You cannot 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
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{V as d}from"./vue-aEZWZQSa.js";import{be as f,ax as e}from"./entry/index-2-yrRtrk-1723018314898.js";function a(t){return t.map(i=>({label:i.dictLabel,value:i.dictValue}))}const h=d("dict",{state:()=>({dictMap:new Map,dictOptionsMap:new Map}),getters:{getDictMap(t){return t.dictMap},getDictOptionsMap(t){return t.dictOptionsMap}},actions:{setDictInfo(t,i){this.dictMap.set(t,i),this.dictOptionsMap.set(t,a(i))},getDict(t){return t?(this.dictMap.has(t)||this.dictMap.set(t,[]),this.dictMap.get(t)):[]},getDictOptions(t){return t?(this.dictOptionsMap.has(t)||this.dictOptionsMap.set(t,[]),this.dictOptionsMap.get(t)):[]},resetCache(){this.dictMap.clear(),this.dictOptionsMap.clear()}}});function c(){return h(f)}function p(t){return e.get({url:"/system/dict/data/type/"+t},{ignoreCancelToken:!0})}function D(t){return e.get({url:"/system/dict/data/list",params:t})}function M(){return e.post({url:"/system/dict/data/export",responseType:"blob"},{isTransformResponse:!1})}function O(t){return e.deleteWithMsg({url:"/system/dict/data/"+t})}function y(t){return e.postWithMsg({url:"/system/dict/data",data:t})}function b(t){return e.putWithMsg({url:"/system/dict/data",data:t})}function I(t){return e.get({url:"/system/dict/data/"+t})}const n=new Map;function x(t){const{getDict:i,setDictInfo:r}=c(),s=i(t);return s.length===0&&(n[t]||(n[t]=p(t).then(o=>{r(t,o),s.push(...o),n.delete(t)}))),s}function L(t){const{getDictOptions:i,setDictInfo:r}=c(),s=i(t);return s.length===0&&(n[t]||(n[t]=p(t).then(o=>{r(t,o);const u=a(o);s.push(...u),n.delete(t)}))),s}export{x as a,M as b,O as c,D as d,I as e,b as f,L as g,y as h};
|