diff --git a/src/pages/workbench/yygl/yyglList.vue b/src/pages/workbench/yygl/yyglList.vue index 212030b70bffeb9b34cb65127ef9c0222781c403..4c28199bb5b31b39fbeee47da0874eca00ebe520 100644 --- a/src/pages/workbench/yygl/yyglList.vue +++ b/src/pages/workbench/yygl/yyglList.vue @@ -78,12 +78,16 @@ export default { detailsUrl() { let url = ""; - if (this.level == 0 && this.type == 0) { + if (this.type == 0) { url = `/yygl/${this.level}/${this.type}/detail/`; - } else if (this.level == 0 && this.type == 1) { - url = `/yygl/${this.level}/${this.type}/approvaldetail/`; + } else if (this.type == 1) { + url = `/yygl/${this.level}/${this.type}/deploydetail/`; } else { - url = `/yygl/${this.level}/${this.type}/detail/`; + if (this.level === 0) { + url = `/yygl/${this.level}/${this.type}/applydetail/`; + } else { + url = `/yygl/${this.level}/${this.type}/approvaldetail/`; + } } return url; @@ -568,15 +572,15 @@ export default { actionList: [ { label: "编辑", - callback: _self.editItem + callback: _self.editItem, }, { label: "下线", - callback: _self.offLine + callback: _self.offLine, }, { label: "删除", - callback: _self.deleteItem + callback: _self.deleteItem, }, ], }, @@ -818,6 +822,9 @@ export default { console.log(error); }); }, + showDialog() { + this.$refs.dialog.show(); + }, // 唤醒弹窗 deleteAction(item) { if (this.cardType === 0) { if (item.online_state == 0) { @@ -943,13 +950,73 @@ export default { console.log("delete --- " + item.id); }, detailItem(item) { - this.$router.push(`${this.detailsUrl + item.app_id}`); + this.$router.push( + `${this.detailsUrl + (this.type === 1 ? item.deploy_id : item.app.id)}` + ); }, soldUpItem(item) { - console.log(`上架${item.app_name}`); + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = "确认上架此服务吗?"; + this.dialogInfo.submit = () => { + console.log(`上架${item.app_name}`); + /* this.$http + .post(`/apaas/service/v3/service/manager/up`, { + id: item.id, + }) + .then(({ data }) => { + if (data.success) { + this.$message({ + message: data.errMsg, + type: "success", + }); + this.init(this.tempFliter); + } else { + this.$message({ + message: data.errMsg, + type: "warning", + }); + } + }) + .catch((error) => { + this.$message({ + message: `上架${item.name}失败.`, + type: "warning", + }); + }); */ + }; + this.showDialog(); }, soldOutItem(item) { - console.log(`下架${item.app_name}`); + this.dialogInfo.title = "提示"; + this.dialogInfo.msg = "确认下架此服务吗?"; + this.dialogInfo.submit = () => { + console.log(`下架${item.app_name}`); + /* this.$http + .post(`/apaas/service/v3/service/manager/up`, { + id: item.id, + }) + .then(({ data }) => { + if (data.success) { + this.$message({ + message: data.errMsg, + type: "success", + }); + this.init(this.tempFliter); + } else { + this.$message({ + message: data.errMsg, + type: "warning", + }); + } + }) + .catch((error) => { + this.$message({ + message: `下架${item.name}失败.`, + type: "warning", + }); + }); */ + }; + this.showDialog(); }, editItem(item) { this.$router.push(`/yygl/${this.level}/${this.type}/edit/${item.id}`);