修改工作量代码部分参数命名

This commit is contained in:
Euni4U 2024-12-09 19:16:13 +08:00
parent 89bf1116bc
commit fc88749e3b

View File

@ -3,7 +3,7 @@
<div class="demo-date-picker">
<div class="block">
<el-date-picker
v-model="value"
v-model="Date_value"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
@ -32,7 +32,7 @@ import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
const Profilevo = ref<ProfileVO>({} 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<any[]>([])
// 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]
})
</script>