import { __decorate } from "tslib";
import { throttle } from '@ibizstudio/runtime';
import { Component, Prop } from 'vue-property-decorator';
import { VueLifeCycleProcessing } from '../../../../decorators';
import { AppDefaultFormDetail } from '../app-default-form-detail/app-default-form-detail';
/**
 * 表单UI组件
 *
 * @export
 * @class AppDefaultGroupPanel
 * @extends {Vue}
 */
let AppDefaultGroupPanel = class AppDefaultGroupPanel extends AppDefaultFormDetail {
    /**
     * 分组面板界面行为点击事件回调
     *
     * @param {*} { item , event}
     * @memberof AppDefaultGroupPanel
     */
    groupUIActionClick({ item, event }) {
        var _a, _b, _c;
        const detail = (_c = (_b = (_a = this.detailsInstance) === null || _a === void 0 ? void 0 : _a.getPSUIActionGroup()) === null || _b === void 0 ? void 0 : _b.getPSUIActionGroupDetails()) === null || _c === void 0 ? void 0 : _c.find((groupDetail) => {
            return item.name == `${this.detailsInstance.name}_${groupDetail.name}`;
        });
        if (detail) {
            this.$emit('groupUIActionClick', event, this.detailsInstance, detail);
        }
    }
    /**
     * 绘制内容
     *
     * @returns {*}
     * @memberof AppDefaultGroupPanel
     */
    render() {
        var _a, _b, _c, _d, _e, _f;
        const { detailClassNames } = this.renderOptions;
        let { codeName, caption, titleBarCloseMode, showCaption, infoGroupMode, detailStyle } = this.detailsInstance;
        let layout = this.detailsInstance.getPSLayout();
        let iconInfo = this.detailsInstance.getPSSysImage();
        // 设置默认值
        let layoutMode = (layout === null || layout === void 0 ? void 0 : layout.layout) || 'TABLE_24COL';
        titleBarCloseMode = Number(titleBarCloseMode) || 0;
        let labelCaption = this.detailsInstance.captionItemName
            ? this.data[this.detailsInstance.captionItemName.toLowerCase()]
            : this.$tl((_a = this.detailsInstance.getCapPSLanguageRes()) === null || _a === void 0 ? void 0 : _a.lanResTag, caption);
        return (<app-form-group layoutType={layoutMode} caption={labelCaption} isShowCaption={showCaption && detailStyle != 'STYLE2'} uiStyle='DEFAULT' titleBarCloseMode={titleBarCloseMode} titleStyle={((_b = this.detailsInstance.getLabelPSSysCss()) === null || _b === void 0 ? void 0 : _b.cssName) || ''} isInfoGroupMode={infoGroupMode} key={codeName} iconInfo={iconInfo} manageContainerStatus={(_c = this.runtimeModel) === null || _c === void 0 ? void 0 : _c.manageContainerStatus} isManageContainer={(_d = this.runtimeModel) === null || _d === void 0 ? void 0 : _d.isManageContainer} uiActionGroup={(_e = this.runtimeModel) === null || _e === void 0 ? void 0 : _e.uiActionGroup} class={Object.assign(Object.assign({}, detailClassNames), { [`form-group-${detailStyle.toLowerCase()}`]: true })} on-groupuiactionclick={(e) => {
                throttle(this.groupUIActionClick, [e], this);
            }} on-managecontainerclick={() => {
                throttle(this.$emit, ['managecontainerclick', this.runtimeModel.name], this);
            }} style={((_f = this.runtimeModel) === null || _f === void 0 ? void 0 : _f.visible) ? '' : 'display: none;'} scopedSlots={{
                default: () => {
                    return this.$slots.default;
                },
                dataInfoPanel: () => {
                    return <app-form-group-data-panel detailModel={this.runtimeModel} data={this.data} context={this.context} viewparams={this.viewparams} on-input={() => { }}/>;
                },
            }}></app-form-group>);
    }
};
__decorate([
    Prop()
], AppDefaultGroupPanel.prototype, "data", void 0);
AppDefaultGroupPanel = __decorate([
    Component({}),
    VueLifeCycleProcessing()
], AppDefaultGroupPanel);
export { AppDefaultGroupPanel };
