VideoPreviewDialog.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <script setup lang="ts">
  2. import { getAssetsImageUrl } from '@/utils/common'
  3. // withDefaults(
  4. // defineProps<{
  5. // videoUrl: string
  6. // }>(),
  7. // {
  8. // videoUrl: '',
  9. // },
  10. // )
  11. // 视频弹窗可见性
  12. const value = defineModel()
  13. const videoUrl = defineModel('videoUrl', { default: '' })
  14. const handleClose = () => {
  15. value.value = false
  16. videoUrl.value = ''
  17. }
  18. </script>
  19. <template>
  20. <div class="videoPreviewDialog">
  21. <el-dialog
  22. v-model="value"
  23. class="naked-dialog"
  24. :show-close="false"
  25. align-center
  26. :close-on-click-modal="false"
  27. @close="handleClose"
  28. >
  29. <template #header="{ close }">
  30. <div class="dialogHeader">
  31. <img
  32. :src="getAssetsImageUrl('icon' + '/dialog/dialog-close3.png')"
  33. @click="close"
  34. alt=""
  35. class="dialogClose"
  36. />
  37. <!-- <el-button class="dialogClose" plain @click="close" circle>-->
  38. <!-- X-->
  39. <!-- </el-button>-->
  40. </div>
  41. </template>
  42. <div class="video-wrapper">
  43. <video controls :src="videoUrl" class="fullscreen-video"></video>
  44. </div>
  45. </el-dialog>
  46. </div>
  47. </template>
  48. <style scoped>
  49. :deep(.naked-dialog) {
  50. background: transparent !important;
  51. box-shadow: none !important;
  52. /* 隐藏默认边框 */
  53. .el-dialog__header {
  54. /*display: none;*/
  55. padding-bottom: 5px;
  56. }
  57. .el-dialog__body {
  58. padding: 0 !important;
  59. background: transparent;
  60. }
  61. }
  62. @keyframes rotate360 {
  63. 0% {
  64. transform: rotate(0deg);
  65. }
  66. 100% {
  67. transform: rotate(360deg);
  68. }
  69. }
  70. .dialogHeader {
  71. position: relative;
  72. width: 100%;
  73. height: 32px;
  74. }
  75. .dialogClose {
  76. width: 32px;
  77. height: 32px;
  78. position: absolute;
  79. right: 0;
  80. top: 0;
  81. cursor: pointer;
  82. }
  83. .dialogClose:hover {
  84. /*transform: rotate(360deg);*/
  85. animation: rotate360 0.6s ease-in-out;
  86. }
  87. .video-wrapper {
  88. position: relative;
  89. width: 100%;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. /*background: rgba(0, 0, 0, 0.4);*/
  94. }
  95. </style>