Selaa lähdekoodia

Merge branch 'master' of http://124.70.43.205:3000/yangxiao/sis_zhfx

# Conflicts:
#	src/views/sampleDatabase/fault/point.vue
chenminghua 3 vuotta sitten
vanhempi
commit
e08ce473ad

+ 3 - 0
src/views/NewPages/alarm-center-1.vue

@@ -649,6 +649,7 @@ export default {
           map[k] = resData[i][k];
         }
       }
+      console.log("map", map);
       // nmap为新的map 整理数据结构
       const nmap = {};
       for (let kv in map) {
@@ -661,6 +662,7 @@ export default {
         }
         nmap[kv] = nchildMap;
       }
+      console.log("nmap", nmap);
       windNum = Object.keys(nmap);
       var cascaderOptions = [];
       var root = {}; // 原始根节点
@@ -700,6 +702,7 @@ export default {
         }
       }
       this.cascaderOptions = cascaderOptions;
+      console.log(123123, cascaderOptions);
     },
     fx() {
       this.startdate = new Date(this.startdate).formatDate("yyyy-MM-dd");

+ 44 - 13
src/views/NewPages/multiple-y-line-chart-normal.vue

@@ -284,12 +284,17 @@ export default {
         },
       ],
     },
+
+    markLineData: {
+      type: Array,
+      defaylt: () => [],
+    },
   },
   data() {
     return {
       id: "",
       chart: null,
-      color: ["#1DA0D7","#05BB4C","#323E6F", "#EDB32F", "#DB5520"],
+      color: ["#1DA0D7", "#05BB4C", "#323E6F", "#EDB32F", "#DB5520"],
     };
   },
   computed: {
@@ -336,7 +341,10 @@ export default {
           //分格线
           splitLine: {
             lineStyle: {
-              color: this.$store.state.themeName === "dark" ? partten.getColor("gray") : partten.getColor("black"),
+              color:
+                this.$store.state.themeName === "dark"
+                  ? partten.getColor("gray")
+                  : partten.getColor("black"),
               type: "dashed",
             },
           },
@@ -367,6 +375,26 @@ export default {
           },
           showSymbol: false,
           yAxisIndex: value.yAxisIndex,
+          markLine: this.markLineData
+            ? {
+                name: "",
+                silent: true,
+                label: {
+                  position: "end",
+                  formatter: "",
+                  color: "red",
+                  fontSize: 14,
+                },
+                data: this.markLineData,
+                lineStyle: {
+                  normal: {
+                    type: "dashed",
+                    color: "red",
+                    width: 2,
+                  },
+                },
+              }
+            : {},
           data: value.value.map((t) => {
             if (t.value || t.value === 0) {
               return t.value;
@@ -385,9 +413,8 @@ export default {
   methods: {
     resize() {},
     initChart() {
-		
       const chart = echarts.init(this.$el);
-	
+
       let option = this.option();
       chart.clear();
 
@@ -407,16 +434,20 @@ export default {
       window.addEventListener("resize", this.resize);
     },
     option: function () {
-		let themeName = '';
-		this.$store.state.themeName === "dark" ? themeName = true : themeName = false;
+      let themeName = "";
+      this.$store.state.themeName === "dark"
+        ? (themeName = true)
+        : (themeName = false);
       return {
         color: this.color,
         tooltip: {
           trigger: "axis",
-          triggerOn:this.default?"click":"mousemove",
-          alwaysShowContent:true,
-          backgroundColor: themeName ? "rgba(0,0,0,0.4)" : "rgba(255,255,255,0.5)",
-          borderColor: themeName ? partten.getColor("gray"): "#000",
+          triggerOn: this.default ? "click" : "mousemove",
+          alwaysShowContent: true,
+          backgroundColor: themeName
+            ? "rgba(0,0,0,0.4)"
+            : "rgba(255,255,255,0.5)",
+          borderColor: themeName ? partten.getColor("gray") : "#000",
           textStyle: {
             color: themeName ? "#fff" : "#000",
             fontSize: 12,
@@ -428,9 +459,9 @@ export default {
           top: "top",
           icon: "circle",
           itemWidth: 6,
-          inactiveColor: themeName ? partten.getColor("gray"): "#000",
+          inactiveColor: themeName ? partten.getColor("gray") : "#000",
           textStyle: {
-            color: themeName ? partten.getColor("grayl"): "#000",
+            color: themeName ? partten.getColor("grayl") : "#000",
             fontSize: 12,
           },
         },
@@ -455,7 +486,7 @@ export default {
               formatter: "{value}",
               fontSize: 12,
               textStyle: {
-                color: themeName ? partten.getColor("gray"): "#000",
+                color: themeName ? partten.getColor("gray") : "#000",
               },
             },
             data: this.xdata,

+ 24 - 13
src/views/sampleDatabase/fault/index.vue

@@ -160,8 +160,13 @@
       :close-on-click-modal="false"
       :before-close="onClickDialogClose"
       class="isvisiable"
+      @closed="
+        () => {
+          markLineData = [];
+        }
+      "
     >
-      <Point :data="gzCgdData" :st="st" v-if="gzCgd" />
+      <Point :data="gzCgdData" :st="st" :markLineData="markLineData" v-if="gzCgd" />
     </el-dialog>
     <el-dialog
       :title="'故障样本库' + addDialogTitle"
@@ -330,6 +335,7 @@ export default {
   data() {
     const that = this;
     return {
+      markLineData: [],
       btnText: "导入",
       addDialogTitle: "",
       addDialogShow: false,
@@ -644,20 +650,25 @@ export default {
             widget: row.widget,
           },
           success(res) {
-            if (res.code == 200) {
-              if (res.data.length) {
-                that.gzCgdData = res.data;
-                if (that.category == "0") {
-                  that.st = Date.parse(new Date(row.tableTime.split(" - ")[0]));
-                } else {
-                  that.st = Date.parse(new Date(row.faultTime));
-                }
-                that.gzCgd = true;
+            if (res.data.length) {
+              that.markLineData = [
+                {
+                  xAxis: new Date(row.tableTime.split(" - ")[0]).formatDate(
+                    "yyyy-MM-dd hh:mm"
+                  ),
+                },
+              ];
+              that.gzCgdData = res.data;
+              if (that.category == "0") {
+                that.st = Date.parse(new Date(row.tableTime.split(" - ")[0]));
               } else {
-                that.BASE.showMsg({
-                  msg: "暂无数据",
-                });
+                that.st = Date.parse(new Date(row.faultTime));
               }
+              that.gzCgd = true;
+            } else {
+              that.BASE.showMsg({
+                msg: "暂无数据",
+              });
             }
           },
         });

+ 7 - 3
src/views/sampleDatabase/fault/point.vue

@@ -59,7 +59,7 @@
         :list="Powertrend"
         :yAxises="PowertrendYAxises"
         :showLegend="true"
-      />
+        :markLineData="markLineData"/>
     </el-col>
   </el-row>
 </template>
@@ -115,7 +115,7 @@ export default {
         {
           value: "1800",
           label: "三十分钟",
-        },
+        }
       ],
       time: [that.st - 3600 * 1000 * 24, that.st + 1000 * 10 * 60],
       point: [],
@@ -198,6 +198,10 @@ export default {
     st: {
       type: String,
     },
+    markLineData: {
+      type: Array,
+      default: () => [],
+    },
   },
   methods: {
     onClickOption(e, row) {
@@ -283,7 +287,7 @@ export default {
             res.data.forEach((ele, index) => {
               ele.list.forEach((cEle) => {
                 Powertrend[index].value.push({
-                  text: new Date(cEle.ts).formatDate("hh:mm"),
+                  text: new Date(cEle.ts).formatDate("yyyy-MM-dd hh:mm"),
                   value: cEle.doubleValue,
                 });
               });