Browse Source

沙盘模块上传

Koishi 3 years ago
parent
commit
7790c287a7
1 changed files with 46 additions and 17 deletions
  1. 46 17
      src/views/SandTable/SandTable.vue

+ 46 - 17
src/views/SandTable/SandTable.vue

@@ -40,7 +40,7 @@
         <template v-slot:default>
           <RadarPieChart
             height="20.6vh"
-            :list="warmChartData"
+            :list="warnChartData"
             title="隐患情况"
           />
         </template>
@@ -101,16 +101,16 @@
           <Table :data="workData" />
         </div>
       </PanelSand>
-      <PanelSandToolbar class="right-panel mg-t-16" title="风险隐患详情">
+      <PanelSandToolbar class="right-panel mg-t-16" title="部件">
         <template v-slot:tools>
-          <div class="exchange" @click="exchange">
-            <span :class="exchangeBtn ? 'gray' : 'green'">预警</span>
+          <div class="exchange" @click="changeBjSwitch">
+            <span :class="bjSwitch ? 'gray' : 'green'">库存</span>
             <i class="green fa fa-exchange mg-l-8 mg-r-8"></i>
-            <span :class="exchangeBtn ? 'green' : 'gray'">时长</span>
+            <span :class="bjSwitch ? 'green' : 'gray'">记录</span>
           </div>
         </template>
         <template v-slot:default>
-          <RadarPieChart height="21vh" />
+          <RadarPieChart height="21vh" :list="bjChartData" title="部件情况" />
         </template>
       </PanelSandToolbar>
     </div>
@@ -335,7 +335,10 @@
       <template #title>
         <div class="dialogTitle">
           停机详情
-          <i class="jumpBtn el-icon-more" @click="jumpUrl('/health/gzzd/malfunctionRecall')"></i>
+          <i
+            class="jumpBtn el-icon-more"
+            @click="jumpUrl('/health/gzzd/malfunctionRecall')"
+          ></i>
         </div>
       </template>
       <el-form style="margin: 30px 0" label-width="120px" inline>
@@ -521,7 +524,7 @@ export default {
     return {
       videoShow: true,
       showPanel: false,
-      exchangeBtn: false,
+      bjSwitch: false,
       warnSwitch: false,
       timmer1: null,
       showWeatherDialog: false,
@@ -596,7 +599,8 @@ export default {
       ],
       showVideoDialog: false,
       dialogVideoUrl: "",
-      warmChartData: [],
+      warnChartData: [],
+      bjChartData: [],
       ForecastPower: [
         {
           name: "今日预测电量",
@@ -790,15 +794,15 @@ export default {
           stationid: that.wpId,
         },
         success(res) {
-          let warmChartData = [];
+          let warnChartData = [];
           for (let key in res.data) {
             const ele = res.data[key];
-            warmChartData.push({
+            warnChartData.push({
               value: ele.count,
               name: ele.relatePartsText,
             });
           }
-          that.warmChartData = warmChartData;
+          that.warnChartData = warnChartData;
         },
       });
     },
@@ -814,15 +818,39 @@ export default {
           stId: that.wpId,
         },
         success(res) {
-          let warmChartData = [];
+          let warnChartData = [];
           for (let key in res.data) {
             const ele = res.data[key];
-            warmChartData.push({
+            warnChartData.push({
               value: ele.count,
               name: ele.type,
             });
           }
-          that.warmChartData = warmChartData;
+          that.warnChartData = warnChartData;
+        },
+      });
+    },
+
+    // 获取库存玫瑰图
+    getRepertoryMGT() {
+      let that = this;
+      that.API.requestData({
+        method: "GET",
+        baseURL: "http://192.168.1.18:9988/",
+        subUrl: "inventory/groupcount",
+        data: {
+          stId: that.wpId,
+        },
+        success(res) {
+          let bjChartData = [];
+          for (let key in res.data) {
+            const ele = res.data[key];
+            bjChartData.push({
+              value: ele.curbal,
+              name: ele.description,
+            });
+          }
+          that.bjChartData = bjChartData;
         },
       });
     },
@@ -915,8 +943,8 @@ export default {
       this.showPanel = true;
     },
 
-    exchange() {
-      this.exchangeBtn = !this.exchangeBtn;
+    changeBjSwitch() {
+      this.bjSwitch = !this.bjSwitch;
     },
 
     changeWarnSwitch() {
@@ -937,6 +965,7 @@ export default {
     this.getWpHealthInfo();
     this.getTop4Info();
     this.getWarnMGT();
+    this.getRepertoryMGT();
     this.timeStr = new Date().formatDate("MM-dd hh:mm");
     this.timmer1 = setInterval(() => {
       this.timeStr = new Date().formatDate("MM-dd hh:mm");