enumMap.js 523 B

123456789101112131415161718
  1. import { defineStore } from 'pinia'
  2. import businessDEl from '@/api/business/dictionary.js'
  3. export const enumMaplistStore = defineStore('enumMaplist', () => {
  4. // 定义state
  5. const enumMaplist = ref(JSON.parse(localStorage.getItem('enumMaplist')) || [])
  6. const businessDElasync = async () => {
  7. const res = await businessDEl.getPersionsDEl()
  8. enumMaplist.value = []
  9. enumMaplist.value = res
  10. localStorage.setItem('enumMaplist', JSON.stringify(res))
  11. console.log(res)
  12. }
  13. return { enumMaplist, businessDElasync }
  14. })