<!-- 机巢详情列表 -->
|
<template>
|
<common-title title="机巢概况" text="返回" :style="{ marginLeft: pxToRem(14) }" @details="detailsFun"></common-title>
|
|
<div class="machine-nest-list">
|
<MachineNestTotal @searchNickName="handleSearch" />
|
<div class="content-wrapper">
|
<!-- <div
|
class="table-list"
|
v-if="tableList.length > 0"
|
infinite-scroll-distance="6"
|
v-infinite-scroll="loadMore"
|
:infinite-scroll-disabled="busy"
|
infinite-scroll-immediate="true"
|
> -->
|
<div
|
class="table-list"
|
v-if="tableList.length > 0"
|
>
|
<div
|
:class="[index % 2 === 1 ? 'table-itemeven' : 'table-item']"
|
v-for="(item, index) in tableList"
|
:key="index" @click="signMachineNestClick(item)"
|
>
|
<img src="/src/assets/images/home/homeLeft/machinenestlist-sign.png" alt="" />
|
<div class="middle">
|
<div class="title">{{ item.nickname }}</div>
|
<div class="number">
|
飞行次数:
|
<span>{{ item.fly_count }}</span>
|
次 飞行里程:
|
<span>{{ item.flight_mileage }}</span>
|
km
|
</div>
|
<div class="result">
|
任务成果:
|
<span>{{ item.accumulate_data }}</span>
|
个 飞行时长:
|
<span>{{ item.hour }}</span>
|
h
|
</div>
|
</div>
|
<div
|
class="right"
|
:class="item.status === 'WORKING' ? 'atcive' : item.status === 'OFFLINE' ? 'offine' : 'freetime'">
|
{{ item.status === 'OFFLINE' ? '离线中' : item.status === 'WORKING' ? '作业中' : '空闲中' }}
|
</div>
|
</div>
|
</div>
|
<!-- <div class="pagination-container">
|
<el-pagination
|
v-model:current-page="pageParams.current"
|
v-model:page-size="pageParams.size"
|
:total="pageParams.total"
|
:page-sizes="[5, 10, 20]"
|
layout="total, prev, pager, next"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
background
|
/>
|
</div> -->
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
import CommonTitle from '@/components/CommonTitle.vue'
|
import MachineNestTotal from './components/MachineNestTotal.vue'
|
import { selectDevicePage } from '@/api/home/machineNest.js'
|
import { useStore } from 'vuex'
|
|
const store = useStore()
|
const isMore = ref(true)
|
// 控制加载状态
|
const busy = ref(false)
|
const searchText = ref('')
|
// 分页参数
|
const pageParams = ref({
|
current: 1,
|
size: 99,
|
total: 0,
|
})
|
|
// 机巢列表
|
const tableList = ref([])
|
// 机巢列表数据
|
const getTableList = () => {
|
const params = {
|
nickname: searchText.value,
|
current: 1,
|
size: pageParams.value.size,
|
}
|
selectDevicePage(params).then(res => {
|
if (res.data.code !== 0) return
|
if (res.data.data.records.length === 0) return (isMore.value = false)
|
// pageParams.value.current += 1
|
// pageParams.value.size += 8
|
tableList.value = res.data.data.records;// [...tableList.value, ...res.data.data.records]
|
busy.value = false
|
})
|
}
|
// 加载更多数据
|
const loadMore = async () => {
|
busy.value = true
|
if (!isMore.value) return
|
getTableList()
|
}
|
// 搜索数据
|
const handleSearch = name => {
|
searchText.value = name
|
pageParams.value.current = 1
|
tableList.value = []
|
getTableList()
|
}
|
|
// 单个机巢详情
|
const signMachineNestClick = item => {
|
store.commit('setSingleUavHome', item)
|
}
|
|
// 返回
|
const detailsFun = () => {
|
store.commit('setMachineNestDetail', false)
|
}
|
|
onMounted(() => {
|
getTableList()
|
})
|
</script>
|
|
<style scoped lang="scss">
|
.machine-nest-list {
|
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
|
margin-left: 29px;
|
padding: 16px 16px;
|
width: 390px;
|
height: 838px;
|
background: linear-gradient(270deg, rgba(31, 62, 122, 0) 0%, rgba(31, 62, 122, 0.35) 21%, #1f3e7a 100%);
|
border-radius: 0px 0px 0px 0px;
|
opacity: 0.85;
|
.content-wrapper {
|
position: relative;
|
height: calc(100% - 130px);
|
.table-list {
|
height: calc(100% - 50px);
|
overflow-y: auto;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 500;
|
font-size: 16px;
|
color: #fff;
|
// 滚动条
|
&::-webkit-scrollbar {
|
width: 0;
|
display: none;
|
}
|
-ms-overflow-style: none; /* IE and Edge */
|
scrollbar-width: none; /* Firefox */
|
.table-item {
|
display: flex;
|
justify-content: space-between;
|
justify-items: center;
|
padding-top: 6px;
|
margin-top: 10px;
|
|
height: 100px;
|
background: linear-gradient(
|
90deg,
|
rgba(0, 122, 255, 0) 0%,
|
rgba(0, 98, 204, 0.3) 57%,
|
rgba(0, 73, 153, 0) 100%
|
);
|
}
|
.table-itemeven {
|
display: flex;
|
justify-content: space-between;
|
justify-items: center;
|
padding-top: 6px;
|
margin-top: 10px;
|
|
height: 100px;
|
}
|
img {
|
width: 45px;
|
height: 58px;
|
}
|
.middle {
|
.number,
|
.result {
|
font-size: 12px;
|
margin-bottom: 11px;
|
span {
|
color: #ffdd7f;
|
font-size: 14px;
|
}
|
}
|
.title {
|
margin-bottom: 9px;
|
font-weight: bold;
|
font-size: 16px;
|
color: #ffffff;
|
line-height: 19px;
|
text-align: left;
|
}
|
}
|
.right {
|
color: #6fc3ff;
|
cursor: pointer;
|
font-size: 16px;
|
}
|
// 离线中
|
.offine {
|
color: #fff;
|
}
|
// 空闲中
|
.freetime {
|
color: #04f020;
|
}
|
// 作业中
|
.atcive {
|
color: #ffa768;
|
|
}
|
.numbering {
|
font-size: 12px;
|
color: #f6fffa;
|
text-align: center;
|
width: 67px;
|
height: 18px;
|
background: #0039c9;
|
border-radius: 50px 50px 50px 50px;
|
}
|
}
|
.pagination-container {
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
right: 0;
|
margin-top: 20px;
|
display: flex;
|
justify-content: center;
|
|
:deep(.el-pagination) {
|
--el-pagination-bg-color: transparent;
|
--el-pagination-text-color: #fff;
|
--el-pagination-button-color: #fff;
|
--el-pagination-hover-color: #409eff;
|
|
.el-pagination__total {
|
color: #fff;
|
}
|
|
.btn-prev,
|
.btn-next,
|
.number {
|
background-color: transparent;
|
color: #fff;
|
|
&:hover {
|
color: #409eff;
|
}
|
}
|
|
.is-active {
|
color: #409eff;
|
}
|
}
|
}
|
}
|
}
|
</style>
|