NvrTimeSelect.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="nvr-timeselect">
  3. <div class="head">
  4. <div class="line"></div>
  5. <div class="title">视频下载</div>
  6. <span class="tips">(请先拖动进度条,再点击选取时间按钮)</span>
  7. </div>
  8. <div class="timeselect">
  9. <div class="time-picker">
  10. 开始时间:
  11. <el-input
  12. v-model="startTime"
  13. style="width: 160px; margin: 0 8px"
  14. disabled
  15. placeholder="拖动进度条选择时间"
  16. />
  17. <el-tooltip
  18. class="picker-tooltip"
  19. effect="dark"
  20. content="请先拖动进度条,再点击按钮选择时间"
  21. placement="top"
  22. >
  23. <img
  24. @click="callSetTime(true)"
  25. style="cursor: pointer"
  26. src="@\assets\icons\icon-picker.png"
  27. alt=""
  28. />
  29. </el-tooltip>
  30. <el-icon class="icon-refresh" :size="18">
  31. <Refresh @click="startTime = ''" />
  32. </el-icon>
  33. </div>
  34. <div class="time-picker">
  35. 结束时间:
  36. <el-input
  37. v-model="endTime"
  38. style="width: 160px; margin: 0 8px"
  39. disabled
  40. placeholder="拖动进度条选择时间"
  41. />
  42. <el-tooltip
  43. class="picker-tooltip"
  44. effect="dark"
  45. content="请先拖动进度条,再点击按钮选择时间"
  46. placement="top"
  47. >
  48. <img
  49. @click="callSetTime(false)"
  50. style="cursor: pointer"
  51. src="@\assets\icons\icon-picker.png"
  52. alt=""
  53. />
  54. </el-tooltip>
  55. <el-icon class="icon-refresh" :size="18">
  56. <Refresh @click="endTime = ''" />
  57. </el-icon>
  58. </div>
  59. <el-button
  60. type="primary"
  61. :loading="isCallingDownload"
  62. :disabled="!startTime.length || !endTime.length"
  63. @click="nvrDownload"
  64. >下 载</el-button
  65. >
  66. </div>
  67. </div>
  68. </template>
  69. <script setup lang="ts">
  70. import { ref } from 'vue';
  71. import { ElInput } from 'element-plus';
  72. import { Refresh } from '@element-plus/icons-vue';
  73. import { ElIcon, ElTooltip } from 'element-plus';
  74. const isCallingDownload = ref(false);
  75. const startTime = ref('');
  76. const endTime = ref('');
  77. const emit = defineEmits(['setTime', 'downloadNvr']);
  78. const callSetTime = (isStart: boolean) => {
  79. emit('setTime', isStart);
  80. };
  81. const nvrDownload = () => {
  82. emit('downloadNvr');
  83. };
  84. const clearTime = () => {
  85. startTime.value = '';
  86. endTime.value = '';
  87. };
  88. defineExpose({ isCallingDownload, startTime, endTime, clearTime });
  89. </script>
  90. <style scoped lang="scss">
  91. .nvr-timeselect {
  92. width: 50%;
  93. height: 100vh;
  94. background-color: #ffffff;
  95. .head {
  96. display: flex;
  97. align-items: center;
  98. margin-left: 8px;
  99. margin-top: 14px;
  100. .line {
  101. width: 4px;
  102. height: 16px;
  103. background: #1890ff;
  104. }
  105. .title {
  106. font-size: 14px;
  107. font-weight: 500;
  108. color: rgba(0, 0, 0, 0.88);
  109. line-height: 20px;
  110. margin-left: 8px;
  111. }
  112. .tips {
  113. font-weight: 400;
  114. font-size: 10px;
  115. color: #909399;
  116. line-height: 14px;
  117. }
  118. }
  119. .timeselect {
  120. padding: 12px 22px 0 22px;
  121. .time-picker {
  122. margin-bottom: 12px;
  123. display: flex;
  124. align-items: center;
  125. .picker-tooltip {
  126. width: 110px;
  127. margin-top: 10px;
  128. img {
  129. display: inline;
  130. margin-left: 20px;
  131. }
  132. }
  133. .icon-refresh {
  134. color: #1890ff;
  135. margin: 0 8px;
  136. cursor: pointer;
  137. }
  138. }
  139. }
  140. }
  141. </style>