Bläddra i källkod

监控页面图表 左侧随之变化 主运输罐子位置自适应 生产流程监控位置

秦娜敏 3 år sedan
förälder
incheckning
a59cfc2198

+ 14 - 0
package-lock.json

@@ -4478,6 +4478,11 @@
         "assert-plus": "^1.0.0"
       }
     },
+    "dayjs": {
+      "version": "1.11.0",
+      "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.0.tgz",
+      "integrity": "sha512-JLC809s6Y948/FuCZPm5IX8rRhQwOiyMb2TfVVQEixG7P8Lm/gt5S7yoQZmC8x1UehI9Pb7sksEt4xx14m+7Ug=="
+    },
     "de-indent": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
@@ -8479,6 +8484,15 @@
         "minimist": "^1.2.5"
       }
     },
+    "mockjs": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz",
+      "integrity": "sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==",
+      "dev": true,
+      "requires": {
+        "commander": "*"
+      }
+    },
     "moment": {
       "version": "2.29.1",
       "resolved": "https://registry.npmmirror.com/moment/download/moment-2.29.1.tgz",

+ 2 - 0
package.json

@@ -12,6 +12,7 @@
     "ant-design-vue": "^1.7.8",
     "axios": "^0.21.4",
     "core-js": "^2.6.5",
+    "dayjs": "^1.11.0",
     "echarts": "^5.2.2",
     "element-ui": "^2.15.2",
     "flv.js": "^1.6.2",
@@ -42,6 +43,7 @@
     "jsdoc": "^3.6.10",
     "jsdoc-vuejs": "^4.0.0",
     "less": "^4.1.2",
+    "mockjs": "^1.1.0",
     "node-sass": "^7.0.1",
     "sass": "^1.25.0",
     "sass-loader": "^8.0.2",

+ 11 - 12
src/common/dataDetail/dataDetail_chart.vue

@@ -2,7 +2,7 @@
   <div>
     <div style="margin-top:8px">
       <span style="font-size: 10px;">搜索:</span>
-    <el-select style="width: 200px" v-model="currentSubEquipnameId" placeholder="请选择"
+    <el-select style="width: 200px" v-model="currentSubEquipnameId" placeholder="请选择" v-loading="optionLoading"
                @change="selectCurrentpoint()">
       <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
       </el-option>
@@ -10,8 +10,8 @@
     </div>
       <template>
 
-        <el-table :data="tableData" style="width: 100%" @header-click="mpQuality" v-loading="dataListLoading">
-          <el-table-column prop="rowKey" label="日期" width="150">
+        <el-table :data="tableData" style="width: 100%" @header-click="mpQuality"  v-loading="dataListLoading" >
+          <el-table-column prop="rowKey" label="日期" width="200">
             <template slot-scope="scope">
               {{tableData[scope.$index].rowKey}}
             </template>
@@ -85,7 +85,7 @@ export default {
     return {
       page:1,  //当前第几页
       size:10, //当前每页页数
-      total:100, //全部数据量
+      total:50, //全部数据量
       visible: false,
       // 当前下拉选框对应的hbase表名
       hbasetablename:'',
@@ -103,11 +103,7 @@ export default {
         name: '2#滚筒'
       }],
 
-      tableData:[{
-        before:[1,2,3],
-        after:[4,5,6]
-
-      }
+      tableData:[
 
       ],
 
@@ -135,7 +131,8 @@ export default {
       subEuipname:'',
       currentEquipname:'',
 
-      dataListLoading: false,
+      dataListLoading: true,
+      optionLoading: true,
 
       timer: null
     }
@@ -228,6 +225,7 @@ export default {
           this.currentSubEquipnameId = this.options[0].id;
           this.subEuipname = this.options[0].name;
           this.hbasetablename = this.options[0].hbasetablename;
+          this.optionLoading = false;
           // console.log(this.hbasetablename);
           this.initData()
         }
@@ -235,7 +233,7 @@ export default {
     },
     // 根据子设备id拿到对应的测点,并展示在table中
     initData() {
-      this.dataListLoading = true
+      // this.dataListLoading = true
 
       // this.currentSubEquipnameId = parseInt(this.currentSubEquipnameId);
       this.getRequest('/dataQualityMeasurePoint/getMeasurePointBySubEquipmentId/?subEquipmentId=' + this.currentSubEquipnameId + '&page=' + this.page + '&size=' + this.size).then(resp => {
@@ -243,12 +241,13 @@ export default {
         if (resp) {
 
           this.tableHeader = resp.data.data;
+          this.dataListLoading = false;
           // console.log('this.tableHeader');
           // console.log(this.tableHeader);
           this.total = resp.data.total;
         }
       });
-      this.dataListLoading = false
+      
       this.startGetData()
     },
     getHbaseData() {

+ 1 - 1
src/common/m3u8.vue

@@ -16,7 +16,7 @@ export default {
   props: {
     src: {
       type: String,
-      default: "123",
+      default: "http://playtv-live.ifeng.com/live/06OLEEWQKN4_tv1.m3u8",
     },
   },
   data() {

+ 10 - 1
src/components/monitor/detailedTable.vue

@@ -1,7 +1,7 @@
 <template>
   <!-- 采煤工作面设备 的 故障记录 -->
   <div class="table-wrapper main">
-    <el-table :data="tableData" max-height="200">
+    <el-table :data="tableData" max-height="200" @row-click="rowCilck" @cell-mouse-enter="cellMouseEnter">
       <el-table-column prop="serialNumber" label="测点编号" width="130">
       </el-table-column>
       <el-table-column prop="place" label="安装位置" width="230">
@@ -65,6 +65,12 @@ export default {
     tableRowStyle({ row, rowIndex }) {
       return "background-color:#ecf5ff";
     },
+    rowCilck(row){
+      this.$bus.$emit("changeMpId", row.serialNumber);
+    },
+    cellMouseEnter(row, column, cell, event){
+      console.log(row);
+    }
   },
 };
 </script>
@@ -102,6 +108,9 @@ export default {
   background-color: transparent !important;
   border: none;
 }
+.table-wrapper ::v-deep .el-table tr:hover {
+  cursor:pointer;
+}
 .table-wrapper ::v-deep .el-table th {
   background-color: transparent !important;
   border: none;

+ 268 - 222
src/components/monitor/detailedView.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="border">
-    <div style="text-align: right; padding-top: 10px; margin-right: 40px">
+    <div style="text-align: right; padding-top: 10px; margin-right: 70px">
       <button
         type="button"
         class="bottom_01"
-        :style="{ backgroundColor: chooseDatetime === '0' ? 'aqua' : '' }"
+        :style="{ backgroundColor: chooseDatetime === '0' ? '#46B9ED' : '' }"
         @click="chooseDate('0')"
       >
         实时
@@ -12,7 +12,7 @@
       <button
         type="button"
         class="bottom_01"
-        :style="{ backgroundColor: chooseDatetime === '1' ? 'aqua' : '' }"
+        :style="{ backgroundColor: chooseDatetime === '1' ? '#46B9ED' : '' }"
         @click="chooseDate('1')"
       >
         近1天
@@ -20,7 +20,7 @@
       <button
         type="button"
         class="bottom_01"
-        :style="{ backgroundColor: chooseDatetime === '10' ? 'aqua' : '' }"
+        :style="{ backgroundColor: chooseDatetime === '10' ? '#46B9ED' : '' }"
         @click="chooseDate('10')"
       >
         近10天
@@ -28,16 +28,17 @@
       <button
         type="button"
         class="bottom_01"
-        :style="{ backgroundColor: chooseDatetime === '20' ? 'aqua' : '' }"
-        @click="chooseDate('20')"
+        :style="{ backgroundColor: chooseDatetime === '30' ? '#46B9ED' : '' }"
+        @click="chooseDate('30')"
       >
-        近20天
+        近1月
       </button>
     </div>
     <!-- <div id="transactionFlowView" style="height:180px;width: 100%;margin-bottom: 10px;"></div> -->
     <div
       ref="testLine"
-      style="width: 780px; height: 250px; margin: 0px auto; margin-top: -30px"
+      style="width: 850px; height: 260px; margin: 0px auto; margin-top: -40px"
+      v-loading="chartLoading"
     ></div>
   </div>
 </template>
@@ -47,198 +48,126 @@ import { mapState } from "vuex";
 export default {
   data() {
     return {
+      chartLoading:false,
+      interval0: null,
+      interval1: null,
+      interval10: null,
+      interval30: null,
       chooseDatetime: "0",
-      title: "测试",
+      title: "1",
       type: "fuhe_after",
       unit: "",
-      yData: new Array(30).fill("-"),
-      xData: new Array(30).fill("-"),
+      // yData: new Array(30).fill("-"),
+      // xData: new Array(30).fill("-"),
+      xData: [],
+      yData: [],
       count: 0,
 
       myChart: null,
-      option: {
-        color: ["#41D6C3", "#FA8072"],
-        tooltip: {
-          trigger: "axis",
-          axisPointer: {
-            type: "cross",
-            label: {
-              backgroundColor: "#6a7985",
-            },
-          },
-          backgroundColor: "#fff",
-          padding: 10,
-          textStyle: {
-            fontSize: 12,
-            color: "#152934",
-            lineHeight: 24,
-          },
-          extraCssText:
-            "box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); border-radius: 0;",
-          formatter: (params) => {
-            console.log("params", params);
-            var result = `${this.title}:${params[0].data}${this.unit} <br/>`;
-            return result;
-          },
-        },
-        legend: {
-          orient: "vertical",
-          x: "left",
-          y: "top",
-          // data: ["抽气流量", "排气流量"],
-          textStyle: {
-            fontWeight: "normal",
-            color: "#fff",
-          },
-        },
-        yAxis: [
-          {
-            boundaryGap: [0, "100%"],
-            name: this.unit,
-            splitLine: {
-              show: true,
-              lineStyle: {
-                type: "dotted",
-                color: "rgba(155, 155, 155, 0.5)",
-              },
-            },
-            axisLine: {
-              show: false,
-            },
-            axisLabel: {
-              color: "#fff",
-              fontSize: 11,
-            },
-            axisTick: { show: false },
-            type: "value",
-          },
-        ],
-        xAxis: [
-          {
-            // type: "time", // x轴为 时间轴
-            interval: 0,
-            splitLine: { show: false },
-            axisLine: {
-              lineStyle: { width: 0 },
-            },
-            axisLabel: {
-              color: "#fff",
-              fontSize: 11,
-              rotate: 30,
-            },
-            axisTick: { show: false },
-            boundaryGap: false,
-            data: [],
-          },
-        ],
-        title: {
-          text: this.title,
-          padding: [5, 230],
-          textStyle: {
-            fontWeight: "normal", //标题颜色
-            color: "#4ADEFE",
-          },
-        },
-
-        series: [
-          {
-            name: this.title,
-            type: "line",
-            symbol: "none",
-            markPoint: {
-              label: {
-                normal: {
-                  show: true,
-                  backgroundColor: "#fff",
-                  position: "top",
-                  color: "#5AAAFA",
-                  borderColor: "rgba(90,170,250,0.3)",
-                  borderWidth: 1,
-                  padding: 8,
-                  formatter: "{b}: {c} ",
-                },
-              },
-              symbol: "circle",
-              itemStyle: {
-                normal: {
-                  borderColor: "rgba(90,170,250,0.3)",
-                  borderWidth: 15,
-                },
-              },
-              symbolSize: 7,
-              data: [{ type: "max", name: "Max" }],
-            },
-            // lineStyle: { normal: { color: "#41D6C3", width: 1 } },
-            lineStyle: {
-              width: 2,
-              color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
-                {
-                  offset: 0,
-                  color: "#9effff",
-                },
-                {
-                  offset: 1,
-                  color: "#9E87FF",
-                },
-              ]),
-            },
-            areaStyle: { normal: { color: "#41D6C3", opacity: 0.5 } },
-            connectNulls: true,
-            data: [],
-          },
-        ],
-      },
     };
   },
-  computed: {
-    ...mapState(["websocketIP"]),
-  },
+
   methods: {
-    idChange(id) {
-      // 数据清空
-      this.yData = new Array(30).fill("-");
-      this.xData = new Array(30).fill("-");
-      // 关闭以前的websocket
-      this.websocket.close();
-      // 开启一个新的
-      this.websocket = new WebSocket(
-        `ws://${this.websocketIP}/hbase/ws/safetyMonitor/62/${this.choseDateTime}`
-      );
-      this.initWebSocket();
+    idChange(id) {},
+    //获取实时数据
+    getSecondData() {
+      this.mockRequest("/mock/monitor/second").then((resp) => {
+        if (resp) {
+          // console.log("second");
+          // this.xData = [];
+          // this.yData = [];
+          this.xData = resp.data.data.xData;
+          this.yData = resp.data.data.yData;
+          this.addData();
+          // console.log(resp.data.data);
+        }
+      });
     },
+    //获取过去一天数据
+    getOnedayData() {
+      this.mockRequest("/mock/monitor/oneday").then((resp) => {
+        if (resp) {
+          // this.xData = [];
+          // this.yData = [];
+          this.xData = resp.data.data.xData;
+          this.yData = resp.data.data.yData;
+          this.addData();
+          // console.log(resp.data.data);
+        }
+      });
+    },
+    //获取近10天数据
+    getTenDayData() {
+      this.mockRequest("/mock/monitor/tenday").then((resp) => {
+        if (resp) {
+          console.log("tenday");
+          // this.xData = [];
+          // this.yData = [];
+          this.xData = resp.data.data.xData;
+          this.yData = resp.data.data.yData;
+          this.addData();
+          // console.log(resp.data.data);
+        }
+      });
+    },
+    //获取过去一月数据
+    getMonthData() {
+      this.mockRequest("/mock/monitor/month").then((resp) => {
+        if (resp) {
+          console.log("month");
+          // this.xData = [];
+          // this.yData = [];
+          this.xData = resp.data.data.xData;
+          this.yData = resp.data.data.yData;
+          this.addData();
+          // console.log(resp.data.data);
+        }
+      });
+    },
+
     // 选择数据的时间
     chooseDate(value) {
+      // console.log(value);
       this.chooseDatetime = value;
       this.count = 0;
-      this.xData = new Array(30).fill("-");
-      this.yData = new Array(30).fill("-");
-      this.websocket.close();
-
-      this.websocket = new WebSocket(
-        `ws://${this.websocketIP}/hbase/ws/safetyMonitor/62/${this.chooseDatetime}`
-      );
-
-      this.initWebSocket();
+      switch (value) {
+        case "0":
+          clearInterval(this.interval1);
+          clearInterval(this.interval10);
+          clearInterval(this.interval30);
+          this.getSecondData();
+          this.interval0 = setInterval(this.getSecondData, 2000);
+          break;
+        case "1":
+          clearInterval(this.interval0);
+          clearInterval(this.interval10);
+          clearInterval(this.interval30);
+          this.getOnedayData();
+          this.interval1 = setInterval(this.getOnedayData, 1000 * 60 * 60); //1小时调用一次
+          break;
+        case "10":
+          clearInterval(this.interval1);
+          clearInterval(this.interval0);
+          clearInterval(this.interval30);
+          this.getTenDayData();
+          this.interval10 = setInterval(this.getTenDayData, 1000 * 60 * 60 * 8); //8小时调用一次
+          break;
+        case "30":
+          clearInterval(this.interval0);
+          clearInterval(this.interval1);
+          clearInterval(this.interval10);
+          this.getMonthData();
+          this.interval30 = setInterval(this.getMonthData, 1000 * 60 * 60 * 24); //1天调用一次
+          break;
+      }
     },
-
-    addData(data) {
-      this.websocket;
-      // 先扩展数组,然后删除多余元素
-      if (this.count < 30) {
-        for (let i = 0; i < data.length; i++) {
-          this.yData[this.count] = data[i][this.type];
-          this.xData[this.count] = data[i]["date"].split(" ")[1];
-        }
-        this.count++;
-      } else {
-        for (let i = 0; i < data.length; i++) {
-          // 删除数组中的第一个项目
-          this.yData.shift();
-          this.yData.push(data[i][this.type]);
-          this.xData.shift();
-          this.xData.push(data[i]["date"].split(" ")[1]);
+    clearData(){
+      this.mockRequest("/clearData").then((resp) => {
+        if (resp) {
         }
-      }
+      });
+    },
+    addData() {
       this.myChart.setOption({
         xAxis: [
           {
@@ -247,53 +176,170 @@ export default {
         ],
         series: [
           {
-            name: this.unit,
+            name: this.title,
             data: this.yData,
           },
         ],
       });
     },
-    initWebSocket() {
-      // 连接错误
-      this.websocket.onerror = () => {
-        console.log(
-          "WebSocket连接发生错误   状态码:" + this.websocket.readyState
-        );
-      };
-      // 连接成功
-      this.websocket.onopen = () => {
-        console.log(
-          "WebSocket连接成功    状态码:" + this.websocket.readyState
-        );
-      };
-      // 收到消息的回调
-      this.websocket.onmessage = (event) => {
-        // console.log("onmessage", event);
-        if (JSON.parse(event.data).length) {
-          this.addData(JSON.parse(event.data));
-        }
-      };
-      // 连接关闭的回调
-      this.websocket.onclose = () => {
-        console.log(
-          "WebSocket连接关闭    状态码:" + this.websocket.readyState
-        );
-      };
-      // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
-      this.$once("hook:beforeDestroy", () => {
-        this.websocket.close();
-      });
+    clearAllInterval() {
+      if (this.interval0 != null) clearInterval(this.interval0);
+      if (this.interval1 != null) clearInterval(this.interval1);
+      if (this.interval10 != null) clearInterval(this.interval10);
+      if (this.interval30 != null) clearInterval(this.interval30);
     },
   },
   mounted() {
+    const option = {
+      color: ["#41D6C3", "#FA8072"],
+      tooltip: {
+        trigger: "axis",
+        axisPointer: {
+          type: "cross",
+          label: {
+            backgroundColor: "#6a7985",
+          },
+        },
+        backgroundColor: "#fff",
+        padding: 10,
+        textStyle: {
+          fontSize: 12,
+          color: "#152934",
+          lineHeight: 24,
+        },
+        extraCssText:
+          "box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); border-radius: 0;",
+        formatter: (params) => {
+          var result = `${this.title}:${params[0].data}${this.unit} <br/>`;
+          return result;
+        },
+      },
+      legend: {
+        orient: "vertical",
+        x: 45,
+        y: 15,
+        textStyle: {
+          fontWeight: "normal",
+          color: "#fff",
+        },
+      },
+      yAxis: [
+        {
+          boundaryGap: [0, "100%"],
+          name: this.unit,
+          splitLine: {
+            show: true,
+            lineStyle: {
+              type: "dotted",
+              color: "rgba(155, 155, 155, 0.5)",
+            },
+          },
+          axisLine: {
+            show: false,
+          },
+          axisLabel: {
+            color: "#fff",
+            fontSize: 11,
+          },
+          axisTick: { show: false },
+          type: "value",
+        },
+      ],
+      xAxis: [
+        {
+          // type: "time", // x轴为 时间轴
+          interval: 0,
+          splitLine: { show: false },
+          axisLine: {
+            lineStyle: { width: 0 },
+          },
+          axisLabel: {
+            color: "#fff",
+            fontSize: 11,
+            rotate: 30,
+          },
+          axisTick: { show: false },
+          boundaryGap: false,
+          data: [],
+        },
+      ],
+      // title: {
+      //   text: this.title,
+      //   padding: [5, 230],
+      //   textStyle: {
+      //     fontWeight: "normal", //标题颜色
+      //     color: "#fff",
+      //   },
+      // },
+
+      series: [
+        {
+          name: this.title,
+          type: "line",
+          symbol: "none",
+          markPoint: {
+            label: {
+              normal: {
+                show: true,
+                backgroundColor: "#fff",
+                position: "top",
+                color: "#5AAAFA",
+                borderColor: "rgba(90,170,250,0.3)",
+                borderWidth: 1,
+                padding: 8,
+                formatter: "{b}: {c} ",
+              },
+            },
+            symbol: "circle",
+            itemStyle: {
+              normal: {
+                borderColor: "rgba(90,170,250,0.3)",
+                borderWidth: 15,
+              },
+            },
+            symbolSize: 7,
+            data: [{ type: "max", name: "Max" }],
+          },
+          // lineStyle: { normal: { color: "#41D6C3", width: 1 } },
+          lineStyle: {
+            width: 2,
+            color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
+              {
+                offset: 0,
+                color: "#9effff",
+              },
+              {
+                offset: 1,
+                color: "#9E87FF",
+              },
+            ]),
+          },
+          areaStyle: { normal: { color: "#41D6C3", opacity: 0.5 } },
+          connectNulls: true,
+          data: [],
+        },
+      ],
+    };
     // 先画图
     this.myChart = this.$echarts.init(this.$refs.testLine);
-    this.myChart.setOption(this.option);
-    this.websocket = new WebSocket(
-      `ws://${this.websocketIP}/hbase/ws/safetyMonitor/62/${this.chooseDatetime}`
-    );
-    console.log(this.websocket);
-    this.initWebSocket();
+    this.myChart.setOption(option);
+    this.chooseDate(this.chooseDatetime);
+    this.$bus.$on("changeMpId", (val) => {
+      console.log(val);
+      this.title = val;
+      this.chartLoading = true;
+      this.clearAllInterval();
+      this.clearData();
+      this.chartLoading = false;
+      this.chooseDate(this.chooseDatetime);
+    });
+    this.$once("hook:beforeDestroy", () => {
+      this.$bus.$off("changeMpId");
+    });
+  },
+
+  beforeDestroy() {
+    this.clearAllInterval();
   },
 };
 </script>
@@ -311,7 +357,7 @@ export default {
   color: #fff;
   background-color: #2d8cf0;
   width: 60px;
-  z-index:999;
+  z-index: 999;
   position: relative;
 }
 </style>

+ 96 - 157
src/components/process_monitoring/Main.vue

@@ -1,61 +1,33 @@
 <template>
   <div id="outer">
-
     <div class="warning_box">
       <div class="warning_container warning1">
-        <WarningInfo
-          :ref="0"
-          :id="0"
-        ></WarningInfo>
+        <WarningInfo :ref="0" :id="0"></WarningInfo>
       </div>
       <div class="warning_container warning2">
-        <WarningInfo
-          :ref="1"
-          :id="1"
-        ></WarningInfo>
+        <WarningInfo :ref="1" :id="1"></WarningInfo>
       </div>
 
       <div class="warning_container warning3">
-        <WarningInfo
-          :ref="2"
-          :id="2"
-        ></WarningInfo>
+        <WarningInfo :ref="2" :id="2"></WarningInfo>
       </div>
       <div class="warning_container warning4">
-        <WarningInfo
-          :ref="3"
-          :id="3"
-        ></WarningInfo>
+        <WarningInfo :ref="3" :id="3"></WarningInfo>
       </div>
       <div class="warning_container warning5">
-        <WarningInfo
-          :ref="4"
-          :id="4"
-        ></WarningInfo>
+        <WarningInfo :ref="4" :id="4"></WarningInfo>
       </div>
       <div class="warning_container warning6">
-        <WarningInfo
-          :ref="5"
-          :id="5"
-        ></WarningInfo>
+        <WarningInfo :ref="5" :id="5"></WarningInfo>
       </div>
       <div class="warning_container warning7">
-        <WarningInfo
-          :ref="6"
-          :id="6"
-        ></WarningInfo>
+        <WarningInfo :ref="6" :id="6"></WarningInfo>
       </div>
       <div class="warning_container warning8">
-        <WarningInfo
-          :ref="7"
-          :id="7"
-        ></WarningInfo>
+        <WarningInfo :ref="7" :id="7"></WarningInfo>
       </div>
       <div class="warning_container warning9">
-        <WarningInfo
-          :ref="8"
-          :id="8"
-        ></WarningInfo>
+        <WarningInfo :ref="8" :id="8"></WarningInfo>
       </div>
       <!-- <div class="warning_container warning10">
         <WarningInfo :ref="9" :id="9"></WarningInfo>
@@ -76,16 +48,10 @@
     <!-- <div class="shexiangtou_container shexiangtou3"></div>
     </div> -->
     <div class="caimeiji1">
-      <CaiMeiJi
-        :ref="10"
-        info_number="1#"
-      ></CaiMeiJi>
+      <CaiMeiJi :ref="10" info_number="1#"></CaiMeiJi>
     </div>
     <div class="caimeiji2">
-      <CaiMeiJi
-        :ref="11"
-        info_number="9+10"
-      ></CaiMeiJi>
+      <CaiMeiJi :ref="11" info_number="9+10"></CaiMeiJi>
     </div>
     <div class="tongcang">
       <div class="tong"></div>
@@ -93,21 +59,12 @@
     </div>
     <div class="bottom_left">
       煤 仓
-      <img
-        src="./筒仓1.png"
-        alt=""
-      >
+      <img src="./筒仓1.png" alt="" />
     </div>
 
     <div class="buttons">
-      <button
-        class="btn1"
-        @click="start"
-      >模拟皮带启动</button>
-      <button
-        class="btn2"
-        @click="close"
-      >模拟皮带停止</button>
+      <button class="btn1" @click="start">模拟皮带启动</button>
+      <button class="btn2" @click="close">模拟皮带停止</button>
     </div>
 
     <div class="xcspwt-box">
@@ -123,7 +80,10 @@
         </li>
         <li>
           <span>出煤量</span>
-          <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ shearerState[0].coalOutput }}</span>
+          <span
+            >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            {{ shearerState[0].coalOutput }}</span
+          >
         </li>
       </ul>
     </div>
@@ -141,7 +101,10 @@
         </li>
         <li>
           <span>出煤量</span>
-          <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ shearerState[1].coalOutput }}</span>
+          <span
+            >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            {{ shearerState[1].coalOutput }}</span
+          >
         </li>
       </ul>
     </div>
@@ -214,7 +177,7 @@ export default {
 <style lang="less" scoped>
 #outer {
   width: 100%;
-  height: 100%;
+  height: 100vh;
   background: linear-gradient(to bottom, #323232 0%, #3f3f3f 40%, #1c1c1c 150%),
     linear-gradient(
       to top,
@@ -331,34 +294,6 @@ export default {
       width: 138px;
     }
   }
-
-  // .xcspwt-box{
-  //   height: 100px;
-  //   width: 200px;
-  //   top: 900px;
-  //   left: 20px;
-  //   color: #4adefe;
-  //   border: 1px solid #4adefe;
-  //   border-radius: 5px;
-
-  // }
-  //   .xcspwt-box li {
-  //   width: 100%;
-  //   height: 20px;
-  //   line-height: 20px;
-  //   color: #4adefe;
-  //   font-size: 18px;
-  //   margin-top: 14px;
-  //   overflow: hidden;
-  //   text-overflow: ellipsis;
-  //   white-space: nowrap;
-  //   cursor: default;
-  // }
-  //   .xcspwt-box li span {
-  //   color: #f3db5c;
-  //   display: block;
-  //   float: left;
-  // }
 }
 .warning_container {
   width: 100px;
@@ -366,40 +301,40 @@ export default {
   position: absolute;
 }
 .warning1 {
-  top: 40px;
-  left: 250px;
+  margin-top: 3%;
+  left: 15%;
 }
 .warning2 {
-  top: 40px;
-  left: 400px;
+  margin-top: 3%;
+  left: 24%;
 }
 .warning3 {
-  top: 40px;
-  left: 550px;
+  margin-top: 3%;
+  left: 33%;
 }
 .warning4 {
-  top: 40px;
-  left: 700px;
+  margin-top: 3%;
+  left: 42%;
 }
 .warning5 {
-  top: 420px;
-  left: 950px;
+  margin-top: 3%;
+  left: 51%;
 }
 .warning6 {
-  top: 40px;
-  left: 850px;
+  margin-top: 3%;
+  left: 60%;
 }
 .warning7 {
-  top: 40px;
-  left: 1000px;
+  margin-top: 3%;
+  left: 69%;
 }
 .warning8 {
-  top: 190px;
-  left: 1200px;
+  margin-top: 15%;
+  left: 81%;
 }
 .warning9 {
-  top: 160px;
-  left: 1300px;
+  margin-top: 12.8%;
+  left: 88.2%;
 }
 // .warning10 {
 //   top: 490px;
@@ -411,77 +346,81 @@ export default {
   position: absolute;
 }
 .pidai1 {
-  left: 200px;
-  top: 350px;
-  width: 150px;
-  height: 30px;
+     left: 14%;
+    margin-top: 25%;
+    width: 126px;
+    height: 30px;
 }
 .pidai2 {
-  left: 380px;
-  top: 350px;
-  width: 200px;
-  height: 30px;
+      left: 26%;
+    margin-top: 25%;
+    width: 178px;
+    height: 30px;
 }
 .pidai3 {
-  left: 525px;
-  top: 465px;
-  transform: rotate(90deg);
-  width: 150px;
-  height: 30px;
+ left: 35.6%;
+    margin-top: 32%;
+    -webkit-transform: rotate(90deg);
+    transform: rotate(90deg);
+    width: 150px;
+    height: 30px;
 }
 
 .pidai4 {
-  left: 610px;
-  top: 350px;
-  width: 150px;
-  height: 30px;
+  left: 43%;
+    margin-top: 25%;
+    width: 132px;
+    height: 30px;
 }
 .bottom_left {
-  width: 95px;
-  height: 200px;
-  position: absolute;
-  left: 929px;
-  top: 344px;
-  color: #fff;
-  font-size: 14px;
-  padding: 5px;
-  text-align: center;
+      width: 95px;
+    height: 200px;
+    position: absolute;
+    left: 58%;
+    top: 38%;
+    color: #fff;
+    font-size: 14px;
+    padding: 5px;
+    text-align: center;
 }
 .pidai5 {
-  left: 850px;
-  top: 420px;
-  transform: rotate(-60deg);
-  width: 120px;
-  height: 30px;
+      left: 59%;
+    margin-top: 29%;
+    -webkit-transform: rotate(-60deg);
+    transform: rotate(-60deg);
+    width: 120px;
+    height: 30px;
 }
 
 .pidai6 {
-  left: 980px;
-  top: 350px;
-  // transform: rotate(-45deg);
-  width: 150px;
-  height: 30px;
+      left: 68.5%;
+    margin-top: 25%;
+    width: 141px;
+    height: 30px;
 }
 .pidai7 {
-  left: 1100px;
-  top: 280px;
-  transform: rotate(-90deg);
-  width: 120px;
-  height: 30px;
+      left: 74.5%;
+    margin-top: 18%;
+    -webkit-transform: rotate(-90deg);
+    transform: rotate(-90deg);
+    width: 120px;
+    height: 30px;
 }
 .pidai8 {
-  left: 1160px;
-  top: 135px;
-  transform: rotate(-60deg);
-  width: 80px;
-  height: 30px;
+ left: 79%;
+    margin-top: 8%;
+    -webkit-transform: rotate(-60deg);
+    transform: rotate(-60deg);
+    width: 80px;
+    height: 30px;
 }
 .pidai9 {
-  left: 1260px;
-  top: 60px;
-  width: 100px;
-  transform: rotate(-10deg);
-  height: 30px;
+  left: 86.5%;
+    margin-top: 3%;
+    width: 100px;
+    -webkit-transform: rotate(-10deg);
+    transform: rotate(-10deg);
+    height: 30px;
 }
 .pidai10 {
   left: 1200px;

+ 4 - 1
src/main.js

@@ -8,6 +8,7 @@ import axios from "axios";
 import VueAxios from 'vue-axios'
 import Antd from 'ant-design-vue'
 import dataV from '@jiaminghi/data-view';
+import '@/mock'
 // 播放器组件库
 import VideoPlayer from 'vue-video-player'
 import 'video.js/dist/video-js.css'
@@ -25,6 +26,8 @@ import {postRequest} from "./utils/api";
 import {putRequest} from "./utils/api";
 import {deleteRequest} from "./utils/api";
 import {getRequest} from "./utils/api";
+import {mockRequest} from "./utils/api";
+
 import {postKeyValueRequest} from "./utils/api";
 import VueDragResize from "vue-drag-resize"
 // 按需引入vue-awesome图标
@@ -46,7 +49,7 @@ Vue.prototype.putRequest = putRequest;
 Vue.prototype.deleteRequest = deleteRequest;
 Vue.prototype.getRequest = getRequest;
 
-
+Vue.prototype.mockRequest = mockRequest;
 Vue.prototype.$echarts = window.echarts
 Vue.config.productionTip = false
 // Vue.prototype.$http = httpRequest // ajax请求方法

+ 125 - 0
src/mock/index.js

@@ -0,0 +1,125 @@
+import Mock from "mockjs";
+import dayjs from "dayjs";
+dayjs().format();
+// 设置延时200-600毫秒请求到数据
+Mock.setup({
+  timeout: "200-600",
+});
+var count1 = 0;
+var data1 = {
+  xData: [],
+  yData: [],
+};
+var data2 = {
+  xData: [],
+  yData: [],
+};
+var data3 = {
+  xData: [],
+  yData: [],
+};
+var data4 = {
+  xData: [],
+  yData: [],
+};
+//实时 展示近30s数据,每隔1s调用一次
+let secondInfo = {
+  code: 0,
+  data: function() {
+    if (count1 < 31) {
+      for (let num = 30; num >= 0; num--) {
+        data1.xData.push(
+          dayjs()
+            .subtract(num, "second")
+            .format("HH:mm:ss")
+        );
+        data1.yData.push((Math.random() * (40 - 20) + 20).toFixed(1));
+        count1++;
+      }
+    } else {
+      data1.xData.shift();
+      data1.yData.shift();
+      data1.xData.push(dayjs().format("HH:mm:ss"));
+      data1.yData.push((Math.random() * (40 - 20) + 20).toFixed(1));
+    }
+    data1.xData = data1.xData.slice(0, 31);
+    data1.yData = data1.yData.slice(0, 31);
+    return data1;
+  },
+};
+Mock.mock(RegExp("/mock/monitor/second.*"), "get", (options) => {
+  return Mock.mock(secondInfo);
+});
+Mock.mock("/clearData", "get", () => {
+  count1 = 0;
+  data1 = {
+    xData: [],
+    yData: [],
+  };
+  data2 = {
+    xData: [],
+    yData: [],
+  };
+  data3 = {
+    xData: [],
+    yData: [],
+  };
+  data4 = {
+    xData: [],
+    yData: [],
+  };
+  return;
+});
+
+//近一天 以1小时为单位 展示24个数据 每隔一小时调用一次
+Mock.mock("/mock/monitor/oneday", {
+  code: 0,
+  data: function() {
+    for (let num = 24; num >= 0; num--) {
+      data2.xData.push(
+        dayjs()
+          .subtract(num, "hour")
+          .format("MM-DD HH 时")
+      );
+      data2.yData.push((Math.random() * (40 - 20) + 20).toFixed(1));
+    }
+    data2.xData = data2.xData.slice(0, 25);
+    data2.yData = data2.yData.slice(0, 25);
+    return data2;
+  },
+});
+//近10天 以8小时为单位 展示30个数据 每隔8小时调用一次
+Mock.mock("/mock/monitor/tenday", {
+  code: 0,
+  data: function() {
+    for (let num = 30; num >= 0; num--) {
+      data3.xData.push(
+        dayjs()
+          .subtract(num * 8, "hour")
+          .format("MM-DD HH 时")
+      );
+      data3.yData.push((Math.random() * (40 - 20) + 20).toFixed(1));
+    }
+    data3.xData = data3.xData.slice(0, 31);
+    data3.yData = data3.yData.slice(0, 31);
+    return data3;
+  },
+});
+
+// 过去一个月的数据 以天为单位 隔一天调用一次
+Mock.mock("/mock/monitor/month", {
+  code: 0,
+  data: function() {
+    for (let num = 30; num >= 0; num--) {
+      data4.xData.push(
+        dayjs()
+          .subtract(num, "day")
+          .format("MM-DD")
+      );
+      data4.yData.push((Math.random() * (40 - 20) + 20).toFixed(1));
+    }
+    data4.xData = data4.xData.slice(0, 31);
+    data4.yData = data4.yData.slice(0, 31);
+    return data4;
+  },
+});

+ 0 - 0
src/mock/modules/monitor.js


+ 7 - 0
src/utils/api.js

@@ -44,3 +44,10 @@ export const deleteRequest = (url, params) => {
         params: params
     })
 };
+export const mockRequest = (url, params) => {
+    return axios({
+        method: 'get',
+        url: `${url}`,
+        params: params
+    })
+};

+ 13 - 6
src/views/monitor/configImg/configImg.vue

@@ -45,7 +45,7 @@
           </el-row>
           <el-row :gutter="10">
             <el-col :span="4" style="text-align: center; color: #4adefe">
-              粉   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;尘
+              粉 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;尘
             </el-col>
             <el-col :span="19">
               <el-progress :percentage="score[3]"> </el-progress>
@@ -124,7 +124,7 @@ export default {
         "地面主平硐井口",
         "12302回风巷",
       ],
-      workUse: ["上仓皮带出口", "上仓皮带入口","下仓皮带出口", "下仓皮带入口"],
+      workUse: ["上仓皮带出口", "上仓皮带入口", "下仓皮带出口", "下仓皮带入口"],
       score: [80, 90, 70, 88, 96, 76],
     };
   },
@@ -188,9 +188,16 @@ export default {
       this.$refs.left.dataChange(leftData);
       this.$refs.rightTable.dataChange(tableData);
     },
+    
   },
   mounted() {
-    this.selectArea(this.totalArea.findIndex(item => item == this.title));
+    // /mock/monitor
+
+    // let interval2 = setInterval(this.getSecondData, 2000);
+    // this.$once("hook:beforeDestroy", () => {
+    //   clearInterval(interval2);
+    // });
+    this.selectArea(this.totalArea.findIndex((item) => item == this.title));
     let interval = setInterval(() => {
       let temp = [];
       for (let i = 0; i < 6; i++) {
@@ -215,7 +222,7 @@ export default {
       rgba(255, 255, 255, 0.4) 0%,
       rgba(0, 0, 0, 0.25) 200%
     );
-    /* 正片叠底模式。 */
+  /* 正片叠底模式。 */
   background-blend-mode: multiply;
 }
 .detail h2 {
@@ -257,7 +264,7 @@ export default {
   background: url(../../../assets/img/tunneling/dataBg.png) no-repeat;
   background-size: 100%;
 }
-.el-row{
-  left:11px;
+.el-row {
+  left: 11px;
 }
 </style>

+ 17 - 42
src/views/transportation/configImg/analysis/BeltOverview.vue

@@ -8,11 +8,7 @@
         :id="23"
         color="#DADBBD"
       >
-        <a-icon
-          type="sync"
-          style="color: #6ebf8b; font-size: 21px"
-          spin
-        />
+        <a-icon type="sync" style="color: #6ebf8b; font-size: 21px" spin />
       </belt-item>
 
       <belt-item
@@ -21,11 +17,7 @@
         :id="2"
         color="#DADBBD"
       >
-        <a-icon
-          type="sync"
-          style="color: #6ebf8b; font-size: 21px"
-          spin
-        />
+        <a-icon type="sync" style="color: #6ebf8b; font-size: 21px" spin />
       </belt-item>
 
       <div style="margin-top: 180px; margin-left: -50px">
@@ -36,11 +28,7 @@
           rvalue="-90"
           color="#DADBBD"
         >
-          <a-icon
-            type="sync"
-            style="color:#6EBF8B; fon t-size:21px"
-            spin
-          />
+          <a-icon type="sync" style="color:#6EBF8B; fon t-size:21px" spin />
         </belt-item>
       </div>
 
@@ -51,23 +39,26 @@
           :id="4"
           color="#D82148"
         >
-          <a-icon
-            type="alert"
-            style="color: #d82148; font-size: 20px"
-          />
+          <a-icon type="alert" style="color: #d82148; font-size: 20px" />
         </belt-item>
       </div>
 
       <!-- <div class="meicang">煤仓</div> -->
-      <div class="bottom_left">
+      <div
+        style="margin-top: 139px;color: #fff;
+  font-size: 12px;
+  padding: 5px;
+  text-align: center;"
+      >
         煤 仓
         <img
+          style="width: 66px;height: 110px;"
           src="@/components/newMain/item2/筒仓1.png"
           alt="煤 仓"
-        >
+        />
       </div>
 
-      <div style="margin-top: 110px;margin-left:25px">
+      <div style="margin-top: 110px;margin-left:-21px">
         <belt-item
           @click.native="viewDetail('西巷171.6皮带', 5)"
           title="西巷171.6皮带"
@@ -75,11 +66,7 @@
           rvalue="-45"
           color="#DADBBD"
         >
-          <a-icon
-            type="sync"
-            style="color: #6ebf8b; font-size: 21px"
-            spin
-          />
+          <a-icon type="sync" style="color: #6ebf8b; font-size: 21px" spin />
         </belt-item>
       </div>
 
@@ -89,11 +76,7 @@
         :id="6"
         color="#DADBBD"
       >
-        <a-icon
-          type="sync"
-          style="color: #6ebf8b; font-size: 21px"
-          spin
-        />
+        <a-icon type="sync" style="color: #6ebf8b; font-size: 21px" spin />
       </belt-item>
 
       <div style="margin-bottom: 120px; margin-left: -50px">
@@ -104,11 +87,7 @@
           rvalue="-90"
           color="#DADBBD"
         >
-          <a-icon
-            type="sync"
-            style="color: #6ebf8b; font-size: 21px"
-            spin
-          />
+          <a-icon type="sync" style="color: #6ebf8b; font-size: 21px" spin />
         </belt-item>
       </div>
       <div style="margin-bottom: 420px; margin-left: -100px">
@@ -134,11 +113,7 @@
           rvalue="-25"
           color="#DADBBD"
         >
-          <a-icon
-            type="sync"
-            style="color: #6ebf8b; font-size: 21px"
-            spin
-          />
+          <a-icon type="sync" style="color: #6ebf8b; font-size: 21px" spin />
         </belt-item>
       </div>
     </div>