import { BasicProps, BasicState, EditSetting } from '../type' export interface ColDetail { // 合集id id: number; blogInfo: BlogInfo; // 合集封面 coverUrl: string; // 合集名称 name: string; // 合集简介 description: string; // 文章数 postCount: number; // 浏览量 viewCount: number; // 标签 tags: string; // 合集类型,0:普通合集,1:共创合集 collectionType: 0 | 1; } export interface ColConfig { colId: number; cover?: { url: string }; title?: string; description?: string } export interface BlogInfo { authName: string; bigAvaImg: string; blogId: 0 blogName: string; blogNickName: string; selfIntro: string; } export type ColLayoutType = 'vertical' | 'horizontal' export class Props extends BasicProps { public editSetting: EditSetting = { key: 'gaea-lofter-collection', name: 'lofter合集模块', isContainer: false, isAutoHeight: true, defaultPosition: { top: '0', left: '0' }, type: ['common', 'lofter'], editors: [ { field: 'title', text: '标题', type: 'string', }, { field: 'type', text: '类型', type: 'select', data: [ { text: '垂直布局', value: 'vertical' }, { text: '水平布局', value: 'horizontal' }, ] }, { field: 'cols', text: '合集', type: 'array', data: [ { field: 'colId', text: '合集ID', type: 'number' }, { field: 'cover', text: '封面', type: 'image', placeholder: '不传则使用合集封面' }, { field: 'title', text: '标题', type: 'string', placeholder: '不传则使用合集标题' }, { field: 'description', text: '简介', type: 'string', placeholder: '不传则使用合集简介' } ] }, '样式', { field: 'width', text: '模块宽度', type: 'number' }, { field: 'marginTop', text: '模块上间距', type: 'number', }, { field: 'marginBottom', text: '模块下间距', type: 'number', }, ] }; title: string = ''; width: number = 9; marginTop: number = 0; marginBottom: number = 0; type: ColLayoutType = 'vertical'; cols: ColConfig[] = []; } export class State extends BasicState { colDetails: ColDetail[] = [] }