From ee184aa104d81bb7fd5a93237f5e4a22f6a4b4f2 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Tue, 4 Nov 2025 16:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86FormItemsRenderer=E4=B8=AD=E7=9A=84ite?= =?UTF-8?q?ms=E7=9A=84id=E5=AD=97=E6=AE=B5=E6=9B=B4=E6=94=B9=E4=B8=BAbianm?= =?UTF-8?q?a=20utils=E4=B8=AD=E5=A4=84=E7=90=86getLabelName=E5=92=8CgetSel?= =?UTF-8?q?ectAppointItemList=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/FormBuilder/FormItemsRenderer.d.ts | 4 ++-- components/FormBuilder/FormItemsRenderer.js | 2 +- utils/index.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/FormBuilder/FormItemsRenderer.d.ts b/components/FormBuilder/FormItemsRenderer.d.ts index 320ad43..86cc32c 100644 --- a/components/FormBuilder/FormItemsRenderer.d.ts +++ b/components/FormBuilder/FormItemsRenderer.d.ts @@ -30,7 +30,7 @@ export type FormItemRenderType */ export interface OptionItem { /** ID字段 */ - id?: any; + bianma?: any; /** 名称字段 */ name?: string; [key: string]: any; @@ -40,7 +40,7 @@ export interface OptionItem { * 字段键配置 */ export interface itemsFieldConfig { - /** 值字段的键名,默认为 'id' */ + /** 值字段的键名,默认为 'bianma' */ valueKey?: string; /** 标签字段的键名,默认为 'name' */ labelKey?: string; diff --git a/components/FormBuilder/FormItemsRenderer.js b/components/FormBuilder/FormItemsRenderer.js index eb5d71d..e0213a2 100644 --- a/components/FormBuilder/FormItemsRenderer.js +++ b/components/FormBuilder/FormItemsRenderer.js @@ -87,7 +87,7 @@ const FormItemsRenderer = ({ // 获取items里的value和label字段key const getItemsFieldKey = (option) => { return { - valueKey: option?.itemsField?.valueKey || "id", + valueKey: option?.itemsField?.valueKey || "bianma", labelKey: option?.itemsField?.labelKey || "name", }; }; diff --git a/utils/index.js b/utils/index.js index 57eb577..08b848c 100644 --- a/utils/index.js +++ b/utils/index.js @@ -273,7 +273,7 @@ export function addingPrefixToFile(list, options = {}) { * 翻译状态 */ export function getLabelName(options) { - const { status, list, idKey = "id", nameKey = "name" } = options; + const { status, list, idKey = "bianma", nameKey = "name" } = options; for (let i = 0; i < list.length; i++) { if (status?.toString() === list[i][idKey]?.toString()) { return list[i][nameKey]; @@ -327,7 +327,7 @@ export function idCardGetDateAndGender(idCard) { * 获取select中指定项组成的数组 */ export function getSelectAppointItemList(options) { - const { list, value, idKey = "id" } = options; + const { list, value, idKey = "bianma" } = options; return list.filter(item => value.includes(item[idKey])); }