You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.3 KiB

var I=Object.defineProperty;var S=(d,i,e)=>i in d?I(d,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[i]=e;var A=(d,i,e)=>(S(d,typeof i!="symbol"?i+"":i,e),e);var h=(d,i,e)=>new Promise((s,t)=>{var n=a=>{try{r(e.next(a))}catch(c){t(c)}},o=a=>{try{r(e.throw(a))}catch(c){t(c)}},r=a=>a.done?s(a.value):Promise.resolve(a.value).then(n,o);r((e=e.apply(d,i)).next())});import{R as P}from"./DataType-33901a1c.js";import{Y as f,$ as l}from"./index-f4658ae7.js";import{c as D}from"./ParamsUtils-3cbc5822.js";import"./ParamUtils-cdc24dd6.js";import"./SystemConfig-b93c25b3.js";import"./bignumber-cf158d26.js";class B extends Array{constructor(){super();A(this,"readyState",0)}Init(e){return h(this,null,function*(){if(this.readyState===1)return;const s=this.GetNewEntity,t=new l("BP.WF.HttpHandler.WF_CommTS");if(e){t.AddPara("ClassID",s.classID),t.AddPara("Map",JSON.stringify(s._enMap)),yield t.DoMethodReturnString("Entity_SetMap"),this.readyState=1;return}t.AddPara("ClassID",s.classID),(yield t.DoMethodReturnString("Entity_IsExitMap"))=="0"&&(t.AddPara("ClassID",s.classID),t.AddPara("Map",JSON.stringify(s._enMap)),yield t.DoMethodReturnString("Entity_SetMap")),this.readyState=1})}RetrieveAllFromDBSource(e=""){return h(this,null,function*(){yield this.Init();const s=new l("BP.WF.HttpHandler.WF_CommTS");s.AddPara("ClassID",this.GetNewEntity.classID),s.AddPara("PK",this.GetNewEntity.PK),s.AddPara("OrderBy",e);const t=yield s.DoMethodReturnJson("Entities_RetrieveAllFromDBSource");this.splice(0,this.length);for(const n of t){const o=this.GetNewEntity;o.Row=n,this.push(o)}return this.length})}RetrieveAll(e=""){return h(this,null,function*(){yield this.Init();const s=this.GetNewEntity,t=new l("BP.WF.HttpHandler.WF_CommTS");t.AddPara("ClassID",s.classID),t.AddPara("OrderBy",e),t.AddPara("PK",s.PK);const n=yield t.DoMethodReturnJson("Entities_RetrieveAll");this.splice(0,this.length);for(const o of n){const r=this.GetNewEntity;r.Row=new P(o),this.push(r)}return this.length})}Retrieve(...e){return h(this,null,function*(){yield this.Init();const s=this.GetNewEntity,t=new l("BP.WF.HttpHandler.WF_CommTS");t.AddPara("ClassID",s.classID),t.AddPara("Paras",D(e)),t.AddPara("PK",s.PK);const n=yield t.DoMethodReturnJson("Entities_Retrieve");this.splice(0,this.length);for(const o of n){const r=this.GetNewEntity;r.Row=new P(o),this.push(r)}return this.length})}RetrieveLikeKey(e,s,t="",n="",o=""){return h(this,null,function*(){if(yield this.Init(),e===""||e==null){alert("\u8BF7\u8F93\u5165\u5173\u952E\u5B57");return}const r=this.GetNewEntity,a=new l("BP.WF.HttpHandler.WF_CommTS");a.AddPara("ClassID",r.classID),a.AddPara("PK",r.PK),a.AddPara("SearchKey",e),a.AddPara("AttrsScop",s),a.AddPara("CondAttr",t),a.AddPara("CondVal",n),a.AddPara("OrderBy",o);const c=yield a.DoMethodReturnJson("Entities_RetrieveLikeKey");this.splice(0,this.length);for(const p of c){const w=new P,m=Object.keys(p);for(const y of m)w.has(y)||w.SetValByKey(y,p[y]);const u=this.GetNewEntity;u.Row=w,this.push(u)}return this.length})}Delete(...e){return h(this,null,function*(){yield this.Init();const s=this.GetNewEntity,t=new l("BP.WF.HttpHandler.WF_CommTS");t.AddPara("ClassID",s.classID),t.AddPara("Paras",D(e));const n=yield t.DoMethodReturnString("Entities_Delete");typeof n=="string"&&n.includes("err@")&&f.error(n.replace("err@",""))})}}export{B as Entities};