吉安感知网项目-前端
chenyao
2026-07-31 b2f2931356dbcd9cf2c3a6efc6c336c1ad6e0261
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<template>
    <el-dialog
        class="gd-dialog eventDialog"
        v-model="visible"
        title="查看"
        @closed="visible = false"
        width="80%"
        destroy-on-close
    >
        <div class="content" style="display: flex">
            <div class="processBox">
                <div class="detail-title">事件记录</div>
                <div class="process">
                    <!--                    <OrderStepBar :processList="statusFlows" />-->
                    <!--                    <el-steps direction="vertical" :active="1 === 1" space="100">-->
                    <!--                        <el-step-->
                    <!--                            v-for="(item, index) in statusFlows"-->
                    <!--                            @key="item.id"-->
                    <!--                            :title="item.newStatusName"-->
                    <!--                            :description="item.operateUserName"-->
                    <!--                        ></el-step>-->
                    <!--                    </el-steps>-->
                    <el-steps direction="vertical" :active="statusFlows.length" space="100" finish-status="success">
                        <el-step v-for="(item, index) in statusFlows" :key="item.id">
                            <template #title>
                                <div class="step-title">
                                    <span class="status-name">{{ item.newStatusName }}</span>
                                    <span class="operator-name">{{ item.operateUserName }}</span>
                                </div>
                            </template>
                            <template #description>
                                <div class="step-desc">
                                    <span>{{ item.operateTime }}</span>
                                    <span v-if="item.remark" class="remark">{{ item.remark }}</span>
                                </div>
                            </template>
                        </el-step>
                    </el-steps>
                </div>
            </div>
            <div class="leftBox">
                <div>
                    <div class="detail-title">事件详情</div>
                    <el-row class="detail-row-view">
                        <el-col :span="12">
                            <div class="label">事件名称</div>
                            <div class="val">{{ eventInfo.eventName }}</div>
                        </el-col>
                        <el-col :span="12">
                            <div class="label">事件编号</div>
                            <div class="val">{{ eventInfo.eventNum }}</div>
                        </el-col>
                        <el-col :span="12">
                            <div class="label">事件状态</div>
                            <div class="val">{{ getStatusLabel(eventInfo.eventStatus) }}</div>
                        </el-col>
                        <el-col :span="12">
                            <div class="label">事件时间</div>
                            <div class="val">
                                {{ dayjs(eventInfo.shootTime).format('YYYY-MM-DD') }}
                            </div>
                        </el-col>
                        <el-col :span="12">
                            <div class="label">处置人员</div>
                            <div class="val">{{ eventInfo.disposeUserName }}</div>
                        </el-col>
                        <el-col :span="12">
                            <div class="label">处置部门</div>
                            <div class="val">{{ eventInfo.disposeDeptName }}</div>
                        </el-col>
                    </el-row>
                </div>
                <div class="img_flow">
                    <div class="imgurl">
                        <el-image
                            :src="eventInfo.eventImageUrl"
                            :preview-src-list="[eventInfo.eventImageUrl]"
                            fit="cover"
                            preview-teleported
                        />
                    </div>
                    <div class="flow">
                        <div v-if="disposeRecords.length === 0">
                            <el-empty description="暂无处置记录数据" />
                        </div>
                        <div v-else class="flow-card" v-for="item in disposeRecords" :key="item.id">
                            <div class="flow-row1">
                                <span class="flow-name">{{ item.disposeUserName }}</span>
                                <span class="flow-status">{{ item.disposeStatusName }}</span>
                            </div>
                            <div class="flow-row2">{{ item.disposeContent }}</div>
                            <div class="flow-row3" v-if="item.attachUrl?.length">
                                <el-image
                                    v-for="(url, imageIndex) in item.attachUrl"
                                    :key="`${item.id || 'record'}-${imageIndex}`"
                                    class="flow-img-item"
                                    :src="url"
                                    :preview-src-list="item.attachUrl"
                                    fit="cover"
                                    preview-teleported
                                />
                                <!--                                <img-->
                                <!--                                    v-for="(url, imageIndex) in item.attachUrl"-->
                                <!--                                    :key="`${item.id || 'record'}-${imageIndex}`"-->
                                <!--                                    class="flow-img-item"-->
                                <!--                                    :src="url"-->
                                <!--                                    alt=""-->
                                <!--                                />-->
                            </div>
                            <div class="flow-row4">{{ item.operateTime }}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </el-dialog>
</template>
 
<script setup>
import dayjs from 'dayjs'
import { getDetailFull } from './eventManageApi'
import OrderStepBar from './OrderStepBar.vue'
import { ref } from 'vue'
 
const visible = defineModel()
const eventInfo = ref({})
const disposeRecords = ref([])
const statusFlows = ref([])
 
// 获取状态文本
const getStatusLabel = status => {
    const map = {
        0: '待确认',
        1: '处置中',
        2: '已退回',
        3: '已处置',
        4: '已完成',
    }
    return map[status] || '未知'
}
 
// 兼容事件记录接口中不同版本的字段名称
function normalizeStatusFlow(item = {}) {
    return {
        ...item,
        newStatusName: item.newStatusName || item.statusName || item.eventStatusName || '-',
        operateContent:
            item.operateContent || item.operationContent || item.disposeContent || item.content || item.remark || '-',
        operateUserName:
            item.operateUserName || item.operatorName || item.operateUser || item.operator || item.userName || '-',
        operateTime: item.operateTime || item.createTime || item.updateTime || '-',
    }
}
 
// 打开弹框
async function open({ row } = {}) {
    if (!row?.id) return
    const res = await getDetailFull({ id: row.id })
    const detail = res?.data?.data || {}
    eventInfo.value = detail.eventInfo || {}
    disposeRecords.value = detail.disposeRecords || []
    statusFlows.value = (detail.statusFlows || []).map(normalizeStatusFlow)
}
 
defineExpose({ open })
</script>
<style lang="scss">
.eventDialog {
    .el-dialog__body {
        display: flex;
        flex-direction: column;
        .content {
            height: 0;
            flex: 1;
        }
    }
}
</style>
<style scoped lang="scss">
.content {
    display: flex;
    gap: 0 20px;
    //height: 630px;
 
    .leftBox {
        width: 0;
        flex: 1;
        display: flex;
        overflow-y: auto;
        overflow-x: hidden;
        flex-direction: column;
        scrollbar-width: none;
 
        &::-webkit-scrollbar {
            display: none;
        }
 
        //.gd-cesium {
        //    position: relative;
        //    //overflow: hidden;
        //    width: 100%;
        //    height: 390px;
        //}
        .img_flow {
            //border: 1px solid red;
            display: flex;
            justify-content: space-between;
            height: 436px;
            margin-top: 20px;
            .imgurl {
                flex: 1;
                height: 100%;
                img {
                    height: 100%;
                    width: 100%;
                }
            }
            .flow {
                margin-left: 10px;
                flex: 1;
                min-width: 0;
                min-height: 0;
                overflow-y: auto;
                overflow-x: hidden;
                scrollbar-width: none;
 
                &::-webkit-scrollbar {
                    display: none;
                }
 
                .flow-card {
                    display: flex;
                    flex-direction: column;
                    gap: 8px;
                    margin-bottom: 8px;
                    padding: 12px;
                    border: 1px solid #e4e4e4;
                    border-radius: 8px;
                    background: #fff;
                    .flow-row1 {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                    }
                    .flow-row2 {
                        font-size: 14px;
                        font-weight: 500;
                    }
                    .flow-row3 {
                        display: flex;
                        flex-wrap: wrap;
                        gap: 8px;
                        .flow-img-item {
                            width: 60px;
                            height: 60px;
                            flex: 0 0 60px;
                            border: 1px solid #e4e4e4;
                            border-radius: 4px;
                            background: #f5f5f5;
                            object-fit: cover;
                        }
                    }
                    .flow-row4 {
                        font-size: 12px;
                        color: #999;
                    }
                }
            }
        }
    }
 
    .rightBox {
        width: 350px;
        display: flex;
        flex-direction: column;
 
        .title {
            font-weight: 500;
            font-size: 14px;
            color: #272e37;
        }
 
        ::v-deep(.el-table) {
            tr th {
                font-weight: normal;
            }
        }
    }
 
    .processBox {
        display: flex;
        flex-direction: column;
 
        .process {
            height: 100%;
            padding: 12px 16px 24px 16px;
            width: 280px;
            border: 1px solid #e4e4e4;
            border-radius: 8px;
            background: #fff;
            overflow: auto;
        }
    }
 
    .step-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-right: 10px;
    }
 
    .status-name {
        font-weight: 500;
        color: #4c34ff;
        font-size: 14px;
    }
 
    .operator-name {
        color: #909399;
        font-size: 13px;
        margin-left: 20px;
    }
 
    .step-desc {
        color: #999999;
        font-size: 12px;
    }
 
    .remark {
        margin-left: 12px;
        color: #e6a23c;
    }
    :deep(.el-step__icon.is-text) {
        border-color: #4c34ff;
    }
    :deep(.el-step__head.is-success) {
        color: #4c34ff;
        height: 100px;
        border-color: #4c34ff;
    }
}
</style>