|
|
@@ -54,7 +54,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" name="RecordListPage" setup>
|
|
|
-import { computed, ref, reactive, watch, nextTick } from 'vue';
|
|
|
+import { computed, ref, reactive, watch, nextTick, shallowRef } from 'vue';
|
|
|
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import useLoading from '@/hooks/loading';
|
|
|
@@ -71,7 +71,7 @@ interface FaceParams {
|
|
|
}
|
|
|
type SizeProps = 'mini' | 'small' | 'medium' | 'large';
|
|
|
type Column = TableColumnData & { checked?: true };
|
|
|
-
|
|
|
+const isFirst = shallowRef<boolean>(true);
|
|
|
const { loading, setLoading } = useLoading(true);
|
|
|
const { t } = useI18n();
|
|
|
const renderData = ref<DataList[]>([]);
|
|
|
@@ -151,9 +151,11 @@ const fetchData = async () => {
|
|
|
setLoading(true);
|
|
|
try {
|
|
|
queryRecordList(formModel.value).then(res => {
|
|
|
- renderData.value = res.data;
|
|
|
+ if (res.update === 1 || isFirst.value) {
|
|
|
+ renderData.value = res.data;
|
|
|
+ }
|
|
|
+ isFirst.value = false;
|
|
|
pagination.current = formModel.value.pageIndex;
|
|
|
- pagination.pageSize = pagination.pageSize;
|
|
|
pagination.total = res.total;
|
|
|
});
|
|
|
} catch (err) {
|
|
|
@@ -170,6 +172,11 @@ const { pause, resume, isActive } = useIntervalFn(() => {
|
|
|
}, 1000);
|
|
|
const onPageChange = (current: number) => {
|
|
|
formModel.value.pageIndex = current;
|
|
|
+ if (current === 1) {
|
|
|
+ resume();
|
|
|
+ } else {
|
|
|
+ pause();
|
|
|
+ }
|
|
|
fetchData();
|
|
|
};
|
|
|
const downloadExcel = () => {
|