import { __decorate } from "tslib";
import { VueLifeCycleProcessing } from '@ibizstudio/dynamic-design';
import { PSPanelEngine } from '@ibizstudio/api';
import { Component } from 'vue-property-decorator';
import { PanelMaterialBase } from '../panel-material-base';
/**
 * 面板引擎素材项
 *
 * @export
 * @class PanelEngine
 * @extends {Vue}
 */
let PanelEngine = class PanelEngine extends PanelMaterialBase {
    componentCreated() {
        this.load();
    }
    generateOption() {
        return {
            group: {
                name: this.ctx.tag + '-engine',
            },
        };
    }
    async load() {
        var _a;
        const s = await ((_a = ___ibz___.gs) === null || _a === void 0 ? void 0 : _a.getPSUIEngineTypeService());
        const res = await (s === null || s === void 0 ? void 0 : s.FetchValid(this.ctx.context));
        if (res === null || res === void 0 ? void 0 : res.ok) {
            const items = res.data;
            if (items) {
                this.list = [];
                items.forEach((item) => {
                    this.list.push({
                        text: item.psuienginetypename,
                        tooltip: item.psuienginetypename,
                        iconcls: 'iconfont icon-code',
                        data: new PSPanelEngine({
                            psuienginetypename: item.psuienginetypename,
                            psuienginetypeid: item.psuienginetypeid,
                        }),
                    });
                });
            }
        }
    }
};
PanelEngine = __decorate([
    Component({}),
    VueLifeCycleProcessing()
], PanelEngine);
export { PanelEngine };
