feature:优化数据源字段和数组字段展示

This commit is contained in:
pixelMax(奇淼
2024-05-17 11:26:51 +08:00
parent de54688c56
commit a21d2a591e
5 changed files with 26 additions and 7 deletions
+6
View File
@@ -23,6 +23,12 @@ export const filterDict = (value, options) => {
}
export const filterDataSource = (dataSource, value) => {
if (Array.isArray(value)) {
return value.map(item => {
const rowLabel = dataSource && dataSource.find(i => i.value === item)
return rowLabel?.label
})
}
const rowLabel = dataSource && dataSource.find(item => item.value === value)
return rowLabel?.label
}