fanghuisheng 4 年之前
父節點
當前提交
525ff7f202

二進制
dist.zip


+ 3 - 2
public/static/config.js

@@ -2,8 +2,9 @@
 var PLATFROM_CONFIG = {};
 // PLATFROM_CONFIG.baseUrl = "http://172.16.120.155:8010/" //杨强本地
 // PLATFROM_CONFIG.baseUrl = "http://172.16.1.196:8010/"  //超博本地
-PLATFROM_CONFIG.baseUrl = "http://124.71.174.104:80/api" //线上
-PLATFROM_CONFIG.fileUrl = "http://124.71.174.104/file/" //xlsx文件访问路径
+
+PLATFROM_CONFIG.baseUrl = "https://wx.ewoogi.com/api" //线上
+PLATFROM_CONFIG.fileUrl = "https://wx.ewoogi.com/file/" //xlsx文件访问路径
 
 
 // 当前站点 siteId 信息存储

+ 9 - 10
src/components/SvgComponents.vue

@@ -21,16 +21,15 @@ export default {
     height(height) {
       this.edit_height(height);
     },
-  },
-  created() {
-    console.log(this.svgInfoData)
-    this.svgInfoData.forEach((f) => {
-      let componentInfo = {
-        template: f.template,
-        props: f.props,
-      };
-      importComponents[f.type] = componentInfo;
-    });
+    svgInfoData() {
+      this.svgInfoData.forEach((f) => {
+        let componentInfo = {
+          template: f.template,
+          props: f.props,
+        };
+        importComponents[f.type] = componentInfo;
+      });
+    },
   },
   mounted() {
     this.$nextTick(() => {

+ 13 - 15
src/router/index.js

@@ -11,21 +11,17 @@ let routes = [
         name: 'home',
         meta: { title: '首页', name: "智慧用电监控平台", type: "index" },
         component: () =>
-            import ('../views/home/index.vue'),
+            import('../views/home/index.vue'),
     },
-
-
     // ming router end
 
-
-
     //数据管理页面
     {
         path: '/Data_mage',
         name: 'data_mage',
         meta: { title: '数据管理', name: "智慧用电监控平台 ", type: "index" },
         component: () =>
-            import ('../views/index/Data_mage.vue'),
+            import('../views/index/Data_mage.vue'),
     },
     //电能质量页面
     {
@@ -33,7 +29,7 @@ let routes = [
         name: 'power_quality',
         meta: { title: '电能质量', name: "智慧用电监控平台  ", type: "index" },
         component: () =>
-            import ('../views/index/Power_quality.vue'),
+            import('../views/index/Power_quality.vue'),
     },
     //系统管理页面
     {
@@ -41,7 +37,7 @@ let routes = [
         name: 'system_mage',
         meta: { title: '系统管理', name: "智慧用电监控平台   ", type: "index" },
         component: () =>
-            import ('../views/index/System_mage.vue'),
+            import('../views/index/System_mage.vue'),
     },
     //概览页面站点详情页面
     {
@@ -49,7 +45,7 @@ let routes = [
         name: 'overview',
         meta: { title: '概览', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Overview.vue'),
+            import('../views/site/Overview.vue'),
     },
     //配电系统图页面
     {
@@ -58,7 +54,7 @@ let routes = [
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
             // import('../views/site/Power_diagram.vue'),
-            import ('../views/site/CircuitEdit.vue'),
+            import('../views/site/CircuitEdit.vue'),
     },
 
     //设备监控页面
@@ -67,7 +63,7 @@ let routes = [
         name: 'device_motore',
         meta: { title: '设备监控', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Device_motore.vue'),
+            import('../views/site/Device_motore.vue'),
     },
     //事件告警页面
     {
@@ -75,7 +71,7 @@ let routes = [
         name: 'event_alarm',
         meta: { title: '事件告警', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Event_alarm.vue'),
+            import('../views/site/Event_alarm.vue'),
     },
 
 
@@ -86,7 +82,6 @@ let routes = [
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
             import('../views/site/Power_diagram.vue'),
-            // import ('../views/site/CircuitEdit.vue'),
     },
     // 编辑器页面
     {
@@ -94,7 +89,7 @@ let routes = [
         name: 'CircuitEdit',
         meta: { title: '编辑器', name: "测试站点一", type: "" },
         component: () =>
-            import ('../views/CircuitEdit.vue'),
+            import('../views/CircuitEdit.vue'),
     },
     // 预览页页面
     {
@@ -103,7 +98,8 @@ let routes = [
         meta: { title: '预览', name: "测试站点一", type: "" },
         component: () =>
             // import('../views/CircuitPreview.vue'),
-            import ('../views/CircuitPreview.vue'),
+            import('../views/CircuitPreview.vue'),
+        // import('../views/site/Power_diagram.vue'),
     },
 
 
@@ -114,6 +110,8 @@ let routes = [
 
 const router = createRouter({
     history: routerHistory,
+    base: '/vuefiv/',
+    mode: 'history',
     routes
 });
 

+ 1 - 0
src/views/CircuitEdit.vue

@@ -392,6 +392,7 @@ export default {
       .then(function (response) {
         _this.AnalogData = response.data;
         // console.log(response);
+        _this.path('/CircuitPreview')
       })
       .catch(function (error) {
         console.log(error);

+ 19 - 1
src/views/index.vue

@@ -65,7 +65,7 @@
 
       <div class="title">{{ name }}</div>
       <div class="rigth">
-        <div class="showTime">2021-06-28 16:32:32</div>
+        <div class="showTime">{{ time }}</div>
         <router-link class="home" to="/" v-if="home"></router-link>
         <div class="news">
           <div></div>
@@ -89,10 +89,28 @@ export default {
       home: false,
       options: [],
       value: 1,
+      time: null,
     };
   },
   components: {},
   mounted() {
+    setInterval(() => {
+      this.$store.commit("getTimeAll");
+      var time = this.$store.state.Time_All;
+      this.time =
+        time[0] +
+        "-" +
+        (time[1] < 10 ? "0" + time[1] : time[1]) +
+        "-" +
+        (time[2] < 10 ? "0" + time[2] : time[2]) +
+        " " +
+        (time[3] < 10 ? "0" + time[3] : time[3]) +
+        ":" +
+        (time[4] < 10 ? "0" + time[4] : time[4]) +
+        ":" +
+        (time[5] < 10 ? "0" + time[5] : time[5]);
+    }, 0);
+
     this.options_api();
     this.router = this.$router.options.routes;
   },

+ 67 - 48
src/views/site/CircuitEdit.vue

@@ -29,7 +29,10 @@
                 version="1.1"
                 xmlns="http://www.w3.org/2000/svg"
                 xmlns:xlink="http://www.w3.org/1999/xlink"
-                style="background-color: rgba(0, 244, 253, 0.1);border: 1px solid rgba(0, 244, 253, 0.1);"
+                style="
+                  background-color: rgba(0, 244, 253, 0.1);
+                  border: 1px solid rgba(0, 244, 253, 0.1);
+                "
                 width="100%"
                 height="100%"
               >
@@ -60,7 +63,9 @@
                     ',' +
                     item.svgPositionY +
                     ')' +
-                    'rotate(' +item.angle+')'
+                    'rotate(' +
+                    item.angle +
+                    ')'
                   "
                 >
                   <SvgComponents
@@ -96,7 +101,7 @@ import global from "@/global/global.js"; //全局变量
 import SvgComponents from "@/components/SvgComponents.vue";
 // import api from "../api/content/CircuitEdit";
 export default {
-  components: {  SvgComponents},//LeftToolBar, RightToolBar,
+  components: { SvgComponents }, //LeftToolBar, RightToolBar,
   data() {
     return {
       svgInfoData: [], //接口获取到的组件数据
@@ -129,7 +134,7 @@ export default {
       tableRowCount: 2, //表格默认行数
       tableColCount: 2, //表格默认列数
       tableDefaultData: [],
-      AnalogData: []
+      AnalogData: [],
     };
   },
   methods: {
@@ -201,8 +206,10 @@ export default {
       //console.log('点击了画布');
     },
     MousedownSvg(id, index, pointX, pointY, e) {
-      this.CurrentlySelectedToolBar.Type = global.CurrentlySelectedToolBarType = "";
-      this.CurrentlySelectedToolBar.Title = global.CurrentlySelectedToolBarTitle = "";
+      this.CurrentlySelectedToolBar.Type = global.CurrentlySelectedToolBarType =
+        "";
+      this.CurrentlySelectedToolBar.Title =
+        global.CurrentlySelectedToolBarTitle = "";
       //从数组里面根据index找到当前元素
       this.selectSvg.ID = id;
       this.selectSvg.Index = index;
@@ -244,10 +251,10 @@ export default {
       }
       e.preventDefault();
       //判断滚轮方向 -100是往上滑 100是下滑
-      let svgZoom = e.deltaY <0 ? 0.1 : -0.1;
+      let svgZoom = e.deltaY < 0 ? 0.1 : -0.1;
       console.log(e.deltaY);
       selectSvgInfo.size += svgZoom;
-      selectSvgInfo.size =parseFloat(selectSvgInfo.size.toFixed(1));
+      selectSvgInfo.size = parseFloat(selectSvgInfo.size.toFixed(1));
       if (selectSvgInfo.size < 1) {
         selectSvgInfo.size = 1;
       }
@@ -265,9 +272,11 @@ export default {
       alert(JSON.stringify(this.svgLists));
     },
     testE() {
+      console.log("aaaaaaaaaaaaaaaaaa");
       this.svgLists = this.AnalogData;
     },
     testH() {
+      console.log("bbbbbbbbbbbbbbbbbbbbb");
       localStorage.setItem("svginfo", JSON.stringify(this.svgLists));
       this.$router.push({
         path: "/Power_diagram",
@@ -354,41 +363,51 @@ export default {
               </div>
             </td>
           </tr>
-        </table>`
-      gAnyList[0].innerHTML = html
-      
+        </table>`;
+      gAnyList[0].innerHTML = html;
     },
   },
   mounted() {
+    let _this = this;
     //请求接口获取组件
     this.$axios
       .get("/1.json")
       .then(function (response) {
         _this.AnalogData = response.data;
-        // console.log(response);
+        console.log(response);
       })
       .catch(function (error) {
         console.log(error);
       });
-    let _this = this;
-    // api.queryGroupTree().then((requset)=>{
-    //   console.log(requset)
-    // })
+
     let canvasdiv = document.querySelector("#canvas");
     _this.guideX = document.querySelector("#guide-x"); //辅助线x轴
     _this.guideY = document.querySelector("#guide-y"); //辅助线y轴
-    canvasdiv.addEventListener("dragover",function (e) {
-      e.preventDefault();
-      _this.CurrentlySelectedToolBar.Type = global.CurrentlySelectedToolBarType;
-      _this.CurrentlySelectedToolBar.Title = global.CurrentlySelectedToolBarTitle;
-      _this.CurrentlySelectedToolBar.TypeName = global.CurrentlySelectedToolBarTypeName;
-      _this.CurrentlySelectedToolBar.Color = global.CurrentlySelectedToolBarColor;
-      _this.CurrentlySelectedToolBar.Height = global.CurrentlySelectedToolBarHeight;
-      _this.CurrentlySelectedToolBar.Width = global.CurrentlySelectedToolBarWidth;
-      _this.CurrentlySelectedToolBar.SvgText = global.CurrentlySelectedToolBarSvgText;
-      _this.CurrentlySelectedToolBar.FontSize = global.CurrentlySelectedToolBarFontSize;
-      _this.CurrentlySelectedToolBar.TableData = global.CurrentlySelectedToolBarTableData;
-    },false);
+    canvasdiv.addEventListener(
+      "dragover",
+      function (e) {
+        e.preventDefault();
+        _this.CurrentlySelectedToolBar.Type =
+          global.CurrentlySelectedToolBarType;
+        _this.CurrentlySelectedToolBar.Title =
+          global.CurrentlySelectedToolBarTitle;
+        _this.CurrentlySelectedToolBar.TypeName =
+          global.CurrentlySelectedToolBarTypeName;
+        _this.CurrentlySelectedToolBar.Color =
+          global.CurrentlySelectedToolBarColor;
+        _this.CurrentlySelectedToolBar.Height =
+          global.CurrentlySelectedToolBarHeight;
+        _this.CurrentlySelectedToolBar.Width =
+          global.CurrentlySelectedToolBarWidth;
+        _this.CurrentlySelectedToolBar.SvgText =
+          global.CurrentlySelectedToolBarSvgText;
+        _this.CurrentlySelectedToolBar.FontSize =
+          global.CurrentlySelectedToolBarFontSize;
+        _this.CurrentlySelectedToolBar.TableData =
+          global.CurrentlySelectedToolBarTableData;
+      },
+      false
+    );
     canvasdiv.addEventListener(
       "drop",
       function (e) {
@@ -412,9 +431,9 @@ export default {
           width: _this.CurrentlySelectedToolBar.Width,
           svgText: _this.CurrentlySelectedToolBar.SvgText,
           fontSize: _this.CurrentlySelectedToolBar.FontSize,
-          tableRowCount:_this.tableRowCount,
+          tableRowCount: _this.tableRowCount,
           tableColCount: _this.tableColCount,
-          tableData:_this.CurrentlySelectedToolBar.TableData,
+          tableData: _this.CurrentlySelectedToolBar.TableData,
           angle: 0,
           //translate:`translate(${this.mousePosition.positionX},${this.mousePosition.positionY})`
         };
@@ -437,15 +456,29 @@ export default {
     setTimeout(() => {
       this.testE();
       this.testH();
-    }, 1000);
+    }, 100);
   },
   created() {
     let _this = this;
+    //请求接口获取组件
+    this.$axios
+      .get("/InterfaceReturn.json")
+      .then(function (response) {
+        _this.svgInfoData = response.data;
+        // console.log(response.data);
+      })
+      .catch(function (error) {
+        console.log(error);
+      });
     //当前页面监视键盘输入
     document.onkeydown = function (e) {
       //获取当前选中组件
       let selectSvgInfo = _this.selectSvgInfo;
-      if (selectSvgInfo == undefined || selectSvgInfo == null || selectSvgInfo == "" ) {
+      if (
+        selectSvgInfo == undefined ||
+        selectSvgInfo == null ||
+        selectSvgInfo == ""
+      ) {
         return;
       }
       //事件对象兼容
@@ -495,16 +528,6 @@ export default {
         _this.svgLists.splice(selectSvgIndex, 1);
       }
     };
-    //请求接口获取组件
-    this.$axios
-      .get("/InterfaceReturn.json")
-      .then(function (response) {
-        _this.svgInfoData = response.data;
-        // console.log(response.data);
-      })
-      .catch(function (error) {
-        console.log(error);
-      });
   },
 };
 </script>
@@ -524,8 +547,8 @@ export default {
   border-radius: 10px;
   background-color: #444;
 }
-.ant-layout{
-  background:transparent;
+.ant-layout {
+  background: transparent;
 }
 .pageMain {
   position: absolute;
@@ -572,8 +595,4 @@ export default {
     }
   }
 }
-
-
-
-
 </style>

+ 4 - 1
src/views/site/Device_motore.vue

@@ -89,7 +89,10 @@
               </div>
             </el-tab-pane>
           </el-tabs>
-          <el-button type="primary" class="primary" @click="Real_time_api"
+          <el-button
+            type="primary"
+            class="primary"
+            @click="If_tabs_api($store.state.siteId)"
             >刷新</el-button
           >
         </el-tab-pane>

+ 3 - 3
src/views/site/components/Overview/modelStaticTop.vue

@@ -18,9 +18,9 @@
         <div>
           <p>实时负载</p>
           <p>
-            <span class="num text-yellow" style="margin-bottom: 0">{{
-              exception
-            }}</span>
+            <span class="num text-yellow" style="margin-bottom: 0"
+              >{{ exception }} kwh</span
+            >
           </p>
         </div>
       </li>

+ 3 - 0
vue.config.js

@@ -34,6 +34,9 @@ module.exports = {
             }
         })
     },
+    // build: {
+    //     assetsPublicPath: '/vuefiv/'
+    // }
     // devServer: {
     //     proxy: {
     //         './': {