24 lines
585 B
JavaScript
Raw Normal View History

2026-01-21 10:35:08 +08:00
import { ref } from "vue";
import { defineStore } from "pinia";
import api from '@/utils/api';
export default defineStore("dbStore", () => {
const jobMap = ref({})
async function getJobs() {
const res = await api('getCorpMemberJob', {}, false);
if (res && res.success) {
const arr = Array.isArray(res.data) ? res.data : [];
jobMap.value = arr.reduce((map, item) => {
if (item.name && item.value) {
map[item.value] = item.name
}
return map
}, {})
}
console.log(jobMap.value)
}
return { jobMap, getJobs }
})