Commit 29a61793 authored by 徐一鸣's avatar 徐一鸣

云资源调试

parent 8c95cfaf
...@@ -11,187 +11,15 @@ export default { ...@@ -11,187 +11,15 @@ export default {
props: { props: {
xAxis: { xAxis: {
type: Array, type: Array,
default: () => [ default: () => [],
"办公费",
"印刷费",
"水费",
"水费",
"邮电费",
"物业管理费",
"差旅费",
"因公出国(境)费用",
"维修(护)费",
"会议费",
"租聘费",
"培训费",
"取暖费",
"公务接待费",
"公务用车运行",
"其他交通费用",
"房屋建筑物购建",
"办公设备购置",
"大型修缮",
"信息网络及软件购置更新",
"公务用车购置",
"咨询费",
"手续费",
"劳务费",
"委托业务费",
"其他商品和服务支出",
"专用设备购置",
"基础设施建设",
"其他交通工具购置",
"其他资本性支出",
],
}, },
series: { series: {
type: Array, type: Array,
default: () => [ default: () => [],
{
name: "CPU",
data: [
17931.63,
2420.69,
399.4,
2581.2,
1571.79,
3028.14,
8041.46,
1616.08,
7159.78,
3122.55,
2211.05,
10573.26,
1325.09,
1290.44,
2301.95,
3344.42,
5687.6,
2117.72,
442.4,
14853.71,
96.25,
170.19,
40.74,
3947.28,
12558.87,
12546.87,
6945.36,
683.28,
73.17,
169.15,
],
},
{
name: "内存",
data: [
17931.63,
2420.69,
399.4,
2581.2,
1571.79,
3028.14,
8041.46,
1616.08,
7159.78,
3122.55,
2211.05,
10573.26,
1325.09,
1290.44,
2301.95,
3344.42,
5687.6,
2117.72,
442.4,
14853.71,
96.25,
170.19,
40.74,
3947.28,
12558.87,
12546.87,
6945.36,
683.28,
73.17,
169.15,
],
},
{
name: "数据盘",
data: [
17931.63,
2420.69,
399.4,
2581.2,
1571.79,
3028.14,
8041.46,
1616.08,
7159.78,
3122.55,
2211.05,
10573.26,
1325.09,
1290.44,
2301.95,
3344.42,
5687.6,
2117.72,
442.4,
14853.71,
96.25,
170.19,
40.74,
3947.28,
12558.87,
12546.87,
6945.36,
683.28,
73.17,
169.15,
],
},
{
name: "容器组",
data: [
17931.63,
2420.69,
399.4,
2581.2,
1571.79,
3028.14,
8041.46,
1616.08,
7159.78,
3122.55,
2211.05,
10573.26,
1325.09,
1290.44,
2301.95,
3344.42,
5687.6,
2117.72,
442.4,
14853.71,
96.25,
170.19,
40.74,
3947.28,
12558.87,
12546.87,
6945.36,
683.28,
73.17,
169.15,
],
},
],
}, },
}, },
methods: { methods: {
getHistogramOption(_xAxisData, _series) { getHistogramOption() {
let _self = this; let _self = this;
return { return {
...@@ -225,7 +53,7 @@ export default { ...@@ -225,7 +53,7 @@ export default {
lineHeight: 20, lineHeight: 20,
color: "#a9aec0", color: "#a9aec0",
}, },
data: ["CPU", "内存", "数据盘", "容器组"], data: _self.series.map((item) => item.name),
}, },
xAxis: [ xAxis: [
{ {
...@@ -248,13 +76,14 @@ export default { ...@@ -248,13 +76,14 @@ export default {
splitLine: { splitLine: {
show: false, show: false,
}, },
/* splitArea: { splitArea: {
show: true, show: true,
interval: 0,
areaStyle: { areaStyle: {
color: ["#f4f5fd", "#fff"], color: ["#f4f5fd", "#fff"],
opacity: 0.5, opacity: 0.5,
}, },
}, */ },
axisPointer: { axisPointer: {
type: "shadow", type: "shadow",
}, },
...@@ -300,14 +129,18 @@ export default { ...@@ -300,14 +129,18 @@ export default {
}, },
})), })),
dataZoom: [ dataZoom: [
{ type: "inside", start: 0, end: 20 }, {
type: "inside",
startValue: 0,
endValue: Math.min(_self.xAxis.length, 6),
},
{ {
show: true, show: true,
type: "slider", type: "slider",
height: 20, height: 20,
bottom: 0, bottom: 0,
start: 0, startValue: 0,
end: 100, endValue: _self.xAxis.length,
fillerColor: "#e6ebfe", fillerColor: "#e6ebfe",
handleStyle: { color: "#b4c0f5" }, handleStyle: { color: "#b4c0f5" },
backgroundColor: "#f8f9fd", backgroundColor: "#f8f9fd",
......
...@@ -78,8 +78,15 @@ export default { ...@@ -78,8 +78,15 @@ export default {
}, },
}) })
.then(({ data }) => { .then(({ data }) => {
if (data.success == 1) {
this.listTotal = data.total; this.listTotal = data.total;
this.listData = data.data; this.listData = data.data;
} else {
this.$message({
message: data.errMsg || "获取列表失败",
type: "warning",
});
}
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
...@@ -147,7 +154,32 @@ export default { ...@@ -147,7 +154,32 @@ export default {
this.dialogInfo.cancel = null; this.dialogInfo.cancel = null;
this.dialogInfo.sunbmitText = ""; this.dialogInfo.sunbmitText = "";
this.dialogInfo.submit = () => { this.dialogInfo.submit = () => {
console.log("deleteAction"); this.$http
.delete("/apaas/service/v3/resource/apply/deleteRecord", {
params: {
apply_id: item.apply_id,
},
})
.then(({ data }) => {
if (data.success) {
this.$message({
message: data.errMsg || `删除成功.`,
type: "success",
});
this.init(this.tempFilter);
} else {
this.$message({
message: data.errMsg || `删除失败.`,
type: "warning",
});
}
})
.catch((error) => {
this.$message({
message: `删除失败.`,
type: "warning",
});
});
}; };
this.showDialog(); this.showDialog();
}, },
......
...@@ -74,9 +74,12 @@ ...@@ -74,9 +74,12 @@
</div> </div>
<div class="admin_preview-right apass_button"> <div class="admin_preview-right apass_button">
<el-button type="primary" size="mini" @click="approveWorkspace"> <el-button type="primary" size="mini" @click="approveWorkspace">
工作区域审批(1 工作区域审批({{ cloud_admin.unapprove }}
</el-button> </el-button>
<histogramScroll></histogramScroll> <histogramScroll
:xAxis="cloud_admin.cloumn.xAxis"
:series="cloud_admin.cloumn.series"
></histogramScroll>
</div> </div>
</div> </div>
</template> </template>
...@@ -1171,6 +1174,11 @@ export default { ...@@ -1171,6 +1174,11 @@ export default {
state1: filter.state1, state1: filter.state1,
state2: filter.state2, state2: filter.state2,
}; };
// 超管增加withcolumn字段用于区分
if (this.level == 2) {
params.withcolumn = 1;
}
} else { } else {
params = { params = {
keyword: filter.keyword, keyword: filter.keyword,
...@@ -1203,6 +1211,7 @@ export default { ...@@ -1203,6 +1211,7 @@ export default {
if (this.type == 2) { if (this.type == 2) {
const cloud = data.data.cloud_resource_count; const cloud = data.data.cloud_resource_count;
// 超管的云资源管理展示的是组织列表
if (this.level != 2) { if (this.level != 2) {
this.listTotal = data.total; this.listTotal = data.total;
this.listData = data.data.cloud_apply_list; this.listData = data.data.cloud_apply_list;
...@@ -1266,6 +1275,8 @@ export default { ...@@ -1266,6 +1275,8 @@ export default {
unit: "(个)", unit: "(个)",
}, },
], ],
cloumn: cloud.cloumn, // TODO: 柱状图
unapprove: cloud.unapprove, // 审批数量
}; };
} }
} else { } else {
...@@ -1496,13 +1507,13 @@ export default { ...@@ -1496,13 +1507,13 @@ export default {
user_id: item.user_id, user_id: item.user_id,
}, },
}); });
}, }, // 云资源想抢
cloudAllot(item) { cloudAllot(item) {
this.$refs.allotConfirm.getDetail(item.apply_id); this.$refs.allotConfirm.getDetail(item.apply_id);
}, }, // 云资源分配
allotSuccess() { allotSuccess() {
this.init(this.tempFliter); this.init(this.tempFliter);
}, }, // 云资源分配成功
getDashboardOption(item) { getDashboardOption(item) {
let percent = Math.round((item.value / item.total) * 100) || 0; let percent = Math.round((item.value / item.total) * 100) || 0;
let colors = []; let colors = [];
...@@ -1676,7 +1687,7 @@ export default { ...@@ -1676,7 +1687,7 @@ export default {
}, },
], ],
}; };
}, }, // 仪表图option
approveWorkspace() { approveWorkspace() {
this.$router.push({ this.$router.push({
path: `/fwgl/${this.level}/${this.type}/approveWorkspace`, path: `/fwgl/${this.level}/${this.type}/approveWorkspace`,
...@@ -1684,7 +1695,7 @@ export default { ...@@ -1684,7 +1695,7 @@ export default {
warn: this.cloud_admin_warn ? 1 : 0, warn: this.cloud_admin_warn ? 1 : 0,
}, },
}); });
}, }, // 工作区域审批
}, },
created() { created() {
this.level = parseInt(this.$route.params.level); this.level = parseInt(this.$route.params.level);
......
...@@ -383,7 +383,7 @@ export default { ...@@ -383,7 +383,7 @@ export default {
this.dialogInfo.submit = () => { this.dialogInfo.submit = () => {
action(1, () => { action(1, () => {
this.$message({ this.$message({
message: "该工作区域已被启用", message: `${item.name_space}已被启用`,
type: "success", type: "success",
}); });
}); });
...@@ -412,17 +412,17 @@ export default { ...@@ -412,17 +412,17 @@ export default {
message: data.errMsg || `删除${item.name_space}成功.`, message: data.errMsg || `删除${item.name_space}成功.`,
type: "success", type: "success",
}); });
this.init(this.tempFliter); this.init(this.tempFilter);
} else { } else {
this.$message({ this.$message({
message: data.errMsg, message: data.errMsg || `删除${item.name_space}失败.`,
type: "warning", type: "warning",
}); });
} }
}) })
.catch((error) => { .catch((error) => {
this.$message({ this.$message({
message: `删除${item.name}失败.`, message: `删除${item.name_space}失败.`,
type: "warning", type: "warning",
}); });
}); });
......
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