import { __decorate } from "tslib";
import { Vue, Component, Prop } from 'vue-property-decorator';
import './panel-design-content.less';
/**
 * 面板设计区容器
 *
 * @export
 * @class PanelDesignContent
 * @extends {Vue}
 */
let PanelDesignContent = class PanelDesignContent extends Vue {
    created() {
        this.ctx.ctrl.initAction();
        this.load();
    }
    async load() {
        const loading = this.$loading({
            lock: true,
            text: '加载中...',
            background: '#ffffffe6',
        });
        const { ctrl } = this.ctx;
        try {
            await ctrl.load();
        }
        catch (err) {
            this.$throw(err);
        }
        this.ctx.loaded = true;
        loading.close();
    }
    activePanel(e) {
        e.stopPropagation();
        this.ctx.ctrl.select.set(this.ctx.ctrl.masterData);
    }
    render() {
        var _a;
        const { select, masterData } = this.ctx.ctrl;
        return (<div class='ibz-panel-design-container' on-click={(e) => this.activePanel(e)}>
                {masterData ? (<div class={{
                    'ibz-panel-design-content': true,
                    'drag-item-container': true,
                    active: ((_a = select.data) === null || _a === void 0 ? void 0 : _a.srfkey) === (masterData === null || masterData === void 0 ? void 0 : masterData.srfkey),
                }}>
                        {this.ctx.loaded ? <ibz-design-panel-content ctx={this.ctx}/> : null}
                    </div>) : null}
            </div>);
    }
};
__decorate([
    Prop()
], PanelDesignContent.prototype, "ctx", void 0);
PanelDesignContent = __decorate([
    Component({})
], PanelDesignContent);
export { PanelDesignContent };
