This commit is contained in:
parent
a601bc1760
commit
05b49cd86a
|
|
@ -400,8 +400,10 @@
|
||||||
name: searchName.value.trim()
|
name: searchName.value.trim()
|
||||||
})
|
})
|
||||||
if (res.code === 0) {
|
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()
|
updateAvailableParentDictionaries()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,11 @@
|
||||||
|
|
||||||
// 获取树形数据
|
// 获取树形数据
|
||||||
const getTreeData = async () => {
|
const getTreeData = async () => {
|
||||||
if (!props.sysDictionaryID) return
|
if (!props.sysDictionaryID) {
|
||||||
|
treeData.value = []
|
||||||
|
displayTreeData.value = []
|
||||||
|
return
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const res = await getDictionaryTreeList({
|
const res = await getDictionaryTreeList({
|
||||||
sysDictionaryID: props.sysDictionaryID
|
sysDictionaryID: props.sysDictionaryID
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue