管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-02-28 d805339695bf1d25a333977445e1821508654d13
src/views/Synthesis/index.vue
@@ -11,15 +11,8 @@
        class="MenuIcon"
        :class="{ lefMenuActive: showMenuFlag == item.id }"
      >
        <div
          class="menuDiv"
          :title="item.name"
          @click="setMenuChange(item)"
        >
          <div
            class="menuImage"
            :class="item.class"
          ></div>
        <div class="menuDiv" :title="item.name" @click="setMenuChange(item)">
          <div class="menuImage" :class="item.class"></div>
        </div>
      </div>
      <div
@@ -31,18 +24,12 @@
          :title="menuItem.name"
          @click="setMenuChange(menuItem)"
        >
          <div
            class="menuImage"
            :class="menuItem.class"
          ></div>
          <div class="menuImage" :class="menuItem.class"></div>
        </div>
      </div>
    </div>
    <div class="rightContent">
      <div
        class="left_main"
        :class="{ left_main_show: !openStatus }"
      >
      <div class="left_main" :class="{ left_main_show: !openStatus }">
        <div class="right_Map">
          <left-menu></left-menu>
        </div>
@@ -58,10 +45,10 @@
</template>
<script>
import { getPerms } from "../../api/api";
import mapdiv from "../../components/MapDiv.vue";
import leftMenu from "./LeftMenu.vue";
import maplayer from "../Tools/maplayer.vue";
import { getPerms } from "../../api/api"
import mapdiv from "../../components/MapDiv.vue"
import leftMenu from "./LeftMenu.vue"
import maplayer from "../Tools/maplayer.vue"
export default {
  components: {
    mapdiv,
@@ -143,7 +130,7 @@
        class: "menu_img1",
        show: true,
      },
    };
    }
  },
  watch: {},
@@ -151,28 +138,32 @@
    //左侧菜单滑动显隐
    setMenuChange(res) {
      if (res.id == this.showMenuFlag) {
        return;
        return
      }
      //清除查询弹窗
      this.$store.state.mapMenuBoolean = false;
      this.$store.state.mapMenuBoxFlag = "";
      this.$store.state.mapMenuBoolean = false
      this.$store.state.mapMenuBoxFlag = ""
      //清除分析模块的全局变量
      ClearAlayse();
      ClearAlayse()
      switch (res.id) {
        case 1:
          if (this.showMenuFlag == null) return;
          this.openStatus = !this.openStatus;
          break;
          if (this.showMenuFlag == null) return
          this.openStatus = !this.openStatus
          // 点击左侧菜单是调整
          setTimeout(() => {
            window.map.updateSize()
          }, 1000)
          break
        case 10:
          if (this.showMenuFlag == null) {
            this.openStatus = false;
            this.openStatus = false
          }
          this.$bus.$emit("setChangeTwoMenu", res.id - 2);
          break;
          this.$bus.$emit("setChangeTwoMenu", res.id - 2)
          break
        default: {
          this.openStatus = true;
          this.$bus.$emit("setChangeTwoMenu", res.id - 2);
          this.showMenuFlag = res.id;
          this.openStatus = true
          this.$bus.$emit("setChangeTwoMenu", res.id - 2)
          this.showMenuFlag = res.id
        }
      }
    },
@@ -182,63 +173,63 @@
        this.$store.state.currentPerms == "" ||
        this.$store.state.currentPerms != "/comprehensive"
      ) {
        this.$store.state.currentPerms = "/comprehensive";
        this.$store.state.currentPerms = "/comprehensive"
      }
      if (this.$store.state.permsEntity.length == 0) {
        const data = await getPerms();
        this.$store.state.permsEntity = data.result;
        const data = await getPerms()
        this.$store.state.permsEntity = data.result
      }
      var val = this.$store.state.currentPerms;
      var permsEntity = this.$store.state.permsEntity;
      var val = this.$store.state.currentPerms
      var permsEntity = this.$store.state.permsEntity
      for (var i = 0; i < permsEntity.length; i++) {
        if (permsEntity[i].perms == val) {
          this.showMenuChange(permsEntity[i], permsEntity);
          this.showMenuChange(permsEntity[i], permsEntity)
        }
      }
      for (var i in this.menuOption) {
        if (this.menuOption[i].show != false) {
          this.showMenuList.push(this.menuOption[i]);
          this.showMenuList.push(this.menuOption[i])
        }
      }
      //初始化二级菜单
      if (this.showMenuList.length > 1) {
        var index = this.showMenuList[1].id;
        this.$bus.$emit("setChangeTwoMenu", index - 2);
        var index = this.showMenuList[1].id
        this.$bus.$emit("setChangeTwoMenu", index - 2)
      }
    },
    showMenuChange(res, result) {
      var permsId = res.id;
      this.$store.state.syntiesis.menu = res.id;
      var permsId = res.id
      this.$store.state.syntiesis.menu = res.id
      for (var i = 0; i < result.length; i++) {
        if (result[i].pid == permsId) {
          this.showMenuStatus(result[i]);
          this.showMenuStatus(result[i])
        }
      }
    },
    showMenuStatus(res) {
      var std = [];
      std.push(this.menuOption[0]);
      var std = []
      std.push(this.menuOption[0])
      for (var i = 1; i < this.menuOption.length; i++) {
        if (this.menuOption[i].name == res.cnName) {
          this.menuOption[i].show = true;
          this.menuOption[i].show = true
        }
      }
    },
  },
  mounted() {
    // this.$bus.$emit('showLeftMenu', true);
    window.sgworld.navControl("nav", true);
    this.$store.state.mapMenuBoolean = false;
    this.$store.state.mapMenuBoxFlag = null;
    this.$store.state.mapPopBoolean = false;
    this.$store.state.mapPopBoxFlag = null;
    window.sgworld.navControl("nav", true)
    this.$store.state.mapMenuBoolean = false
    this.$store.state.mapMenuBoxFlag = null
    this.$store.state.mapPopBoolean = false
    this.$store.state.mapPopBoxFlag = null
  },
  //初始化菜单授权
  created() {
    this.getPermsMenu();
    this.getPermsMenu()
  },
};
}
</script>
<style lang="less" scoped>