monitorLive.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <template>
  2. <div class="main-data data-monitor-live">
  3. <div class="title-area">实时监控</div>
  4. <!-- 选择日期 -->
  5. <div class="choose-area" @click="choose">
  6. 监控列表
  7. </div>
  8. <div class="close-btn" @click="close"></div>
  9. <div class="content-area">
  10. <div class="content">
  11. <video-component @videoLoad="playVideo"></video-component>
  12. </div>
  13. </div>
  14. <div @click="shot" class="c1" style="right: 20px;top: 140px;">
  15. <img src="../../../assets/zhang/cameraScreen/cut.png" width="20px">
  16. </div>
  17. <div @click="amplify" class="c1" style="right: 20px;top: 190px;">
  18. <img src="../../../assets/zhang/cameraScreen/bigger.png" width="20px">
  19. </div>
  20. <div @click="reduce" class="c1" style="right: 20px;top: 240px;">
  21. <img src="../../../assets/zhang/cameraScreen/smaller.png" width="20px">
  22. </div>
  23. <div class="c2" style="right: 40px;top: 400px;">
  24. <div @click="left" style="position: absolute;left: 0;">
  25. <img src="../../../assets/zhang/cameraScreen/left.png" width="60px">
  26. </div>
  27. <div @click="right" style="position: absolute;right: 0;">
  28. <img src="../../../assets/zhang/cameraScreen/right.png" width="60px">
  29. </div>
  30. <div @click="upWord">
  31. <img src="../../../assets/zhang/cameraScreen/stop.png" width="35px">
  32. </div>
  33. <div @click="top" style="position: absolute;top: 0;">
  34. <img src="../../../assets/zhang/cameraScreen/up.png" width="80px">
  35. </div>
  36. <div @click="bottom" style="position: absolute;bottom: 0;">
  37. <img src="../../../assets/zhang/cameraScreen/down.png" width="80px">
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import VideoComponent from "@/components/VideoComponent/index.vue";
  44. export default {
  45. name: "MonitorLive",
  46. components: {VideoComponent},
  47. props: {
  48. monitorInfo: {
  49. type: Object,
  50. required: true
  51. },
  52. },
  53. data() {
  54. return {
  55. winNum: 1,
  56. videoObj: '',
  57. played: false,
  58. imgSrc:'',
  59. code: '',
  60. direction:''
  61. };
  62. },
  63. watch: {
  64. monitorInfo: {
  65. deep: true,
  66. handler(options) {
  67. // if(!this.videoObj || this.code === options.code) return;
  68. // if(this.played){
  69. // this.videoObj.videoStop(this.winNum);
  70. // }
  71. // this.videoObj.videoPlay({
  72. // winNum: this.winNum,
  73. // code: options.code,
  74. // name: options.name,
  75. // });
  76. // this.played = true;
  77. }
  78. },
  79. },
  80. destroyed() {
  81. this.videoObj && this.videoObj.videoStop(this.winNum);
  82. },
  83. mounted() {},
  84. methods: {
  85. //点击监控列表
  86. choose(){
  87. this.$emit("chooseAllMonitor")
  88. },
  89. close(){
  90. this.videoObj && this.videoObj.videoStop(this.winNum);
  91. this.$emit("closeMonitor")
  92. },
  93. issue(t){
  94. this.$emit("issue",t);
  95. },
  96. // 播放器加载完毕
  97. playVideo(obj) {
  98. console.log(obj, '================================')
  99. console.log("子组件实例方法列表:", Object.keys(obj));
  100. this.videoObj = obj;
  101. this.code = this.monitorInfo.cameraCode;
  102. if(!this.code) return;
  103. console.log("视频播放编号", this.code);
  104. this.videoObj.videoPlay({
  105. winNum: this.winNum,
  106. code: this.monitorInfo.cameraCode,
  107. name: this.monitorInfo.abbreviation ? this.monitorInfo.abbreviation : '',
  108. });
  109. this.played = true;
  110. },
  111. left() {
  112. this.direction=0x0503
  113. // alert(1)
  114. console.log(this.videoObj,'========================aaa');
  115. console.log("视频播放编号", this.code);
  116. if (!this.videoObj)
  117. return;
  118. // alert(2)
  119. this.videoObj.videoControl({
  120. winNum: this.winNum,
  121. code: this.monitorInfo.cameraCode,
  122. control: 0x0504,
  123. });
  124. },
  125. right() {
  126. this.direction=0x0501
  127. console.log(this.videoObj,'========================aaa');
  128. console.log("视频播放编号", this.code);
  129. if (!this.videoObj)
  130. return;
  131. // alert(2)
  132. this.videoObj.videoControl({
  133. winNum: this.winNum,
  134. code: this.monitorInfo.cameraCode,
  135. control: 0x0502,
  136. });
  137. },
  138. top() {
  139. this.direction=0x0401
  140. console.log(this.videoObj,'========================aaa');
  141. console.log("视频播放编号", this.code);
  142. if (!this.videoObj)
  143. return;
  144. // alert(2)
  145. this.videoObj.videoControl({
  146. winNum: this.winNum,
  147. code: this.monitorInfo.cameraCode,
  148. control: 0x0402,
  149. });
  150. },
  151. bottom() {
  152. this.direction=0x0403
  153. console.log(this.videoObj,'========================aaa');
  154. console.log("视频播放编号", this.code);
  155. if (!this.videoObj)
  156. return;
  157. // alert(2)
  158. this.videoObj.videoControl({
  159. winNum: this.winNum,
  160. code: this.monitorInfo.cameraCode,
  161. control: 0x0404,
  162. });
  163. },
  164. upWord() {
  165. // alert(this.direction)
  166. console.log(this.videoObj,'========================aaa');
  167. console.log("视频播放编号", this.code);
  168. if (!this.videoObj)
  169. return;
  170. // alert(2)
  171. this.videoObj.videoControl({
  172. winNum: this.winNum,
  173. code: this.monitorInfo.cameraCode,
  174. control: this.direction,
  175. });
  176. },
  177. //视频截图
  178. shot() {
  179. console.log(this.videoObj,'========================aaa');
  180. console.log("视频播放编号", this.code);
  181. if (!this.videoObj)
  182. return;
  183. this.videoObj.capture({
  184. winNum: this.winNum,
  185. code: this.monitorInfo.cameraCode,
  186. });
  187. this.imgSrc=this.fileName
  188. this.issue(this.imgSrc)
  189. },
  190. amplify() {
  191. console.log(this.videoObj,'========================aaa');
  192. console.log("视频播放编号", this.code);
  193. if (!this.videoObj)
  194. return;
  195. // alert(2)
  196. this.videoObj.videoControl({
  197. winNum: this.winNum,
  198. code: this.monitorInfo.cameraCode,
  199. control: 0x0304,
  200. });
  201. },
  202. reduce() {
  203. console.log(this.videoObj,'========================aaa');
  204. console.log("视频播放编号", this.code);
  205. if (!this.videoObj)
  206. return;
  207. // alert(2)
  208. this.videoObj.videoControl({
  209. winNum: this.winNum,
  210. code: this.monitorInfo.cameraCode,
  211. control: 0x0302,
  212. });
  213. },
  214. },
  215. };
  216. </script>
  217. <style lang="scss">
  218. .el-scrollbar{
  219. background: #15696B;
  220. border: 1px solid #00ffff;
  221. ul{
  222. li{
  223. color: #FFF;
  224. }
  225. }
  226. }
  227. .el-select-dropdown__item.hover, .el-select-dropdown__item:hover{
  228. background: #15696B;
  229. color: #00FFFF;
  230. }
  231. .el-select-dropdown__item.selected{
  232. color: #00FFFF;
  233. }
  234. .el-select .el-input .el-select__caret{
  235. display: none;
  236. }
  237. .data-monitor-live {
  238. position: relative;
  239. width: 890px;
  240. height: 576px;
  241. background: url("../../../assets/images/main/dialog-bg.png") no-repeat;
  242. background-size: cover;
  243. backdrop-filter: blur(10px);
  244. .close-btn{
  245. position: absolute;
  246. right: 0;
  247. top: 0;
  248. width: 50px;
  249. height: 50px;
  250. cursor: pointer;
  251. }
  252. .choose-area{
  253. position: absolute;
  254. right: 100px;
  255. top: 7px;
  256. width: 80.05px;
  257. text-align: center;
  258. height: 30px;
  259. line-height: 30px;
  260. font-size: 14px;
  261. color: #00FFFF;
  262. background: url("../../../assets/images/main/choose_short_single.png") no-repeat;
  263. cursor: pointer;
  264. }
  265. .content-area {
  266. display: flex;
  267. flex-direction: column;
  268. padding: 15px 20px 0 15px;
  269. }
  270. .content-title {
  271. width: 515px;
  272. height: 26px;
  273. background: url("../../../assets/images/main/title_pro_long.png") no-repeat;
  274. background-size: 100% 100%;
  275. font-family: "PingFangSC";
  276. font-size: 14px;
  277. font-weight: bold;
  278. color: #00ffff;
  279. padding-left: 17px;
  280. .title {
  281. display: block;
  282. }
  283. }
  284. .content {
  285. width: 100%;
  286. display: flex;
  287. flex-direction: row;
  288. align-items: center;
  289. .data-list {
  290. position: relative;
  291. img{
  292. width: 100%;
  293. }
  294. .name{
  295. position: absolute;
  296. top: 20px;
  297. left: 15px;
  298. font-size: 16px;
  299. font-weight: bold;
  300. color: #FFFFFF;
  301. }
  302. .time{
  303. position: absolute;
  304. top: 20px;
  305. right: 15px;
  306. font-size: 16px;
  307. font-weight: bold;
  308. color: #FFFFFF;
  309. }
  310. }
  311. }
  312. .title-format {
  313. display: flex;
  314. flex-direction: row;
  315. align-items: center;
  316. img {
  317. width: 6px;
  318. height: 24px;
  319. margin-right: 6px;
  320. }
  321. .title-info {
  322. display: flex;
  323. flex-direction: column;
  324. font-size: 12px;
  325. color: #ffffff;
  326. .title-en {
  327. font-size: 8px;
  328. color: #ffffff;
  329. opacity: 0.4;
  330. }
  331. }
  332. }
  333. .choose-area{
  334. .el-select{
  335. width: 50%;
  336. }
  337. .el-input{
  338. input{
  339. background: rgba(255, 255, 255, 0);
  340. color: #00FFFF;
  341. border: none;
  342. padding: 0;
  343. width: 30px;
  344. }
  345. }
  346. }
  347. .title-area{
  348. padding-left: 40px !important;
  349. }
  350. .c1{
  351. width: 50px;
  352. height: 30px;
  353. background-color: rgba(88,139,196,0.37);box-shadow: 0 0 15px rgb(47,113,124);
  354. display: flex;
  355. position:absolute;
  356. justify-content: center;
  357. align-items: center;
  358. }
  359. .c1:hover{
  360. cursor: pointer;
  361. }
  362. .c2{
  363. width: 150px;
  364. height: 150px;
  365. border-radius: 50%;
  366. background-color: rgba(88,139,196,0.37);box-shadow: 0 0 15px rgb(47,113,124);
  367. display: flex;
  368. position:absolute;
  369. justify-content: center;
  370. align-items: center;
  371. }
  372. ::-webkit-scrollbar {
  373. width: 3px;
  374. height: 3px;
  375. }
  376. ::-webkit-scrollbar-thumb {
  377. //滑块部分
  378. // border-radius: 5px;
  379. background-color: #58cbbb;
  380. }
  381. ::-webkit-scrollbar-track {
  382. //轨道部分
  383. // box-shadow: inset 0 0 5px #ddd;
  384. background: #ddd;
  385. // border-radius: 5px;
  386. }
  387. }
  388. </style>