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
1.3 KiB

var l=Object.defineProperty;var u=(r,t,e)=>t in r?l(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var s=(r,t,e)=>(u(r,typeof t!="symbol"?t+"":t,e),e);import{E as h}from"./DataType-33901a1c.js";import{Entities as p}from"./Entities-6a72b013.js";import{a as y}from"./assign-481cba08.js";import"./index-f4658ae7.js";import"./ParamUtils-cdc24dd6.js";import"./SystemConfig-b93c25b3.js";import"./bignumber-cf158d26.js";import"./ParamsUtils-3cbc5822.js";import"./_createAssigner-77c8874c.js";class o{}s(o,"No","No"),s(o,"Name","Name"),s(o,"ParentNo","ParentNo"),s(o,"Idx","Idx");class G extends h{constructor(t,e){super(t,e)}get PK(){return"No"}get PKVal(){return this.No}get No(){return this.GetValStringByKey(o.No)}set No(t){this.SetValByKey(o.No,t)}get Name(){return this.GetValStringByKey(o.Name)}set Name(t){this.SetValByKey(o.Name,t)}get ParentNo(){return this.GetValStringByKey("ParentNo")}set ParentNo(t){this.SetValByKey("ParentNo",t)}}class v extends p{ToTreeJson(t){function e(i,a){const N=a.filter(n=>n.ParentNo===i);if(N.length===0)return[];const m=a.filter(n=>N.every(c=>c.No!==n.No));return N.map(n=>y(n,{children:e(n.No,m)})),N}try{const i=this.slice(0,this.length).map(a=>Object.fromEntries(a.Row));return e(t,i)}catch(i){return[]}}}export{v as EntitiesTree,G as EntityTree,o as EntityTreeAttr};