@cainiaofe/cn-ui-m
Version:
90 lines (89 loc) • 5.02 kB
JavaScript
import React from 'react';
import { CnCard, CnDemoPage, CnForm } from "../../..";
export var 基本 = function () {
return (React.createElement(CnDemoPage, { title: "\u57FA\u672C" },
React.createElement(CnCard, { title: "\u8868\u5355\u573A\u666F" },
React.createElement(CnForm, { hasFooterSubmit: true, onSubmit: console.log, formProps: {
initialValues: {
readonlyImageList: [
{
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',
},
{
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-5',
size: 8810,
name: 'tps-80-81.doc',
url: 'https://gw.alicdn.com/imgextra/i2/O1CN01AceP7a1nV6LowEOEa_!!6000000005094-2-tps-80-80.png',
},
{
key: 'tps-80-3.png',
size: 8805,
name: 'tps-80-8tps-80-80tps-80-80tps-80-80tps-80-80tps-80-80tps-80-80tps-80-80tps-80-800.png',
url: 'https://gw.alicdn.com/imgextra/i2/O1CN01AceP7a1nV6LowEOEa_!!6000000005094-2-tps-80-80.png',
},
{
key: 'tps-80-4.png',
name: 'tps-80-8tps-80-80tps-80-80tps-80-80tps-80-80tps-80-80tps-80-80tps-80-80tps-80-800.png',
url: 'https://gw.alicdn.com/imgextra/i2/O1CN01AceP7a1nV6LowEOEa_!!6000000005094-2-tps-80-80.png',
},
],
},
}, schema: {
type: 'object',
properties: {
singleImage: {
title: '上传附件(单选)',
'x-component': 'CnOSSUpload',
'x-decorator': 'CnFormItem',
'x-decorator-props': {
title: '上传附件(单选)',
tip: '上传电子发票支持PDF格式的增值税发票和专用发票,根据国家税务总局查验平台提示,当日开具发票最快可于次日查验,若查验失败请于次日查验并报销。',
},
required: true,
'x-component-props': {
limit: 9,
placeholder: '请输入',
requestConfig: {
// 测试接口,业务场景切勿使用,数据随时会被删除
url: 'https://pre-cnui.cainiao-inc.com/api/tars2/file/upload/getUploadFileScrip',
},
},
},
multiImage: {
title: '上传附件(多选)',
'x-component': 'CnOSSUpload',
'x-decorator': 'CnFormItem',
required: true,
'x-component-props': {
limit: 6,
multiple: true,
placeholder: '请输入',
requestConfig: {
// 测试接口,业务场景切勿使用,数据随时会被删除
url: 'https://pre-cnui.cainiao-inc.com/api/tars2/file/upload/getUploadFileScrip',
},
},
},
readonlyImageList: {
title: '上传附件(只读态)',
'x-component': 'CnOSSUpload',
'x-decorator': 'CnFormItem',
readOnly: true,
},
},
} }))));
};
export default { title: 'demo/CnOssUpload' };