From b77253b0cbff2b7099cb6d101b99589298f8980b Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Tue, 16 Jul 2024 20:36:06 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=BC=93=E5=AD=98,=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=9B=9E=E6=98=BE,=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83icon?= =?UTF-8?q?=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AttachmentUpload.vue | 59 ++++-- .../DetailComponent/ApprovalDetail.vue | 129 +++++++++++- .../DetailComponent/CollectionDetail.vue | 1 + .../DetailComponent/ProjectApply.vue | 184 ++++++++++++------ src/views/auth/index.vue | 114 +++++++---- src/views/plan/detail.vue | 6 +- .../project-demand/requirement/detail.vue | 2 +- src/views/project-demand/summary/add.vue | 4 +- src/views/project-demand/summary/detail.vue | 2 + src/views/project-demand/summary/index.vue | 3 +- .../implementation/detail.vue | 7 +- .../implementation/phase.vue | 4 +- .../mobledetail/ProjectApplyMoblie.vue | 2 +- 13 files changed, 389 insertions(+), 128 deletions(-) diff --git a/src/components/AttachmentUpload.vue b/src/components/AttachmentUpload.vue index 66dcef4..e5fe14f 100644 --- a/src/components/AttachmentUpload.vue +++ b/src/components/AttachmentUpload.vue @@ -5,7 +5,7 @@ - {{ singleFile ? singleFile?.originalFileName : formData.singleFile?.originalFileName }} + {{ singleFile ? singleFile?.originalFileName : formData.singleFile?.originalFileName?formData.singleFile?.originalFileName:_singleFileValue[0]?.originalFileName }} 删除 @@ -16,10 +16,7 @@ :disabled="isSingleFile" ref="fileUploadRef"/> - - - + :data="_singleFileValue" :isSettingCol="false" :pagination="false"> @@ -27,14 +24,12 @@ - - @@ -46,6 +41,7 @@ import FileUpload from '@/components/FileUpload.vue' import {deleteFile, downloadFile} from "@/api/project-demand"; import {ElMessageBox, ElNotification} from "element-plus"; + const props = defineProps({ showFileList: { type: Boolean, @@ -88,7 +84,7 @@ const props = defineProps({ default: '' } }) -const emit = defineEmits(["getAttachment", "getOtherFile"]) +const emit = defineEmits(["getAttachment", "getOtherFile","update:singleList"]) const tableConfig = reactive({ columns: [ { @@ -223,14 +219,36 @@ const isSingleFile = ref(false) const allFileList = ref([]) const deleteFileVal = ref({}) const singleFileList = ref([]) -// if (props.formData.fileList !== null && props.formData.fileList?.length > 0) { -// allFileList.value = props.formData.fileList -// } +if(localStorage.getItem('singleFile')){ + singleFile.value = JSON.parse(localStorage.getItem('singleFile')) +} +const _singleFileValue = computed({ + get() { + return props.singleList; + }, + set(value) { + emit('update:singleList', value) + } +}) + +console.log('_singleFileValue',_singleFileValue.value) +const _otherFileListValue = computed({ + get() { + return props.otherFileList; + }, + set(value) { + emit('update:otherFileList', value) + } +}) +if(_otherFileListValue.value&&_otherFileListValue.value.length>0){ + _otherFileListValue.value.forEach(item=>{ + allFileList.value.push(item) + }) +} watch(() => props.showSingleTable, (newVal) => { props.showSingleTable = newVal }, {deep: true}) watch(() => props.formData.fileList, (newVal) => { - // console.log('newVal-fileList', newVal) if (props.preview) { newVal?.forEach(item => { allFileList.value.push(item) @@ -256,18 +274,21 @@ watch(() => props.formData.fileList, (newVal) => { watch(() => props.showTable, (newVal) => { props.showTable = newVal }, {deep: true}) -watch(() => props.singleList, (newVal) => { - // console.log('singleFile', newVal) - singleFileList.value = newVal -}, {deep: true}) +// watch(() => props.singleList, (newVal) => { +// console.log('singleFile', newVal) +// singleFileList.value = newVal +// }, {deep: true}) watch(() => props.formData.singleFile, (newVal) => { - // console.log('singleFile', newVal) + console.log('singleFile', newVal) singleFile.value = newVal props.formData.singleFile=newVal }, {deep: true}) watch(() => isSingleFile.value, (newVal) => { isSingleFile.value = newVal }, {deep: true}) +watch(() => singleFile.value, (newVal) => { + singleFile.value = newVal +}, {deep: true}) const handleDelete = (row, type) => { deleteFile(row.fileId).then(res => { ElNotification({ @@ -277,7 +298,7 @@ const handleDelete = (row, type) => { }) if (res.code === 1000) { if (type === 'single') { - singleFileList.value.splice(singleFileList.value.findIndex((item) => item.fileId === row.fileId), 1); + _singleFileValue.value.splice(_singleFileValue.value.findIndex((item) => item.fileId === row.fileId), 1); isSingleFile.value = false } else { allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1); @@ -311,7 +332,7 @@ const getOtherFile = (val) => { if (props.preview) { allFileList.value.push(compositeParam(val)) } else { - allFileList.value = props.otherFileList + allFileList.value = _otherFileListValue.value } emit('getOtherFile', val) } diff --git a/src/components/DetailComponent/ApprovalDetail.vue b/src/components/DetailComponent/ApprovalDetail.vue index ead1bad..5067649 100644 --- a/src/components/DetailComponent/ApprovalDetail.vue +++ b/src/components/DetailComponent/ApprovalDetail.vue @@ -1,5 +1,33 @@ + + + + + + + + + + + + 搜索 + + + + + + + + + + form = e"> @@ -42,9 +70,58 @@