import{m as s,a}from"./p-c3d35135.js";import{G as e,c as o,M as t,a as n}from"./p-8d47f7b8.js";class i{static async objModel(a){const e={item:a},o=await s.create({component:"app-model-main",componentProps:e});await o.present()}static async arrModel(a){const e={item:a},o=await s.create({component:"app-model-list",componentProps:e});await o.present()}}const p=new class{constructor(){this.store=e.getInstance()}get appLoaded(){return this.store.data.appLoaded}async openDesignView(s){if(this.openDesignCallback)if(s.isFill||await s.fill(),n(s)){const a=s.getPSModelService(),e=o(s);this.openDesignCallback({dynaInstId:a.app.M.getPSDynaInstId,previewModelType:null==e?void 0:e.modeltype,previewModel:null==e?void 0:e.M,modelType:s.modeltype,model:s.M})}else a.create({header:"抱歉",subHeader:"无法打开设计视图!",message:"当前模型尚未支持打开设计视图，敬请期待.",buttons:["确认"]}).then((s=>s.present()))}setConfig(s,a,e,o){const t=this.store.data;t.modelService=s,t.model=a,t.context=e,t.params=o}async openView(s){s?"PSAPPDEVIEW"!==s.modeltype&&"PSAPPINDEXVIEW"!==s.modeltype||(s.isFill||await s.fill(),i.objModel(new t(s))):console.warn("给予模型类型不正确，请检查!",s)}};export{i as O,p as a}