fix(alarm-page): reset pagination when click search after fields chenge
This commit is contained in:
@@ -42,6 +42,7 @@ const searchFields = reactive({
|
||||
// deviceId_likeRight: '',
|
||||
alarmDate: [dayjs().startOf('date').valueOf(), dayjs().endOf('date').valueOf()] as [number, number],
|
||||
});
|
||||
const searchFieldsChanged = ref(false);
|
||||
|
||||
const resetSearchFields = () => {
|
||||
searchFields.stationCode_in = [];
|
||||
@@ -90,6 +91,10 @@ const onDateChange = (value: [number, number] | null) => {
|
||||
}
|
||||
};
|
||||
|
||||
watch(searchFields, () => {
|
||||
searchFieldsChanged.value = true;
|
||||
});
|
||||
|
||||
const tableColumns: DataTableColumns<NdmDeviceAlarmLogResultVO> = [
|
||||
{ title: '告警流水号', key: 'alarmNo' },
|
||||
{
|
||||
@@ -226,7 +231,14 @@ const onClickReset = () => {
|
||||
tablePagination.itemCount = 0;
|
||||
getAlarmList();
|
||||
};
|
||||
const onClickQuery = () => getAlarmList();
|
||||
const onClickQuery = () => {
|
||||
if (searchFieldsChanged.value) {
|
||||
tablePagination.page = 1;
|
||||
tablePagination.pageSize = 10;
|
||||
searchFieldsChanged.value = false;
|
||||
}
|
||||
getAlarmList();
|
||||
};
|
||||
|
||||
const { mutate: downloadTableData, isPending: isDownloading } = useMutation({
|
||||
mutationFn: async () => {
|
||||
|
||||
Reference in New Issue
Block a user