Browse Source

驾驶舱模块顶部地图传参修改

yangxiao 3 years ago
parent
commit
1551bd7f9c

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

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

+ 4 - 2
src/views/Home/Home.vue

@@ -38,7 +38,7 @@
         <Row type="flex">
           <Col :span="24">
             <com-panel title="计划电量完成情况" sub-title="(单位:万KWh)">
-              <power-plan :data="planData" :showSingle="powerplanShowSingle" :id="wpId" @chartClick="showDownChart" />
+              <power-plan :data="planData" :title="planBtnName" :showSingle="powerplanShowSingle" :id="wpId" @chartClick="showDownChart" />
             </com-panel>
           </Col>
         </Row>
@@ -478,6 +478,7 @@ export default {
       powerData: {},
       tqmap:{},
       nowTime:"",
+      planBtnName:"全部",
       powerLineChartData: {
         // 图表所用单位
         units: [""],
@@ -688,7 +689,8 @@ export default {
     },
 
     // 点击地图展示类型
-    changeShowType(wpId){
+    changeShowType(wpId, planBtnName){
+      this.planBtnName = planBtnName;
       clearInterval(this.timmer);
       this.timmer = null;
       this.wpId = wpId;

+ 5 - 5
src/views/Home/components/map.vue

@@ -171,18 +171,18 @@ export default {
       let wpId = (showType === "all" ? "0" : showType === "fc" ? "-1" : "-2");
       this.safeDay = "---";
       this.mapName = "nx";
-      this.$emit("mapClick", wpId);
+      this.$emit("mapClick", wpId, this.tabs[index].text);
     },
     backMap() {
       // this.mapName = "nx";
       // this.$emit("mapClick", wpId);
     },
-    clickLabel(wpId) {
+    clickLabel(wpId, planBtnName) {
       this.mapName = wpId;
-      this.$emit("mapClick", wpId);
+      this.$emit("mapClick", wpId, planBtnName);
     },
-    clickFj(wpId){
-      this.$emit("mapClick", wpId);
+    clickFj(wpId, planBtnName){
+      this.$emit("mapClick", wpId, planBtnName);
     }
   },
   watch:{

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

@@ -117,7 +117,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickFj('MHS03_XL')"
+                    @click.stop="clickFj('MHS03_XL', '麻黄山3#')"
                 />
                 <text x="250" y="37" fill="#919697" font-size="14">
                     3#集电线
@@ -136,7 +136,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickFj('MHS04_XL')"
+                    @click.stop="clickFj('MHS04_XL', '麻黄山4#')"
                 />
                 <text x="510" y="95" fill="#919697" font-size="14">
                     4#集电线
@@ -155,7 +155,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickFj('MHS02_XL')"
+                    @click.stop="clickFj('MHS02_XL', '麻黄山2#')"
                 />
                 <text x="290" y="144" fill="#919697" font-size="14">
                     2#集电线
@@ -174,7 +174,7 @@
                     fill="#000000"
                     opacity="0.8"
                     class="item-label"
-                    @click.stop="clickFj('MHS01_XL')"
+                    @click.stop="clickFj('MHS01_XL', '麻黄山1#')"
                 />
                 <text x="370" y="214" fill="#919697" font-size="14">
                     1#集电线
@@ -191,7 +191,7 @@
                 stroke-dasharray="8 4"
                 stroke-width="1"
             />
-            <text x="140" y="340" fill="#ffffff" font-size="14" class="curStyle" @click.stop="changeshowType('MHS01_GC')">一期</text>
+            <text x="140" y="340" fill="#ffffff" font-size="14" class="curStyle" @click.stop="changeshowType('MHS01_GC', '麻黄山一期')">一期</text>
             <line
                 x1="580"
                 y1="130"
@@ -201,7 +201,7 @@
                 stroke-dasharray="8 4"
                 stroke-width="1"
             />
-            <text x="650" y="120" fill="#ffffff" font-size="14" class="curStyle" @click.stop="changeshowType('MHS02_GC')">二期</text>
+            <text x="650" y="120" fill="#ffffff" font-size="14" class="curStyle" @click.stop="changeshowType('MHS02_GC', '麻黄山二期')">二期</text>
         </svg>
     </div>
 </template>
@@ -234,12 +234,12 @@ export default {
     },
     // 函数
     methods: {
-        changeshowType(id) {
+        changeshowType(id, planBtnName) {
             this.activeId = id;
-            this.$emit("clickFj", id);
+            this.$emit("clickFj", id, planBtnName);
         },
-        clickFj(id){
-          this.$emit("clickFj", id);
+        clickFj(id, planBtnName){
+          this.$emit("clickFj", id, planBtnName);
         }
     },
     created() {

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

@@ -93,7 +93,7 @@
                 transform="matrix(1 0 0 1 -113 60.6679)"
             ></image>
 
-            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click.stop="clickLabel('XS_FDC')" @mouseover="mouseover(0)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click.stop="clickLabel('XS_FDC', '香山风电场')" @mouseover="mouseover(0)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="150" y="195" />
                 <use xlink:href="#nx-map-circle-1" x="150" y="195" />
                 <!-- +25 -5 -->
@@ -111,7 +111,7 @@
                 <!-- +70 0 -->
                 <text x="245" y="207" fill="#05bb4c" font-size="14">{{sourceMap.XS_FDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click.stop="clickLabel" @mouseover="mouseover(1)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click.stop="clickLabel('MCH_GDC', '马场湖光电厂')" @mouseover="mouseover(1)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="280" y="40" />
                 <use xlink:href="#nx-map-circle-1" x="280" y="40" />
                 <!-- +25 -5 -->
@@ -129,7 +129,7 @@
                 <!-- +70 0 -->
                 <text x="375" y="52" fill="#05bb4c" font-size="14">{{sourceMap.MCH_GDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click.stop="clickLabel('XH_GDC')" @mouseover="mouseover(2)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click.stop="clickLabel('XH_GDC', '宣和光电厂')" @mouseover="mouseover(2)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="290" y="80" />
                 <use xlink:href="#nx-map-circle-1" x="290" y="80" />
                 <!-- +25 -5 -->
@@ -147,7 +147,7 @@
                 <!-- +70 0 -->
                 <text x="385" y="92" fill="#05bb4c" font-size="14">{{sourceMap.XH_GDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click.stop="clickLabel('NSS_FDC')" @mouseover="mouseover(3)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click.stop="clickLabel('NSS_FDC', '牛首山风电场')" @mouseover="mouseover(3)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="410" y="65" />
                 <use xlink:href="#nx-map-circle-1" x="410" y="65" />
                 <!-- +25 -5 -->
@@ -165,7 +165,7 @@
                 <!-- +70 0 -->
                 <text x="505" y="77" fill="#05bb4c" font-size="14">{{sourceMap.NSS_FDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click="clickLabel('DWK_GDC')" @mouseover="mouseover(4)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click="clickLabel('DWK_GDC', '大武口电厂')" @mouseover="mouseover(4)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="570" y="5" />
                 <use xlink:href="#nx-map-circle-1" x="570" y="5" />
                 <!-- +25 -5 -->
@@ -183,7 +183,7 @@
                 <!-- +70 0 -->
                 <text x="665" y="17" fill="#05bb4c" font-size="14">{{sourceMap.DWK_GDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click="clickLabel('PL_GDC')" @mouseover="mouseover(5)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'gf'" class="item-label" @click="clickLabel('PL_GDC', '平罗光电厂')" @mouseover="mouseover(5)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="590" y="30" />
                 <use xlink:href="#nx-map-circle-1" x="590" y="30" />
                 <!-- +25 -5 -->
@@ -201,7 +201,7 @@
                 <!-- +70 0 -->
                 <text x="685" y="42" fill="#05bb4c" font-size="14">{{sourceMap.PL_GDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'fc'" class="item-label"  @click="clickLabel('SBQ_FDC')" @mouseover="mouseover(6)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'fc'" class="item-label"  @click="clickLabel('SBQ_FDC', '石板泉风电场')" @mouseover="mouseover(6)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="380" y="125" />
                 <use xlink:href="#nx-map-circle-1" x="380" y="125" />
                 <!-- +25 -5 -->
@@ -219,7 +219,7 @@
                 <!-- +70 0 -->
                 <text x="475" y="137" fill="#05bb4c" font-size="14">{{sourceMap.SBQ_FDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click="clickLabel('MHS_FDC')" @mouseover="mouseover(7)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click="clickLabel('MHS_FDC', '麻黄山风电场')" @mouseover="mouseover(7)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="390" y="155" />
                 <use xlink:href="#nx-map-circle-1" x="390" y="155" />
                 <!-- +25 -5 -->
@@ -237,7 +237,7 @@
                 <!-- +70 0 -->
                 <text x="485" y="167" fill="#05bb4c" font-size="14">{{sourceMap.MHS_FDC_zjts}}台</text>
             </g>
-            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click="clickLabel('QS_FDC')" @mouseover="mouseover(8)" @mouseout="mouseout">
+            <g v-if="showType === 'all' || showType === 'fc'" class="item-label" @click="clickLabel('QS_FDC', '青山风电场')" @mouseover="mouseover(8)" @mouseout="mouseout">
                 <use xlink:href="#nx-map-line-1" x="430" y="180" />
                 <use xlink:href="#nx-map-circle-1" x="430" y="180" />
                 <!-- +25 -5 -->
@@ -420,8 +420,8 @@ export default {
     },
     // 函数
     methods: {
-        clickLabel(wpId) {
-           this.$emit("clickLabel", wpId);
+        clickLabel(wpId, planBtnName) {
+           this.$emit("clickLabel", wpId, planBtnName);
         },
         popupHide: function () {
             for (let i = 0; i < this.popup.length; i++) {

+ 10 - 1
src/views/Home/components/power-plan.vue

@@ -23,11 +23,12 @@ export default {
     return {
       planData: {},
       wpId: "",
+      showTitle:"",
       // tab项
       tabs: [
         {
           id: "1",
-          text: "风电"
+          text: ""
         }
       ],
       // 月计划完成率
@@ -54,6 +55,10 @@ export default {
     id:{
       type: String,
       default: ""
+    },
+    title:{
+      type: String,
+      default: ""
     }
   },
   computed: {
@@ -71,6 +76,7 @@ export default {
   mounted() {
     this.planData = this.data;
     this.wpId = this.id;
+    this.tabs[0].text = this.title;
   },
   methods: {
     selectionItemClick (item) {
@@ -145,6 +151,9 @@ export default {
     },
     id(res){
       this.wpId = res;
+    },
+    title(res){
+      this.tabs[0].text = res;
     }
   }
 };