import { getListWithOptionList } from '@/views/basicmanage/caseTemplatesStatistics/api';
import { onMounted, ref } from 'vue';
const statisticsOptionList = ref([]);
const initStatic = async () => {
  try {
    const res = await getListWithOptionList();
    statisticsOptionList.value = res.data;
  } catch (error) {
    console.log(error);
  }
};
export default function useOptionsList() {
  initStatic();
  const getStatisticsOptionList = (code) => {
    return statisticsOptionList.value.find((item) => item.code === code)?.optionList || [];
  };
  return {
    statisticsOptionList,
    getStatisticsOptionList,
  };
}
