viewpanel-control-base.tsx 1.3 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
import { MainControlBase } from "./main-control-base";
import { IPSAppView, IPSDEViewPanel } from '@ibiz/dynamic-model-api';

/**
 * 嵌入视图面板部件基类
 *
 * @export
 * @class ViewPanelControlBase
 * @extends {MDControlBase}
 */
export class ViewPanelControlBase extends MainControlBase {

    /**
     * 面板的模型对象
     *
     * @type {*}
     * @memberof ViewPanelControlBase
     */
    public controlInstance!: IPSDEViewPanel;

    /**
     * 缓存UUID
     *
     * @type {*}
     * @memberof ViewPanelControlBase
     */
    public cacheUUID: any;

    /**
     * 嵌入视图模型路径
     *
     * @type {string}
     * @memberof ViewPanelControlBase
     */
    public embedViewPath: string = '';

    /**
     * 部件模型初始化
     *
     * @memberof ViewPanelControlBase
     */
    public async ctrlModelInit(args?: any) {
        await super.ctrlModelInit(args);
        await this.initEmbedViewPath();
    }

    /**
     * 初始化嵌入视图模型路径
     *
     * @memberof ViewPanelControlBase
     */
    public async initEmbedViewPath() {
        const embedView = this.controlInstance.getEmbeddedPSAppDEView?.() as IPSAppView;
        await embedView?.fill?.(true);
        this.embedViewPath = embedView.modelPath || '';
    }

}