吉安感知网项目-前端
罗广辉
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
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
<template>
    <div class="execution-container">
        <!-- 固定头部 tabs -->
        <div class="fixed-tabs">
            <van-tabs
                v-model:active="active"
                title-active-color="#1989fa"
                title-inactive-color="#646566"
                sticky
                @click-tab="tabClick"
            >
                <van-tab title="任务情况" name="任务情况"/>
                <van-tab title="关联事件" name="关联事件" :badge="eventTotal" />
                <van-tab title="成果数据" name="成果数据" :badge="resultTotal" />
            </van-tabs>
        </div>
 
        <!-- 可滚动的内容区域 -->
        <div class="scroll-content">
            <div v-show="active === '任务情况'" class="tab-content">
                <ex-details :wayLineJobInfoId="route.query.wayLineJobInfoId" />
            </div>
 
            <div v-show="active === '关联事件'" class="tab-content">
                <ex-events :wayLineJobInfoId="route.query.wayLineJobInfoId" />
            </div>
 
            <div v-show="active === '成果数据'" class="tab-content tab-content-cg">
                <achievementData :wayLineJobInfoId="route.query.wayLineJobInfoId" />
            </div>
        </div>
    </div>
</template>
 
<script setup>
import { getDeviceEventList } from '@/api/home/machineNest'
import { aiImagesPage } from '@/api/dataCenter'
import {getJobWayLineDetails} from '@ztzf/apis'
 
import { getJobDetails } from '@/api/home/task'
import { useRoute } from 'vue-router'
import exDetails from './compoment/details.vue'
import exEvents from './compoment/events.vue'
import achievementData from './compoment/achievementData.vue'
import { setStore } from '@/utils/store'
const active = ref('任务情况')
provide('activeTab', active)
const route = useRoute()
 
const eventTotal = ref(0)
function returnNumEx(value) {
    eventTotal.value = value
}
const resultTotal = ref(0)
function returnNumE(value) {
    resultTotal.value = value
}
function tabClick(value) {
    active.value = value.name
}
 
const detailsObj = ref({})
const taskWayLineDetails = ref([])
provide('detailsObj', detailsObj)
provide('taskWayLineDetails', taskWayLineDetails)
 
onMounted(() => {
  console.log(route.query, '8888')
    // const item = JSON.parse(decodeURIComponent(route.query.rowItem))
    const params = { 
        way_line_job_info_id: route.query.wayLineJobInfoId,
        batch_no: route.query.batch_no,
    }
    getDeviceEventList(params, { current: 1, size: 1999 }).then(res => {
        eventTotal.value = res.data.data.total;
    })
    getJobDetails({ wayLineJobInfoId: route.query.wayLineJobInfoId, waylineJobId: route.query.waylineJobId, batchNo: route.query.batch_no }).then(async resDetails => {
        detailsObj.value = resDetails.data.data
        aiImagesPage({ wayLineJobId: detailsObj.value.job_id, resultTypes: [0, 1, 2, 4, 5],orderByCreateTime:true,current: 1,size:2000 }).then(res => {
            resultTotal.value = res.data.data.total;
        })
    })
    getJobWayLineDetails({ wayLineJobInfoId: route.query.wayLineJobInfoId, waylineJobId: route.query.waylineJobId, batchNo: route.query.batch_no }).then(async res => {
        taskWayLineDetails.value = res.data.data
    })
})
</script>
 
<style lang="scss" scoped>
.execution-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Source Han Sans CN, Source Han Sans CN;
    :deep(.van-badge) {
        position: initial;
        background-color: #1D6FE9;
    }
    :deep(){
        .van-tabs__nav{
            background: transparent;
        }
    }
    .van-tabs{
        background: transparent;
        :deep(.van-tab) {
            font-size: 15px;
            font-weight: 400;
        }
        :deep(.van-badge__wrapper) {
            display: flex;
            justify-items: center;
            align-items: center;
        }
        :deep(.van-badge--top-right) {
            transform: none;
        }
    }
    .fixed-tabs {
        flex-shrink: 0; /* 防止 tabs 被压缩 */
        z-index: 1000;
    }
 
    .scroll-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
    }
 
    .tab-content {
        height: 100%;
        overflow-y: auto;
    }
    .tab-content-cg {
        -webkit-overflow-scrolling: touch;
        padding-bottom: 48px; /* 预留按钮高度 + 间距 */
    }
 
    /* 确保内容区域在 tabs 下面 */
    :deep(.van-tabs__wrap) {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
}
</style>