11 changed files with 54 additions and 122 deletions
@ -1,35 +1,35 @@ |
|||||
<template> |
<template> |
||||
<SearchHistoryLog @search="onSearch" /> |
<SearchHistoryLog @search="getData" /> |
||||
|
|
||||
<TableHistoryLog /> |
<TableHistoryLog :data="data" /> |
||||
</template> |
</template> |
||||
|
|
||||
<script setup> |
<script setup> |
||||
import { computed } from 'vue'; |
import { computed, ref } from 'vue'; |
||||
import { useStore } from 'vuex'; |
import { useStore } from 'vuex'; |
||||
import { getSendHistory } from 'apis'; |
import { getSendHistory } from 'apis'; |
||||
|
import { ElMessage } from 'element-plus'; |
||||
import SearchHistoryLog from 'components/history/search-history-log.vue'; |
import SearchHistoryLog from 'components/history/search-history-log.vue'; |
||||
import TableHistoryLog from 'components/history/history-log-table.vue'; |
import TableHistoryLog from 'components/history/history-log-table.vue'; |
||||
|
|
||||
const store = useStore(); |
const store = useStore(); |
||||
const currentDeviceId = computed(() => store.state.device.currentDeviceId); // 正在操作的设备的id |
const currentDeviceId = computed(() => store.state.device.currentDeviceId); // 正在操作的设备的id |
||||
async function getData() { |
const data = ref([]); |
||||
|
|
||||
|
async function getData( |
||||
|
params = { |
||||
|
deviceId: currentDeviceId.value, |
||||
|
status: '', |
||||
|
type: '', |
||||
|
}, |
||||
|
) { |
||||
try { |
try { |
||||
const params = { |
|
||||
deviceId: currentDeviceId.value, |
|
||||
status: 'DATA', |
|
||||
type: 'EVENT', |
|
||||
}; |
|
||||
const resData = await getSendHistory(params); |
const resData = await getSendHistory(params); |
||||
console.log(resData); |
data.value = resData ? [...resData] : []; |
||||
} catch (error) { |
} catch (error) { |
||||
console.error(error); |
ElMessage.error(error.message || '查询失败'); |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
getData(); |
getData(); |
||||
|
|
||||
function onSearch(event) { |
|
||||
console.log(event); |
|
||||
} |
|
||||
</script> |
</script> |
||||
|
Loading…
Reference in new issue