import{ad as t,r as e,ae as i}from"./index-Bf8mw6fQ.js";const a=t("dict",{state:()=>({dict:new Array}),actions:{getDict(t){if(null==t&&""==t)return null;try{for(let e=0;e<this.dict.length;e++)if(this.dict[e].key==t)return this.dict[e].value}catch(e){return null}},setDict(t,e){null!==t&&""!==t&&this.dict.push({key:t,value:e})},removeDict(t){var e=!1;try{for(let e=0;e<this.dict.length;e++)if(this.dict[e].key==t)return this.dict.splice(e,1),!0}catch(i){e=!1}return e},cleanDict(){this.dict=new Array},initDict(){}}});async function c(...t){const c=e({});for(const e of t){c.value[e]=[];const t=a().getDict(e);if(t)c.value[e]=t;else try{const t=await uni.$uapi.get("/system/dict/data/type/"+e);c.value[e]=t.data.map(t=>({label:t.dictLabel,value:t.dictValue,elTagType:t.listClass,elTagClass:t.cssClass})),a().setDict(e,c.value[e])}catch(s){console.error(`Failed to fetch dict ${e}:`,s)}}return i(c.value)}export{c as u};
|