charles
2024-06-05 fefe4a3011fb472788abb2e7ffdbbc5a4f58623c
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
<template>
    <div>
        <el-dialog
                :close-on-click-modal="false"
                title="播放音频"
                :visible.sync="modalAudio"
                width="60%"
                :destroy-on-close="true"
                @close="$emit('update:modalAudio',false)"
        >
            <div>
                <el-card height="400px">
                    <a-player
                            :music="audio[0]"
                            :list="audio"
                    />
                </el-card>
            </div>
            <div class="body" style="margin-top: 30px">
                <div class="left">
                    <el-card height="420px">
                        <h3>语音识别</h3>
                        <div class="status">
                            <span>{{lookAudio.score}}</span>
                            <!--<span v-if="lookAudio.audioStatus===0">上传中</span>-->
                            <!--<span v-else-if="lookAudio.audioStatus===1" style="color: green">正常</span>-->
                            <!--<span v-else-if="lookAudio.audioStatus===2">处理中</span>-->
                            <!--<span v-else-if="lookAudio.audioStatus===3">异常</span>-->
                        </div>
                        <!--<div class="title">
                            <div>时间</div>
                            <div>语音</div>
                        </div>-->
                        <div class="timeline-container">
                            <div v-if="lookAudio.audioText==''">
                                <el-empty description="暂无数据"></el-empty>
                            </div>
                            <div v-else>
                                {{lookAudio.audioText}}
                            </div>
                            <!--<el-timeline style="margin-top: 20px">-->
                                <!--<el-timeline-item v-for="i in 10"   placement="top">-->
                                    <!--<div class="time-line">-->
                                        <!--<div class="time">-->
                                            <!--<div>2018/4/12 20:46</div>-->
                                            <!--<div>2018/4/12 20:46</div>-->
                                        <!--</div>-->
                                        <!--<div class="description">车辆启动了</div>-->
                                    <!--</div>-->
                                <!--</el-timeline-item>-->
                            <!--</el-timeline>-->
                        </div>
                    </el-card>
                </div>
                <div class="right">
                    <el-card style="height: 420px">
                        <h3>音频详情</h3>
                        <div>
                            车号:{{lookAudio.locomotiveNumber}}<br/>
                            车次:{{lookAudio.trainNumber}}<br>
                            时间:{{lookAudio.occurrenceTime}}<br/>
                            司机:{{lookAudio.driverNumber}}<br>
                        </div>
                    </el-card>
                </div>
            </div>
        </el-dialog>
    </div>
</template>
 
<script>
    import APlayer from 'vue-aplayer'
    const publicPath= process.env.BASE_URL;
    export default {
        name: "analysis",
        components:{
            APlayer
        },
        props:{
            modalAudio:{type:Boolean,default:false},
            lookAudio:{
                type:Object,
                default:()=>({})
            }
        },
        data(){
            return {
                audio: [
                    {
                        title: '天空之城',
                        artist: '黄叶',
                        url: `${publicPath}audio/test.mp3`,
                        pic: `${publicPath}images/audio/u230.png`,
                        lrc: '[00:12.09]作词:林夕[00:12.33]作曲:徐伟贤[00:14.40]对我好对我好'
                    }
                    ]
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .timeline-container {
        height: 280px; /* 设置你想要的高度 */
        overflow-y: auto; /* 添加垂直滚动条 */
        overflow-x: hidden; /* 隐藏水平滚动条 */
    }
    .body{
        display: flex;
        justify-content: start;
        .left{
            width: 70%;
            .status{
                text-align: right;
                span{
                    display: inline-block;
                    width: 50px;
                    height: 20px;
                    line-height: 20px;
                    text-align: center;
                   // border: 1px solid red;
                    color: red;
                   // border-radius: 10px;
                }
            }
            .title{
                display: flex;
                justify-content: start;
                div{
                    width: 30%;
                    text-align: right;
                }
                div:nth-child(1){
                    text-align: center;
                }
            }
        }
        .right{
            width: 20%;
            margin-left: 20px;
        }
    }
    .time-line{
        position: relative;
        top:-20px;
        display: flex;
        justify-content: start;
        font-size: 12px;
        .time{
            color: gray;
        }
        .description{
            box-sizing: border-box;
            margin-left: 15px;
            padding: 10px 0px 0px 10px;
            width: 60%;
            background-color: lightgray;
        }
    }
</style>