Parcourir la source

5-19 axios更新 页面优化

zhaomiao il y a 3 ans
Parent
commit
bf1a7aa664

Fichier diff supprimé car celui-ci est trop grand
+ 2907 - 193
package-lock.json


+ 1 - 1
package.json

@@ -6,7 +6,7 @@
     "serve": "vue-cli-service serve && webpack-dev-server --open",
     "dev": "vue-cli-service build --mode development",
     "test": "vue-cli-service build --mode test",
-    "build": "vue-cli-service build"
+    "build": "vue-cli-service build --mode production"
   },
   "dependencies": {
     "axios": "^0.21.1",

+ 125 - 1
src/api/axios.js

@@ -2,6 +2,7 @@
 import BASE from '@tools/base'
 import store from '@store/index'
 import axios from 'axios'
+
 import { Message } from 'element-ui';
 
 // 创建axios实例
@@ -29,6 +30,15 @@ const httpService = axios.create({
     // 'Content-Type': 'application/json;charset=UTF-8'
   },
 });
+
+const httpService_L = axios.create({
+  withCredentials: false, // 允许携带cookie
+  baseURL: process.env.VUE_APP_API_URL || '/api/',
+  timeout: 210000, // 请求超时时间 - 3s
+  headers: {
+    'Content-Type': 'application/x-www-form-urlencoded',
+  },
+});
 // httpService.defaults.withCredentials = true; // 表示跨域请求时是否需要使用凭证
 // http request 拦截器
 httpService.interceptors.request.use(
@@ -39,6 +49,78 @@ httpService.interceptors.request.use(
     return Promise.reject(err);
   }
 );
+//长时间相应拦截器
+httpService_L.interceptors.response.use(
+  response => {
+    const {
+      data
+    } = response;
+    if(data.code === 200){
+
+    }
+    else{
+      // let rqData = JSON.parse(response.config.data); // 请求数据
+      // console.error(BASE.getNowTime(), rqData.interfaceid+":"+data.message)
+      Message.warning(data.message);
+      store.commit('loadingStore', false); // 全局的数据 加载中.... - 开关
+      store.commit('openSubmitDDTag', false); // 防抖动 - 开关
+    }
+    return data; // 响应正确的数据
+  }, error => {
+    // 响应错误数据(错误情况分无token信息,错误码)
+    const {
+      response
+    } = error;
+    if (response) {
+      switch (error.response.status) {
+        case 400:
+          error.message = '错误请求';
+          break;
+        case 401:
+          error.message = '未授权,请重新登录';
+          break;
+        case 403:
+          error.message = '拒绝访问';
+          break;
+        case 404:
+          error.message = '请求错误,未找到该资源';
+          break;
+        case 405:
+          error.message = '请求方法未允许';
+          break;
+        case 408:
+          error.message = '请求超时';
+          break;
+        case 500:
+          error.message = '服务器端出错';
+          break;
+        case 501:
+          error.message = '网络未实现';
+          break;
+        case 502:
+          error.message = '网络错误';
+          break;
+        case 503:
+          error.message = '服务不可用';
+          break;
+        case 504:
+          error.message = '网络超时';
+          break;
+        case 505:
+          error.message = 'http版本不支持该请求';
+          break;
+        default:
+          error.message = `未知错误${error.response.status}`;
+      }
+    } else {
+      error.message = "请求超时";
+    }
+    store.commit('loadingStore', false); // 全局的数据 加载中... - 开关
+    store.commit('openSubmitDDTag', false); // 防抖动 - 开关
+    console.error(BASE.getBzDate(new Date().getTime(), 0, "datetime"), error.message)
+    Message.error(error.message + ",请稍候重试!");
+  }
+);
 // respone拦截器
 httpService.interceptors.response.use(
   response => {
@@ -46,7 +128,7 @@ httpService.interceptors.response.use(
       data
     } = response;
     if(data.code === 200){
-      
+
     }
     else{
       // let rqData = JSON.parse(response.config.data); // 请求数据
@@ -153,6 +235,46 @@ export function post(url, params = {}) {
   });
 }
 
+
+/*
+ *  get请求   长时间
+ *  url: 接口地址
+ *  params: 参数,格式如下
+ * */
+export function get_L(url, params = {}) {
+  return new Promise((resolve, reject) => {
+    httpService_L({
+      url: url,
+      method: 'get',
+      params: params,
+    }).then(response => {
+      resolve(response);
+    }).catch(error => {
+      reject(error);
+    });
+  });
+}
+
+
+/*
+ *  post请求  长时间
+ *  url: 接口地址
+ *  params: 参数,格式如下
+ * */
+export function post_L(url, params = {}) {
+
+  return new Promise((resolve, reject) => {
+    httpService_L({
+      url: url,
+      method: 'post',
+      data: params,
+    }).then(response => {
+      resolve(response);
+    }).catch(error => {
+      reject(error);
+    });
+  });
+}
 /*
  *  post请求 - 超过5s使用的方法
  *  url: 接口地址
@@ -184,6 +306,8 @@ export function postL(url, params = {}) {
 
 export default {
   get,
+  get_L,
   post,
+  post_L,
   postL,
 }

+ 96 - 84
src/assets/js/benchmarkingSys/singleTransverseBenchmark.js

@@ -1,4 +1,5 @@
 import * as echarts from "echarts";
+import { Store } from "express-session";
 export default {
   data() {
     return {
@@ -66,6 +67,7 @@ export default {
   created() {
     this.Date1 = this.BASE.getBzDate(new Date().getTime(),-1);
     this.query_wpid();
+    this.query_check();
   },
   methods: {
     clear() {
@@ -83,9 +85,10 @@ export default {
     /**
      * 获取风场
      */
-    query_wpid() {
-      this.API.get("powercompare/windfarmAjax?").then((res) => {
+     query_wpid() {
+      this.API.get("powercompare/windfarmAjax?").then(async(res) => {
         this.wpIdslist = res.data;
+        await this.query();
       }).catch(error =>{
         this.$message.error('获取数据失败');
       });
@@ -156,12 +159,18 @@ export default {
      * 获取年 曲线数据
      */
     query_line_n() {
+      this.$store.commit("loadingStore",true);
       let that = this;
+          that.lineDate_n.speed = [];
+          that.lineDate_n.value1 = [];
+          that.lineDate_n.value2 = [];
+          that.lineDate_n.value3 = [];
+          that.lineDate_n.value4 = [];
       this.API
-        .get(
+        .get_L(
           "compare/compareYearChat?windturbineid=" +
             this.fj +
-            "&date=" +
+            "&recorddate=" +
             this.Date1
         )
         .then((res) => {
@@ -174,6 +183,8 @@ export default {
             that.lineDate_n.value4[i] = Date[i].value4;
             that.lineDate_n.value5[i] = Date[i].value5;
           }
+          
+          this.ECZM.bar_djbhd("linechar_n",this.fj,this.lineDate_n);
           this.query_daycompare_n();
         }).catch(error =>{
           this.$message.error('获取数据失败');
@@ -184,10 +195,10 @@ export default {
      */
     query_daycompare_n() {
       this.API
-        .get(
+        .get_L(
           "compare/compareYearList?windturbineid=" +
             this.fj +
-            "&date=" +
+            "&recorddate=" +
             this.Date1
         )
         .then((res) => {
@@ -197,29 +208,14 @@ export default {
         });
 
       this.API
-        .get("compare/fzyYear?windturbineid=" + this.fj + "&date=" + this.Date1)
+        .get_L("compare/fzyYear?windturbineid=" + this.fj + "&recorddate=" + this.Date1)
         .then((res) => {
           let that = this;
-          Object.assign(
-            this.$data.leida_list_0,
-            this.$options.data().leida_list_0
-          );
-          Object.assign(
-            this.$data.leida_list_1,
-            this.$options.data().leida_list_1
-          );
-          Object.assign(
-            this.$data.leida_list_2,
-            this.$options.data().leida_list_2
-          );
-          Object.assign(
-            this.$data.leida_list_3,
-            this.$options.data().leida_list_3
-          );
-          Object.assign(
-            this.$data.leida_list_4,
-            this.$options.data().leida_list_4
-          );
+          this.leida_list_0 = [];
+          this.leida_list_1 = [];
+          this.leida_list_2 = [];
+          this.leida_list_3 = [];
+          this.leida_list_4 = [];
           let len = Object.keys(res.data).length;
           let lenfj = this.fj.length;
           if (len == 2) {
@@ -292,18 +288,28 @@ export default {
           }
           if (this.fj.length == 1) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
+            this.ECZM.clear("fzy2"); 
+            this.ECZM.clear("fzy3"); 
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 2) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
+            this.ECZM.clear("fzy3"); 
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 3) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
             this.ECZM.leida_djbhd("fzy3",this.leida_list_2,this.jfpl2);
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 4) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
             this.ECZM.leida_djbhd("fzy3",this.leida_list_2,this.jfpl2); 
             this.ECZM.leida_djbhd("fzy4",this.leida_list_3,this.jfpl3);
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 5) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
@@ -311,21 +317,28 @@ export default {
             this.ECZM.leida_djbhd("fzy4",this.leida_list_3,this.jfpl3); 
             this.ECZM.leida_djbhd("fzy5",this.leida_list_4,this.jfpl4); 
           }
-          this.ECZM.bar_djbhd("linechar_n",this.fj,this.lineDate);
+          this.$store.commit("loadingStore",false);
         }).catch(error =>{
           this.$message.error('获取数据失败');
+          this.$store.commit("loadingStore",false);
         });
     },
     /**
      * 获取月曲线数据
      */
     query_line_y() {
+      this.$store.commit("loadingStore",true);
       let that = this;
+          that.lineDate_y.speed = [];
+          that.lineDate_y.value1 = [];
+          that.lineDate_y.value2 = [];
+          that.lineDate_y.value3 = [];
+          that.lineDate_y.value4 = [];
       this.API
         .get(
           "compare/compareMonthChat?windturbineid=" +
             this.fj +
-            "&date=" +
+            "&recorddate=" +
             this.Date1
         )
         .then((res) => {
@@ -338,6 +351,8 @@ export default {
             that.lineDate_y.value4[i] = Date[i].value4;
             that.lineDate_y.value5[i] = Date[i].value5;
           }
+          
+          this.ECZM.bar_djbhd("linechar_y",this.fj,this.lineDate_y);
           this.query_daycompare_y();
         }).catch(error =>{
           this.$message.error('获取数据失败');
@@ -351,7 +366,7 @@ export default {
         .get(
           "compare/compareMonthList?windturbineid=" +
             this.fj +
-            "&date=" +
+            "&recorddate=" +
             this.Date1
         )
         .then((res) => {
@@ -361,30 +376,15 @@ export default {
         });
       this.API
         .get(
-          "compare/fzyMonth?windturbineid=" + this.fj + "&date=" + this.Date1
+          "compare/fzyMonth?windturbineid=" + this.fj + "&recorddate=" + this.Date1
         )
         .then((res) => {
           let that = this;
-          Object.assign(
-            this.$data.leida_list_0,
-            this.$options.data().leida_list_0
-          );
-          Object.assign(
-            this.$data.leida_list_1,
-            this.$options.data().leida_list_1
-          );
-          Object.assign(
-            this.$data.leida_list_2,
-            this.$options.data().leida_list_2
-          );
-          Object.assign(
-            this.$data.leida_list_3,
-            this.$options.data().leida_list_3
-          );
-          Object.assign(
-            this.$data.leida_list_4,
-            this.$options.data().leida_list_4
-          );
+          this.leida_list_0 = [];
+          this.leida_list_1 = [];
+          this.leida_list_2 = [];
+          this.leida_list_3 = [];
+          this.leida_list_4 = [];
 
           if (Object.keys(res.data).length == 2) {
             this.jfpl0 = res.data.jfpl0;
@@ -456,18 +456,28 @@ export default {
           }
           if (this.fj.length == 1) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
+            this.ECZM.clear("fzy2"); 
+            this.ECZM.clear("fzy3"); 
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 2) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
+            this.ECZM.clear("fzy3"); 
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 3) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
             this.ECZM.leida_djbhd("fzy3",this.leida_list_2,this.jfpl2);
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5");
           } else if (this.fj.length == 4) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
             this.ECZM.leida_djbhd("fzy3",this.leida_list_2,this.jfpl2); 
             this.ECZM.leida_djbhd("fzy4",this.leida_list_3,this.jfpl3);
+            this.ECZM.clear("fzy5");
           } else if (this.fj.length == 5) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
@@ -475,8 +485,9 @@ export default {
             this.ECZM.leida_djbhd("fzy4",this.leida_list_3,this.jfpl3); 
             this.ECZM.leida_djbhd("fzy5",this.leida_list_4,this.jfpl4); 
           }
-          this.ECZM.bar_djbhd("linechar_y",this.fj,this.lineDate);
+          this.$store.commit("loadingStore",false);
         }).catch(error =>{
+          this.$store.commit("loadingStore",false);
           this.$message.error('获取数据失败');
         });
     },
@@ -484,15 +495,22 @@ export default {
      * 获取日曲线数据
      */
     query_line() {
+      this.$store.commit("loadingStore",true);
       let that = this;
       this.API
         .get(
           "compare/compareDayChat?windturbineid=" +
             this.fj +
-            "&date=" +
+            "&recorddate=" +
             this.Date1
         )
         .then((res) => {
+          debugger
+          that.lineDate.speed = [];
+          that.lineDate.value1 = [];
+          that.lineDate.value2 = [];
+          that.lineDate.value3 = [];
+          that.lineDate.value4 = [];
           let Date = res.data;
           for (let i = 0; i < Date.length; i++) {
             that.lineDate.speed[i] = Date[i].speed;
@@ -502,50 +520,34 @@ export default {
             that.lineDate.value4[i] = Date[i].value4;
             that.lineDate.value5[i] = Date[i].value5;
           }
+          this.ECZM.bar_djbhd("linechar",this.fj,this.lineDate);
           this.query_daycompare();
-        }).catch(error =>{
-          this.$message.error('获取数据失败');
-        });
+        })
     },
     /**
      * 获取日雷达图数据 表格
      */
     query_daycompare() {
-      Object.assign(this.$data.tableData, this.$options.data().tableData);
+      this.tableData = [];
       this.API
         .get(
           "compare/compareDayList?windturbineid=" +
             this.fj +
-            "&date=" +
+            "&recorddate=" +
             this.Date1
         )
         .then((res) => {
           this.tableData = res.data;
         });
       this.API
-        .get("compare/fzyDay?windturbineid=" + this.fj + "&date=" + this.Date1)
+        .get("compare/fzyDay?windturbineid=" + this.fj + "&recorddate=" + this.Date1)
         .then((res) => {
           let that = this;
-          Object.assign(
-            this.$data.leida_list_0,
-            this.$options.data().leida_list_0
-          );
-          Object.assign(
-            this.$data.leida_list_1,
-            this.$options.data().leida_list_1
-          );
-          Object.assign(
-            this.$data.leida_list_2,
-            this.$options.data().leida_list_2
-          );
-          Object.assign(
-            this.$data.leida_list_3,
-            this.$options.data().leida_list_3
-          );
-          Object.assign(
-            this.$data.leida_list_4,
-            this.$options.data().leida_list_4
-          );
+          this.leida_list_0 = [];
+          this.leida_list_1 = [];
+          this.leida_list_2 = [];
+          this.leida_list_3 = [];
+          this.leida_list_4 = [];
 
           if (Object.keys(res.data).length == 2) {
             this.jfpl0 = res.data.jfpl0;
@@ -616,19 +618,29 @@ export default {
             }
           }
           if (this.fj.length == 1) {
-            this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
+            this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0);
+            this.ECZM.clear("fzy2"); 
+            this.ECZM.clear("fzy3"); 
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 2) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
+            this.ECZM.clear("fzy3"); 
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 3) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
             this.ECZM.leida_djbhd("fzy3",this.leida_list_2,this.jfpl2);
+            this.ECZM.clear("fzy4"); 
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 4) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
             this.ECZM.leida_djbhd("fzy3",this.leida_list_2,this.jfpl2); 
             this.ECZM.leida_djbhd("fzy4",this.leida_list_3,this.jfpl3);
+            this.ECZM.clear("fzy5"); 
           } else if (this.fj.length == 5) {
             this.ECZM.leida_djbhd("fzy1",this.leida_list_0,this.jfpl0); 
             this.ECZM.leida_djbhd("fzy2",this.leida_list_1,this.jfpl1); 
@@ -636,15 +648,15 @@ export default {
             this.ECZM.leida_djbhd("fzy4",this.leida_list_3,this.jfpl3); 
             this.ECZM.leida_djbhd("fzy5",this.leida_list_4,this.jfpl4); 
           }
-        this.ECZM.bar_djbhd("linechar",this.fj,this.lineDate);
+          this.$store.commit("loadingStore",false);
         }).catch(error =>{
+          this.$store.commit("loadingStore",false);
           this.$message.error('获取数据失败');
         });
     },
   },
   mounted() {
-    this.ECZM.bar_djbhd("linechar",this.fj,this.lineDate);
-    this.query();
-    this.query_check();
+    // this.ECZM.bar_djbhd("linechar",this.fj,this.lineDate);
+    
   },
 };

+ 1 - 1
src/assets/js/main.js

@@ -1,4 +1,4 @@
-import menuData from "@jsonData/menu.json"
+import menuData from "@jsonData/menu.json" //动态导入
 import menuZj from "@components/common/menu"
 export default {
   data() {

+ 16 - 10
src/assets/js/singlePerformanceAnalysis/powerChart.js

@@ -42,10 +42,9 @@ export default {
     query_wpid() {
       let that = this;
       let newData = new Date();
-      this.year = newData.getFullYear() + '';
-      let month = newData.getMonth() +'';
-      if(this.month==0){that.month=12;that.year=that.year-1};
-      if (month < 10) { that.month = '0' + month };
+      this.year = newData.getFullYear()+'';
+      this.month = newData.getMonth()-1+''; 
+      if(this.month==0){that.month=11;that.year=that.year-1}else if(this.month==1){that.month=12;that.year=that.year-1};
       this.API.get("powercompare/windfarmAjax?").then((res) => {
         this.wpIdslist = res.data;
         this.query_xml();
@@ -81,6 +80,7 @@ export default {
      * 查数据
      */
     query_scatter_1() {
+      this.$store.commit("loadingStore",true);
       let that = this;
       Object.assign(this.$data.scatter_1, this.$options.data().scatter_1);
       var digital = new URLSearchParams();
@@ -89,14 +89,17 @@ export default {
       digital.append("pjId", "");
       digital.append("year", this.year);
       digital.append("month", this.month);
-      this.API.postL("/scatter/scatterAjax", digital).then((res) => {
-        this.scatter_1 = res.data.data;
+      this.API.post_L("/scatter/scatterAjax", digital).then((res) => {
+        debugger
+        this.scatter_1 = res.data;
+        this.$store.commit("loadingStore",false);
         this.loading1 = false;
         this.ECZM.sdt("scatter_diagram_1",this.scatter_1);
 
       });
     },
     query_scatter_2() {
+      this.$store.commit("loadingStore",true);
       let that = this;
       Object.assign(this.$data.scatter_2, this.$options.data().scatter_2);
       var digital = new URLSearchParams();
@@ -105,14 +108,16 @@ export default {
       digital.append("pjId", this.pj);
       digital.append("year", this.year);
       digital.append("month", this.month);
-      this.API.postL("/scatter/scatterAjax", digital).then((res) => {
-        this.scatter_2 = res.data.data;
+      this.API.post_L("/scatter/scatterAjax", digital).then((res) => {
+        this.scatter_2 = res.data;
+        this.$store.commit("loadingStore",false);
         this.loading2 = false;
         this.ECZM.sdt("scatter_diagram_2",this.scatter_2);
 
       });
     },
     query_scatter_3() {
+      this.$store.commit("loadingStore",true);
       Object.assign(this.$data.scatter_3, this.$options.data().scatter_3);
       var digital = new URLSearchParams();
       digital.append("wpId", this.fc);
@@ -120,8 +125,9 @@ export default {
       digital.append("pjId", "");
       digital.append("year", this.year);
       digital.append("month", this.month);
-      this.API.postL("/scatter/scatterAjax", digital).then((res) => {
-        this.scatter_3 = res.data.data;
+      this.API.post_L("/scatter/scatterAjax", digital).then((res) => {
+        this.scatter_3 = res.data;
+        this.$store.commit("loadingStore",false);
         this.loading3 = false;
         this.ECZM.sdt("scatter_diagram_3",this.scatter_3);
       });

+ 5 - 5
src/assets/js/singlePerformanceAnalysis/powerandWindspeedChart.js

@@ -44,8 +44,8 @@ export default {
       let that = this;
       let newData = new Date();
       this.year = newData.getFullYear()+'';
-      this.month = newData.getMonth()+''; 
-      if(this.month==0){that.month=12;that.year=that.year-1};
+      this.month = newData.getMonth()-1+''; 
+      if(this.month==0){that.month=11;that.year=that.year-1}else if(this.month==1){that.month=12;that.year=that.year-1};
       this.API.get("powercompare/windfarmAjax?").then((res) => {
         this.wpIdslist = res.data;
       });
@@ -61,9 +61,9 @@ export default {
       digital.append("wtId", this.fj);
       digital.append("year", this.year);
       digital.append("month", this.month);
-      this.API.postL("/scatter/scatterWtAjax", digital).then((res) => {
-        sdtDate = res.data.data.scatter;
-        lineDate = res.data.data.line;
+      this.API.post_L("/scatter/scatterWtAjax", digital).then((res) => {
+        sdtDate = res.data.scatter;
+        lineDate = res.data.line;
         this.draw_scatter_diagram(sdtDate,lineDate);
         this.loading=false;
       });

+ 5 - 6
src/router/index.js

@@ -47,16 +47,15 @@ const routes = [
     name: 'error404',
     component: error404,
   },
-  { // 健康评价报告 - 临时  /部署单页面
-    path:'/healthAssessmentDetailed2',
-    component: r => require.ensure([], () => r(require('@views/healthManagement/healthAssessmentDetailed')), 'healthManagement')
-  },
+  // { // 健康评价报告 - 临时  /部署单页面
+  //   path:'/healthAssessmentDetailed2',
+  //   component: r => require.ensure([], () => r(require('@views/healthManagement/healthAssessmentDetailed')), 'healthManagement')
+  // },
 ]
 
 const router = new VueRouter({
   mode: 'history',
-  // base: '/report/', / 部署单页面 404 history  带井号解决(去掉history 放web-inf)
-  base: '/',
+  base: '/sis/', // 部署单页面 404 history  带井号解决(去掉history 放web-inf)
   routes
 })
 

+ 13 - 7
src/store/modules/user.js

@@ -3,15 +3,21 @@ const state = {
   token:getToken //设置token为共享状态   初始化vuex的时候 就先从缓存中读取
 }
 const mutations = {
-  setToken(state,token){
-    state.token=token//将数据设置给vuex
-    //同步给缓存
-    setToken(token)
-  },
-  removeToken(state){
+  REMOVE_TOKEN(state){
     state.token = null//将vuex的数据置空
     removeToken()//同步到缓存
-  }
+  },
+  SET_TOKEN: (state, token) => {
+    state.token = token//将数据设置给vuex
+    //同步缓存
+    setToken(token)
+  },
+  SET_INTRODUCTION: (state, introduction) => {
+    state.introduction = introduction
+  },
+  SET_NAME: (state, name) => {
+    state.name = name
+  },
 }
 const actions = {
   async login(context,data){

+ 7 - 3
src/tools/echartsToolzm.js

@@ -586,14 +586,14 @@ export function bar_djbhd(id  , fj , lineDate) {
       type: "line",
       stack: "总量",
       smooth: true,
-      data: lineDate.value3,
+      data: lineDate.value4,
     },
     {
       name: fj[4],
       type: "line",
       stack: "总量",
       smooth: true,
-      data: lineDate.value4,
+      data: lineDate.value5,
     },
   ],
 };
@@ -892,7 +892,10 @@ export function zzt_cdbqd(id  , value , name ) {
     
     myChart.setOption(option, true);
   }
-  
+  export function clear(id) {
+    var myChart = EC.init(document.getElementById(id));
+    myChart.clear();
+    }
 export default {
   getBar_fdd,
   leida_tc,
@@ -904,5 +907,6 @@ export default {
   qt_DJXNFX,
   zzt_cdbqd,
   sdt,
+  clear,
   color,
 }