From a9388ff09fa933cdaa816726dfd9882d9627d22b Mon Sep 17 00:00:00 2001 From: xuyiming Date: Wed, 24 Jun 2020 17:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=9E=84=E5=BB=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/workbench/app_build.vue | 57 ++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/src/pages/workbench/app_build.vue b/src/pages/workbench/app_build.vue index 9194a89..1f259b3 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) => { -- 2.26.0