From fc88749e3b5333a9aa92a6b9e0aadc8306c62d04 Mon Sep 17 00:00:00 2001 From: Euni4U <958079825@qq.com> Date: Mon, 9 Dec 2024 19:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E9=87=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=83=A8=E5=88=86=E5=8F=82=E6=95=B0=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ECG/ECGStat/statdiagnosis.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/ECG/ECGStat/statdiagnosis.vue b/src/views/ECG/ECGStat/statdiagnosis.vue index 1814086f..e1d37c87 100644 --- a/src/views/ECG/ECGStat/statdiagnosis.vue +++ b/src/views/ECG/ECGStat/statdiagnosis.vue @@ -3,7 +3,7 @@
({} as ProfileVO) //当前登录人信息 const endDate = new Date() const startDate = new Date(endDate.getTime() - 7 * 24 * 3600 * 1000) -const value = ref<[Date, Date]>([startDate, endDate]) +const Date_value = ref<[Date, Date]>([startDate, endDate]) const getlogininfo = async () => { Profilevo.value = await getUserProfile() } @@ -44,12 +44,12 @@ const defaultTime = ref<[Date, Date]>([ // 修改日期限制函数 const disabledDate = (time: Date) => { - if (value.value && value.value[0]) { - const start = value.value[0] + if (Date_value.value && Date_value.value[0]) { + const start = Date_value.value[0] const diff = 7 * 24 * 3600 * 1000 // 如果是选择开始日期 - if (!value.value[1]) { + if (!Date_value.value[1]) { const today = new Date() return time.getTime() > today.getTime() } @@ -83,8 +83,8 @@ const cachedData = ref([]) // 修改 getdata 函数 async function getdata() { - const startDate = `${formatDate(value.value[0])} 00:00:00` - const endDate = `${formatDate(value.value[1])} 23:59:59` + const startDate = `${formatDate(Date_value.value[0])} 00:00:00` + const endDate = `${formatDate(Date_value.value[1])} 23:59:59` const data = await EcganalysisparasApi.getDateStaAndEndData(Profilevo.value.doctorname, startDate, endDate) cachedData.value = data // 保存数据 @@ -93,7 +93,7 @@ async function getdata() { // 新增处理图表更新的方法 const updateChartWithData = (data: any[]) => { - const dateArray = generateDateArray(value.value[0], value.value[1]) + const dateArray = generateDateArray(Date_value.value[0], Date_value.value[1]) const countArray = calculateDailyDiagnosisCounts(data, dateArray) const myChart = echarts.init(document.getElementById('main')) @@ -141,7 +141,7 @@ const handleDateChange = (val: [Date, Date]) => { const diff = val[1].getTime() - val[0].getTime() if (diff > 7 * 24 * 3600 * 1000) { // 如果选择范围超过7天,自动调整结束日期 - value.value = [val[0], new Date(val[0].getTime() + 7 * 24 * 3600 * 1000 - 1)] + Date_value.value = [val[0], new Date(val[0].getTime() + 7 * 24 * 3600 * 1000 - 1)] } @@ -182,7 +182,7 @@ onMounted(() => { // 设置默认时间范围为当前日期往前7天 const endDate = new Date() const startDate = new Date(endDate.getTime() - 6 * 24 * 3600 * 1000) - value.value = [startDate, endDate] + Date_value.value = [startDate, endDate] })