From 901e98c660ec19a05f50eab8468c39dadf14fbb0 Mon Sep 17 00:00:00 2001 From: liudianxin Date: Wed, 8 Jul 2020 16:05:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/e-charts/dashboard.vue | 6 +- src/pages/data-analysis/my-service.vue | 3 +- src/pages/workbench/fwgl/cloud-detail.vue | 91 +++++++++++++++++------ src/request/api/workbench.js | 2 +- 4 files changed, 74 insertions(+), 28 deletions(-) diff --git a/src/components/e-charts/dashboard.vue b/src/components/e-charts/dashboard.vue index 90721f3..a871b61 100644 --- a/src/components/e-charts/dashboard.vue +++ b/src/components/e-charts/dashboard.vue @@ -9,8 +9,10 @@ export default { data: { type: Object, default: () => { - data = 40; - text = "模拟数据1.0"; + return { + data: 40, + text: "模拟数据1.0" + }; } }, dangerousValue: { diff --git a/src/pages/data-analysis/my-service.vue b/src/pages/data-analysis/my-service.vue index 783d00c..995fb39 100644 --- a/src/pages/data-analysis/my-service.vue +++ b/src/pages/data-analysis/my-service.vue @@ -130,7 +130,8 @@ export default { .in_analysis { padding: 0 10px 10px; height: 100%; - /* min-width: 1700px; */ + width: 100%; + min-width: 1700px; } .in_l { } diff --git a/src/pages/workbench/fwgl/cloud-detail.vue b/src/pages/workbench/fwgl/cloud-detail.vue index cc28238..f1b4d43 100644 --- a/src/pages/workbench/fwgl/cloud-detail.vue +++ b/src/pages/workbench/fwgl/cloud-detail.vue @@ -12,29 +12,31 @@
-
aPaaS V3.0
+
{{ cloudData.workplace }}

申请用户: - 张三 + {{ cloudData.user_name }} 联系电话: - 12345678901 + {{ cloudData.phone }} 资源申请状态: 审批通过 + v-if="cloudData.first_level == 0" + class="head_right_msg_item apply_success" + >待审批 + 待审批 + 待审批

业务系统名: - aPaaS V3.0 一期 + {{ cloudData.workplace }} 资源申请时间: - 2020-02-12 15:54:21 + {{ cloudData.apply_time }}

- + @@ -139,11 +141,11 @@
物理总量 - 1632核 + {{ data1.total }}核
剩余量 - 1632核 + {{ data1.remaining }}核
@@ -154,11 +156,11 @@
物理总量 - 1632核 + {{ data1.total }}GB
剩余量 - 1632核 + {{ data1.remaining }}GB
@@ -169,11 +171,11 @@
物理总量 - 1632核 + {{ data1.total }}GB
剩余量 - 1632核 + {{ data1.remaining }}GB
@@ -184,11 +186,11 @@
物理总量 - 1632核 + {{ data1.total }}
剩余量 - 1632核 + {{ data1.remaining }}
@@ -327,19 +329,27 @@ export default { "当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。", data1: { data: 80, - text: "CPU1已使用" + text: "CPU已使用", + total: 0, + remaining: 0 }, data2: { data: 60, - text: "CPU2已使用" + text: "内存已使用", + total: 0, + remaining: 0 }, data3: { data: 40, - text: "CPU3已使用" + text: "数据盘已使用", + total: 0, + remaining: 0 }, data4: { data: 10, - text: "CPU4已使用" + text: "容器组已使用", + total: 0, + remaining: 0 }, appListHeaders: [ { @@ -399,7 +409,9 @@ export default { } ], now_user: "", - activeName: "0" + activeName: "0", + tabShow: true, + cloudData: {} }; }, watch: {}, @@ -448,17 +460,48 @@ export default { let index = this.list_arr.findIndex( item => item.title == "资源使用情况:" ); - this.list_arr.splice(index); + // this.list_arr.splice(index); + // this.tabShow = false; } else if (this.now_user == 1) { + this.tabShow = true; } else if (this.now_user == 2) { } }, getCloudDetail() { let query = { type: 0, - applyId: 13 + applyId: 13, + id: 25 }; this.$api.workbench.getCloudDetail(query).then(response => { + let data = response.data.data; + this.list_arr[3].info = helper.downloadFileFormat(data.apply_file); // application file name + this.list_arr[3].url = data.apply_file; // application file url + this.list_arr[6].info = data.bgn_time; // get time + this.list_arr[7].info = data.time_remaining; // remaining days + this.list_arr[8].info = data.end_time; // maturity time + this.list_arr_my[0].info = data.first_level_time; // submit application time + this.list_arr_my[1].info = data.second_level_time; // super get time + this.applicationStatus = data.second_leve; // super status + this.desc = data.workplacedesc; // workplace description + let count = data.cloud_resource_count; // resource usage + this.data1.total = count.cpu_total; + this.data1.remaining = count.cpu_total - count.cpu_use; + this.data1.data = Math.round((count.cpu_total / count.cpu_use) * 100); + this.data2.total = count.memory_total; + this.data2.remaining = count.memory_total - count.memory_use; + this.data2.data = Math.round( + (count.memory_total / count.memory_use) * 100 + ); + this.data3.total = count.disk_total; + this.data3.remaining = count.disk_total - count.disk_use; + this.data3.data = Math.round((count.disk_total / count.disk_use) * 100); + this.data4.total = count.containers_total; + this.data4.remaining = count.containers_total - count.containers_use; + this.data4.data = Math.round( + (count.containers_total / count.containers_use) * 100 + ); + // this.appList = }); } } diff --git a/src/request/api/workbench.js b/src/request/api/workbench.js index 9ac5176..3de82d3 100644 --- a/src/request/api/workbench.js +++ b/src/request/api/workbench.js @@ -30,7 +30,7 @@ const workbench = { // get cloud resources details getCloudDetail(params) { - return axios.get(`/apaas/service/v3/resource/user/apply/approvedDetail?type=${params.type}&applyid=${params.applyId}`) + return axios.get(`/apaas/service/v3/resource/user/apply/approvedDetail?type=${params.type}&id=${params.id}&applyid=${params.applyId}`) }, // cloud resource approval setCloudApproval(params) { -- 2.26.0