TVWall.vue 27 KB

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