pension-vue/src/composables/useNursing.ts

22 lines
704 B
TypeScript

import { getNursingHomeList, getNursingDetail } from "@/api/interfaceDocument";
import { getRequest } from "@/api/customFetch";
export const useNursingHomeList = () => {
const nursingHomeList = ref<any[]>([]);
getRequest(getNursingHomeList()).then(resp => {
if(resp.code === 200){
nursingHomeList.value = (resp.result as { list: any[] }).list;
}
});
return {nursingHomeList}
}
export const useNursingDetail = () => {
const nursingDetail = ref<any>({});
getRequest(getNursingDetail()).then(resp => {
if(resp.code === 200){
nursingDetail.value = (resp.result as { data: any }).data;
}
});
return { nursingDetail };
}