import type { DeptTreeNode } from '@/views/system/dept/dept-interface'

const useDictStore = defineStore(
  'dict',
  {
    state: () => ({
      allDeptList: [] as DeptTreeNode[], // 所有部门列表
      companyList: [] as DeptTreeNode[], // 公司列表
    }),
    getters: {
      getAllDeptList: (state) => {
        return state.allDeptList
      },
      getCompanyList: (state) => {
        return state.companyList
      },
    },
    actions: {
      setAllDeptList(list: DeptTreeNode[]) {
        this.allDeptList = list
      },
      setAllCompanyList(list: DeptTreeNode[]) {
        this.allDeptList = list
      },
    },
  },
)

export default useDictStore
