HuanMengAdmin/admin-client/dist/static/js/AppDictionaryCache-W9MkSZG1.js
2024-08-05 14:03:42 +08:00

2 lines
4.4 KiB
JavaScript

var $=Object.defineProperty;var k=(n,t,a)=>t in n?$(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var s=(n,t,a)=>k(n,typeof t!="symbol"?t+"":t,a);import{S as P}from"./SysDictionaryService-CkkUcfd5.js";import{H as i}from"./index-mXGxF4sR.js";class l{constructor(t){s(this,"_lock",null);s(this,"_dataList");this._lock=t}async getSysDictionaryService(){return(await P.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 x=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 L=u;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_Type");const d=class d extends l{constructor(){super(d._lock);s(this,"code","types")}async getSysDictionaryService(){return(await y.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 v=d;class w{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(w,"urlPrefix","/api/v1/admin/T_Character_Personality");const _=class _ extends l{constructor(){super(_._lock);s(this,"code","personality")}async getSysDictionaryService(){return(await w.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(_,"_lock",null);let h=_;class S{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(S,"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 S.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 m=f;const p=class p extends l{constructor(){super(p._lock);s(this,"code","categorymenu_actiontype")}async getDataListSelect(){return(await this.getDataList()).map(e=>({label:e.name,value:e.value,name:e.code}))}};s(p,"_lock",null);let g=p;class c{}s(c,"appDictionaryImageCache",new x),s(c,"appDictionaryTenantCache",new L),s(c,"appDictionaryPersonalitysCache",new h),s(c,"appDictionaryTypesCache",new v),s(c,"appDictionaryLablesCache",new m),s(c,"appDictionaryActionTypeCache",new g);export{c as A,S as T,w as a,y as b};