Merge branch 'master-dev' into feature-Beta-dev-renpy
This commit is contained in:
		
						commit
						3b8c23bc96
					
				| 
						 | 
				
			
			@ -28,9 +28,9 @@
 | 
			
		|||
      </a-layout-sider>
 | 
			
		||||
      <a-layout style="background-color: aliceblue">
 | 
			
		||||
        <keep-alive>
 | 
			
		||||
          <router-view v-if="keepAlive" />
 | 
			
		||||
          <router-view />
 | 
			
		||||
        </keep-alive>
 | 
			
		||||
        <router-view v-if="!keepAlive" />
 | 
			
		||||
        <!-- <router-view v-if="!keepAlive" /> -->
 | 
			
		||||
      </a-layout>
 | 
			
		||||
    </a-layout>
 | 
			
		||||
  </a-card>
 | 
			
		||||
| 
						 | 
				
			
			@ -72,11 +72,11 @@ const SubMenu = {
 | 
			
		|||
export default {
 | 
			
		||||
  name: 'menuTree',
 | 
			
		||||
  components: { 'sub-menu': SubMenu },
 | 
			
		||||
  computed: {
 | 
			
		||||
    keepAlive() {
 | 
			
		||||
      return this.$route.meta.keepAlive
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  // computed: {
 | 
			
		||||
  //   keepAlive() {
 | 
			
		||||
  //     return this.$route.meta.keepAlive
 | 
			
		||||
  //   },
 | 
			
		||||
  // },
 | 
			
		||||
  data() {
 | 
			
		||||
    const collapsed = false
 | 
			
		||||
    return {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1592,4 +1592,12 @@ export default {
 | 
			
		|||
  width: 100%;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
/deep/.ant-spin-nested-loading {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
}
 | 
			
		||||
/deep/.ant-spin-container {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  height: 100%;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <a-card :bordered="false" style="height: 100%;">
 | 
			
		||||
  <a-card :bordered="false" style="height: 100%">
 | 
			
		||||
    <a-layout id="components-layout-demo-custom-trigger" style="height: 100%">
 | 
			
		||||
      <a-layout-sider theme="light" v-model="collapsed" :trigger="null" collapsible width="350px">
 | 
			
		||||
        <div style="height:100%">
 | 
			
		||||
        <div style="height: 100%">
 | 
			
		||||
          <!-- :defaultSelectedKeys="defaultSelectedKeys" -->
 | 
			
		||||
          <!-- :defaultOpenKeys="defaultOpenKeys" -->
 | 
			
		||||
          <a-menu
 | 
			
		||||
| 
						 | 
				
			
			@ -30,9 +30,9 @@
 | 
			
		|||
      </a-layout-sider>
 | 
			
		||||
      <a-layout style="background-color: aliceblue">
 | 
			
		||||
        <keep-alive>
 | 
			
		||||
          <router-view v-if="keepAlive" />
 | 
			
		||||
          <router-view />
 | 
			
		||||
        </keep-alive>
 | 
			
		||||
        <router-view v-if="!keepAlive" />
 | 
			
		||||
        <!-- <router-view v-if="!keepAlive" /> -->
 | 
			
		||||
      </a-layout>
 | 
			
		||||
    </a-layout>
 | 
			
		||||
  </a-card>
 | 
			
		||||
| 
						 | 
				
			
			@ -74,11 +74,11 @@ const SubMenu = {
 | 
			
		|||
export default {
 | 
			
		||||
  name: 'menuTree',
 | 
			
		||||
  components: { 'sub-menu': SubMenu },
 | 
			
		||||
  computed: {
 | 
			
		||||
    keepAlive() {
 | 
			
		||||
      return this.$route.meta.keepAlive
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  // computed: {
 | 
			
		||||
  //   keepAlive() {
 | 
			
		||||
  //     return this.$route.meta.keepAlive
 | 
			
		||||
  //   },
 | 
			
		||||
  // },
 | 
			
		||||
  data() {
 | 
			
		||||
    const collapsed = false
 | 
			
		||||
    return {
 | 
			
		||||
| 
						 | 
				
			
			@ -104,30 +104,29 @@ export default {
 | 
			
		|||
        this.menus = f.children
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    console.log("路由信息",this.menus);
 | 
			
		||||
    // this.initDefaultKeys(this.menus[0])
 | 
			
		||||
    // 将从缓存中取出openKeys
 | 
			
		||||
    const openKeys = window.sessionStorage.getItem('openKeys')
 | 
			
		||||
    const selectedKeys = window.sessionStorage.getItem('currMenu_web')
 | 
			
		||||
    if (selectedKeys) {
 | 
			
		||||
      this.currSlecteKey=[]
 | 
			
		||||
      this.currSlecteKey = []
 | 
			
		||||
      // this.defaultSelectedKeys.push(selectedKeys)
 | 
			
		||||
      this.currSlecteKey.push(selectedKeys)
 | 
			
		||||
    } else {
 | 
			
		||||
      this.currSlecteKey=[]
 | 
			
		||||
      this.currSlecteKey = []
 | 
			
		||||
      this.initDefaultKeys(this.menus[0])
 | 
			
		||||
      this.menus.forEach(item => {
 | 
			
		||||
       if (item.name!=="istatistics-data") {
 | 
			
		||||
         // this.defaultOpenKeys.push(item.path)
 | 
			
		||||
         this.openKeys.push(item.path)
 | 
			
		||||
       }
 | 
			
		||||
      this.menus.forEach((item) => {
 | 
			
		||||
        if (item.name !== 'istatistics-data') {
 | 
			
		||||
          // this.defaultOpenKeys.push(item.path)
 | 
			
		||||
          this.openKeys.push(item.path)
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      window.sessionStorage.setItem('openKeys', JSON.stringify(this.openKeys))
 | 
			
		||||
    }
 | 
			
		||||
    // if (openKeys) {
 | 
			
		||||
    //   // 存在即赋值
 | 
			
		||||
    //   this.defaultOpenKeys = JSON.parse(openKeys)
 | 
			
		||||
    // } 
 | 
			
		||||
    // }
 | 
			
		||||
    if (openKeys) {
 | 
			
		||||
      // 存在即赋值
 | 
			
		||||
      this.openKeys = JSON.parse(openKeys)
 | 
			
		||||
| 
						 | 
				
			
			@ -151,25 +150,25 @@ export default {
 | 
			
		|||
      // this.defaultOpenKeys.push(data.path)
 | 
			
		||||
      this.openKeys.push(data.path)
 | 
			
		||||
      // if (data.children) {
 | 
			
		||||
        if (data.name!=="istatistics-StateOfHealth-alerts") {
 | 
			
		||||
          data.children.some((f) => {
 | 
			
		||||
            if (f.name!=="istatistics-met") {
 | 
			
		||||
              if (f.children) {
 | 
			
		||||
                // 第一个节点展开
 | 
			
		||||
                // this.defaultOpenKeys.push(f.path)
 | 
			
		||||
                this.openKeys.push(f.path)
 | 
			
		||||
                this.initDefaultKeys(f.children[0])
 | 
			
		||||
              } else {
 | 
			
		||||
                // 选中
 | 
			
		||||
                // this.defaultSelectedKeys.push(f.path)
 | 
			
		||||
                this.currSlecteKey.push(f.path)
 | 
			
		||||
                return true
 | 
			
		||||
              }
 | 
			
		||||
      if (data.name !== 'istatistics-StateOfHealth-alerts') {
 | 
			
		||||
        data.children.some((f) => {
 | 
			
		||||
          if (f.name !== 'istatistics-met') {
 | 
			
		||||
            if (f.children) {
 | 
			
		||||
              // 第一个节点展开
 | 
			
		||||
              // this.defaultOpenKeys.push(f.path)
 | 
			
		||||
              this.openKeys.push(f.path)
 | 
			
		||||
              this.initDefaultKeys(f.children[0])
 | 
			
		||||
            } else {
 | 
			
		||||
              // 选中
 | 
			
		||||
              // this.defaultSelectedKeys.push(f.path)
 | 
			
		||||
              this.currSlecteKey.push(f.path)
 | 
			
		||||
              return true
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
      // } else {
 | 
			
		||||
        // this.defaultOpenKeys.push(data.path)
 | 
			
		||||
      // this.defaultOpenKeys.push(data.path)
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
    onOpenChange(openKeys) {
 | 
			
		||||
| 
						 | 
				
			
			@ -193,7 +192,7 @@ export default {
 | 
			
		|||
    background: none;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
::v-deep .ant-card-body{
 | 
			
		||||
::v-deep .ant-card-body {
 | 
			
		||||
  height: 100%;
 | 
			
		||||
}
 | 
			
		||||
.ant-menu {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user