feat: 解决没数据报错的问题
This commit is contained in:
@ -15,7 +15,7 @@ export function isLocalDict(dictCode) {
|
|||||||
D_GS_SSYJ: true, // "岗哨系统四色预警"
|
D_GS_SSYJ: true, // "岗哨系统四色预警"
|
||||||
D_BZ_SF: true, // "是否"
|
D_BZ_SF: true, // "是否"
|
||||||
BD_BK_CLYJBQ: true, // "车辆预警标签"
|
BD_BK_CLYJBQ: true, // "车辆预警标签"
|
||||||
D_YJXX_CZCSLX:true, //常控处置措施类型
|
D_YJXX_CZCSLX: true, //常控处置措施类型
|
||||||
}
|
}
|
||||||
return localDicObj[dictCode]
|
return localDicObj[dictCode]
|
||||||
}
|
}
|
||||||
@ -32,12 +32,14 @@ export function getDict(...args) {
|
|||||||
getSysDictByCode({
|
getSysDictByCode({
|
||||||
dictCode: d
|
dictCode: d
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
|
result = result || {}
|
||||||
|
result.itemList = Array.isArray(result.itemList) ? result.itemList : []
|
||||||
result.itemList.forEach(p => {
|
result.itemList.forEach(p => {
|
||||||
p.label = p.zdmc
|
p.label = p.zdmc
|
||||||
p.value = p.dm
|
p.value = p.dm
|
||||||
p.id = p.dm
|
p.id = p.dm
|
||||||
p.elTagType = p.dictType
|
p.elTagType = p.dictType
|
||||||
if (p.itemList && p.itemList.length > 0) {
|
if (p?.itemList && p.itemList?.length > 0) {
|
||||||
getChildren(p)
|
getChildren(p)
|
||||||
}
|
}
|
||||||
p.children = p.itemList
|
p.children = p.itemList
|
||||||
|
|||||||
Reference in New Issue
Block a user