mob-list-expbar-control-base.tsx 2.1 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 61 62 63 64 65 66 67 68 69 70 71
import { IPSAppView, IPSDEList, IPSListExpBar } from "@ibiz/dynamic-model-api";
import { MobListExpBarControlInterface } from "../../../ibiz-core/src";
import { MobExpBarControlBase } from './mob-expbar-control-base';
/**
 * 列表导航栏部件基类
 *
 * @export
 * @class MobListExpBarControlBase
 * @extends {MainControlBase}
 */
export class MobListExpBarControlBase extends MobExpBarControlBase implements MobListExpBarControlInterface {

    /**
     * 列表导航栏的模型对象
     *
     * @type {*}
     * @memberof MobListExpBarControlBase
     */
    public declare controlInstance: IPSListExpBar;

    /**
     * 数据部件
     *
     * @memberof ListExpBarControlBase
     */
    protected declare $xDataControl: IPSDEList;

    /**
     * 计算目标部件所需参数
     *
     * @param {string} [controlType]
     * @returns
     * @memberof MobListExpBarControlBase
     */
    public computeTargetCtrlData(controlInstance: any) {
        const { targetCtrlName, targetCtrlParam, targetCtrlEvent } = super.computeTargetCtrlData(controlInstance);
        Object.assign(targetCtrlParam.staticProps, {
            listMode: "LISTEXPBAR"
        });
        return { targetCtrlName: targetCtrlName, targetCtrlParam: targetCtrlParam, targetCtrlEvent: targetCtrlEvent };
    }

    /**
     * load完成事件
     * 
     * @memberof MobListExpBarControlBase
     */
    public onLoad(args: any, tag?: string, $event2?: any) {
        if (!this.selection.view) {
            this.onSelectionChange(args);
        }
        if (this.$xDataControl) {
            this.$emit('ctrl-event', { controlname: this.$xDataControl.name, action: "load", data: args });
        }
    }

    /**
     * 处理数据部件参数
     *
     * @memberof GridExpBarControlBase
     */
    public async handleXDataCtrlOptions() {
        super.handleXDataCtrlOptions();
        const navPSAppView: IPSAppView = await this.$xDataControl?.getNavPSAppView()?.fill() as IPSAppView;
        if (navPSAppView) {
            this.navView = navPSAppView;
        }
        this.navFilter = this.$xDataControl?.navFilter ? this.$xDataControl.navFilter : "";
    }

}