|
|
|
@ -1,16 +1,41 @@
|
|
|
|
|
<template >
|
|
|
|
|
<div id="main1"></div>
|
|
|
|
|
<div style="height: 100%; width: 100%" v-loading="load1">
|
|
|
|
|
<div id="main1"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
import { workStatistics } from "@/api/yingji/keyEnterprise.js";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {};
|
|
|
|
|
return {
|
|
|
|
|
load1: true,
|
|
|
|
|
arr1: [],
|
|
|
|
|
arr2: [],
|
|
|
|
|
beforeParams: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.initChart();
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.getData();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getData() {
|
|
|
|
|
this.load1 = true;
|
|
|
|
|
workStatistics(this.beforeParams).then((res) => {
|
|
|
|
|
res.data.list.forEach((value, index) => {
|
|
|
|
|
this.arr1.push(value.deptName);
|
|
|
|
|
this.arr2.push(value.keyCompleted + value.nonKeyCompleted);
|
|
|
|
|
});
|
|
|
|
|
this.initChart();
|
|
|
|
|
this.load1 = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
initChart() {
|
|
|
|
|
var chartDom = document.getElementById("main1");
|
|
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
|
@ -64,19 +89,20 @@ export default {
|
|
|
|
|
yAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: "category",
|
|
|
|
|
data: [
|
|
|
|
|
"高新区",
|
|
|
|
|
"工业园区",
|
|
|
|
|
"相城区",
|
|
|
|
|
"姑苏区",
|
|
|
|
|
"吴中区",
|
|
|
|
|
"吴江区",
|
|
|
|
|
"昆山市",
|
|
|
|
|
"太仓市",
|
|
|
|
|
"常熟市",
|
|
|
|
|
"张家港市",
|
|
|
|
|
"苏州",
|
|
|
|
|
],
|
|
|
|
|
// data: [
|
|
|
|
|
// "高新区",
|
|
|
|
|
// "工业园区",
|
|
|
|
|
// "相城区",
|
|
|
|
|
// "姑苏区",
|
|
|
|
|
// "吴中区",
|
|
|
|
|
// "吴江区",
|
|
|
|
|
// "昆山市",
|
|
|
|
|
// "太仓市",
|
|
|
|
|
// "常熟市",
|
|
|
|
|
// "张家港市",
|
|
|
|
|
// "苏州",
|
|
|
|
|
// ],
|
|
|
|
|
data: this.arr1,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
// 超出指定长度显示省略号
|
|
|
|
|
formatter: function (value) {
|
|
|
|
@ -88,10 +114,10 @@ export default {
|
|
|
|
|
return value;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fontSize: '13px',
|
|
|
|
|
fontFamily: 'Alibaba PuHuiTi',
|
|
|
|
|
fontSize: "13px",
|
|
|
|
|
fontFamily: "Alibaba PuHuiTi",
|
|
|
|
|
fontWeight: 500,
|
|
|
|
|
color: '#525966',
|
|
|
|
|
color: "#525966",
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false,
|
|
|
|
@ -102,7 +128,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "category",
|
|
|
|
|
data: [33, 63, 115, 167, 210, 225, 245, 283, 300, 321, 1000],
|
|
|
|
|
// data: [33, 63, 115, 167, 210, 225, 245, 283, 300, 321, 1000],
|
|
|
|
|
data: this.arr2,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
formatter: function (value, index) {
|
|
|
|
|
return `{a|${value}}{b|家}`;
|
|
|
|
@ -111,7 +138,8 @@ export default {
|
|
|
|
|
a: {
|
|
|
|
|
color: "#0084FF",
|
|
|
|
|
align: "right",
|
|
|
|
|
width: 32,
|
|
|
|
|
// width: 32,
|
|
|
|
|
// width: 20,
|
|
|
|
|
},
|
|
|
|
|
b: {
|
|
|
|
|
color: "#525966",
|
|
|
|
@ -135,8 +163,8 @@ export default {
|
|
|
|
|
label: {
|
|
|
|
|
show: false, //是否显示标签
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data: [63, 115, 167, 210, 225, 245, 283, 300, 321,678, 1000],
|
|
|
|
|
// data: [63, 115, 167, 210, 225, 245, 283, 300, 321, 678, 1000],
|
|
|
|
|
data: this.arr2,
|
|
|
|
|
barWidth: 12,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: {
|
|
|
|
@ -160,14 +188,17 @@ export default {
|
|
|
|
|
emphasis: {
|
|
|
|
|
disabled: true,
|
|
|
|
|
},
|
|
|
|
|
z:102,
|
|
|
|
|
z: 102,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
// name: '背景',
|
|
|
|
|
type: "bar",
|
|
|
|
|
barWidth: 12,
|
|
|
|
|
barGap: "-100%",
|
|
|
|
|
data: [1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,1000],
|
|
|
|
|
// data: [
|
|
|
|
|
// 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
|
|
|
|
|
// ],
|
|
|
|
|
data: [],
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
color: "#EDF0F2",
|
|
|
|
|