import { listDept } from '@/api/system/dept'; // 部门 import { listUser } from '@/api/system/user'; import { handleTree } from '@/utils/ruoyi'; const useOrderStore = defineStore('order', { state: () => { return { deptList: [], userList: [], }; }, actions: { getDeptList(data = {}) { /* { deptName: undefined, status: undefined, } */ listDept(data).then(response => { this.deptList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listDept ~ this.deptList:', this.deptList, response); }); }, getUserList(data = {}) { listUser(data).then(response => { this.userList = handleTree(response.data, 'deptId'); console.log('🚀 ~ listUser ~ this.userList:', this.userList, response); }); }, }, }); export default useOrderStore;