import { Subject, Subscription } from 'rxjs'; import { FormControlInterface } from '@ibizstudio/runtime'; import { MainControlBase } from './main-control-base'; import { IPSDEEditFormItem, IPSDEForm } from '@ibizstudio/runtime'; /** * 表单部件基类 * * @export * @class FormControlBase * @extends {MainControlBase} */ export declare class FormControlBase extends MainControlBase implements FormControlInterface { /** * 表单数据对象 * * @type {*} * @memberof FormControlBase */ data: any; /** * 表单的模型对象 * * @type {*} * @memberof FormControlBase */ controlInstance: IPSDEForm; /** * 表单服务对象 * * @type {*} * @memberof ControlBase */ service: any; /** * 部件行为--loaddraft * * @type {*} * @memberof FormControlBase */ loaddraftAction: any; /** * 部件行为--load * * @type {*} * @memberof FormControlBase */ loadAction: any; /** * 表单状态 * * @type {Subject} * @memberof FormControlBase */ formState: Subject; /** * 忽略表单项值变化 * * @type {boolean} * @memberof FormControlBase */ ignorefieldvaluechange: boolean; /** * 数据变化 * * @public * @type {Subject} * @memberof FormControlBase */ dataChang: Subject; /** * 视图状态事件 * * @public * @type {(Subscription | undefined)} * @memberof FormControlBase */ dataChangEvent: Subscription | undefined; /** * 原始数据 * * @public * @type {*} * @memberof FormControlBase */ oldData: any; /** * 详情模型集合 * * @type {*} * @memberof FormControlBase */ detailsModel: any; /** * 值规则 * * @type {*} * @memberof FormControlBase */ rules: any; /** * 转化代码项值映射 * * @type {Map} * @memberof FormControlBase */ codeItemTextMap: Map; /** * 获取多项数据 * * @returns {any[]} * @memberof FormControlBase */ getDatas(): any[]; /** * 获取单项数据 * * @returns {*} * @memberof FormControlBase */ getData(): any; /** * 重置表单项值 * * @public * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } 名称,新值,旧值 * @memberof FormControlBase */ resetFormData({ name, newVal, oldVal }: { name: string; newVal: any; oldVal: any; }): void; /** * 表单逻辑 * * @public * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } 名称,新值,旧值 * @memberof FormControlBase */ formLogic({ name, newVal, oldVal }: { name: string; newVal: any; oldVal: any; }): Promise; /** * 表单值变化 * * @public * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } 名称,新值,旧值 * @returns {void} * @memberof FormControlBase */ formDataChange({ name, newVal, oldVal }: { name: string; newVal: any; oldVal: any; }): void; /** * 表单加载完成 * * @public * @param {*} [data={}] 表单数据 * @param {string} [action] 行为标识 * @memberof FormControlBase */ onFormLoad(data: any, action: string): void; /** * 值填充 * * @param {*} [_datas={}] 表单数据 * @param {string} [action] 行为标识 * @memberof FormControlBase */ fillForm(_datas: any, action: string): void; /** * 设置表单项是否启用 * * @public * @param {*} data 表单数据 * @memberof FormControlBase */ setFormEnableCond(data: any): void; /** * 新建默认值 * @memberof FormControlBase */ createDefault(): void; /** * 重置草稿表单状态 * * @public * @memberof FormControlBase */ resetDraftFormStates(): void; /** * 重置校验结果 * * @memberof FormControlBase */ resetValidates(): void; /** * 填充校验结果 (后台) * * @param {any[]} fieldErrors 校验数组 * @memberof FormControlBase */ fillValidates(fieldErrors: any[]): void; /** * 表单校验状态 * * @returns {boolean} * @memberof FormControlBase */ formValidateStatus(): boolean; /** * 表单项值变更 * * @param {{ name: string, value: any }} $event 名称,值 * @returns {void} * @memberof FormControlBase */ onFormItemValueChange($event: { name: string; value: any; }): void; /** * 校验编辑器基础规则后续行为 * * @param {string} name 名称 * @param {*} value 值 * @returns {void} * @memberof FormControlBase */ validateEditorRuleAction(name: string, value: any): void; /** * @description 校验是否忽略输入值 * @protected * @param {string} name * @param {('before' | 'change')} [step='change'] {before:表单值变化之前,change:表单值变化} * @return {*} {boolean} * @memberof FormControlBase */ protected checkIgnoreInput(name: string, step?: 'before' | 'change'): boolean; /** * 设置数据项值 * * @param {string} name 名称 * @param {*} value 值 * @returns {void} * @memberof FormControlBase */ setDataItemValue(name: string, value: any): void; /** * 分组界面行为事件 * * @param {*} $event * @memberof FormControlBase */ groupUIActionClick($event: any): void; /** * 编辑表单初始化 * * @memberof FormControlBase */ ctrlInit(args?: any): void; viewStateAction(tag: string, action: string, data: any): void; /** * 表单销毁 * * @memberof FormControlBase */ ctrlDestroyed(args?: any): void; /** * 表单自动加载 * * @param {*} [arg={}] 加载参数 * @returns {void} * @memberof FormControlBase */ autoLoad(arg?: any): void; /** * 加载 * * @public * @param {*} [opt={}] 加载参数 * @memberof FormControlBase */ load(opt?: any): Promise; /** * 加载草稿 * * @param {*} [opt={}] * @memberof FormControlBase */ loadDraft(opt?: any, mode?: string): void; /** * 表单项更新 * * @param {string} mode 界面行为名称 * @param {*} [data={}] 请求数据 * @param {string[]} updateDetails 更新项 * @param {boolean} [showloading] 是否显示加载状态 * @returns {void} * @memberof FormControlBase */ updateFormItems(mode: string, data: any, updateDetails: string[], showloading?: boolean): void; /** * 回车事件 * * @param {*} $event * @memberof FormControlBase */ onEnter($event: any): void; /** * 搜索 * * @memberof FormControlBase */ onSearch(): void; /** * 重置 * * @memberof FormControlBase */ onReset(): void; /** * 通过属性名获取表单项 * * @memberof FormControlBase */ findFormItemByField(fieldName: string): IPSDEEditFormItem | undefined; /** * 处理部件UI请求 * * @param {string} action 行为名称 * @param {*} context 上下文 * @param {*} viewparam 视图参数 * @memberof FormControlBase */ onControlRequset(action: string, context: any, viewparam: any): void; /** * 处理部件UI响应 * * @param {string} action 行为名称 * @param {*} response 响应 * @memberof FormControlBase */ onControlResponse(action: string, response: any): void; } //# sourceMappingURL=form-control-base.d.ts.map