From 38f7bce772a741daac9e9db953f3ab8810146995 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Sun, 7 Apr 2024 16:03:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86/\APP?= =?UTF-8?q?=E5=8D=87=E7=BA=A7/=E5=AE=89=E8=A3=85=E5=8C=85=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=AE=A1=E7=90=86=20---=20=E6=96=B0=E5=A2=9E=EF=BC=9A?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFile/src/UploadFile.vue | 8 +++--- .../system/systemInstallPackage/index.vue | 15 +++++++++++ .../systemInstallPackage.data.ts | 27 ++++++++++++++++++- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index ed92c4c18..1f8b90948 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -129,11 +129,11 @@ const excelUploadError: UploadProps['onError'] = (): void => { } // 删除上传文件 const handleRemove = (file) => { - const findex = fileList.value.map((f) => f.name).indexOf(file.name) - if (findex > -1) { - fileList.value.splice(findex, 1) + // const findex = fileList.value.map((f) => f.name).indexOf(file.name) + // if (findex > -1) { + // fileList.value.splice(findex, 1) emit('update:modelValue', listToString(fileList.value)) - } + // } } const handlePreview: UploadProps['onPreview'] = (uploadFile) => { console.log(uploadFile) diff --git a/src/views/system/systemInstallPackage/index.vue b/src/views/system/systemInstallPackage/index.vue index f6b9543ac..e6475b35e 100644 --- a/src/views/system/systemInstallPackage/index.vue +++ b/src/views/system/systemInstallPackage/index.vue @@ -41,6 +41,13 @@ { /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => { + if('create'==type){ + const currentTime = new Date().getTime() + const fileId = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='fileId') + fileId['value'] = currentTime + const uploadFile = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='uploadFile') + uploadFile['componentProps']['upData']['tableId'] = currentTime + } basicFormRef.value.open(type, row) } // form表单提交 const formsSuccess = async (formType,data) => { if (formType === 'create') { + delete data['uploadFile'] await SystemInstallPackageApi.createSystemInstallPackage(data) message.success(t('common.createSuccess')) } else { diff --git a/src/views/system/systemInstallPackage/systemInstallPackage.data.ts b/src/views/system/systemInstallPackage/systemInstallPackage.data.ts index 148027b7b..580aadb6d 100644 --- a/src/views/system/systemInstallPackage/systemInstallPackage.data.ts +++ b/src/views/system/systemInstallPackage/systemInstallPackage.data.ts @@ -25,6 +25,11 @@ export const SystemInstallPackage = useCrudSchemas(reactive([ label: '安装路径', field: 'installPackageUrl', sort: 'custom', + form: { + componentProps: { + disabled: true + }, + } }, { label: '是否强制更新', @@ -53,14 +58,34 @@ export const SystemInstallPackage = useCrudSchemas(reactive([ { label: '附件id', field: 'fileId', - isForm:false, sort: 'custom', + form: { + componentProps: { + disabled: true + }, + value:'', + } }, { label: '备注', field: 'remark', sort: 'custom', }, + { + label: '上传附件', + field: 'uploadFile', + sort: 'custom', + form: { + component: 'UploadFile', + componentProps: { + upData:{ + tableId: '', + tableName: '' + }, + limit:1 + } + }, + }, { label: '创建时间', field: 'createTime',