import {Property} from "../properties/Property"; export enum LayoutSectionKeyEnum{ REPORT = 1, PREFERENCE, TEXT, PARAGRAPH, IMAGE, FUNCTION, STYLE, LAYOUT, DATA } export class LayoutSectionDef { private _key:LayoutSectionKeyEnum; private _type:string; private _label:string; constructor(key:LayoutSectionKeyEnum, type:string, label:string) { this._key = key; this._type = type; this._label = label; } get type():string { return this._type; } get label():string { return this._label; } get key():LayoutSectionKeyEnum{ return this._key; } } export class LayoutProperty { private _property:Property; private _readonly:boolean; private _hidden:boolean; constructor(property: Property, readonly = false, hidden = false) { this._property = property; this._readonly = readonly; this._hidden = hidden; } get property(): Property { return this._property; } get readonly(): boolean { return this._readonly; } setReadonly(value: boolean):LayoutProperty { this._readonly = value; return this; } get hidden(): boolean { return this._hidden; } setHidden(value: boolean):LayoutProperty { this._hidden = value; return this; } } export class LayoutSection { static LAYOUT_SECTION_TYPES = { REPORT: '__$LAYOUT_SECTION_TYPES_REPORT', PREFERENCE : '__$LAYOUT_SECTION_TYPES_PREFERENCE', TEXT : '__$LAYOUT_SECTION_TYPES_TEXT', PARAGRAPH : '__$LAYOUT_SECTION_TYPES_PARAGRAPH', IMAGE : '__$LAYOUT_SECTION_TYPES_IMAGE', FUNCTION: '__$LAYOUT_SECTION_TYPES_FUNCTION', STYLE: '__$LAYOUT_SECTION_TYPES_STYLE', LAYOUT: '__$LAYOUT_SECTION_TYPES_LAYOUT', DATA: '__$LAYOUT_SECTION_TYPES_DATA', }; static LAYOUT_SECTION = { [LayoutSectionKeyEnum.REPORT]: new LayoutSectionDef(LayoutSectionKeyEnum.REPORT, LayoutSection.LAYOUT_SECTION_TYPES.REPORT, '报表'), [LayoutSectionKeyEnum.PREFERENCE]: new LayoutSectionDef(LayoutSectionKeyEnum.PREFERENCE, LayoutSection.LAYOUT_SECTION_TYPES.PREFERENCE, "外观"), [LayoutSectionKeyEnum.LAYOUT]: new LayoutSectionDef(LayoutSectionKeyEnum.LAYOUT, LayoutSection.LAYOUT_SECTION_TYPES.LAYOUT, '布局'), [LayoutSectionKeyEnum.TEXT]: new LayoutSectionDef(LayoutSectionKeyEnum.TEXT, LayoutSection.LAYOUT_SECTION_TYPES.TEXT, "文本"), [LayoutSectionKeyEnum.PARAGRAPH]: new LayoutSectionDef(LayoutSectionKeyEnum.PARAGRAPH, LayoutSection.LAYOUT_SECTION_TYPES.PARAGRAPH, "段落"), [LayoutSectionKeyEnum.IMAGE]: new LayoutSectionDef(LayoutSectionKeyEnum.IMAGE, LayoutSection.LAYOUT_SECTION_TYPES.IMAGE, "图像"), [LayoutSectionKeyEnum.FUNCTION]: new LayoutSectionDef(LayoutSectionKeyEnum.FUNCTION, LayoutSection.LAYOUT_SECTION_TYPES.FUNCTION, '功能'), [LayoutSectionKeyEnum.STYLE]: new LayoutSectionDef(LayoutSectionKeyEnum.STYLE, LayoutSection.LAYOUT_SECTION_TYPES.STYLE, '样式'), [LayoutSectionKeyEnum.DATA]: new LayoutSectionDef(LayoutSectionKeyEnum.DATA, LayoutSection.LAYOUT_SECTION_TYPES.DATA, '数据') }; private _def:LayoutSectionDef; private _properties:Array = []; constructor(def:LayoutSectionDef) { this._def = def; } get type():string { return this._def.type; } get key():LayoutSectionKeyEnum { return this._def.key; } get label():string { return this._def.label; } get properties():Array { return this._properties; } };