This commit is contained in:
Leo_Ding 2026-02-10 13:56:17 +08:00
parent 3d79b2101d
commit 2264c268eb
7 changed files with 26 additions and 16 deletions

View File

@ -12,7 +12,7 @@ VITE_ROUTER_BASE=/
VITE_ROUTER_HISTORY=hash
# api
VITE_API_BASIC=http://10.10.1.33:8040
VITE_API_BASIC=http://10.10.1.11:8040
VITE_API_BASIC_IMG=http://36.133.78.46:8040
VITE_API_HTTP=/api/v1/
# storage

View File

@ -3,7 +3,7 @@ export default () => ({
port: 8080,
proxy: {
'/api': {
target: 'http://10.10.1.33:8040/api',
target: 'http://10.10.1.11:8040/api',
// target: 'http://127.0.0.1:8045/api',
changeOrigin: true,
rewrite: (path) => path.replace('/api', ''),

View File

@ -35,7 +35,7 @@
:size="size" row-key="id" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="'contractContent' === column.dataIndex">
<a-image :width="100" :height="100" :src="config('http.apiBasic')+record.contractContent" />
<a-image :width="100" :height="100" :src="config('http.apiBasicImg')+record.contractContent" />
</template>
<template v-if="'action' === column.key">
<x-action-button @click="handleReview(record)">上传合同</x-action-button>

View File

@ -19,15 +19,20 @@
<a-form-item :label="'是否推荐到首页'" name="is_recommend">
<a-radio-group v-model:value="formData.is_recommend" :options="[
{ label: '是', value: true },
{ label:'否', value: false },
{ label: '否', value: false },
]"></a-radio-group>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'跳转链接'" name="link_url">
<a-input v-model:value="formData.link_url"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item :label="'图片类型'" name="type">
<a-radio-group v-model:value="formData.type" :options="[
{ label: '轮播图片', value: '1'},
{ label: '营销图片', value: '2'},
{ label: '轮播图片', value: '1' },
{ label: '营销图片', value: '2' },
]"></a-radio-group>
</a-form-item>
</a-col>
@ -38,7 +43,7 @@
</a-col>
<a-col :span="24">
<a-form-item :label="'上传图片'" name="permissions">
<GxUpload :fileNumber="1" />
<GxUpload :fileNumber="1" v-model="formData.fileList" />
</a-form-item>
</a-col>
</a-row>
@ -55,6 +60,7 @@ import { config } from '@/config'
import apis from '@/apis'
import { useForm, useModal } from '@/hooks'
import GxUpload from '@/components/GxUpload/index.vue'
import {spliceUrl} from '@/utils/util.js'
const emit = defineEmits(['ok'])
import { useI18n } from 'vue-i18n'
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
@ -95,20 +101,22 @@ async function handleEdit(record = {}) {
hideModal()
return
}
formRecord.value = data
formData.value = cloneDeep(data)
formData.value.fileList = [config('http.apiBasicImg') + data.image_url]
}
/**
* 确定
*/
function handleOk() {
if (formData.value.fileList === undefined || formData.value.fileList.length == 0) {
return message.error('请上传签章图片')
}
formRef.value
.validateFields()
.then(async (values) => {
try {
showLoading()
const params = { ...values }
const params = { ...formData.value, image_url: spliceUrl(formData.value.fileList[0]) }
let result = null
switch (modal.value.type) {
case 'create':

View File

@ -33,7 +33,7 @@
</a-button>
</x-action-bar>
<a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState"
:scroll="{ x: 1000 }" @change="onTableChange">
:scroll="{ x: 1000 }" @change="onTableChange" bordered>
<template #bodyCell="{ column, record }">
<template v-if="'type' === column.key">
<!--状态-->
@ -102,12 +102,12 @@ defineOptions({
})
const { t } = useI18n() // t
const columns = [
{ title: '缩略图', dataIndex: 'code', width: 200 },
// { title: '', dataIndex: 'code', width: 200 },
{ title: '名称', dataIndex: 'name', width: 150 },
{ title: '类型', dataIndex: 'type', key: 'type', width: 150 },
{ title: t('pages.system.role.form.created_at'), key: 'createAt', fixed: 'right', width: 120 },
{ title: t('pages.system.role.form.created_at'), key: 'createAt', width: 120 },
{ title: '是否启用', key: 'is_recommend', fixed: 'is_recommend', width: 120 },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 60 },
]
const { listData, loading, showLoading, hideLoading, paginationState, searchFormData, resetPagination } =

View File

@ -114,6 +114,7 @@ function handleOk() {
showLoading()
const params = {
...values,
order: Number(values.order),
imgUrl: spliceUrl(formData.value.fileList[0])
}
let result = null

View File

@ -38,7 +38,7 @@
</a-button>
</x-action-bar>
<a-table :columns="columns" :data-source="listData" :loading="loading" :pagination="paginationState"
:scroll="{ x: 1000 }" @change="onTableChange">
:scroll="{ x: 1000 }" @change="onTableChange" bordered>
<template #bodyCell="{ column, record }">
<template v-if="'is_recommend' === column.key">
<!--状态-->
@ -106,7 +106,8 @@ const columns = [
width: 150,
customRender: ({ text }) => (text ? '是' : '否'),
},
{ title: '图片地址', key: 'imgUrl', dataIndex: 'imgUrl', width: 160, customRender: ({ text }) => (text ? config('http.apiBasicImg') + text : '') },
{ title: '排序', key: 'order', dataIndex: 'order', width: 60 },
// { title: '', key: 'imgUrl', dataIndex: 'imgUrl', width: 160, customRender: ({ text }) => (text ? config('http.apiBasicImg') + text : '') },
{ title: '创建时间', key: 'createAt', dataIndex: 'created_at', width: 180 },
{ title: '页面地址', key: 'pageUrl', dataIndex: 'pageUrl', width: 160 },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },