<!-- 机巢列表详情 -->
|
<template>
|
<el-dialog
|
class="machineTableDetails ztzf-dialog"
|
v-model="isShowDetails"
|
:width="pxToRem(1500)"
|
:close-on-click-modal="false"
|
:destroy-on-close="true"
|
>
|
<template #header="{ titleId, titleClass }">
|
<div class="my-header">
|
<img src="/src/assets/images/home/homeLeft/inspection-union.png" alt="" />
|
<span :id="titleId" :class="titleClass">机巢详情</span>
|
</div>
|
</template>
|
<div class="machineTableDetailsblock">
|
<div class="machineTableDetailsTitle"><span>详情</span></div>
|
<div class="infoBox">
|
<div class="itemBox" v-for="(item, index) in infoList" :key="index">
|
<div class="itemTitle">{{ item.name }} :</div>
|
<div v-if="item.name == '任务成果'" class="missionOutcomes">
|
<span>{{item.value ? item.value :0}}</span>
|
个
|
</div>
|
<div
|
v-if="item.name == '机巢状态'"
|
:class="{
|
active: item.value === 'WORKING',
|
freetime: item.value === 'LEISURE',
|
offine: item.value === 'OFFLINE',
|
}"
|
>
|
{{ item.value === 'OFFLINE' ? '离线中' : item.value === 'WORKING' ? '作业中' : '空闲中' }}
|
</div>
|
<div class="itemValue" v-else>{{ item.value }}</div>
|
</div>
|
</div>
|
</div>
|
<DeviceJob v-if="isShowDetails" />
|
<DeviceEvent v-if="isShowDetails" />
|
</el-dialog>
|
</template>
|
|
<script setup>
|
import DeviceEvent from '@/views/SignMachineNest/MachineRight/MachineStatus/MachineTableDetails/DeviceEvent.vue'
|
import DeviceJob from '@/views/SignMachineNest/MachineRight/MachineStatus/MachineTableDetails/DeviceJob/DeviceJob.vue'
|
import { pxToRem } from '@/utils/rem'
|
import { useStore } from 'vuex'
|
|
const isShowDetails = defineModel('show')
|
|
const infoList = ref([
|
{ name: '机巢名称', value: '', field: 'nickname' },
|
{ name: '机巢所属地区', value: '', field: 'device_area' },
|
{ name: '任务成果', value: '', field: 'result_num' },
|
{ name: '机巢位置', value: '', field: 'address' },
|
{ name: '机巢状态', value: '', field: 'status' },
|
])
|
const store = useStore()
|
const singleTotal = inject('singleTotal')
|
watch(singleTotal, val => {
|
if (val?.device_info) {
|
infoList.value.forEach(item => {
|
item.value = val.device_info?.[item.field] || ''
|
})
|
}
|
})
|
onMounted(() => {})
|
</script>
|
|
<style lang="scss">
|
.machineTableDetails {
|
|
.el-pagination {
|
text-align: left;
|
padding: 10px 20px 5px 10px;
|
}
|
.my-header {
|
display: inline-block;
|
vertical-align: middle;
|
margin-left: 12px;
|
}
|
}
|
</style>
|
|
<style lang="scss" scoped>
|
.infoBox {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-bottom: 10px;
|
font-size: 14px;
|
color: #ffffff;
|
.itemBox {
|
display: flex;
|
align-items: center;
|
.itemTitle {
|
margin-right: 5px;
|
}
|
}
|
|
.flystatus {
|
width: 53px;
|
height: 27px;
|
background: #042c53;
|
border-radius: 0px 0px 0px 0px;
|
border: 1px solid #1b94ff;
|
}
|
}
|
|
// 详情
|
.machineTableDetailsblock {
|
margin: 0 24px;
|
}
|
.machineTableDetailsTitle {
|
margin-bottom: 10px;
|
background: url('/src/assets/images/signMachineNest/machineRight/detailtitle.png') no-repeat center;
|
background-size: 100% 100%;
|
span {
|
display: inline-block;
|
margin-left: 30px;
|
font-size: 16px;
|
color: #ddf0ff;
|
line-height: 20px;
|
text-align: left;
|
margin-bottom: 8px;
|
}
|
}
|
.missionOutcomes {
|
span {
|
color: #ffa500;
|
font-size: 14px;
|
font-weight: bold;
|
}
|
}
|
// 离线中
|
.offine {
|
width: 53px;
|
height: 27px;
|
background: #042c53;
|
border-radius: 0px 0px 0px 0px;
|
border: 1px solid #1b94ff;
|
text-align: center;
|
line-height: 27px;
|
font-size: 14px;
|
color: #1b94ff;
|
}
|
// 空闲中
|
.freetime {
|
width: 53px;
|
height: 27px;
|
text-align: center;
|
line-height: 27px;
|
font-size: 14px;
|
color: #8effac;
|
background: rgba(142, 255, 172, 0.14);
|
border-radius: 0px 0px 0px 0px;
|
border: 1px solid #8effac;
|
}
|
.active {
|
color: #04f020;
|
}
|
</style>
|