修改诊断时间查询字段

This commit is contained in:
Euni4U 2024-12-09 17:52:01 +08:00
parent 07ed2e9c95
commit 89bf1116bc
2 changed files with 33 additions and 20 deletions

View File

@ -82,7 +82,7 @@ export const EcganalysisparasApi = {
return await request.get({ url: `/tblist/ecganalysisparas/list?regId=${regId}&orgId=${orgId}` })
},
// 获取开始和结束时间的心电分析数据记录
getDateStaAndEndData: async (orgId:String,startDate:String,endDate:String) => {
return await request.get({ url: `/tblist/ecganalysisparas/getDateStaAndEndData?orgId=${orgId}&TimeSta=${startDate}&TimeEnd=${endDate}` })
getDateStaAndEndData: async (doctorName:String,startDate:String,endDate:String) => {
return await request.get({ url: `/tblist/ecganalysisparas/getDateStaAndEndData?doctorName=${doctorName}&TimeSta=${startDate}&TimeEnd=${endDate}` })
},
}

View File

@ -63,13 +63,13 @@ const disabledDate = (time: Date) => {
return time.getTime() > today.getTime()
}
//
//
const generateDateArray = (startDate: Date, endDate: Date) => {
const dates = []
let currentDate = new Date(startDate)
while (currentDate <= endDate) {
dates.push(currentDate.toLocaleDateString('zh-CN', { month: '2-digit', day: '2-digit' }))
dates.push(formatDate(currentDate)) // 使 formatDate
currentDate = new Date(currentDate.setDate(currentDate.getDate() + 1))
}
return dates
@ -86,7 +86,7 @@ async function getdata() {
const startDate = `${formatDate(value.value[0])} 00:00:00`
const endDate = `${formatDate(value.value[1])} 23:59:59`
const data = await EcganalysisparasApi.getDateStaAndEndData(Profilevo.value.orgId, startDate, endDate)
const data = await EcganalysisparasApi.getDateStaAndEndData(Profilevo.value.doctorname, startDate, endDate)
cachedData.value = data //
updateChartWithData(data)
}
@ -102,7 +102,21 @@ const updateChartWithData = (data: any[]) => {
xAxis: {
data: dateArray
},
yAxis: {},
yAxis: {
type: 'value',
name: '诊断数量',
minInterval: 1, // 1
min: 0, // 0
axisLabel: {
formatter: '{value}'
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed'
}
}
},
series: [
{
name: '诊断数量',
@ -130,11 +144,19 @@ const handleDateChange = (val: [Date, Date]) => {
value.value = [val[0], new Date(val[0].getTime() + 7 * 24 * 3600 * 1000 - 1)]
}
updateChart() // 使
}
}
//
//
const formatDate = (date: Date) => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
//
const calculateDailyDiagnosisCounts = (data: any[], dateArray: string[]) => {
//
const countMap = {}
@ -145,32 +167,23 @@ const calculateDailyDiagnosisCounts = (data: any[], dateArray: string[]) => {
//
data.forEach(item => {
const date = new Date(item.doctorDiagTime)
const dateStr = date.toLocaleDateString('zh-CN', { month: '2-digit', day: '2-digit' })
const dateStr = formatDate(date) // 使
if (countMap[dateStr] !== undefined) {
countMap[dateStr]++
}
})
//
return dateArray.map(date => countMap[date])
}
//
const formatDate = (date: Date) => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
// onMounted
onMounted(() => {
getlogininfo()
// 7
const endDate = new Date()
const startDate = new Date(endDate.getTime() - 7 * 24 * 3600 * 1000)
const startDate = new Date(endDate.getTime() - 6 * 24 * 3600 * 1000)
value.value = [startDate, endDate]
updateChart()
})
</script>