TVWalls.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. <template>
  2. <div>
  3. <el-dialog :title="title" :visible.sync="TVWallVisible" v-if="TVWallVisible" customClass="TVWallCustomWidth"
  4. @close="cancelEventLocationShow()">
  5. <!--<div @click="findCameraByEventCoordinate()">视频联动</div>-->
  6. <!--<div class="forthis" style="width: 22%; position: absolute;left: 0;z-index: 9999999999999;">-->
  7. <!--<div class="i-list-con" style="height: 46vh; overflow-y: scroll;">-->
  8. <!--<span v-for="(item,index) in cameraList" :key="index">-->
  9. <!--<div class="d-l-con" @click="playhk(item.channelCode)">-->
  10. <!--<div class="d-l-l-text">-->
  11. <!--<i class="i-small"></i>-->
  12. <!--<h4>{{ item.cameraName }}</h4>-->
  13. <!--</div>-->
  14. <!--</div>-->
  15. <!--</span>-->
  16. <!--</div>-->
  17. <!--</div>-->
  18. <!--<div style="width:70%;height:400px;position:absolute;">-->
  19. <!--&lt;!&ndash;视频窗口展示-&#45;&#45;大华&ndash;&gt;-->
  20. <!--<div id="dom1" class="dom1"></div>-->
  21. <!--&lt;!&ndash;视频窗口展示-&#45;&#45;海康&ndash;&gt;-->
  22. <!--<div id="playWnd" class="playWnd" style="left: 0px; top: 0px;"></div>-->
  23. <!--</div>-->
  24. <div style="display: flex;">
  25. <div id="dom1" class="dom1"></div>
  26. <div class="leader-info-container" v-if="this.detail!=null">
  27. <div class="leader-info-list-con">
  28. <div v-for="(item,key) in this.detail" :key="key">
  29. <el-descriptions class="margin-top" title="" :column="1" size="mini" border>
  30. <el-descriptions-item :label="`${item.name}:`">
  31. {{item.value}}
  32. </el-descriptions-item>
  33. </el-descriptions>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. /** ----------------------------------摄像头预览开始------------------------------------- */
  43. import {getDahuaVideoServer, getTVWallList} from '@/api/dahua/dahua'
  44. import {tvCameraList} from '@/api/haikang/haikang'
  45. import {findCameraByEventCoordinate, rotation} from '@/api/monitor'
  46. import DHWs from '@/dahua/lib/DHWs'
  47. import Cookies from "js-cookie"
  48. import {selectConfigKey} from "@/api/system/config";
  49. /** ----------------------------------摄像头预览结束------------------------------------- */
  50. export default {
  51. dicts: ['event_source'],
  52. components: {},
  53. data() {
  54. return {
  55. detail:null,
  56. 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您的所有操作痕迹已被后台记录,请谨慎操作。部分摄像头处于敏感区域,已屏蔽操控权限,无法操控。",
  57. tvListJson: [
  58. {
  59. 'switchTab': '1',
  60. 'treeLabels': [
  61. {
  62. 'labelCode': '123456',
  63. 'labelName': '视频场景',
  64. 'parentLabelCode': null
  65. },
  66. {
  67. 'labelCode': '5a81d1bd499b4940a21fc63ca51f4dfa',
  68. 'labelName': '标签2',
  69. 'parentLabelCode': 123456
  70. },
  71. {
  72. 'labelCode': 'd941adbbd3e64dac92cc448dec5293cd',
  73. 'labelName': '标签1',
  74. 'parentLabelCode': 123456
  75. }
  76. ],
  77. 'labelChannels': [{
  78. 'channelDates': [{
  79. 'channelCode': '6044981090191552',
  80. 'channelName': '复兴大桥中段-交通事故',
  81. 'channelSn': null,
  82. 'cameraType': 0,
  83. 'online': 1
  84. },
  85. {
  86. 'channelCode': 'ZgVzqsjwA1DTF561VGHK5E',
  87. 'channelName': '北京7青羊东二路77号2通道1',
  88. 'channelSn': null,
  89. 'cameraType': 1,
  90. 'online': 1
  91. }
  92. ],
  93. 'labelCode': 'd941adbbd3e64dac92cc448dec5293cd'
  94. },
  95. {
  96. 'channelDates': [{
  97. 'channelCode': 'ZgVzqsjwA1DTF561VGHKK7',
  98. 'channelName': '北京7青羊东二路77号2通道2',
  99. 'channelSn': null,
  100. 'cameraType': 2,
  101. 'online': 0
  102. }],
  103. 'labelCode': '5a81d1bd499b4940a21fc63ca51f4dfa'
  104. }
  105. ]
  106. },
  107. {
  108. 'switchTab': '2',
  109. 'labelChannels': [{
  110. 'channelDates': [{
  111. 'channelCode': 'ZgVzqsjwA1DTF561VGHK5E',
  112. 'channelName': '北京7青羊东二路77号2通道1',
  113. 'channelSn': null,
  114. 'cameraType': 1,
  115. 'online': 1
  116. },
  117. {
  118. 'channelCode': 'ZgVzqsjwA1DTF561VGHKK7',
  119. 'channelName': '北京7青羊东二路77号2通道2',
  120. 'channelSn': null,
  121. 'cameraType': 2,
  122. 'online': 0
  123. }
  124. ]
  125. }]
  126. }
  127. ],
  128. TVWallVisible: false,
  129. activeName: 'tv',
  130. channelId: ['ZgVzqsjwA1DTF561VHG69F'],
  131. /** ----------------------------------摄像头预览开始------------------------------------- */
  132. showModal: true,
  133. detailList:['所属部门','创建时间','创建人','修改时间','修改人'],
  134. activePanel: 'key1',
  135. isLogin: false,
  136. loginType: '1',
  137. token: '',
  138. ctrlType: 'playerWin',
  139. https: 1,
  140. httpsList: [
  141. {
  142. value: 0,
  143. label: 0
  144. },
  145. {
  146. value: 1,
  147. label: 1
  148. }
  149. ],
  150. ctrlTypeList: [{
  151. value: 'playerWin',
  152. label: '播放控件'
  153. }, {
  154. value: 'realMonitorUI',
  155. label: '带设备树实时预览控件'
  156. }, {
  157. value: 'playbackUI',
  158. label: '带设备树视频回放控件'
  159. }, {
  160. value: 'TVWallUI',
  161. label: '视频上墙'
  162. }],
  163. ctrlList: [
  164. {
  165. value: 'ctrl1',
  166. label: '控件1'
  167. },
  168. {
  169. value: 'ctrl2',
  170. label: '控件2'
  171. },
  172. {
  173. value: 'ctrl3',
  174. label: '控件3'
  175. }
  176. ],
  177. splitList: [
  178. {
  179. value: 1,
  180. label: '1 * 1'
  181. },
  182. {
  183. value: 4,
  184. label: '2 * 2'
  185. },
  186. {
  187. value: 9,
  188. label: '3 * 3'
  189. }
  190. ],
  191. displayModeList: [
  192. {
  193. value: 1,
  194. label: '播放器预览模式'
  195. },
  196. {
  197. value: 2,
  198. label: '播放器回放模式'
  199. }
  200. ],
  201. mixedVideoDisplayModeList: [
  202. {
  203. value: 1,
  204. label: '播放实时视频'
  205. },
  206. {
  207. value: 2,
  208. label: '播放回放视频'
  209. }
  210. ],
  211. ctrl: 'ctrl1',
  212. splitNum: 1,
  213. displayMode: 1,
  214. displayTimeRange: [],
  215. modalDisplayTimeRange: [],
  216. mixedVideoTime: null,
  217. recordPath: 'C:\\DSS LightWeight\\DSS LightWeight Client\\Record\\',
  218. downloadName: '',
  219. downTimeRange: [],
  220. downloadFormat: 0,
  221. downloadFormatList: [{
  222. value: 0,
  223. label: 'dav'
  224. },
  225. {
  226. value: 1,
  227. label: 'avi'
  228. }, {
  229. value: 2,
  230. label: 'mp4'
  231. }],
  232. downloadSource: 3,
  233. downloadSourceList: [
  234. {
  235. value: 3,
  236. label: '中心录像'
  237. }, {
  238. value: 2,
  239. label: '设备录像'
  240. }],
  241. showDownloadStreamType: false,
  242. downloadStreamType: 1,
  243. downloadStreamTypeList: [{
  244. value: 1,
  245. label: '主码流'
  246. },
  247. {
  248. value: 2,
  249. label: '辅码流'
  250. },
  251. {
  252. value: 3,
  253. label: '三码流'
  254. }],
  255. downloadIsShow: true,
  256. downloadIsShowList: [{
  257. value: true,
  258. label: '是'
  259. },
  260. {
  261. value: false,
  262. label: '否'
  263. }],
  264. crtPosX: 0,
  265. crtPosY: 0,
  266. crtWidth: 1148,
  267. crtHeight: 650,
  268. domId: 'dom1',
  269. mixedVideoDisplayMode: 2,
  270. isShowTipe: true,
  271. autoList: [],
  272. stringList: [],
  273. data: null,
  274. /** ----------------------------------摄像头预览结束------------------------------------- */
  275. cameraList: [],
  276. initCount: 0,
  277. pubKey: '',
  278. oWebControl: null
  279. }
  280. },
  281. created() {
  282. const DHWsInstance = DHWs.getInstance()
  283. this.ws = DHWsInstance
  284. },
  285. methods: {
  286. cancelEventLocationShow() {
  287. // this.activeName = 'tv'
  288. this.TVWallVisible = false
  289. this.destroy()
  290. if (this.oWebControl != null) {
  291. this.oWebControl.JS_HideWnd() // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
  292. this.oWebControl.JS_Disconnect().then(function () { // 断开与插件服务连接成功
  293. },
  294. function () { // 断开与插件服务连接失败
  295. })
  296. }
  297. },
  298. showTVWall(data, val) {
  299. selectConfigKey("DssVersion").then(res => {
  300. if(this.ws.getLocalDssVersion()!=res.data){
  301. this.$modal.confirm('系统检测到新客户端版本,请更新后使用', '系统提示', {
  302. confirmButtonText: '确定',
  303. cancelButtonText: '取消',
  304. type: 'warning'
  305. }
  306. ).then(() => {
  307. selectConfigKey('video_plugin_url').then(response => {
  308. window.open(response.data);
  309. })
  310. }).catch(() => {
  311. return
  312. });
  313. return
  314. }else{
  315. this.tvListJson = data
  316. this.data = val
  317. this.autoList = []
  318. this.stringList = []
  319. let length = data[0].treeLabels.length > 4 ? 5 : data[0].treeLabels.length
  320. for (let i = 1; i < length; i++) {
  321. this.autoList.push({"channelId": data[0].treeLabels[i].labelCode})
  322. this.stringList.push(data[0].treeLabels[i].labelCode)
  323. }
  324. console.log("this.autoList",this.autoList);
  325. console.log("this.stringList",this.stringList);
  326. // let that=this;
  327. /** ----------------------------------大华摄像头预览开始------------------------------------- */
  328. this.ws.addEventListener('connectStateChange', data => {
  329. if (data) {
  330. console.log('连接成功')
  331. } else {
  332. console.log('连接失败,下载客户端')
  333. this.alertReinstall()
  334. }
  335. })
  336. this.preview()
  337. /** ----------------------------------大华摄像头预览结束------------------------------------- */
  338. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  339. // tvCameraList().then(response => {
  340. // this.cameraList=response.data
  341. // })
  342. // that.initPlugin()
  343. // setTimeout(function() {
  344. // that.playhk();
  345. // }, 5000)
  346. // /** ----------------------------------海康摄像头预览结束------------------------------------- */
  347. this.TVWallVisible = true
  348. }
  349. })
  350. },
  351. objToStrMap(obj){
  352. let strMap = new Map();
  353. let str=[];
  354. for (let k of Object.keys(obj)) {
  355. console.log(k)
  356. strMap.set(k,obj[k]);
  357. if(!this.detailList.includes(k))
  358. {
  359. let sroce ={
  360. name:k,
  361. value:(obj[k]==null?'无':obj[k])
  362. }
  363. str.push(sroce)
  364. }
  365. }
  366. return str;
  367. },
  368. showTVWall1(data, val,detail) {
  369. this.detail=this.objToStrMap(detail)
  370. console.log(this.detail)
  371. selectConfigKey("DssVersion").then(res => {
  372. if(this.ws.getLocalDssVersion()!=res.data){
  373. this.$modal.confirm('系统检测到新客户端版本,请更新后使用', '系统提示', {
  374. confirmButtonText: '确定',
  375. cancelButtonText: '取消',
  376. type: 'warning'
  377. }
  378. ).then(() => {
  379. selectConfigKey('video_plugin_url').then(response => {
  380. window.open(response.data);
  381. })
  382. }).catch(() => {
  383. return
  384. });
  385. return
  386. }else{
  387. this.tvListJson = data
  388. this.data = val
  389. this.autoList = []
  390. this.stringList = []
  391. let length = data[0].treeLabels.length > 4 ? 5 : data[0].treeLabels.length
  392. for (let i = 1; i < length; i++) {
  393. this.autoList.push({"channelId": data[0].treeLabels[i].labelCode})
  394. this.stringList.push(data[0].treeLabels[i].labelCode)
  395. }
  396. console.log("this.autoList",this.autoList);
  397. console.log("this.stringList",this.stringList);
  398. // let that=this;
  399. /** ----------------------------------大华摄像头预览开始------------------------------------- */
  400. this.ws.addEventListener('connectStateChange', data => {
  401. if (data) {
  402. console.log('连接成功')
  403. } else {
  404. console.log('连接失败,下载客户端')
  405. this.alertReinstall()
  406. }
  407. })
  408. this.preview()
  409. /** ----------------------------------大华摄像头预览结束------------------------------------- */
  410. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  411. // tvCameraList().then(response => {
  412. // this.cameraList=response.data
  413. // })
  414. // that.initPlugin()
  415. // setTimeout(function() {
  416. // that.playhk();
  417. // }, 5000)
  418. // /** ----------------------------------海康摄像头预览结束------------------------------------- */
  419. this.TVWallVisible = true
  420. }
  421. })
  422. },
  423. /** ----------------------------------大华摄像头预览开始------------------------------------- */
  424. alertLogin: function () {
  425. this.$modal.msg('登录中....')
  426. },
  427. alertLoginSuccess: function () {
  428. this.$modal.msgSuccess('登录成功!')
  429. },
  430. alertLoginFailed: function () {
  431. this.$modal.msgError('登陆失败!')
  432. },
  433. alertReinstall: function () {
  434. this.$modal.msgWarning('请重新安装客户端')
  435. },
  436. /** 预览按钮操作 */
  437. preview() {
  438. getDahuaVideoServer().then(newResponse => {
  439. this.ws.detectConnectQt().then(res => {
  440. if (res) { // 连接客户端成功
  441. this.alertLogin()
  442. this.ws.login({
  443. loginIp: newResponse.loginIp,
  444. loginPort: newResponse.loginPort,
  445. userName: newResponse.userName,
  446. userPwd: newResponse.userPwd,
  447. // loginIp: '192.168.100.100',
  448. // loginPort: 8314,
  449. // userName: 'system',
  450. // userPwd: 'Admin@123',
  451. token: '',
  452. https: 1
  453. })
  454. this.ws.on('loginState', (res) => {
  455. this.isLogin = res
  456. console.log('---res-----', res)
  457. if (res) {
  458. this.alertLoginSuccess()
  459. this.activePanel = 'key2'
  460. this.create(this.tvListJson)
  461. } else {
  462. this.alertLoginFailed()
  463. }
  464. })
  465. } else { // 连接客户端失败
  466. this.alertReinstall()
  467. }
  468. })
  469. })
  470. },
  471. playRealMonitorVideo() { // 自定义设备树自动播放指定通道编码视频
  472. const config = this.ws.config
  473. const {loginIp, userCode} = config
  474. this.ws.postMessage('playRealMonitorVideo', {
  475. loginIp,
  476. userCode,
  477. params: {
  478. ctrlCode: "ctrl1",
  479. array: this.autoList
  480. }
  481. })
  482. },
  483. create(tvListJson) { // 调用创建控件接口
  484. let _this = this
  485. const params = [
  486. {
  487. 'ctrlType': 'realMonitorUI',
  488. 'ctrlCode': 'ctrl1',
  489. 'ctrlProperty': {
  490. 'displayMode': 1,
  491. 'splitNum': (this.autoList.length==1?1:4),
  492. 'channelList': [
  493. {
  494. 'channelId': ''
  495. }
  496. ]
  497. },
  498. 'visible': true,
  499. 'domId': 'dom1'
  500. }
  501. ]
  502. this.setPos()
  503. this.customizeTree(tvListJson);
  504. _this.ws.createCtrl(params);
  505. _this.playRealMonitorVideo();
  506. if (_this.data != undefined && _this.data != null) {
  507. setTimeout( _this.rotation(_this.data.longitude, _this.data.latitude, _this.stringList),5000)
  508. }
  509. },
  510. rotation(lng,lat,list){
  511. rotation(lng,lat,list);
  512. },
  513. setPos() {
  514. let target = document.getElementById(this.domId)
  515. console.log(target, 'target')
  516. target.style.right = `${this.crtPosX}px`
  517. target.style.top = `${this.crtPosY}px`
  518. target.style.width = `${this.crtWidth}px`
  519. target.style.height = `${this.crtHeight}px`
  520. if (document.createEvent) {
  521. var event = document.createEvent('HTMLEvents')
  522. event.initEvent('resize', true, true)
  523. window.dispatchEvent(event)
  524. } else if (document.createEventObject) {
  525. window.fireEvent('onresize')
  526. }
  527. },
  528. destroy() { // 调用销毁控件接口
  529. if (!this.isLogin) {
  530. this.$modal.msgWarning('正在登陆客户端,请稍等......')
  531. return false
  532. }
  533. const ctrls = this.ws.ctrls.map(i => {
  534. if (i.ctrlCode === this.ctrl) {
  535. return i.ctrlCode
  536. }
  537. })
  538. this.ws.destroyCtrl(ctrls)
  539. },
  540. customizeTree(tvListJson) { // 调用控件接口树
  541. const config = this.ws.config
  542. const {loginIp, userCode} = config
  543. this.ws.postMessage('customizeTree', {
  544. loginIp,
  545. userCode,
  546. params: {
  547. array: tvListJson
  548. }
  549. })
  550. },
  551. /** ----------------------------------大华摄像头预览结束------------------------------------- */
  552. /** ----------------------------------海康摄像头预览开始------------------------------------- */
  553. // 创建播放实例
  554. initPlugin() {
  555. let that = this
  556. that.oWebControl = new WebControl({
  557. szPluginContainer: 'playWnd', // 指定容器id
  558. iServicePortStart: 15900, // 指定起止端口号,建议使用该值
  559. iServicePortEnd: 15909,
  560. szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
  561. cbConnectSuccess: function () { // 创建WebControl实例成功
  562. that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
  563. dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
  564. }).then(function () { // 启动插件服务成功
  565. that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
  566. cbIntegrationCallBack: cbIntegrationCallBack
  567. })
  568. that.oWebControl.JS_CreateWnd('playWnd', 850, 615).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
  569. that.init() // 创建播放实例成功后初始化
  570. })
  571. }, function () { // 启动插件服务失败
  572. })
  573. },
  574. cbConnectError: function () { // 创建WebControl实例失败
  575. that.oWebControl = null
  576. $('#playWnd').html('插件未启动,正在尝试启动,请稍候...<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  577. WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
  578. initCount++
  579. if (initCount < 3) {
  580. setTimeout(function () {
  581. that.initPlugin()
  582. }, 3000)
  583. } else {
  584. $('#playWnd').html('插件启动失败,请检查插件是否安装!<a href="./hk/VideoWebPlugin.exe">点击下载插件</a>')
  585. }
  586. },
  587. cbConnectClose: function (bNormalClose) {
  588. // 异常断开:bNormalClose = false
  589. // JS_Disconnect正常断开:bNormalClose = true
  590. console.log('cbConnectClose')
  591. that.oWebControl = null
  592. }
  593. })
  594. },
  595. //初始化
  596. init() {
  597. let that = this
  598. this.getPubKey(function () {
  599. ////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
  600. var appkey = '24699060' //综合安防管理平台提供的appkey,必填
  601. var secret = that.setEncrypt('tt1pMbsrlwGZUWucdAPw') //综合安防管理平台提供的secret,必填
  602. var ip = '36.49.108.22' //综合安防管理平台IP地址,必填
  603. var playMode = 0 //初始播放模式:0-预览,1-回放
  604. var port = 1443 //综合安防管理平台端口,若启用HTTPS协议,默认443
  605. var snapDir = 'D:\\SnapDir' //抓图存储路径
  606. var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
  607. var layout = '3x3' //playMode指定模式的布局
  608. var enableHTTPS = 1 //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
  609. var encryptedFields = 'secret' //加密字段,默认加密领域为secret
  610. var showToolbar = 1 //是否显示工具栏,0-不显示,非0-显示
  611. var showSmart = 1 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
  612. var buttonIDs = '0,16,256,257,258,259,260,512,513,514,515,516,517,768,769' //自定义工具条按钮
  613. ////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
  614. that.oWebControl.JS_RequestInterface({
  615. funcName: 'init',
  616. argument: JSON.stringify({
  617. appkey: appkey, //API网关提供的appkey
  618. secret: secret, //API网关提供的secret
  619. ip: ip, //API网关IP地址
  620. playMode: playMode, //播放模式(决定显示预览还是回放界面)
  621. port: port, //端口
  622. snapDir: snapDir, //抓图存储路径
  623. videoDir: videoDir, //紧急录像或录像剪辑存储路径
  624. layout: layout, //布局
  625. enableHTTPS: enableHTTPS, //是否启用HTTPS协议
  626. encryptedFields: encryptedFields, //加密字段
  627. showToolbar: showToolbar, //是否显示工具栏
  628. showSmart: showSmart, //是否显示智能信息
  629. buttonIDs: buttonIDs //自定义工具条按钮
  630. })
  631. }).then(function (oData) {
  632. that.oWebControl.JS_Resize(850, 615) // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
  633. })
  634. })
  635. },
  636. //获取公钥
  637. getPubKey(callback) {
  638. let that = this
  639. that.oWebControl.JS_RequestInterface({
  640. funcName: 'getRSAPubKey',
  641. argument: JSON.stringify({
  642. keyLength: 1024
  643. })
  644. }).then(function (oData) {
  645. console.log(oData)
  646. if (oData.responseMsg.data) {
  647. that.pubKey = oData.responseMsg.data
  648. callback()
  649. }
  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. //电视墙视频摄像头预览弹层样式
  820. .TVWallCustomWidth {
  821. width: 1500px !important;
  822. height: 750px !important;
  823. background: #04080c !important;
  824. box-shadow: $barShadow !important;
  825. border: 1px $barBorder !important;
  826. .el-dialog__header {
  827. padding: 15px 20px !important;
  828. background-image: -moz-linear-gradient($GradualGreen) !important;
  829. background-image: -webkit-linear-gradient($GradualGreen) !important;
  830. background-image: linear-gradient($GradualGreen) !important;
  831. box-shadow: $shadowTitle !important;
  832. .el-dialog__title {
  833. font-weight: bolder !important;
  834. color: #3cd7ef !important;
  835. }
  836. }
  837. .leader-info-container{
  838. // padding: .5rem;
  839. display: flex;
  840. height: 650px;
  841. width: 20rem;
  842. overflow-y: scroll;
  843. flex-direction: column;
  844. padding: 0 1rem;
  845. .leader-info-list-con{
  846. width: 100%;
  847. padding: 1rem;
  848. margin-bottom: .5rem;
  849. background-image: -moz-linear-gradient($GradualGreen)!important;
  850. background-image: -webkit-linear-gradient($GradualGreen) !important;
  851. background-image: linear-gradient($GradualGreen)!important;
  852. border: solid 1px #7dc2eb;
  853. box-shadow: $shadowListHover !important;
  854. border-radius: 5px;
  855. h4{
  856. margin: .4rem 0;
  857. color: $white;
  858. }
  859. }
  860. .leader-info-list-con:hover{
  861. background-image: -moz-linear-gradient($popupBG)!important;
  862. background-image: -webkit-linear-gradient($popupBG) !important;
  863. background-image: linear-gradient($popupBG)!important;
  864. }
  865. }
  866. }
  867. </style>