|
|
|
@ -1,47 +1,49 @@
|
|
|
|
|
<template >
|
|
|
|
|
<div style="height: 100%; height: 100%" >
|
|
|
|
|
<div style="height: 100%; height: 100%" v-loading="loadS">
|
|
|
|
|
<div id="cakeBox"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { workStatistics } from "@/api/yingji/keyEnterprise.js";
|
|
|
|
|
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
load1: true,
|
|
|
|
|
arr1: [],
|
|
|
|
|
beforeParams: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
},
|
|
|
|
|
arr2: [],
|
|
|
|
|
//总数
|
|
|
|
|
numTotal: 0,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// this.getData();
|
|
|
|
|
this.initChart();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
loadS: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getData() {
|
|
|
|
|
this.load1 = true;
|
|
|
|
|
workStatistics(this.beforeParams).then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
res.data.list.forEach((value1) => {
|
|
|
|
|
getData(e) {
|
|
|
|
|
this.arr1= []
|
|
|
|
|
this.arr2= []
|
|
|
|
|
e.forEach((value1) => {
|
|
|
|
|
if (value1.institutionName != "苏州") {
|
|
|
|
|
this.arr1.push({
|
|
|
|
|
value: value1.keyCompleted + value1.nonKeyCompleted,
|
|
|
|
|
name: value1.deptName,
|
|
|
|
|
value: value1.checkEnterpriseCount,
|
|
|
|
|
name: value1.institutionName,
|
|
|
|
|
pt: value1.pt,
|
|
|
|
|
});
|
|
|
|
|
this.numTotal += value1.keyCompleted + value1.nonKeyCompleted;
|
|
|
|
|
console.log(this.arr1);
|
|
|
|
|
});
|
|
|
|
|
this.initChart();
|
|
|
|
|
this.load1 = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.arr2.push({
|
|
|
|
|
value: value1.plannedEnterpriseCount,
|
|
|
|
|
name: value1.institutionName,
|
|
|
|
|
pt: value1.pt,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.initChart();
|
|
|
|
|
},
|
|
|
|
|
initChart() {
|
|
|
|
|
var chartDom = document.getElementById("cakeBox");
|
|
|
|
@ -97,29 +99,24 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
formatter: function (name) {
|
|
|
|
|
console.log(option.legend);
|
|
|
|
|
let arrA = 0;
|
|
|
|
|
option.legend.data.forEach((value, index) => {
|
|
|
|
|
arrA += value.value;
|
|
|
|
|
});
|
|
|
|
|
const item = option.legend.data.find((item) => item.name === name);
|
|
|
|
|
// return `{a|${name}}{b|${( item.value / arrA * 100)}%}`;
|
|
|
|
|
return `{a|${name}}{b|15%}`;
|
|
|
|
|
return `{a|${name}}{b|${item.pt * 100}%}`;
|
|
|
|
|
},
|
|
|
|
|
//将waiyuan的数据拿过来,就会只显示该外圆的数据
|
|
|
|
|
data: [
|
|
|
|
|
{ value: 15, name: "张家港市" },
|
|
|
|
|
{ value: 10, name: "吴中区" },
|
|
|
|
|
{ value: 8, name: "常熟市" },
|
|
|
|
|
{ value: 10, name: "姑苏区" },
|
|
|
|
|
{ value: 18, name: "太仓市" },
|
|
|
|
|
{ value: 6, name: "相城区" },
|
|
|
|
|
{ value: 10, name: "昆山市" },
|
|
|
|
|
{ value: 4, name: "工业园区" },
|
|
|
|
|
{ value: 10, name: "吴江区" },
|
|
|
|
|
{ value: 5, name: "高新区" },
|
|
|
|
|
],
|
|
|
|
|
// data: this.arr1,
|
|
|
|
|
// data: [
|
|
|
|
|
// { value: 15, name: "张家港市" },
|
|
|
|
|
// { value: 10, name: "吴中区" },
|
|
|
|
|
// { value: 8, name: "常熟市" },
|
|
|
|
|
// { value: 10, name: "姑苏区" },
|
|
|
|
|
// { value: 18, name: "太仓市" },
|
|
|
|
|
// { value: 6, name: "相城区" },
|
|
|
|
|
// { value: 10, name: "昆山市" },
|
|
|
|
|
// { value: 4, name: "工业园区" },
|
|
|
|
|
// { value: 10, name: "吴江区" },
|
|
|
|
|
// { value: 5, name: "高新区" },
|
|
|
|
|
// ],
|
|
|
|
|
data: this.arr1,
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
@ -144,7 +141,9 @@ export default {
|
|
|
|
|
position: "center",
|
|
|
|
|
formatter: function (params) {
|
|
|
|
|
console.log(params);
|
|
|
|
|
return `{a|${params.data.pt}%}\n{b|${params.data.name}}`;
|
|
|
|
|
return `{a|${params.data.pt * 100}%}\n{b|${
|
|
|
|
|
params.data.name
|
|
|
|
|
}完成率}`;
|
|
|
|
|
},
|
|
|
|
|
rich: {
|
|
|
|
|
a: {
|
|
|
|
@ -163,7 +162,8 @@ export default {
|
|
|
|
|
labelLine: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
data: [{ value: 1, name: "苏州完成率", pt: 100 }],
|
|
|
|
|
// data: [{ value: 1, name: "苏州完成率", pt: 100 }],
|
|
|
|
|
data: this.arr2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
//外圆
|
|
|
|
@ -185,19 +185,19 @@ export default {
|
|
|
|
|
labelLine: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
data: [
|
|
|
|
|
{ value: 15, name: "张家港市" },
|
|
|
|
|
{ value: 10, name: "吴中区" },
|
|
|
|
|
{ value: 8, name: "常熟市" },
|
|
|
|
|
{ value: 10, name: "姑苏区" },
|
|
|
|
|
{ value: 18, name: "太仓市" },
|
|
|
|
|
{ value: 6, name: "相城区" },
|
|
|
|
|
{ value: 10, name: "昆山市" },
|
|
|
|
|
{ value: 4, name: "工业园区" },
|
|
|
|
|
{ value: 10, name: "吴江区" },
|
|
|
|
|
{ value: 5, name: "高新区" },
|
|
|
|
|
],
|
|
|
|
|
// data: this.arr1,
|
|
|
|
|
// data: [
|
|
|
|
|
// { value: 15, name: "张家港市" },
|
|
|
|
|
// { value: 10, name: "吴中区" },
|
|
|
|
|
// { value: 8, name: "常熟市" },
|
|
|
|
|
// { value: 10, name: "姑苏区" },
|
|
|
|
|
// { value: 18, name: "太仓市" },
|
|
|
|
|
// { value: 6, name: "相城区" },
|
|
|
|
|
// { value: 10, name: "昆山市" },
|
|
|
|
|
// { value: 4, name: "工业园区" },
|
|
|
|
|
// { value: 10, name: "吴江区" },
|
|
|
|
|
// { value: 5, name: "高新区" },
|
|
|
|
|
// ],
|
|
|
|
|
data: this.arr1,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|