Commit 12a6333b authored by 徐一鸣's avatar 徐一鸣

Merge branch 'xym' into dev

parents 97f04542 29a61793
<template>
<chart
ref="adminHistogram"
:options="getHistogramOption()"
style="width:100%;height:100%;"
/>
</template>
<script>
export default {
props: {
xAxis: {
type: Array,
default: () => [],
},
series: {
type: Array,
default: () => [],
},
},
methods: {
getHistogramOption() {
let _self = this;
return {
tooltip: {
trigger: "axis",
backgroundColor: "#242c43",
textStyle: {
fontSize: 12,
lineHeight: 20,
color: "#fff",
},
},
grid: {
left: 10,
right: 10,
bottom: 25,
top: 45,
containLabel: true,
},
color: ["#525e98", "#90b7c1", "#d06d1f", "#e4aa4f"],
legend: {
right: "center",
top: 0,
itemWidth: 10,
itemHeight: 10,
icon: "roundRect",
orient: "horizontal",
backgroundColor: "#f8f9fd",
textStyle: {
fontSize: 12,
lineHeight: 20,
color: "#a9aec0",
},
data: _self.series.map((item) => item.name),
},
xAxis: [
{
type: "category",
axisLabel: {
textStyle: {
color: "#0d1847",
fontSize: 12,
lineHeight: 20,
},
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#e3e5ef",
},
},
splitLine: {
show: false,
},
splitArea: {
show: true,
interval: 0,
areaStyle: {
color: ["#f4f5fd", "#fff"],
opacity: 0.5,
},
},
axisPointer: {
type: "shadow",
},
data: _self.xAxis,
},
],
yAxis: [
{
type: "value",
min: 0,
axisLabel: {
formatter: "{value}",
textStyle: {
color: "#a9aec0",
fontSize: 12,
},
},
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#e3e5ef",
},
},
splitLine: {
lineStyle: {
type: "dashed",
color: ["#f2f2f2"],
width: 1,
},
},
},
],
series: _self.series.map((item) => ({
...item,
type: "bar",
barMaxWidth: 12,
itemStyle: {
normal: {
barBorderRadius: [6, 6, 6, 6],
},
},
})),
dataZoom: [
{
type: "inside",
startValue: 0,
endValue: Math.min(_self.xAxis.length, 6),
},
{
show: true,
type: "slider",
height: 20,
bottom: 0,
startValue: 0,
endValue: _self.xAxis.length,
fillerColor: "#e6ebfe",
handleStyle: { color: "#b4c0f5" },
backgroundColor: "#f8f9fd",
borderColor: "#f8f9fd",
textStyle: { color: "transparent", fontSize: "12px" },
dataBackground: {
lineStyle: { color: "transparent" },
areaStyle: { color: "transparent" },
},
},
],
};
},
resizeColumn() {
if (this.$refs.adminHistogram) {
this.$refs.adminHistogram.resize();
}
},
},
mounted() {
window.addEventListener("resize", this.resizeColumn);
},
destroyed() {
window.removeEventListener("resize", this.resizeColumn);
},
};
</script>
...@@ -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();
}, },
......
This diff is collapsed.
...@@ -170,23 +170,28 @@ export default { ...@@ -170,23 +170,28 @@ export default {
} }
return { return {
title: { title: [
{
text: percent + "%", text: percent + "%",
subtext: item.name,
x: "center", x: "center",
y: "center", y: "28%",
textVerticalAlign: "auto",
textStyle: { textStyle: {
fontSize: 34, fontSize: 34,
fontWeight: "100", fontWeight: "100",
color: ["#0d1847"], color: ["#0d1847"],
}, },
subtextStyle: { },
{
text: item.name,
x: "center",
y: "55%",
textStyle: {
fontSize: 12, fontSize: 12,
fontWeight: "100", fontWeight: "100",
color: "#707693", color: "#707693",
}, },
}, },
],
angleAxis: { angleAxis: {
axisLine: { axisLine: {
show: false, show: false,
...@@ -378,7 +383,7 @@ export default { ...@@ -378,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",
}); });
}); });
...@@ -407,17 +412,17 @@ export default { ...@@ -407,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