index.js 392 B

123456789101112131415
  1. /** @format */
  2. import { getDictConfig } from "@/api/login";
  3. export async function useDict(...args) {
  4. let dictList = [];
  5. for (let key of args) {
  6. dictList.push(getDictConfig({ key }));
  7. }
  8. let syncRes = await Promise.all(dictList);
  9. return syncRes[0].data;
  10. }
  11. export function paraseDict(dictList, value) {
  12. return dictList.filter((dict) => dict.dictValue == value)[0].dictLabel;
  13. }