/** * 特性属性 */ // export interface IFeatures { // id: string; // /** // * 编号 // */ // code: string; // /** // * 名称 // */ // __name__: { "zh-CHS": string, "zh-CHT": string, en: string }; // name_chs: string; // name_cht: string; // name_en: string; // /** // * 是否必填 // * @description 可选值 "1" | "0" // */ // isrequired: string; // /** // * 输入控件类型 // * @description 可选值 Help | Number | Enum etc // */ // inputtype: string; // textfield: string; // codefield: string; // /** // * 过滤条件 // */ // filtercondition: string; // /** // * 枚举信息 // */ // enuminfo: string; // /** // * 枚举数据源 // */ // __data__: Array<{ id: string, text: string }>; // /** // * 精度 // */ // digitalaccuracy: number; // /** // * 特征集id // */ // setid: string; // /** // * 是否是树帮助 // * @description 可选值 "0" | "1" // */ // setistree: string; // /** // * idp帮助id // */ // codesetid: string; // /** // * 只读 // * @description 可选值 "0" | "1" // */ // isreadonly: string; // /** // * 顺序号 // */ // sortorder: number; // value: string; // helpid: string; import { Observable } from "rxjs"; // } export interface IFeatureEditorOptions { width?: number; height?: number; title?: string; /** * 确认事件 */ onConfirm?: (features: IFeature[]) => void; /** * 确认前 * @description 方法返回值可以为 */ onConfirming?: (features: IFeature[]) => Observable | boolean; /** * 特性编辑器打开前 */ onOpening?: (options: any) => Observable | boolean; } export enum InputType { Help = 'Help', String = 'String', Enum = 'Enum', Date = 'Date' } /** * 编辑器类型 */ export const enum EditorTypes { TEXTAREA = 'textarea', TEXTBOX = 'textbox', CHECKBOX = 'checkbox', DATEPICKER = 'datepicker', INPUTGROUP = 'input-group', SELECT = 'select', LOOKUP = 'lookup', NUMBERBOX = 'numberbox', COMBOLIST = 'combolist', SWITCH = 'switch', TIMEPICKER = 'timepicker', COMBOLOOKUP = 'combo-lookup', LANGUAGETEXTBOX = 'language-textbox', ENUMEDITOR = 'enum-editor', FILTEREDITOR = 'filter-editor', SORTEDITOR = 'sort-editor' }; export interface IEditor { controlType: EditorTypes, [prop: string]: any; } /** * 枚举编辑器 */ export interface IEnumEditor extends IEditor { controlType: EditorTypes.ENUMEDITOR, idField: string; textField: string; multiSelect?: boolean; items?: any[]; }; /** * 数字编辑器 */ export interface INumberEditor extends IEditor { controlType: EditorTypes.NUMBERBOX; precision: number; step?: number; min?: number; max?: number; }; /** * 日期编辑器 */ export interface IDateEditor extends IEditor { controlType: EditorTypes.DATEPICKER; dateRange?: boolean; } /** * 时间编辑器 */ export interface ITimeEditor extends IEditor { controlType: EditorTypes.TIMEPICKER, use12Hours?: boolean; } /** * 帮助编辑器 */ export interface ILookupEditor extends IEditor { idField: string; textField: string; valueField: string; displayType?: string; singleSelect?: boolean; multiSelect?: boolean; mapFields?: string | object; dialogTitle?: string; hiddenInputName?: string; } /** * 特性描述 */ export interface IFeature { id: any; title: string; field: string; editor: IEditor | IEnumEditor | INumberEditor | IDateEditor | ITimeEditor | ILookupEditor; value?: any; results?: any; options?: { [prop: string]: any }; }