Commit c8b7d2e9 authored by 张俊's avatar 张俊

Merge branch 'dev' of cloud.wodcloud.com:apaas/apaas-v3-ui into dev

parents 223cb2d2 901e98c6
...@@ -7,35 +7,55 @@ import { graphic } from "echarts/lib/export"; ...@@ -7,35 +7,55 @@ import { graphic } from "echarts/lib/export";
export default { export default {
props: { props: {
data: { data: {
type: Array, type: Object,
default: () => [] default: () => {
return {
data: 40,
text: "模拟数据1.0"
};
}
},
dangerousValue: {
type: String,
default: ""
} }
}, },
data: () => ({ data: () => ({
navList: [], navList: []
}), }),
mounted() { mounted() {},
},
methods: { methods: {
dashboard() { dashboard() {
let self = this; let self = this;
return { return {
title: { title: [
text: "20%", {
subtext: "sssss", text: self.data.data + "{a|%}",
x: "center", x: "center",
y: "center", y: "center",
textStyle: { textStyle: {
fontSize: 26, fontSize: 36,
fontWeight: "normal", fontWeight: "lighter",
color: ["#67828c"] color: ["#67828c"],
rich: {
a: {
fontSize: 14,
padding: [0, 0, 4, 0]
}
}
}
}, },
subtextStyle: { {
color: "#67828c", text: self.data.text,
fontSize: 16, x: "center",
align: "center" y: "58%",
textStyle: {
fontSize: 12,
fontWeight: "normal",
color: "#707693"
}
} }
}, ],
angleAxis: { angleAxis: {
axisLine: { axisLine: {
show: false show: false
...@@ -73,7 +93,7 @@ export default { ...@@ -73,7 +93,7 @@ export default {
series: [ series: [
{ {
type: "bar", type: "bar",
data: [, 40], data: [, self.data.data],
coordinateSystem: "polar", coordinateSystem: "polar",
barMaxWidth: 10, barMaxWidth: 10,
z: 1, z: 1,
...@@ -81,10 +101,18 @@ export default { ...@@ -81,10 +101,18 @@ export default {
roundCap: true, roundCap: true,
itemStyle: { itemStyle: {
normal: { normal: {
color: new graphic.LinearGradient(0, 0, 0, 1, [ color:
{ offset: 0, color: "#25bdb1" }, self.dangerousValue == "high"
{ offset: 1, color: "#e7fdfc" } ? self.data.data >= 80
]) ? "#e15260"
: "#515fe7"
: self.data.data > 75
? "#00cfc6"
: self.data.data > 50
? "#54cefd"
: self.data.data > 25
? "#54cefd"
: "#25bdb1"
} }
}, },
barGap: "-100%" barGap: "-100%"
...@@ -126,7 +154,7 @@ export default { ...@@ -126,7 +154,7 @@ export default {
show: true, show: true,
splitNumber: 5, splitNumber: 5,
lineStyle: { lineStyle: {
color: "#a9aec0", color: "#c9cee0",
width: 1 width: 1
}, },
length: 4 length: 4
...@@ -135,7 +163,7 @@ export default { ...@@ -135,7 +163,7 @@ export default {
show: true, show: true,
length: 6, length: 6,
lineStyle: { lineStyle: {
color: "#a9aec0" color: "#c9cee0"
} }
}, //分隔线样式 }, //分隔线样式
detail: { detail: {
...@@ -160,7 +188,7 @@ export default { ...@@ -160,7 +188,7 @@ export default {
} }
}, },
data: [, 40] data: [, self.data.data]
} }
] ]
}; };
......
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
}, },
url: { type: String, default: "" }, url: { type: String, default: "" },
name: { type: String, default: "" }, name: { type: String, default: "" },
filterNmaes: { filterNames: {
type: Array, type: Array,
default: () => { default: () => {
[]; [];
...@@ -251,12 +251,19 @@ export default { ...@@ -251,12 +251,19 @@ export default {
} }
] ]
}); });
} else {
this.$set(this.filterLists, 0, {
id: 110,
name: "",
prop: "",
childDomains: []
});
} }
this.getShopFilter(); this.getShopFilter();
} }
} }
}, },
filterNmaes: { filterNames: {
handler(val) { handler(val) {
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
this.filterLists[i + 1].name = val[i]; this.filterLists[i + 1].name = val[i];
......
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
:stripe="true" :stripe="true"
:datas="dataDiskList" :datas="dataDiskList"
@primary-del="delItem" @primary-del="delItem"
height="300" height="260"
></table-um> ></table-um>
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
default-expand-all default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
ref="cesTable" ref="cesTable"
class="table_scoller"
:class="radius ? 'table_radius' : ''" :class="radius ? 'table_radius' : ''"
:header-cell-class-name="headerCellClassName" :header-cell-class-name="headerCellClassName"
v-cloak v-cloak
...@@ -853,6 +854,25 @@ em { ...@@ -853,6 +854,25 @@ em {
border: 0; border: 0;
padding: 0; padding: 0;
} }
.table_scoller .el-table__body-wrapper::-webkit-scrollbar {
/*滚动条整体样式*/
width: 16px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
.table_scoller .el-table__body-wrapper::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 8px;
/* background: #dde4ff; */
box-shadow: 8px 0 0 #bcc1d0 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
.table_scoller .el-table__body-wrapper::-webkit-scrollbar-track {
/*滚动条里面轨道*/
border-radius: 8px;
/* background: #f4f4f4; */
box-shadow: 8px 0 0 #f8f8f8 inset;
border: 4px solid rgba(0, 0, 0, 0);
}
</style> </style>
<style scoped> <style scoped>
.ces-table { .ces-table {
......
...@@ -43,7 +43,8 @@ export default { ...@@ -43,7 +43,8 @@ export default {
</script> </script>
<style scoped> <style scoped>
.href { .href {
color: #264dd9 !important; color: #0f2683;
font-weight: 700;
cursor: pointer; cursor: pointer;
} }
</style> </style>
\ No newline at end of file
...@@ -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 {
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<service-shop-menu></service-shop-menu> <service-shop-menu></service-shop-menu>
</el-aside> </el-aside>
<el-main> <el-main>
<service-list :filterNmaes="filterNmaes" :name="name" :url="url" :urlFilter="urlFilter"></service-list> <service-list :filterNames="filterNames" :name="name" :url="url" :urlFilter="urlFilter"></service-list>
</el-main> </el-main>
</el-container> </el-container>
</div> </div>
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
urlFilter: "", urlFilter: "",
url: "", url: "",
name: "", name: "",
filterNmaes: [] filterNames: []
}), }),
mounted() { mounted() {
this.getVal(this.$route.path); this.getVal(this.$route.path);
...@@ -37,43 +37,43 @@ export default { ...@@ -37,43 +37,43 @@ export default {
this.name = "数据服务"; this.name = "数据服务";
this.urlFilter = "5"; this.urlFilter = "5";
this.url = "/shop/sjfwDetail"; this.url = "/shop/sjfwDetail";
this.filterNmaes = ["数据服务类型", "数据领域", "数据来源机构"]; this.filterNames = ["数据服务类型", "数据领域", "数据来源机构"];
break; break;
case "space_time_service_list": case "space_time_service_list":
this.name = "时空服务"; this.name = "时空服务";
this.urlFilter = "6"; this.urlFilter = "6";
this.url = "/shop/skfwDetail"; this.url = "/shop/skfwDetail";
this.filterNmaes = ["数据服务类型", "数据领域", "数据来源机构"]; this.filterNames = ["时空服务类型", "应用领域", "服务来源组织"];
break; break;
case "video_service_list": case "video_service_list":
this.name = "视频服务"; this.name = "视频服务";
this.urlFilter = "7"; this.urlFilter = "7";
this.url = ""; this.url = "";
this.filterNmaes = []; this.filterNames = [];
break; break;
case "perception_service_list": case "perception_service_list":
this.name = "感知服务"; this.name = "感知服务";
this.urlFilter = "10"; this.urlFilter = "10";
this.url = ""; this.url = "";
this.filterNmaes = []; this.filterNames = [];
break; break;
case "comprehensive_app_list": case "comprehensive_app_list":
this.name = "综合服务"; this.name = "综合服务";
this.urlFilter = "21"; this.urlFilter = "21";
this.url = "/shop/zhfwDetail"; this.url = "/shop/zhfwDetail";
this.filterNmaes = ["数据服务类型", "数据领域", "数据来源机构"]; this.filterNames = ["服务类型", "应用领域", "服务来源组织"];
break; break;
case "app_store_list": case "app_store_list":
this.name = "应用商店"; this.name = "应用商店";
this.urlFilter = "app"; this.urlFilter = "app";
this.url = "/shop/yysdDetail"; this.url = "/shop/yysdDetail";
this.filterNmaes = ["应用类型", "应用领域", "应用来源机构"]; this.filterNames = ["应用类型", "应用领域", "应用来源机构"];
break; break;
default: default:
this.name = ""; this.name = "";
this.urlFilter = ""; this.urlFilter = "";
this.url = ""; this.url = "";
this.filterNmaes = []; this.filterNames = [];
break; break;
} }
} }
......
...@@ -12,32 +12,82 @@ ...@@ -12,32 +12,82 @@
<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>
<div class="cloud_params"> <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="1"></el-tab-pane>
</el-tabs>
<div v-if="activeName=='0'" class="cloud_params">
<InfoList @download="download" :list_arr="list_arr" class="detail_s_val"> <InfoList @download="download" :list_arr="list_arr" class="detail_s_val">
<div ref="ApplyParams" slot="ApplyParams" class="params_block"> <div ref="ApplyParams" slot="ApplyParams" class="params_block">
<span class="params_block_title">申请规格:</span> <span class="params_block_title">工作区域:</span>
<div class="params_block_item">
<div class="params_block_item_in">
<span class="params_block_item_title">CPU:</span>
<span class="params_block_item_val">{{ orderDetail.cpu }}</span>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">内存:</span>
<span class="params_block_item_val">{{ orderDetail.memory }}GB</span>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">容器组:</span>
<span class="params_block_item_val">{{ orderDetail.memory }}</span>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">数据盘:</span>
<div class="params_block_item_val">
<div>{{ orderDetail.disk_num}}块,每块{{orderDetail.disk_cap }}GB</div>
</div>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">申请时长:</span>
<span class="params_block_item_val">{{ orderDetail.memory }}</span>
</div>
</div>
<span class="params_block_title margin_top_20">单个容器组规格:</span>
<div class="params_block_item">
<div class="params_block_item_in">
<span class="params_block_item_title">CPU:</span>
<div class="params_block_item_val">
<span class="val_has_2">最高&nbsp;{{ orderDetail.one_cpu_max }}</span>
<span class="val_has_2">默认&nbsp;{{ orderDetail.one_cpu_min }}</span>
</div>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">CPU:</span>
<div class="params_block_item_val">
<span class="val_has_2">最高&nbsp;{{ orderDetail.one_memory_max }}</span>
<span class="val_has_2">默认&nbsp;{{ orderDetail.one_memory_min }}</span>
</div>
</div>
</div>
</div>
<div ref="ApplyBeforeParams" slot="ApplyBeforeParams" class="params_block">
<span class="params_block_title">工作区域:</span>
<div class="params_block_item"> <div class="params_block_item">
<div class="params_block_item_in"> <div class="params_block_item_in">
<span class="params_block_item_title">CPU:</span> <span class="params_block_item_title">CPU:</span>
...@@ -53,9 +103,13 @@ ...@@ -53,9 +103,13 @@
</div> </div>
<div class="params_block_item_in"> <div class="params_block_item_in">
<span class="params_block_item_title">数据盘:</span> <span class="params_block_item_title">数据盘:</span>
<span <div class="params_block_item_val">
class="params_block_item_val" <div>{{ orderDetail.disk_num}}块,每块{{orderDetail.disk_cap }}GB</div>
>{{ orderDetail.disk_num}}块,每块{{orderDetail.disk_cap }}GB</span> </div>
</div>
<div class="params_block_item_in">
<span class="params_block_item_title">续期时长:</span>
<span class="params_block_item_val">{{ orderDetail.memory }}</span>
</div> </div>
</div> </div>
<span class="params_block_title margin_top_20">单个容器组规格:</span> <span class="params_block_title margin_top_20">单个容器组规格:</span>
...@@ -76,12 +130,101 @@ ...@@ -76,12 +130,101 @@
</div> </div>
</div> </div>
</div> </div>
<div ref="ApplyDesc" slot="ApplyDesc"> <div ref="ApplyDesc" slot="ApplyDesc" class="params_apply_desc">{{ desc }}</div>
{{ desc }} <div ref="ResourceOverview" slot="ResourceOverview" class="params_resource_overview">
{{ resourceOverview }}
<el-row class="params_charts">
<el-col :span="6" class="params_col">
<div class="params_chart">
<dashboard ref="chart_1" :data="data1" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}</span>
</div>
</div>
</el-col>
<el-col :span="6" class="params_col">
<div class="params_chart">
<dashboard ref="chart_2" :data="data2" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}GB</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}GB</span>
</div>
</div>
</el-col>
<el-col :span="6" class="params_col">
<div class="params_chart">
<dashboard ref="chart_3" :data="data3" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}GB</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}GB</span>
</div>
</div>
</el-col>
<el-col :span="6" class="params_col">
<div class="params_chart">
<dashboard ref="chart_4" :data="data4" dangerousValue="high"></dashboard>
</div>
<div class="params_chart_msg">
<div class="params_chart_msg_item">
物理总量
<span>{{ data1.total }}</span>
</div>
<div class="params_chart_msg_item">
剩余量
<span>{{ data1.remaining }}</span>
</div>
</div>
</el-col>
</el-row>
</div>
<div ref="AppList" slot="AppList">
<table-um
ref="AppListTable"
:headers="appListHeaders"
:stripe="true"
:datas="appList"
height="260"
detailsUrl
></table-um>
</div> </div>
</InfoList> </InfoList>
</div> </div>
<div v-if="activeName == '1'" class="my_params">
<InfoList :list_arr="list_arr_my" class="detail_s_val">
<div
ref="ApplicationStatus"
slot="ApplicationStatus"
class="params_apply_desc"
>{{ applicationStatus }}</div>
</InfoList>
</div>
<div class="btn_footer">
<el-button class="submit" @click="submit">提交资源申请</el-button>
<el-button class="adjustment" @click="adjustment">资源调整</el-button>
<el-button class="adjustment" @click="distribution">分配</el-button>
<el-button class="refuse" @click="refuse">拒绝</el-button>
</div>
</BlockRadius> </BlockRadius>
<AllotInfoConfirm ref="allotConfirm"></AllotInfoConfirm>
</div> </div>
</template> </template>
...@@ -89,10 +232,17 @@ ...@@ -89,10 +232,17 @@
import BlockRadius from "@/components/general/block-radius"; import BlockRadius from "@/components/general/block-radius";
import InfoList from "@/components/infoList"; import InfoList from "@/components/infoList";
import helper from "@/services/helper.js"; import helper from "@/services/helper.js";
import Dashboard from "@/components/e-charts/dashboard";
import TableUm from "@/components/table/table-um";
import { mapGetters, mapState } from "vuex";
import AllotInfoConfirm from "@/components/allot-info-confirm";
export default { export default {
components: { components: {
BlockRadius, BlockRadius,
InfoList InfoList,
Dashboard,
TableUm,
AllotInfoConfirm
}, },
data() { data() {
return { return {
...@@ -110,6 +260,11 @@ export default { ...@@ -110,6 +260,11 @@ export default {
type: "solt", type: "solt",
solt_name: "ApplyParams" solt_name: "ApplyParams"
}, },
{
title: "审批通过后工作区域规格:",
type: "solt",
solt_name: "ApplyParams"
},
{ {
title: "资源申请文件:", title: "资源申请文件:",
info: "2222222222222222222222.docs", info: "2222222222222222222222.docs",
...@@ -119,23 +274,236 @@ export default { ...@@ -119,23 +274,236 @@ export default {
{ {
title: "工作区域描述:", title: "工作区域描述:",
type: "solt", type: "solt",
solt_name: "ApplyDesc", solt_name: "ApplyDesc"
},
{
title: "资源使用情况:",
prop: "title"
},
{
title: "获取时间:",
info: "2020-06-02 15:54:21"
},
{
title: "剩余使用天数:",
info: "1000天"
},
{
title: "到期时间:",
info: "2020-06-02 15:54:21"
},
{
title: "资源使用概况:",
type: "solt",
solt_name: "ResourceOverview"
},
{
title: "已部署应用列表:",
prop: "title"
},
{
title: "",
type: "solt",
solt_name: "AppList"
}
],
list_arr_my: [
{
title: "提交申请时间:",
info: "2020-06-02 15:54:21"
},
{
title: "获取时间:",
info: "2020-06-02 15:54:21"
},
{
title: "申请状态:",
type: "solt",
solt_name: "ApplicationStatus"
}
],
applicationStatus: "申请通过",
desc:
"工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:",
resourceOverview:
"当您觉得使用空间不足时,可以选择至服务超市-云资源服务页面的升级现有工作区域来完成配置扩容操作。",
data1: {
data: 80,
text: "CPU已使用",
total: 0,
remaining: 0
},
data2: {
data: 60,
text: "内存已使用",
total: 0,
remaining: 0
},
data3: {
data: 40,
text: "数据盘已使用",
total: 0,
remaining: 0
},
data4: {
data: 10,
text: "容器组已使用",
total: 0,
remaining: 0
},
appListHeaders: [
{
label: "应用名称",
prop: "app_name",
align: "center",
type: "href"
},
{
label: "应用类型",
prop: "app_name",
align: "center"
},
{
label: "应用版本号",
prop: "app_name",
align: "center"
},
{
label: "应用部署时间",
prop: "app_name",
align: "center"
}
],
appList: [
{
id: "123",
app_name: "单文件啊"
},
{
id: "1223",
app_name: "单文件啊"
},
{
id: "1313",
app_name: "单文件啊"
},
{
id: "124563",
app_name: "单文件啊"
},
{
id: "126783",
app_name: "单文件啊"
},
{
id: "1225673",
app_name: "单文件啊"
},
{
id: "13134563",
app_name: "单文件啊"
},
{
id: "12234563",
app_name: "单文件啊"
} }
], ],
desc: "工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:工作区域描述:" now_user: "",
activeName: "0",
tabShow: true,
cloudData: {}
}; };
}, },
watch: {}, watch: {},
computed: {}, computed: {
created() {}, ...mapGetters(["level"]),
...mapState(["userInfo"])
},
created() {
if (this.userInfo) {
this.now_user = this.level;
} else {
this.getCurrentUser();
}
},
mounted() { mounted() {
this.getUrl(); this.getUrl();
this.setListWithRole();
this.getCloudDetail();
}, },
methods: { methods: {
getUrl() { getUrl() {
return this.$route.path.substring(0, 9); return this.$route.path.substring(0, 9);
}, },
download() {} download() {},
adjustment() {},
distribution() {},
submit() {},
refuse() {},
getCurrentUser() {
this.$api.user.getNowUser().then(({ data }) => {
if (data.success == 1) {
this.$store.commit("userInfofun", data.data);
this.now_user = this.level;
} else {
console.log(data.errMsg);
}
});
},
submit(item) {
this.$refs.allotConfirm.getDetail(item.apply_id);
},
clickTab() {},
setListWithRole() {
console.log(this.now_user);
if (this.now_user == 0) {
let index = this.list_arr.findIndex(
item => item.title == "资源使用情况:"
);
// 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,
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 =
});
}
} }
}; };
</script> </script>
...@@ -232,4 +600,86 @@ export default { ...@@ -232,4 +600,86 @@ export default {
display: block; display: block;
margin-top: 20px; margin-top: 20px;
} }
.params_apply_desc {
margin: 5px 0;
padding-left: 15px;
line-height: 26px;
}
.params_resource_overview {
margin: 5px 0;
padding-left: 15px;
line-height: 26px;
}
.params_charts {
width: 800px;
height: 200px;
}
.params_col {
height: 100%;
position: relative;
}
.params_chart {
height: 180px;
padding: 0;
}
.params_chart_msg {
width: 120px;
position: absolute;
bottom: 0;
left: 40px;
}
.params_chart_msg_item {
display: flex;
justify-content: space-between;
color: #8890a7;
}
.params_chart_msg_item span {
color: #0d1847;
}
.btn_footer {
text-align: right;
margin: 60px 20px 10px;
position: relative;
}
.submit {
width: 130px;
background-color: #0f2683;
color: #f8f9fd;
position: absolute;
left: 20px;
}
.submit:hover {
background-color: #0f2683;
color: #f8f9fd;
}
.adjustment {
width: 100px;
background-color: #0f2683;
color: #f8f9fd;
}
.adjustment:hover {
background-color: #0f2683;
color: #f8f9fd;
}
.refuse {
width: 100px;
background-color: #e15260;
color: #f8f9fd;
}
.refuse:hover {
background-color: #e15260;
color: #f8f9fd;
}
.val_has_2 {
margin-right: 20px;
}
.my_params p {
padding: 0 15px;
}
</style> </style>
<style>
.params_tabs .el-tabs__header {
margin: 20px 0;
}
</style>
...@@ -27,6 +27,27 @@ const workbench = { ...@@ -27,6 +27,27 @@ const workbench = {
getAppParams(params) { getAppParams(params) {
return axios.get(`/apaas/hubApi/market/values/${params.app_id}`) return axios.get(`/apaas/hubApi/market/values/${params.app_id}`)
}, },
// get cloud resources details
getCloudDetail(params) {
return axios.get(`/apaas/service/v3/resource/user/apply/approvedDetail?type=${params.type}&id=${params.id}&applyid=${params.applyId}`)
},
// cloud resource approval
setCloudApproval(params) {
return axios.put(`/apaas/service/v3/resource/apply/approve?apply_id=${params.applyId}&apply_state=${params.applyState}&apply_type=${params.applyType}&cloud_id=${params.applyCloudId}`, params)
},
// cloud resource allocation
setCloudAllocation(params) {
return axios.put(`/apaas/service/v3/resource/apply/distribution?id=${params.id}&user_id=${params.userId}`)
},
// cloud resource delete
deleteCloud(params) {
return axios.delete(`/apaas/service/v3/resource/apply/remove?id=${params.id}`)
},
// cloud resource disabled
disabledCloud(params) {
return axios.put(`/apaas/service/v3/resource/apply/disable?id=${params.id}&type=${params.type}`)
},
} }
export default workbench; export default workbench;
...@@ -56,7 +56,7 @@ const errorHandle = (status, other) => { ...@@ -56,7 +56,7 @@ const errorHandle = (status, other) => {
} }
// 创建axios实例 // 创建axios实例
var instance = axios.create({ timeout: 1000 * 12 }); var instance = axios.create({ timeout: 1000 * 30 });
// 设置post请求头 // 设置post请求头
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
/** /**
......
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