main
赵培友 3 years ago
parent cd1b55cc06
commit b18c5279e0
  1. 7
      src/api/wel/wel.js
  2. 55
      src/views/wel/index.vue

@ -21,6 +21,13 @@ export const getFlowTakeTime = () => {
method: 'get', method: 'get',
}) })
} }
// 状态统计
export const getFlowStatus = () => {
return request({
url: `${prefix}/flowStatus`,
method: 'get',
})
}
// 类型统计 // 类型统计
export const getFlowListType = () => { export const getFlowListType = () => {
return request({ return request({

@ -52,6 +52,7 @@ import {
getFlowListMonth, getFlowListMonth,
getFlowTakeTime, getFlowTakeTime,
getFlowListType, getFlowListType,
getFlowStatus,
} from "@/api/wel/wel.js"; } from "@/api/wel/wel.js";
export default { export default {
name: "wel", name: "wel",
@ -85,6 +86,7 @@ export default {
this.onload(); this.onload();
}, },
methods: { methods: {
//
lineChart(xData, monthAddNum, monthFinishNum) { lineChart(xData, monthAddNum, monthFinishNum) {
var myChart = this.$echarts.init(document.getElementById("lineChart")); var myChart = this.$echarts.init(document.getElementById("lineChart"));
// //
@ -203,18 +205,11 @@ export default {
}, 100); }, 100);
}); });
}, },
//
pieOneChart(data) { pieOneChart(data) {
var myChart = this.$echarts.init(document.getElementById("pieItemOne")); var myChart = this.$echarts.init(document.getElementById("pieItemOne"));
// //
var option = { var option = {
color: [
"#2689FF",
"#6F33FF",
"#2356F7",
"#00C374",
"#00CFDC",
"#FD4D66",
],
title: { title: {
text: "业务类型统计", text: "业务类型统计",
textStyle: { textStyle: {
@ -270,7 +265,8 @@ export default {
}, 100); }, 100);
}); });
}, },
pieTwoChart() { //
pieTwoChart(data) {
var myChart = this.$echarts.init(document.getElementById("pieItemTwo")); var myChart = this.$echarts.init(document.getElementById("pieItemTwo"));
// //
var option = { var option = {
@ -302,13 +298,10 @@ export default {
name: "状态统计", name: "状态统计",
type: "pie", type: "pie",
radius: ["55%", "42%"], radius: ["55%", "42%"],
data: [ data,
{ value: 140, name: "审批中" },
{ value: 206, name: "进行中" },
{ value: 75, name: "已完成" },
],
hoverAnimation: false, hoverAnimation: false,
minAngle: 15, //
startAngle: 270, //
label: { label: {
normal: { normal: {
color: "#000", color: "#000",
@ -320,15 +313,13 @@ export default {
}, },
labelLine: { labelLine: {
length: 30, length: 30,
length2: 20,
show: true,
}, },
}, },
{ {
center: ["36%", "48%"], center: ["36%", "48%"],
name: "", name: "",
type: "pie", type: "pie",
radius: "30%", radius: "28%",
itemStyle: { itemStyle: {
color: "#ccc", color: "#ccc",
}, },
@ -337,6 +328,9 @@ export default {
labelLine: { labelLine: {
show: false, show: false,
}, },
tooltip: {
show: false,
},
}, },
], ],
}; };
@ -347,6 +341,7 @@ export default {
}, 100); }, 100);
}); });
}, },
//
barChart(XData, YData) { barChart(XData, YData) {
var myChart = this.$echarts.init(document.getElementById("barChart")); var myChart = this.$echarts.init(document.getElementById("barChart"));
var option = { var option = {
@ -428,11 +423,11 @@ export default {
color: "#4CA3FB", color: "#4CA3FB",
}, },
label: { label: {
show:true, show: true,
position: 'top', position: "top",
color: "#000", color: "#000",
fontSize: 14 fontSize: 14,
} },
}, },
], ],
}; };
@ -453,6 +448,7 @@ export default {
this.headerList[i].num = arr[i]; this.headerList[i].num = arr[i];
} }
}); });
//
getFlowListMonth().then((res) => { getFlowListMonth().then((res) => {
const { xData, monthAddNum, monthFinishNum } = res.data.data; const { xData, monthAddNum, monthFinishNum } = res.data.data;
this.lineChart(xData, monthAddNum, monthFinishNum); this.lineChart(xData, monthAddNum, monthFinishNum);
@ -461,21 +457,20 @@ export default {
getFlowListType().then((res) => { getFlowListType().then((res) => {
this.pieOneChart(res.data.data); this.pieOneChart(res.data.data);
}); });
//
getFlowStatus().then((res) => {
this.pieTwoChart(res.data.data);
});
// //
getFlowTakeTime().then((res) => { getFlowTakeTime().then((res) => {
const { XData, YData } = res.data.data; const { XData, YData } = res.data.data;
const data = XData.map(item => { const data = XData.map((item) => {
return item + "天" return item + "天";
}) });
this.barChart(data, YData); this.barChart(data, YData);
}); });
}, },
}, },
mounted() {
this.pieOneChart();
this.pieTwoChart();
this.barChart();
},
}; };
</script> </script>

Loading…
Cancel
Save