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' } 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: { + } } },