table-header重置时间变成默认时间

This commit is contained in:
zhujiyan
2024-05-29 16:11:34 +08:00
parent cf36d7979a
commit 7f8d6151a1
2 changed files with 7 additions and 5 deletions

View File

@@ -24,7 +24,7 @@
<script lang="ts" setup>
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
import { ref, onMounted, nextTick } from 'vue'
import { ref, onMounted, nextTick,watch} from 'vue'
const interval = ref(3)
const timeFlag = ref(1)
@@ -499,7 +499,7 @@ function formatDate(date: Date): string {
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth })
defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth ,timeChange})
</script>
<style scoped>

View File

@@ -151,12 +151,14 @@ const onComSearch = async () => {
await tableStore.onTableAction('search', {})
}
const onResetForm = () => {
tableStore.onTableAction('reset', {})
}
const setDatePicker = (list: any) => {
datePickerRef.value.setTimeOptions(list)
}
const onResetForm = () => {
//时间重置成默认值
datePickerRef.value.timeChange(3)
tableStore.onTableAction('reset', {})
}
const setInterval = (val: any) => {
datePickerRef.value.setInterval(val)
}