import { INumberConfigType, ISelectConfigType, ITextConfigType, TSelectDefaultType, IImageListConfigType, TNumberDefaultType, } from 'editorCore/FormComponents/types'; import { commonConfig, commonEditData, ICommonConfig } from '../../common'; import _ from 'lodash'; export type TTemplateKey = | 'twoInARow' | 'threeInARow' | 'fourInARow' | 'upOneDownThree' | 'leftTwoRightTwo' | 'leftOneRightTwo' | 'leftOneIRightThree'; export type TPhotoCubeEditData = Array< ITextConfigType | INumberConfigType | IImageListConfigType | ISelectConfigType >; export type TPhotoCubeConfig = Pick< ICommonConfig, 'name' | 'borderRadius' | 'imgList' | 'paddingX' > & { template: TSelectDefaultType; imagePadding: TNumberDefaultType; }; export interface IPhotoCubeSchema { editData: TPhotoCubeEditData; config: TPhotoCubeConfig; } const PhotoCube: IPhotoCubeSchema = { editData: [ commonEditData.name, { key: 'imagePadding', name: '图片间距', type: 'Number', range: [0, 100], }, { key: 'template', name: '选择模板', type: 'Select', range: [ { key: 'twoInARow', text: '一行二个', }, { key: 'threeInARow', text: '一行三个', }, { key: 'fourInARow', text: '一行四个', }, { key: 'upOneDownThree', text: '上一下三', }, { key: 'leftTwoRightTwo', text: '左二右二', }, { key: 'leftOneRightTwo', text: '左一右二', }, { key: 'leftOneIRightThree', text: '左一右三', }, ], }, commonEditData.imgList, commonEditData.borderRadius, commonEditData.paddingX, ], config: { ..._.pick(commonConfig, ['name', 'borderRadius', 'paddingX']), imgList: [ { id: '1', title: '专题推荐1', desc: '专题推荐1', link: '', data: { price: 20, sales_volume: 123, }, imgUrl: [ { uid: '001', name: 'image.png', status: 'done', url: 'https://static.liweijia.com/site-php/upload/commodity-goods/188cf28ce2c1ddc3e9e528cb95ba8586.png', }, ], }, { id: '2', title: '专题推荐2', desc: '专题推荐2', link: '', data: { price: 20, sales_volume: 123, }, imgUrl: [ { uid: '002', name: 'image.png', status: 'done', url: 'https://static.liweijia.com/site-php/upload/commodity-goods/b2b0e35485c8c6732235c3fde45d7a79.png', }, ], }, { id: '3', title: '专题推荐3', desc: '专题推荐3', link: '', data: { price: 20, sales_volume: 123, }, imgUrl: [ { uid: '003', name: 'image.png', status: 'done', url: 'https://static.liweijia.com/site-php/upload/commodity-goods/554411c9c06b43a8693c3a33fc17a961.png', }, ], }, { id: '4', title: '专题推荐4', desc: '专题推荐4', link: '', data: { price: 20, sales_volume: 123, }, imgUrl: [ { uid: '004', name: 'image.png', status: 'done', url: 'https://static.liweijia.com/site-php/upload/commodity-goods/673964091d845a9f0669bb2f48cdbcef.png', }, ], }, ], template: 'upOneDownThree', imagePadding: 3, }, }; export default PhotoCube;