版本更新
This commit is contained in:
21
openhis-ui-vue3/src/template/useOptionsList.js
Normal file
21
openhis-ui-vue3/src/template/useOptionsList.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user