import { BasicProps, BasicState, EditSetting } from '../type' export const THEME = new Map([ ['theme-1', '主题1'], ['theme-2', '主题2'], ['theme-3', '主题3'] ]) export interface PostConfig { descImgUrl?: { url: string; }; descImgHeight?: number; maxLine?: number; maxPostCount?: number; theme?: string; hideUser?: boolean; } export class Props extends BasicProps { public editSetting: EditSetting = { key: 'gaea-template-activity-post-list', name: '模板活动-作品展示', isAutoHeight: true, defaultPosition: { top: '0', left: '0' }, editors: [ { field: 'backgroundColor', text: '背景颜色', type: 'color' }, { field: 'postConfigs', text: '作品展示模块配置', type: 'array', data: [ { field: 'descImgUrl', text: '描述图片', type: 'image' }, { field: 'descImgHeight', text: '描述图片高度', type: 'number', data: { input: [0, Number.MAX_SAFE_INTEGER], step: 0.1 } }, { field: 'maxLine', text: '文案展示行数', type: 'number', data: { input: [0, 3], precision: 0 } }, { field: 'maxPostCount', text: '作品展示数量', type: 'number', data: { precision: 0 } }, { field: 'hideUser', text: '隐藏用户信息', type: 'boolean' }, { field: 'theme', text: '主题', type: 'select', data: [...THEME].map(item => ({ text: item[1], value: item[0] })) } ] } ] }; public tabImage: string; public backgroundColor: string = '#ffffff'; // 默认值 public postConfigs: PostConfig[] = [{ descImgHeight: 1.33, theme: 'theme-1', maxLine: 3 }]; public style: React.CSSProperties = { width: '10rem', }; } export class State extends BasicState { }