From c1bba811b99d7125f2f8a4394a3cd77312a531f7 Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Tue, 13 Aug 2024 18:01:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=AE=9E=E6=96=BD/=E5=BD=92=E6=A1=A3=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E8=A1=A8=E6=A0=BC=E9=AB=98=E5=BA=A6,?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=BD=92=E6=A1=A3=E9=99=84=E4=BB=B6/?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E6=97=B6=E7=9A=84=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SearchFilesByTag.vue | 31 +++- src/components/TagAndFileUpload.vue | 2 +- .../project-management/filing/upload.vue | 169 ++++++++++++------ .../implementation/attachment.vue | 26 ++- .../implementation/upload.vue | 28 ++- 5 files changed, 188 insertions(+), 68 deletions(-) diff --git a/src/components/SearchFilesByTag.vue b/src/components/SearchFilesByTag.vue index 3ae67af..a6730f6 100644 --- a/src/components/SearchFilesByTag.vue +++ b/src/components/SearchFilesByTag.vue @@ -2,7 +2,7 @@
- + @@ -21,13 +21,15 @@ - +
@@ -35,7 +37,7 @@ import {downloadFile} from "@/api/project-demand"; import {ElNotification} from "element-plus"; import {getTags} from "@/api/project-manage"; -import {computed} from "vue"; +import {computed, ref} from "vue"; const route = useRoute() const router = useRouter() @@ -71,8 +73,10 @@ const tableConfig = reactive({ }, { prop: 'originalFileName', - label: '附件名称', + label: '文件名', align: 'center', + currentRender: ({row, index}) => (
clickToPreview(row)}>{row.originalFileName}
) + }, { prop: 'tag', @@ -114,6 +118,23 @@ const _value = computed({ emit('update:modelValue', value) } }) +const filePreviewParam = ref({ + fileUrl: '', + fileName: '', + fileType: 'pdf' +}) +const filePreviewShow = ref(false) +const clickToPreview=(row)=>{ + filePreviewShow.value = false + filePreviewParam.value = { + fileUrl: row.url, + fileName: row.originalFileName, + fileType: row.fileType + } + nextTick(()=>{ + filePreviewShow.value = true + }) +} const getTagsOption = () => { if (!route.query.id) return getTags(route.query.id).then(res => { @@ -172,6 +193,6 @@ onActivated(()=>{ diff --git a/src/components/TagAndFileUpload.vue b/src/components/TagAndFileUpload.vue index fbf5b64..fde2db7 100644 --- a/src/components/TagAndFileUpload.vue +++ b/src/components/TagAndFileUpload.vue @@ -59,7 +59,7 @@ const tableConfig = reactive({ }, { prop: 'originalFileName', - label: '附件名称', + label: '文件名', align: 'center', }, { diff --git a/src/views/project-management/filing/upload.vue b/src/views/project-management/filing/upload.vue index c80ca53..2eb7ff3 100644 --- a/src/views/project-management/filing/upload.vue +++ b/src/views/project-management/filing/upload.vue @@ -1,21 +1,24 @@ - diff --git a/src/views/project-management/implementation/attachment.vue b/src/views/project-management/implementation/attachment.vue index a86c2e6..a38ce58 100644 --- a/src/views/project-management/implementation/attachment.vue +++ b/src/views/project-management/implementation/attachment.vue @@ -19,14 +19,14 @@ 上传附件 - - - + @@ -250,7 +250,7 @@ const schema = computed(() => { const baseForm = ref() const tagsOption = ref([]) -const tableConfig = reactive({ +const implementationAttachmentTableConfig = reactive({ columns: [ { prop: 'index', @@ -263,6 +263,7 @@ const tableConfig = reactive({ prop: 'originalFileName', label: '文件名', align: 'center', + currentRender: ({row, index}) => (
clickToPreview(row)}>{row.originalFileName}
) }, { prop: 'tag', @@ -292,6 +293,23 @@ const tableConfig = reactive({ }) const showTable = ref(true) const otherFileList = ref([]) +const filePreviewParam = ref({ + fileUrl: '', + fileName: '', + fileType: 'pdf' +}) +const filePreviewShow = ref(false) +const clickToPreview=(row)=>{ + filePreviewShow.value = false + filePreviewParam.value = { + fileUrl: row.url, + fileName: row.originalFileName, + fileType: row.fileType + } + nextTick(()=>{ + filePreviewShow.value = true + }) +} //匹配字典值,返回对应值的字典标签 const filterDict = (data, value) => { if (data === undefined || value === undefined) return; diff --git a/src/views/project-management/implementation/upload.vue b/src/views/project-management/implementation/upload.vue index 539a4fd..631138c 100644 --- a/src/views/project-management/implementation/upload.vue +++ b/src/views/project-management/implementation/upload.vue @@ -20,7 +20,7 @@ - @@ -266,8 +268,10 @@ const tableConfig = reactive({ }, { prop: 'originalFileName', - label: '附件名称', + label: '文件名', align: 'center', + currentRender: ({row, index}) => (
clickToPreview(row)}>{row.originalFileName}
) + }, { prop: 'tag', @@ -290,7 +294,6 @@ const tableConfig = reactive({
handleDownload(row)}>下载 handleDelete(row)}/>
) @@ -304,6 +307,23 @@ const name = ref(router.currentRoute.value.name) const rules = reactive({ tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}], }) +const filePreviewParam = ref({ + fileUrl: '', + fileName: '', + fileType: 'pdf' +}) +const filePreviewShow = ref(false) +const clickToPreview=(row)=>{ + filePreviewShow.value = false + filePreviewParam.value = { + fileUrl: row.url, + fileName: row.originalFileName, + fileType: row.fileType + } + nextTick(()=>{ + filePreviewShow.value = true + }) +} onActivated(() => { console.log('onActivated') formData.value.tagName = ''; @@ -476,7 +496,7 @@ getTagsOption()