fix
Showing
2 changed files
with
22 additions
and
2 deletions
| ... | @@ -375,7 +375,7 @@ function confirm () { | ... | @@ -375,7 +375,7 @@ function confirm () { |
| 375 | request(body).then((res:any) => { | 375 | request(body).then((res:any) => { |
| 376 | if (res.code === proxy.$passCode) { | 376 | if (res.code === proxy.$passCode) { |
| 377 | ElMessage.success('操作成功') | 377 | ElMessage.success('操作成功') |
| 378 | emit('success') | 378 | emit('success', props.type === 'add' ? res.data : body.guid) |
| 379 | visible.value = false | 379 | visible.value = false |
| 380 | return | 380 | return |
| 381 | } | 381 | } | ... | ... |
| ... | @@ -32,6 +32,7 @@ const cacheStore = useCatchStore() | ... | @@ -32,6 +32,7 @@ const cacheStore = useCatchStore() |
| 32 | const showFiledsPage = ref(false) | 32 | const showFiledsPage = ref(false) |
| 33 | 33 | ||
| 34 | // 树菜单 | 34 | // 树菜单 |
| 35 | const dictTreeRef = ref() | ||
| 35 | const treeInfo = ref({ | 36 | const treeInfo = ref({ |
| 36 | id: "data-pickup-tree", | 37 | id: "data-pickup-tree", |
| 37 | filter: true, | 38 | filter: true, |
| ... | @@ -106,7 +107,7 @@ function getTree (refresh = false, initLocate = false) { | ... | @@ -106,7 +107,7 @@ function getTree (refresh = false, initLocate = false) { |
| 106 | } | 107 | } |
| 107 | }) | 108 | }) |
| 108 | } | 109 | } |
| 109 | function refreshTree () { | 110 | function refreshTree (treeGuid) { |
| 110 | treeInfo.value.loading = true; | 111 | treeInfo.value.loading = true; |
| 111 | getMetaStandardTree().then((res:any) => { | 112 | getMetaStandardTree().then((res:any) => { |
| 112 | treeInfo.value.loading = false; | 113 | treeInfo.value.loading = false; |
| ... | @@ -117,6 +118,9 @@ function refreshTree () { | ... | @@ -117,6 +118,9 @@ function refreshTree () { |
| 117 | item.level = 1 | 118 | item.level = 1 |
| 118 | }) | 119 | }) |
| 119 | treeInfo.value.data = data | 120 | treeInfo.value.data = data |
| 121 | if (treeGuid) { | ||
| 122 | setTreeCurrentNode(treeGuid) | ||
| 123 | } | ||
| 120 | } | 124 | } |
| 121 | }) | 125 | }) |
| 122 | } | 126 | } |
| ... | @@ -124,6 +128,22 @@ function refreshTreeAndPage () { | ... | @@ -124,6 +128,22 @@ function refreshTreeAndPage () { |
| 124 | refreshTree() | 128 | refreshTree() |
| 125 | getFirstPageData() | 129 | getFirstPageData() |
| 126 | } | 130 | } |
| 131 | function setTreeCurrentNode (treeGuid) { | ||
| 132 | treeInfo.value.currentNodeKey = treeGuid | ||
| 133 | let { data } = treeInfo.value | ||
| 134 | const format = (list) => { | ||
| 135 | list.forEach(item => { | ||
| 136 | if (item.guid === treeGuid) { | ||
| 137 | nodeClick(item) | ||
| 138 | return | ||
| 139 | } | ||
| 140 | if (item.children) { | ||
| 141 | format(item.children) | ||
| 142 | } | ||
| 143 | }) | ||
| 144 | } | ||
| 145 | format(data) | ||
| 146 | } | ||
| 127 | 147 | ||
| 128 | function deleteTreeNode (guid) { | 148 | function deleteTreeNode (guid) { |
| 129 | deleteMetaStandard([guid]).then((res:any) => { | 149 | deleteMetaStandard([guid]).then((res:any) => { | ... | ... |
-
Please register or sign in to post a comment