import { __decorate } from "tslib";
import { Component } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '../../../../decorators';
import { AppDefaultFormDetail } from '../app-default-form-detail/app-default-form-detail';
/**
 * 表单UI组件
 *
 * @export
 * @class AppDefaultFormPage
 * @extends {Vue}
 */
let AppDefaultFormPage = class AppDefaultFormPage extends AppDefaultFormDetail {
    /**
     * 绘制表单分页标题
     *
     * @param {*} viewPanel
     * @returns
     * @memberof AppDefaultFormPage
     */
    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': '2px' }}></img>;
            }
            else {
                labelIcon = <i class={sysImg === null || sysImg === void 0 ? void 0 : sysImg.cssClass} style={{ 'margin-right': '2px' }}></i>;
            }
        }
        return (<span class={labelClass}>
        {labelIcon}
        {labelCaption}
      </span>);
    }
    /**
     * 绘制内容
     *
     * @returns {*}
     * @memberof AppDefaultFormPage
     */
    render() {
        var _a, _b;
        const { detailClassNames } = this.renderOptions;
        const { codeName } = this.detailsInstance;
        const { codeName: formCodeName, controlType } = this.controlInstance;
        const tabsName = `${(_b = (_a = this.controlInstance.getPSAppDataEntity()) === null || _a === void 0 ? void 0 : _a.codeName) === null || _b === void 0 ? void 0 : _b.toLowerCase()}_${controlType === null || controlType === void 0 ? void 0 : controlType.toLowerCase()}_${formCodeName === null || formCodeName === void 0 ? void 0 : formCodeName.toLowerCase()}`;
        return (<tab-pane label={this.renderLabel} name={codeName} index={this.index} tab={tabsName} class={detailClassNames}>
        {this.runtimeModel.visible ? this.$slots.default : null}
      </tab-pane>);
    }
};
AppDefaultFormPage = __decorate([
    Component({}),
    VueLifeCycleProcessing()
], AppDefaultFormPage);
export { AppDefaultFormPage };
