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
};
},
});