|
@ -1,11 +1,14 @@ |
|
|
<template> |
|
|
<template> |
|
|
<a-table :columns="columnLog" :data-source="dataSourceLog" :pagination="pagination"> |
|
|
<a-table |
|
|
|
|
|
:columns="columnLog" |
|
|
|
|
|
:data-source="dataSourceLog" |
|
|
|
|
|
:pagination="pagination" |
|
|
|
|
|
:loading="loading"> |
|
|
<template #bodyCell="{ record, column }"> |
|
|
<template #bodyCell="{ record, column }"> |
|
|
<template v-if="column.dataIndex === 'state'"> |
|
|
<template v-if="column.dataIndex === 'state'"> |
|
|
<span |
|
|
<span :style="{ color: { '0': '#bfcde2', '1': '#0dffa4' }[record.switchStatus.value] }">{{ |
|
|
:style="{ color: record.state === '开启' ? 'rgb(149, 242, 4)' : 'rgb(245, 154, 35)' }" |
|
|
record.switchStatus.label |
|
|
>{{ record.state }}</span |
|
|
}}</span> |
|
|
> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</a-table> |
|
|
</a-table> |
|
@ -26,9 +29,10 @@ |
|
|
const handleChangePage = (current: number, pageSize: number) => { |
|
|
const handleChangePage = (current: number, pageSize: number) => { |
|
|
pagination.value.current = current; |
|
|
pagination.value.current = current; |
|
|
pagination.value.pageSize = pageSize; |
|
|
pagination.value.pageSize = pageSize; |
|
|
console.log(current, pageSize); |
|
|
getList(); |
|
|
}; |
|
|
}; |
|
|
const info = ref({}); |
|
|
const info = ref({}); |
|
|
|
|
|
const loading = ref(false); |
|
|
const pagination = ref({ |
|
|
const pagination = ref({ |
|
|
total: 0, |
|
|
total: 0, |
|
|
size: 'small', |
|
|
size: 'small', |
|
@ -45,8 +49,8 @@ |
|
|
const columnLog = [ |
|
|
const columnLog = [ |
|
|
{ |
|
|
{ |
|
|
title: '执行时间', |
|
|
title: '执行时间', |
|
|
dataIndex: 'age', |
|
|
dataIndex: 'time', |
|
|
key: 'age', |
|
|
key: 'time', |
|
|
width: 140, |
|
|
width: 140, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -56,34 +60,9 @@ |
|
|
width: 80, |
|
|
width: 80, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
const dataSourceLog = ref([ |
|
|
const dataSourceLog = ref([]); |
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '关闭' }, |
|
|
|
|
|
{ age: '2024-07-26 23:50:20', state: '开启' }, |
|
|
|
|
|
]); |
|
|
|
|
|
const getList = () => { |
|
|
const getList = () => { |
|
|
|
|
|
loading.value = true; |
|
|
http |
|
|
http |
|
|
.get(electricDoorApi.getDeviceRecordList, { |
|
|
.get(electricDoorApi.getDeviceRecordList, { |
|
|
projectId: state.projectId, |
|
|
projectId: state.projectId, |
|
@ -94,9 +73,12 @@ |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
if (res.msg === 'success') { |
|
|
if (res.msg === 'success') { |
|
|
console.log(res, '数据'); |
|
|
dataSourceLog.value = res.data.data; |
|
|
dataSourceLog.value = res.data; |
|
|
pagination.value.total = res.data.total; |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.finally(() => { |
|
|
|
|
|
loading.value = false; |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
const toggle = (data: any) => { |
|
|
const toggle = (data: any) => { |
|
@ -110,6 +92,7 @@ |
|
|
pagination, |
|
|
pagination, |
|
|
handleChangePage, |
|
|
handleChangePage, |
|
|
info, |
|
|
info, |
|
|
|
|
|
loading, |
|
|
getList, |
|
|
getList, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|