monitorScreen.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  1. <template>
  2. <v-scale-screen width="2200" height="1080">
  3. <div class="task_screen_cotainer">
  4. <div class="task_header">训练态势监控大屏</div>
  5. <div class="exit_box_hanlde">
  6. <el-image
  7. @click="showFull"
  8. style="width: 20px; height: 20px; margin-right:6px; margin-top: -10px;"
  9. :src="require('../assets/img/small.svg')"
  10. fit="contain"
  11. class="moreBtn_style"
  12. >
  13. </el-image>
  14. </div>
  15. <div class="monitor_video_box">
  16. <div class="full_video_box">
  17. <div class="video_title_new">
  18. <a style="float: left">监控名称</a>
  19. <a style="margin-left: 1370px">分屏</a>
  20. <div style="float: right; ">
  21. <el-radio-group v-model="selectedScreen" size="mini" @change="selectChange">
  22. <el-radio-button label=1></el-radio-button>
  23. <el-radio-button label=4></el-radio-button>
  24. <!-- <el-radio-button label=5></el-radio-button>-->
  25. <el-radio-button label=9></el-radio-button>
  26. <el-radio-button label=16></el-radio-button>
  27. </el-radio-group>
  28. </div>
  29. </div>
  30. <div class="video_content">
  31. <MonitorHK v-if="HKbigCamaraShow"
  32. @change-window="handleChangeWindow"
  33. :num="selectedScreen"
  34. :bofang="issbofang"
  35. :chooseWindow="selectWindow"
  36. :chooseData="bofangyuan"
  37. :companyVideoData="this.bigData.data"
  38. @init="HKbigCamaraInit"
  39. ref="hkbigCamara" />
  40. </div>
  41. </div>
  42. <div class="full_video_list">
  43. <div class="full_video_list_card">
  44. <a style="float: left">采集卡视频</a>
  45. <div class="full_video_list_card_list" >
  46. <el-table
  47. :data="pagedData_bigcardData"
  48. :header-cell-style="changeHeaderCellStyle"
  49. :cell-style="changeCellStyle"
  50. stripe:border="true"
  51. >
  52. <el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="getTableIndex_bigcardData" />
  53. <el-table-column label="名称" align="center" prop="name" />
  54. <el-table-column label="播放窗口" align="center" prop="windowList" />
  55. <el-table-column label="操作" align="center">
  56. <template slot-scope="scope">
  57. <el-button class="table-btn primary" size="mini" type="text" @click="begin_bigcardData(scope)">播放</el-button>
  58. <!-- <el-button class="table-btn primary" size="mini" type="text" @click="stopone_bigcardData(scope)">暂停当前</el-button>-->
  59. <el-button class="table-btn primary" size="mini" type="text" @click="stopall_bigcardData(scope)">暂停所有</el-button>
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. <el-row type="flex" justify="end" style="margin-top: 10px;">
  64. <el-pagination
  65. :total="this.bigcardData.length"
  66. :current-page="this.bigcardData.currentPage"
  67. :page-size="this.bigcardData.pageSize"
  68. :page-sizes="[5,10,15, 20]"
  69. layout="total, prev, pager, next, sizes"
  70. @current-change="onCurrentPageChange_bigcardData"
  71. @size-change="onPageSizeChange_bigcardData">
  72. </el-pagination>
  73. </el-row>
  74. </div>
  75. </div>
  76. <div class="full_video_list_camara">
  77. <a style="float: left">监控视频</a>
  78. <div class="full_video_list_camara_list" >
  79. <el-row class="task_item_body1" >
  80. <el-col :span="24" >
  81. <el-table
  82. :data="pagedData_bigcamaraData"
  83. :header-cell-style="changeHeaderCellStyle"
  84. :cell-style="changeCellStyle"
  85. stripe:border="true"
  86. >
  87. <el-table-column label="序号" header-align="center" align="center" type="index" width="55px" :index="getTableIndex_bigcamaraData" />
  88. <el-table-column label="名称" align="center" prop="name" />
  89. <el-table-column label="播放窗口" align="center" prop="windowList" />
  90. <el-table-column label="操作" align="center">
  91. <template slot-scope="scope">
  92. <el-button class="table-btn primary" size="mini" type="text" @click="begin_bigcamaraData(scope)">播放</el-button>
  93. <!-- <el-button class="table-btn primary" size="mini" type="text" @click="stopone_bigcamaraData(scope)">暂停当前</el-button>-->
  94. <el-button class="table-btn primary" size="mini" type="text" @click="stopall_bigcamaraData(scope)">暂停所有</el-button>
  95. </template>
  96. </el-table-column>
  97. </el-table>
  98. <el-row type="flex" justify="end" style="margin-top: 10px;">
  99. <el-pagination
  100. :total="this.bigcamaraData.length"
  101. :current-page="this.bigcamaraData.currentPage"
  102. :page-size="this.bigcamaraData.pageSize"
  103. :page-sizes="[5,10,15, 20]"
  104. layout="total, prev, pager, next, sizes"
  105. @current-change="onCurrentPageChange_bigcamaraData"
  106. @size-change="onPageSizeChange_bigcamaraData">
  107. </el-pagination>
  108. </el-row>
  109. </el-col>
  110. </el-row>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </v-scale-screen>
  117. </template>
  118. <script>
  119. import * as echarts from 'echarts';
  120. import myFlylineChartEnhanced from '../components/my-flyline-chart-enhanced/index'
  121. import myscrollBoard from '../components/myscroll-board/src/main'
  122. import sacleBox from '../components/sacle-box/index'
  123. import { request } from '../utils/request';
  124. var uploadedDataURL = require('../../public/json/taiyuan.json')
  125. import './taskScreen.css'
  126. import Videojs from "video.js"; // 引入Videojs
  127. import MonitorHK from '../components/hk/monitorHK.vue';
  128. import {isInteger, toInteger} from "lodash";
  129. export default {
  130. name: 'monitorScreen',
  131. components:{
  132. myFlylineChartEnhanced,
  133. sacleBox,
  134. myscrollBoard,
  135. MonitorHK
  136. },
  137. props: {
  138. title: {
  139. type: String,
  140. default: ''
  141. },
  142. videoData: {
  143. type: Array
  144. },
  145. },
  146. data() {
  147. return {
  148. radio1: '1',
  149. options: [{
  150. value: 4,
  151. label: '1'
  152. }, {
  153. value: 4,
  154. label: '4'
  155. }, {
  156. value: 9,
  157. label: '9'
  158. }, {
  159. value: 16,
  160. label: '16'
  161. }, {
  162. value: 25,
  163. label: '25'
  164. }],
  165. selectedScreen: 1,
  166. selectWindow:0,
  167. bofangyuan:{
  168. window:0,
  169. data:[],
  170. Password: "sgw123456",
  171. Port: "80",
  172. Username: "admin",
  173. channelName: "test1",
  174. ip: "172.3.11.115",
  175. name: "11",
  176. isbofang:0,
  177. windowList:[]
  178. },
  179. issbofang:0,
  180. dataSrc:'https://cctvwbndbd.a.bdydns.com/cctvwbnd/cctv1_2/index.m3u8?BR=single',
  181. playerList:[],
  182. isShow: false,
  183. HKbigCamaraShow: false,
  184. HKbigCardShow: false,
  185. bigData: {
  186. // header: ['0','1', '2', '3','4', '5', '6','7'],
  187. // waitTime:1500,
  188. data: [{
  189. windowList:[]
  190. }],
  191. length:0,
  192. currentPage:1,
  193. pageSize:3,
  194. paged:true,
  195. },
  196. bigcamaraData:{
  197. // header: ['0','1', '2', '3','4', '5', '6','7'],
  198. // waitTime:1500,
  199. data: [{
  200. windowList:[]
  201. }],
  202. length:0,
  203. currentPage:1,
  204. pageSize:5,
  205. paged:true,
  206. },
  207. bigcardData:{
  208. // header: ['0','1', '2', '3','4', '5', '6','7'],
  209. // waitTime:1500,
  210. data: [{
  211. windowList:[]
  212. }],
  213. length:0,
  214. currentPage:1,
  215. pageSize:5,
  216. paged:true,
  217. },
  218. subjectName:'',
  219. taskId:'',
  220. bigcamaraSrc: ["", "", "", "", ""],
  221. bigcamaraName: ["监控名称", "监控名称", "监控名称", "监控名称", "监控名称"],
  222. bigcardName:[],
  223. bigcardSrc:[],
  224. }
  225. },
  226. computed:{
  227. pagedData_bigcamaraData() { // 动态计算当前页的数据
  228. const start = (this.bigcamaraData.currentPage - 1) * this.bigcamaraData.pageSize
  229. const end = start + this.bigcamaraData.pageSize
  230. if(this.bigcamaraData.data!=null){
  231. console.log("hhhh1: ",start+"---"+end )
  232. console.log("hhhh2: ",this.bigcamaraData.data )
  233. console.log("hhhh3: ",this.bigcamaraData.data.slice(start, end) )
  234. return this.bigcamaraData.data.slice(start, end)
  235. }else{
  236. return null
  237. }
  238. },
  239. pagedData_bigcardData() { // 动态计算当前页的数据
  240. const start = (this.bigcardData.currentPage - 1) * this.bigcardData.pageSize
  241. const end = start + this.bigcardData.pageSize
  242. if(this.bigcardData.data!=null){
  243. console.log("hhhh1: ",start+"---"+end )
  244. console.log("hhhh2: ",this.bigcardData.data )
  245. console.log("hhhh3: ",this.bigcardData.data.slice(start, end) )
  246. return this.bigcardData.data.slice(start, end)
  247. }else{
  248. return null
  249. }
  250. }
  251. },
  252. methods:{
  253. async handleChangeWindow(value) {
  254. console.log("当前更新的窗口",value)
  255. this.selectWindow=value
  256. console.log("this.selectWindow",this.selectWindow)
  257. },
  258. updateSelectedButton(button) {
  259. console.log("更新button",this.selectedScreen,button)
  260. this.selectedScreen = button;
  261. },
  262. bofang1(){
  263. console.log("播放1",this.bigcardData)
  264. console.log("播放2",this.bigcamaraData)
  265. this.bigData=this.bigcardData
  266. // this.handleChange()
  267. },
  268. bofang2(){
  269. console.log("播放2",this.bigcamaraData)
  270. this.bigData=this.bigcamaraData
  271. },
  272. checkWindow(){
  273. let that = this
  274. console.log("this.selectWindow1",this.selectWindow)
  275. let xuanzhongchuangkou = this.selectWindow
  276. //播放前先停止当前窗口播放其他视频
  277. this.bigcamaraData.data.forEach(function(obj,index) {
  278. console.log(index);
  279. // console.log(obj);
  280. console.log(obj.windowList);
  281. if (obj.windowList.length != 0) {
  282. obj.windowList.forEach(function (obj, index) {
  283. console.log("camaraData序号,数值",index,obj);
  284. if (parseInt(obj) == xuanzhongchuangkou) {//该窗口已播放视频
  285. console.log("cardData该窗口已播放视频",this,that);
  286. that.$refs.hkbigCamara.stopPlayVideo()
  287. //删除窗口显示
  288. that.bigcamaraData.data[index].windowList = that.bigcamaraData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  289. // if(that.$refs.hkbigCamara.stopPlayVideo()){
  290. // that.bigcamaraData.data[index].windowList = that.bigcamaraData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  291. // }
  292. }
  293. })
  294. }
  295. }),
  296. this.bigcardData.data.forEach(function(obj,index) {
  297. console.log(index);
  298. // console.log(obj);
  299. console.log(obj.windowList);
  300. if(obj.windowList.length!=0){
  301. obj.windowList.forEach(function(obj,index) {
  302. console.log("cardData序号,数值",index,obj);
  303. if(parseInt(obj)==xuanzhongchuangkou){//该窗口已播放视频
  304. console.log("cardData该窗口已播放视频",this,that);
  305. that.$refs.hkbigCamara.stopPlayVideo() //暂停播放该视频
  306. //删除窗口显示
  307. that.bigcardData.data[index].windowList = that.bigcardData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  308. // if(that.$refs.hkbigCamara.stopPlayVideo()){
  309. // that.bigcardData.data[index].windowList = that.bigcardData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  310. // }
  311. }
  312. })
  313. }
  314. });
  315. },
  316. begin_bigcamaraData (a) {
  317. // let that = this
  318. if(this.bigcamaraData.data[a.$index].windowList.length<6) {
  319. // console.log("this.selectWindow1",this.selectWindow)
  320. // let xuanzhongchuangkou = this.selectWindow
  321. // //播放前先停止当前窗口播放其他视频
  322. // this.bigcamaraData.data.forEach(function(obj,index) {
  323. // console.log(index);
  324. // // console.log(obj);
  325. // console.log(obj.windowList);
  326. // if (obj.windowList.length != 0) {
  327. // obj.windowList.forEach(function (obj, index) {
  328. // console.log("camaraData序号,数值",index,obj);
  329. // if (parseInt(obj) == xuanzhongchuangkou) {//该窗口已播放视频
  330. // console.log("cardData该窗口已播放视频",this,that);
  331. // that.$refs.hkbigCamara.stopPlayVideo()
  332. // //删除窗口显示
  333. // that.bigcamaraData.data[index].windowList = that.bigcamaraData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  334. // }
  335. // })
  336. // }
  337. // }),
  338. //
  339. // this.bigcardData.data.forEach(function(obj,index) {
  340. // console.log(index);
  341. // // console.log(obj);
  342. // console.log(obj.windowList);
  343. // if(obj.windowList.length!=0){
  344. // obj.windowList.forEach(function(obj,index) {
  345. // console.log("cardData序号,数值",index,obj);
  346. // if(parseInt(obj)==xuanzhongchuangkou){//该窗口已播放视频
  347. // console.log("cardData该窗口已播放视频",this,that);
  348. // that.$refs.hkbigCamara.stopPlayVideo() //暂停播放该视频
  349. // //删除窗口显示
  350. // that.bigcardData.data[index].windowList = that.bigcardData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  351. // }
  352. // })
  353. // }
  354. // });
  355. this.checkWindow()
  356. console.log("a", a)
  357. console.log("a.index", a.$index)
  358. console.log(" this.bigcamaraData", this.bigcamaraData)
  359. this.bofangyuan.Password = a.row.Password
  360. this.bofangyuan.Port = a.row.Port
  361. this.bofangyuan.Username = a.row.Username
  362. this.bofangyuan.channelName = a.row.channelName
  363. this.bofangyuan.ip = a.row.ip
  364. this.bofangyuan.name = a.row.name
  365. this.bofangyuan.window = this.selectWindow
  366. this.bofangyuan.isbofang = 1
  367. this.issbofang = 1
  368. console.log("this.bigcamaraData.data[a.$index]", this.bigcamaraData.data[a.$index])
  369. console.log("this.bofangyuan", this.bofangyuan)
  370. // 定义一个空数组对象
  371. let myArray = [];
  372. // 将对象添加到数组中
  373. myArray.push(this.bofangyuan);
  374. console.log(myArray);
  375. if(this.$refs.hkbigCamara.login(myArray)){
  376. this.bigcamaraData.data[a.$index].windowList.push(this.selectWindow.toString())
  377. this.bigcamaraData.data[a.$index].windowList = [...new Set(this.bigcamaraData.data[a.$index].windowList)]
  378. this.bigcamaraData.data[a.$index].windowList.sort((a, b) => a - b);
  379. }
  380. // this.$refs.hkbigCamara.login(myArray).catch(error => {
  381. // // 捕获错误并获取错误代码
  382. // const errorCode = error.errorCode;
  383. // console.log(errorCode);
  384. // if (errorCode == 2001) {//继续播放
  385. }
  386. },
  387. stopone_bigcamaraData(a){
  388. this.$refs.hkbigCamara.stopPlayVideo()
  389. this.bigcamaraData.data[a.$index].windowList = this.bigcamaraData.data[a.$index].windowList.filter((element) => element !== this.selectWindow.toString());
  390. },
  391. stopall_bigcamaraData(a){
  392. console.log("windowList",this.bigcamaraData.data[a.$index].windowList)
  393. this.$refs.hkbigCamara.stopallPlayVideo(this.bigcamaraData.data[a.$index].windowList)
  394. this.bigcamaraData.data[a.$index].windowList.splice(0, this.bigcamaraData.data[a.$index].windowList.length)
  395. },
  396. stopone_bigcardData(a){
  397. this.$refs.hkbigCamara.stopPlayVideo()
  398. this.bigcardData.data[a.$index].windowList = this.bigcardData.data[a.$index].windowList.filter((element) => element !== this.selectWindow.toString());
  399. },
  400. stopall_bigcardData(a){
  401. console.log("windowList",this.bigcardData.data[a.$index].windowList)
  402. this.$refs.hkbigCamara.stopallPlayVideo(this.bigcardData.data[a.$index].windowList)
  403. this.bigcardData.data[a.$index].windowList.splice(0, this.bigcardData.data[a.$index].windowList.length)
  404. },
  405. begin_bigcardData (a) {
  406. // let that = this
  407. if(this.bigcardData.data[a.$index].windowList.length<6){
  408. // console.log("this.selectWindow",this.selectWindow)
  409. // let xuanzhongchuangkou = this.selectWindow
  410. // //播放前先停止当前窗口播放其他视频
  411. // this.bigcamaraData.data.forEach(function(obj,index) {
  412. // console.log(index);
  413. // // console.log(obj);
  414. // console.log(obj.windowList);
  415. // if (obj.windowList.length != 0) {
  416. // obj.windowList.forEach(function (obj, index) {
  417. // console.log("camaraData序号,数值",index,obj);
  418. // if (parseInt(obj) == xuanzhongchuangkou) {//该窗口已播放视频
  419. // console.log("cardData该窗口已播放视频",this,that);
  420. // that.$refs.hkbigCamara.stopPlayVideo()
  421. // //删除窗口显示
  422. // that.bigcamaraData.data[index].windowList = that.bigcamaraData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  423. // }
  424. // })
  425. // }
  426. // }),
  427. // this.bigcardData.data.forEach(function(obj,index) {
  428. // console.log(index);
  429. // // console.log(obj);
  430. // console.log(obj.windowList);
  431. // if(obj.windowList.length!=0){
  432. // obj.windowList.forEach(function(obj,index) {
  433. // console.log("cardData序号,数值",index,obj);
  434. // if(parseInt(obj)==xuanzhongchuangkou){//该窗口已播放视频
  435. // console.log("cardData该窗口已播放视频",this,that);
  436. // that.$refs.hkbigCamara.stopPlayVideo() //暂停播放该视频
  437. // //删除窗口显示
  438. // that.bigcardData.data[index].windowList = that.bigcardData.data[index].windowList.filter((element) => element !== that.selectWindow.toString());
  439. // }
  440. // })
  441. // }
  442. // });
  443. this.checkWindow()
  444. console.log("a",a)
  445. console.log("a.index",a.$index)
  446. console.log(" this.bigcardData", this.bigcardData)
  447. this.bofangyuan.Password= a.row.Password
  448. this.bofangyuan.Port=a.row.Port
  449. this.bofangyuan.Username=a.row.Username
  450. this.bofangyuan.channelName=a.row.channelName
  451. this.bofangyuan.ip=a.row.ip
  452. this.bofangyuan.name=a.row.name
  453. this.bofangyuan.window=this.selectWindow
  454. this.bofangyuan.isbofang=1
  455. this.issbofang=1
  456. console.log("this.bigcardData.data[a.$index]",this.bigcardData.data[a.$index])
  457. console.log("this.bofangyuan",this.bofangyuan)
  458. // 定义一个空数组对象
  459. let myArray = [];
  460. // 将对象添加到数组中
  461. myArray.push(this.bofangyuan);
  462. console.log(myArray);
  463. if(this.$refs.hkbigCamara.login(myArray)){
  464. this.bigcardData.data[a.$index].windowList.push(this.selectWindow.toString())
  465. this.bigcardData.data[a.$index].windowList = [...new Set(this.bigcardData.data[a.$index].windowList)]
  466. this.bigcardData.data[a.$index].windowList.sort((a, b) => a - b);
  467. }
  468. }
  469. },
  470. /**
  471. * 表格排序字段变化
  472. * @param {String} prop 排序字段的字段名
  473. * @param {String} order 正序还是倒序
  474. */
  475. onSortChange ({ prop, order }) {
  476. console.log("h3:",prop,order)
  477. this.orderInfo.fieldName = prop;
  478. this.orderInfo.asc = (order === 'ascending');
  479. this.refreshTable();
  480. },
  481. pagedData_bigcamaraData1() { // 动态计算当前页的数据
  482. const start = (this.bigcamaraData.currentPage - 1) * this.bigcamaraData.pageSize
  483. const end = start + this.bigcamaraData.pageSize
  484. if(this.bigcamaraData.data!=null){
  485. console.log("hhhh1: ",start+"---"+end )
  486. console.log("hhhh2: ",this.bigcamaraData.data )
  487. console.log("hhhh3: ",this.bigcamaraData.data.slice(start, end) )
  488. return this.bigcamaraData.data.slice(start, end)
  489. }else{
  490. return null
  491. }
  492. },
  493. // 表格样式修改
  494. changeHeaderCellStyle(row,column, rowIndex, columnIndex){
  495. if(row.columnIndex === 0){
  496. return 'background: #004279 ; color:#fff;'; // 修改的样式
  497. }else {
  498. return 'background: #004279 ;color:#fff; ';
  499. }
  500. },
  501. changeCellStyle(row,column, rowIndex, columnIndex){
  502. if(row.columnIndex === 0){
  503. return 'background: #0A427C ; color:#fff;'; // 修改的样式
  504. }else {
  505. return 'background: #0A427C ; color:#fff;';
  506. }
  507. },
  508. /**
  509. * 获取每一行的index信息
  510. * @param {Integer} index 表格在本页位置
  511. */
  512. getTableIndex_bigcamaraData (index) {
  513. let a
  514. console.log("参数20: "+this.bigcamaraData.data,this.bigcardData.data,this.bigData.data)
  515. console.log("参数: "+this.bigcamaraData.paged+" "+this.bigcamaraData.pageSize+" "+index)
  516. a=((this.bigcamaraData.currentPage - 1) * this.bigcamaraData.pageSize + (index + 1))
  517. console.log(".....a "+a)
  518. return a;
  519. },
  520. onCurrentPageChange_bigcamaraData (newCurrentPage) {
  521. console.log("1: ",newCurrentPage )
  522. console.log("2: ",this.bigcamaraData.pageSize )
  523. console.log("3: ",this.oldPage)
  524. this.loadTableDataImpl_bigcamaraData(newCurrentPage, this.bigcamaraData.pageSize).then(() => {//数据加载成功
  525. this.bigcamaraData.currentPage = newCurrentPage;
  526. this.oldPage = this.bigcamaraData.currentPage-1
  527. console.log("4: ",newCurrentPage)
  528. console.log("5: ",this.bigcamaraData.currentPage)
  529. console.log("6: ",this.oldPage)
  530. if(this.bigcamaraData.data.length <= newCurrentPage*this.bigcamaraData.pageSize ){
  531. this.bigcamaraData.paged=true
  532. }else{
  533. this.bigcamaraData.paged=false
  534. }
  535. }).catch(() => {//数据加载失败
  536. this.bigcamaraData.currentPage = this.oldPage;
  537. console.log("7: ",this.oldPage)
  538. console.log("8: ",this.bigcamaraData.currentPage)
  539. });
  540. },
  541. /**
  542. * 表格分页每页显示数量变化
  543. * @param {Integer} newPageSize 变化后的每页显示数量
  544. */
  545. onPageSizeChange_bigcamaraData (newPageSize) {
  546. console.log("hhhh2: ",newPageSize )
  547. this.bigcamaraData.pageSize = newPageSize;
  548. this.bigcamaraData.currentPage = 1
  549. this.loadTableDataImpl_bigcamaraData(1, newPageSize).then(() => {
  550. this.oldPage = this.bigcamaraData.currentPage;
  551. this.oldPageSize = this.bigcamaraData.pageSize;
  552. }).catch(e => {
  553. this.bigcamaraData.currentPage = this.oldPage;
  554. this.bigcamaraData.pageSize = this.oldPageSize;
  555. });
  556. },
  557. /**
  558. * 获取表格数据
  559. * @param {Integer} pageNum 当前分页
  560. * @param {Integer} pageSize 每页数量
  561. * @param {Boolean} reload 是否重新获取数据
  562. */
  563. loadTableDataImpl_bigcamaraData (pageNum, pageSize, reload = false) {
  564. console.log("11: ",pageNum+"---"+pageSize+"---"+reload)
  565. // 判断是否需要重新加载数据
  566. if (reload || !this.bigcamaraData.data || this.bigcamaraData.data.length === 0) {
  567. // 调用后端接口或其他数据来源获取数据
  568. // 这里省略具体实现
  569. // 模拟一个返回结果的 Promise 对象
  570. const mockData = new Promise(resolve => {
  571. const data = [];
  572. for (let i = 1; i <= pageSize; i++) {
  573. data.push({
  574. id: pageNum * pageSize + i,
  575. name: `任务${pageNum * pageSize + i}`,
  576. status: Math.floor(Math.random() * 4)
  577. });
  578. }
  579. resolve(data);
  580. });
  581. // 返回 Promise 对象,以便分页组件可以在数据加载完成后进行下一步处理。
  582. return mockData.then(data => {
  583. // 更新任务列表数据
  584. this.bigcamaraData.data = data;
  585. // 返回新的任务列表数据
  586. return this.bigcamaraData.data.slice((pageNum - 1) * pageSize, pageNum * pageSize);
  587. });
  588. } else {// 直接返回已有的任务列表数据
  589. console.log("112:")
  590. console.log("112_1:",pageNum ,pageSize)
  591. console.log("112_2:",this.bigcamaraData.data.slice((pageNum - 1) * pageSize,pageNum * pageSize))
  592. console.log("112_2:",Promise.resolve(this.bigcamaraData.data.slice((pageNum - 1) * pageSize,pageNum * pageSize)))
  593. return Promise.resolve(this.bigcamaraData.data.slice((pageNum - 1) * pageSize, pageNum * pageSize));
  594. }
  595. },
  596. /**
  597. * 获取每一行的index信息
  598. * @param {Integer} index 表格在本页位置
  599. */
  600. getTableIndex_bigcardData (index) {
  601. let a
  602. console.log("参数10: "+this.bigcamaraData.data,this.bigcardData.data,this.bigData.data)
  603. console.log("参数: "+this.bigcardData.paged+" "+this.bigcardData.pageSize+" "+index)
  604. a=((this.bigcardData.currentPage - 1) * this.bigcardData.pageSize + (index + 1))
  605. console.log(".....a "+a)
  606. return a;
  607. },
  608. onCurrentPageChange_bigcardData (newCurrentPage) {
  609. console.log("1: ",newCurrentPage )
  610. console.log("2: ",this.bigcardData.pageSize )
  611. console.log("3: ",this.oldPage)
  612. this.loadTableDataImpl_bigcardData(newCurrentPage, this.bigcardData.pageSize).then(() => {//数据加载成功
  613. this.bigcardData.currentPage = newCurrentPage;
  614. this.oldPage = this.bigcardData.currentPage-1
  615. console.log("4: ",newCurrentPage)
  616. console.log("5: ",this.bigcardData.currentPage)
  617. console.log("6: ",this.oldPage)
  618. if(this.bigcardData.data.length <= newCurrentPage*this.bigcardData.pageSize ){
  619. this.bigcardData.paged=true
  620. }else{
  621. this.bigcardData.paged=false
  622. }
  623. }).catch(() => {//数据加载失败
  624. this.bigcardData.currentPage = this.oldPage;
  625. console.log("7: ",this.oldPage)
  626. console.log("8: ",this.bigcardData.currentPage)
  627. });
  628. },
  629. /**
  630. * 表格分页每页显示数量变化
  631. * @param {Integer} newPageSize 变化后的每页显示数量
  632. */
  633. onPageSizeChange_bigcardData (newPageSize) {
  634. console.log("hhhh2: ",newPageSize )
  635. this.bigcardData.pageSize = newPageSize;
  636. this.bigcardData.currentPage = 1
  637. this.loadTableDataImpl_bigcardData(1, newPageSize).then(() => {
  638. this.oldPage = this.bigcardData.currentPage;
  639. this.oldPageSize = this.bigcardData.pageSize;
  640. }).catch(e => {
  641. this.bigcardData.currentPage = this.oldPage;
  642. this.bigcardData.pageSize = this.oldPageSize;
  643. });
  644. },
  645. /**
  646. * 获取表格数据
  647. * @param {Integer} pageNum 当前分页
  648. * @param {Integer} pageSize 每页数量
  649. * @param {Boolean} reload 是否重新获取数据
  650. */
  651. loadTableDataImpl_bigcardData (pageNum, pageSize, reload = false) {
  652. console.log("11: ",pageNum+"---"+pageSize+"---"+reload)
  653. // 判断是否需要重新加载数据
  654. if (reload || !this.bigcardData.data || this.bigcardData.data.length === 0) {
  655. // 调用后端接口或其他数据来源获取数据
  656. // 这里省略具体实现
  657. // 模拟一个返回结果的 Promise 对象
  658. const mockData = new Promise(resolve => {
  659. const data = [];
  660. for (let i = 1; i <= pageSize; i++) {
  661. data.push({
  662. id: pageNum * pageSize + i,
  663. name: `任务${pageNum * pageSize + i}`,
  664. status: Math.floor(Math.random() * 4)
  665. });
  666. }
  667. resolve(data);
  668. });
  669. // 返回 Promise 对象,以便分页组件可以在数据加载完成后进行下一步处理。
  670. return mockData.then(data => {
  671. // 更新任务列表数据
  672. this.bigcardData.data = data;
  673. // 返回新的任务列表数据
  674. return this.bigcardData.data.slice((pageNum - 1) * pageSize, pageNum * pageSize);
  675. });
  676. } else {// 直接返回已有的任务列表数据
  677. return Promise.resolve(this.bigcardData.data.slice((pageNum - 1) * pageSize, pageNum * pageSize));
  678. }
  679. },
  680. init(){
  681. // this.bigcamaraData=this.$route.query.camaraData
  682. // this.bigcardData=this.$route.query.cardData
  683. this.subjectName=this.$route.query.subjectInfo1
  684. this.taskId=this.$route.query.subjectInfo2
  685. // this.init('步坦协同课目')
  686. console.log("0",this.subjectName,this.taskId)
  687. console.log("1",this.$route.query)
  688. this.initUrl()
  689. // console.log(this.bigcamaraData)
  690. // console.log("...")
  691. // console.log(this.bigcardData)
  692. },
  693. async initUrl() {
  694. this.bigData.data=[];
  695. let params = {
  696. subjectName: this.subjectName,
  697. taskId: this.taskId
  698. };
  699. this.currentSubject = this.subjectName;
  700. this.bigcamaraData.data = [];
  701. const res = await request("/dt_screen/rest/v2/video/videos/getSubjectUrls", "post", params, false);
  702. let index = 0;
  703. this.SubjectInfo1=params.subjectName
  704. this.SubjectInfo2=params.taskId
  705. this.SubjectInfo3=res.data.data
  706. console.log("cansgu1",params.subjectName,params.taskId)
  707. console.log("res1",res.data.data)
  708. this.bigcamaraSrc = ["", "", "", "", ""];
  709. this.bigcamaraName = ["监控名称", "监控名称", "监控名称", "监控名称", "监控名称"];
  710. // console.log()
  711. for (let item in res.data.data) {
  712. // this.camaraSrc[index] = res.data.data[item].url;
  713. // this.camaraName[index++] = res.data.data[item].name;
  714. let data = {
  715. name: res.data.data[item].name,
  716. ip: res.data.data[item].ip,
  717. Port: res.data.data[item].port,
  718. Username: res.data.data[item].username,
  719. Password: res.data.data[item].password,
  720. channelName: res.data.data[item].channelName,
  721. windowList:[]
  722. };
  723. this.bigcamaraData.data.push(data);
  724. this.bigData.data.push(data);
  725. }
  726. console.log('bigcamaraData :>> ', this.bigcamaraData.data);
  727. this.bigcamaraData.length=this.bigcamaraData.data.length
  728. setTimeout(() => {
  729. this.HKbigCamaraShow = true;
  730. }, 800);
  731. let params1 = {
  732. subjectName: this.subjectName,
  733. taskId: this.taskId
  734. };
  735. this.currentSubject = this.subjectName;
  736. this.bigcardData.data = [];
  737. const res1 = await request("/dt_screen/rest/v2/video/videos/getSubjectCardUrls", "post", params1, false);
  738. console.log("cansgu2",params.subjectName,params.taskId)
  739. console.log("res1",res1.data.data)
  740. let index1 = 0;
  741. this.bigcardSrc = ["", "", "", "", ""];
  742. this.bigcardName = ["监控名称", "监控名称", "监控名称", "监控名称", "监控名称"];
  743. for (let item in res1.data.data) {
  744. // this.cardSrc[index1] = res1.data.data[item].url;
  745. // this.cardName[index1++] = res1.data.data[item].name;
  746. let data = {
  747. name: res1.data.data[item].name,
  748. ip: res1.data.data[item].ip,
  749. Port: res1.data.data[item].port,
  750. Username: res1.data.data[item].username,
  751. Password: res1.data.data[item].password,
  752. channelName: res1.data.data[item].channelName,
  753. windowList:[]
  754. };
  755. this.bigcardData.data.push(data);
  756. this.bigData.data.push(data);
  757. }
  758. console.log('bigcardData :>> ', this.bigcardData.data);
  759. console.log('bigData :>> ', this.bigData.data);
  760. this.bigcardData.length=this.bigcardData.data.length
  761. },
  762. HKbigCamaraInit(){
  763. this.HKbigCamaraShow = true;
  764. },
  765. selectChange(val){
  766. // 此时 val 为当前对象
  767. console.log("isInteger1",isInteger(val))
  768. console.log("isInteger2",isInteger(parseInt(val)))
  769. this.selectedScreen =parseInt(val)
  770. // this.selectedScreen =val
  771. console.log(val)
  772. // this.num=this.selectedScreen
  773. // if (subjectName == '')
  774. // return;
  775. // if(subjectName != this.currentSubject) {
  776. // this.currentSubject = subjectName;
  777. // // this.$refs.hkv.stopAll();
  778. // // this.$refs.hkCard.stopAll();
  779. // this.camaraData = []
  780. // this.cardData = []
  781. // this.initUrl(subjectName);
  782. // }
  783. },
  784. showFull(){
  785. this.$router.push('/taskScreen')
  786. },
  787. // 初始化视频
  788. initVideo(nowPlayVideoUrl,id,isAuto) {
  789. let that =this
  790. // 这些options属性也可直接设置在video标签上,见 muted
  791. let options = {
  792. autoplay: isAuto, // 设置自动播放
  793. controls: true, // 显示播放的控件
  794. sources: [
  795. // 注意,如果是以option方式设置的src,是不能实现 换台的 (即使监听了nowPlayVideoUrl也没实现)
  796. {
  797. src: nowPlayVideoUrl,
  798. type: "application/x-mpegURL" // 告诉videojs,这是一个hls流
  799. }
  800. ]
  801. };
  802. // videojs的第一个参数表示的是,文档中video的id
  803. const myPlyer= Videojs(id, options, function onPlayerReady() {
  804. console.log("onPlayerReady 中的this指的是:", this); // 这里的this是指Player,是由Videojs创建出来的实例
  805. console.log(myPlyer === this); // 这里返回的是true
  806. });
  807. this.playerList.push(myPlyer)
  808. }
  809. },
  810. created(){
  811. // this.videoData = this.$route.query.videoData;
  812. // console.log(this.$route.query.videoData);
  813. // this.videoData = JSON.parse(this.$route.query.videoData);
  814. this.init();
  815. },
  816. mounted(){
  817. // this.init();
  818. },
  819. beforeDestroy() {
  820. if(this.playerList.length){
  821. this.playerList.forEach((item)=>{
  822. item.dispose()
  823. })
  824. }
  825. },
  826. }
  827. </script>
  828. <style scoped>
  829. .player {
  830. background-color: #d9b3b3;
  831. height: 50%;
  832. width: 50%;
  833. border: 1px solid white;
  834. color: white;
  835. text-align: center;
  836. }
  837. .monitor_video_box {
  838. display: flex;
  839. align-items: flex-start;
  840. color: #fff;
  841. height: 100%;
  842. width: 100%;
  843. padding: 10px;
  844. box-sizing: border-box;
  845. }
  846. .full_video_box {
  847. width: 80%;
  848. height: 100%;
  849. /* border:1px solid red; */
  850. padding: 10px;
  851. box-sizing: border-box;
  852. background-image:url('../assets/img/opitty.png');
  853. background-repeat:no-repeat;
  854. background-size:100% 100%;
  855. margin-right: 15px;
  856. }
  857. .full_video_list {
  858. width: 20%;
  859. height: 100%;
  860. /*border:1px solid yellow;*/
  861. /*padding:17px 10px 10px 10px;*/
  862. /*box-sizing: border-box;*/
  863. /*background-image:url('../assets/img/opitty.png');*/
  864. /*background-repeat:no-repeat;*/
  865. /*background-size:100% 100%;*/
  866. /*background: #0027a8;*/
  867. }
  868. .full_video_list_card {
  869. width: 100%;
  870. height: 49%;
  871. /*border:1px solid yellow;*/
  872. padding:17px 10px 10px 10px;
  873. box-sizing: border-box;
  874. background-image:url('../assets/img/opitty.png');
  875. background-repeat:no-repeat;
  876. background-size:100% 100%;
  877. background: #004279;
  878. }
  879. .full_video_list_card_list{
  880. margin-top: 30px;
  881. }
  882. .full_video_list_camara{
  883. position: relative;
  884. z-index: 1;
  885. margin-top: 4%;
  886. width: 100%;
  887. height: 49%;
  888. /*border:1px solid yellow;*/
  889. padding:17px 10px 10px 10px;
  890. box-sizing: border-box;
  891. background-image:url('../assets/img/opitty.png');
  892. background-repeat:no-repeat;
  893. background-size:100% 100%;
  894. /*background: #13864d;*/
  895. background: #004279;
  896. /*margin: 10px;*/
  897. }
  898. .full_video_list_camara_list{
  899. margin-top: 30px;
  900. }
  901. .video_title_new {
  902. font-size: 18px;
  903. font-weight: 600;
  904. margin: 10px 0;
  905. }
  906. .exit_box_hanlde {
  907. display: flex;
  908. justify-content: end;
  909. padding-right: 4px;
  910. }
  911. #videoPlayerTask {
  912. width: 100%;
  913. height: 95%;
  914. }
  915. #videoPlayer_first {
  916. width: 419px;
  917. height: 182px;
  918. margin-right: 10px;
  919. margin-bottom: 10px;
  920. }
  921. #videoPlayer_second {
  922. width: 419px;
  923. height: 182px;
  924. margin-bottom: 10px;
  925. }
  926. #videoPlayer_third {
  927. width: 419px;
  928. height: 182px;
  929. margin-right: 10px;
  930. margin-bottom: 10px;
  931. }
  932. #videoPlayer_fourth {
  933. width: 419px;
  934. height: 182px;
  935. }
  936. </style>