3d0fd7fa by fanguang

fix

1 parent 250765dc
......@@ -375,7 +375,7 @@ function confirm () {
request(body).then((res:any) => {
if (res.code === proxy.$passCode) {
ElMessage.success('操作成功')
emit('success')
emit('success', props.type === 'add' ? res.data : body.guid)
visible.value = false
return
}
......
......@@ -32,6 +32,7 @@ const cacheStore = useCatchStore()
const showFiledsPage = ref(false)
// 树菜单
const dictTreeRef = ref()
const treeInfo = ref({
id: "data-pickup-tree",
filter: true,
......@@ -106,7 +107,7 @@ function getTree (refresh = false, initLocate = false) {
}
})
}
function refreshTree () {
function refreshTree (treeGuid) {
treeInfo.value.loading = true;
getMetaStandardTree().then((res:any) => {
treeInfo.value.loading = false;
......@@ -117,6 +118,9 @@ function refreshTree () {
item.level = 1
})
treeInfo.value.data = data
if (treeGuid) {
setTreeCurrentNode(treeGuid)
}
}
})
}
......@@ -124,6 +128,22 @@ function refreshTreeAndPage () {
refreshTree()
getFirstPageData()
}
function setTreeCurrentNode (treeGuid) {
treeInfo.value.currentNodeKey = treeGuid
let { data } = treeInfo.value
const format = (list) => {
list.forEach(item => {
if (item.guid === treeGuid) {
nodeClick(item)
return
}
if (item.children) {
format(item.children)
}
})
}
format(data)
}
function deleteTreeNode (guid) {
deleteMetaStandard([guid]).then((res:any) => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!