|
@@ -137,11 +137,13 @@ export default {
|
|
this.frameworkForm.productName=this.productsRow.productName
|
|
this.frameworkForm.productName=this.productsRow.productName
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- async getList() {//产品的id
|
|
|
|
|
|
+ async getList(isClick) {//产品的id
|
|
this.queryParams.productId = this.productsRow.id//产品id
|
|
this.queryParams.productId = this.productsRow.id//产品id
|
|
- if (this.queryParams.structureName) {//查询名称
|
|
|
|
- this.queryParams.structureId=0
|
|
|
|
- }
|
|
|
|
|
|
+ if (!isClick) {
|
|
|
|
+ if (this.queryParams.structureName) {//查询名称
|
|
|
|
+ this.queryParams.structureId=0
|
|
|
|
+ }
|
|
|
|
+ }
|
|
await this.$api.queryStructures(this.queryParams).then(res => {
|
|
await this.$api.queryStructures(this.queryParams).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
if (this.queryParams.structureId) {
|
|
if (this.queryParams.structureId) {
|
|
@@ -157,8 +159,9 @@ export default {
|
|
this.queryParams.structureId=0
|
|
this.queryParams.structureId=0
|
|
} else {
|
|
} else {
|
|
let a = JSON.parse(sessionStorage.getItem('parentId'))
|
|
let a = JSON.parse(sessionStorage.getItem('parentId'))
|
|
- if (!a) {
|
|
|
|
|
|
+ if (!a || this.queryParams.structureId == 0) {
|
|
this.$emit('table', res.data)
|
|
this.$emit('table', res.data)
|
|
|
|
+ sessionStorage.removeItem("parentId");
|
|
}
|
|
}
|
|
this.treeData = res.data.children
|
|
this.treeData = res.data.children
|
|
}
|
|
}
|
|
@@ -182,7 +185,7 @@ export default {
|
|
handleNodeClick(data, node, tree) {
|
|
handleNodeClick(data, node, tree) {
|
|
sessionStorage.setItem('parentId',JSON.stringify(data.id))
|
|
sessionStorage.setItem('parentId',JSON.stringify(data.id))
|
|
this.queryParams.structureId = data.id
|
|
this.queryParams.structureId = data.id
|
|
- this.getList()
|
|
|
|
|
|
+ this.getList(true)
|
|
},
|
|
},
|
|
handleNode() {//请求新数据后保持刷新前所点击的节点高亮并展开
|
|
handleNode() {//请求新数据后保持刷新前所点击的节点高亮并展开
|
|
this.expandedKeys = []
|
|
this.expandedKeys = []
|