@innoways/utils
Version:
drip-form通用方法
98 lines (96 loc) • 1.91 kB
text/typescript
export const unitedSchema = {
validateTime: 'change',
requiredMode: 'default',
type: 'object',
theme: 'antd',
schema: [
{
type: 'array',
title: 'Array Container',
ui: {
type: 'array',
mode: 'add',
addTitle: 'Add a row of data',
},
minItems: 1,
errMsg: {
minItems: '最小1',
},
items: {
type: 'string',
title: 'Input Box',
minLength: 2,
errMsg: {
minLength: '2',
},
ui: {
type: 'text',
style: {
width: '100%',
},
},
},
fieldKey: 'array_g6NF65',
},
],
}
export const parsedSchema = {
dataSchema: {
validateTime: 'change',
requiredMode: 'default',
type: 'object',
properties: {
array_g6NF65: {
type: 'array',
title: 'Array Container',
minItems: 1,
errorMessage: {
minItems: '最小1',
},
items: {
type: 'string',
title: 'Input Box',
minLength: 2,
errorMessage: {
minLength: '2',
},
},
},
},
},
uiSchema: {
theme: 'antd',
order: ['array_g6NF65'],
properties: {
array_g6NF65: {
type: 'array',
mode: 'add',
addTitle: 'Add a row of data',
order: ['$container'],
properties: {
$container: {
type: 'text',
style: {
width: '100%',
},
},
},
},
},
},
typePath: {
array_g6NF65: {
fatherKey: '',
title: 'Array Container',
type: 'array',
unitedSchemaKey: 'schema.0',
},
'array_g6NF65.$container': {
fatherKey: 'array_g6NF65',
title: 'Input Box',
type: 'string',
unitedSchemaKey: 'schema.0.items',
},
},
customProps: [],
}