|
|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<SearchBar :loading-search="loadingSearch" :show-command="true" :show-export="true" @search="onSearch" /> |
|
|
<SearchBar :loading-search="loadingSearch" :show-command="true" :show-export="true" :show-pass-setting="true" @search="onSearch" /> |
|
|
|
|
|
|
|
|
<template v-if="data"> |
|
|
<template v-if="data"> |
|
|
<el-table :data="data" :max-height="contentHeight" border stripe style="width: 100%"> |
|
|
<el-table :data="data" :max-height="contentHeight" border stripe style="width: 100%"> |
|
|
@ -21,7 +21,6 @@ |
|
|
<el-table-column align="center" label="环境温度(℃)" min-width="110" prop="environmentTemperature" /> |
|
|
<el-table-column align="center" label="环境温度(℃)" min-width="110" prop="environmentTemperature" /> |
|
|
<el-table-column align="center" label="环境湿度(RH%)" min-width="130" prop="environmentHumidity" /> |
|
|
<el-table-column align="center" label="环境湿度(RH%)" min-width="130" prop="environmentHumidity" /> |
|
|
<el-table-column align="center" label="SO2(ppb)" min-width="90" prop="so2" /> |
|
|
<el-table-column align="center" label="SO2(ppb)" min-width="90" prop="so2" /> |
|
|
<!-- TODO:--> |
|
|
|
|
|
<el-table-column align="center" label="盐分温度(℃)" min-width="110" prop="saltT" /> |
|
|
<el-table-column align="center" label="盐分温度(℃)" min-width="110" prop="saltT" /> |
|
|
<el-table-column align="center" label="盐分阻抗(Ω)" min-width="110" prop="saltR" /> |
|
|
<el-table-column align="center" label="盐分阻抗(Ω)" min-width="110" prop="saltR" /> |
|
|
<el-table-column align="center" label="机箱温度(℃)" min-width="110" prop="deviceTemperature" /> |
|
|
<el-table-column align="center" label="机箱温度(℃)" min-width="110" prop="deviceTemperature" /> |
|
|
@ -55,6 +54,16 @@ |
|
|
@next-click="onNext" |
|
|
@next-click="onNext" |
|
|
></el-pagination> |
|
|
></el-pagination> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<el-badge v-if="missingData && missingData.length" :max="99" :value="missingData.length" class="pass-button animate-bounce"> |
|
|
|
|
|
<div circle class="shadow-xl btn" type="primary" @click="showMissing = true"> |
|
|
|
|
|
<i class="el-icon-upload"></i> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-badge> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="showMissing" custom-class="device-dialog" title="待补传列表" top="30px" width="80%"> |
|
|
|
|
|
<MissingData :data="missingData" @on-success="onPassSuccess" /> |
|
|
|
|
|
</el-dialog> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup> |
|
|
<script setup> |
|
|
@ -64,6 +73,7 @@ import { getDatas } from 'apis'; |
|
|
import { ElMessage } from 'element-plus'; |
|
|
import { ElMessage } from 'element-plus'; |
|
|
import dayjs from 'dayjs'; |
|
|
import dayjs from 'dayjs'; |
|
|
import SearchBar from 'components/history/search-bar-data.vue'; |
|
|
import SearchBar from 'components/history/search-bar-data.vue'; |
|
|
|
|
|
import MissingData from 'components/history/missing-data.vue'; |
|
|
|
|
|
|
|
|
const search = ref({}); |
|
|
const search = ref({}); |
|
|
const page = ref({ |
|
|
const page = ref({ |
|
|
@ -77,6 +87,8 @@ const currentDeviceId = computed(() => store.state.device.currentDeviceId); // |
|
|
const contentHeight = ref(600); |
|
|
const contentHeight = ref(600); |
|
|
const loadingSearch = ref(false); |
|
|
const loadingSearch = ref(false); |
|
|
const data = ref(null); |
|
|
const data = ref(null); |
|
|
|
|
|
const showMissing = ref(false); |
|
|
|
|
|
const missingData = ref([]); |
|
|
|
|
|
|
|
|
// 获取设备完整信息列表 |
|
|
// 获取设备完整信息列表 |
|
|
const getData = async () => { |
|
|
const getData = async () => { |
|
|
@ -86,8 +98,7 @@ const getData = async () => { |
|
|
return ElMessage.error('请选择站点'); |
|
|
return ElMessage.error('请选择站点'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const options = { ...search.value }; |
|
|
const { date, missingIntervalInMs } = search.value; |
|
|
const date = options && options.date ? options.date : []; |
|
|
|
|
|
if (!date || date.length !== 2) { |
|
|
if (!date || date.length !== 2) { |
|
|
return ElMessage.error('请选择时间 '); |
|
|
return ElMessage.error('请选择时间 '); |
|
|
} |
|
|
} |
|
|
@ -95,6 +106,7 @@ const getData = async () => { |
|
|
deviceId: currentDeviceId.value, |
|
|
deviceId: currentDeviceId.value, |
|
|
gatheredDateRange: date, |
|
|
gatheredDateRange: date, |
|
|
paging: true, |
|
|
paging: true, |
|
|
|
|
|
missingIntervalInMs, |
|
|
page: page.value.page, |
|
|
page: page.value.page, |
|
|
size: page.value.size, |
|
|
size: page.value.size, |
|
|
sort: [ |
|
|
sort: [ |
|
|
@ -113,6 +125,13 @@ const getData = async () => { |
|
|
page.value = resData.page; |
|
|
page.value = resData.page; |
|
|
timer && clearTimeout(timer); |
|
|
timer && clearTimeout(timer); |
|
|
timer = null; |
|
|
timer = null; |
|
|
|
|
|
|
|
|
|
|
|
if (resData.missingData) { |
|
|
|
|
|
missingData.value = [...resData.missingData]; |
|
|
|
|
|
missingData.value.forEach(item => { |
|
|
|
|
|
item.uuid = `${item.deviceId}-${item.startTime}-${item.endTime}`; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
timer = setTimeout(() => { |
|
|
timer = setTimeout(() => { |
|
|
getData(); |
|
|
getData(); |
|
|
@ -175,4 +194,40 @@ const onPrev = e => { |
|
|
function formatTime(time) { |
|
|
function formatTime(time) { |
|
|
return dayjs(new Date(time)).format('YYYY-MM-DD HH:mm:ss'); |
|
|
return dayjs(new Date(time)).format('YYYY-MM-DD HH:mm:ss'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 补传成功 标记当前记录 |
|
|
|
|
|
function onPassSuccess(uuid) { |
|
|
|
|
|
// eslint-disable-next-line no-restricted-syntax |
|
|
|
|
|
for (const item of missingData.value) { |
|
|
|
|
|
if (item.uuid === uuid) { |
|
|
|
|
|
item.disabled = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|
|
.device-dialog :deep(.el-dialog__body) { |
|
|
|
|
|
padding-top: 0 !important; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pass-button { |
|
|
|
|
|
z-index: 999; |
|
|
|
|
|
position: fixed; |
|
|
|
|
|
right: 30px; |
|
|
|
|
|
bottom: 40px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pass-button .btn { |
|
|
|
|
|
width: 56px; |
|
|
|
|
|
height: 56px; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
background-color: #409eff; |
|
|
|
|
|
border-radius: 50%; |
|
|
|
|
|
color: #fff; |
|
|
|
|
|
font-size: 26px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
} |
|
|
|
|
|
</style> |
|
|
|