日历只月的时候调接口

This commit is contained in:
stt
2025-12-03 13:26:03 +08:00
parent aa07112605
commit bcb1535d4d

View File

@@ -68,7 +68,8 @@ const prop = defineProps({
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: [String, Number] },
timeValue: { type: Object }
timeValue: { type: Object },
interval: { type: [String, Number] }
})
const headerHeight = ref(57)
@@ -119,9 +120,14 @@ const tableStore: any = new TableStore({
column: [],
beforeSearchFun: () => {
if (!fullscreen.value && prop.timeValue && Array.isArray(prop.timeValue)) {
if (!fullscreen.value) {
if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) {
tableStore.table.params.searchBeginTime = prop.timeValue[0]
tableStore.table.params.searchEndTime = prop.timeValue[1]
} else {
tableStore.table.params.searchBeginTime = '2025-12-1'
tableStore.table.params.searchEndTime = '2025-12-31'
}
}
},
@@ -152,16 +158,31 @@ onMounted(() => {
TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }])
}
if (fullscreen.value) {
if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) {
tableStore.table.params.searchBeginTime = prop.timeValue[0] || tableStore.table.params.searchBeginTime
tableStore.table.params.searchEndTime = prop.timeValue[1] || tableStore.table.params.searchEndTime
TableHeaderRef.value.setTimeInterval(prop.timeValue)
} else {
TableHeaderRef.value.setInterval(3)
}
}
tableStore.index()
})
})
watch(
() => prop.timeKey,
val => {
// tableStore.index()
}
)
watch(
() => prop.interval,
val => {
if (val == 3) {
tableStore.index()
}
}
)
watch(
() => prop.timeValue,