管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-11 d5efa1b1cdbab10b034357ae3e7b65c21754a123
src/views/maintenance/mochaitmo.vue
@@ -41,6 +41,7 @@
        <system-monitoring v-if="setMenuFlag == 'systemMonitoring'"></system-monitoring>
        <parameter-configuration v-if="setMenuFlag == 'parameterConfiguration'"></parameter-configuration>
        <downlog v-if="setMenuFlag == 'downlog'"></downlog>
        <template-manage v-if="setMenuFlag == 'templateManage'"></template-manage>
      </div>
    </div>
@@ -68,8 +69,10 @@
import systemMonitoring from '@/views/maintenance/systemMonitoring.vue'; //系统监控
import parameterConfiguration from '@/views/maintenance/parameterConfiguration.vue'; //系统配置
import downlog from '@/views/maintenance/downlog.vue'; //下载日志
import { selectMenuRecursive, queryMenuTree, getPerms } from '../../api/api';
import templateManage from '@/views/userManage/templateManage.vue'//模板管理
import { selectMenuRecursive, queryMenuTree, getPerms, sign_insertOpLog } from '../../api/api';
import customElMenu from '../../components/customElMenu.vue';
export default {
  components: {
    menuSettings,
@@ -91,7 +94,9 @@
    systemMonitoring,
    parameterConfiguration,
    customElMenu,
    downlog
    downlog,
    templateManage,
  },
  data() {
    return {
@@ -112,6 +117,7 @@
      editUnit: false,
      itemdetail: {},
      formLabelWidth: '70px',
      m1: null,
    };
  },
  created() { },
@@ -175,6 +181,7 @@
        this.$store.state.permsEntity = data.result;
      }
      var store = this.menuList[0];
      this.m1 = store.cnName;
      this.setViewController(store);
    },
    getTimeCookies() {
@@ -203,6 +210,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('暂无菜单栏数据');
@@ -213,14 +227,28 @@
      // this.treeList = this.treeData(data.result);
    },
    async signInsertOpLog(m1, m2) {
      var obj = {
        m1: m1,
        m2: m2,
      }
      const data = await sign_insertOpLog(obj);
    },
    setViewController(res) {
      if (res == null) {
        return;
      }
      if (res.children != null) {
        this.setViewController(res.children[0]);
      } else {
        this.$store.state.currentPerms = res.perms;
        this.signInsertOpLog(this.m1, res.cnName)
        this.setMenuFlag = res.url;
        this.activeIndex = res.url;
      }
@@ -244,6 +272,11 @@
    handleselect(index, indexPath, e) {
      this.getTimeCookies();
      this.signInsertOpLog(this.m1, e.$attrs.perms.cnName)
      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;
@@ -253,6 +286,25 @@
          index = 'dataIfream';
        }
      }
      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;
    },