|
|
@@ -46,6 +46,7 @@
|
|
|
v-model="formModel.entityType"
|
|
|
:placeholder="t('dashboard.form.entityType')"
|
|
|
allow-clear
|
|
|
+ @clear="formModel.entityType = null"
|
|
|
>
|
|
|
<a-option
|
|
|
v-for="item of entityTypeList"
|
|
|
@@ -65,6 +66,7 @@
|
|
|
v-model="formModel.status"
|
|
|
:placeholder="t('dashboard.form.status')"
|
|
|
allow-clear
|
|
|
+ @clear="formModel.status = null"
|
|
|
>
|
|
|
<a-option
|
|
|
v-for="item of statusTypeList"
|
|
|
@@ -186,13 +188,12 @@ import { useI18n } from 'vue-i18n';
|
|
|
import { entityTypeList, statusTypeList, DeviceInfo } from './conf';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { downLoadFun } from '@/utils/const';
|
|
|
+import { useIntervalFn } from '@vueuse/core';
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
const { loading, setLoading } = useLoading(true);
|
|
|
const cloneColumns = computed(() => [
|
|
|
- // ])
|
|
|
- // const cloneColumns = ref<TableColumnData[]>([
|
|
|
{
|
|
|
title: t('searchTable.table.number'),
|
|
|
dataIndex: 'index',
|
|
|
@@ -202,33 +203,34 @@ const cloneColumns = computed(() => [
|
|
|
width: 60,
|
|
|
},
|
|
|
{
|
|
|
- title: t('dashboard.form.entityType'),
|
|
|
- dataIndex: 'entityType',
|
|
|
- slotName: 'entityType',
|
|
|
+ title: t('dashboard.table.time'),
|
|
|
+ dataIndex: 'time',
|
|
|
+ slotName: 'time',
|
|
|
+ ellipsis: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: t('dashboard.form.status'),
|
|
|
+ dataIndex: 'status',
|
|
|
+ slotName: 'status',
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: t('dashboard.form.name'),
|
|
|
dataIndex: 'name',
|
|
|
slotName: 'name',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: t('dashboard.form.entityType'),
|
|
|
+ dataIndex: 'entityType',
|
|
|
+ slotName: 'entityType',
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
title: t('dashboard.form.address'),
|
|
|
dataIndex: 'address',
|
|
|
ellipsis: true,
|
|
|
tooltip: true,
|
|
|
},
|
|
|
- {
|
|
|
- title: t('dashboard.form.status'),
|
|
|
- dataIndex: 'status',
|
|
|
- slotName: 'status',
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- {
|
|
|
- title: t('dashboard.table.time'),
|
|
|
- dataIndex: 'time',
|
|
|
- slotName: 'time',
|
|
|
- ellipsis: true,
|
|
|
- },
|
|
|
]);
|
|
|
|
|
|
const basePagination: Pagination = {
|
|
|
@@ -258,13 +260,14 @@ const visible = shallowRef<boolean>(false);
|
|
|
const this_ = getCurrentInstance()?.appContext.config.globalProperties;
|
|
|
const deviceInfo = ref<DeviceInfo[]>([] as DeviceInfo[]);
|
|
|
function searchTable() {
|
|
|
- setLoading(true);
|
|
|
- const [startTime, endTime] = formModel.value.time;
|
|
|
+ // setLoading(true);
|
|
|
+ const [startTime, endTime] = formModel.value.time
|
|
|
+ ? formModel.value.time
|
|
|
+ : ['', ''];
|
|
|
formModel.value.startTime = startTime ? startTime : null;
|
|
|
formModel.value.endTime = endTime ? endTime : null;
|
|
|
queryDashboardList(formModel.value)
|
|
|
.then(res => {
|
|
|
- console.log('res', res);
|
|
|
pagination.current = formModel.value.pageIndex;
|
|
|
pagination.pageSize = pagination.pageSize;
|
|
|
pagination.total = res.totalCount;
|
|
|
@@ -275,6 +278,11 @@ function searchTable() {
|
|
|
});
|
|
|
}
|
|
|
searchTable();
|
|
|
+const { pause, resume, isActive } = useIntervalFn(() => {
|
|
|
+ /* your function */
|
|
|
+ formModel.value.pageIndex = 1;
|
|
|
+ searchTable();
|
|
|
+}, 1000);
|
|
|
const search = () => {
|
|
|
searchTable();
|
|
|
};
|
|
|
@@ -300,6 +308,11 @@ const downloadExcel = () => {
|
|
|
};
|
|
|
const onPageChange = (current: number) => {
|
|
|
formModel.value.pageIndex = current;
|
|
|
+ if (current === 1) {
|
|
|
+ resume();
|
|
|
+ } else {
|
|
|
+ pause();
|
|
|
+ }
|
|
|
searchTable();
|
|
|
};
|
|
|
|