Ming 4 rokov pred
rodič
commit
614c8ac7b4

+ 79 - 81
package-lock.json

@@ -1812,6 +1812,63 @@
           "integrity": "sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo=",
           "dev": true
         },
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1618995547052&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz",
+          "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.1",
+          "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz?cache=0&sync_timestamp=1618995355917&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.1.tgz",
+          "integrity": "sha1-yAs/qyi/Y3HmhjMl7uZ+YYt35q0=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz",
+          "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
+          "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
+          "dev": true,
+          "optional": true
+        },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1618847009337&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
+          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
+          "dev": true,
+          "optional": true
+        },
+        "loader-utils": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
+          "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "big.js": "^5.2.2",
+            "emojis-list": "^3.0.0",
+            "json5": "^2.1.2"
+          }
+        },
         "ssri": {
           "version": "8.0.1",
           "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-8.0.1.tgz?cache=0&sync_timestamp=1617826725566&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fssri%2Fdownload%2Fssri-8.0.1.tgz",
@@ -1820,6 +1877,28 @@
           "requires": {
             "minipass": "^3.1.1"
           }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1622293579301&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
+          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
+        "vue-loader-v16": {
+          "version": "npm:vue-loader@16.3.0",
+          "resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.3.0.tgz?cache=0&sync_timestamp=1624994309035&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.3.0.tgz",
+          "integrity": "sha1-LxleS6D7DiY1ltaDDfF9Gjbok2w=",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chalk": "^4.1.0",
+            "hash-sum": "^2.0.0",
+            "loader-utils": "^2.0.0"
+          }
         }
       }
     },
@@ -12365,87 +12444,6 @@
         }
       }
     },
-    "vue-loader-v16": {
-      "version": "npm:vue-loader@16.3.0",
-      "resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.3.0.tgz?cache=0&sync_timestamp=1624994309035&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.3.0.tgz",
-      "integrity": "sha1-LxleS6D7DiY1ltaDDfF9Gjbok2w=",
-      "dev": true,
-      "optional": true,
-      "requires": {
-        "chalk": "^4.1.0",
-        "hash-sum": "^2.0.0",
-        "loader-utils": "^2.0.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz?cache=0&sync_timestamp=1618995778321&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-styles%2Fdownload%2Fansi-styles-4.3.0.tgz",
-          "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.1",
-          "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.1.tgz?cache=0&sync_timestamp=1618995355917&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.1.tgz",
-          "integrity": "sha1-yAs/qyi/Y3HmhjMl7uZ+YYt35q0=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
-          "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz",
-          "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1618847009337&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
-          "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-2.0.0.tgz",
-          "integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1622293579301&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
-          "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        }
-      }
-    },
     "vue-router": {
       "version": "4.0.8",
       "resolved": "https://registry.nlark.com/vue-router/download/vue-router-4.0.8.tgz",

+ 6 - 0
package.json

@@ -30,8 +30,14 @@
         "eslint-plugin-vue": "^7.0.0-0",
         "less": "^4.0.0",
         "less-loader": "^7.2.1",
+<<<<<<< HEAD
         "node-sass": "^5.0.0",
         "sass-loader": "^11.0.1"
+=======
+        "node-sass": "^4.12.0",
+        "sass-loader": "^8.0.2",
+        "sass-resources-loader": "^2.2.1"
+>>>>>>> cf1b240d4d7dca2b25f0e2abe7cb99ef226b9303
     },
     "eslintConfig": {
         "root": true,

+ 2 - 0
public/index.html

@@ -6,6 +6,8 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=8e266e1ac2ad2383c7773ff504ac248f"></script>
+    <script src="//webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script>
     <title>
         <%= htmlWebpackPlugin.options.title %>
     </title>

+ 13 - 6
src/assets/css/index.css

@@ -117,20 +117,27 @@ header {
 }
 
 /* el-select 下拉框 样式 */
-.el-input__inner{
+.el-input__suffix{
+    line-height: 1rem !important;
+}
+.el-input--suffix .el-input__inner{
     margin-top: 0.2rem;
     width: 2rem !important;
     height: 0.375rem !important;
     background-color: transparent !important;
     color: #4BF4F9 !important;
     font-size: 0.18rem !important;
-}
-.el-input__suffix{
-    line-height: 1rem !important;
-}
-.el-input--suffix .el-input__inner{
     border: 1px #4BF4F9 solid !important;
     border-radius: 0px !important;
+    
+}
+.el-input--suffix .el-input__icon{
+    width: 0.3125rem;
+    line-height: 0.375rem !important;
+}
+.el-input--suffix .el-select__caret{
+    color:#4BF4F9 !important;
+    font-size: 0.175rem !important;
 }
 .el-input__prefix, .el-input__suffix{
     top: -0.30rem !important;

BIN
src/assets/images/No_data.png


+ 9 - 4
src/main.js

@@ -12,11 +12,13 @@ import router from './router';
 import axios from 'axios';
 const app = createApp(App);
 
+import ElementPlus from 'element-plus';
+import 'element-plus/lib/theme-chalk/index.css';
+import 'dayjs/locale/zh-cn'
+import locale from 'element-plus/lib/locale/lang/zh-cn'
+
+app.use(router).use(ElementPlus, { locale });
 
-app.use(router);
-import ElementPlus from 'element-plus'
-import 'element-plus/lib/theme-chalk/index.css'
-app.use(ElementPlus)
 app.config.globalProperties.$UCore = UCore;
 app.config.globalProperties.$axios = axios;
 app.use(Antd).mount('#app');
@@ -30,6 +32,9 @@ import '@/assets/fonts/font.css';
 
 
 import * as echarts from 'echarts'
+import 'echarts/lib/component/tooltip'
+import 'echarts/lib/component/title'
+import 'echarts/lib/component/legend'
 app.use(echarts);
 
 

+ 267 - 11
src/views/home/index.vue

@@ -3,10 +3,9 @@
     <section class="mainbox">
       <div class="topBox">
         <div class="column statisSec">
-
           <statis-top></statis-top>
           <statis-bottom></statis-bottom>
-          
+
           <!-- <div class="panel statisBottom">
             <h2>折线图-人员变化</h2>
             <div class="chart"></div>
@@ -19,7 +18,13 @@
         </div> -->
         </div>
         <div class="column">
-          <div class="map" style="" @click="Overview()"></div>
+          <!-- @click="Overview()" -->
+          <div class="map" id="mapF" style="">
+          <div id="pickerBox">
+            <input id="pickerInput" placeholder="输入关键字选取地点" />
+            <div id="poiInfo"></div>
+          </div>
+          </div>
         </div>
         <div class="column">
           <div class="panel deviceSum">
@@ -40,7 +45,6 @@
       <div class="bottomBox">
         <div class="column">221</div>
         <div class="column">21211</div>
-       
       </div>
     </section>
   </div>
@@ -49,16 +53,268 @@
 import statisTop from "./components/statisTop";
 import statisBottom from "./components/statisBottom";
 import pieChart from "./components/pieChart";
+// 地图
+import AMap from "AMap";
+import AMapUI from "AMapUI";
 export default {
   name: "index",
-  components: {statisTop,statisBottom,pieChart},
-  methods:{
-    Overview(){
-      this.$router.push({ path: '/Overview'});//, query: { title: title }
-    }
-  }
+  components: { statisTop, statisBottom, pieChart },
+  data() {
+    return {
+      map: null,
+    };
+  },
+  created() {},
+  mounted() {
+    this.initMap();
+  },
+  methods: {
+    Overview() {
+      this.$router.push({ path: "/Overview" }); //, query: { title: title }
+    },
+    async initMap() {
+      this.map = await new AMap.Map("mapF", {
+        mapStyle: "amap://styles/blue", //设置地图的显示样式
+        resizeEnable: true,
+        zoom: 13,
+        zooms: [3, 16],
+        // features: [] //清空背景道路等
+      });
+      this.initMapUi();
+      this.addMarker(
+        [
+          {
+            address: "东川路2988号富康东川木业有限公司3车间西南角",
+            detachmentName: "闵行区消防救援支队",
+            dutyPerson: null,
+            getWaterType: "市政",
+            gisBaiDuX: "121.394165",
+            gisBaiDuY: "31.011814",
+            gisX: "121.382935",
+            gisY: "31.00811",
+            jurisdictionalAgency: "闵行站",
+            phone: "64881840",
+            status: "1",
+            type: "消火栓",
+            waterAdministrative: "单位",
+            waterGage: "3.0000",
+            waterUnit: "闵行水厂",
+          },
+          {
+            address: "瓶安路1600弄鑫都城宝铭苑34号楼东侧",
+            detachmentName: "闵行区消防救援支队",
+            dutyPerson: null,
+            getWaterType: "市政",
+            gisBaiDuX: "121.40705",
+            gisBaiDuY: "31.060436",
+            gisX: "121.39589",
+            gisY: "31.056536",
+            jurisdictionalAgency: "光华站",
+            phone: "021-64881840",
+            status: "1",
+            type: "消火栓",
+            waterAdministrative: "居民",
+            waterGage: "0.3000",
+            waterUnit: "闵行自来水公司",
+          },
+        ],
+        "water"
+      );
+    },
+    addMarker(lnglats, type = "") {
+      // 创建标点和点击事件
+      // let icon = "";
+      let markers = lnglats.map((val, ind) => {
+        if (type === "water") {
+          // icon =
+          //   val.waterAdministrative === "单位"
+          //     ? "http://120.55.70.156/image/unitWater.png"
+          //     : val.waterAdministrative === "市政"
+          //     ? "http://120.55.70.156/image/szWater.png"
+          //     : val.waterAdministrative === "社区" ||
+          //       val.waterAdministrative === "居民"
+          //     ? "http://120.55.70.156/image/sqWater.png"
+          //     : "";
+        }
+        let marker = new AMap.Marker({
+          position: new AMap.LngLat(val.gisX, val.gisY),
+          // icon: icon,
+          zIndex: 9,
+          extData: {
+            id: ind + 1,
+          },
+        });
+        marker.on("click", async () => {
+          console.log([val.gisX, val.gisY], null, val);
+          await this.addMarkerInfo([val.gisX, val.gisY], null, val);
+          // console.log(222);
+        });
+        return marker;
+      });
+      this.map.add(new AMap.OverlayGroup(markers));
+      this.map.setFitView(); // 根据所有点自适应
+    },
+    // 添加标点
+    addMarkerInfo(position, content, value = "") {
+      // this.map.getIsOpen();
+      console.log(value);
+      this.map.clearInfoWindow();
+      var infoWindow = new AMap.InfoWindow({
+        isCustom: true, //使用自定义窗体
+        closeWhenClickMap: true,
+        content:
+          content ||
+          `
+                <div class="tableTooltip mapTab">
+                  <div class="tableTitle">
+                    <div>${"测试站点1"}</div>
+                  </div>
+                  <el-row class="tableContent">
+                    <div><a>站点状态:</a>${"正常"}</div>
+                    <div><a>设备总数:</a>${"5"}</div>
+                    <div><a>告警数:</a>${"3"}</div>
+                    <div><a>监控类型:</a>${"电力,视频"}</div>
+                    <div><a> 电话:</a>${"18888888888"}</div>
+                    <div><a> 地址:</a>${"XX路135弄"}</div>
+                  </el-row>
+                </div>`,
+        offset: new AMap.Pixel(16, -30),
+      });
+      infoWindow.open(this.map, position);
+    },
+    poiPickerReady(poiPicker) {
+      console.log(poiPicker);
+      var marker = new AMap.Marker();
+
+      var infoWindow = new AMap.InfoWindow({
+        offset: new AMap.Pixel(0, -20),
+      });
+
+      //选取了某个POI
+      poiPicker.on("poiPicked", (poiResult) => {
+        var source = poiResult.source,
+          poi = poiResult.item,
+          info = {
+            source: source,
+            id: poi.id,
+            name: poi.name,
+            location: poi.location.toString(),
+            address: poi.address,
+          };
+
+        marker.setMap(this.map);
+        infoWindow.setMap(this.map);
+
+        marker.setPosition(poi.location);
+        infoWindow.setPosition(poi.location);
+
+        infoWindow.setContent(
+          "POI信息: <pre>" + JSON.stringify(info, null, 2) + "</pre>"
+        );
+        infoWindow.open(this.map, marker.getPosition());
+
+        this.map.setCenter(marker.getPosition());
+      });
+
+      poiPicker.onCityReady(() => {
+        poiPicker.suggest("美食");
+      });
+    },
+    initMapUi() {
+      console.log(22);
+      AMapUI.load(["ui/misc/PoiPicker"],  (PoiPicker)=> {
+        console.log(PoiPicker);
+        let poiPickers = new PoiPicker({
+          //city:'北京',
+          input: "pickerInput",
+        });
+
+        //初始化poiPicker
+        this.poiPickerReady(poiPickers);
+      });
+    },
+  },
 };
 </script>
 
-<style>
+<style lang="scss">
+#pickerBox {
+  position: absolute;
+  z-index: 9999;
+  top: 50px;
+  right: 30px;
+  width: 300px;
+}
+
+#pickerInput {
+  width: 200px;
+  padding: 5px 5px;
+}
+
+#poiInfo {
+  background: #fff;
+}
+/* 地图弹窗 */
+.mapTab {
+  background: transparent;
+  border-radius: 3%;
+  box-shadow: inset 0 0 0.2rem 0.0125rem #30cfff;
+  background: rgba(0, 44, 110, 0.5);
+  // box-shadow: inset 0 0 0.2rem 0.0125rem #30cfff;
+  // background: rgba(0, 44, 110, 0.8);
+  font-size: 0.2rem;
+  padding: 0.1875rem;
+  width: 5rem;
+  font-size: 0.1875rem;
+  font-family: Microsoft YaHei Regular, Microsoft YaHei Regular-Regular;
+  width: 3.5rem;
+  scrollbar-width: none;
+  /* firefox */
+  -ms-overflow-style: none;
+  /* IE 10+ */
+  overflow-x: hidden;
+  overflow-y: auto;
+  .tableTitle {
+    // background: url('~@a/img/comprehensive/title.png');
+    background-size: 100% 100%;
+    & > div {
+      line-height: 0.4rem;
+      background-image: linear-gradient(#caf6ff, #56d1ed);
+      -webkit-background-clip: text;
+      color: transparent;
+      -webkit-text-fill-color: transparent;
+      font-weight: 900;
+    }
+  }
+  .tableContent {
+    display: flex;
+    flex-wrap: wrap;
+    margin-top: 0.125rem;
+    div {
+      width: 100%;
+      padding-right: 0.25rem;
+      line-height: 0.275rem;
+      box-sizing: border-box;
+      // margin: 0.0625rem 0;
+      a {
+        width: 0.875rem;
+        font-size: 0.175rem;
+        text-align: right;
+        display: inline-block;
+        color: #00f4fd;
+        cursor: pointer;
+      }
+    }
+    .max {
+      width: 100%;
+    }
+    .divTitle {
+      color: #04f2f4;
+    }
+  }
+  &::-webkit-scrollbar {
+    display: none;
+    /* Chrome Safari */
+  }
+}
 </style>

+ 1 - 0
src/views/index.vue

@@ -73,6 +73,7 @@
 </template>
 
 <script>
+
 export default {
   name: "App",
   data() {

+ 705 - 15
src/views/site/Device_motore.vue

@@ -1,6 +1,15 @@
 <template>
   <section class="mainbox">
-    <div class="Site-details">
+    <div
+      class="Site-details"
+      :style="
+        activeName === 'first'
+          ? 'height: 684px;'
+          : activeName === 'third'
+          ? 'height: 670px;'
+          : 'height: 710px;'
+      "
+    >
       <el-tabs v-model="activeName" @tab-click="handleClick">
         <el-tab-pane label="实时数据" name="first">
           <el-tabs
@@ -84,12 +93,140 @@
           </el-tabs>
           <el-button type="primary" class="primary">刷新</el-button>
         </el-tab-pane>
-        <el-tab-pane label="历史趋势" name="second" style="top: 1px"
-          >历史趋势</el-tab-pane
-        >
-        <el-tab-pane label="数据报表" name="third" style="top: 2px"
-          >数据报表</el-tab-pane
-        >
+        <el-tab-pane label="历史趋势" name="second" style="top: 1px">
+          <el-tabs
+            v-model="se_content"
+            @tab-click="handleClick2"
+            class="se-content"
+          >
+            <el-tab-pane label="电流" name="flow" class="flow"> </el-tab-pane>
+            <el-tab-pane label="功率" name="power" class="power"> </el-tab-pane>
+            <el-tab-pane label="电度" name="degree" class="degree">
+            </el-tab-pane>
+            <el-tab-pane label="电压" name="voltage" class="voltage">
+            </el-tab-pane>
+            <el-tab-pane label="温度" name="temperature" class="temperature">
+            </el-tab-pane>
+            <el-tab-pane label="频率" name="frequency" class="frequency">
+            </el-tab-pane>
+            <el-tab-pane
+              label="功率因数"
+              name="power_factor"
+              class="power_factor"
+            >
+            </el-tab-pane>
+            <el-tab-pane
+              label="谐波电流有效值"
+              name="hc_valid_value"
+              class="hc_valid_value"
+            >
+            </el-tab-pane>
+            <el-tab-pane
+              label="通讯参数"
+              name="c_parameters"
+              class="c_parameters"
+            >
+            </el-tab-pane>
+            <el-tab-pane label="电压突变" name="v_mutation" class="v_mutation">
+            </el-tab-pane>
+            <el-button type="primary" class="preservation" @click="preservation"
+              >保存为图片</el-button
+            >
+          </el-tabs>
+          <div class="block">
+            <span>选择时间范围:</span>
+            <el-date-picker
+              v-model="defaultTime"
+              type="datetimerange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              range-separator="~"
+              :disabledDate="disabledDate"
+            >
+            </el-date-picker>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane label="数据报表" name="third" style="top: 2px">
+          <div class="block">
+            <span>选择时间范围:</span>
+            <el-date-picker
+              v-model="defaultTime"
+              type="datetimerange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              range-separator="~"
+              :disabledDate="disabledDate"
+            >
+            </el-date-picker>
+            <div class="operation">
+              <el-button type="primary" class="query" :disabled="checkedCities.length > 0 ? false : true" @click="Time_all">查询</el-button>
+              <el-button type="primary" class="export" :disabled="tableData.length > 0 ? false : true">导出</el-button>
+            </div>
+          </div>
+          <div class="box">
+            <el-checkbox
+              :indeterminate="isIndeterminate"
+              v-model="checkAll"
+              @change="handleCheckAllChange"
+              >全选</el-checkbox
+            >
+            <el-checkbox-group
+              v-model="checkedCities"
+              @change="handleCheckedCitiesChange"
+            >
+              <el-checkbox v-for="city in cities" :label="city" :key="city">{{
+                city
+              }}</el-checkbox>
+            </el-checkbox-group>
+          </div>
+          <div class="table">
+            <el-table :data="tableData" style="width: 100%" height="520" show>
+              <el-table-column prop="time" label="时间" fixed>
+              </el-table-column>
+              <el-table-column label="电流 A" v-if="columnHeaders[0].isShow">
+                <el-table-column prop="name" label="A相电流"> </el-table-column>
+                <el-table-column prop="province" label="B相电流">
+                </el-table-column>
+                <el-table-column prop="city" label="C相电流"> </el-table-column>
+              </el-table-column>
+              <el-table-column label="电流 B" v-if="columnHeaders[1].isShow">
+                <el-table-column prop="name" label="B相电流"> </el-table-column>
+                <el-table-column prop="province" label="B相电流">
+                </el-table-column>
+                <el-table-column prop="city" label="B相电流"> </el-table-column>
+              </el-table-column>
+              <!-- <el-table-column label="地址">
+                <el-table-column prop="province" label="省份" width="120">
+                </el-table-column>
+                <el-table-column prop="city" label="市区" width="120">
+                </el-table-column>
+                <el-table-column prop="address" label="地址"> </el-table-column>
+                <el-table-column prop="zip" label="邮编" width="120">
+                </el-table-column>
+                <el-table-column prop="zip" label="邮编" width="120">
+                </el-table-column>
+                <el-table-column prop="zip" label="邮编" width="120">
+                </el-table-column>
+                <el-table-column prop="zip" label="邮编" width="120">
+                </el-table-column>
+                <el-table-column prop="zip" label="邮编" width="120">
+                </el-table-column>
+              </el-table-column> -->
+
+              <template #empty>
+                <div class="zwsj">
+                  <img src="./../../assets/images/No_data.png" alt="" />
+                  <p>暂无数据</p>
+                </div>
+              </template>
+            </el-table>
+          </div>
+        </el-tab-pane>
+        <devicemotore
+          v-if="activeName === 'second'"
+          ref="main"
+          :defaul_tTime="defaultTime"
+        ></devicemotore>
         <el-tab-pane label="运行状态统计" name="fourth" style="top: 3px"
           >运行状态统计</el-tab-pane
         >
@@ -98,11 +235,29 @@
   </section>
 </template>
 <script>
+import devicemotore from "../site_ehcarts/Device_motore";
+const cityOptions = [
+  "电流",
+  "功率",
+  "电度",
+  "电压",
+  "温度",
+  "频率",
+  "功率因数",
+  "谐波电流有效值",
+  "通讯参数",
+  "电压突变",
+];
 export default {
+  name: "site_details",
+  components: { devicemotore },
   data() {
     return {
       activeName: "first",
       ac_content: "model",
+      se_content: "flow",
+      se_label: "电流",
+
       model_array: [
         { name: "A相电压:", value: "236.94V" },
         { name: "B相电压:", value: "237.94V" },
@@ -205,16 +360,86 @@ export default {
         { name: "备用遥信3:", value: "OFF" },
         { name: "备用遥信4:", value: "OFF" },
       ],
+
+      value: "",
+      defaultTime: [
+        new Date(2021, 6, 1, 0, 0, 0),
+        new Date(2021, 6, 1, 12, 0, 0),
+      ],
+      disabledDate(date) {
+        return date.getTime() > new Date();
+      },
+      checkAll: false,
+      checkedCities: [],
+      cities: cityOptions,
+      isIndeterminate: false,
+      tableData: [],
+
+      msg: "暂无数据",
+
+      columnHeaders: [
+        { index: 0, title: "电流", isShow: false },
+        { index: 1, title: "功率", isShow: false },
+        { index: 2, title: "电度", isShow: false },
+        { index: 3, title: "电压", isShow: false },
+        { index: 4, title: "温度", isShow: false },
+        { index: 5, title: "频率", isShow: false },
+        {
+          index: 6,
+          title: "功率因数",
+          isShow: false,
+        },
+        {
+          index: 7,
+          title: "谐波电流有效值",
+          isShow: false,
+        },
+        {
+          index: 8,
+          title: "通讯参数",
+          isShow: false,
+        },
+        {
+          index: 9,
+          title: "电压突变",
+          isShow: false,
+        },
+      ],
     };
   },
-  name: "site_details",
-  components: {},
-  mounted() {},
+  mounted() {
+  },
   methods: {
+    preservation() {
+      console.log(this.$refs.main.chart);
+      var url = this.$refs.main.chart.getConnectedDataURL({
+        pixelRatio: 15,
+        backgroundColor: "black",
+        excludeComponents: ["toolbox"],
+        type: "png",
+      });
+      var $a = document.createElement("a");
+      var type = "png";
+      //图片名称
+      $a.download = this.se_label + "." + type;
+      $a.target = "_blank";
+      $a.href = url;
+      if (typeof MouseEvent === "function") {
+        var evt = new MouseEvent("click", {
+          view: window,
+          bubbles: true,
+          cancelable: false,
+        });
+        $a.dispatchEvent(evt);
+      }
+    },
+    //最外层tabs切换事件触发
     handleClick(tab, event) {
+      // this.Time_all();
       //   console.log(tab, event);
       //   console.log(tab.props.name)
       this.ac_content = "model";
+      this.se_content = "flow";
       for (let i in event.path) {
         if (event.path[i].className === "el-tabs__nav is-top") {
           var childNodes = event.path[i].childNodes;
@@ -226,16 +451,464 @@ export default {
         }
       }
     },
+    //实时数据 内部tabs 点击事件触发
     handleClick1(tab, event) {
       console.log(tab, event);
     },
+    //历史趋势 内部tabs 点击事件触发
+    handleClick2(tab, event) {
+      console.log(tab, event);
+      this.se_label = tab.props.label;
+    },
+    Time_all() {
+      // console.log(this.defaultTime)
+      // console.log("bbbbbbb",data)
+      // this.$emit("func", this.defaultTime);
+      this.tableData = [
+        {
+          time: "2016-05-03",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "1518",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-02",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-04",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-01",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-08",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-06",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+        {
+          time: "2016-05-07",
+          name: "1",
+          province: "2",
+          city: "3",
+          address: "2市3金沙江路 1518 弄",
+          zip: 200333,
+        },
+      ]
+    },
+    handleCheckAllChange(val) {
+      this.checkedCities = val ? cityOptions : [];
+      this.isIndeterminate = false;
+    },
+    handleCheckedCitiesChange(value) {
+      let checkedCount = value.length;
+      this.checkAll = checkedCount === this.cities.length;
+      this.isIndeterminate =
+        checkedCount > 0 && checkedCount < this.cities.length;
+    },
+  },
+  watch: {
+    /**
+     * @title 监听列显示隐藏
+     */
+    checkedCities(newArrayVal) {
+      newArrayVal.length <= 0 ? this.tableData=[] : ''
+      // 计算为被选中的列标题数组
+      var nonSelecteds = this.columnHeaders
+        .filter((item) => newArrayVal.indexOf(item.title) == -1)
+        .map((item) => item.title);
+      // 根据计算结果进行表格重绘
+      this.columnHeaders.filter((item) => {
+        let isNonSelected = nonSelecteds.indexOf(item.title) != -1;
+        if (isNonSelected) {
+          // 隐藏未选中的列
+          item.isShow = false;
+        } else {
+          // 显示已选中的列
+          item.isShow = true;
+        }
+      });
+    },
   },
 };
 </script>
+
+<style>
+/* 
+  数据报表css样式
+*/
+#pane-third .el-table__fixed {
+  height: 100% !important;
+}
+#pane-third .el-table {
+  color: #fff;
+}
+#pane-third .el-table thead {
+  color: #fff;
+}
+#pane-third .cell {
+  text-align: center;
+}
+
+.el-table__fixed-body-wrapper {
+  /* height: 369px !important; */
+}
+#pane-third .el-table__header {
+  /* width: 100.65% !important; */
+}
+
+#pane-third .el-table--fit {
+  background-color: rgb(0, 66, 78, 0) !important;
+}
+#pane-third .el-table th,
+.el-table tr {
+  background-color: rgb(0, 66, 78, 0.5) !important;
+}
+.el-table__fixed-body-wrapper::-webkit-scrollbar {
+  width: 0;
+  height: 0;
+}
+#pane-third .block span {
+  padding: 0 10px;
+}
+#pane-third .el-input__inner {
+  width: 414px !important;
+  height: 30px !important;
+  line-height: 30px !important;
+  background-color: transparent;
+  border: 1px solid rgba(3, 107, 119, 1);
+}
+#pane-third .el-range-input {
+  background-color: transparent;
+  color: #fff;
+}
+#pane-third .el-range-separator {
+  line-height: 20px;
+  color: #fff;
+}
+#pane-third .operation {
+  float: right;
+  margin-right: 10px;
+}
+#pane-third button {
+  height: 30px !important;
+  min-height: 30px;
+  line-height: 0;
+  margin-top: 0px;
+  padding: 0px 10px;
+  margin-left: 17px;
+}
+#pane-third button span {
+  font-size: 0.18rem;
+  padding: 0 10px;
+  font-family: Microsoft YaHei Regular, Microsoft YaHei Regular-Regular;
+}
+#pane-third .box {
+  padding-left: 10px;
+  display: flex;
+  margin-top: 12px;
+}
+#pane-third .el-checkbox-group {
+  margin-left: 30px;
+}
+#pane-third .el-checkbox .el-checkbox__label {
+  color: #fff;
+  font-size: 0.18rem;
+}
+#pane-third .el-checkbox .el-checkbox__input .el-checkbox__inner {
+  background-color: transparent;
+  border: 1px solid rgba(1, 111, 109, 1);
+}
+#pane-third .el-checkbox__input.is-checked .el-checkbox__inner,
+.el-checkbox__input.is-indeterminate .el-checkbox__inner {
+  background-color: rgba(1, 111, 109, 1) !important;
+}
+#pane-third .el-checkbox__inner::after {
+  border: 1px solid rgba(0, 244, 253, 1);
+  border-left: 0;
+  border-top: 0;
+}
+#pane-third .table {
+  margin-top: 10px;
+  padding: 0 10px;
+}
+#pane-third .el-table--border,
+.el-table--group {
+  border: 1px solid rgba(1, 111, 109, 0.5);
+  background-color: transparent;
+}
+#pane-third .el-table--border td,
+.el-table--border th,
+.el-table__body-wrapper .el-table--border.is-scrolling-left ~ .el-table__fixed {
+  border-right: 1px solid rgba(1, 111, 109, 0.5);
+  color: #fff;
+}
+#pane-third .el-table td,
+.el-table th.is-leaf {
+  border-bottom: 1px solid rgba(1, 111, 109, 0.5);
+}
+#pane-third .el-table th,
+.el-table tr {
+  border-bottom: 1px solid rgba(1, 111, 109, 0.5);
+}
+#pane-third .table .el-table thead.is-group th {
+  background-color: rgb(0, 66, 78, 1) !important;
+}
+#pane-third .el-table__row {
+  background-color: transparent;
+}
+
+/* #pane-third .el-table__body {
+  width: 100% !important;
+} */
+#pane-third .el-table__body .hover-row > td {
+  background-color: rgb(3, 61, 72, 1) !important;
+}
+#pane-third .el-table__body tr > td:nth-child(1) {
+  background-color: rgb(0, 66, 78, 1) !important;
+}
+#pane-third .el-table__body-wrapper::-webkit-scrollbar {
+  width: 5px;
+  height: 5px;
+}
+#pane-third .el-table__body-wrapper::-webkit-scrollbar-thumb {
+  border-right: none;
+  background-color: #01f5f1;
+  border-radius: 5px;
+}
+#pane-third .el-table__body-wrapper::-webkit-scrollbar-track {
+  background-color: rgb(0, 66, 78, 1);
+}
+#pane-third .el-table__body-wrapper::-webkit-scrollbar-thumb:hover {
+  background-color: rgb(17, 177, 174);
+}
+#pane-third .el-table__body-wrapper::-webkit-scrollbar-thumb:active {
+  background-color: rgb(9, 136, 134);
+}
+
+#pane-third .zwsj {
+  margin: 65px 0;
+}
+#pane-third .el-table--border::after,
+.el-table--group::after {
+  width: 0;
+}
+#pane-third .el-table::before {
+  height: 0px;
+}
+#pane-third .el-table__fixed-right::before,
+.el-table__fixed::before {
+  height: 0px;
+}
+/* #pane-third .is-scrolling-middle {
+  height: 374px !important;
+  z-index: 1;
+}
+#pane-third .is-scrolling-right {
+  height: 374px !important;
+  z-index: 1;
+}
+#pane-third .is-scrolling-left {
+  height: 374px !important;
+  z-index: 1;
+} */
+</style>
+
+<style>
+/* 历史趋势css样式 */
+.se-content {
+  width: 100%;
+  height: 100%;
+  margin: 0 auto;
+  display: flex;
+}
+.se-content .el-tabs__header {
+  /* width: calc(130px * 10); */
+  width: 100%;
+  margin: 0 auto;
+}
+.se-content .el-tabs__item.is-active {
+  background: rgba(6, 68, 83, 1) !important;
+}
+.se-content .el-tabs__active-bar {
+  width: 130px !important;
+  top: 0;
+  background: transparent;
+}
+.se-content .el-tabs__item {
+  border-top: 1px rgba(0, 244, 253, 0.1) solid;
+  border-bottom: 1px rgba(0, 244, 253, 0.1) solid;
+}
+.se-content .el-tabs__nav-scroll {
+  border-bottom: 0px rgba(0, 244, 253, 0.1) solid;
+}
+.se-content .el-tabs__nav {
+  /* width: 100%; */
+  width: calc(130px * 9);
+  float: none !important;
+  margin: auto;
+}
+.se-content .preservation {
+  min-height: 35px !important;
+  line-height: 10px;
+  height: 35px;
+  margin: 5px 0.4rem 5px 0px;
+}
+.se-content #tab-flow {
+  border-left: 1px rgba(0, 244, 253, 0.1) solid;
+}
+
+#pane-second .block {
+  margin-top: 3px;
+}
+#pane-second .el-input__inner {
+  width: 414px !important;
+  height: 30px !important;
+  line-height: 30px !important;
+  background-color: transparent;
+  border: 1px solid rgba(3, 107, 119, 1);
+}
+#pane-second span {
+  font-size: 0.2rem;
+  padding: 0 10px;
+  font-family: Microsoft YaHei Regular, Microsoft YaHei Regular-Regular;
+}
+#pane-second .el-range-input {
+  background-color: transparent;
+  color: #fff;
+}
+#pane-second .el-range-separator {
+  line-height: 20px;
+  color: #fff;
+}
+</style>
+
 <style>
 .Site-details {
   width: 98%;
-  height: 705px;
   /* opacity: 0.2; */
   background-color: rgba(0, 244, 253, 0.1);
   border: 1px solid rgba(0, 244, 253, 0.1);
@@ -243,7 +916,11 @@ export default {
   margin-top: 5px;
 }
 
+.el-tabs__nav-wrap {
+  margin-bottom: 0px;
+}
 .el-tabs__nav-scroll {
+  border-bottom: 1px rgba(0, 244, 253, 0.1) solid;
   margin: 0 auto;
 }
 .el-tabs__item {
@@ -264,6 +941,7 @@ export default {
   background: #4bf4f9;
 }
 .el-tabs__nav-wrap::after {
+  bottom: revert;
   height: 1px !important;
   background-color: rgba(0, 244, 253, 0.1) !important;
 }
@@ -284,20 +962,27 @@ export default {
   background: transparent;
 }
 .ac-content .el-tabs__item {
-  border: 1px rgba(0, 244, 253, 0.1) solid;
+  border-left: 1px rgba(0, 244, 253, 0.1) solid;
+  border-top: 1px rgba(0, 244, 253, 0.1) solid;
 }
 .primary {
   position: absolute;
   top: 0;
   right: 10px;
-  width: 72px !important;
   min-height: 34px !important;
   line-height: 8px;
+  z-index: 10;
 }
+</style>
 
+<style>
+/* 
+  模拟量css样式
+ */
 .ac-content .model > div {
   width: 25%;
-  height: 570px;
+  height: 580px;
+  margin-top: 10px;
 }
 .ac-content .model .display {
   display: flex;
@@ -319,7 +1004,12 @@ export default {
   padding-left: 0.7rem;
   color: rgba(1, 201, 208, 1);
 }
+</style>
 
+<style>
+/* 
+  状态量css样式
+ */
 .ac-content .states {
   display: flex;
 }
@@ -366,7 +1056,7 @@ export default {
   height: 24px;
   background: url(./../../assets/images/state_OFF.png) no-repeat;
   background-size: cover;
-  margin-top: 0.1rem;
+  margin-top: 6px;
   margin-left: 0.2rem;
 }
 </style>

+ 0 - 4
src/views/site/Power_diagram.vue

@@ -157,10 +157,6 @@ export default {
       });
   },
   unmounted() {
-    this.$router.push({
-      path: "/CircuitEdit",
-      name: "circuitEdit",
-    });
     window.removeEventListener("beforeunload", (e) => this.test(e));
   },
 };

+ 312 - 0
src/views/site_ehcarts/Device_motore.vue

@@ -0,0 +1,312 @@
+<template>
+  <div
+    ref="main"
+    :class="className"
+    :style="{ height: height, width: width }"
+  ></div>
+</template>
+<script>
+import * as echarts from "echarts";
+
+export default {
+  props: {
+    defaul_tTime: {
+      type: Array,
+    },
+    className: {
+      type: String,
+      default: "chart",
+    },
+    width: {
+      type: String,
+      default: "100%",
+    },
+    height: {
+      type: String,
+      default: "580px",
+    },
+    perData: {
+      type: Array,
+      default: () => [
+        {
+          color: "#01ACFF",
+          name: "摄像头",
+          value: [39],
+          // nAmount: 566557.14,
+        },
+      ],
+    },
+  },
+  data() {
+    return {
+      chart: null,
+      color_XY: "rgba(0, 244, 253, 0.1)",
+      itemStyle: [
+        {
+          normal: {
+            borderColor: "rgba(0,244,253,1)",
+            borderWidth: 2,
+            color: "rgba(6, 68, 83, 1)",
+            lineStyle: {
+              width: 2, //折线宽度
+              color: "rgba(0,244,253,1)",
+            },
+          },
+        },
+        {
+          normal: {
+            borderColor: "rgba(253,143,0,1)",
+            borderWidth: 2,
+            color: "rgba(6, 68, 83, 1)",
+            lineStyle: {
+              width: 2, //折线宽度
+              color: "rgba(253,143,0,1)",
+            },
+          },
+        },
+        {
+          normal: {
+            borderColor: "rgba(0,255,18,1)",
+            borderWidth: 2,
+            color: "rgba(6, 68, 83, 1)",
+            lineStyle: {
+              width: 2, //折线宽度
+              color: "rgba(0,255,18,1)",
+            },
+          },
+        },
+      ],
+      msgFormSon: null,
+    };
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.initChart();
+      // this.getMsgFormSon();
+      console.log(this.defaul_tTime);
+    });
+  },
+  beforeUnmount() {
+    window.removeEventListener("resize", this.chart);
+  },
+  methods: {
+    initChart() {
+      var chart = echarts.init(this.$refs.main);
+      var option;
+      let data = [
+        "2020-01-01 14:00:00",
+        "2020-01-01 15:00:00",
+        "2020-01-01 16:00:00",
+        "2020-01-01 17:00:00",
+        "2020-01-01 18:00:00",
+        "2020-01-01 19:00:00",
+        "2020-01-01 20:00:00",
+        "2020-01-01 21:00:00",
+        "2020-01-01 22:00:00",
+        "2020-01-01 23:00:00",
+        "2020-01-02 01:05:00",
+        "2020-01-02 01:10:00",
+        "2020-01-02 01:15:00",
+        "2020-01-02 01:20:00",
+        "2020-01-02 01:25:00",
+        "2020-01-02 01:30:00",
+        "2020-01-02 01:35:00",
+        "2020-01-02 01:40:00",
+        "2020-01-02 01:45:00",
+        "2020-01-02 01:50:00",
+        "2020-01-02 01:55:00",
+        "2020-01-02 02:00:00",
+      ];
+
+      option = {
+        // title: {
+        //   // text: "折线图堆叠",
+        //   textStyle: {
+        //     color: "red",
+        //     fontSize: "12",
+        //     fontFamily: "fangsong",
+        //     fontWeight: "400",
+        //     fontStyle: "normal",
+        //   },
+
+        //   // subtext: "副标题",
+        //   subtextStyle: {
+        //     color: "red",
+        //   },
+
+        //   align: "center",
+        //   x: "right",
+        //   y: "top",
+        //   textAlign: "center",
+        //   padding: [5, 10, 5, 10],
+        //   itemGap: "4",
+        // },
+        tooltip: {
+          backgroundColor: "rgba(0, 244, 253, 0.1)",
+          borderColor: "rgba(0, 244, 253, 0.3)",
+          textStyle: {
+            color: "#fff",
+          },
+          trigger: "axis",
+          // item  主要在散点图,饼图等无类目轴的图表中使用。 // axis  坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用 //none   什么都不触发
+          axisPointer: {
+            // 坐标轴指示器配置项。
+            type: "cross",
+            // line   直线指示器 / 'shadow' 阴影指示器 /'none' 无指示器 /'cross' 十字准星指示器。其实是种简写,表示启用两个正交的轴的 axisPointer。
+          },
+          formatter: function (params) {
+            // console.log(params);
+            var res = params[0].name;
+            for (let i in params) {
+              res += `
+              <div style="display:flex">
+                  <div style="width:10px;height:10px;background:${params[i].borderColor};border-radius: 10px;margin:10px 0;"></div>
+                  <div style="padding:4px 0px 0px 10px;">${params[i].seriesName}</div>
+                  <div style="padding:4px 0px 0px 40px;">${params[i].data}</div>
+              </div>`; //可以在这个方法中做改变
+            }
+
+            return res;
+          },
+        },
+        legend: {
+          //   orient: "vertical",
+          bottom: 0,
+          right: "auto",
+          left: "center",
+          padding: [5, 10, 18, 10],
+          data: ["A相电流", "B相电流", "C相电流"],
+          itemGap: 70, // 图例间隔
+          itemWidth: 40, // 图例宽度
+          itemHeight: 15, //高度
+          textStyle: {
+            fontSize: "12",
+            color: "#fff",
+            fontFamily:
+              "font-family: Microsoft YaHei Regular, Microsoft YaHei Regular-Regular;",
+            padding: [5, 10, 18, 10],
+          },
+
+          formatter: function (name) {
+            return name;
+          },
+        },
+        grid: {
+          left: "3%",
+          right: "4%",
+          bottom: "10%",
+          containLabel: true,
+        },
+        toolbox: {
+          show: false,
+        },
+        xAxis: {
+          type: "time",
+          // boundaryGap: false,
+          nameTextStyle: {
+            // 名称样式
+            fontSize: 12,
+            color: "#fff",
+            fontWeight: "bold",
+          },
+          axisLine: {
+            lineStyle: {
+              color: this.color_XY,
+            },
+            // symbol: ["none", "arrow"], //轴线两边的箭头
+            symbolSize: [8, 12],
+          },
+          interval: 2,
+          axisLabel: {
+            textStyle: {
+              color: "#fff", //坐标值得具体的颜色
+            },
+            // formatter: '{yyyy}-{MM}-{dd}'
+            formatter: {
+              year: "{yyyy}",
+              month: "{MMM}",
+              day: "{MM}-{dd} {hh}:{mm}",
+              hour: "{MM}-{dd} {HH}:{mm}",
+              minute: "{HH}:{mm}",
+              second: "{HH}:{mm}:{ss}",
+              millisecond: "{hh}:{mm}:{ss} {SSS}",
+              none: "{yyyy}-{MM}-{dd} {hh}:{mm}:{ss} {SSS}",
+            },
+          },
+        },
+        yAxis: {
+          type: "value",
+          max: 0.15,
+          splitLine: {
+            lineStyle: {
+              // 使用深浅的间隔色
+              color: [this.color_XY],
+            },
+          },
+          axisLabel: {
+            textStyle: {
+              color: "#fff", //坐标值得具体的颜色
+            },
+          },
+        },
+        series: [
+          {
+            // smooth: true,  //设置折线为圆滑曲线,false则有转折点
+            name: "A相电流",
+            type: "line",
+            data: [
+              0, 0, 0, 0.03, 0, 0, 0, 0, 0, 0, 0, 0.005, 0, 0, 0, 0.03, 0, 0, 0,
+              0, 0, 0, 0, 0.005, 0, 0, 0, 0.03, 0, 0, 0, 0, 0, 0, 0, 0.005,
+            ].map((val, ind) => {
+              return [data[ind], val];
+            }), //0
+            itemStyle: this.itemStyle[0],
+            symbolSize: 10,
+            symbol: "circle",
+          },
+          {
+            name: "B相电流",
+            type: "line",
+            data: [
+              0.015, 0.01, 0.015, 0.012, 0.01, 0.012, 0.01, 0.01, 0.06, 0.04,
+              0.007, 0, 0.015, 0.01, 0.015, 0.012, 0.01, 0.012, 0.01, 0.01,
+              0.06, 0.04, 0.007, 0,
+            ].map((val, ind) => {
+              return [data[ind], val];
+            }), //0.01,
+            itemStyle: this.itemStyle[1],
+            symbolSize: 10,
+            symbol: "circle",
+          },
+          {
+            name: "C相电流",
+            type: "line",
+            data: [
+              0.02, 0, 0.03, 0.04, 0.03, 0.04, 0.02, 0.03, 0.009, 0.03, 0.006,
+              0.008, 0.02, 0, 0.03, 0.04, 0.03, 0.04, 0.02, 0.03, 0.009, 0.03,
+              0.006, 0.008,
+            ].map((val, ind) => {
+              return [data[ind], val];
+            }), //0.005,
+            itemStyle: this.itemStyle[2],
+            symbolSize: 10,
+            symbol: "circle",
+          },
+        ],
+      };
+
+      chart.setOption(option);
+      window.addEventListener("resize", () => {
+        chart.resize();
+      });
+      this.chart = chart;
+    },
+    getMsgFormSon() {
+      // this.$emit("func", "aaaaaaaaaaaaaaaaaaaa");
+      console.log("aaaaaaaaaaaa");
+      // this.msgFormSon = data;
+      // console.log(this.msgFormSon);
+    },
+  },
+};
+</script>

+ 16 - 1
vue.config.js

@@ -2,5 +2,20 @@
 module.exports = {
     // 打包后路径错误导致的空白页面问题。
     publicPath: './',
-    outputDir: process.env.outputDir
+    outputDir: process.env.outputDir,
+    //      *  分别为生成环境和开发环境配置
+    configureWebpack: config => {
+        if (process.env.NODE_ENV === 'production') {
+            // 为生产环境修改配置...
+            config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
+        } else {
+            // 为开发环境修改配置...
+        }
+        Object.assign(config, {
+            externals: {
+                'AMap': 'AMap',
+                'AMapUI': 'AMapUI'
+            }
+        })
+    },
 }