将FormItemsRenderer中的items的id字段更改为bianma
utils中处理getLabelName和getSelectAppointItemList同步修改master
parent
41a306b53c
commit
ee184aa104
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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]));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue