cfofpp 3 bulan lalu
induk
melakukan
0c6cbce505

+ 9 - 0
src/api/powerdistribution/home.js

@@ -9,6 +9,15 @@ export function getWorkNumStatistics(params) {
   });
 }
 
+// 根据作业单位分类查询作业数量汇总
+export function getWorkNumStatisticsHome(params) {
+  return request({
+    url: "/power/workPlan/getWorkNumStatisticsHome",
+    method: "get",
+    params,
+  });
+}
+
 // 查询风险汇总-日
 export function getWorkRiskStatistics(date) {
   return request({

+ 102 - 31
src/views/home/components/map/index.vue

@@ -3,25 +3,36 @@
     <div class="c-title flex justify-between">
       <span>作业计划</span>
       <el-button
-        style="font-size: 16px; position: absolute; right: 45%; top: 5px"
+        style="font-size: 16px; position: absolute; right: 65%; top: 5px"
         size="mini"
         v-if="currentMap != '衡阳市'"
         type="text"
         @click="back()"
         >返回</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 style="display: flex; justify-content: space-between; height: 100%">
@@ -47,7 +58,7 @@ const mapEnum = {
   蒸湘区: require("./蒸湘区.json"),
   珠晖区: require("./珠晖区.json"),
 };
-import { getWorkNumStatistics } from "@/api/powerdistribution/home";
+import { getWorkNumStatisticsHome } from "@/api/powerdistribution/home";
 import moment from "moment";
 export default {
   name: "map",
@@ -60,12 +71,16 @@ export default {
       loading: true,
       currentMap: "衡阳市",
       dataMap: {},
+      type: "1",
     };
   },
   mounted() {
     this.init();
   },
   methods: {
+    typeChange(e) {
+      this.init();
+    },
     async init() {
       await this.getData();
     },
@@ -74,11 +89,11 @@ export default {
         startDate: this.dateRange[0],
         endDate: this.dateRange[1],
       };
-      const data = await getWorkNumStatistics(params);
+      const data = await getWorkNumStatisticsHome(params);
       Object.keys(mapEnum).forEach((key) => {
         (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;
         data.push({
           name: v.properties.name,
-          value: this.dataMap[v.properties.name] ?? 0,
+          value: this.dataMap[v.properties.name] || {},
         });
       });
       var convertData = function (data) {
@@ -122,20 +137,72 @@ export default {
           formatter: (params) => {
             let str = "";
             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 == "衡阳市"
               ? str
               : 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: {
@@ -180,7 +247,8 @@ export default {
             label: {
               normal: {
                 show: true,
-                formatter: "{b}: {c}",
+                formatter: "{b}",
+                // : {c}
                 textStyle: {
                   color: "#fff",
                 },
@@ -242,8 +310,11 @@ export default {
             itemStyle: {
               normal: {
                 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,
               },

+ 4 - 4
src/views/home/index.vue

@@ -6,8 +6,8 @@
           <PointsRanking></PointsRanking>
         </el-card>
         <el-card class="h-60 mt-10">
-          <!-- <MapHy></MapHy> -->
-          <MapView></MapView>
+          <MapHy></MapHy>
+          <!-- <MapView></MapView> -->
         </el-card>
       </el-col>
       <el-col :span="12" class="h-full-calc">
@@ -30,7 +30,7 @@ import TargetSituation from "./components/TargetSituation/index.vue";
 import RiskIdentification from "./components/RiskIdentification/index.vue";
 import PointsRanking from "./components/PointsRanking/index.vue";
 import TargetMonth from "./components/TargetMonth/index.vue";
-import MapView from "../map-view/MapView.vue";
+// import MapView from "../map-view/MapView.vue";
 
 export default {
   components: {
@@ -39,7 +39,7 @@ export default {
     RiskIdentification,
     MapHy,
     PointsRanking,
-    MapView,
+    // MapView,
   },
   data() {
     return {