修改工作量代码部分参数命名
This commit is contained in:
parent
89bf1116bc
commit
fc88749e3b
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user