Kaynağa Gözat

演示修改默认参数

rui.jiang 4 ay önce
ebeveyn
işleme
e4a8532c82
5 değiştirilmiş dosya ile 31 ekleme ve 14 silme
  1. 1 1
      .env.demo
  2. 1 0
      .env.dev
  3. 1 0
      .env.hd
  4. 14 11
      src/views/health/malfunction.vue
  5. 14 2
      src/views/health/vibration.vue

+ 1 - 1
.env.demo

@@ -11,7 +11,7 @@
 #VUE_APP_HOME_COM="../views/admin/cockpitManage/Index.vue"
 VUE_APP_THEM="green"
 VUE_APP_ISSHOWHD='default'
-
+VUE_APP_Helath='demo'
 VUE_APP_TITLE='机组功率曲线异常检测数据分析系统'
 #外网
 # # VUE_APP_MAPVIEW=http://106.120.102.238:18998/tiles/{z}/{x}/{y}.png

+ 1 - 0
.env.dev

@@ -9,6 +9,7 @@
 #VUE_APP_HOME_COM="../views/admin/cockpitManage/Index.vue"
 VUE_APP_THEM="green"
 VUE_APP_ISSHOWHD='default'
+VUE_APP_Helath='dev'
 VUE_APP_TITLE='机组功率曲线异常检测数据分析系统'
 
 #外网

+ 1 - 0
.env.hd

@@ -1,6 +1,7 @@
 VUE_APP_THEM="blue"
 VUE_APP_ISSHOWHD='HD'
 VUE_APP_TITLE='风电机组健康诊断平台'
+VUE_APP_Helath='hd'
 
 #外网
 VUE_APP_MAPVIEW="http://106.120.102.238:18000/tiles/{z}/{x}/{y}.png"

+ 14 - 11
src/views/health/malfunction.vue

@@ -235,7 +235,11 @@ export default {
     for (const key in this.tabConditions) {
       this.tabConditions[key] = this.defaultCondition();
     }
-    this.GETtree();
+    if (process.env.VUE_APP_Helath === "demo") {
+      this.GETtreedemo();
+    } else {
+      this.GETtree();
+    }
   },
   methods: {
     defaultCondition() {
@@ -255,18 +259,18 @@ export default {
       this.activeTab = tab.name;
     },
 
-    // async GETtree() {
-    //   const res = await getSysOrganizationAuthTreeByRoleId();
-    //   const treedata = res.data;
-    //   const processed = this.processTreeData(treedata);
+    async GETtree() {
+      const res = await getSysOrganizationAuthTreeByRoleId();
+      const treedata = res.data;
+      const processed = this.processTreeData(treedata);
 
-    //   for (const key in this.tabConditions) {
-    //     this.tabConditions[key].parentOpt = processed;
-    //   }
-    // },
+      for (const key in this.tabConditions) {
+        this.tabConditions[key].parentOpt = processed;
+      }
+    },
 
     // demo演示所需,必要时可删除
-    async GETtree() {
+    async GETtreedemo() {
       const res = await getSysOrganizationAuthTreeByRoleId();
       const treedata = res.data;
       const processed = this.processTreeData(treedata);
@@ -286,7 +290,6 @@ export default {
         if (key === "Gear") {
           // Gear tab:保留主轴承 + 齿轮箱测点
           this.$set(tab, "monitoringoptions", [
-       
             {
               itemKey: "gearbox_first_stage_planet_large_ring_radial_vibration",
               itemValue: "齿轮箱一级行星级大齿圈径向振动",

+ 14 - 2
src/views/health/vibration.vue

@@ -381,7 +381,7 @@ export default {
           "齿轮箱高速轴输出端轴向振动",
       },
 
-     // demo演示所需,必要时可删除
+      // demo演示所需,必要时可删除
       unitvalue: "#37",
       unitoptions: [
         {
@@ -404,7 +404,11 @@ export default {
   },
 
   created() {
-    this.GETtree();
+    if (process.env.VUE_APP_Helath === "demo") {
+      this.GETtreedemo();
+    } else {
+      this.GETtree();
+    }
   },
   watch: {
     // 监听 timeList 的变化
@@ -456,6 +460,14 @@ export default {
       const processedData = this.processTreeData(treedata);
       this.parentOpt = processedData;
       this.defaultdata = res.data[0];
+    },
+
+    async GETtreedemo() {
+      const res = await getSysOrganizationAuthTreeByRoleId();
+      const treedata = res.data;
+      const processedData = this.processTreeData(treedata);
+      this.parentOpt = processedData;
+      this.defaultdata = res.data[0];
 
       // demo演示
       this.$nextTick(() => {