HuanMengAdmin/admin-client/dist/static/js/AppDictionaryCache-muSIuEQ4.js
2024-07-29 01:55:29 +08:00

2 lines
1.4 KiB
JavaScript

var d=Object.defineProperty;var y=(c,t,a)=>t in c?d(c,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[t]=a;var e=(c,t,a)=>y(c,typeof t!="symbol"?t+"":t,a);import{S as _}from"./SysDictionaryService-AQ_z3QXg.js";class u{constructor(t){e(this,"_lock",null);e(this,"_dataList");this._lock=t}async getSysDictionaryService(){return(await _.getDictionaryByCode(this.code)).data}async getSysDictionaryCacheCommonModel(){return(await this.getSysDictionaryService()).map(a=>{const s=isNaN(Number(a.value))?a.value:Number(a.value);return{name:a.name,value:s,code:a.code}})}async getDataList(){for(;this._lock;)await this._lock;return this._dataList||(this._lock=(async()=>{try{this._dataList==null&&(this._dataList=await this.getSysDictionaryCacheCommonModel())}finally{this._lock=null}})(),await this._lock),this._dataList===void 0&&(this._dataList=[]),this._dataList}}const i=class i extends u{constructor(){super(i._lock);e(this,"code","image_types")}async getDataListSelect(){return(await this.getDataList()).map(s=>({label:s.name,value:s.value,name:s.code}))}};e(i,"_lock",null);let o=i;const n=class n extends u{constructor(){super(n._lock);e(this,"code","tenant")}async getDataListSelect(){return(await this.getDataList()).map(s=>({label:s.name,value:s.value,name:s.code}))}};e(n,"_lock",null);let l=n;class r{}e(r,"appDictionaryImageCache",new o),e(r,"appDictionaryTenantCache",new l);export{r as A};