Преглед изворни кода

web组态修改/安全协议修改202107230859

fanghuisheng пре 4 година
родитељ
комит
47d971a8b5

Разлика између датотеке није приказан због своје велике величине
+ 285 - 221
package-lock.json


+ 2 - 2
package.json

@@ -31,8 +31,8 @@
         "eslint-plugin-vue": "^7.0.0-0",
         "less": "^4.0.0",
         "less-loader": "^7.2.1",
-        "node-sass": "^4.12.0",
-        "sass-loader": "^8.0.2",
+        "node-sass": "^5.0.0",
+        "sass-loader": "^10.1.1",
         "sass-resources-loader": "^2.2.1"
     },
     "eslintConfig": {

+ 9 - 21
src/components/SvgComponents.vue

@@ -21,15 +21,15 @@ export default {
     height(height) {
       this.edit_height(height);
     },
-    svgInfoData() {
-      this.svgInfoData.forEach((f) => {
-        let componentInfo = {
-          template: f.template,
-          props: f.props,
-        };
-        importComponents[f.type] = componentInfo;
-      });
-    },
+  },
+  created() {
+    this.svgInfoData.forEach((f) => {
+      let componentInfo = {
+        template: f.template,
+        props: f.props,
+      };
+      importComponents[f.type] = componentInfo;
+    });
   },
   mounted() {
     this.$nextTick(() => {
@@ -62,36 +62,27 @@ export default {
     },
     edit_height(val) {
       var el = this.$refs.textsss.$el;
-
       if (el != undefined) {
         var dom = document.getElementById(el.parentNode.id);
         var title = dom.getAttribute("title");
         var type = dom.getAttribute("type");
-
         let rect = dom.getElementsByTagName("rect")[0];
-
         let line = dom.getElementsByTagName("line")[0];
         let line2 = dom.getElementsByTagName("line")[1];
         let line3 = dom.getElementsByTagName("line")[2];
         let line4 = dom.getElementsByTagName("line")[3];
-
         let polyline = dom.getElementsByTagName("polyline")[0];
         let polyline2 = dom.getElementsByTagName("polyline")[1];
-
         let polygon = dom.getElementsByTagName("polygon")[0];
-
         let ellipse = dom.getElementsByTagName("ellipse")[0];
         let ellipse2 = dom.getElementsByTagName("ellipse")[1];
-
         var line_ = dom.getElementsByTagName("line");
         let polyline_ = dom.getElementsByTagName("polyline");
         var ellipse_ = dom.getElementsByTagName("ellipse");
         let polygon_ = dom.getElementsByTagName("polygon");
         var path_ = dom.getElementsByTagName("path");
         var x1, y1, x2, y2, points, cx, cy, rx, ry, transform;
-
         // console.log(val, el);
-
         if (val != null && val != "") {
           if (title === "断路器") {
             rect.setAttribute("x", -val / 4);
@@ -215,7 +206,6 @@ export default {
             ellipse.setAttribute("rx", val * 4);
             ellipse.setAttribute("ry", val * 4);
             ellipse.setAttribute("transform", "translate(" + translate2 + ")");
-
             line.setAttribute("x1", -val - -3);
             line.setAttribute("y1", val * 10);
             line.setAttribute("x2", val * 5);
@@ -309,11 +299,9 @@ export default {
               polygon_[0].setAttribute("points", points);
               line_[0].setAttribute("y1", -val * 4);
               line_[0].setAttribute("y2", -val * 7);
-
               line_[1].setAttribute("y1", -val * 4);
               line_[1].setAttribute("x2", val * 2);
               line_[1].setAttribute("y2", -val * 2);
-
               line_[2].setAttribute("y1", -val * 4);
               line_[2].setAttribute("x2", -val * 2);
               line_[2].setAttribute("y2", -val * 2);

+ 1 - 1
src/main.js

@@ -1,4 +1,4 @@
-import { createApp } from 'vue';
+import { createApp } from 'vue/dist/vue.esm-bundler.js';
 import Antd from 'ant-design-vue';
 import App from './App.vue';
 import 'ant-design-vue/dist/antd.css';

+ 8 - 9
src/router/index.js

@@ -50,10 +50,9 @@ let routes = [
     //配电系统图页面
     {
         path: '/CircuitEdit',
-        name: 'circuitEdit',
+        name: 'CircuitEdit',
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
-            // import('../views/site/Power_diagram.vue'),
             import('../views/site/CircuitEdit.vue'),
     },
 
@@ -81,16 +80,16 @@ let routes = [
         name: 'power_diagram',
         meta: { title: '配电系统图', name: "测试站点一", type: "menu" },
         component: () =>
-            import ('../views/site/Power_diagram.vue'),
+            import('../views/site/Power_diagram.vue'),
         // import ('../views/site/CircuitEdit.vue'),
     },
     // 编辑器页面
     {
-        path: '/CircuitEdit',
-        name: 'CircuitEdit',
+        path: '/CircuitEdit1',
+        name: 'CircuitEdit1',
         meta: { title: '编辑器', name: "测试站点一", type: "" },
         component: () =>
-            import('../views/CircuitEdit.vue'),
+            import('../views/CircuitEdit1.vue'),
     },
     // 预览页页面
     {
@@ -109,7 +108,7 @@ let routes = [
         name: 'login',
         meta: { title: '登录', name: "登录 ", type: "" },
         component: () =>
-            import ('../views/login.vue'),
+            import('../views/login.vue'),
     },
 
 
@@ -120,8 +119,8 @@ let routes = [
 
 const router = createRouter({
     history: routerHistory,
-    base: '/vuefiv/',
-    mode: 'history',
+    // base: '/vuefiv/',
+    // mode: 'history',
     routes
 });
 

+ 1 - 7
src/views/CircuitEdit.vue → src/views/CircuitEdit1.vue

@@ -117,7 +117,6 @@ import LeftToolBar from "@/components/LeftToolBar.vue";
 import RightToolBar from "@/components/RightToolBar.vue";
 // import SvgComponents from '@/components/SvgComponents.vue';
 import global from "@/global/global.js"; //全局变量
-// import admin from '@/global/1.json';//全局变量
 import SvgComponents from "@/components/SvgComponents.vue";
 export default {
   components: { LeftToolBar, RightToolBar, SvgComponents },
@@ -391,13 +390,10 @@ export default {
       .get("/1.json")
       .then(function (response) {
         _this.AnalogData = response.data;
-        // console.log(response);
-        _this.path('/CircuitPreview')
       })
       .catch(function (error) {
         console.log(error);
       });
-
     let canvasdiv = document.querySelector("#canvas");
     _this.guideX = document.querySelector("#guide-x"); //辅助线x轴
     _this.guideY = document.querySelector("#guide-y"); //辅助线y轴
@@ -434,7 +430,7 @@ export default {
           return;
         }
         //根据类型和鼠标位置创建组件
-        // console.log(_this.CurrentlySelectedToolBar.Type);
+        console.log(_this.CurrentlySelectedToolBar.Type);
 
         let svgItem = {
           id: _this.$UCore.GenUUid(),
@@ -459,7 +455,6 @@ export default {
         setTimeout(function () {
           //获取所有g标签 将当前标签追加选中样式
           let gAnyList = document.querySelectorAll("g");
-          console.log(gAnyList);
           gAnyList.forEach((g) => {
             g.classList.remove("topo-layer-view-selected");
           });
@@ -537,7 +532,6 @@ export default {
       .get("/InterfaceReturn.json")
       .then(function (response) {
         _this.svgInfoData = response.data;
-        // console.log(response.data);
       })
       .catch(function (error) {
         console.log(error);

+ 1 - 1
src/views/index.vue

@@ -66,7 +66,7 @@
       <div class="title">{{ name }}</div>
       <div class="rigth">
         <div class="showTime">{{ time }}</div>
-        <router-link class="home" to="/" v-if="home"></router-link>
+        <router-link class="home" to="/home" v-if="home"></router-link>
         <div class="news">
           <div></div>
           <span><a>9</a></span>

+ 2 - 6
src/views/site/CircuitEdit.vue

@@ -97,7 +97,6 @@
 // import RightToolBar from "@/components/RightToolBar.vue";
 // import SvgComponents from '@/components/SvgComponents.vue';
 import global from "@/global/global.js"; //全局变量
-// import admin from '@/global/1.json';//全局变量
 import SvgComponents from "@/components/SvgComponents.vue";
 // import api from "../api/content/CircuitEdit";
 export default {
@@ -272,11 +271,9 @@ 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",
@@ -416,7 +413,7 @@ export default {
           return;
         }
         //根据类型和鼠标位置创建组件
-        // console.log(_this.CurrentlySelectedToolBar.Type);
+        console.log(_this.CurrentlySelectedToolBar.Type);
 
         let svgItem = {
           id: _this.$UCore.GenUUid(),
@@ -456,7 +453,7 @@ export default {
     setTimeout(() => {
       this.testE();
       this.testH();
-    }, 100);
+    }, 1000);
   },
   created() {
     let _this = this;
@@ -465,7 +462,6 @@ export default {
       .get("/InterfaceReturn.json")
       .then(function (response) {
         _this.svgInfoData = response.data;
-        // console.log(response.data);
       })
       .catch(function (error) {
         console.log(error);

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

@@ -146,7 +146,6 @@ export default {
     window.addEventListener("beforeunload", (e) => this.test(e));
     _this.svgLists = JSON.parse(localStorage.getItem("svginfo"));
     //请求接口获取组件
-
     this.$axios
       .get("/InterfaceReturn.json")
       .then(function (response) {

+ 11 - 2
vue.config.js

@@ -25,16 +25,25 @@ module.exports = {
                 alias: {
                     '@': resolve('src'),
                     '~': process.cwd(),
-                    // public: resolve('public'),
+                    public: resolve('public'),
                     components: resolve('src/components'),
                     util: resolve('src/utils'),
                     store: resolve('src/store'),
                     router: resolve('src/router')
                 }
-            }
+            },
         })
     },
     // build: {
+    //     // Template for index.html
+    //     index: path.resolve(__dirname, '../dist/index.html'),
+
+    //     // Paths
+    //     assetsRoot: path.resolve(__dirname, '../dist'),
+    //     assetsSubDirectory: './static',
+    //     assetsPublicPath: '/vuefiv/',//修改这里
+    // }
+    // build: {
     //     assetsPublicPath: '/vuefiv/'
     // }
     // devServer: {

Неке датотеке нису приказане због велике количине промена