|
@@ -63,7 +63,7 @@ import {
|
|
|
watch,
|
|
watch,
|
|
|
} from 'vue';
|
|
} from 'vue';
|
|
|
import type { DashboardParams, DataList } from '@/api/dashboard';
|
|
import type { DashboardParams, DataList } from '@/api/dashboard';
|
|
|
-import type { AlarmTotalRes } from '@/api/home';
|
|
|
|
|
|
|
+import type { AlarmTotalRes, Data } from '@/api/home';
|
|
|
import { SizeProps, Pagination } from '@/types/global';
|
|
import { SizeProps, Pagination } from '@/types/global';
|
|
|
import BTag from '@/components/business/b-tag/index.vue';
|
|
import BTag from '@/components/business/b-tag/index.vue';
|
|
|
import useLoading from '@/hooks/loading';
|
|
import useLoading from '@/hooks/loading';
|
|
@@ -90,7 +90,7 @@ const cloneColumns = computed(() => [
|
|
|
slotName: 'index',
|
|
slotName: 'index',
|
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
|
tooltip: true,
|
|
tooltip: true,
|
|
|
- width: 70,
|
|
|
|
|
|
|
+ width: 60,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: t('dashboard.table.time'),
|
|
title: t('dashboard.table.time'),
|
|
@@ -104,7 +104,7 @@ const cloneColumns = computed(() => [
|
|
|
title: t('dashboard.form.status'),
|
|
title: t('dashboard.form.status'),
|
|
|
dataIndex: 'status',
|
|
dataIndex: 'status',
|
|
|
slotName: 'status',
|
|
slotName: 'status',
|
|
|
- width: 120,
|
|
|
|
|
|
|
+ width: 100,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: t('dashboard.form.name'),
|
|
title: t('dashboard.form.name'),
|
|
@@ -148,7 +148,7 @@ const generateFormModel = () => {
|
|
|
entityType: null,
|
|
entityType: null,
|
|
|
} as DashboardParams;
|
|
} as DashboardParams;
|
|
|
};
|
|
};
|
|
|
-const renderData = ref<DataList[]>([] as DataList[]);
|
|
|
|
|
|
|
+const tableData = ref<Data[]>([] as Data[]);
|
|
|
const size = ref<SizeProps>('medium');
|
|
const size = ref<SizeProps>('medium');
|
|
|
const formModel = ref<DashboardParams>(generateFormModel());
|
|
const formModel = ref<DashboardParams>(generateFormModel());
|
|
|
const visible = shallowRef<boolean>(false);
|
|
const visible = shallowRef<boolean>(false);
|
|
@@ -165,8 +165,11 @@ useDictList(['DeviceType', 'DeviceStatus']).then(res => {
|
|
|
watch(
|
|
watch(
|
|
|
() => props.data,
|
|
() => props.data,
|
|
|
newVal => {
|
|
newVal => {
|
|
|
- if (newVal) {
|
|
|
|
|
- const { totalCount } = newVal;
|
|
|
|
|
|
|
+ if (newVal && newVal.data) {
|
|
|
|
|
+ const { totalCount, data } = newVal;
|
|
|
|
|
+ // 更新表格数据
|
|
|
|
|
+ tableData.value.length = 0;
|
|
|
|
|
+ tableData.value.push(...newVal.data);
|
|
|
pagination.current = 1;
|
|
pagination.current = 1;
|
|
|
pagination.pageSize = totalCount;
|
|
pagination.pageSize = totalCount;
|
|
|
pagination.total = totalCount;
|
|
pagination.total = totalCount;
|
|
@@ -200,11 +203,11 @@ const handleClick = (value: DataList) => {
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
.table-list {
|
|
.table-list {
|
|
|
- margin-top: 0;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
|
|
|
-.hover-link {
|
|
|
|
|
- color: var(--primary-4);
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
|
|
+ .hover-link {
|
|
|
|
|
+ color: rgb(var(--primary-4));
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|