From 412a21c0e2263a4f92bca4ade781d2311919a48b Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 6 Dec 2023 15:28:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 8 +- src/components/Detail/src/TemplateDetails.vue | 241 ++++++++++-------- src/components/UploadFile/src/Preview.vue | 11 + src/views/spc/detectiontemplate/index.vue | 4 +- .../templateItemDetails.data.ts | 72 ++++-- 5 files changed, 208 insertions(+), 128 deletions(-) create mode 100644 src/components/UploadFile/src/Preview.vue diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index a39623d..7050f3f 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -1,5 +1,5 @@ diff --git a/src/components/UploadFile/src/Preview.vue b/src/components/UploadFile/src/Preview.vue new file mode 100644 index 0000000..db78c27 --- /dev/null +++ b/src/components/UploadFile/src/Preview.vue @@ -0,0 +1,11 @@ + + + diff --git a/src/views/spc/detectiontemplate/index.vue b/src/views/spc/detectiontemplate/index.vue index a67e34b..75a8742 100644 --- a/src/views/spc/detectiontemplate/index.vue +++ b/src/views/spc/detectiontemplate/index.vue @@ -63,6 +63,7 @@ :apiPage="TemplateItemDetailsApi.getTemplateItemDetailsPage" :apiDelete="TemplateItemDetailsApi.deleteTemplateItemDetails" :Echo="Echo" + width="60%" @searchTableSuccessDetail="searchTableSuccessDetail" /> @@ -107,7 +108,8 @@ const { tableObject, tableMethods } = useTable({ }) // 获得表格的各种操作 -const { getList, setSearchParams } = tableMethods +const {getList, setSearchParams } = tableMethods + // 列表头部按钮 const HeadButttondata = [ diff --git a/src/views/spc/detectiontemplate/templateItemDetails.data.ts b/src/views/spc/detectiontemplate/templateItemDetails.data.ts index d47e531..b6eddfa 100644 --- a/src/views/spc/detectiontemplate/templateItemDetails.data.ts +++ b/src/views/spc/detectiontemplate/templateItemDetails.data.ts @@ -107,34 +107,54 @@ export const TemplateItemDetails = useCrudSchemas(reactive([ isSearch: false, isTable:false, form:{ - component:'UploadImg', + component:'UploadFile', + componentProps:{ + fileType:['image/jpeg', 'image/png', 'image/gif','video/mp4','video/webm'], + fileSize:20, + limit:1, + upData:{ + tableId:0,tableName:"detection_template_item_details" + }, + modelValue:[] + } + } + }, + { + label: '工具图', + field: 'image2', + sort: 'custom', + isSearch: false, + isTable:false, + form:{ + component:'UploadFile', + componentProps:{ + fileType:['image/jpeg', 'image/png', 'image/gif','video/mp4','video/webm'], + fileSize:20, + limit:1, + upData:{ + tableId:0,tableName:"detection_template_item_details" + } + } + } + }, + { + label: '操作指导书', + field: 'image3', + sort: 'custom', + isSearch: false, + isTable:false, + form:{ + component:'UploadFile', + componentProps:{ + fileType:['image/jpeg', 'image/png', 'image/gif','video/mp4','video/webm'], + fileSize:20, + limit:1, + upData:{ + tableId:0,tableName:"detection_template_item_details" + } + } } }, - // { - // label: '工具图', - // field: 'image2', - // sort: 'custom', - // isSearch: false, - // isTable:false, - // form:{ - // component:'UploadImg', - // componentProps:{ - // upData:{ - // tabelId:1,tableName:"detection" - // } - // } - // } - // }, - // { - // label: '操作指导书', - // field: 'image3', - // sort: 'custom', - // isSearch: false, - // isTable:false, - // form:{ - // component:'UploadImg', - // } - // }, { label: '创建时间', field: 'createTime', From 1c0214c1f823de2084494c9c85c1cec304f5c133 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 6 Dec 2023 15:29:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFile/src/UploadFile.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index 4067be5..a12b07b 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -8,10 +8,11 @@ v-model:file-list="fileList" :show-file-list="true" :auto-upload="autoUpload" - :action="updateUrl+'?tableId='+upData?.tableId+'&tableName='+ upData?.tableName" + :action="updateUrl + '?tableId=' + upData?.tableId + '&tableName=' + upData?.tableName" :headers="uploadHeaders" :limit="props.limit" :drag="drag" + :accept="fileType.join(',')" :before-upload="beforeUpload" :on-exceed="handleExceed" :on-success="handleFileSuccess" @@ -26,8 +27,9 @@ 大小不超过 {{ fileSize }}MB
- 格式为 {{ fileType.join('/') }} 的文件 + 格式为 {{ fileType.join(',') }} 的文件
+