You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

queryKey.js 769B

12345678910111213141516171819202122232425262728293031
  1. import {
  2. getItem
  3. } from "@/utils/storage";
  4. /*通过字典type取Name*/
  5. export const getCodeName = (type, code) => {
  6. var data = getItem('key')
  7. if (!data || !data[type]) return ""
  8. let types = data[type].filter(item => item.code == code);
  9. if (types[0] && types) {
  10. return types[0] ? types[0].name : ''
  11. }
  12. }
  13. /*通过字典type取Code*/
  14. export const getNameCode = (type, name) => {
  15. var data = getItem('key')
  16. if (!data || !data[type]) return ""
  17. let types = data[type].filter(item => item.name == name);
  18. if (types[0] && types) {
  19. return types[0] ? types[0].code : ''
  20. }
  21. }
  22. /*通过字典type取字典*/
  23. export const getDicWithType = (type) => {
  24. var data = getItem('key')
  25. if (!data || !data[type]) return []
  26. return data[type];
  27. }