管道基础大数据平台系统开发-【前端】-新系統界面
liupengpeng
2023-02-10 7302dadaba783c1346b47b40f533280d6c3e4fa2
页面刷新还在本页面
已修改8个文件
186 ■■■■■ 文件已修改
src/App.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/login.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/navMenu.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/PackageTwo/WareInspection.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Thematic/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/dataController.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/maintenance/mochaitmo.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -18,6 +18,24 @@
  },
  created() {
  },
  mounted () {
    window.addEventListener('beforeunload', e => {
      sessionStorage.setItem('beforeunload', 1);
    });
    // 监听页面刷新
    if (sessionStorage.getItem('beforeunload') == 1) {
      let name = sessionStorage.getItem("routerName");
      if (name) {
        this.$nextTick(function () {
          this.$router.push({ path: name }); //如果sessionStorage存在路由,去缓存的路由
        })
      } else {
        this.$nextTick(function () {
         this.$router.push({ path: '/' });  //不存在存储,去主页
        })
      }
    }
  },
  beforeDestroy() { },
};
</script>
src/components/login.vue
@@ -257,6 +257,7 @@
                  this.$store.commit('getPermsEntity', res.result);
                  if (res.result.length != 0) {
                    sessionStorage.setItem('routerName', '/Synthesis')
                    this.$router.push('/');
                  }
                  this.loading = false
src/components/navMenu.vue
@@ -117,7 +117,32 @@
      listMenu: [],
      showFlag: null,
      language: true,
      nowPage: [
        {
          name: '/Archive',
          index: 3
        },
        {
          name: '/dataApplication',
          index: 3
        },
        {
          name: '/ExportMap',
          index: 3
        },
        {
          name: '/Synthesis',
          index: 3
        },
        {
          name: '/dataController',
          index: 4
        },
        {
          name: '/mochaitmo',
          index: 5
        }
      ]
    };
  },
  created() { },
@@ -187,7 +212,7 @@
          this.showFlag = null;
        }
      }
      sessionStorage.setItem('changeSelectStyle', index)
      this.changeSelectStyle = index;
    },
    closeAllChildren() {
@@ -211,9 +236,11 @@
    },
    setLiClick(res, index) {
      setTimeout(() => {
        // debu
        this.changeliSelect = res.cnName;
        if (res.url.indexOf('http') != -1) {
           this.$store.reporturl = res.url;
            this.$store.reporturl = res.url;
            sessionStorage.setItem('iframehttpurl', this.$store.reporturl)
            this.$router.push('/QualityInspection');
          // if (location.href.indexOf('/WareInspection') == -1) {
          //   this.$store.reporturl = res.url;
@@ -223,6 +250,7 @@
          // }
        } else {
          this.$store.reporturl = null;
          sessionStorage.setItem('iframehttpurl', null)
          this.$router.push(res.url);
          this.$store.commit('currentPerms', res.perms);
        }
@@ -268,7 +296,19 @@
          }
          this.listMenu.push(res[i]);
          this.changeSelectStyle = this.listMenu.length - 1;
          // this.changeSelectStyle = this.listMenu.length - 1;
          // this.changeSelectStyle = 0
          // const nowPage = this.nowPage
          // if (sessionStorage.getItem('routerName')) {
          //   for (let index = 0; index < nowPage.length; index++) {
          //     if (this.$route.path === nowPage[index].name) {
          //       this.$set(this, 'changeSelectStyle', nowPage[index].index)
          //     }
          //   }
          // } else {
          //   this.changeSelectStyle = this.listMenu.length - 1;
          // }
          this.changeSelectStyle = sessionStorage.getItem('changeSelectStyle')
          // var strartMneu = res[i].children[0];
          // this.$store.commit('currentPerms', strartMneu.perms);
          // this.changeliSelect = strartMneu.cnName;
src/router/index.js
@@ -53,7 +53,15 @@
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
  const nowPage = sessionStorage.getItem('routerName')
  const page = {
    path: nowPage
  }
  if (page === location || location === '/') {
    return originalPush.call(this, page).catch((err) => err);
  } else {
    return originalPush.call(this, location).catch((err) => err);
  }
};
// 群组管理
@@ -462,6 +470,7 @@
});
//路由守卫
router.beforeEach((to, from, next) => {
  sessionStorage.setItem('routerName', to.path)
  next();
  if (to.matched.some((auth) => auth.meta.requireAuth)) {
    // 获取token
src/views/PackageTwo/WareInspection.vue
@@ -49,6 +49,8 @@
    
    },
    showChangeIfream(res) {
      // debugger
      console.log(res)
      if (this.$store.state.themeflag == true) {
        if (res.indexOf('theme=white') != -1) {
          res = res.replace('theme=white', 'theme=dark');
@@ -80,15 +82,55 @@
      this.$store.state.reporturl = res;
      this.reportUrl = res;
      this.url = res
      // sessionStorage.setItem('routerName', this.reportUrl)
      console.log("2", this.reportUrl)
    }
    },
    setLiClick(res, index) {
      var timer = setTimeout(function () {
        if (res.indexOf('http') != -1) {
            this.$store.reporturl = res;
            // sessionStorage.setItem('iframehttpurl', this.$store.reporturl)
            this.$router.push('/QualityInspection');
          // if (location.href.indexOf('/WareInspection') == -1) {
          //   this.$store.reporturl = res.url;
          //   this.$router.push('/WareInspection');
          // } else {
          //   this.$bus.$emit('changeNaveUrl', res.url);
          // }
        }
        this.setShowFalseDiv(false)
      }, 100)
      clearTimeout(timer)
    },
    setShowFalseDiv(bolean) {
      var index = this.showFlag;
      if (index != null) {
        let newItem = this.listMenu[index];
        newItem.show = bolean;
        Vue.set(this.listMenu, index, newItem);
      }
    },
  },
  mounted() {
    this.showChangeIfream(this.$store.reporturl)
    // console.log(sessionStorage.getItem('iframehttpurl'))
    // debugger
    if (sessionStorage.getItem('routerName') === '/WareInspection') {
      this.showChangeIfream(sessionStorage.getItem('iframehttpurl'))
      this.setLiClick(sessionStorage.getItem('iframehttpurl'))
    this.$bus.$on('changeNaveUrl', (res) => {
      this.showChangeIfream(res)
    });
      this.$bus.$on('changeNaveUrl', (res) => {
        this.showChangeIfream(res)
      });
    } else {
      this.showChangeIfream(this.$store.reporturl)
      this.$bus.$on('changeNaveUrl', (res) => {
        this.showChangeIfream(res)
      });
    }
  }
}
src/views/Thematic/index.vue
@@ -379,6 +379,7 @@
  methods: {
    setTopReturn() {
      this.$router.push('/Synthesis');
      sessionStorage.setItem('changeSelectStyle', 3)
    },
    changeRightList(res) {
      this.changeSelectli = res.id;
src/views/datamanage/dataController.vue
@@ -160,6 +160,14 @@
          this.menuList = this.treeData(menuList);
          this.setViewController(this.menuList[0]);
          const hanleselectindex = sessionStorage.getItem('hanleselectindex')
          if (hanleselectindex) {
            this.$nextTick(function (){
              this.handleselecttwo(JSON.parse(hanleselectindex).url, JSON.parse(hanleselectindex))
              this.setViewController(JSON.parse(hanleselectindex))
            })
          }
        } else {
          this.$message.error('暂无菜单栏数据');
@@ -198,6 +206,8 @@
    },
    handleselect(index, indexPath, e) {
      const a = JSON.stringify(e.$attrs.perms)
      sessionStorage.setItem('hanleselectindex', a)
      var data = e.$attrs.perms;
      this.$store.state.currentPerms = data.perms;
      var index = data.url;
@@ -210,6 +220,22 @@
      }
      this.setMenuFlag = index;
    },
    handleselecttwo(index, e) {
      const a = JSON.stringify(e)
      sessionStorage.setItem('hanleselectindex', a)
      var data = e;
      this.$store.state.currentPerms = data.perms;
      var index = data.url;
      if (index != null) {
        if (index.indexOf('http') != -1) {
          this.$store.commit('getIframe', data.url);
          index = 'dataIfream';
        }
      }
      this.setMenuFlag = index;
    },
  },
};
</script>
src/views/maintenance/mochaitmo.vue
@@ -203,6 +203,13 @@
          });
          this.menuList = this.treeData(menuList);
          this.getCookies();
          const hanleselectmochaitmo = sessionStorage.getItem('hanleselectmochaitmo')
          if (hanleselectmochaitmo) {
            this.$nextTick(function (){
              this.handleselecttwo(JSON.parse(hanleselectmochaitmo).url, JSON.parse(hanleselectmochaitmo))
              this.setViewController(JSON.parse(hanleselectmochaitmo))
            })
          }
          //
        } else {
          alert('暂无菜单栏数据');
@@ -244,6 +251,10 @@
    handleselect(index, indexPath, e) {
      this.getTimeCookies();
      const a = JSON.stringify(e.$attrs.perms)
      sessionStorage.setItem('hanleselectmochaitmo', a)
      var data = e.$attrs.perms;
      this.$store.state.currentPerms = data.perms;
      var index = data.url;
@@ -256,6 +267,24 @@
      this.setMenuFlag = index;
    },
    handleselecttwo(index, e) {
      this.getTimeCookies();
      const a = JSON.stringify(e)
      sessionStorage.setItem('hanleselectmochaitmo', a)
      var data = e;
      this.$store.state.currentPerms = data.perms;
      var index = data.url;
      if (index != null) {
        if (index.indexOf('http') != -1) {
          this.$store.commit('getIframe', data.url);
          index = 'dataIfream';
        }
      }
      this.setMenuFlag = index;
    },
  },
};
</script>