|
@@ -3,25 +3,36 @@
|
|
<div class="c-title flex justify-between">
|
|
<div class="c-title flex justify-between">
|
|
<span>作业计划</span>
|
|
<span>作业计划</span>
|
|
<el-button
|
|
<el-button
|
|
- style="font-size: 16px; position: absolute; right: 45%; top: 5px"
|
|
|
|
|
|
+ style="font-size: 16px; position: absolute; right: 65%; top: 5px"
|
|
size="mini"
|
|
size="mini"
|
|
v-if="currentMap != '衡阳市'"
|
|
v-if="currentMap != '衡阳市'"
|
|
type="text"
|
|
type="text"
|
|
@click="back()"
|
|
@click="back()"
|
|
>返回</el-button
|
|
>返回</el-button
|
|
>
|
|
>
|
|
- <el-date-picker
|
|
|
|
- size="mini"
|
|
|
|
- v-model="dateRange"
|
|
|
|
- type="daterange"
|
|
|
|
- range-separator="至"
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
- value-format="yyyyMMdd"
|
|
|
|
- style="width: 240px"
|
|
|
|
- @change="init"
|
|
|
|
- >
|
|
|
|
- </el-date-picker>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-date-picker
|
|
|
|
+ size="mini"
|
|
|
|
+ v-model="dateRange"
|
|
|
|
+ type="daterange"
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ value-format="yyyyMMdd"
|
|
|
|
+ style="width: 240px"
|
|
|
|
+ @change="init"
|
|
|
|
+ >
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ <el-select
|
|
|
|
+ style="width: 90px; margin-left: 10px"
|
|
|
|
+ size="mini"
|
|
|
|
+ v-model="type"
|
|
|
|
+ @change="typeChange"
|
|
|
|
+ >
|
|
|
|
+ <el-option label="作业" value="1"></el-option>
|
|
|
|
+ <el-option label="风险" value="2"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div style="display: flex; justify-content: space-between; height: 100%">
|
|
<div style="display: flex; justify-content: space-between; height: 100%">
|
|
@@ -47,7 +58,7 @@ const mapEnum = {
|
|
蒸湘区: require("./蒸湘区.json"),
|
|
蒸湘区: require("./蒸湘区.json"),
|
|
珠晖区: require("./珠晖区.json"),
|
|
珠晖区: require("./珠晖区.json"),
|
|
};
|
|
};
|
|
-import { getWorkNumStatistics } from "@/api/powerdistribution/home";
|
|
|
|
|
|
+import { getWorkNumStatisticsHome } from "@/api/powerdistribution/home";
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
export default {
|
|
export default {
|
|
name: "map",
|
|
name: "map",
|
|
@@ -60,12 +71,16 @@ export default {
|
|
loading: true,
|
|
loading: true,
|
|
currentMap: "衡阳市",
|
|
currentMap: "衡阳市",
|
|
dataMap: {},
|
|
dataMap: {},
|
|
|
|
+ type: "1",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.init();
|
|
this.init();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ typeChange(e) {
|
|
|
|
+ this.init();
|
|
|
|
+ },
|
|
async init() {
|
|
async init() {
|
|
await this.getData();
|
|
await this.getData();
|
|
},
|
|
},
|
|
@@ -74,11 +89,11 @@ export default {
|
|
startDate: this.dateRange[0],
|
|
startDate: this.dateRange[0],
|
|
endDate: this.dateRange[1],
|
|
endDate: this.dateRange[1],
|
|
};
|
|
};
|
|
- const data = await getWorkNumStatistics(params);
|
|
|
|
|
|
+ const data = await getWorkNumStatisticsHome(params);
|
|
Object.keys(mapEnum).forEach((key) => {
|
|
Object.keys(mapEnum).forEach((key) => {
|
|
(data || []).map((ite) => {
|
|
(data || []).map((ite) => {
|
|
- if (key.includes(ite.submitOrgNm)) {
|
|
|
|
- this.dataMap[key] = ite.workNum ?? 0;
|
|
|
|
|
|
+ if (key.includes(ite.company)) {
|
|
|
|
+ this.dataMap[key] = { ...ite };
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
@@ -96,7 +111,7 @@ export default {
|
|
geoCoordMap[v.properties.name] = v.properties.center;
|
|
geoCoordMap[v.properties.name] = v.properties.center;
|
|
data.push({
|
|
data.push({
|
|
name: v.properties.name,
|
|
name: v.properties.name,
|
|
- value: this.dataMap[v.properties.name] ?? 0,
|
|
|
|
|
|
+ value: this.dataMap[v.properties.name] || {},
|
|
});
|
|
});
|
|
});
|
|
});
|
|
var convertData = function (data) {
|
|
var convertData = function (data) {
|
|
@@ -122,20 +137,72 @@ export default {
|
|
formatter: (params) => {
|
|
formatter: (params) => {
|
|
let str = "";
|
|
let str = "";
|
|
Object.keys(this.dataMap).forEach((key) => {
|
|
Object.keys(this.dataMap).forEach((key) => {
|
|
- str +=
|
|
|
|
- key +
|
|
|
|
- "-作业数量 " +
|
|
|
|
- `<span class="orange">${this.dataMap[key] || 0}</span> <br/>`;
|
|
|
|
|
|
+ if (this.type == "1") {
|
|
|
|
+ str +=
|
|
|
|
+ key +
|
|
|
|
+ "-作业数" +
|
|
|
|
+ `<span class="orange">${
|
|
|
|
+ this.dataMap[key]?.planSum || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `取消数 <span class="orange">${
|
|
|
|
+ this.dataMap[key]?.cancelSum || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `执行率 <span class="orange">${
|
|
|
|
+ this.dataMap[key]?.executeRatio || "0%"
|
|
|
|
+ }</span> <br/>`;
|
|
|
|
+ }
|
|
|
|
+ if (this.type == "2") {
|
|
|
|
+ str +=
|
|
|
|
+ key +
|
|
|
|
+ "-风险作业数" +
|
|
|
|
+ `<span class="orange">${
|
|
|
|
+ this.dataMap[key]?.riskSum || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `三级作业数 <span class="orange">${
|
|
|
|
+ this.dataMap[key]?.planSum3 || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `四级作业数 <span class="orange">${
|
|
|
|
+ this.dataMap[key]?.planSum4 || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `五级作业数 <span class="orange">${
|
|
|
|
+ this.dataMap[key]?.planSum5 || 0
|
|
|
|
+ }</span> <br/>`;
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- const v = Array.isArray(params.value)
|
|
|
|
- ? params.value[2]
|
|
|
|
- : params.value;
|
|
|
|
-
|
|
|
|
|
|
+ // const v = Array.isArray(params.value)
|
|
|
|
+ // ? params.value[2]
|
|
|
|
+ // : params.value;
|
|
|
|
+ if (this.type == "2") {
|
|
|
|
+ return this.currentMap == "衡阳市"
|
|
|
|
+ ? str
|
|
|
|
+ : params.name +
|
|
|
|
+ "-风险作业数 " +
|
|
|
|
+ `<span class="orange">${
|
|
|
|
+ params.data.value?.riskSum || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `三级作业数 <span class="orange">${
|
|
|
|
+ params.data.value?.planSum3 || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `四级作业数 <span class="orange">${
|
|
|
|
+ params.data.value?.planSum4 || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `五级作业数 <span class="orange">${
|
|
|
|
+ params.data.value?.planSum5 || 0
|
|
|
|
+ }</span> <br/>`;
|
|
|
|
+ }
|
|
return this.currentMap == "衡阳市"
|
|
return this.currentMap == "衡阳市"
|
|
? str
|
|
? str
|
|
: params.name +
|
|
: params.name +
|
|
- "-作业数量 " +
|
|
|
|
- `<span class="orange">${v || 0}</span> <br/>`;
|
|
|
|
|
|
+ "-作业数 " +
|
|
|
|
+ `<span class="orange">${
|
|
|
|
+ params.data.value?.planSum || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `取消数 <span class="orange">${
|
|
|
|
+ params.data.value?.cancelSum || 0
|
|
|
|
+ }</span> ` +
|
|
|
|
+ `执行率 <span class="orange">${
|
|
|
|
+ params.data.value?.executeRatio || "0%"
|
|
|
|
+ }</span> <br/>`;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
// visualMap: {
|
|
// visualMap: {
|
|
@@ -180,7 +247,8 @@ export default {
|
|
label: {
|
|
label: {
|
|
normal: {
|
|
normal: {
|
|
show: true,
|
|
show: true,
|
|
- formatter: "{b}: {c}",
|
|
|
|
|
|
+ formatter: "{b}",
|
|
|
|
+ // : {c}
|
|
textStyle: {
|
|
textStyle: {
|
|
color: "#fff",
|
|
color: "#fff",
|
|
},
|
|
},
|
|
@@ -242,8 +310,11 @@ export default {
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
color: (params) => {
|
|
color: (params) => {
|
|
- const [x, y, v] = params.value;
|
|
|
|
- return v ? "#44936c" : "gray";
|
|
|
|
|
|
+ const [x, y, v] = params.data.value;
|
|
|
|
+ if (this.type == "1") {
|
|
|
|
+ return v?.planSum ? "#44936c" : "gray";
|
|
|
|
+ }
|
|
|
|
+ return v?.riskSum ? "#44936c" : "gray";
|
|
}, //标志颜色,
|
|
}, //标志颜色,
|
|
shadowBlur: 2,
|
|
shadowBlur: 2,
|
|
},
|
|
},
|