detail.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div>
  3. <header_local />
  4. <div class="main">
  5. <el-row class="head">
  6. <el-col :span="12">
  7. <el-icon size="18" @click="router.go(-1)" style="cursor: pointer;">
  8. <ArrowLeft />
  9. </el-icon>
  10. 视频审核
  11. </el-col>
  12. </el-row>
  13. <br />
  14. <el-row class="body">
  15. <el-col
  16. ref="left"
  17. :span="16"
  18. style="border-right: 2px solid #e4e4e4; padding: 0 26px"
  19. >
  20. <div v-text="detail.title" style="margin-bottom: 1em"></div>
  21. <div class="video_content">
  22. <!-- -->
  23. <video
  24. autoplay
  25. controls
  26. ref="video"
  27. style="width: 100%"
  28. @timeupdate="timeupdate"
  29. :src="detail.url"
  30. ></video>
  31. <!-- <div class="progress"></div> -->
  32. </div>
  33. <el-button
  34. :type="status[detail.reviewResult.label]"
  35. style="margin: 0 auto; display: block"
  36. v-text="detail.reviewResult.labelDesc"
  37. ></el-button>
  38. <div style="text-align: center; height: 3em; line-height: 3em">
  39. 该视频共有{{ detail_data.total }}处违规
  40. </div>
  41. </el-col>
  42. <el-col :span="8" style="padding: 0 17px">
  43. <div style="height: 3em; line-height: 3em">审核结果</div>
  44. <el-tabs
  45. v-if="detail && detail.reviewResult && detail.reviewResult.results"
  46. v-model="activeName"
  47. >
  48. <el-tab-pane
  49. :label="item.typeDesc"
  50. :name="item.type"
  51. v-for="item in detail.reviewResult.results"
  52. :key="item.type"
  53. >
  54. <div
  55. :class="{ err_item: true, err_act: select_item === index }"
  56. v-for="(p, index) in item.items"
  57. :key="index"
  58. @click="() => play(p, index)"
  59. >
  60. <div
  61. class="err_item_label"
  62. style="height: 2em; line-height: 2em"
  63. >
  64. {{
  65. `${index + 1}、 ${changeTime(
  66. p.startTimeInSeconds
  67. )}-${changeTime(p.endTimeInSeconds)},类型:${
  68. p.labelDesc
  69. },错误内容:${p.subTypeDesc}`
  70. }}
  71. </div>
  72. <img
  73. :src="p.evidence.thumbnail"
  74. style="
  75. width: 100%;
  76. max-width: 373px;
  77. border-radius: 5px;
  78. display: block;
  79. margin: 0 auto;
  80. "
  81. />
  82. </div>
  83. </el-tab-pane>
  84. </el-tabs>
  85. </el-col>
  86. </el-row>
  87. </div>
  88. </div>
  89. </template>
  90. <script setup>
  91. import header_local from '../components/header.vue';
  92. // import { storeImg, historyImg } from '@/api/processing';
  93. import { ref } from 'vue';
  94. import { useRouter } from 'vue-router';
  95. const router = useRouter();
  96. // import config from '../../../config/index';
  97. const status = {
  98. REJECT: 'danger',
  99. REVIEW: 'warning',
  100. NORMAL: 'success'
  101. };
  102. const left = ref(null);
  103. const video = ref(null);
  104. const detail = JSON.parse(
  105. sessionStorage.getItem('Processing_detail') || '{reviewResult: {}}'
  106. );
  107. const activeName = ref(
  108. detail && detail.reviewResult && detail.reviewResult.results && detail.reviewResult.results.length
  109. ? detail.reviewResult.results[0].type
  110. : ''
  111. );
  112. const select_item = ref(-1);
  113. const detail_data = ref({
  114. total: 0
  115. });
  116. detail?.reviewResult?.results?.map(v => {
  117. detail_data.value.total += v.items ? v.items.length : 0;
  118. });
  119. function timeupdate(p) {
  120. // console.log(p.target.duration);
  121. // console.log(p.target.currentTime);
  122. // console.log((p.target.currentTime / p.target.duration).toFixed(4) * 100);
  123. }
  124. function changeTime(T) {
  125. let H = (T - (T % 3600)) / 3600;
  126. let M = (T - (T % 60)) / 60;
  127. let S = T % 60;
  128. H < 10 ? (H = '0' + H) : H;
  129. M < 10 ? (M = '0' + M) : M;
  130. S < 10 ? (S = '0' + S) : S;
  131. return `${H}:${M}:${S}`;
  132. }
  133. function play(p, i) {
  134. select_item.value = i;
  135. video.value.currentTime = p.startTimeInSeconds;
  136. video.value.play();
  137. }
  138. // const Authorization = localStorage.getItem('token') || '';
  139. </script>
  140. <style scoped>
  141. .main {
  142. padding: 1em;
  143. font-size: 14px;
  144. font-family: PingFangSC, PingFang SC;
  145. height: calc(100% - 42px);
  146. }
  147. .main .head {
  148. background: #f9fafc;
  149. height: 42px;
  150. line-height: 42px;
  151. padding: 0 22px;
  152. }
  153. .main .body {
  154. height: calc(100% - 42px - 1em);
  155. }
  156. .err_item_label {
  157. overflow-wrap: break-word;
  158. }
  159. .err_item {
  160. padding: 5px;
  161. margin: 10px 0;
  162. }
  163. .err_item:hover,
  164. .err_act {
  165. background-color: #e8effc;
  166. }
  167. .progress {
  168. border-radius: 2em;
  169. background-color: #fff;
  170. position: absolute;
  171. bottom: 1.5em;
  172. width: 90%;
  173. left: 5%;
  174. height: 4px;
  175. }
  176. .video_content {
  177. position: relative;
  178. margin-bottom: 3em;
  179. }
  180. </style>