diff --git a/src/pages/workbench/app_build.vue b/src/pages/workbench/app_build.vue index 9194a89df3b2e93dd3e3f5c0938311645f7716dd..1f259b3a08952ef74570795713b8f6f09e1bb49f 100644 --- a/src/pages/workbench/app_build.vue +++ b/src/pages/workbench/app_build.vue @@ -205,7 +205,7 @@ fit="fill" :list="logo" @getNewList="getNewList" - :directory="hub" + directory="hub" > @@ -260,6 +260,13 @@ + + @@ -268,6 +275,7 @@ import appBuildSteps from "@/components/app-build-steps/app-build-steps"; import appBuildStep from "@/components/app-build-steps/app-build-step"; import apassTable from "@/components/apass-table"; import uploadFile from "@/components/upload_file"; +import apassDialog from "@/components/apass-dialog"; export default { components: { @@ -275,6 +283,7 @@ export default { appBuildStep, apassTable, uploadFile, + apassDialog, }, data: () => ({ step: 0, @@ -337,6 +346,11 @@ export default { orgs: [], logo: [], submitLoading: false, + dialogInfo: { + title: "", + msg: "", + submit: null, + }, }), methods: { preStep() { @@ -417,17 +431,36 @@ export default { }); }, deleteItem(item) { - this.$http - .delete(`/apaas/hubApi/image/del/${item.name}`) - .then((response) => { - // console.log("已删除" + item.name); - this.image_datas = []; - this.image_page = 1; - this.initImageList(); - }) - .catch((error) => { - console.log(error); - }); + this.dialogInfo.title = ""; + this.dialogInfo.msg = "是否删除该镜像?"; + this.dialogInfo.submit = () => { + this.$http + .delete(`/apaas/hubApi/image/del/${item.name}`) + .then((response) => { + if (response.data.success == 1) { + this.$message({ + message: `删除成功`, + type: "success", + }); + this.image_datas = []; + this.image_page = 1; + this.initImageList(); + } else { + this.$message({ + message: `删除失败`, + type: "warning", + }); + } + }) + .catch((error) => { + console.log(error); + this.$message({ + message: `删除失败`, + type: "warning", + }); + }); + }; + this.$refs.dialog.show(); }, goToStep2(formName) { this.$refs[formName].validate((valid) => {