管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-18 4c634c5542c4d61f33c98bc4756aca6e195ac6d2
src/store/index.js
@@ -37,9 +37,40 @@
    mapMenuBoxFlag: null,
    mapSpaceQueryLayer: null,
    mapMenuShpFile: null,
    propertiesFlag: null,
    propertiesName: null,
    propertiesInfo: null,
    pickUpPointInfo: null,
    //主题切换
    theme: variables.theme,
    //登录用户名
    uname: null,
    unid: null,
    //项目管理
    projeOl: null,
    download: false,
    showAllLayers: true,
    primitLayer: null,
    loading: false,
    pipelineEntity: [],
    reporturl: null,
    layerMnage: false,
    themeflag: false,
    language: true,
    isNaviget: false,
    treeData: null,
    checkedKeys: [],
    queryInfo: [],
    Map3: [],
    histogramLayer: [],
    attachModel: false,
    attachinfo: null,
    catModel: false,
    catModelInfo: null,
    showPopBoxFlag: false,
    pickoption: null,
    previewLayer: null
  },
  mutations: {
    //获取权限合集
@@ -82,16 +113,16 @@
    },
    /* 打开Loading */
    START_LOADING(state, msg) {
      state.loadingInstance = Loading.service({
        lock: true,
        text: msg ? msg : '加载中...',
        background: 'rgba(0, 0, 0, 0.7)',
      });
      // state.loadingInstance = Loading.service({
      //   lock: true,
      //   text: msg ? msg : '加载中...',
      //   background: 'rgba(0, 0, 0, 0.7)',
      // });
    },
    /* 关闭loading */
    CLOSE_LOADING(state) {
      state.loadingInstance.close();
      // state.loadingInstance.close();
    },
    /* 更新请求线程池 */
    UPDATE_API_COUNT(state, handle) {
@@ -105,10 +136,12 @@
        }
      }
    },
    SET_UNAME(state, name) {
      state.uname = name;
    },
    SET_TOKEN(state, token) {
      state.token = token;
    },
    SET_KEY(state, key) {
      state.key = key;
    },
@@ -130,14 +163,19 @@
        login(data)
          .then((response) => {
            const data = response;
            if (data.code !== 200) {
              return Message({
                message: data.msg,
                type: 'error',
                duration: 5 * 1000,
              });
              resolve(data);
              return
              // return Message({
              //   message: data.msg,
              //   type: 'error',
              //   duration: 5 * 1000,
              // });
            }
            commit('SET_UNAME', data.result.uname);
            commit('SET_TOKEN', data.result.token);
            setToken(data.result.token);
            resolve(data);
          })
@@ -146,6 +184,23 @@
          });
      });
    },
    setCookies(res) {
      var value = localStorage.getItem('LFToken');
      if (value != null) {
        this.rmCookies();
      }
      var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss');
      var token = res.result;
      var LfPrems = {
        token: token,
        time: timeData,
      };
      LfPrems = JSON.stringify(LfPrems);
      localStorage.setItem('LFToken', LfPrems);
    },
    rmCookies() {
      localStorage.removeItem('LFToken');
    },
    getpublickey({ commit, state }, userInfo) {
      return new Promise((resolve, reject) => {
        getPublicKey(userInfo)