This commit is contained in:
parent
a601bc1760
commit
05b49cd86a
|
|
@ -400,8 +400,10 @@
|
|||
name: searchName.value.trim()
|
||||
})
|
||||
if (res.code === 0) {
|
||||
dictionaryData.value = res.data
|
||||
selectID.value = res.data[0].ID
|
||||
// 搜索无结果时同步清空当前选中项。
|
||||
const dictionaries = Array.isArray(res.data) ? res.data : []
|
||||
dictionaryData.value = dictionaries
|
||||
selectID.value = dictionaries[0]?.ID ?? 0
|
||||
// 更新可选父级字典列表
|
||||
updateAvailableParentDictionaries()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,7 +283,11 @@
|
|||
|
||||
// 获取树形数据
|
||||
const getTreeData = async () => {
|
||||
if (!props.sysDictionaryID) return
|
||||
if (!props.sysDictionaryID) {
|
||||
treeData.value = []
|
||||
displayTreeData.value = []
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await getDictionaryTreeList({
|
||||
sysDictionaryID: props.sysDictionaryID
|
||||
|
|
|
|||
Loading…
Reference in New Issue