TVWall.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <template>
  2. <div>
  3. <el-dialog title="电视墙" :visible.sync="TVWallVisible" v-if="TVWallVisible" customClass="TVWallCustomWidth"
  4. @close="cancelEventLocationShow()">
  5. <!--<div class="forthis" style="width: 22%; position: absolute;left: 0;z-index: 9999999999999;">-->
  6. <!--&lt;!&ndash; <div class="this-title">-->
  7. <!--<span>林场</span>-->
  8. <!--<span>45</span>-->
  9. <!--</div> &ndash;&gt;-->
  10. <!--<div class="i-list-con" style="height: 46vh; overflow-y: scroll;">-->
  11. <!--<span v-for="(item,index) in cameraList" :key="index">-->
  12. <!--<div class="d-l-con" @click="playhk(item.channelCode)">-->
  13. <!--<div class="d-l-l-text">-->
  14. <!--<i class="i-small"></i>-->
  15. <!--<h4>{{ item.cameraName }}</h4>-->
  16. <!--</div>-->
  17. <!--</div>-->
  18. <!--</span>-->
  19. <!--</div>-->
  20. <!--</div>-->
  21. <!--<div style="width:70%;height:400px;position:absolute;">-->
  22. <!--&lt;!&ndash;视频窗口展示-&#45;&#45;大华&ndash;&gt;-->
  23. <!--<div id="dom1" class="dom1"></div>-->
  24. <!--&lt;!&ndash;视频窗口展示-&#45;&#45;海康&ndash;&gt;-->
  25. <!--<div id="playWnd" class="playWnd" style="left: 0px; top: 0px;"></div>-->
  26. <!--</div>-->
  27. <div id="dom1" class="dom1"></div>
  28. </el-dialog>
  29. </div>
  30. </template>
  31. <script>
  32. /** ----------------------------------摄像头预览开始------------------------------------- */
  33. import { getDahuaVideoServer, getTVWallList } from '@/api/dahua/dahua'
  34. import { tvCameraList } from '@/api/haikang/haikang'
  35. import DHWs from '@/dahua/lib/DHWs'
  36. import { rotation } from '@/api/monitor'
  37. /** ----------------------------------摄像头预览结束------------------------------------- */
  38. export default {
  39. dicts: ['event_source'],
  40. components: {},
  41. data() {
  42. return {
  43. tvListJson: [
  44. {
  45. 'switchTab': '1',
  46. 'treeLabels': [
  47. {
  48. 'labelCode': '123456',
  49. 'labelName': '视频场景',
  50. 'parentLabelCode': null
  51. },
  52. {
  53. 'labelCode': '5a81d1bd499b4940a21fc63ca51f4dfa',
  54. 'labelName': '标签2',
  55. 'parentLabelCode': 123456
  56. },
  57. {
  58. 'labelCode': 'd941adbbd3e64dac92cc448dec5293cd',
  59. 'labelName': '标签1',
  60. 'parentLabelCode': 123456
  61. }
  62. ],
  63. 'labelChannels': [{
  64. 'channelDates': [{
  65. 'channelCode': '6044981090191552',
  66. 'channelName': '复兴大桥中段-交通事故',
  67. 'channelSn': null,
  68. 'cameraType': 0,
  69. 'online': 1
  70. },
  71. {
  72. 'channelCode': 'ZgVzqsjwA1DTF561VGHK5E',
  73. 'channelName': '北京7青羊东二路77号2通道1',
  74. 'channelSn': null,
  75. 'cameraType': 1,
  76. 'online': 1
  77. }
  78. ],
  79. 'labelCode': 'd941adbbd3e64dac92cc448dec5293cd'
  80. },
  81. {
  82. 'channelDates': [{
  83. 'channelCode': 'ZgVzqsjwA1DTF561VGHKK7',
  84. 'channelName': '北京7青羊东二路77号2通道2',
  85. 'channelSn': null,
  86. 'cameraType': 2,
  87. 'online': 0
  88. }],
  89. 'labelCode': '5a81d1bd499b4940a21fc63ca51f4dfa'
  90. }
  91. ]
  92. },
  93. {
  94. 'switchTab': '2',
  95. 'labelChannels': [{
  96. 'channelDates': [{
  97. 'channelCode': 'ZgVzqsjwA1DTF561VGHK5E',
  98. 'channelName': '北京7青羊东二路77号2通道1',
  99. 'channelSn': null,
  100. 'cameraType': 1,
  101. 'online': 1
  102. },
  103. {
  104. 'channelCode': 'ZgVzqsjwA1DTF561VGHKK7',
  105. 'channelName': '北京7青羊东二路77号2通道2',
  106. 'channelSn': null,
  107. 'cameraType': 2,
  108. 'online': 0
  109. }
  110. ]
  111. }]
  112. }
  113. ],
  114. TVWallVisible: false,
  115. activeName: 'tv',
  116. channelId: ['ZgVzqsjwA1DTF561VHG69F'],
  117. /** ----------------------------------摄像头预览开始------------------------------------- */
  118. showModal: true,
  119. activePanel: 'key1',
  120. isLogin: false,
  121. loginType: '1',
  122. token: '',
  123. ctrlType: 'playerWin',
  124. https: 1,
  125. httpsList: [
  126. {
  127. value: 0,
  128. label: 0
  129. },
  130. {
  131. value: 1,
  132. label: 1
  133. }
  134. ],
  135. ctrlTypeList: [{
  136. value: 'playerWin',
  137. label: '播放控件'
  138. }, {
  139. value: 'realMonitorUI',
  140. label: '带设备树实时预览控件'
  141. }, {
  142. value: 'playbackUI',
  143. label: '带设备树视频回放控件'
  144. }, {
  145. value: 'TVWallUI',
  146. label: '视频上墙'
  147. }],
  148. ctrlList: [
  149. {
  150. value: 'ctrl1',
  151. label: '控件1'
  152. },
  153. {
  154. value: 'ctrl2',
  155. label: '控件2'
  156. },
  157. {
  158. value: 'ctrl3',
  159. label: '控件3'
  160. }
  161. ],
  162. splitList: [
  163. {
  164. value: 1,
  165. label: '1 * 1'
  166. },
  167. {
  168. value: 4,
  169. label: '2 * 2'
  170. },
  171. {
  172. value: 9,
  173. label: '3 * 3'
  174. }
  175. ],
  176. displayModeList: [
  177. {
  178. value: 1,
  179. label: '播放器预览模式'
  180. },
  181. {
  182. value: 2,
  183. label: '播放器回放模式'
  184. }
  185. ],
  186. mixedVideoDisplayModeList: [
  187. {
  188. value: 1,
  189. label: '播放实时视频'
  190. },
  191. {
  192. value: 2,
  193. label: '播放回放视频'
  194. }
  195. ],
  196. ctrl: 'ctrl1',
  197. splitNum: 1,
  198. displayMode: 1,
  199. displayTimeRange: [],
  200. modalDisplayTimeRange: [],
  201. mixedVideoTime: null,
  202. recordPath: 'C:\\DSS LightWeight\\DSS LightWeight Client\\Record\\',
  203. downloadName: '',
  204. downTimeRange: [],
  205. downloadFormat: 0,
  206. downloadFormatList: [{
  207. value: 0,
  208. label: 'dav'
  209. },
  210. {
  211. value: 1,
  212. label: 'avi'
  213. }, {
  214. value: 2,
  215. label: 'mp4'
  216. }],
  217. downloadSource: 3,
  218. downloadSourceList: [
  219. {
  220. value: 3,
  221. label: '中心录像'
  222. }, {
  223. value: 2,
  224. label: '设备录像'
  225. }],
  226. showDownloadStreamType: false,
  227. downloadStreamType: 1,
  228. downloadStreamTypeList: [{
  229. value: 1,
  230. label: '主码流'
  231. },
  232. {
  233. value: 2,
  234. label: '辅码流'
  235. },
  236. {
  237. value: 3,
  238. label: '三码流'
  239. }],
  240. downloadIsShow: true,
  241. downloadIsShowList: [{
  242. value: true,
  243. label: '是'
  244. },
  245. {
  246. value: false,
  247. label: '否'
  248. }],
  249. crtPosX: 0,
  250. crtPosY: 0,
  251. crtWidth: 1150,
  252. crtHeight: 700,
  253. domId: 'dom1',
  254. mixedVideoDisplayMode: 2,
  255. isShowTipe: true,
  256. /** ----------------------------------摄像头预览结束------------------------------------- */
  257. cameraList:[],
  258. initCount: 0,
  259. pubKey: '',
  260. oWebControl: null
  261. }
  262. },
  263. created() {
  264. const DHWsInstance = DHWs.getInstance()
  265. this.ws = DHWsInstance
  266. },
  267. methods: {
  268. cancelEventLocationShow() {
  269. // this.activeName = 'tv'
  270. this.TVWallVisible = false
  271. this.destroy()
  272. if (this.oWebControl != null) {
  273. this.oWebControl.JS_HideWnd() // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
  274. this.oWebControl.JS_Disconnect().then(function() { // 断开与插件服务连接成功
  275. },
  276. function() { // 断开与插件服务连接失败
  277. })
  278. }
  279. },
  280. //火点联动电视墙调用
  281. showTVWall1(longitude,latitude,tvListJson) {
  282. // let that=this;
  283. /** ----------------------------------大华摄像头预览开始------------------------------------- */
  284. this.ws.addEventListener('connectStateChange', data => {
  285. if (data) {
  286. console.log('连接成功')
  287. } else {
  288. console.log('连接失败,下载客户端')
  289. this.alertReinstall()
  290. this.isShowTipe && this.$modal.confirm({
  291. title: '下载客户端',
  292. content: '检测到您未安装部分插件,将影响部分功能使用,请下载后使用?',
  293. onOk: () => {
  294. //这里写下载方法
  295. this.isShowTipe = false
  296. },
  297. onCancel: () => {
  298. this.isShowTipe = false
  299. }
  300. });
  301. }
  302. })
  303. getDahuaVideoServer().then(newResponse => {
  304. this.ws.detectConnectQt().then(res => {
  305. if (res) { // 连接客户端成功
  306. this.alertLogin()
  307. this.ws.login({
  308. loginIp: newResponse.loginIp,
  309. loginPort: newResponse.loginPort,
  310. userName: newResponse.userName,
  311. userPwd: newResponse.userPwd,
  312. // loginIp: '192.168.100.100',
  313. // loginPort: 8314,
  314. // userName: 'system',
  315. // userPwd: 'Admin@123',
  316. token: '',
  317. https: 1
  318. })
  319. this.ws.on('loginState', (res) => {
  320. this.isLogin = res
  321. console.log('---res-----', res)
  322. if (res) {
  323. this.alertLoginSuccess()
  324. this.activePanel = 'key2'
  325. console.log(tvListJson)
  326. const array=[]
  327. const array1=[]
  328. tvListJson[0].treeLabels.forEach((item,index)=>
  329. {
  330. if (index!=0)
  331. {
  332. const param =Object.assign({})
  333. param.channelId=item.labelCode
  334. array.push(param)
  335. array1.push(item.labelCode)
  336. }
  337. })
  338. this.create1(longitude,latitude,tvListJson,array,array1)
  339. // var obj=JSON.parse(tvListJson)
  340. } else {
  341. this.alertLoginFailed()
  342. }
  343. })
  344. } else { // 连接客户端失败
  345. this.alertReinstall()
  346. }
  347. })
  348. })
  349. /** ----------------------------------大华摄像头预览结束------------------------------------- */
  350. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  351. // tvCameraList().then(response => {
  352. // this.cameraList=response.data
  353. // })
  354. // that.initPlugin()
  355. // setTimeout(function() {
  356. // that.playhk();
  357. // }, 5000)
  358. // /** ----------------------------------海康摄像头预览结束------------------------------------- */
  359. this.TVWallVisible = true
  360. },
  361. create1(longitude,latitude,tvListJson,array,array1) { // 调用创建控件接口
  362. let _this = this
  363. const params = [
  364. {
  365. 'ctrlType': 'realMonitorUI',
  366. 'ctrlCode': 'ctrl1',
  367. 'ctrlProperty': {
  368. 'displayMode': 1,
  369. 'splitNum': 1,
  370. 'channelList': [
  371. {
  372. 'channelId': ''
  373. }
  374. ]
  375. },
  376. 'visible': true,
  377. 'domId': 'dom1'
  378. }
  379. ]
  380. this.setPos()
  381. this.customizeTree(tvListJson);
  382. _this.ws.createCtrl(params);
  383. _this.playRealMonitorVideo(array)
  384. setTimeout(() => {
  385. _this.rotation(longitude,latitude,array1)
  386. }, 5000)
  387. },
  388. playRealMonitorVideo(array) { // 自定义设备树自动播放指定通道编码视频
  389. const config = this.ws.config
  390. const { loginIp, userCode } = config
  391. this.ws.postMessage('playRealMonitorVideo', {
  392. loginIp,
  393. userCode,
  394. params: {
  395. ctrlCode: "ctrl1",
  396. array: array
  397. }
  398. })
  399. },
  400. rotation(lng,lat,list){
  401. rotation(lng,lat,list).then(res => {
  402. })
  403. },
  404. showTVWall() {
  405. // let that=this;
  406. /** ----------------------------------大华摄像头预览开始------------------------------------- */
  407. this.ws.addEventListener('connectStateChange', data => {
  408. if (data) {
  409. console.log('连接成功')
  410. } else {
  411. console.log('连接失败,下载客户端')
  412. this.alertReinstall()
  413. this.isShowTipe && this.$modal.confirm({
  414. title: '下载客户端',
  415. content: '检测到您未安装部分插件,将影响部分功能使用,请下载后使用?',
  416. onOk: () => {
  417. //这里写下载方法
  418. this.isShowTipe = false
  419. },
  420. onCancel: () => {
  421. this.isShowTipe = false
  422. }
  423. });
  424. }
  425. })
  426. this.preview()
  427. /** ----------------------------------大华摄像头预览结束------------------------------------- */
  428. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  429. // tvCameraList().then(response => {
  430. // this.cameraList=response.data
  431. // })
  432. // that.initPlugin()
  433. // setTimeout(function() {
  434. // that.playhk();
  435. // }, 5000)
  436. // /** ----------------------------------海康摄像头预览结束------------------------------------- */
  437. this.TVWallVisible = true
  438. },
  439. /** ----------------------------------大华摄像头预览开始------------------------------------- */
  440. alertLogin: function() {
  441. this.$modal.msg('登录中....')
  442. },
  443. alertLoginSuccess: function() {
  444. this.$modal.msgSuccess('登录成功!')
  445. },
  446. alertLoginFailed: function() {
  447. this.$modal.msgError('登陆失败!')
  448. },
  449. alertReinstall: function() {
  450. this.$modal.msgWarning('请重新安装客户端')
  451. },
  452. /** 预览按钮操作 */
  453. preview() {
  454. getTVWallList().then(newres => {
  455. getDahuaVideoServer().then(newResponse => {
  456. this.ws.detectConnectQt().then(res => {
  457. if (res) { // 连接客户端成功
  458. this.alertLogin()
  459. this.ws.login({
  460. loginIp: newResponse.loginIp,
  461. loginPort: newResponse.loginPort,
  462. userName: newResponse.userName,
  463. userPwd: newResponse.userPwd,
  464. // loginIp: '192.168.100.100',
  465. // loginPort: 8314,
  466. // userName: 'system',
  467. // userPwd: 'Admin@123',
  468. token: '',
  469. https: 1
  470. })
  471. this.ws.on('loginState', (res) => {
  472. this.isLogin = res
  473. console.log('---res-----', res)
  474. if (res) {
  475. this.alertLoginSuccess()
  476. this.activePanel = 'key2'
  477. this.create(newres.data)
  478. } else {
  479. this.alertLoginFailed()
  480. }
  481. })
  482. } else { // 连接客户端失败
  483. this.alertReinstall()
  484. }
  485. })
  486. })
  487. })
  488. },
  489. create(tvListJson) { // 调用创建控件接口
  490. let _this = this
  491. const params = [
  492. {
  493. 'ctrlType': 'realMonitorUI',
  494. 'ctrlCode': 'ctrl1',
  495. 'ctrlProperty': {
  496. 'displayMode': 1,
  497. 'splitNum': 1,
  498. 'channelList': [
  499. {
  500. 'channelId': ''
  501. }
  502. ]
  503. },
  504. 'visible': true,
  505. 'domId': 'dom1'
  506. }
  507. ]
  508. this.setPos()
  509. this.customizeTree(tvListJson);
  510. setTimeout(function () {
  511. _this.ws.createCtrl(params);
  512. }, 3000);
  513. },
  514. setPos() {
  515. let target = document.getElementById(this.domId)
  516. console.log(target, 'target')
  517. target.style.right = `${this.crtPosX}px`
  518. target.style.top = `${this.crtPosY}px`
  519. target.style.width = `${this.crtWidth}px`
  520. target.style.height = `${this.crtHeight}px`
  521. if (document.createEvent) {
  522. var event = document.createEvent('HTMLEvents')
  523. event.initEvent('resize', true, true)
  524. window.dispatchEvent(event)
  525. } else if (document.createEventObject) {
  526. window.fireEvent('onresize')
  527. }
  528. },
  529. destroy() { // 调用销毁控件接口
  530. if (!this.isLogin) {
  531. this.$modal.msgWarning('正在登陆客户端,请稍等......')
  532. return false
  533. }
  534. const ctrls = this.ws.ctrls.map(i => {
  535. if (i.ctrlCode === this.ctrl) {
  536. return i.ctrlCode
  537. }
  538. })
  539. this.ws.destroyCtrl(ctrls)
  540. },
  541. customizeTree(tvListJson) { // 调用控件接口树
  542. const config = this.ws.config
  543. const { loginIp, userCode } = config
  544. this.ws.postMessage('customizeTree', {
  545. loginIp,
  546. userCode,
  547. params: {
  548. array: tvListJson
  549. }
  550. })
  551. },
  552. /** ----------------------------------大华摄像头预览结束------------------------------------- */
  553. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  554. // 创建播放实例
  555. initPlugin() {
  556. let that=this
  557. that.oWebControl = new WebControl({
  558. szPluginContainer: 'playWnd', // 指定容器id
  559. iServicePortStart: 15900, // 指定起止端口号,建议使用该值
  560. iServicePortEnd: 15909,
  561. szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
  562. cbConnectSuccess: function() { // 创建WebControl实例成功
  563. that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
  564. dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
  565. }).then(function() { // 启动插件服务成功
  566. that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
  567. cbIntegrationCallBack: cbIntegrationCallBack
  568. })
  569. that.oWebControl.JS_CreateWnd('playWnd', 850, 615).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
  570. that.init() // 创建播放实例成功后初始化
  571. })
  572. }, function() { // 启动插件服务失败
  573. })
  574. },
  575. cbConnectError: function() { // 创建WebControl实例失败
  576. that.oWebControl = null
  577. $('#playWnd').html('插件未启动,正在尝试启动,请稍候...<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  578. WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
  579. initCount++
  580. if (initCount < 3) {
  581. setTimeout(function() {
  582. that.initPlugin()
  583. }, 3000)
  584. } else {
  585. $('#playWnd').html('插件启动失败,请检查插件是否安装!<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  586. }
  587. },
  588. cbConnectClose: function(bNormalClose) {
  589. // 异常断开:bNormalClose = false
  590. // JS_Disconnect正常断开:bNormalClose = true
  591. console.log('cbConnectClose')
  592. that.oWebControl = null
  593. }
  594. })
  595. },
  596. //初始化
  597. init() {
  598. let that=this
  599. this.getPubKey(function() {
  600. ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
  601. var appkey = '24699060' //综合安防管理平台提供的appkey,必填
  602. var secret = that.setEncrypt('tt1pMbsrlwGZUWucdAPw') //综合安防管理平台提供的secret,必填
  603. var ip = '36.49.108.22' //综合安防管理平台IP地址,必填
  604. var playMode = 0 //初始播放模式:0-预览,1-回放
  605. var port = 1443 //综合安防管理平台端口,若启用HTTPS协议,默认443
  606. var snapDir = 'D:\\SnapDir' //抓图存储路径
  607. var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
  608. var layout = '3x3' //playMode指定模式的布局
  609. var enableHTTPS = 1 //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
  610. var encryptedFields = 'secret' //加密字段,默认加密领域为secret
  611. var showToolbar = 1 //是否显示工具栏,0-不显示,非0-显示
  612. var showSmart = 1 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
  613. var buttonIDs = '0,16,256,257,258,259,260,512,513,514,515,516,517,768,769' //自定义工具条按钮
  614. ////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
  615. that.oWebControl.JS_RequestInterface({
  616. funcName: 'init',
  617. argument: JSON.stringify({
  618. appkey: appkey, //API网关提供的appkey
  619. secret: secret, //API网关提供的secret
  620. ip: ip, //API网关IP地址
  621. playMode: playMode, //播放模式(决定显示预览还是回放界面)
  622. port: port, //端口
  623. snapDir: snapDir, //抓图存储路径
  624. videoDir: videoDir, //紧急录像或录像剪辑存储路径
  625. layout: layout, //布局
  626. enableHTTPS: enableHTTPS, //是否启用HTTPS协议
  627. encryptedFields: encryptedFields, //加密字段
  628. showToolbar: showToolbar, //是否显示工具栏
  629. showSmart: showSmart, //是否显示智能信息
  630. buttonIDs: buttonIDs //自定义工具条按钮
  631. })
  632. }).then(function(oData) {
  633. that.oWebControl.JS_Resize(850, 615) // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
  634. })
  635. })
  636. },
  637. //获取公钥
  638. getPubKey(callback) {
  639. let that=this
  640. that.oWebControl.JS_RequestInterface({
  641. funcName: 'getRSAPubKey',
  642. argument: JSON.stringify({
  643. keyLength: 1024
  644. })
  645. }).then(function(oData) {
  646. console.log(oData)
  647. if (oData.responseMsg.data) {
  648. that.pubKey = oData.responseMsg.data
  649. callback()
  650. }125
  651. })
  652. },
  653. //RSA加密
  654. setEncrypt(value) {
  655. var encrypt = new JSEncrypt()
  656. encrypt.setPublicKey(this.pubKey)
  657. return encrypt.encrypt(value)
  658. },
  659. //播放海康摄像头
  660. playhk(channelCode){
  661. var cameraIndexCode = channelCode //获取输入的监控点编号值,必填
  662. var streamMode = 0 //主子码流标识:0-主码流,1-子码流
  663. var transMode = 1 //传输协议:0-UDP,1-TCP
  664. var gpuMode = 0 //是否启用GPU硬解,0-不启用,1-启用
  665. var wndId = -1 //播放窗口序号(在2x2以上布局下可指定播放窗口)
  666. cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, '')
  667. cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, '')
  668. this.oWebControl.JS_RequestInterface({
  669. funcName: 'startPreview',
  670. argument: JSON.stringify({
  671. cameraIndexCode: cameraIndexCode, //监控点编号
  672. streamMode: streamMode, //主子码流标识
  673. transMode: transMode, //传输协议
  674. gpuMode: gpuMode, //是否开启GPU硬解
  675. wndId: wndId //可指定播放窗口
  676. })
  677. })
  678. }
  679. /** ----------------------------------海康摄像头预览结束------------------------------------- */
  680. }
  681. }
  682. // 推送消息
  683. function cbIntegrationCallBack(oData) {
  684. console.log(JSON.stringify(oData.responseMsg))
  685. }
  686. </script>
  687. <style rel="stylesheet/scss" lang="scss" scoped>
  688. @import '@/assets/styles/base.scss';
  689. .event-info-con {
  690. width: 100%;
  691. display: flex;
  692. .e-left {
  693. width: 32%;
  694. }
  695. .e-center {
  696. width: 30%;
  697. margin-left: 1%;
  698. .img-company {
  699. width: 100%;
  700. height: 18.3vh;
  701. img {
  702. }
  703. }
  704. }
  705. .e-right {
  706. margin-left: 1%;
  707. width: 45%;
  708. }
  709. .e-location-left {
  710. width: 28%;
  711. margin-top: 1rem;
  712. }
  713. .e-location-right {
  714. width: 71%;
  715. margin-top: 1.3rem;
  716. margin-left: 1rem;
  717. }
  718. }
  719. .el-dialog:not(.is-fullscreen) {
  720. margin-top: 5.5vh !important;
  721. }
  722. .bottom-menu-normal {
  723. max-width: 90%;
  724. padding: 0 3rem;
  725. position: absolute;
  726. left: 50%;
  727. transform: translateX(-50%);
  728. bottom: 0;
  729. z-index: 100000;
  730. border-radius: 5px;
  731. display: flex;
  732. justify-content: center;
  733. align-items: center;
  734. background: url(../assets/images/integrated/btm-menu.png) center no-repeat;
  735. background-size: cover;
  736. overflow: hidden;
  737. .btm-m-con {
  738. position: relative;
  739. color: $inBlue;
  740. font-size: .5rem;
  741. padding: 1rem 1.5rem;
  742. display: flex;
  743. align-items: center;
  744. justify-content: center;
  745. -webkit-transform: translateY(0);
  746. transform: translateY(0);
  747. transition: all 0.2s ease-in-out;
  748. cursor: pointer;
  749. white-space: nowrap;
  750. i {
  751. font-size: 1rem;
  752. color: $inBlue;
  753. text-shadow: 0 0 10px rgba($color: $inBlue, $alpha: .6);
  754. margin-right: 0.2rem;
  755. }
  756. }
  757. .btm-m-con:hover {
  758. text-shadow: 0 0 20px rgba($color: $inBlueHover, $alpha: 1.0);
  759. filter: brightness(2.3);
  760. -webkit-transform: translateX(0.2rem);
  761. transform: translateX(0.2rem);
  762. transition: all 0.2s ease-in-out;
  763. i {
  764. color: $inBlueHover;
  765. text-shadow: 0 0 20px rgba($color: $inBlueHover, $alpha: 1.0);
  766. }
  767. }
  768. .m-l-none {
  769. .el-input__inner {
  770. margin-left: 0 !important;
  771. }
  772. }
  773. }
  774. /*海康*/
  775. html, body {
  776. padding: 0;
  777. margin: 0;
  778. }
  779. .playWnd {
  780. margin: -13px 0 0 255px;
  781. width: 850px; /*播放容器的宽和高设定*/
  782. height: 615px;
  783. border: 1px solid red;
  784. }
  785. .operate {
  786. margin-top: 24px;
  787. }
  788. .operate::after {
  789. content: '';
  790. display: block;
  791. clear: both;
  792. }
  793. .module {
  794. float: left;
  795. width: 340px;
  796. /*min-height: 320px;*/
  797. margin-left: 16px;
  798. padding: 16px 8px;
  799. box-sizing: border-box;
  800. border: 1px solid #e5e5e5;
  801. }
  802. .module .item {
  803. margin-bottom: 4px;
  804. }
  805. .module input[type="text"] {
  806. box-sizing: border-box;
  807. display: inline-block;
  808. vertical-align: middle;
  809. margin-left: 0;
  810. width: 150px;
  811. min-height: 20px;
  812. }
  813. .module .btn {
  814. min-width: 80px;
  815. min-height: 24px;
  816. margin-top: 100px;
  817. margin-left: 80px;
  818. }
  819. </style>