import { __decorate } from "tslib";
import { Component } from 'vue-property-decorator';
import { AppDefaultFormDetail } from '../app-default-form-detail/app-default-form-detail';
import { VueLifeCycleProcessing } from '../../../../decorators';
/**
 * 表单UI组件
 *
 * @export
 * @class AppDefaultFormTabPage
 * @extends {Vue}
 */
let AppDefaultFormTabPage = class AppDefaultFormTabPage extends AppDefaultFormDetail {
    /**
     * 绘制表单分页标题
     *
     * @param {*} viewPanel
     * @returns
     * @memberof AppDefaultFormTabPage
     */
    renderLabel() {
        var _a;
        const { caption } = this.detailsInstance;
        const sysCss = this.detailsInstance.getLabelPSSysCss();
        const sysImg = this.detailsInstance.getPSSysImage();
        let labelClass = (sysCss === null || sysCss === void 0 ? void 0 : sysCss.cssName) ? 'caption ' + sysCss.cssName : 'caption';
        let labelCaption = this.$tl((_a = this.detailsInstance.getCapPSLanguageRes()) === null || _a === void 0 ? void 0 : _a.lanResTag, caption);
        let labelIcon;
        if (sysImg) {
            if (sysImg === null || sysImg === void 0 ? void 0 : sysImg.imagePath) {
                labelIcon = <img src={sysImg === null || sysImg === void 0 ? void 0 : sysImg.imagePath} style={{ 'margin-right': '4px' }}></img>;
            }
            else {
                labelIcon = <i class={sysImg === null || sysImg === void 0 ? void 0 : sysImg.cssClass} style={{ 'margin-right': '4px' }}></i>;
            }
        }
        return (<span class={labelClass}>
        {labelIcon}
        {labelCaption}
      </span>);
    }
    /**
     * 绘制内容
     *
     * @returns {*}
     * @memberof AppDefaultFormTabPage
     */
    render() {
        var _a, _b;
        const { detailClassNames } = this.renderOptions;
        const { codeName } = this.detailsInstance;
        const tabsName = (_b = (_a = this.detailsInstance) === null || _a === void 0 ? void 0 : _a.getParentPSModelObject()) === null || _b === void 0 ? void 0 : _b.name;
        return (<tab-pane label={this.renderLabel} name={codeName} index={this.index} tab={tabsName} class={detailClassNames} style={this.runtimeModel.visible ? '' : 'display: none;'}>
        {this.$slots.default}
      </tab-pane>);
    }
};
AppDefaultFormTabPage = __decorate([
    Component({}),
    VueLifeCycleProcessing()
], AppDefaultFormTabPage);
export { AppDefaultFormTabPage };
