diff --git a/src/assets/svg/topology_ic_ganzhifw.svg b/src/assets/svg/topology_ic_ganzhifw.svg new file mode 100644 index 0000000000000000000000000000000000000000..9d1f75758ede69f8da4df86630c6a1ef301f3efd --- /dev/null +++ b/src/assets/svg/topology_ic_ganzhifw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/topology_ic_shikongfw.svg b/src/assets/svg/topology_ic_shikongfw.svg new file mode 100644 index 0000000000000000000000000000000000000000..48a34980bae936a73c52d9639c6097cd11846842 --- /dev/null +++ b/src/assets/svg/topology_ic_shikongfw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/topology_ic_shipinfw.svg b/src/assets/svg/topology_ic_shipinfw.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f386ccae335af89ea436108ab772a16ac5c923a --- /dev/null +++ b/src/assets/svg/topology_ic_shipinfw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/topology_ic_shujufw.svg b/src/assets/svg/topology_ic_shujufw.svg new file mode 100644 index 0000000000000000000000000000000000000000..d33bbe93cac67ea97b1943c6727a5e3646025b57 --- /dev/null +++ b/src/assets/svg/topology_ic_shujufw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/svg/topology_ic_zonghefw.svg b/src/assets/svg/topology_ic_zonghefw.svg new file mode 100644 index 0000000000000000000000000000000000000000..b5b13db0304f4fddd6355f48a635d76620c10d39 --- /dev/null +++ b/src/assets/svg/topology_ic_zonghefw.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/shop-cloud/shop-cloud.vue b/src/components/shop-cloud/shop-cloud.vue index f1d0f41574ed81c6c7ce2588b607251ddfd3b183..29bf92c783102b4a71e164a5009c2dfec6b1f5b4 100644 --- a/src/components/shop-cloud/shop-cloud.vue +++ b/src/components/shop-cloud/shop-cloud.vue @@ -139,7 +139,7 @@
业务系统名: - {{ cloudData.workplace }} + {{ cloudData.system_name }} 资源申请时间: {{ cloudData.apply_time }}
@@ -291,7 +291,6 @@ export default { data() { return { id: "", - userId: "", url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", helper, @@ -456,7 +455,14 @@ export default { now_user: "", activeName: null, tabShow: true, - cloudData: {}, + cloudData: { + namespace: "", + workplace: "", + user_name: "", + phone: "", + apply_time: "", + system_name: "" + }, cloudDteail: { containers: "", cpu: "", @@ -504,14 +510,38 @@ export default { } }, mounted() { + this.getUrlQuery(); this.getCloudDetail(); }, methods: { + getUrlQuery() { + this.apply_id = this.$route.query.apply_id || ""; + this.user_id = this.$route.query.user_id || ""; + this.apply_type = this.$route.query.apply_type || 0; + this.use_uid = this.$route.query.use_uid || ""; + this.id = this.$route.query.id || ""; + if (this.use_uid != "") { + this.getCloudApplication(); + } + }, getUrl() { return this.$route.path.substring(0, 9); }, + getCloudApplication() { + this.$api.workbench + .getCloudApplication({ namespace: this.cloudData.namespace }) + .then(response => { + if (response.data.success == 1) { + this.appList = response.data.data; + } else { + console.log(response.data.errMsg); + } + }); + }, download() {}, - adjustment() {}, + adjustment() { + this.$router.push("/shop/cloud"); + }, distribution() { this.$api.workbench .setCloudAllocation({ id: this.id, userId: this.user_id }) @@ -530,9 +560,74 @@ export default { } }); }, - refuse() {}, - pass() {}, - deleteItem() {}, + refuse() { + let query = { + applyId: this.apply_id, + applyState: -1, + applyType: this.apply_type, + applyCloudId: this.id, + namespace: this.cloudData.namespace + }; + this.$api.workbench.setCloudApproval(query).then(response => { + if (response.data.success == 1) { + this.$message({ + message: "申请已拒绝", + type: "success" + }); + this.$router.push(this.getUrl()); + } else { + this.$message({ + message: "申请拒绝失败", + type: "error" + }); + } + }); + }, + pass() { + let query = { + applyId: this.apply_id, + applyState: 1, + applyType: this.apply_type, + applyCloudId: this.id, + namespace: this.cloudData.namespace + }; + this.$api.workbench.setCloudApproval(query).then(response => { + if (response.data.success == 1) { + this.$message({ + message: "申请已通过", + type: "success" + }); + this.$router.push(this.getUrl()); + } else { + this.$message({ + message: "申请通过失败", + type: "error" + }); + } + }); + }, + deleteItem() { + this.$api.workbench + .deleteCloud({ + id: this.id, + namespace: this.cloudData.namespace, + useUid: this.use_uid + }) + .then(response => { + if (response.data.success == 1) { + this.$message({ + message: "该资源已删除", + type: "success" + }); + this.$router.push(this.getUrl()); + } else { + this.$message({ + message: "资源删除失败", + type: "error" + }); + } + }); + }, getCurrentUser() { this.$api.user.getNowUser().then(({ data }) => { if (data.success == 1) { @@ -547,6 +642,7 @@ export default { this.$refs.allotConfirm.getDetail(this.apply_id); }, clickTab() {}, + // 根据列表参数来判断显示什么 setListWithRole() { if (this.now_user == 0) { // 普通用户 @@ -594,9 +690,9 @@ export default { }, getCloudDetail() { let query = { - type: 0, - applyId: 13, - id: 25 + type: this.apply_type, + applyId: this.apply_id, + id: this.id }; this.$api.workbench.getCloudDetail(query).then(response => { let data = response.data.data; @@ -633,7 +729,6 @@ export default { (count.containers_total / count.containers_use) * 100 ); } - // this.appList = this.cloudDteail.containers = data.containers; this.cloudDteail.cpu = data.cpu; this.cloudDteail.disk = data.disk; @@ -654,6 +749,12 @@ export default { this.cloudDteail.adjust_one_memory_min = data.adjust_one_memory_min; this.apploy_msg.first_level = data.first_level; this.apploy_msg.second_level = data.second_level; + this.cloudData.namespace = data.namespace; + this.cloudData.workplace = data.workplace; + this.cloudData.user_name = data.user_name; + this.cloudData.phone = data.phone; + this.cloudData.apply_time = data.apply_time; + this.cloudData.system_name = data.system_name; this.setListWithRole(); }); } diff --git a/src/pages/workbench/fwgl/serviceDetail.vue b/src/pages/workbench/fwgl/serviceDetail.vue index 86ab272b86cdcdef8bc0995b4fbc3246db8cb225..84b2cb6bd52ef6b9e6649bdf863968211939c04d 100644 --- a/src/pages/workbench/fwgl/serviceDetail.vue +++ b/src/pages/workbench/fwgl/serviceDetail.vue @@ -501,13 +501,9 @@ export default { }); }, getData() { - let url = "./static/antv.json"; - this.$http - .get(url) - .then(response => { - this.datas = response.data.elements; - }) - .catch(function(response) {}); + this.$api.workbench.getServiceTopology().then(response => { + this.datas = response.data.elements; + }); }, getServiceInfo() { this.$http diff --git a/src/pages/workbench/yygl/deploy_app_detail.vue b/src/pages/workbench/yygl/deploy_app_detail.vue index f3587a91788704d1d222769f5b05eb4e309bd696..b434b75d4c99a8d1303626308220309ea51f627f 100644 --- a/src/pages/workbench/yygl/deploy_app_detail.vue +++ b/src/pages/workbench/yygl/deploy_app_detail.vue @@ -181,20 +181,38 @@ :key="index + 6000" >{{ item.name }} -