HuanMengAdmin/admin-client/dist/static/js/AppDictionaryCache-BSp0bywC.js
2024-07-29 21:15:09 +08:00

2 lines
4.1 KiB
JavaScript

var S=Object.defineProperty;var w=(n,t,a)=>t in n?S(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var s=(n,t,a)=>w(n,typeof t!="symbol"?t+"":t,a);import{S as $}from"./SysDictionaryService-Das48zJi.js";import{H as i}from"./index-CtHIQ-BT.js";class l{constructor(t){s(this,"_lock",null);s(this,"_dataList");this._lock=t}async getSysDictionaryService(){return(await $.getDictionaryByCode(this.code)).data}async getSysDictionaryCacheCommonModel(){return(await this.getSysDictionaryService()).map(a=>{const e=isNaN(Number(a.value))?a.value:Number(a.value);return{name:a.name,value:e,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 o=class o extends l{constructor(){super(o._lock);s(this,"code","image_types")}async getDataListSelect(){return(await this.getDataList()).map(e=>({label:e.name,value:e.value,name:e.code}))}};s(o,"_lock",null);let _=o;const u=class u extends l{constructor(){super(u._lock);s(this,"code","tenant")}async getDataListSelect(){return(await this.getDataList()).map(e=>({label:e.name,value:e.value,name:e.code}))}};s(u,"_lock",null);let x=u;class m{static findList(t,a,e={},r=[]){return i.post(`${this.urlPrefix}/findList`,{page:t,size:a,search:e,searchSort:r})}static deleteList(t){return i.post(`${this.urlPrefix}/deleteList`,t)}static findForm(t){return i.get(`${this.urlPrefix}/findForm${t?"/"+t:""}`)}static saveForm(t,a){return i.post(`${this.urlPrefix}/${t?"update":"create"}`,a)}static exportExcel(t={},a=[]){return i.download(`${this.urlPrefix}/exportExcel`,{page:-1,size:-1,search:t,searchSort:a})}}s(m,"urlPrefix","/api/v1/admin/T_Character_Type");const d=class d extends l{constructor(){super(d._lock);s(this,"code","types")}async getSysDictionaryService(){return(await m.findList(1,9999,{},[])).data.dataSource.map(r=>({name:r.name,value:r.id,code:""}))}async getDataListSelect(){return(await this.getDataList()).map(e=>({label:e.name,value:e.value,name:e.code}))}};s(d,"_lock",null);let h=d;class g{static findList(t,a,e={},r=[]){return i.post(`${this.urlPrefix}/findList`,{page:t,size:a,search:e,searchSort:r})}static deleteList(t){return i.post(`${this.urlPrefix}/deleteList`,t)}static findForm(t){return i.get(`${this.urlPrefix}/findForm${t?"/"+t:""}`)}static saveForm(t,a){return i.post(`${this.urlPrefix}/${t?"update":"create"}`,a)}static exportExcel(t={},a=[]){return i.download(`${this.urlPrefix}/exportExcel`,{page:-1,size:-1,search:t,searchSort:a})}}s(g,"urlPrefix","/api/v1/admin/T_Character_Personality");const p=class p extends l{constructor(){super(p._lock);s(this,"code","personality")}async getSysDictionaryService(){return(await g.findList(1,9999,{},[])).data.dataSource.map(r=>({name:r.name,value:r.id,code:r.value}))}async getDataListSelect(){return(await this.getDataList()).map(e=>({label:e.name,value:e.value,name:e.code}))}};s(p,"_lock",null);let L=p;class y{static findList(t,a,e={},r=[]){return i.post(`${this.urlPrefix}/findList`,{page:t,size:a,search:e,searchSort:r})}static deleteList(t){return i.post(`${this.urlPrefix}/deleteList`,t)}static findForm(t){return i.get(`${this.urlPrefix}/findForm${t?"/"+t:""}`)}static saveForm(t,a){return i.post(`${this.urlPrefix}/${t?"update":"create"}`,a)}static exportExcel(t={},a=[]){return i.download(`${this.urlPrefix}/exportExcel`,{page:-1,size:-1,search:t,searchSort:a})}}s(y,"urlPrefix","/api/v1/admin/T_Character_Label");const f=class f extends l{constructor(){super(f._lock);s(this,"code","personality")}async getSysDictionaryService(){return(await y.findList(1,9999,{},[])).data.dataSource.map(r=>({name:r.labelName,value:r.id,code:r.labelValue}))}async getDataListSelect(){return(await this.getDataList()).map(e=>({label:e.name,value:e.value,name:e.code}))}};s(f,"_lock",null);let v=f;class c{}s(c,"appDictionaryImageCache",new _),s(c,"appDictionaryTenantCache",new x),s(c,"appDictionaryPersonalitysCache",new L),s(c,"appDictionaryTypesCache",new h),s(c,"appDictionaryLablesCache",new v);export{c as A,y as T,g as a,m as b};