fix: bug#10824

This commit is contained in:
xieyonghong 2023-03-27 19:18:59 +08:00
parent c366f4a2cc
commit c34647fad5
3 changed files with 30 additions and 28 deletions

View File

@ -192,28 +192,30 @@ const columns = [
hideInTable: true,
search: {
type: 'treeSelect',
options: getTreeData_api({ paging: false }).then((resp: any) => {
const formatValue = (list: any[]) => {
return list.map((item: any) => {
if (item.children) {
item.children = formatValue(item.children);
}
return {
...item,
value: JSON.stringify({
assetType: 'product',
targets: [
{
type: 'org',
id: item.id,
},
],
}),
}
})
}
return formatValue(resp.result)
}),
options: () => new Promise((resolve) => {
getTreeData_api({ paging: false }).then((resp: any) => {
const formatValue = (list: any[]) => {
return list.map((item: any) => {
if (item.children) {
item.children = formatValue(item.children);
}
return {
...item,
value: JSON.stringify({
assetType: 'product',
targets: [
{
type: 'org',
id: item.id,
},
],
}),
}
})
}
resolve(formatValue(resp.result) || [])
})
})
}
}
]

View File

@ -175,14 +175,14 @@ const handOptionByColumn = (option: any) => {
termTypeOptions.value = option.termTypes || []
tabsOptions.value[0].component = option.type
if (option.type === 'boolean') {
valueOptions.value = [
{ name: '是', id: true },
{ name: '否', id: false },
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [
{ label: '是', value: true },
{ label: '否', value: false },
]
} else if(option.type === 'enum') {
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || []
} else{
valueOptions.value = option.options || []
valueOptions.value = (option.options || []).map((item: any) => ({ ...item, label: item.name, value: item.id}))
}
valueColumnOptions.value = treeFilter(cloneDeep(columnOptions.value), option.type, 'type')
} else {

View File

@ -176,14 +176,14 @@ const handOptionByColumn = (option: any) => {
}
if (option.dataType === 'boolean') {
valueOptions.value = [
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [
{ label: '是', value: true },
{ label: '否', value: false },
]
} else if(option.dataType === 'enum') {
valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || []
} else{
valueOptions.value = option.options || []
valueOptions.value = (option.options || []).map((item: any) => ({ ...item, label: item.name, value: item.id}))
}
} else {
termTypeOptions.value = []