管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-06 28bd61701bb409257ea0dd3c78f32bd0b45ebbd5
src/views/Synthesis/index.vue
@@ -15,8 +15,15 @@
          <div class="menuImage" :class="item.class"></div>
        </div>
      </div>
      <div class="MenuIcon menu-class" :class="{ lefMenuActive: showMenuFlag == menuItem.id }">
        <div class="menuDiv" :title="menuItem.name" @click="setMenuChange(menuItem)">
      <div
        class="MenuIcon menu-class"
        :class="{ lefMenuActive: showMenuFlag == menuItem.id }"
      >
        <div
          class="menuDiv"
          :title="menuItem.name"
          @click="setMenuChange(menuItem)"
        >
          <div class="menuImage" :class="menuItem.class"></div>
        </div>
      </div>
@@ -38,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,
@@ -123,36 +130,40 @@
        class: "menu_img1",
        show: true,
      },
    };
    }
  },
  watch: {},
  methods: {
    //左侧菜单滑动显隐
    setMenuChange(res) {
      if (res.id == this.showMenuFlag){
        return;
      if (res.id == this.showMenuFlag) {
        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
        }
      }
    },
@@ -162,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>
@@ -266,12 +277,12 @@
          center;
      }
      .menu_img4 {
        background: url("../../assets/img/synthesis/图层 8 拷贝 2.png")
          no-repeat center;
        background: url("../../assets/img/synthesis/图层 3.png") no-repeat
          center;
      }
      .menu_img5 {
        background: url("../../assets/img/synthesis/矢量智能对象 拷贝 3.png")
          no-repeat center;
        background: url("../../assets/img/synthesis/图层 4.png") no-repeat
          center;
      }
      .menu_img6 {
        background: url("../../assets/img/synthesis/图层 9 拷贝 4.png")
@@ -313,13 +324,14 @@
    .left_main {
      margin: 0;
      //width: 255px;
      width: 130px;
      padding-bottom: 10px;
      height: calc(100% - 10px);
      width: 140px;
      // padding-bottom: 10px;
      height: 100%;
      overflow-y: auto;
      //height: auto;
      transition: width 1s;
      background: #F4F8FF;
      // background: #f4f8ff;
    }
    .right_main {
@@ -369,7 +381,7 @@
    }
  }
  .menu-class{
  .menu-class {
    position: absolute;
    bottom: 10px;
    left: 0;