| | |
| | | let checked = ref('today'); |
| | | |
| | | let timeClick = (item, index) => { |
| | | checked.value = item; |
| | | // dateRange.value = dateRanges[item]; |
| | | dateRange.value = []; |
| | | // emit('change', dateRanges[item],timeListEnum[index]); |
| | | searchForm.date_enum = timeListEnum[index]; |
| | | handleSearch(); |
| | | if (checked.value === item){ |
| | | checked.value = null |
| | | searchForm.date_enum = undefined |
| | | }else{ |
| | | checked.value = item |
| | | searchForm.date_enum = timeListEnum[index] |
| | | } |
| | | dateRange.value = [] |
| | | handleSearch() |
| | | }; |
| | | // 搜索 |
| | | const handleSearch = () => { |
| | |
| | | emit('search', params); |
| | | }; |
| | | const handleDateChange = val => { |
| | | if (val && val.length === 2) { |
| | | const start = dayjs(val[0]); |
| | | const end = dayjs(val[1]); |
| | | const diff = end.diff(start, 'day'); |
| | | |
| | | if (diff > 31) { |
| | | ElMessage.warning('日期范围不能超过31天'); |
| | | dateRange.value = []; |
| | | return; |
| | | } |
| | | } |
| | | handleSearch(); |
| | | checked.value = null |
| | | searchForm.date_enum = undefined |
| | | }; |
| | | |
| | | // 重置 |
| | |
| | | // watch( |
| | | // () => store.state.task.jumpTask, |
| | | // newVal => { |
| | | |
| | | |
| | | // if (newVal && Object.keys(newVal).length) { |
| | | // // 兼容当日任务 计划任务 历史任务传参 |
| | | // if (newVal.clickValue) { |
| | |
| | | const date = dayjs(calendarday.value).format(timeFormat); |
| | | |
| | | const dateArray = [date, date]; |
| | | |
| | | |
| | | dateRange.value = dateArray; |
| | | } |
| | | // 查询一次 |