WXL
5 天以前 871522ed7e06fd9c62a87c178d7f5c88d7853a20
1
import{an as t,r as e,ao as i}from"./index-DF3kK8Jo.js";const s=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=s().getDict(e);if(t)c.value[e]=t;else try{const t=await uni.$uapi.get("/project/dict/data/type/"+e);c.value[e]=t.map(t=>({label:t.dictLabel,value:t.dictValue,elTagType:t.listClass,elTagClass:t.cssClass})),s().setDict(e,c.value[e])}catch(a){console.error(`Failed to fetch dict ${e}:`,a)}}return console.log(c.value.sys_user_sex,"2"),i(c.value)}export{c as u};