forked from drone/command-center-dashboard

罗广辉
2025-04-20 f4dc3ef6453334874ab4a10dcc8557d6d4a1bcbf
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
<template>
    <div class="task-details-right-container">
        <div class="titleImg">
            <img :src="droneImg" alt="" />
        </div>
 
        <div class="taskInfo">
            <div v-for="item in list" class="itemBox">
                <div class="itemName">{{ item.name }}:</div>
                <div class="itemValue" v-if="item.name !== '飞行事件'">{{ item.value }}</div>
                <div class="flightEvents" v-else>
                    <img v-for="item in flightEvents" alt="" :src="item.img" :title="item.name"></img>
                </div>
            </div>
        </div>
 
        <BaseControl v-if="workspace_id" />
    </div>
</template>
<script setup>
import droneImg from '@/assets/images/taskManagement/taskIntermediateContent/droneImg.png'
import BaseControl from '@/components/CurrentTaskDetails/ControlPanel/BaseControl.vue'
import { droneEventList } from '@/const/drc'
 
const taskDetails = inject('taskDetails')
const workspace_id = inject('workspace_id')
 
const list = ref([
    { name: '任务编号', value: '', field: 'job_info_num' },
    { name: '任务名称', value: '', field: 'name' },
    { name: '任务类型', value: '', field: 'industry_type_str' },
    { name: '飞行事件', value: '', field: '' },
    { name: '所属单位', value: '', field: 'dept_name' },
    { name: '任务时间', value: '', field: 'create_time' },
    { name: '任务频次', value: '', field: 'rep_rule_type rep_rule_val' },
    { name: '关联算法', value: '', field: 'ai_type_str' },
    { name: '任务描述', value: '', field: 'remark' },
])
const flightEvents = ref([])
 
watch(
    taskDetails,
    () => {
        list.value.forEach(item => {
            item.value = taskDetails?.value?.[item.field] || ''
            if (item.name === '任务频次') {
                const { rep_rule_type = '', rep_rule_val = '' } = taskDetails?.value || {}
                item.value = rep_rule_type + ' -- ' + rep_rule_val
            }
            if (item.name === '飞行事件') {
                const { action_modes = [] } = taskDetails?.value || {}
                flightEvents.value = action_modes.flatMap(({ actionActuatorFunc }) =>
                    droneEventList.filter(({ value }) => actionActuatorFunc === value)
                )
            }
        })
    },
    {
        immediate: true,
        deep: true,
    }
)
</script>
 
<style scoped lang="scss">
.task-details-right-container {
    padding-top: 35px;
    position: absolute;
    right: 0;
    top: 0;
    width: 297px;
    height: 1002px;
    background: rgba(31, 31, 31, 0.5);
    backdrop-filter: blur(0.5rem);
    border-radius: 0px 40px 40px 0px;
    display: flex;
    flex-direction: column;
    gap: 25px 0;
    align-items: center;
 
    .manualControl {
        background: transparent !important;
    }
 
    .titleImg {
        width: 224px;
        height: 131px;
        background: rgba(74, 72, 72, 0.54);
        box-shadow: 0px 4px 72px 0px rgba(0, 0, 0, 0.25);
        border-radius: 12px 12px 12px 12px;
        border: 1px solid rgba(255, 255, 255, 0.99);
        display: flex;
        align-items: center;
        justify-content: center;
 
        img {
            width: 100px;
            height: 68px;
        }
    }
 
    .taskInfo {
        width: 230px;
        height: 520px;
        display: flex;
        overflow: auto;
        flex-direction: column;
        gap: 25px 0;
 
        .itemBox {
            display: flex;
            font-family: Segoe UI, Segoe UI;
            font-size: 14px;
 
            .itemName {
                flex-shrink: 0;
                font-weight: 400;
 
                color: #d3d3d3;
            }
 
            .itemValue {
                font-weight: bold;
                color: #ffffff;
                word-break: break-all; /* 强制在任意字符断行 */
                white-space: normal; /* 允许正常换行 */
            }
 
            .flightEvents{
                display: flex;
                flex-wrap: wrap;
                gap: 10px 10px;
                img {
                    width: 30px;
                    height: 30px;
                }
            }
        }
    }
}
</style>