'use strict';

var vue = require('vue');
var pinia = require('pinia');
var core = require('@vueuse/core');
require('../../../../api/guardBasic/controller/index.js');
var usePostBasicV1OrgDeptList = require('../../../../api/guardBasic/controller/JiChuFuWu/ZuZhiGuanLi/usePostBasicV1OrgDeptList.js');

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

exports.useOrgTreeListStore = useOrgTreeListStore;
//# sourceMappingURL=index.js.map
