@cainiaofe/cn-ui-m
Version:
57 lines (56 loc) • 2.48 kB
JavaScript
import * as React from 'react';
import { CnForm, CnPage } from "../../..";
export var 只读 = function () {
return (React.createElement(CnPage, { title: "CnFormArrayCard \u57FA\u7840\u4F7F\u7528" },
React.createElement(CnForm, { formProps: {
readOnly: true,
initialValues: {
array: [
{
startDate: '2022-03-29',
endDate: '2022-03-31',
isOverDay: true,
},
],
},
}, hasFooterSubmit: true, onSubmit: console.log, schema: {
type: 'object',
properties: {
array: {
type: 'array',
'x-component': 'CnFormArrayCard',
'x-component-props': {
autoIncrementTitle: '班组',
additionText: '新增班次',
},
maxItems: 3,
items: {
type: 'object',
properties: {
startDate: {
title: '开始时间',
'x-decorator': 'CnFormItem',
'x-component': 'CnTimePickerPro',
},
endDate: {
title: '结束时间',
'x-decorator': 'CnFormItem',
'x-component': 'CnTimePickerPro',
},
isOverDay: {
title: '是否跨天',
'x-decorator': 'CnFormItem',
'x-component': 'CnRadioGroup',
enum: [
{ label: '是', value: true },
{ label: '否', value: false },
],
},
},
},
},
},
} })));
};
只读.desc = '通过readOnly属性让组件处于只读状态';
export default { title: 'demo/CnFormArrayCard' };