瀏覽代碼

场站监视、风机列表、单机状态监视、测风塔模块路由修改,确保携带参数不丢失

yangxiao 3 年之前
父節點
當前提交
f0ae524739

+ 0 - 2
src/components/coms/cards/percent-card-2.vue

@@ -53,8 +53,6 @@ export default {
   },
   computed: {
     percent() {
-      console.log(111,this.TotalValue)
-      console.log(222,this.ActualValue)
       // return parseInt((this.ActualValue / this.TotalValue) * 100);
       return parseInt((this.TotalValue / this.ActualValue) * 100);
     },

+ 4 - 4
src/router/index.js

@@ -27,10 +27,10 @@ const routes = [
     name: 'WindSite',
     component: () => import(/* webpackChunkName: "windsite" */ '../views/WindSite/WindSite.vue'),
     children: [{
-      path: 'home',  // 场站监视
+      path: 'home/:wpId',  // 场站监视
       component: () => import(/* webpackChunkName: "windsitehome" */ '../views/WindSite/pages/Home/Home.vue'),
     }, {
-      path: 'draughtfanlist', // 风机列表
+      path: 'draughtfanlist/:wpId', // 风机列表
       component: () => import(/* webpackChunkName: "windsitedraughtfanlist" */ '../views/WindSite/pages/DraughtFanList.vue'),
     }, {
       path: 'matrix', // 风场矩阵
@@ -42,10 +42,10 @@ const routes = [
       path: 'box',
       component: () => import(/* webpackChunkName: "windsitebox" */ '../views/WindSite/pages/Box.vue'),
     }, {
-      path: 'info', // 单机状态监视
+      path: 'info/:wpId', // 单机状态监视
       component: () => import(/* webpackChunkName: "windsitebox" */ '../views/WindSite/pages/Info/Info.vue'),
     }, {
-      path: 'tower',
+      path: 'tower/:wpId',
       component: () => import(/* webpackChunkName: "windsitetower" */ '../views/WindSite/pages/Tower.vue'),
     }, {
       path: 'inverter-info',

+ 0 - 1
src/views/Home/Home.vue

@@ -621,7 +621,6 @@ export default {
             ywcl: res.data.gxkmap.ywcl,
             nwcl: res.data.gxkmap.nwcl
           };
-          console.log(111, res);
         },
       });
     },

+ 4 - 4
src/views/Home/components/power-plan.vue

@@ -3,12 +3,12 @@
     <tab @select="selectionItemClick" :data="tabs" class="power-plan-tab" />
     <row>
       <Col :span="12">
-      <percent-card-2 :title="'月完成率' + (planData.ywcl || '') + '%'" TotalText="实际" ActualText="计划" :TotalValue="planData.yfdl"
-        :ActualValue="planData.yfdljh" :percent="planData.ywcl" />
+      <percent-card-2 :title="'月完成率' + parseInt((planData.yfdl / planData.yfdljh * 100)) + '%'" TotalText="实际"
+        ActualText="计划" :TotalValue="planData.yfdl" :ActualValue="planData.yfdljh" :percent="planData.ywcl" />
       </Col>
       <Col :span="12">
-      <percent-card-2 :title="'年完成率' + (planData.nwcl || '') + '%'" TotalText="实际" ActualText="计划" :TotalValue="planData.nfdl"
-        :ActualValue="planData.nfdljh" :percent="planData.nwcl" />
+      <percent-card-2 :title="'年完成率' + parseInt((planData.nfdl / planData.nfdljh * 100)) + '%'" TotalText="实际"
+        ActualText="计划" :TotalValue="planData.nfdl" :ActualValue="planData.nfdljh" :percent="planData.nwcl" />
       </Col>
     </row>
   </div>

+ 3 - 3
src/views/Status/components/status-panel.vue

@@ -75,10 +75,10 @@ export default {
   },
   // 函数
   methods: {
-    jumpPage(id) {
+    jumpPage(wpId) {
       this.$router.push({
-        path: "/windsite/home",
-        query: { wpId: id },
+        path: `/windsite/home/${wpId}`,
+        // query: { wpId: id },
       });
     },
   },

+ 11 - 6
src/views/WindSite/WindSite.vue

@@ -10,7 +10,8 @@
           <div class="page-common-body-menu-border left bottom"></div>
           <div class="page-common-body-menu-border right top"></div>
           <div class="page-common-body-menu-border right bottom"></div>
-          <div class="page-common-body-menu-item" v-for="(menuData, index) of menuDatas" :key="index" @click="clickMenu(index)" :class="{ active: activeIndex == index }">
+          <div class="page-common-body-menu-item" v-for="(menuData, index) of menuDatas" :key="index" @click="clickMenu(index)"
+            :class="{ active: activeIndex == index }">
             <router-link :to="menuData.path">
               <span class="svg-icon" :class="activeIndex == index ? 'svg-icon-yellow' : 'svg-icon-green'">
                 <SvgIcon :svgid="menuData.icon"></SvgIcon>
@@ -33,7 +34,7 @@ export default {
     SvgIcon,
   },
   // 数据
-  data() {
+  data () {
     return {
       activeIndex: 0,
       menuDatas: [
@@ -82,14 +83,18 @@ export default {
   },
   // 函数
   methods: {
-    clickMenu: function(index) {
+    clickMenu: function (index) {
       this.activeIndex = index;
     },
   },
 
-  created() {},
+  created () {
+    this.menuDatas.forEach(ele => {
+      ele.path += ("/" + this.$route.params.wpId);
+    });
+  },
 
-  mounted() {},
+  mounted () { },
 };
 </script>
 
@@ -165,7 +170,7 @@ export default {
             position: relative;
 
             &::after {
-              content: "";
+              content: '';
               width: calc(100% - 0.37vh);
               height: calc(100% - 0.37vh);
               position: absolute;

+ 2 - 1
src/views/WindSite/pages/DraughtFanList.vue

@@ -202,7 +202,7 @@ export default {
         method: "POST",
         subUrl: "monitorwt/findWtInfoList",
         data: {
-          wpId: "MHS_FDC",
+          wpId: that.wpId
         },
         success(res) {
           res.data.forEach((ele) => {
@@ -220,6 +220,7 @@ export default {
 
   created() {
     let that = this;
+    that.wpId = that.$route.params.wpId;
     that.$nextTick(() => {
       that.requestData(false);
       that.timmer = setInterval(() => {

+ 1 - 1
src/views/WindSite/pages/Home/Home.vue

@@ -616,7 +616,7 @@ export default {
 
   created() {
     let that = this;
-    that.wpId = that.$route.query.wpId;
+    that.wpId = that.$route.params.wpId;
     that.$nextTick(() => {
       that.requestData(false);
 

+ 2 - 1
src/views/WindSite/pages/Info/Info.vue

@@ -139,7 +139,7 @@ export default {
         method: "POST",
         subUrl: "matrix/findSimpleMatrixAll",
         data: {
-          wpId: "MHS_FDC",
+          wpId: that.wpId,
         },
         success(res) {
           let WindSites = [];
@@ -212,6 +212,7 @@ export default {
 
   created() {
     let that = this;
+    that.wpId = that.$route.params.wpId;
     that.$nextTick(() => {
       that.requestData(false);
       that.timmer = setInterval(() => {

+ 2 - 1
src/views/WindSite/pages/Tower.vue

@@ -141,7 +141,7 @@ export default {
         method: "POST",
         subUrl: "monitor/findCftInfo",
         data: {
-          wpId: "MHS_FDC",
+          wpId: that.wpId,
         },
         success(res) {
           let rmgtmap = {
@@ -242,6 +242,7 @@ export default {
 
   created() {
     let that = this;
+    that.wpId = that.$route.params.wpId;
     that.$nextTick(() => {
       that.requestData(false);
       that.timmer = setInterval(() => {