From 288fa545d1ba613070f2fabe572d8c403f65264b Mon Sep 17 00:00:00 2001 From: wyx Date: Sat, 7 Jan 2023 15:57:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=BA=93=E5=85=B1=E4=BA=AB=E6=96=87=E6=A1=A3=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=8F=8A=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/projectcenter/LibraryAdd.vue | 74 +++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/src/views/projectcenter/LibraryAdd.vue b/src/views/projectcenter/LibraryAdd.vue index 2fbc8308..78747701 100644 --- a/src/views/projectcenter/LibraryAdd.vue +++ b/src/views/projectcenter/LibraryAdd.vue @@ -581,7 +581,7 @@ - + +
+ +
+ +
+ +
+ +
+ + +
+
+
+
+
+ {{ item.name }} + 下载 ---> + @@ -974,8 +1003,7 @@ export default defineComponent({ } catch { state.fileList = []; } - state.attachSwitch = - res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false; + state.attachSwitch = res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false; let data = res.data.data.stageList; console.log("data=====", data); for (let i in data) { @@ -1197,6 +1225,35 @@ export default defineComponent({ } }; + // 删除图片按钮 + const deFile = (id) => { + console.log(id); + let index = state.fileList.findIndex((item) => { + item.uid == id; + }); + state.fileList.splice(index, 1); + let str = JSON.stringify(state.fileList); + + api + .templateEdit({ + sourceBelongId: state.projectInfo.sourceBelongId, + projectTemplateId: localStorage.getItem("projectTemplateId"), + attach: str, + }) + .then((res) => { + console.log(res) + message.destroy(); + message.success("删除成功"); + return + }) + .catch((err) => { + console.log(err) + message.destroy(); + message.warning("删除失败"); + return + }); + }; + // 设置上传图片开关 const checkedClose = (data, a) => { console.log(data, a); @@ -1299,6 +1356,7 @@ export default defineComponent({ scoresum, checkedClose, editNotice, + deFile }; }, });