contextmenu-base.tsx 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
import { IPSDEContextMenu } from '@ibiz/dynamic-model-api';
import { ContextMenuControlInterface } from 'ibiz-core';
import { MainControlBase } from './main-control-base';

/**
 * 上下文菜单部件基类
 *
 * @export
 * @class FormControlBase
 * @extends {MainControlBase}
 */
export class ContextMenuBase extends MainControlBase implements ContextMenuControlInterface{

    /**
     * 部件模型
     *
     * @type {AppContextMenuBase}
     * @memberof ContextMenuBase
     */
    public controlInstance!: IPSDEContextMenu;

    /**
     * 上下文菜单界面行为模型
     *
     * @type {AppContextMenuBase}
     * @memberof ContextMenuBase
     */
    public contextMenuActionModel!: any;

    /**
     * 监听静态参数变化
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof ControlBase
     */
    public onDynamicPropsChange(newVal: any, oldVal: any) {
        this.contextMenuActionModel = newVal?.contextMenuActionModel || {};
        super.onDynamicPropsChange(newVal, oldVal);
    }

    /**
     * 部件模型数据初始化实例
     *
     * @memberof ContextMenuBase
     */
    public async ctrlModelInit(args?: any) {
        await super.ctrlModelInit();
    }

    /**
     * 设置已经绘制完成状态
     *
     * @memberof ContextMenuBase
     */    
    public setIsMounted(){
      // 上下文菜单绘制完成不需要外面部件重新加载
    }

}