From 2a72de08a42793df8e01c123681b5303543d8fea Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Tue, 14 May 2024 22:16:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat=20:=20=E9=A1=B9=E7=9B=AE=E7=AB=8B?= =?UTF-8?q?=E9=A1=B9=E7=94=B3=E8=AF=B7=E9=A1=B5=E9=9D=A2=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileUpload.vue | 11 +- src/views/project-demand/collection/add.vue | 57 +++++---- .../project-management/initiation/apply.vue | 117 +++++++++++++++++- 3 files changed, 153 insertions(+), 32 deletions(-) diff --git a/src/components/FileUpload.vue b/src/components/FileUpload.vue index 2992a8f..a08f25b 100644 --- a/src/components/FileUpload.vue +++ b/src/components/FileUpload.vue @@ -6,10 +6,11 @@ with-credentials :multiple="maxSize > 0" :data="uploadParams" - :show-file-list="false" + :show-file-list="showFileList" :auto-upload="true" :before-upload="beforeUpload" :on-success="handleUploadSuccess" + :on-error="uploadError" > 上传文件 @@ -37,6 +38,10 @@ const props = defineProps({ maxSize: { type: Number, default: 30 + }, + showFileList: { + type: Boolean, + default: false } }) @@ -77,6 +82,10 @@ const handleUploadSuccess = (res, file) => { fileList.value.push(data) emit("getFile", fileList.value) } +const uploadError=(err)=>{ + loading.value = false + ElMessage.error("上传失败,请稍后再试!") +} diff --git a/src/views/project-demand/collection/add.vue b/src/views/project-demand/collection/add.vue index b73264d..a449ece 100644 --- a/src/views/project-demand/collection/add.vue +++ b/src/views/project-demand/collection/add.vue @@ -33,10 +33,12 @@ - + - + @@ -136,27 +138,27 @@ const tableConfig = reactive({ return (
下载 - beforeRemove(row)}>删除 + handleDelete(row)}>删除
) } } ] }) -const compositeParam=(item)=>{ - return { - fileId: item.id, - size: item.size, - originalFileName: item.originalFilename, - fileType: item.fileType, - url: item.url, - processNodeTag: null, - tag: formData.value.collectType, - userId: authStore.userinfo.userId - } +const compositeParam = (item) => { + return { + fileId: item.id, + size: item.size, + originalFileName: item.originalFilename, + fileType: item.fileType, + url: item.url, + processNodeTag: null, + tag: formData.value.collectType, + userId: authStore.userinfo.userId + } } const getFile = (val) => { - console.log('上传文件',val) + console.log('上传文件', val) showTable.value = false nextTick(() => { showTable.value = true @@ -165,14 +167,14 @@ const getFile = (val) => { let newFileArray = [] if (route.query.isAdd === undefined) { val.forEach(item => { - fileObj =compositeParam(item) + fileObj = compositeParam(item) newFileArray.push(fileObj) formData.value.fileList.push(fileObj) }) fileList.value = formData.value.fileList } else { val.forEach(item => { - fileObj =compositeParam(item) + fileObj = compositeParam(item) newFileArray.push(fileObj) }) formData.value.fileList = newFileArray @@ -241,7 +243,6 @@ const handleResubmit = () => { const getDetailInfo = async () => { getFormInfo(route.query.id).then(res => { if (res.code === 1000) { - console.log(res) ElMessage.success(res.msg) formData.value = res.data showTinymce.value = false @@ -257,26 +258,23 @@ const getDetailInfo = async () => { const handleBack = () => { history.back() } -const beforeRemove = (row) => { +const handleDelete = (row) => { ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的表格吗?`, '系统提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - handleRemove(row) + deleteFile(row.fileId).then(res => { + if (res.code === 1000) { + ElMessage.success("删除成功"); + fileList.value.splice(fileList.value.findIndex((item) => item.id === row.id), 1); + } + }); }).catch(() => { ElMessage.warning("用户取消删除! "); }) } -const handleRemove = (row) => { - deleteFile(row.fileId).then(res => { - if (res.code === 1000) { - ElMessage.success("删除成功"); - fileList.value.splice(fileList.value.findIndex((item) => item.id === row.id), 1); - } - }); -}; onMounted(async () => { loading.value = true await init() @@ -292,9 +290,10 @@ onMounted(async () => { diff --git a/src/views/project-management/implementation/detail.vue b/src/views/project-management/implementation/detail.vue new file mode 100644 index 0000000..386dc31 --- /dev/null +++ b/src/views/project-management/implementation/detail.vue @@ -0,0 +1,49 @@ + + + + + diff --git a/src/views/project-management/implementation/index.vue b/src/views/project-management/implementation/index.vue index 9c8ed39..433f00c 100644 --- a/src/views/project-management/implementation/index.vue +++ b/src/views/project-management/implementation/index.vue @@ -1,15 +1,195 @@ - - - From 9ae0b7547cf7ed522a9dd6e0a58ef9eb342d3e18 Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Wed, 15 May 2024 00:18:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat=20:=20=E9=A1=B9=E7=9B=AE=E7=AB=8B?= =?UTF-8?q?=E9=A1=B9=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project-management/initiation/detail.vue | 44 +++++++++++++++++-- .../project-management/initiation/edit.vue | 12 ----- .../project-management/initiation/index.vue | 4 +- 3 files changed, 42 insertions(+), 18 deletions(-) delete mode 100644 src/views/project-management/initiation/edit.vue diff --git a/src/views/project-management/initiation/detail.vue b/src/views/project-management/initiation/detail.vue index 8ad911c..aeebf62 100644 --- a/src/views/project-management/initiation/detail.vue +++ b/src/views/project-management/initiation/detail.vue @@ -1,12 +1,48 @@ - diff --git a/src/views/project-management/initiation/edit.vue b/src/views/project-management/initiation/edit.vue deleted file mode 100644 index 94125ec..0000000 --- a/src/views/project-management/initiation/edit.vue +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/src/views/project-management/initiation/index.vue b/src/views/project-management/initiation/index.vue index c7c865f..c47dcbc 100644 --- a/src/views/project-management/initiation/index.vue +++ b/src/views/project-management/initiation/index.vue @@ -129,7 +129,7 @@ const tableConfig = reactive({ }, { prop: 'status', - label: '发布状态', + label: '状态', align: 'center', showOverflowTooltip: false, currentRender: ({row, index}) => () @@ -165,7 +165,7 @@ const tableConfig = reactive({ } } ], - api: '/workflow/mosr/requirement', + api: '', params: {}, }) From 08579c8aadb801e42e202d071a33ad0cb38d6e7f Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Wed, 15 May 2024 09:48:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8D=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E5=BE=81=E9=9B=86=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileUpload.vue | 2 +- src/views/project-demand/collection/add.vue | 70 +++++++++------------ 2 files changed, 30 insertions(+), 42 deletions(-) diff --git a/src/components/FileUpload.vue b/src/components/FileUpload.vue index a08f25b..76a8939 100644 --- a/src/components/FileUpload.vue +++ b/src/components/FileUpload.vue @@ -80,7 +80,7 @@ const handleUploadSuccess = (res, file) => { showTable.value = true let data = res.data fileList.value.push(data) - emit("getFile", fileList.value) + emit("getFile", res.data) } const uploadError=(err)=>{ loading.value = false diff --git a/src/views/project-demand/collection/add.vue b/src/views/project-demand/collection/add.vue index a449ece..faa33f5 100644 --- a/src/views/project-demand/collection/add.vue +++ b/src/views/project-demand/collection/add.vue @@ -36,7 +36,7 @@ - +