import { computed } from 'vue';
import { defineStore } from 'pinia';
import { tryOnMounted } from '@vueuse/core';
import '../../../../api/guardBasic/controller/index.mjs';
import { usePostBasicV1OrgDeptList } from '../../../../api/guardBasic/controller/JiChuFuWu/ZuZhiGuanLi/usePostBasicV1OrgDeptList.mjs';

const useOrgTreeListStore = defineStore("gmOrgTreeList", () => {
  const { isLoading, exec, data } = usePostBasicV1OrgDeptList();
  const orgTreeList = computed(() => data.value?.data || []);
  const getOrgTreeList = async () => {
    if (orgTreeList.value.length !== 0 || isLoading.value) {
      return;
    }
    return exec({ status: 1 });
  };
  tryOnMounted(() => {
    getOrgTreeList();
  });
  return {
    orgTreeList,
    isLoading,
    getOrgTreeList
  };
});

export { useOrgTreeListStore };
//# sourceMappingURL=index.mjs.map
