diff --git a/src/views/sta/index.vue b/src/views/sta/index.vue index 32a47c9..8136104 100644 --- a/src/views/sta/index.vue +++ b/src/views/sta/index.vue @@ -2,20 +2,23 @@ + + {{item.label}} + - - 查询 - @@ -53,6 +56,7 @@ import {StatisticsApi} from "@/api/inspect/statistics"; import dayjs from "dayjs"; import {PatientApi} from "@/api/inspect/inspectpatient"; +import {formatDate} from "@/utils/formatTime"; const time = ref() // 日期 const data = ref([ @@ -81,6 +85,13 @@ const data = ref([ }, ])*/ const data1 = ref([]) +const radioSelector = ref([ + {value:1,label:'全部'}, + {value:2,label:'今天'}, + {value:3,label:'最近一周'}, + {value:4,label:'最近一个月'}, +]) +const radioType = ref(3) // const shortcuts = [ { text: '最近一周', @@ -109,6 +120,29 @@ const shortcuts = [ }, }, ] +/** + * 改变单选框 + * @param e + */ +const changeRadio = (e) => { + let end = new Date() + let start = new Date() + let date = null + switch (e){ + case 1 : date = [];break + case 2 : break + case 3 : start.setDate(start.getDate() - 7);break + case 4 : start.setMonth(start.getMonth() - 1);break + default : start.setDate(start.getDate() -7) + } + console.log(time.value) + time.value = [formatDate(start,'YYYY-MM-DD'),formatDate(end,'YYYY-MM-DD')] + getList() +} +const changeDatePick = () => { + radioType.value = null + getList() +} /** * 获取统计数据 */ @@ -158,6 +192,7 @@ const dataProcessing = (data) => { } onMounted(()=>{ getList() + changeRadio(3) })