完善数据字典

This commit is contained in:
ChenYi 2025-10-23 14:31:32 +08:00
parent 5fe1af6a75
commit 2874160e45
4 changed files with 50 additions and 11 deletions

View File

@ -8890,6 +8890,11 @@ export const UpdateDetailInputSchema = {
order: {
type: 'integer',
format: 'int32'
},
extendedAttribute: {
type: 'string',
description: '扩展属性',
nullable: true
}
},
additionalProperties: false

View File

@ -4574,6 +4574,10 @@ export type UpdateDetailInput = {
displayText?: (string) | null;
description?: (string) | null;
order?: number;
/**
*
*/
extendedAttribute?: (string) | null;
};
export type UpdateFeatureDto = {

View File

@ -354,7 +354,7 @@ export const editThingModelFormSchema = computed(() => [
return items.map((item: any) => ({
...item,
// 使用secondValue的小写版本作为value保持label为原始value
value: item.secondValue?.toLowerCase() || item.value?.toLowerCase(),
value: item.secondValue || item.value?.toLowerCase(),
label: item.value, // 显示文本
}));
},

View File

@ -5,6 +5,7 @@ import { useVbenModal } from '@vben/common-ui';
import { useVbenForm } from '#/adapter/form';
import {
getCommonGetSelectList,
postDataDictionaryCreateDetail,
postDataDictionaryUpdateDetail,
} from '#/api-client/index';
@ -69,9 +70,38 @@ const [Form, formApi] = useVbenForm({
rules: 'required',
},
{
component: 'Input',
component: 'ApiSelect',
componentProps: {
placeholder: $t('common.pleaseInput'),
api: getCommonGetSelectList,
params: {
query: {
typeName: 'StandardThingModelDataTypeEnum',
},
},
labelField: 'value',
valueField: 'secondValue',
optionsPropName: 'options',
immediate: true,
allowClear: true,
placeholder:
$t('common.pleaseSelect') +
$t('abp.dataDictionary.extendedAttribute'),
afterFetch: (res: any) => {
//
if (Array.isArray(res)) {
return res;
}
// items
if (res && Array.isArray(res.items)) {
return res.items;
}
// data
if (res && Array.isArray(res.data)) {
return res.data;
}
//
return [];
},
},
fieldName: 'extendedAttribute',
label: $t('abp.dataDictionary.extendedAttribute'),