完善数据字典
This commit is contained in:
parent
5fe1af6a75
commit
2874160e45
@ -8890,6 +8890,11 @@ export const UpdateDetailInputSchema = {
|
|||||||
order: {
|
order: {
|
||||||
type: 'integer',
|
type: 'integer',
|
||||||
format: 'int32'
|
format: 'int32'
|
||||||
|
},
|
||||||
|
extendedAttribute: {
|
||||||
|
type: 'string',
|
||||||
|
description: '扩展属性',
|
||||||
|
nullable: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|||||||
@ -4574,6 +4574,10 @@ export type UpdateDetailInput = {
|
|||||||
displayText?: (string) | null;
|
displayText?: (string) | null;
|
||||||
description?: (string) | null;
|
description?: (string) | null;
|
||||||
order?: number;
|
order?: number;
|
||||||
|
/**
|
||||||
|
* 扩展属性
|
||||||
|
*/
|
||||||
|
extendedAttribute?: (string) | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdateFeatureDto = {
|
export type UpdateFeatureDto = {
|
||||||
|
|||||||
@ -354,7 +354,7 @@ export const editThingModelFormSchema = computed(() => [
|
|||||||
return items.map((item: any) => ({
|
return items.map((item: any) => ({
|
||||||
...item,
|
...item,
|
||||||
// 使用secondValue的小写版本作为value,保持label为原始value
|
// 使用secondValue的小写版本作为value,保持label为原始value
|
||||||
value: item.secondValue?.toLowerCase() || item.value?.toLowerCase(),
|
value: item.secondValue || item.value?.toLowerCase(),
|
||||||
label: item.value, // 显示文本
|
label: item.value, // 显示文本
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { useVbenModal } from '@vben/common-ui';
|
|||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import {
|
import {
|
||||||
|
getCommonGetSelectList,
|
||||||
postDataDictionaryCreateDetail,
|
postDataDictionaryCreateDetail,
|
||||||
postDataDictionaryUpdateDetail,
|
postDataDictionaryUpdateDetail,
|
||||||
} from '#/api-client/index';
|
} from '#/api-client/index';
|
||||||
@ -69,9 +70,38 @@ const [Form, formApi] = useVbenForm({
|
|||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'ApiSelect',
|
||||||
componentProps: {
|
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',
|
fieldName: 'extendedAttribute',
|
||||||
label: $t('abp.dataDictionary.extendedAttribute'),
|
label: $t('abp.dataDictionary.extendedAttribute'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user