2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
var M=Object.defineProperty;var P=(o,e,a)=>e in o?M(o,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[e]=a;var s=(o,e,a)=>P(o,typeof e!="symbol"?e+"":e,a);import{S as b}from"./SysDictionaryService-CoxT7Yam.js";import{da as i,au as T}from"./index-D2_T1wn8.js";import{T as N}from"./T_Game_TypesService-O6BewZrT.js";import{T as F}from"./T_Game_TagsService-BMaG5ygF.js";class c{constructor(e){s(this,"_lock",null);s(this,"_dataList");this._lock=e}async getSysDictionaryService(){return(await b.getDictionaryByCode(this.code)).data}async getSysDictionaryCacheCommonModel(){const e=await this.getSysDictionaryService();try{return e.map(a=>{const t=isNaN(Number(a.value))?a.value:Number(a.value);return{name:a.name,value:t,code:a.code}})}catch{return e.data.map(a=>{const t=isNaN(Number(a.value))?a.value:Number(a.value);return{name:a.name,value:t,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 p=class p extends c{constructor(){super(p._lock);s(this,"code","image_types")}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.code}))}};s(p,"_lock",null);let D=p;class S{constructor(e){s(this,"urlPrefix");this.urlPrefix=e}findList(e,a,t={},n=[]){return i.post(`${this.urlPrefix}/findList`,{page:e,size:a,search:t,searchSort:n})}getFindList(){return i.get(`${this.urlPrefix}/findList`)}deleteList(e){return i.post(`${this.urlPrefix}/deleteList`,e)}findForm(e){return i.get(`${this.urlPrefix}/findForm${e?"/"+e:""}`)}saveForm(e,a){return i.post(`${this.urlPrefix}/${e?"update":"create"}`,a)}exportExcel(e={},a=[]){return i.download(`${this.urlPrefix}/exportExcel`,{page:-1,size:-1,search:e,searchSort:a})}getOrderId(e,a,t){return i.get(`${this.urlPrefix}/getOrderId?selectName=${e}&orderIdName=${a}&value=${t}`)}}class E extends S{constructor(e){super(e)}}class I{static getAppServer(e){this.appCommonServerMap||(this.appCommonServerMap=new Map);var a=this.appCommonServerMap.get(e);return a!=null||(a=new E(e),this.appCommonServerMap.set(e,a)),a}}s(I,"appCommonServerMap",new Map);class z extends S{constructor(){console.log("执行构造函数"),super("/api/v1/admin/Game/T_Epg_CategoryCfg")}GetEpgCategoryCfgIndex(e){return i.get(`${this.urlPrefix}/GetEpgCategoryCfgIndex${e?"/"+e:""}`)}}const O=new z,g=class g extends c{constructor(){super(g._lock);s(this,"code","AppDictionaryEpgCache");s(this,"_epgData",[])}async getSysDictionaryCacheCommonModel(){if(this._epgData==null||this._epgData==null||this._epgData.length==0){const a=await O.getFindList();console.log(a),this._epgData=a.data}return this._epgData.map(a=>({name:a.name,value:a.id,code:a.idName}))}async getCategoryCfg(a){(this._epgData==null||this._epgData==null||this._epgData.length==0)&&await this.getSysDictionaryCacheCommonModel();let t=[];if(a==null||a=="")t=this._epgData.filter(n=>n.epgParentCategory==0);else{let n=this._epgData.find(l=>l.idName==a);n!=null&&(t=this._epgData.filter(l=>l.epgParentCategory==n.id))}return t.map(n=>({name:n.name,value:n.id,code:n.idName}))}async getCategoryCfgSelect(a){return(await this.getCategoryCfg(a)).map(n=>({label:n.name,value:n.value,code:n.code}))}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.name}))}};s(g,"_lock",null);let _=g;class k{static findList(e,a,t={},n=[]){return i.post(`${this.urlPrefix}/findList`,{page:e,size:a,search:t,searchSort:n})}static deleteList(e){return i.post(`${this.urlPrefix}/deleteList`,e)}static findForm(e){return i.get(`${this.urlPrefix}/findForm${e?"/"+e:""}`)}static getImageList(e){return i.get(`${this.urlPrefix}/GetImageList${e?"/"+e:""}`)}static findImageForm(e,a){return i.get(`${this.urlPrefix}/findImageForm/${a}/${e}`)}static saveForm(e,a){return i.post(`${this.urlPrefix}/${e?"updateImage":"createImage"}`,a)}static exportExcel(e={},a=[]){return i.download(`${this.urlPrefix}/exportExcel`,{page:-1,size:-1,search:e,searchSort:a})}static getImageUrl(e,a,t){return`${T.domainServerApi}${this.urlPrefix}/GetImageUrl/${e}/${a}/${t?1:0}`}}s(k,"urlPrefix","/api/v1/admin/Game/T_App_Image");const d=class d extends c{constructor(a){super(d._lock);s(this,"code","AppDictionaryImageInfoCache");s(this,"imageType",1);s(this,"_ImageData",[]);this.imageType=a}async getSysDictionaryCacheCommonModel(){if(this._ImageData==null||this._ImageData==null||this._ImageData.length==0){const a=await k.getImageList(this.imageType);console.log(a),this._ImageData=a.data}return this._ImageData.map(a=>({name:a.name,value:a.imageId,code:a.imageId}))}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.name}))}};s(d,"_lock",null);let L=d;const m=class m extends c{constructor(a,t){super(m._lock);s(this,"code","AppDictionaryServerCache");s(this,"server");s(this,"nameKey");s(this,"_data",[]);this.server=a,this.nameKey=t}async getSysDictionaryCacheCommonModel(){if(this._data==null||this._data==null||this._data.length==0){const a=await this.server.getFindList();console.log(a),this._data=a.data}return this._data.map(a=>({name:a[this.nameKey],value:a.id,code:a.id}))}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.name}))}};s(m,"_lock",null);let C=m;class B extends S{constructor(){console.log("执行构造函数"),super("/api/v1/admin/Game/T_Game_List")}}const K=new B,h=class h extends c{constructor(){super(h._lock);s(this,"code","AppDictionaryGameCache")}async getSysDictionaryCacheCommonModel(){const a=await K.getFindList();return console.log(a),a.data.map(t=>({name:t.gameName,value:t.gameId,code:t.id}))}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.name}))}};s(h,"_lock",null);let w=h;const y=class y extends c{constructor(){super(y._lock);s(this,"code","AppDictionaryGameTypeCache")}async getSysDictionaryCacheCommonModel(){const a=await N.getFindList();return console.log(a),a.data.map(t=>({name:t.typeName,value:t.typeId,code:t.typeId}))}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.name}))}};s(y,"_lock",null);let u=y;class G extends c{constructor(){super(u._lock);s(this,"code","AppDictionaryGameTagCache")}async getSysDictionaryCacheCommonModel(){const a=await F.getFindList();return console.log(a),a.data.map(t=>({name:t.tagName,value:t.tagId,code:t.tagId}))}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.name}))}}s(G,"_lock",null);class f extends c{constructor(a){super(null);s(this,"code","");this.code=a}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.code}))}}const v=class v extends c{constructor(){super(v._lock);s(this,"code","language")}async getDataListSelect(){return(await this.getDataList()).map(t=>({label:t.name,value:t.value,name:t.code}))}};s(v,"_lock",null);let x=v;const r=class r{static getAppDictionary(e){r.appDictionaryCacheList||(r.appDictionaryCacheList=new Map);var a=r.appDictionaryCacheList.get(e);return a!=null||(e=="AppDictionaryGameCache"?a=new w:e=="appDictionaryImagesubscriptCache"?a=new L(2):a=new f(e),r.appDictionaryCacheList.set(e,a)),a}static getAppDictionaryServer(e,a,t="name"){r.appDictionaryCacheList||(r.appDictionaryCacheList=new Map);var n=r.appDictionaryCacheList.get(e);if(n!=null)return n;let l=I.getAppServer(a);return n=new C(l,t),r.appDictionaryCacheList.set(e,n),n}};s(r,"appDictionaryImageCache",new D),s(r,"appDictionaryImagesubscriptCache",r.getAppDictionary("appDictionaryImagesubscriptCache")),s(r,"appDictionaryLanguageCache",new x),s(r,"appDictionaryGameTypeCache",new u),s(r,"appDictionaryGameTagCache",new G),s(r,"appDictionaryGameOperationModelCache",new f("GameOperationModel")),s(r,"appDictionaryGameIssuerCache",r.getAppDictionary("GameIssuer")),s(r,"appDictionaryGameDCompanyCache",new f("GameDCompany")),s(r,"appDictionaryCacheList",new Map),s(r,"appDictionaryGameCache",r.getAppDictionary("AppDictionaryGameCache")),s(r,"appDictionaryEpgCache",new _);let $=r;export{$ as A,S as B,K as T,k as a,O as b};
|