Commit 901e98c6 authored by 刘殿昕's avatar 刘殿昕

fix仪表盘报错

parent 3e1d8217
...@@ -9,8 +9,10 @@ export default { ...@@ -9,8 +9,10 @@ export default {
data: { data: {
type: Object, type: Object,
default: () => { default: () => {
data = 40; return {
text = "模拟数据1.0"; data: 40,
text: "模拟数据1.0"
};
} }
}, },
dangerousValue: { dangerousValue: {
......
...@@ -130,7 +130,8 @@ export default { ...@@ -130,7 +130,8 @@ export default {
.in_analysis { .in_analysis {
padding: 0 10px 10px; padding: 0 10px 10px;
height: 100%; height: 100%;
/* min-width: 1700px; */ width: 100%;
min-width: 1700px;
} }
.in_l { .in_l {
} }
......
...@@ -12,29 +12,31 @@ ...@@ -12,29 +12,31 @@
<el-image class="head_left_img" :src="url" fit="fill"></el-image> <el-image class="head_left_img" :src="url" fit="fill"></el-image>
</div> </div>
<div class="head_right"> <div class="head_right">
<div class="head_right_name">aPaaS V3.0</div> <div class="head_right_name">{{ cloudData.workplace }}</div>
<div class="head_right_msg"> <div class="head_right_msg">
<p class="head_right_msg_p"> <p class="head_right_msg_p">
申请用户: 申请用户:
<span class="head_right_msg_item">张三</span> <span class="head_right_msg_item">{{ cloudData.user_name }}</span>
联系电话: 联系电话:
<span class="head_right_msg_item">12345678901</span> <span class="head_right_msg_item">{{ cloudData.phone }}</span>
资源申请状态: 资源申请状态:
<span <span
class="head_right_msg_item" v-if="cloudData.first_level == 0"
:class="true ? 'apply_success' : ''" class="head_right_msg_item apply_success"
>审批通过</span> >待审批</span>
<span v-if="cloudData.first_level == 0" class="head_right_msg_item apply_success">待审批</span>
<span v-if="cloudData.first_level == 0" class="head_right_msg_item apply_success">待审批</span>
</p> </p>
<p class="head_right_msg_p"> <p class="head_right_msg_p">
业务系统名: 业务系统名:
<span class="head_right_msg_item">aPaaS V3.0 一期</span> <span class="head_right_msg_item">{{ cloudData.workplace }}</span>
资源申请时间: 资源申请时间:
<span class="head_right_msg_item">2020-02-12 15:54:21</span> <span class="head_right_msg_item">{{ cloudData.apply_time }}</span>
</p> </p>
</div> </div>
</div> </div>
</div> </div>
<el-tabs v-model="activeName" class="params_tabs" @tab-click="clickTab"> <el-tabs v-if="tabShow" v-model="activeName" class="params_tabs" @tab-click="clickTab">
<el-tab-pane label="用户申请信息" name="0"></el-tab-pane> <el-tab-pane label="用户申请信息" name="0"></el-tab-pane>
<el-tab-pane label="我的申请信息" name="1"></el-tab-pane> <el-tab-pane label="我的申请信息" name="1"></el-tab-pane>
</el-tabs> </el-tabs>
...@@ -139,11 +141,11 @@ ...@@ -139,11 +141,11 @@
<div class="params_chart_msg"> <div class="params_chart_msg">
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
物理总量 物理总量
<span>1632</span> <span>{{ data1.total }}</span>
</div> </div>
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
剩余量 剩余量
<span>1632</span> <span>{{ data1.remaining }}</span>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -154,11 +156,11 @@ ...@@ -154,11 +156,11 @@
<div class="params_chart_msg"> <div class="params_chart_msg">
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
物理总量 物理总量
<span>1632核</span> <span>{{ data1.total }}GB</span>
</div> </div>
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
剩余量 剩余量
<span>1632核</span> <span>{{ data1.remaining }}GB</span>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -169,11 +171,11 @@ ...@@ -169,11 +171,11 @@
<div class="params_chart_msg"> <div class="params_chart_msg">
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
物理总量 物理总量
<span>1632核</span> <span>{{ data1.total }}GB</span>
</div> </div>
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
剩余量 剩余量
<span>1632核</span> <span>{{ data1.remaining }}GB</span>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -184,11 +186,11 @@ ...@@ -184,11 +186,11 @@
<div class="params_chart_msg"> <div class="params_chart_msg">
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
物理总量 物理总量
<span>1632核</span> <span>{{ data1.total }}</span>
</div> </div>
<div class="params_chart_msg_item"> <div class="params_chart_msg_item">
剩余量 剩余量
<span>1632核</span> <span>{{ data1.remaining }}</span>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -327,19 +329,27 @@ export default { ...@@ -327,19 +329,27 @@ export default {
"当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。", "当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。",
data1: { data1: {
data: 80, data: 80,
text: "CPU1已使用" text: "CPU已使用",
total: 0,
remaining: 0
}, },
data2: { data2: {
data: 60, data: 60,
text: "CPU2已使用" text: "内存已使用",
total: 0,
remaining: 0
}, },
data3: { data3: {
data: 40, data: 40,
text: "CPU3已使用" text: "数据盘已使用",
total: 0,
remaining: 0
}, },
data4: { data4: {
data: 10, data: 10,
text: "CPU4已使用" text: "容器组已使用",
total: 0,
remaining: 0
}, },
appListHeaders: [ appListHeaders: [
{ {
...@@ -399,7 +409,9 @@ export default { ...@@ -399,7 +409,9 @@ export default {
} }
], ],
now_user: "", now_user: "",
activeName: "0" activeName: "0",
tabShow: true,
cloudData: {}
}; };
}, },
watch: {}, watch: {},
...@@ -448,17 +460,48 @@ export default { ...@@ -448,17 +460,48 @@ export default {
let index = this.list_arr.findIndex( let index = this.list_arr.findIndex(
item => item.title == "资源使用情况:" item => item.title == "资源使用情况:"
); );
this.list_arr.splice(index); // this.list_arr.splice(index);
// this.tabShow = false;
} else if (this.now_user == 1) { } else if (this.now_user == 1) {
this.tabShow = true;
} else if (this.now_user == 2) { } else if (this.now_user == 2) {
} }
}, },
getCloudDetail() { getCloudDetail() {
let query = { let query = {
type: 0, type: 0,
applyId: 13 applyId: 13,
id: 25
}; };
this.$api.workbench.getCloudDetail(query).then(response => { 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 =
}); });
} }
} }
......
...@@ -30,7 +30,7 @@ const workbench = { ...@@ -30,7 +30,7 @@ const workbench = {
// get cloud resources details // get cloud resources details
getCloudDetail(params) { 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 // cloud resource approval
setCloudApproval(params) { setCloudApproval(params) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment