|
|
@ -138,6 +138,7 @@ import GuipRadio from '@/components/GuipRadio'; |
|
|
import GuipInput from '@/components/GuipInput.vue'; |
|
|
import GuipInput from '@/components/GuipInput.vue'; |
|
|
import GuipSelect from '@/components/GuipSelect.vue'; |
|
|
import GuipSelect from '@/components/GuipSelect.vue'; |
|
|
import GuipTextarea from '@/components/GuipTextarea.vue'; |
|
|
import GuipTextarea from '@/components/GuipTextarea.vue'; |
|
|
|
|
|
import {getFormattedDate} from "@/utils/common"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
props: { |
|
|
props: { |
|
|
@ -150,13 +151,7 @@ export default { |
|
|
GuipRadio, |
|
|
GuipRadio, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
const today = new Date(); |
|
|
const fixedStartDate = getFormattedDate('YYYY-MM-DD'); |
|
|
const fixedStartDate = this.formatDate(today); |
|
|
|
|
|
|
|
|
|
|
|
// 计算默认结束日期(例如:一周后) |
|
|
|
|
|
const defaultEndDate = new Date(today); |
|
|
|
|
|
defaultEndDate.setDate(today.getDate() + 7); |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
// 日期范围值 - 固定起始日期为今天 |
|
|
// 日期范围值 - 固定起始日期为今天 |
|
|
dateRange: [fixedStartDate, ''], |
|
|
dateRange: [fixedStartDate, ''], |
|
|
@ -170,8 +165,6 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 固定起始日期(不可修改) |
|
|
|
|
|
fixedStartDate: fixedStartDate, |
|
|
|
|
|
// 是否显示日期信息 |
|
|
// 是否显示日期信息 |
|
|
fastWords: [ |
|
|
fastWords: [ |
|
|
|
|
|
|
|
|
@ -378,21 +371,6 @@ export default { |
|
|
const day = String(date.getDate()).padStart(2, '0'); |
|
|
const day = String(date.getDate()).padStart(2, '0'); |
|
|
return `${year}-${month}-${day}`; |
|
|
return `${year}-${month}-${day}`; |
|
|
}, |
|
|
}, |
|
|
// 处理日期变化 |
|
|
|
|
|
handleDateChange(value) { |
|
|
|
|
|
console.log('日期范围变化:', value); |
|
|
|
|
|
|
|
|
|
|
|
// 确保起始日期始终为固定值 |
|
|
|
|
|
if (value && value[0] !== this.fixedStartDate) { |
|
|
|
|
|
// 如果用户尝试修改起始日期,强制改回固定值 |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
this.dateRange = [this.fixedStartDate, value[1] || '']; |
|
|
|
|
|
}, 0); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 更新显示信息 |
|
|
|
|
|
this.showDateInfo = true; |
|
|
|
|
|
}, |
|
|
|
|
|
checkFastWord(item) { |
|
|
checkFastWord(item) { |
|
|
this.searchWord = item.name; |
|
|
this.searchWord = item.name; |
|
|
this.searchWordId = item.id; |
|
|
this.searchWordId = item.id; |
|
|
|