index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="sm-function-module-content">
  3. <video
  4. id="trailer"
  5. WE
  6. style="
  7. visibility: hidden;
  8. position: absolute;
  9. top: 0px;
  10. left: 0px;
  11. width: 200px;
  12. height: 200px;
  13. z-index: 100;
  14. "
  15. autoplay
  16. loop
  17. crossorigin
  18. controls
  19. >
  20. <source src="@/assets/video.mp4" type="video/mp4" />
  21. </video>
  22. <el-form :model="proform" ref="ruleForm" label-width="100px">
  23. <el-form-item label="宽度:" prop="horizontal">
  24. <el-slider
  25. class="inputwidth"
  26. :min="1"
  27. :max="50"
  28. :step="1"
  29. v-model="proform.horizontal"
  30. @input="chageHor"
  31. ></el-slider>
  32. </el-form-item>
  33. <el-form-item label="高度:" prop="vertical">
  34. <el-slider
  35. class="inputwidth"
  36. :min="1"
  37. :max="50"
  38. :step="1"
  39. v-model="proform.vertical"
  40. @input="chageVert"
  41. ></el-slider>
  42. </el-form-item>
  43. <el-form-item label="距离:" prop="distance">
  44. <el-slider
  45. class="distance"
  46. :min="100"
  47. :max="1000"
  48. :step="1"
  49. v-model="proform.distance"
  50. @input="chageDist"
  51. ></el-slider>
  52. </el-form-item>
  53. </el-form>
  54. <el-checkbox v-model="proform.visibleLine" @change="chageLineVisible">
  55. 显示视频投放线
  56. </el-checkbox>
  57. <div class="boxchild">
  58. <el-button type="primary" size="mini" @click="active">
  59. 视频投放
  60. </el-button>
  61. <!-- <button type="button" id="cilpRegion" class="button black">
  62. 绘制裁剪面
  63. </button> -->
  64. <el-button type="primary" size="mini" @click="clear">清除</el-button>
  65. </div>
  66. <div id="toolbar" class="param-container tool-bar">
  67. <!-- <div class="param-item">
  68. <b>宽度:</b>
  69. <input
  70. type="range"
  71. id="horizontal"
  72. min="1"
  73. max="50"
  74. step="1"
  75. value="20"
  76. />
  77. </div>
  78. <div class="param-item">
  79. <b>高度:</b>
  80. <input type="range" id="vertical" min="1" max="50" step="1" value="10" />
  81. </div>
  82. <div class="param-item">
  83. <b>距离:</b>
  84. <input
  85. type="range"
  86. id="distance"
  87. min="100"
  88. max="1000"
  89. step="1"
  90. value="200"
  91. />
  92. </div>
  93. <div class="param-item">
  94. <b>裁剪模式:</b>
  95. <select id="clip-mode" class="supermap3d-button">
  96. <option value="clip-outside">保留区域外</option>
  97. <option value="clip-inside">保留区域内</option>
  98. </select>
  99. </div>
  100. <div>
  101. <label>
  102. <input
  103. type="checkbox"
  104. id="visibleLine"
  105. style="display: inline-block; vertical-align: middle"
  106. checked
  107. />
  108. <span style="display: inline-block; vertical-align: middle"
  109. >显示视频投放线</span
  110. >
  111. </label>
  112. </div> -->
  113. </div>
  114. </div>
  115. </template>
  116. <script>
  117. import {
  118. proInit,
  119. clearAndActive,
  120. handler,
  121. chageHor,
  122. chageVert,
  123. chageDist,
  124. chageLineVisible,
  125. centerPoint,
  126. } from "./projectionImage.js";
  127. export default {
  128. data() {
  129. return {
  130. videoElement: "",
  131. proform: {
  132. horizontal: 2,
  133. vertical: 1,
  134. distance: 200,
  135. visibleLine: true,
  136. },
  137. center: null,
  138. };
  139. },
  140. mounted() {
  141. // if (this.analysisShow && this.skylineComb) {
  142. // }
  143. this.$nextTick(() => {
  144. proInit();
  145. this.videoElement = document.getElementById("trailer");
  146. this.center = document.createElement("div");
  147. this.center.setAttribute("class", "addCenter");
  148. document.body.appendChild(this.center);
  149. });
  150. },
  151. methods: {
  152. active() {
  153. clearAndActive(this.videoElement, 20, 10);
  154. handler.activate();
  155. },
  156. clear() {
  157. clearAndActive(this.videoElement, 20, 10);
  158. handler.clear();
  159. viewer.entities.remove(centerPoint);
  160. },
  161. chageHor(v) {
  162. chageHor(v);
  163. },
  164. chageVert(v) {
  165. chageVert(v);
  166. },
  167. chageDist(v) {
  168. chageDist(v);
  169. },
  170. chageLineVisible(v) {
  171. chageLineVisible(v);
  172. },
  173. },
  174. };
  175. </script>
  176. <style>
  177. .addCenter {
  178. position: absolute;
  179. left: calc(50% - 3px);
  180. top: calc(50% - 3px);
  181. background: yellow;
  182. border: 2px solid BLACK;
  183. border-radius: 50%;
  184. width: 6px;
  185. height: 6px;
  186. }
  187. </style>