moreShopAdmin/build/admin/assets/useDictOptions.0a19781c.js

2 lines
551 B
JavaScript
Raw Normal View History

2024-09-19 15:29:18 +08:00
import{g as l}from"./index.b73336f2.js";import{Z as u,t as D}from"./@vue.18505fe0.js";function y(s){const a=u({}),e=Object.keys(s),c=e.map(n=>{const t=s[n];return a[n]=[],()=>t.api(D(t.params)||{})}),o=async()=>{(await Promise.allSettled(c.map(t=>t()))).forEach((t,f)=>{const r=e[f];if(t.status=="fulfilled"){const{transformData:i}=s[r],p=i?i(t.value):t.value;a[r]=p}})};return o(),{optionsData:a,refresh:o}}function v(s){const a=u({}),e=async()=>{const c=await l({type:s});Object.assign(a,c)};return e(),{dictData:a,refresh:e}}export{y as a,v as u};