forked from drone/command-center-dashboard

罗广辉
2025-04-21 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!-- 机巢列表详情 -->
<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>