This commit is contained in:
sjl
2024-11-14 18:26:34 +08:00
parent 65cb7826d3
commit 87fe66da3e
42 changed files with 188 additions and 204 deletions

View File

@@ -117,17 +117,16 @@ const columns = reactive<ColumnProps<Dict.ResDictPq>[]>([
const codeString = Array.isArray(codes) ? codes.join(',') : codes
const codeArray = codeString.split(',')
if (codeArray.length > 1) {
console.log('多个 code', codeString)
// 查找与每个 code 值匹配的 name然后拼接成逗号分割的字符串
const names = codeArray.map(code => {
const dictItem = dictStore.getDictData('Stat_Method').find(item => item.code === code)
return dictItem ? dictItem.name : '' // 如果找到匹配的项,返回对应的 name
return dictItem ? dictItem.code : '/' // 如果找到匹配的项,返回对应的 code
})
return names.join(', ') // 用逗号连接所有的 name
}
// 查找单个 code 对应的 name
const dictItem = dictStore.getDictData('Stat_Method').find(item => item.code === codeArray[0])
return dictItem ? dictItem.name : '' // 如果找到匹配的项,返回对应的 name
return dictItem ? dictItem.code : '/' // 如果找到匹配的项,返回对应的 code
},
},
{
@@ -145,6 +144,14 @@ const columns = reactive<ColumnProps<Dict.ResDictPq>[]>([
enum: dictStore.getDictData('Data_Day'),
fieldNames: { label: 'name', value: 'code' }
},
{
prop: 'sort',
label: '排序',
width:70,
render: scope => {
return String(scope.row.sort) // 将数字转换为字符串
},
},
{
prop: 'operation',
label: '操作',