在资产编辑和SKU对话框中新增dictType字段支持,确保自定义属性的字典类型信息在请求体中正确传递和保存

This commit is contained in:
WUSIJIAN
2026-01-12 15:59:05 +08:00
parent a06d4955d4
commit 586e0d51dd
2 changed files with 4 additions and 0 deletions

View File

@@ -469,6 +469,7 @@ interface CategoryAttr {
type: string; type: string;
options?: { label: string; value: string }[]; options?: { label: string; value: string }[];
required?: boolean; required?: boolean;
dictType?: string;
} }
interface KeyValuePair { interface KeyValuePair {
@@ -1158,6 +1159,7 @@ const buildRequestBody = async (): Promise<any> => {
name: attr.name, name: attr.name,
type: attr.type, type: attr.type,
value: value, value: value,
...(attr.dictType ? { dictType: attr.dictType } : {}),
}; };
// 只有单选和多选类型才传递 options且只传递选中的值对应的选项 // 只有单选和多选类型才传递 options且只传递选中的值对应的选项

View File

@@ -149,6 +149,7 @@ interface SpecValueItem {
interface AssetSpecAttr { interface AssetSpecAttr {
name: string; name: string;
options?: string[]; options?: string[];
dictType?: string;
} }
const dialogVisible = ref(false); const dialogVisible = ref(false);
@@ -241,6 +242,7 @@ const fetchAssetSpecAttrs = () => {
.map((item: any) => ({ .map((item: any) => ({
name: item.name, name: item.name,
options: item.options?.map((opt: any) => opt.label || opt.value) || [], options: item.options?.map((opt: any) => opt.label || opt.value) || [],
dictType: item.dictType || '',
})); }));
} else { } else {
assetSpecAttrs.value = []; assetSpecAttrs.value = [];