zy-react-library 1.0.44 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,7 +30,7 @@ export type FormItemRenderType
|
|
|
30
30
|
*/
|
|
31
31
|
export interface OptionItem {
|
|
32
32
|
/** ID字段 */
|
|
33
|
-
|
|
33
|
+
bianma?: any;
|
|
34
34
|
/** 名称字段 */
|
|
35
35
|
name?: string;
|
|
36
36
|
[key: string]: any;
|
|
@@ -40,7 +40,7 @@ export interface OptionItem {
|
|
|
40
40
|
* 字段键配置
|
|
41
41
|
*/
|
|
42
42
|
export interface itemsFieldConfig {
|
|
43
|
-
/** 值字段的键名,默认为 '
|
|
43
|
+
/** 值字段的键名,默认为 'bianma' */
|
|
44
44
|
valueKey?: string;
|
|
45
45
|
/** 标签字段的键名,默认为 'name' */
|
|
46
46
|
labelKey?: string;
|
|
@@ -87,7 +87,7 @@ const FormItemsRenderer = ({
|
|
|
87
87
|
// 获取items里的value和label字段key
|
|
88
88
|
const getItemsFieldKey = (option) => {
|
|
89
89
|
return {
|
|
90
|
-
valueKey: option?.itemsField?.valueKey || "
|
|
90
|
+
valueKey: option?.itemsField?.valueKey || "bianma",
|
|
91
91
|
labelKey: option?.itemsField?.labelKey || "name",
|
|
92
92
|
};
|
|
93
93
|
};
|
package/package.json
CHANGED
package/utils/index.js
CHANGED
|
@@ -273,7 +273,7 @@ export function addingPrefixToFile(list, options = {}) {
|
|
|
273
273
|
* 翻译状态
|
|
274
274
|
*/
|
|
275
275
|
export function getLabelName(options) {
|
|
276
|
-
const { status, list, idKey = "
|
|
276
|
+
const { status, list, idKey = "bianma", nameKey = "name" } = options;
|
|
277
277
|
for (let i = 0; i < list.length; i++) {
|
|
278
278
|
if (status?.toString() === list[i][idKey]?.toString()) {
|
|
279
279
|
return list[i][nameKey];
|
|
@@ -327,7 +327,7 @@ export function idCardGetDateAndGender(idCard) {
|
|
|
327
327
|
* 获取select中指定项组成的数组
|
|
328
328
|
*/
|
|
329
329
|
export function getSelectAppointItemList(options) {
|
|
330
|
-
const { list, value, idKey = "
|
|
330
|
+
const { list, value, idKey = "bianma" } = options;
|
|
331
331
|
return list.filter(item => value.includes(item[idKey]));
|
|
332
332
|
}
|
|
333
333
|
|