-
+
-
+
@@ -27,6 +28,10 @@ export default {
type: String,
default: 0,
},
+ hideDelete: {
+ type: Boolean,
+ default: false,
+ },
},
data: () => ({
rowNum: 5,
diff --git a/src/pages/workbench/fwgl/fwglList.vue b/src/pages/workbench/fwgl/fwglList.vue
index fcfc79eb1452336fb0045a99596fd4cdceaa0661..8a4e1d1cd0c03e96d4730433e7a042cbf248c426 100644
--- a/src/pages/workbench/fwgl/fwglList.vue
+++ b/src/pages/workbench/fwgl/fwglList.vue
@@ -18,10 +18,10 @@
-
-
{{ cloud_zuzhi.org_name }}
+
+ {{ userInfo && userInfo.department_name }}
- {{ "在用工作区域:" + (cloud_zuzhi.used_area || 0) + "个" }}
+ {{ "在用工作区域:" + cloud_zuzhi.count_zy + "个" }}
@@ -45,11 +45,49 @@
+
+
+
+ 云资源概览
+
+
+
+
+
+ 物理总量
+
+
+
+ 剩余量
+
+
+
+
+
+
+
+
+
+ 组织概览
+
-
+
+
+
+
-
+
@@ -71,6 +112,7 @@ import apassList from "@/components/apass-list";
import apassDialog from "@/components/apass-dialog";
import allotInfoConfirm from "@/components/allot-info-confirm";
import Dashboard from "@/components/e-charts/dashboard";
+import organizationList from "@/components/organization-list/organization-list";
export default {
components: {
@@ -78,6 +120,7 @@ export default {
apassDialog,
allotInfoConfirm,
Dashboard,
+ organizationList,
},
data: () => ({
level: 0, // 用户等级
@@ -103,6 +146,7 @@ export default {
computed: {
...mapState({
fwglNav: "fwglNav",
+ userInfo: "userInfo",
}),
pathName() {
return this.fwglNav[this.level][this.type];
@@ -1091,35 +1135,6 @@ export default {
// 超级管理员 --- 云资源管理
else if (level == 2 && type == 2) {
this.listUrl = "/apaas/service/v3/resource/user/apply/list";
- /* this.cloud_admin = {
- dashboard_list: [
- {
- name: "cpu使用量",
- value: 6,
- total: 10,
- unit: "(核)",
- },
- {
- name: "内存使用量",
- value: 13,
- total: 20,
- unit: "(GB)",
- },
- {
- name: "数据盘使用量",
- value: 240,
- total: 560,
- unit: "(GB)",
- },
- {
- name: "容器组使用量",
- value: 10,
- total: 18,
- unit: "(个)",
- },
- ],
- histogram: {},
- }; */
}
// Error
@@ -1145,7 +1160,7 @@ export default {
limit: filter.size,
depart: "",
state1: filter.state1,
- State2: filter.State2,
+ state2: filter.state2,
};
} else {
params = {
@@ -1177,39 +1192,70 @@ export default {
// console.log(data);
if (this.type == 2) {
- this.listTotal = data.total;
- this.listData = data.data.cloud_apply_list;
+ const cloud = data.data.cloud_resource_count;
- this.cloud_zuzhi = {
- org_name: "北京比格大数据",
- used_area: 2,
- dashboard_list: [
- {
- name: "cpu使用量",
- value: 6,
- total: 10,
- unit: "(核)",
- },
- {
- name: "内存使用量",
- value: 13,
- total: 20,
- unit: "(GB)",
- },
- {
- name: "数据盘使用量",
- value: 500,
- total: 560,
- unit: "(GB)",
- },
- {
- name: "容器组使用量",
- value: 10,
- total: 18,
- unit: "(个)",
- },
- ],
- };
+ if (this.level == 1) {
+ this.listTotal = data.total;
+ this.listData = data.data.cloud_apply_list;
+ this.cloud_zuzhi = {
+ count_zy: cloud.count_zy,
+ dashboard_list: [
+ {
+ name: "cpu使用量",
+ value: cloud.cpu_use,
+ total: cloud.cpu_total,
+ unit: "(核)",
+ },
+ {
+ name: "内存使用量",
+ value: cloud.memory_use,
+ total: cloud.memory_total,
+ unit: "(GB)",
+ },
+ {
+ name: "数据盘使用量",
+ value: cloud.disk_use,
+ total: cloud.disk_total,
+ unit: "(GB)",
+ },
+ {
+ name: "容器组使用量",
+ value: cloud.containers_use,
+ total: cloud.containers_total,
+ unit: "(个)",
+ },
+ ],
+ };
+ } else if (this.level == 2) {
+ this.cloud_admin = {
+ dashboard_list: [
+ {
+ name: "cpu使用量",
+ value: cloud.cpu_use,
+ total: cloud.cpu_total,
+ unit: "(核)",
+ },
+ {
+ name: "内存使用量",
+ value: cloud.memory_use,
+ total: cloud.memory_total,
+ unit: "(GB)",
+ },
+ {
+ name: "数据盘使用量",
+ value: cloud.disk_use,
+ total: cloud.disk_total,
+ unit: "(GB)",
+ },
+ {
+ name: "容器组使用量",
+ value: cloud.containers_use,
+ total: cloud.containers_total,
+ unit: "(个)",
+ },
+ ],
+ };
+ }
} else {
this.listTotal = data.data.total;
this.listData = data.data.data;
@@ -1218,6 +1264,27 @@ export default {
.catch((error) => {
console.log(error);
});
+
+ // 超管的云资源管理展示的是组织列表
+ if (this.level == 2 && this.type == 2) {
+ this.$http
+ .get("/apaas/backmgt/department/list", {
+ params: {
+ search: filter.keyword,
+ page: filter.page,
+ limit: filter.size,
+ },
+ })
+ .then(({ data }) => {
+ // console.log(data);
+
+ this.listTotal = data.total;
+ this.listData = data.data;
+ })
+ .catch((error) => {
+ console.log(error);
+ });
+ }
},
showDialog() {
this.$refs.dialog.show();
@@ -1414,7 +1481,7 @@ export default {
this.$refs.allotConfirm.getDetail(item.apply_id);
},
getDashboardOptions(item) {
- let percent = Math.round((item.value / item.total) * 100);
+ let percent = Math.round((item.value / item.total) * 100) || 0;
let colors = ["#515fe7", "#e7ecfd"];
if (percent >= 80) {
@@ -1569,6 +1636,9 @@ export default {
],
};
},
+ allotSuccess() {
+ this.init(this.tempFliter);
+ },
},
created() {
this.level = parseInt(this.$route.params.level);
@@ -1599,35 +1669,36 @@ export default {
.service_management_list {
height: 100%;
}
-.zuzhi_title {
+.cloud_title {
margin-top: 15px;
}
-.zuzhi_title > span,
-.zuzhi_title > span::before {
+.cloud_title > span,
+.cloud_title > span::before {
display: inline-block;
vertical-align: middle;
}
-.zuzhi_title > span:nth-child(1)::before {
+.cloud_title > span:nth-child(1)::before {
content: "";
width: 4px;
height: 16px;
border-radius: 2px;
background-color: #515fe7;
margin-right: 10px;
+ margin-bottom: 2px;
}
-.zuzhi_title > span:nth-child(1) {
+.cloud_title > span:nth-child(1) {
font-size: 16px;
color: #242c43;
line-height: 30px;
}
-.zuzhi_title > span:nth-child(2)::before {
+.cloud_title > span:nth-child(2)::before {
content: "";
width: 2px;
height: 12px;
background-color: #b4c0f5;
margin: 0 10px;
}
-.zuzhi_title > span:nth-child(2) {
+.cloud_title > span:nth-child(2) {
font-size: 14px;
line-height: 1;
color: #58617a;