import { AppLayoutService } from '../../../app-service';
import { DePanelViewBase } from '../../../view';
/**
 * 应用实体面板视图基类
 *
 * @export
 * @class AppDataViewExpViewBase
 * @extends {DataViewExpBase}
 */
export class AppDePanelViewBase extends DePanelViewBase {
    /**
     * 渲染视图主体内容区
     *
     * @memberof ExpViewBase
     */
    renderMainContent() {
        var _a;
        let { targetCtrlName, targetCtrlParam, targetCtrlEvent } = this.computeTargetCtrlData(this.panelInstance);
        if (this.panelInstance) {
            Object.assign(targetCtrlParam.dynamicProps, {
                navdatas: this.navdatas,
            });
        }
        return this.$createElement(targetCtrlName, { props: targetCtrlParam, ref: (_a = this.panelInstance) === null || _a === void 0 ? void 0 : _a.name, on: targetCtrlEvent });
    }
    /**
     * 数据视图渲染
     *
     * @memberof AppDataViewExpViewBase
     */
    render(h) {
        if (!this.viewIsLoaded) {
            return null;
        }
        const targetViewLayoutComponent = AppLayoutService.getLayoutComponent(`${this.viewInstance.viewType}-${this.viewInstance.viewStyle}`);
        return h(targetViewLayoutComponent, {
            props: { viewInstance: this.viewInstance, model: this.model, modelService: this.modelService, viewparams: this.viewparams, context: this.context },
        }, [this.renderTopMessage(), this.renderToolBar(), this.renderBodyMessage(), this.renderMainContent(), this.renderBottomMessage()]);
    }
}
