소스 검색

修改本地json访问路径/配置页面访问路径

fanghuisheng 4 년 전
부모
커밋
586a93b430
10개의 변경된 파일43개의 추가작업 그리고 47개의 파일을 삭제
  1. BIN
      dist.zip
  2. 25 25
      public/InterfaceReturn.json
  3. 5 0
      public/static/config.js
  4. 2 2
      src/router/index.js
  5. 2 2
      src/views/CircuitEdit1.vue
  6. 1 1
      src/views/CircuitPreview.vue
  7. 2 2
      src/views/index.vue
  8. 2 2
      src/views/site/CircuitEdit.vue
  9. 1 1
      src/views/site/Power_diagram.vue
  10. 3 12
      vue.config.js

BIN
dist.zip


+ 25 - 25
public/InterfaceReturn.json

@@ -10,7 +10,7 @@
     "fontSize": 1,
     "height": 40,
     "svgText": "",
-    "priview_img": "/CircuitBreakerSvg.png"
+    "priview_img": "/vuefiv/CircuitBreakerSvg.png"
   },
   {
     "type": "VerticalLineSvg",
@@ -23,7 +23,7 @@
     "fontSize": 1,
     "height": 150,
     "svgText": "",
-    "priview_img": "/VerticalLineSvg.png"
+    "priview_img": "/vuefiv/VerticalLineSvg.png"
   },
   {
     "type": "TextSvg",
@@ -36,7 +36,7 @@
     "fontSize": 50,
     "height": 1,
     "svgText": "文字",
-    "priview_img": "/TextSvg.png"
+    "priview_img": "/vuefiv/TextSvg.png"
   },
   {
     "type": "IsolatingSwitchSvg",
@@ -49,7 +49,7 @@
     "fontSize": 1,
     "height": 20,
     "svgText": "",
-    "priview_img": "/IsolatingSwitchSvg.png"
+    "priview_img": "/vuefiv/IsolatingSwitchSvg.png"
   },
   {
     "type": "LightningArresterSvg",
@@ -62,7 +62,7 @@
     "fontSize": 1,
     "height": 7,
     "svgText": "",
-    "priview_img": "/LightningArresterSvg.png"
+    "priview_img": "/vuefiv/LightningArresterSvg.png"
   },
   {
     "type": "StandardCapacitorSvg",
@@ -75,7 +75,7 @@
     "fontSize": 1,
     "height": 3,
     "svgText": "",
-    "priview_img": "/StandardCapacitorSvg.png"
+    "priview_img": "/vuefiv/StandardCapacitorSvg.png"
   },
   {
     "type": "WireBreakOffSvg",
@@ -88,7 +88,7 @@
     "fontSize": 1,
     "height": 5,
     "svgText": "",
-    "priview_img": "/WireBreakOffSvg.png"
+    "priview_img": "/vuefiv/WireBreakOffSvg.png"
   },
   {
     "type": "WireConnectionSvg",
@@ -101,7 +101,7 @@
     "fontSize": 1,
     "height": 5,
     "svgText": "",
-    "priview_img": "/WireBreakOffSvg.png"
+    "priview_img": "/vuefiv/WireBreakOffSvg.png"
   },
   {
     "type": "TableSvg",
@@ -114,7 +114,7 @@
     "fontSize": 1,
     "height": 0,
     "svgText": "",
-    "priview_img": "/TableSvg.png"
+    "priview_img": "/vuefiv/TableSvg.png"
   },
   {
     "type": "HorizontalLineSvg",
@@ -127,7 +127,7 @@
     "fontSize": 1,
     "height": 150,
     "svgText": "",
-    "priview_img": "/HorizontalLineSvg.png"
+    "priview_img": "/vuefiv/HorizontalLineSvg.png"
   },
   {
     "type": "PolylineUpSvg",
@@ -140,7 +140,7 @@
     "fontSize": 1,
     "height": 7,
     "svgText": "",
-    "priview_img": "/PolylineUpSvg.png"
+    "priview_img": "/vuefiv/PolylineUpSvg.png"
   },
   {
     "type": "PolylineDownSvg",
@@ -153,7 +153,7 @@
     "fontSize": 1,
     "height": 7,
     "svgText": "",
-    "priview_img": "/PolylineDownSvg.png"
+    "priview_img": "/vuefiv/PolylineDownSvg.png"
   },
   {
     "type": "ArrowDownSvg",
@@ -166,7 +166,7 @@
     "fontSize": 1,
     "height": 2,
     "svgText": "",
-    "priview_img": "/ArrowDownSvg.png"
+    "priview_img": "/vuefiv/ArrowDownSvg.png"
   },
   {
     "type": "ArrowUpSvg",
@@ -179,7 +179,7 @@
     "fontSize": 1,
     "height": 2,
     "svgText": "",
-    "priview_img": "/ArrowUpSvg.png"
+    "priview_img": "/vuefiv/ArrowUpSvg.png"
   },
   {
     "type": "GroundGraySvg",
@@ -192,7 +192,7 @@
     "fontSize": 1,
     "height": 3,
     "svgText": "",
-    "priview_img": "/GroundGraySvg.png"
+    "priview_img": "/vuefiv/GroundGraySvg.png"
   },
   {
     "type": "SignalLamp",
@@ -205,7 +205,7 @@
     "fontSize": 1,
     "height": 3,
     "svgText": "",
-    "priview_img": "/SignalLamp.png"
+    "priview_img": "/vuefiv/SignalLamp.png"
   },
   {
     "type": "RectSvg",
@@ -216,7 +216,7 @@
     ],
     "height": 30,
     "default_color": "#FF0000",
-    "priview_img": "/RectSvg.png"
+    "priview_img": "/vuefiv/RectSvg.png"
   },
   {
     "type": "TwoCircleSvg",
@@ -229,7 +229,7 @@
     "fontSize": 1,
     "height": 3,
     "svgText": "",
-    "priview_img": "/TwoCircleSvg.png"
+    "priview_img": "/vuefiv/TwoCircleSvg.png"
   },
   {
     "type": "TransformerYSvg",
@@ -242,7 +242,7 @@
     "fontSize": 1,
     "height": 5,
     "svgText": "",
-    "priview_img": "/TransformerY.png"
+    "priview_img": "/vuefiv/TransformerY.png"
   },
   {
     "type": "TransformerTriphaseOpen",
@@ -255,7 +255,7 @@
     "fontSize": 1,
     "height": 2,
     "svgText": "",
-    "priview_img": "/TransformerTriphaseOpen.png"
+    "priview_img": "/vuefiv/TransformerTriphaseOpen.png"
   },
   {
     "type": "DoubleWindingSvg",
@@ -268,7 +268,7 @@
     "fontSize": 1,
     "height": 5,
     "svgText": "",
-    "priview_img": "/DoubleWindingSvg.png"
+    "priview_img": "/vuefiv/DoubleWindingSvg.png"
   },
   {
     "type": "DoubleWindingSvgB",
@@ -281,7 +281,7 @@
     "fontSize": 1,
     "height": 5,
     "svgText": "",
-    "priview_img": "/DoubleWindingSvgB.png"
+    "priview_img": "/vuefiv/DoubleWindingSvgB.png"
   },
   {
     "type": "GGJSvg",
@@ -294,7 +294,7 @@
     "fontSize": 1,
     "height": 1,
     "svgText": "",
-    "priview_img": "/GGJ.png"
+    "priview_img": "/vuefiv/GGJ.png"
   },
   {
     "type": "StandardReactance",
@@ -307,7 +307,7 @@
     "fontSize": 1,
     "height": 3,
     "svgText": "",
-    "priview_img": "/StandardReactance.png"
+    "priview_img": "/vuefiv/StandardReactance.png"
   },
   {
     "type": "AlternatorSvg",
@@ -319,6 +319,6 @@
     ],
     "default_color": "#FF0000",
     "height": 5,
-    "priview_img": "/AlternatorSvg.png"
+    "priview_img": "/vuefiv/AlternatorSvg.png"
   }
 ]

+ 5 - 0
public/static/config.js

@@ -6,6 +6,11 @@ var PLATFROM_CONFIG = {};
 PLATFROM_CONFIG.baseUrl = "https://wx.ewoogi.com/api" //线上
 PLATFROM_CONFIG.fileUrl = "https://wx.ewoogi.com/file/" //xlsx文件访问路径
 
+// 本地json文件请求路径
+PLATFROM_CONFIG.Interface = "/vuefiv/InterfaceReturn.json"
+PLATFROM_CONFIG.ione = "/vuefiv/1.json"
+
+
 
 // 当前站点 siteId 信息存储
 // var PLATFROM_SITEID = {};

+ 2 - 2
src/router/index.js

@@ -7,7 +7,7 @@ let routes = [
     // ming router start
     // 大屏首页看板
     {
-        path: '/home',
+        path: '/',
         name: 'home',
         meta: { title: '首页', name: "智慧用电监控平台", type: "index" },
         component: () =>
@@ -104,7 +104,7 @@ let routes = [
 
     //登录页面
     {
-        path: '/',
+        path: '/login',
         name: 'login',
         meta: { title: '登录', name: "登录 ", type: "" },
         component: () =>

+ 2 - 2
src/views/CircuitEdit1.vue

@@ -387,7 +387,7 @@ export default {
     let _this = this;
     //请求接口获取组件
     this.$axios
-      .get("/1.json")
+      .get(window.PLATFROM_CONFIG.ione)
       .then(function (response) {
         _this.AnalogData = response.data;
       })
@@ -529,7 +529,7 @@ export default {
     };
     //请求接口获取组件
     this.$axios
-      .get("/InterfaceReturn.json")
+      .get(window.PLATFROM_CONFIG.Interface)
       .then(function (response) {
         _this.svgInfoData = response.data;
       })

+ 1 - 1
src/views/CircuitPreview.vue

@@ -135,7 +135,7 @@ export default {
 
     //请求接口获取组件
     this.$axios
-      .get("/InterfaceReturn.json")
+      .get(window.PLATFROM_CONFIG.Interface)
       .then(function (response) {
         _this.svgInfoData = response.data;
         console.log(response.data);

+ 2 - 2
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="/home" v-if="home"></router-link>
+        <router-link class="home" to="/" v-if="home"></router-link>
         <div class="news">
           <div></div>
           <span><a>9</a></span>
@@ -100,7 +100,7 @@ export default {
       this.time =
         time[0] +
         "-" +
-        (time[1] < 10 ? "0" + time[1] : time[1]) +
+        (time[1] < 10 ? "0" + (time[1]+1) : (time[1]+1)) +
         "-" +
         (time[2] < 10 ? "0" + time[2] : time[2]) +
         " " +

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

@@ -368,7 +368,7 @@ export default {
     let _this = this;
     //请求接口获取组件
     this.$axios
-      .get("/1.json")
+      .get(window.PLATFROM_CONFIG.ione)
       .then(function (response) {
         _this.AnalogData = response.data;
         console.log(response);
@@ -459,7 +459,7 @@ export default {
     let _this = this;
     //请求接口获取组件
     this.$axios
-      .get("/InterfaceReturn.json")
+      .get(window.PLATFROM_CONFIG.Interface)
       .then(function (response) {
         _this.svgInfoData = response.data;
       })

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

@@ -147,7 +147,7 @@ export default {
     _this.svgLists = JSON.parse(localStorage.getItem("svginfo"));
     //请求接口获取组件
     this.$axios
-      .get("/InterfaceReturn.json")
+      .get(window.PLATFROM_CONFIG.Interface)
       .then(function (response) {
         _this.svgInfoData = response.data;
       })

+ 3 - 12
vue.config.js

@@ -5,8 +5,10 @@ function resolve(dir) {
 // 基本结构
 module.exports = {
     // 打包后路径错误导致的空白页面问题。
-    publicPath: './',
+    publicPath: '/vuefiv/',
     outputDir: process.env.outputDir,
+    // assetsPublicPath: '/vuefiv/',
+    // assetsDir: 'vuefiv',
     //      *  分别为生成环境和开发环境配置
     configureWebpack: config => {
         if (process.env.NODE_ENV === 'production') {
@@ -34,18 +36,7 @@ module.exports = {
             },
         })
     },
-    // 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: {
     //     proxy: {
     //         './': {