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
2.3 KiB
2 lines
2.3 KiB
var f=(a,i,e)=>new Promise((n,l)=>{var o=p=>{try{y(e.next(p))}catch(t){l(t)}},m=p=>{try{y(e.throw(p))}catch(t){l(t)}},y=p=>p.done?n(p.value):Promise.resolve(p.value).then(o,m);y((e=e.apply(a,i)).next())});import{ClassFactory as I}from"./ClassFactory-66077970.js";import{D as u}from"./DataType-33901a1c.js";import{FieldType as D,UIContralType as T}from"./EnumLab-3cbd0812.js";import{SysEnums as g}from"./SysEnum-989b6639.js";import{splitAtString as b}from"./ParamUtils-cdc24dd6.js";import"./index-f4658ae7.js";import"./SystemConfig-b93c25b3.js";import"./bignumber-cf158d26.js";import"./ParamsUtils-3cbc5822.js";import"./UAC-8e255d47.js";import"./Map-73575e6b.js";import"./Attrs-62391d6b.js";import"./Attr-d5feb8b8.js";import"./RefMethod-33a71db4.js";import"./SearchNormal-5c7fda42.js";import"./SearchFKEnum-31a3a609.js";import"./Glo-fda3f906.js";import"./EnMapExt-8e17025c.js";import"./EntityMyPK-e742fec8.js";import"./Entities-6a72b013.js";function s(a,i){return a===u.AppInt?parseInt(i):a===u.AppFloat||a===u.AppDouble?parseFloat(i):i}function V(a){return{getDDLData:(e,n)=>f(this,null,function*(){const{UIBindKey:l,UITag:o,Key:m}=e;if((l==null?void 0:l.trim().substring(0,6).toLowerCase())==="select"){const t=yield a==null?void 0:a.GenerSQLAttrDB(m,n);return Array.isArray(t)?t.map(r=>({value:s(e.MyDataType,r.No),label:r.Name,text:r.Name})):[]}if(e.MyFieldType===D.RefText&&e.UIContralType===T.DDL){if(e.UIIsReadonly==!0&&n)return[{value:n.get(e.Key),label:n.get(e.Key+"Text")}];{const t=yield I.GetEns(e.HisFKEns||"");return t?(yield t.Init(),yield t.RetrieveAll(),t.slice(0,t.length).map(r=>({value:s(e.MyDataType,r.No),label:r.Name,text:r.Name}))):[]}}if(e.MyFieldType===D.FK&&e.UIContralType===T.DDL){if(e.UIIsReadonly&&n)return[{value:n.get(e.Key),label:n.get(e.Key+"Text")||""}];const t=yield I.GetEns(e.HisFKEns||"");return t?(yield t.Init(),yield t.RetrieveAll(),t.slice(0,t.length).map(r=>({value:s(e.MyDataType,r.No),label:r.Name,text:r.Name}))):[]}if(e.MyFieldType===D.Enum&&e.MyDataType===u.AppInt&&e.UIContralType===T.DDL&&!o){const t=new g;return yield t.Retrieve("EnumKey",l),t.slice(0,t.length).map(r=>({value:s(e.MyDataType,r.IntKey),label:r.Lab,text:r.Lab}))}return(typeof o=="string"?b(o):[]).map(t=>{const[r,c]=t.split("=");return{value:s(e.MyDataType,r),label:c,text:c}})})}}export{s as parseValByType,V as useDDLDataLoader};
|