From cf08358e3b09900d97d84d8bdd5677e11179cf69 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 22 Mar 2024 11:12:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Descriptions/src/Descriptions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Descriptions/src/Descriptions.vue b/src/components/Descriptions/src/Descriptions.vue index 0c3cd20..03f57be 100644 --- a/src/components/Descriptions/src/Descriptions.vue +++ b/src/components/Descriptions/src/Descriptions.vue @@ -15,7 +15,7 @@ const mobile = computed(() => appStore.getMobile) const attrs = useAttrs() const slots = useSlots() -const height = ref('200px') +const height = ref('83px') const isShow = ref(false) @@ -73,7 +73,7 @@ const toggleClick = () => { } const showAll = () =>{ if(isShow.value){ - height.value ='200px' + height.value ='83px' }else{ height.value ='auto' } From f11419776141fb6de9b1fac2c4d5e2baae7521f7 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 22 Mar 2024 11:35:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E6=98=93=E6=8D=9F?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=8D=A2=E6=8C=87=E5=AF=BC=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFile/src/UploadImg.vue | 1 + src/views/eam/device/problemSolving/index.vue | 11 ----------- src/views/eam/item/replaceItemDes/index.vue | 11 +++++++++-- .../item/replaceItemDes/replaceItemDes.data.ts | 17 ++++++++++++++++- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/components/UploadFile/src/UploadImg.vue b/src/components/UploadFile/src/UploadImg.vue index 31571e2..11b71a9 100644 --- a/src/components/UploadFile/src/UploadImg.vue +++ b/src/components/UploadFile/src/UploadImg.vue @@ -84,6 +84,7 @@ const props = defineProps({ width: propTypes.string.def('150px'), // 组件宽度 ==> 非必传(默认为 150px) borderradius: propTypes.string.def('8px') // 组件边框圆角 ==> 非必传(默认为 8px) }) +debugger const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 // 生成组件唯一id diff --git a/src/views/eam/device/problemSolving/index.vue b/src/views/eam/device/problemSolving/index.vue index bc88d44..6b6570a 100644 --- a/src/views/eam/device/problemSolving/index.vue +++ b/src/views/eam/device/problemSolving/index.vue @@ -176,17 +176,6 @@ const openForm = (type: string, row?: any) => { // form表单提交 const formsSuccess = async (formType, data) => { - var isHave = ProblemSolving.allSchemas.formSchema.some(function (item) { - return item.field === 'activeTime' || item.field === 'expireTime' - }) - if (isHave) { - if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) { - message.error('失效时间要大于生效时间') - return - } - } - if (data.activeTime == 0) data.activeTime = null - if (data.expireTime == 0) data.expireTime = null data.filePathList = [] for (let i = 0; i < data.filePathListView.length; i++) { data.filePathList.push(data.filePathListView[i].url) diff --git a/src/views/eam/item/replaceItemDes/index.vue b/src/views/eam/item/replaceItemDes/index.vue index 0cdbad3..e92eda1 100644 --- a/src/views/eam/item/replaceItemDes/index.vue +++ b/src/views/eam/item/replaceItemDes/index.vue @@ -124,13 +124,20 @@ /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type : string, row ?: any) => { + if (row&&row.filePathList && row.filePathList.length > 0) { + row.filePathListView = row.filePathList.map((item) => { + return { + name: item, + url: item + } + }) + } basicFormRef.value.open(type, row) } // form表单提交 const formsSuccess = async (formType, data) => { - if (data.expireTime == 0) data.expireTime = null; - data.filePathList = data.filePathList.map(item=>item.url) + data.filePathList = data.filePathListView.map(item=>item.url) if (formType === 'create') { await ReplaceItemDesApi.createReplaceItemDes(data) message.success(t('common.createSuccess')) diff --git a/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts b/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts index d74e5c9..050d569 100644 --- a/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts +++ b/src/views/eam/item/replaceItemDes/replaceItemDes.data.ts @@ -7,7 +7,7 @@ import * as ItemApi from '@/api/eam/basic/item' // 表单校验 export const ReplaceItemDesRules = reactive({ number: [required], - filePathList: [required], + filePathListView: [required], }) export const ReplaceItemDes = useCrudSchemas(reactive([ @@ -34,16 +34,31 @@ export const ReplaceItemDes = useCrudSchemas(reactive([ } } }, + { + label: '文件', + field: 'filePathListView', + sort: 'custom', + isTable: false, + table: { + }, + form: { + component: 'UploadFile', + componentProps: { + } + } + }, { label: '文件', field: 'filePathList', sort: 'custom', isTable: false, + isForm: false, table: { }, form: { component: 'UploadFile', componentProps: { + } } },