'use strict';

var vue = require('vue');
var pinia = require('pinia');
require('../../../api/productCenter/index.js');
var core = require('@vueuse/core');
var useGetCompanyCategoryTree = require('../../../api/productCenter/categoryManage/useGetCompanyCategoryTree.js');

const useCompanyCategoryListStore = pinia.defineStore("gmCompanyCategoryList", () => {
  const { isLoading, exec, data: companyCategoryListData } = useGetCompanyCategoryTree.useGetCompanyCategoryTree();
  const companyCategoryList = vue.computed(() => companyCategoryListData.value?.data ?? []);
  const getCompanyCategoryList = async () => {
    if (companyCategoryList.value.length !== 0 || isLoading.value) {
      return;
    }
    return exec();
  };
  core.tryOnMounted(() => {
    getCompanyCategoryList();
  });
  return {
    companyCategoryList,
    isLoading,
    getCompanyCategoryList
  };
});

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