Merge branch 'feature-particulate-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
dc4780ea73
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="search-form">
|
<div class="search-form">
|
||||||
<a-form-model ref="form" :colon="false" :model="formModel" v-bind="$attrs" @keyup.enter.native="onSearch">
|
<a-form-model ref="form" :colon="false" :model="formModel" v-bind="$attrs">
|
||||||
<a-row v-if="type == 'single-line'" :gutter="20" style="margin-right: 0 !important;">
|
<a-row v-if="type == 'single-line'" :gutter="20" style="margin-right: 0 !important;">
|
||||||
<a-col
|
<a-col
|
||||||
class="search-form-item"
|
class="search-form-item"
|
||||||
|
|
|
@ -3,10 +3,12 @@
|
||||||
<a-layout id="components-layout-demo-custom-trigger" 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">
|
<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
|
<a-menu
|
||||||
id="dddddd"
|
id="dddddd"
|
||||||
:defaultSelectedKeys="defaultSelectedKeys"
|
:openKeys="openKeys"
|
||||||
:defaultOpenKeys="defaultOpenKeys"
|
v-model="currSlecteKey"
|
||||||
mode="inline"
|
mode="inline"
|
||||||
:inline-collapsed="collapsed"
|
:inline-collapsed="collapsed"
|
||||||
@openChange="onOpenChange"
|
@openChange="onOpenChange"
|
||||||
|
@ -90,6 +92,7 @@ export default {
|
||||||
openKeys: [],
|
openKeys: [],
|
||||||
// 选中的子菜单项
|
// 选中的子菜单项
|
||||||
defaultSelectedKeys: [],
|
defaultSelectedKeys: [],
|
||||||
|
currSlecteKey: [],
|
||||||
defaultOpenKeys: [],
|
defaultOpenKeys: [],
|
||||||
rootSubmenuKeys: ['/istatistics/imsData', '/istatistics'],
|
rootSubmenuKeys: ['/istatistics/imsData', '/istatistics'],
|
||||||
}
|
}
|
||||||
|
@ -104,32 +107,38 @@ export default {
|
||||||
console.log("路由信息",this.menus);
|
console.log("路由信息",this.menus);
|
||||||
// this.initDefaultKeys(this.menus[0])
|
// this.initDefaultKeys(this.menus[0])
|
||||||
// 将从缓存中取出openKeys
|
// 将从缓存中取出openKeys
|
||||||
// const openKeys = window.sessionStorage.getItem('openKeys')
|
const openKeys = window.sessionStorage.getItem('openKeys')
|
||||||
const selectedKeys = window.sessionStorage.getItem('currMenu')
|
const selectedKeys = window.sessionStorage.getItem('currMenu_web')
|
||||||
if (selectedKeys) {
|
if (selectedKeys) {
|
||||||
this.defaultSelectedKeys.push(selectedKeys)
|
this.currSlecteKey=[]
|
||||||
|
// this.defaultSelectedKeys.push(selectedKeys)
|
||||||
|
this.currSlecteKey.push(selectedKeys)
|
||||||
} else {
|
} else {
|
||||||
|
this.currSlecteKey=[]
|
||||||
this.initDefaultKeys(this.menus[0])
|
this.initDefaultKeys(this.menus[0])
|
||||||
|
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))
|
||||||
}
|
}
|
||||||
console.log(this.menus);
|
|
||||||
this.menus.forEach(item => {
|
|
||||||
if (item.name!=="istatistics-data") {
|
|
||||||
this.defaultOpenKeys.push(item.path)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// if (openKeys) {
|
// if (openKeys) {
|
||||||
// // 存在即赋值
|
// // 存在即赋值
|
||||||
// this.defaultOpenKeys = JSON.parse(openKeys)
|
// this.defaultOpenKeys = JSON.parse(openKeys)
|
||||||
// }
|
// }
|
||||||
// if (openKeys) {
|
if (openKeys) {
|
||||||
// // 存在即赋值
|
// 存在即赋值
|
||||||
// this.openKeys = JSON.parse(openKeys)
|
this.openKeys = JSON.parse(openKeys)
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 点击菜单,路由跳转,注意的是当点击MenuItem才会触发此函数
|
// 点击菜单,路由跳转,注意的是当点击MenuItem才会触发此函数
|
||||||
menuClick({ item, key, keyPath }) {
|
menuClick({ item, key, keyPath }) {
|
||||||
window.sessionStorage.setItem('currMenu', key)
|
this.currSlecteKey = []
|
||||||
|
this.currSlecteKey.push(key)
|
||||||
|
window.sessionStorage.setItem('currMenu_web', key)
|
||||||
// var parentPath = item._props.parentMenu._props.eventKey;
|
// var parentPath = item._props.parentMenu._props.eventKey;
|
||||||
// var parentTitle = parentPath.substring(parentPath.lastIndexOf("/") + 1, parentPath.length)
|
// var parentTitle = parentPath.substring(parentPath.lastIndexOf("/") + 1, parentPath.length)
|
||||||
// var par = {"type": "q"}
|
// var par = {"type": "q"}
|
||||||
|
@ -139,19 +148,23 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initDefaultKeys(data) {
|
initDefaultKeys(data) {
|
||||||
this.defaultOpenKeys.push(data.path)
|
// this.defaultOpenKeys.push(data.path)
|
||||||
|
this.openKeys.push(data.path)
|
||||||
// if (data.children) {
|
// if (data.children) {
|
||||||
if (data.name!=="istatistics-StateOfHealth-alerts") {
|
if (data.name!=="istatistics-StateOfHealth-alerts") {
|
||||||
|
|
||||||
data.children.some((f) => {
|
data.children.some((f) => {
|
||||||
if (f.children) {
|
if (f.name!=="istatistics-met") {
|
||||||
// 第一个节点展开
|
if (f.children) {
|
||||||
this.defaultOpenKeys.push(f.path)
|
// 第一个节点展开
|
||||||
this.initDefaultKeys(f.children[0])
|
// this.defaultOpenKeys.push(f.path)
|
||||||
} else {
|
this.openKeys.push(f.path)
|
||||||
// 选中
|
this.initDefaultKeys(f.children[0])
|
||||||
this.defaultSelectedKeys.push(f.path)
|
} else {
|
||||||
return true
|
// 选中
|
||||||
|
// this.defaultSelectedKeys.push(f.path)
|
||||||
|
this.currSlecteKey.push(f.path)
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user