From 54ff700b559f0c77260b4882393dae3e75a3e86c Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Mon, 8 Apr 2024 08:23:58 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/inspectionMethod/index.ts | 1 + src/components/UploadFile/src/UploadFile.vue | 12 ++++ src/views/qms/inspectionMethod/index.vue | 59 +++++++++++++++---- .../inspectionMethod/inspectionMethod.data.ts | 35 ++++++++++- 4 files changed, 96 insertions(+), 11 deletions(-) diff --git a/src/api/qms/inspectionMethod/index.ts b/src/api/qms/inspectionMethod/index.ts index dae6cc6bc..5721037b9 100644 --- a/src/api/qms/inspectionMethod/index.ts +++ b/src/api/qms/inspectionMethod/index.ts @@ -33,6 +33,7 @@ export const createInspectionMethod = async (data: InspectionMethodVO) => { // 修改检验方法 export const updateInspectionMethod = async (data: InspectionMethodVO) => { + // debugger return await request.put({ url: `/qms/inspection-method/update`, data }) } diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index 1f8b90948..36fed8b4b 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -137,6 +137,7 @@ const handleRemove = (file) => { } const handlePreview: UploadProps['onPreview'] = (uploadFile) => { console.log(uploadFile) + window.open(uploadFile.url) } // 对象转成指定字符串分隔 const listToString = (list: UploadUserFile[], separator?: string) => { @@ -147,6 +148,17 @@ const listToString = (list: UploadUserFile[], separator?: string) => { } return strs != '' ? strs.substr(0, strs.length - 1) : '' } +watch( + () => props.modelValue, + (data) => { + if (!data) return + fileList.value = data + }, + { + deep: true, + immediate: true + } +)