import { IDataListConfigType, INumberConfigType, IRadioConfigType, ISwitchConfigType, TDataListDefaultType, TRadioDefaultType, TSwitchDefaultType, } from 'editorCore/FormComponents/types'; import { baseConfig, baseDefault, ICommonBaseType } from '../../common'; export type CarouselDirectionKeyType = 'down' | 'left'; export type TCarouselEditData = Array< | INumberConfigType | IRadioConfigType | ISwitchConfigType | IDataListConfigType >; export interface ICarouselConfig extends ICommonBaseType { direction: TRadioDefaultType; swipeable: TSwitchDefaultType; autoPlay: TSwitchDefaultType; imgList: TDataListDefaultType; } export interface ICarouselSchema { editData: TCarouselEditData; config: ICarouselConfig; } const Carousel: ICarouselSchema = { editData: [ // ...baseConfig, // { // key: 'direction', // name: '方向', // type: 'Radio', // range: [ // { // key: 'down', // text: '从上到下', // }, // { // key: 'left', // text: '从左到右', // }, // ], // }, // { // key: 'swipeable', // name: '是否可拖拽', // type: 'Switch', // }, // { // key: 'autoPlay', // name: '是否自动播放', // type: 'Switch', // }, { key: 'imgList', name: '图片列表', type: 'DataList', }, ], config: { direction: 'left', swipeable: true, autoPlay: true, imgList: [ { id: '1', title: '首页banner', desc: '首页banner', link: 'http://www.liweijia.com', imgUrl: [ { uid: '001', name: 'image.png', status: 'done', url: 'http://webimg.liweijia.com/lwj_cms2/upload/content/5734531f15a952c76a4f78629fbfa9a5.jpg', }, ], }, { id: '2', title: '专题推荐', desc: '专题推荐', link: 'http://www.liweijia.com', imgUrl: [ { uid: '001', name: 'image.png', status: 'done', url: 'http://webimg.liweijia.com/lwj_cms2/upload/content/5734531f15a952c76a4f78629fbfa9a5.jpg', }, ], }, ], ...baseDefault, }, }; export default Carousel;