管道基础大数据平台系统开发-【前端】-新系統界面
lixuliang
2023-02-23 22bf1a64cacaf7052987d6df203b1c9d4082fbb5
src/components/navMenu.vue
@@ -76,7 +76,7 @@
</template>
<script>
import { logout, selectMenuRecursive } from '@/api/api';
import { logout, selectMenuRecursive, sign_insertOpLog } from '@/api/api';
import { removeToken, getToken } from '@/utils/auth';
import customElMenu from '../components/customElMenu.vue';
import { queryMenuTree, getPerms } from '../api/api';
@@ -150,6 +150,10 @@
    this.$store.state.themeflag = false;
    $("#app").removeClass("Black_theme");
    this.getMenuTree();
    if (sessionStorage.getItem('changeliSelect')) {
      this.$set(this, 'changeliSelect', sessionStorage.getItem('changeliSelect'))
      // this.changeliSelect = sessionStorage.getItem('changeliSelect')
    }
  },
  computed: {},
  methods: {
@@ -183,6 +187,9 @@
      this.$router.push('/');
    },
    getTimeCookies() {
      if(!localStorage.getItem('LFToken')){
        return false
      }
      var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time);
      var time2 = new Date();
      if (time2 > time1) {
@@ -191,18 +198,27 @@
        return true;
      }
    },
    //主题切换
 //主题切换
    setThemeColors() { },
    async signInsertOpLog(m1, m2) {
      var obj = {
        m1: m1,
        m2: m2,
      }
      const data = await sign_insertOpLog(obj);
    },
    //鼠标移入菜单事件
    setMenuMove(index, item) {
      if (item.perms != null) {
        this.$router.push(item.url);
        if (this.showFlag != null) {
          this.changeliSelect = '%%';
          this.showFlag = null;
        }
          if (item.url == "Thematic") {
          this.signInsertOpLog("综合展示", item.cnName)
        }
      } else {
        if (this.showFlag != index) {
@@ -211,6 +227,11 @@
        } else {
          this.showFlag = null;
        }
      }
      //
      if (index === 4 || index === 5 || index === 6) {
        sessionStorage.removeItem('changeliSelect')
        this.$set(this, 'changeliSelect', null)
      }
      sessionStorage.setItem('changeSelectStyle', index)
      this.changeSelectStyle = index;
@@ -235,9 +256,11 @@
      }
    },
    setLiClick(res, index) {
        this.signInsertOpLog(this.listMenu[index].cnName, res.cnName)
      setTimeout(() => {
        // debu
        this.changeliSelect = res.cnName;
        sessionStorage.setItem('changeliSelect', res.cnName)
        if (res.url.indexOf('http') != -1) {
            this.$store.reporturl = res.url;
            sessionStorage.setItem('iframehttpurl', this.$store.reporturl)
@@ -251,6 +274,7 @@
        } else {
          this.$store.reporturl = null;
          sessionStorage.setItem('iframehttpurl', null)
          // sessionStorage.setItem('changeliSelect', null)
          this.$router.push(res.url);
          this.$store.commit('currentPerms', res.perms);
        }
@@ -291,9 +315,11 @@
          if (result.code == 200) {
            res[i].children = result.result.filter((value) => {
              return value.isShow == 1;
            })
            .filter((value) => {
              return value.pid == res[i].id;
            });
          }
          this.listMenu.push(res[i]);
          // this.changeSelectStyle = this.listMenu.length - 1;