yangbifan 2 years ago
parent
commit
ab1f265594
4 changed files with 68 additions and 39 deletions
  1. 2 2
      config/dev.env.js
  2. 2 2
      public/index.html
  3. 60 31
      src/pages/main/luckySheet/index.vue
  4. 4 4
      vue.config.js

+ 2 - 2
config/dev.env.js

@@ -6,8 +6,8 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
   ENV_CONFIG: '"dev"',
   ctx:'"http://127.0.0.1:8080"',
-  ctxForm: '"http://10.149.85.91:8880"',//dev
-  // ctxForm: '"http://43.138.50.94:8880"',//test
+  // ctxForm: '"http://10.149.85.91:8880"',//dev
+  ctxForm: '"http://43.138.50.94:8880"',//test
   // ctxForm: '"http://192.168.2.124:8880"',//test
   // ctxForm: '"http://10.230.15.228:8880"',//生产
   excludeMeWhenSelectNextHandler:false,

+ 2 - 2
public/index.html

@@ -34,9 +34,9 @@
   <!-- built files will be auto injected -->
   <script type="text/javascript">
     // window.staticHost = 'http://10.230.26.15:8000/mkt'; // 正式
-    window.staticHost = 'http://10.149.85.91:8000/spfm'; // 测试
+    // window.staticHost = 'http://10.149.85.91:8000/spfm'; // 测试
     // window.staticHost = 'http://192.168.0.103:9600/';
-    // window.staticHost = 'http://192.168.2.142:9600/';
+    window.staticHost = 'http://43.138.50.94:9600';
 
     // document.title = "hello";
   </script>

+ 60 - 31
src/pages/main/luckySheet/index.vue

@@ -21,13 +21,14 @@
 </template>
 
 <script>
+import axios from 'axios'
 import luckyexcel from "luckyexcel";
 export default {
   data() {
     return {
       excelStatus: false,
       optionsExcel: [],
-      ids:'',
+      ids: "",
     };
   },
   created() {
@@ -149,48 +150,76 @@ export default {
         },
         data: {},
       }).then((res) => {
-        this.ids = e.id
+        this.ids = e.id;
         // this.optionsExcel = res.data;
-        let options ={
-        container: "luckysheet",
-        title: "123123",
-        allowUpdate: true,
-        lang: "zh",
-        loadUrl: window.location.protocol + '//10.149.85.91:7777' + "/sheet/worksheet/"+this.ids,
-        loadSheetUrl: window.location.protocol + '//10.149.85.91:7777' +"/sheet/loadsheet/"+this.ids,
-        updateUrl: "ws://"+'//10.149.85.91:7777'+ "/ws/" + JSON.parse(window.sessionStorage.userInfo).loginName + "/"+this.ids
-      }
-        window.luckysheet.create(options)
-           this.excelStatus = true
-           
+        let options = {
+          container: "luckysheet",
+          title: "123123",
+          allowUpdate: true,
+          lang: "zh",
+          loadUrl:
+            window.location.protocol +
+            "//43.138.50.94:7777" +
+            "/sheet/worksheet/" +
+            this.ids,
+          loadSheetUrl:
+            window.location.protocol +
+            "//43.138.50.94:7777" +
+            "/sheet/loadsheet/" +
+            this.ids,
+          updateUrl:
+            "ws://" +
+            "//43.138.50.94:7777" +
+            "/ws/" +
+            JSON.parse(window.sessionStorage.userInfo).loginName +
+            "/" +
+            this.ids,
+        };
+        window.luckysheet.create(options);
+        this.excelStatus = true;
       });
     },
     //获取所有
     getAllExcel() {
-      this.$http({
-        url: "/api/sheet/allSheet",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: {},
-      }).then((res) => {
+      let data = {};
+      axios.post("http://43.138.50.94:7777/sheet/allSheet", data).then((res) => {
         console.log(res);
         this.optionsExcel = res.data;
       });
+      // this.$http({
+      //   url: "/api/sheet/allSheet",
+      //   method: "post",
+      //   headers: {
+      //     "Content-Type": "application/json",
+      //   },
+      //   data: {},
+      // }).then((res) => {
+      //   console.log(res);
+      //   this.optionsExcel = res.data;
+      // });
     },
     newExcle() {
-      //    this.excelStatus = true
-      this.$http({
-        url: "/api/sheet/create",
-        method: "post",
-        headers: {
-          "Content-Type": "application/json",
-        },
-        data: {},
-      }).then((res) => {
+      let data = {};
+      axios.post("http://43.138.50.94:7777/sheet/create", data).then((res) => {
         console.log(res);
+        let list = {
+          name:res.data.name,
+          id:res.data.id
+        }
+        this.optionsExcel.push(list)
+        // this.optionsExcel = res.data;
       });
+      //    this.excelStatus = true
+      // this.$http({
+      //   url: "/api/sheet/create",
+      //   method: "post",
+      //   headers: {
+      //     "Content-Type": "application/json",
+      //   },
+      //   data: {},
+      // }).then((res) => {
+      //   console.log(res);
+      // });
     },
   },
 };

+ 4 - 4
vue.config.js

@@ -124,8 +124,8 @@ module.exports = {
                     "^/market": "",
                 },
             },
-            "/api/sheet": {
-                target: "http://192.168.2.124:7777",
+            "/api": {
+                target: "http://43.138.50.94:7777",
                 ws: false,
                 changeOrigin: true,
                 pathRewrite: {
@@ -143,8 +143,8 @@ module.exports = {
                 // target: 'http://192.168.0.156:9600/',
                 // target: 'http://192.168.2.170:9600/',
                 // target: 'http://192.168.2.169:9600/',
-                target: "http://192.168.2.124:9600",
-                // target:'http://43.138.50.94:9600',
+                // target: "http://192.168.2.124:9600",
+                target:'http://43.138.50.94:9600',
                 changeOrigin: true,
             },
         },