【优化】优化字典前端语法-小改动

pull/82/head
小诺 2023-01-17 23:46:05 +08:00 committed by 俞宝山
parent 879b3fa74f
commit 99182cd929
2 changed files with 4 additions and 4 deletions

View File

@ -112,14 +112,14 @@
category: 'BIZ' category: 'BIZ'
} }
dictApi.dictTree(param).then((res) => { dictApi.dictTree(param).then((res) => {
if (res !== null) { if (res) {
treeData.value = res treeData.value = res
} }
}) })
} }
// //
const treeSelect = (selectedKeys) => { const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) { if (selectedKeys && selectedKeys.length > 0) {
searchFormState.parentId = selectedKeys.toString() searchFormState.parentId = selectedKeys.toString()
} else { } else {
delete searchFormState.parentId delete searchFormState.parentId

View File

@ -111,14 +111,14 @@
category: 'FRM' category: 'FRM'
} }
dictApi.dictTree(param).then((res) => { dictApi.dictTree(param).then((res) => {
if (res !== null) { if (res) {
treeData.value = res treeData.value = res
} }
}) })
} }
// //
const treeSelect = (selectedKeys) => { const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) { if (selectedKeys && selectedKeys.length > 0) {
searchFormState.parentId = selectedKeys.toString() searchFormState.parentId = selectedKeys.toString()
} else { } else {
delete searchFormState.parentId delete searchFormState.parentId