Sfoglia il codice sorgente

跳转后再回主页点击失效优化

dengliying 11 mesi fa
parent
commit
0130808df8
2 ha cambiato i file con 65 aggiunte e 11 eliminazioni
  1. 14 1
      ui/src/store/modules/settings.js
  2. 51 10
      ui/src/views/monitor/pfd/index.vue

+ 14 - 1
ui/src/store/modules/settings.js

@@ -9,11 +9,24 @@ const state = {
   tagsView: tagsView,
   fixedHeader: fixedHeader,
   sidebarLogo: sidebarLogo,
-  pfdPageImgeSize: 2148,
+  pfdPageImgeSize: {
+    imageWidth:2148,
+    areaLJLWidth: 248,
+    areaJLQWidth: 423,
+    areaZJQWidth: 802,
+    areaYSWidth: 520,
+    areaTBPWidth: 282,
+    areaRQ1Width: 520,
+    areaLQ_RQWidth: 666,
+    areaLQ_1Width: 666,
+    areaLQ_2Width: 320,
+    areaRQ2Width: 320,
+  },
 }
 
 const mutations = {
   CHANGE_SETTING: (state, { key, value }) => {
+    console.log("value")
     if (state.hasOwnProperty(key)) {
       state[key] = value
     }

+ 51 - 10
ui/src/views/monitor/pfd/index.vue

@@ -301,8 +301,21 @@ export default {
     },
     mounted () {
         this.$nextTick(() => {
-          // 获取store中记录的主图大小
-          this.imageWidth = this.$store.state.settings.pfdPageImgeSize;
+          // 获取store中记录的大小
+          this.imageWidth = this.$store.state.settings.pfdPageImgeSize.imageWidth;
+          this.areaLJLWidth = this.$store.state.settings.pfdPageImgeSize.areaLJLWidth;
+          this.areaJLQWidth = this.$store.state.settings.pfdPageImgeSize.areaJLQWidth;
+          this.areaZJQWidth = this.$store.state.settings.pfdPageImgeSize.areaZJQWidth;
+          this.areaYSWidth = this.$store.state.settings.pfdPageImgeSize.areaYSWidth;
+          this.areaTBPWidth = this.$store.state.settings.pfdPageImgeSize.areaTBPWidth;
+          this.areaRQ1Width = this.$store.state.settings.pfdPageImgeSize.areaRQ1Width;
+          this.areaLQ_RQWidth = this.$store.state.settings.pfdPageImgeSize.areaLQ_RQWidth;
+          this.areaLQ_1Width = this.$store.state.settings.pfdPageImgeSize.areaLQ_1Width;
+          this.areaLQ_2Width = this.$store.state.settings.pfdPageImgeSize.areaLQ_2Width;
+          this.areaRQ2Width = this.$store.state.settings.pfdPageImgeSize.areaRQ2Width;
+
+          console.log("this.imageWidth",this.$store.state.settings.pfdPageImgeSize);
+
           // 设置不同区域的缩放比例
           this.areaLJLScaleNum = parseFloat(this.scaleNum * (this.areaLJLWidth / this.imageWidth)).toFixed();
           this.areaJLQScaleNum = parseFloat(this.scaleNum * (this.areaJLQWidth / this.imageWidth)).toFixed();
@@ -885,20 +898,48 @@ export default {
       // 跳转页面
       handleToPage(id){
         // 记录图片大小
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'pfdPageImgeSize',
-          value: this.imageWidth
-        });
+        let imgSizeObj =  {
+              imageWidth:this.imageWidth,
+              areaLJLWidth: this.areaLJLWidth,
+              areaJLQWidth: this.areaJLQWidth,
+              areaZJQWidth: this.areaZJQWidth,
+              areaYSWidth: this.areaYSWidth,
+              areaTBPWidth: this.areaTBPWidth,
+              areaRQ1Width: this.areaRQ1Width,
+              areaLQ_RQWidth: this.areaLQ_RQWidth,
+              areaLQ_1Width: this.areaLQ_1Width,
+              areaLQ_2Width: this.areaLQ_2Width,
+              areaRQ2Width: this.areaRQ2Width,
+            }
+
+            this.$store.dispatch('settings/changeSetting', {
+              key: 'pfdPageImgeSize',
+              value: imgSizeObj
+            });
         //带参数跳转
         this.$router.push({ path: '/pfd/jlq' , query: { id: id }});
       },
       // 跳转c2c3页面
       handleToC2C3Page(){
         // 记录图片大小
-        this.$store.dispatch('settings/changeSetting', {
-          key: 'pfdPageImgeSize',
-          value: this.imageWidth
-        });
+        let imgSizeObj =  {
+              imageWidth:this.imageWidth,
+              areaLJLWidth: this.areaLJLWidth,
+              areaJLQWidth: this.areaJLQWidth,
+              areaZJQWidth: this.areaZJQWidth,
+              areaYSWidth: this.areaYSWidth,
+              areaTBPWidth: this.areaTBPWidth,
+              areaRQ1Width: this.areaRQ1Width,
+              areaLQ_RQWidth: this.areaLQ_RQWidth,
+              areaLQ_1Width: this.areaLQ_1Width,
+              areaLQ_2Width: this.areaLQ_2Width,
+              areaRQ2Width: this.areaRQ2Width,
+            }
+
+            this.$store.dispatch('settings/changeSetting', {
+              key: 'pfdPageImgeSize',
+              value: imgSizeObj
+            });
         this.$router.push({ path: '/pfd/c2c3' });
       }