Переглянути джерело

驾驶舱模块上传,中部地图模块接口对接,逻辑修改

yangxiao 3 роки тому
батько
коміт
6d113ca9df

+ 1 - 1
public/static/config/modeConfig.js

@@ -1,6 +1,6 @@
 
 // 本地联调开关
-const localTest = 0;
+const localTest = 1;
 
 // 服务器地址
 let baseURL = null;

+ 21 - 18
src/views/Home/Home.vue

@@ -468,24 +468,7 @@ export default {
       wpId: "0",
       fcmap:{},
       // 预测电量
-      ForecastPower: [
-        {
-          name: "当日预测电量",
-          value: 103.62,
-        },
-        {
-          name: "实际发电量",
-          value: 98.62,
-        },
-        {
-          name: "当月预测电量",
-          value: 113.27,
-        },
-        {
-          name: "实际发电量",
-          value: 136.72,
-        },
-      ],
+      ForecastPower: [],
       // 日发电量
       DayPower: {
         // 图表所用单位
@@ -521,6 +504,7 @@ export default {
         showLoading,
         method: "POST",
         subUrl: "genreset/findBasicDataInfo",
+        timeout: 60000,
         data: {
           id: that.wpId,
         },
@@ -617,6 +601,25 @@ export default {
           that.gxkmap = res.data.gxkmap;
           that.mxztmap = res.data.mxztmap;
           that.fcmap = res.data.fcmap;
+
+          that.ForecastPower = [{
+            name: "当日预测电量",
+            value: res.data.jczbmap.rycfdl,
+            total: res.data.jczbmap.rfdlsx
+          },{
+            name: "实际发电量",
+            value: res.data.jczbmap.rfdl,
+            total: res.data.jczbmap.rfdlsx
+          },{
+            name: "当月预测电量",
+            value: res.data.jczbmap.yycfdl,
+            total: res.data.jczbmap.yfdlsx
+          },{
+            name: "实际发电量",
+            value: res.data.jczbmap.yfdl,
+            total: res.data.jczbmap.yfdlsx
+          }];
+
           that.planData = {
             yfdl: res.data.jczbmap.yfdl,
             nfdl: res.data.jczbmap.nfdl,

+ 22 - 10
src/views/Home/components/map.vue

@@ -16,7 +16,7 @@
         <span>{{ tab.text }}</span>
       </div>
     </div>
-    <div class="return" @click="backMap" v-show="!nxmap">
+    <div class="return" @click="backMap" v-show="mapName !== 'nx'">
       <span class="svg-icon svg-icon-sm">
         <svg-icon :svgid="'svg-arrow-dpwn-1'" />
       </span>
@@ -82,15 +82,21 @@
       </svg>
     </div>
     <div class="map-img">
-      <SvgMap v-if="!nxmap"></SvgMap>
-      <SvgMapNX v-if="nxmap" :show="showType" :data="sourceMap" @clickLabel="clickLabel"></SvgMapNX>
+      <!-- 宁夏地图总览 -->
+      <SvgMapNX v-if="mapName === 'nx'" :show="showType" :data="sourceMap" @clickLabel="clickLabel"></SvgMapNX>
+      <!-- 麻黄山风电场 -->
+      <MHSFDC v-if="mapName === 'MHS_FDC'" :data="sourceMap" @clickFj="clickFj"></MHSFDC>
     </div>
   </div>
 </template>
 
 <script>
-import SvgMap from "./map/svg-map.vue";
+// 宁夏地图总览
 import SvgMapNX from "./map/svg-map-nx.vue";
+
+// 麻黄山风电场
+import MHSFDC from "./map/MHS_FDC.vue";
+
 import SvgIcon from "../../../components/coms/icon/svg-icon.vue";
 import compassIcon from "@/assets/icon/svg_fill/compass.svg";
 export default {
@@ -98,8 +104,8 @@ export default {
   name: "Map",
   // 使用组件
   components: {
-    SvgMap,
     SvgMapNX,
+    MHSFDC,
     SvgIcon,
   },
   props:{
@@ -150,7 +156,7 @@ export default {
       activeTab: 0,
       img: require("@assets/map/map-nx.png"),
       nxSvgFile: require("@assets/map/map-nx.svg"),
-      nxmap: true,
+      mapName: "nx",
     };
   },
   // 函数
@@ -160,14 +166,20 @@ export default {
       this.showType = showType;
       let wpId = (showType === "all" ? "0" : showType === "fc" ? "-1" : "-2");
       this.safeDay = "---";
+      this.mapName = "nx";
       this.$emit("mapClick", wpId);
     },
-    backMap: function() {
-      this.nxmap = true;
+    backMap() {
+      // this.mapName = "nx";
+      // this.$emit("mapClick", wpId);
     },
-    clickLabel: function() {
-      this.nxmap = false;
+    clickLabel(wpId) {
+      this.mapName = wpId;
+      this.$emit("mapClick", wpId);
     },
+    clickFj(wpId){
+      this.$emit("mapClick", wpId);
+    }
   },
   watch:{
     wpId(res){

Різницю між файлами не показано, бо вона завелика
+ 46 - 36
src/views/Home/components/map/svg-map.vue


+ 12 - 12
src/views/Home/components/map/svg-map-nx.vue

@@ -83,7 +83,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('XS_FDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="180" y="207" fill="#919697" font-size="14">香山</text>
@@ -103,7 +103,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('MCH_GDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="310" y="52" fill="#919697" font-size="14">马场湖</text>
@@ -123,7 +123,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('XH_GDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="320" y="92" fill="#919697" font-size="14">宣和</text>
@@ -143,12 +143,12 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('NSS_FDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="440" y="77" fill="#919697" font-size="14">牛首山</text>
                 <!-- +70 0 -->
-                <text x="505" y="77" fill="#05bb4c" font-size="14">126台</text>
+                <text x="505" y="77" fill="#05bb4c" font-size="14">{{sourceMap.NSS_FDC_zjts}}</text>
             </g>
             <g v-if="showType === 'all' || showType === 'gf'">
                 <use xlink:href="#nx-map-line-1" x="570" y="5" />
@@ -163,7 +163,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('DWK_GDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="600" y="17" fill="#919697" font-size="14">大武口</text>
@@ -183,7 +183,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('PL_GDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="620" y="42" fill="#919697" font-size="14">平罗</text>
@@ -203,7 +203,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('SBQ_FDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="410" y="137" fill="#919697" font-size="14">石板泉</text>
@@ -223,7 +223,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('MHS_FDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="420" y="167" fill="#919697" font-size="14">麻黄山</text>
@@ -243,7 +243,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickLabel"
+                    @click.stop="clickLabel('QS_FDC')"
                 />
                 <!-- +5 +12| -->
                 <text x="460" y="192" fill="#919697" font-size="14">青山</text>
@@ -286,8 +286,8 @@ export default {
     },
     // 函数
     methods: {
-        clickLabel: function () {
-           this.$emit("clickLabel");
+        clickLabel(wpId) {
+           this.$emit("clickLabel", wpId);
         },
         mouseover() {},
     },