import { __decorate } from "tslib";
import { Component, Prop, Vue, Emit } from 'vue-property-decorator';
let AppPanelShell = class AppPanelShell extends Vue {
    /**
     * 部件事件
     *
     * @param {{ controlname: string; action: string; data: any }} { controlname 部件名称, action 事件名称, data 事件参数 }
     * @memberof AppDefaultTree
     */
    ctrlEvent({ controlname, action, data }) { }
    getPanelComponentName() {
        if (this.staticProps && this.staticProps.modelData) {
            const modelType = this.staticProps.modelData.modeltype;
            if (modelType && modelType == 'PSSYSVIEWPANEL') {
                return 'app-default-viewpanel';
            }
            else {
                return 'app-default-panel';
            }
        }
    }
    render(h) {
        const componentName = this.getPanelComponentName();
        if (!componentName) {
            return;
        }
        return h(componentName, {
            props: {
                staticProps: this.staticProps,
                dynamicProps: this.dynamicProps
            },
            on: {
                'ctrl-event': ({ controlname, action, data }) => {
                    this.ctrlEvent({ controlname, action, data });
                }
            }
        });
    }
};
__decorate([
    Prop()
], AppPanelShell.prototype, "dynamicProps", void 0);
__decorate([
    Prop()
], AppPanelShell.prototype, "staticProps", void 0);
__decorate([
    Emit('ctrl-event')
], AppPanelShell.prototype, "ctrlEvent", null);
AppPanelShell = __decorate([
    Component({})
], AppPanelShell);
export { AppPanelShell };
