evaluationResults.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div
  3. style="
  4. width: 100%;
  5. display: flex;
  6. flex-direction: column;
  7. padding: 20px 50px;
  8. "
  9. >
  10. <h2
  11. style="
  12. width: 100%;
  13. text-align: center;
  14. font-size: 28px;
  15. font-weight: bold;
  16. "
  17. >
  18. 评价结果
  19. </h2>
  20. <p
  21. style="
  22. font-size: 18px;
  23. font-weight: bold;
  24. border-bottom: 1px solid #ccc;
  25. padding-bottom: 15px;
  26. "
  27. >
  28. 仿真评价
  29. </p>
  30. <p
  31. style="
  32. width: 100%;
  33. text-align: center;
  34. font-size: 18px;
  35. color: #000;
  36. margin-top: 30px;
  37. "
  38. >
  39. {{ describe }}
  40. </p>
  41. <tableList
  42. ref="table"
  43. style="margin: 30px 30px"
  44. :columns="columns"
  45. :getDataWay="getDataWay"
  46. index
  47. >
  48. <el-table-column label="操作" slot="cgInfos" align="center" width="180">
  49. <template v-slot="scope">
  50. <span v-if="!isEdit" @click="" class="elIcon"> 评价结果 </span>
  51. <span v-if="isEdit" @click="" class="elIcon"> 编辑 </span>
  52. <span v-if="isEdit" @click="" class="elIcon"> 删除 </span>
  53. </template>
  54. </el-table-column>
  55. </tableList>
  56. <p
  57. style="
  58. font-size: 18px;
  59. font-weight: bold;
  60. border-bottom: 1px solid #ccc;
  61. padding-bottom: 15px;
  62. "
  63. >
  64. 仿真回放
  65. </p>
  66. <div
  67. style="
  68. margin: 20px 0;
  69. width: 100%;
  70. display: flex;
  71. justify-content: end;
  72. align-items: center;
  73. "
  74. >
  75. <span>回放视角:</span>
  76. <el-select v-model="viewKey">
  77. <el-option
  78. v-for="item in viewOptions"
  79. :key="item.value"
  80. :label="item.label"
  81. :value="item.value"
  82. >
  83. </el-option>
  84. </el-select>
  85. </div>
  86. <div
  87. style="width: 100%; height: 500px; border: 2px dashed #ccc; padding: 10px"
  88. >
  89. <video
  90. ref="videoPlayer"
  91. controls
  92. style="width: 100%; height: 100%"
  93. autoplay
  94. :src="videoList[viewKey]"
  95. >
  96. </video>
  97. </div>
  98. </div>
  99. </template>
  100. <script>
  101. import tableList from '@/components/grid/TableList'
  102. export default {
  103. name: 'evaluationResults', // 多仿真模式 评价结果
  104. components: { tableList },
  105. data() {
  106. return {
  107. viewKey: 0,
  108. viewOptions: [
  109. {
  110. value: 0,
  111. label: '总视角',
  112. },
  113. // {
  114. // value: 1,
  115. // label: '多仿真视角',
  116. // },
  117. ],
  118. playUrl:'', // 当前播放地址
  119. videoList: [], // 视频地址列表
  120. describe: '', // 评价描述
  121. columns: [
  122. {
  123. label: '事故类型',
  124. prop: 'type',
  125. },
  126. {
  127. label: '状态',
  128. prop: 'status',
  129. },
  130. ],
  131. getDataWay: {
  132. //加载表格数据
  133. dataType: 'data',
  134. type: 'post',
  135. // firstRequest: false,
  136. data: [],
  137. param: {},
  138. },
  139. }
  140. },
  141. methods: {
  142. // 获取评价信息
  143. getMulationSceneResult(id) {
  144. this.$axios({
  145. method: 'post',
  146. url: this.$api.multimode.viewMulationSceneResult,
  147. data: {
  148. sceneId: id,
  149. },
  150. }).then((res) => {
  151. if (res.code == 200) {
  152. this.describe = res.info.phrases
  153. this.getDataWay.data = [
  154. {
  155. type: '碰撞',
  156. status: res.info.collisionDetail[0].abnormalTimeDescription,
  157. },
  158. {
  159. type: '异常停车',
  160. status: res.info.abnormalParkingDetail[0].abnormalTimeDescription,
  161. },
  162. {
  163. type: '冲出车道',
  164. status: res.info.outOfPavementDetail[0].abnormalTimeDescription,
  165. },
  166. ]
  167. this.playUrl = res.info.projectResultOverallUrl
  168. if(res.info.projectResultSimulationUrl){
  169. this.viewOptions = [...this.viewOptions, {value: 1,label: '多仿真视角',}]
  170. }
  171. this.videoList = [
  172. res.info.projectResultOverallUrl,
  173. res.info.projectResultSimulationUrl,
  174. ]
  175. } else {
  176. this.$message.error(res.message || '查询信息失败')
  177. }
  178. })
  179. },
  180. },
  181. mounted() {
  182. this.$route.query.id && this.getMulationSceneResult(this.$route.query.id)
  183. },
  184. }
  185. </script>