import { AppLayoutService } from '../app-service';
import { MainViewBase } from './mainview-base';
/**
 * 导航视图基类
 *
 * @export
 * @class ExpViewBase
 * @extends {MainViewBase}
 * @implements {ExpViewInterface}
 */
export class ExpViewBase extends MainViewBase {
    constructor() {
        super(...arguments);
        /**
         * 视图唯一标识
         *
         * @type {string}
         * @memberof ExpViewBase
         */
        this.viewUID = '';
    }
    /**
     * 渲染视图主体内容区
     *
     * @memberof ExpViewBase
     */
    renderMainContent() {
        var _a;
        let { targetCtrlName, targetCtrlParam, targetCtrlEvent } = this.computeTargetCtrlData(this.expBarInstance);
        return this.$createElement(targetCtrlName, { props: targetCtrlParam, ref: (_a = this.expBarInstance) === null || _a === void 0 ? void 0 : _a.name, on: targetCtrlEvent });
    }
    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()]);
    }
}
