管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-01-03 1d100868d755062854671a85f677530147ebeaed
src/components/navMenu.vue
@@ -2,13 +2,16 @@
  <div class="topMenu">
    <div class="logo"></div>
    <div class="headerTitle">
      <p class="textp1">管道基础大数据平台</p>
      <p class="textp2">Pipeline basic big data platform</p>
      <!-- <p class="textp1">管道基础大数据平台</p>
      <p class="textp2">Pipeline basic big data platform</p> -->
    </div>
    <div class="rightWrapper">
      <div class="rightMenu">
        <ul class="infinite-list menu_ul">
          <li v-for="(item, index) in listMenu" class="infinite-list-item">
          <li
            v-for="(item, index) in listMenu"
            class="infinite-list-item"
          >
            <div @click="setMenuMove(index, item)">
              <div
                class="menuImage"
@@ -21,7 +24,10 @@
                {{ item.cnName }}
              </div>
            </div>
            <div class="secondMenuDiv" v-show="item.show">
            <div
              class="secondMenuDiv"
              v-show="item.show"
            >
              <div
                v-for="res in item.children"
                @click="setLiClick(res)"
@@ -34,14 +40,20 @@
        </ul>
      </div>
      <div class="rightUser">
        <div @click="logOut" class="topdiv topUser">
        <div
          @click="logOut"
          class="topdiv topUser"
        >
          <div class="userImage user1"></div>
          <div class="userText">
            <span>{{ this.$store.state.uname }}</span>
            <el-link class="elLink">{{ $t('common.logout') }}</el-link>
          </div>
        </div>
        <div @click="switchLang" class="topdiv botLingo">
        <div
          @click="switchLang"
          class="topdiv botLingo"
        >
          <div class="userImage user2"></div>
          <div class="userText">Language</div>
        </div>
@@ -94,33 +106,14 @@
      itemdetail: {},
      formLabelWidth: '70px',
      count: 5,
      changeSelectStyle: 5,
      changeSelectStyle: null,
      changeliSelect: null,
      changeSelectdiv: false,
      listMenu: [
        {
          cnName: '数据质检',
          css: 'm1',
          checkClass: 'm11',
          url: '',
        },
        {
          cnName: '数据交换',
          css: 'm2',
          checkClass: 'm21',
          url: '',
        },
        {
          cnName: '服务管理',
          css: 'm4',
          checkClass: 'm41',
          url: '',
        },
      ],
      listMenu: [],
      showFlag: null,
    };
  },
  created() {},
  created() { },
  mounted() {
    this.getMenuTree();
  },
@@ -151,16 +144,22 @@
      }
    },
    //主题切换
    setThemeColors() {},
    setThemeColors() { },
    closeAllChildren() {
      for (var i in this.listMenu) {
        let newItem = this.listMenu[i];
        newItem.show = false;
        Vue.set(this.listMenu, i, newItem);
      }
    },
    //鼠标移入菜单事件
    setMenuMove(index, item) {
      var that = this;
      this.closeAllChildren();
      if (item.perms != null) {
        this.$router.push(item.url);
        if (this.showFlag != null) {
          this.setShowFalseDiv(false);
          this.changeliSelect = '呵呵';
          this.changeliSelect = '%%';
          this.showFlag = null;
        }
      } else {
@@ -169,7 +168,7 @@
          this.setShowFalseDiv(true);
        } else {
          let newItem = this.listMenu[index];
          newItem.show = !this.listMenu[index].show;
          newItem.show = !newItem.show;
          Vue.set(this.listMenu, index, newItem);
        }
      }
@@ -184,10 +183,20 @@
      Vue.set(this.listMenu, index, newItem);
    },
    setLiClick(res) {
      this.setShowFalseDiv(false);
      this.changeliSelect = res.cnName;
      this.$router.push(res.url);
      this.$store.commit('currentPerms', res.perms);
      if (res.url.indexOf('http') != -1) {
        if (this.$store.reporturl == null) {
          this.$store.reporturl = res.url;
          this.$router.push('/WareInspection');
        } else {
          this.$bus.$emit('changeNaveUrl', res.url);
        }
      } else {
        this.$store.reporturl = null;
        this.$router.push(res.url);
        this.$store.commit('currentPerms', res.perms);
      }
   this.closeAllChildren();
    },
    async getMenuTree() {
      this.getCookies();
@@ -207,6 +216,7 @@
      }
    },
    async setMenuTree(res) {
      for (var i in res) {
        res[i].checkClass = res[i].css + '1';
        res[i].show = false; //控制显隐
@@ -215,8 +225,15 @@
          res[i].children = result.result.filter((value) => {
            return value.pid == res[i].id;
          });
          this.listMenu.push(res[i]);
          this.changeSelectStyle = this.listMenu.length - 1;
          // var strartMneu = res[i].children[0];
          // this.$store.commit('currentPerms', strartMneu.perms);
          // this.changeliSelect = strartMneu.cnName;
          // this.$bus.$emit('currentPerms', strartMneu.perms);
        } else {
          this.listMenu.push(res[i]);
        }
        this.listMenu.push(res[i]);
      }
    },
    treeData(source) {
@@ -306,6 +323,7 @@
    },
  },
  created() {
   this.$store.reporturl=null;
    let str = this.$route.path;
    if (str[0] == '/') {
      this.activeIndex = str.slice(1);
@@ -379,51 +397,51 @@
        height: 70px;
      }
      .m1 {
        background: url('../assets/img/menu/menu11.png') no-repeat;
        background: url("../assets/img/menu/menu11.png") no-repeat;
        background-size: 100% 100%;
      }
      .m2 {
        background: url('../assets/img/menu/menu21.png') no-repeat;
        background: url("../assets/img/menu/menu21.png") no-repeat;
        background-size: 100% 100%;
      }
      .m3 {
        background: url('../assets/img/menu/menu31.png') no-repeat;
        background: url("../assets/img/menu/menu31.png") no-repeat;
        background-size: 100% 100%;
      }
      .m4 {
        background: url('../assets/img/menu/menu41.png') no-repeat;
        background: url("../assets/img/menu/menu41.png") no-repeat;
        background-size: 100% 100%;
      }
      .m5 {
        background: url('../assets/img/menu/menu51.png') no-repeat;
        background: url("../assets/img/menu/menu51.png") no-repeat;
        background-size: 100% 100%;
      }
      .m6 {
        background: url('../assets/img/menu/menu61.png') no-repeat;
        background: url("../assets/img/menu/menu61.png") no-repeat;
        background-size: 100% 100%;
      }
      .m11 {
        background: url('../assets/img/menu/menu12.png') no-repeat;
        background: url("../assets/img/menu/menu12.png") no-repeat;
        background-size: 100% 100%;
      }
      .m21 {
        background: url('../assets/img/menu/menu22.png') no-repeat;
        background: url("../assets/img/menu/menu22.png") no-repeat;
        background-size: 100% 100%;
      }
      .m31 {
        background: url('../assets/img/menu/menu32.png') no-repeat;
        background: url("../assets/img/menu/menu32.png") no-repeat;
        background-size: 100% 100%;
      }
      .m41 {
        background: url('../assets/img/menu/menu42.png') no-repeat;
        background: url("../assets/img/menu/menu42.png") no-repeat;
        background-size: 100% 100%;
      }
      .m51 {
        background: url('../assets/img/menu/menu52.png') no-repeat;
        background: url("../assets/img/menu/menu52.png") no-repeat;
        background-size: 100% 100%;
      }
      .m61 {
        background: url('../assets/img/menu/menu62.png') no-repeat;
        background: url("../assets/img/menu/menu62.png") no-repeat;
        background-size: 100% 100%;
      }
    }
@@ -446,11 +464,11 @@
          margin-right: 10px;
        }
        .user1 {
          background: url('../assets/img/user.png') no-repeat;
          background: url("../assets/img/user.png") no-repeat;
          background-size: 100% 100%;
        }
        .user2 {
          background: url('../assets/img/EN.png') no-repeat;
          background: url("../assets/img/EN.png") no-repeat;
          background-size: 100% 100%;
        }
        .userText {
@@ -488,25 +506,28 @@
    margin-top: 49px;
    margin-left: 120px;
    position: absolute;
    .textp1 {
      font-size: 36px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      color: #ffffff;
      background: linear-gradient(0deg, #79a8ff 0%, #ffffff 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .textp2 {
      font-size: 9px;
      font-family: Microsoft YaHei;
      font-weight: 300;
      color: #ffffff;
      display: flex;
      background: linear-gradient(0deg, #79a8ff 0%, #ffffff 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    width: 323px;
    height: 70px;
    background: url("../assets/img/LOGO.png") no-repeat center;
    // .textp1 {
    //   font-size: 36px;
    //   font-family: Microsoft YaHei;
    //   font-weight: bold;
    //   color: #ffffff;
    //   background: linear-gradient(0deg, #79a8ff 0%, #ffffff 100%);
    //   -webkit-background-clip: text;
    //   -webkit-text-fill-color: transparent;
    // }
    // .textp2 {
    //   font-size: 9px;
    //   font-family: Microsoft YaHei;
    //   font-weight: 300;
    //   color: #ffffff;
    //   display: flex;
    //   background: linear-gradient(0deg, #79a8ff 0%, #ffffff 100%);
    //   -webkit-background-clip: text;
    //   -webkit-text-fill-color: transparent;
    // }
  }
  .elLink {
    margin-left: 5px;