import { __decorate } from "tslib";
import { throttle } from '@ibizstudio/runtime';
import { Component, Prop } from 'vue-property-decorator';
import { AppDefaultSearchFormDetail } from '../app-default-searchform-detail/app-default-searchform-detail';
import { VueLifeCycleProcessing } from '../../../../decorators';
/**
 * 表单UI组件
 *
 * @export
 * @class AppDefaultGroupPanel
 * @extends {Vue}
 */
let AppDefaultSearchGroupPanel = class AppDefaultSearchGroupPanel extends AppDefaultSearchFormDetail {
    /**
     * 分组面板界面行为点击事件回调
     *
     * @param {*} { item , event}
     * @memberof AppDefaultGroupPanel
     */
    groupUIActionClick({ item, event }) {
        var _a, _b, _c;
        let detail = (_c = (_b = (_a = this.detailsInstance) === null || _a === void 0 ? void 0 : _a.uiActionGroup) === null || _b === void 0 ? void 0 : _b.getPSUIActionGroupDetails) === null || _c === void 0 ? void 0 : _c.find((groupDetail) => {
            var _a;
            return item.name == `${(_a = this.detailsInstance) === null || _a === void 0 ? void 0 : _a.name}_${groupDetail === null || groupDetail === void 0 ? void 0 : groupDetail.name}`;
        });
        if (detail) {
            this.$emit('groupUIActionClick', event, this.detailsInstance, detail);
        }
    }
    /**
     * 绘制内容
     *
     * @returns {*}
     * @memberof AppDefaultGroupPanel
     */
    render() {
        var _a, _b, _c, _d, _e;
        const { detailClassNames } = this.renderOptions;
        let { codeName, caption, getLayout, titleBarCloseMode, showCaption, infoGroupMode, getLabelPSSysCss } = this.detailsInstance;
        // 设置默认值
        let layoutMode = (getLayout === null || getLayout === void 0 ? void 0 : getLayout.layout) || 'TABLE_24COL';
        titleBarCloseMode = Number(titleBarCloseMode) || 0;
        let labelCaption = this.detailsInstance.captionItemName
            ? this.data[this.detailsInstance.captionItemName]
            : 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} uiStyle='DEFAULT' titleBarCloseMode={titleBarCloseMode} titleStyle={(getLabelPSSysCss === null || getLabelPSSysCss === void 0 ? void 0 : getLabelPSSysCss.cssName) || ''} isInfoGroupMode={infoGroupMode} key={codeName} manageContainerStatus={(_b = this.runtimeModel) === null || _b === void 0 ? void 0 : _b.manageContainerStatus} isManageContainer={(_c = this.runtimeModel) === null || _c === void 0 ? void 0 : _c.isManageContainer} uiActionGroup={(_d = this.runtimeModel) === null || _d === void 0 ? void 0 : _d.uiActionGroup} class={detailClassNames} on-groupuiactionclick={(e) => {
                throttle(this.groupUIActionClick, [e], this);
            }} style={((_e = this.runtimeModel) === null || _e === void 0 ? void 0 : _e.visible) ? '' : 'display: none;'}>
        {this.$slots.default}
      </app-form-group>);
    }
};
__decorate([
    Prop()
], AppDefaultSearchGroupPanel.prototype, "data", void 0);
AppDefaultSearchGroupPanel = __decorate([
    Component({}),
    VueLifeCycleProcessing()
], AppDefaultSearchGroupPanel);
export { AppDefaultSearchGroupPanel };
