@cainiaofe/cn-ui-m
Version:
93 lines (92 loc) • 4.32 kB
JavaScript
import * as React from 'react';
import { CnPage, CnForm, CnCard } from "../../..";
export var 基本 = function () {
var list = [
{
key: 'tps-80-5',
size: 8810,
name: 'tps-80-81.doc',
url: 'https://img.alicdn.com/imgextra/i2/O1CN01T8l1yV1W58W7ulDjD_!!6000000002736-2-tps-952-480.png',
},
{
key: 'tps-80-2',
size: 8810,
name: 'tps-80-81.xml',
url: 'https://gw.alicdn.com/imgextra/i2/O1CN01AceP7a1nV6LowEOEa_!!6000000005094-2-tps-80-80.png',
},
{
key: 'tps-80-0.png',
name: 'tps-80-81.png',
url: 'https://gw.alicdn.com/imgextra/i2/O1CN01AceP7a1nV6LowEOEa_!!6000000005094-2-tps-80-80.png',
},
{
key: '80-2',
name: '体检.pdf',
url: 'https://gw.alicdn.com/imgextra/i2/O1CN01AceP7a1nV6LowEOEa_!!6000000005094-2-tps-80-80.png',
},
];
return (React.createElement(CnPage, null,
React.createElement(CnCard, { title: "\u8868\u5355\u573A\u666F" },
React.createElement(CnForm, { hasFooterSubmit: true, onSubmit: console.log, formProps: {
initialValues: {
readonlyFileList: list,
readonlyFileList4: list,
},
}, schema: {
type: 'object',
properties: {
singleImage: {
title: '上传图片(单图)',
'x-component': 'CnOSSImageUpload',
'x-decorator': 'CnFormItem',
required: true,
'x-component-props': {
mode: 'single',
limit: 1,
requestConfig: {
// 测试接口,业务场景切勿使用,数据随时会被删除
url: 'https://pre-cnui.cainiao-inc.com/api/tars2/file/upload/getUploadFileScrip',
},
},
},
singleSelect: {
title: '上传图片(单选)',
'x-component': 'CnOSSImageUpload',
'x-decorator': 'CnFormItem',
required: true,
'x-component-props': {
requestConfig: {
// 测试接口,业务场景切勿使用,数据随时会被删除
url: 'https://pre-cnui.cainiao-inc.com/api/tars2/file/upload/getUploadFileScrip',
},
},
},
multiSelect: {
title: '上传图片(多选)',
'x-component': 'CnOSSImageUpload',
'x-decorator': 'CnFormItem',
required: true,
'x-component-props': {
multiple: true,
requestConfig: {
// 测试接口,业务场景切勿使用,数据随时会被删除
url: 'https://pre-cnui.cainiao-inc.com/api/tars2/file/upload/getUploadFileScrip',
},
},
},
disableFileList: {
title: '上传图片(禁用)',
'x-component': 'CnOSSImageUpload',
'x-decorator': 'CnFormItem',
'x-disabled': true,
},
readonlyFileList: {
title: '上传图片(只读)',
'x-component': 'CnOSSImageUpload',
'x-decorator': 'CnFormItem',
readOnly: true,
},
},
} }))));
};
export default { title: 'demo/CnOssImageUpload' };