吉安感知网项目-前端
罗广辉
2026-01-26 beb95fb5fc166804056abafd70fc01ac27de7621
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
 
<template>
    <div class="taskContentParent">
        <div class="taskContent">
            <div class="title">任务内容</div>
            <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>
                    <template v-if="flightEvents.length > 0">
                        <img v-for="item in flightEvents" alt="" :src="item.imgUrl" :title="item.label"></img>
                    </template>
                    <span v-else>--</span>
                </div>
            </div>
        </div>
    </div>
</template>
 
<script setup>
import { getFindAction } from '@/views/RoutePlan/PointAirLine/pointWayLineUtils'
 
const flightEvents = ref([])
const hasAiTypeStr = ref(false)
const list = ref([
    { name: '任务编号', value: '--', field: 'job_info_num' },
    { name: '任务名称', value: '--', field: 'name' },
    { name: '任务类型', value: '--', field: 'rep_rule_type' },
    { name: '飞行事件', value: '--', field: '' },
    { name: '所属部门', value: '--', field: 'dept_name' },
    { name: '所属机巢', value: '--', field: 'device_names' },
    { name: '任务时间', value: '--', field: 'begin_time' },
    { name: '任务频次', value: '--', field: 'rep_rule_type rep_rule_val' },
    { name: '关联算法', value: '--', field: 'ai_type_str' },
    { name: '任务描述', value: '--', field: 'remark' },
])
const props = defineProps(['taskDetails'])
function setListParams() {
    list.value.forEach(item => {
        item.value = props.taskDetails?.[item.field] || '--'
        if (item.name === '任务频次') {
            const { rep_rule_type = '', final_cycle_frequency = '' } = props.taskDetails || {}
            item.value = rep_rule_type ? final_cycle_frequency : '1次'
        }
        if (item.name === '任务类型') {
            const val = props.taskDetails?.[item.field]
            item.value =  val ? '周期任务' : '临时任务'
        }
        if (item.name === '飞行事件') {
            const { action_modes = [] } = props.taskDetails || {}
            flightEvents.value = action_modes.flatMap((item) => getFindAction(item, 'app'))
        }
        if (item.name === '关联算法'){
            hasAiTypeStr.value = !!props.taskDetails?.[item.field]
        }
    })
}
 
watch(()=>props.taskDetails,setListParams,
    {
        immediate: true,
        deep: true,
    }
)
 
</script>
 
 
<style scoped lang="scss">
.taskContentParent{
    width: 100%;
    padding: 0 12px;
    .taskContent{
        background: #FFFFFF;
        padding: 10px 10px 20px 10px;
        border-radius: 6px 6px 6px 6px;
 
        .title{
            font-family: Source Han Sans CN, Source Han Sans CN;
            font-weight: bold;
            font-size: 16px;
            color: #222324;
        }
        .itemBox{
            min-height: 48px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #F5F5F5;
 
            .itemName{
                flex-shrink: 0;
            }
 
            .flightEvents{
                display: flex;
                align-items: center;
                gap: 5px;
 
                >img{
                    width: 26px;
                    height: 26px;
                }
            }
        }
 
    }
}
</style>