index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. <template>
  2. <div class="app-container" style="padding-top: 20px;height: 120vh;" v-loading="loading"
  3. element-loading-text="拼命加载中"
  4. element-loading-spinner="el-icon-loading"
  5. element-loading-background="rgba(0, 0, 0, 0.8)">
  6. <div class="ntgs">
  7. <el-row :gutter="10" class="mb8">
  8. <div class="iuer" style="margin-bottom:10px;">
  9. <!-- <div style="display: flex;align-items: center; " class="ingaqe">
  10. <el-select v-model="queryParams.name" placeholder="请选监控名称" clearable>
  11. <el-option
  12. v-for="dict in postList"
  13. :key="dict.indexCode"
  14. :label="dict.name"
  15. :value="dict.name"
  16. />
  17. </el-select>
  18. <div class="ksfpofg" @click="handleQuery">
  19. 搜索
  20. </div>
  21. </div> -->
  22. <!-- <div class="ite">
  23. <div class="ksfpo" @click="osge" v-hasPermi="['system:camera:openDz']">
  24. <img src="../../../assets/images/icon_ssjk_kman_open.png" alt="" style="width:10px;height: 10px;">
  25. 开门</div>
  26. <div class="ksfpo ksfpok" @click="osgef" v-hasPermi="['system:camera:closeDz']">
  27. <img src="../../../assets/images/icon_ssjk_kman_close.png" alt="" style="width:10px;height: 10px;">
  28. 关门</div>
  29. </div> -->
  30. <!-- -->
  31. </div>
  32. <!-- <el-col :span="1.5">
  33. <el-button
  34. type="primary"
  35. plain
  36. icon="el-icon-plus"
  37. size="mini"
  38. @click="handleAdd"
  39. v-hasPermi="['investigate:table:add']"
  40. >新增</el-button>
  41. </el-col>
  42. <el-col :span="1.5">
  43. <el-button
  44. type="danger"
  45. plain
  46. icon="el-icon-delete"
  47. size="mini"
  48. :disabled="multiple"
  49. @click="handleDelete"
  50. v-hasPermi="['investigate:table:remove']"
  51. >删除</el-button>
  52. </el-col> -->
  53. <!-- <el-col :span="1.5">
  54. <el-button
  55. type="warning"
  56. plain
  57. icon="el-icon-download"
  58. size="mini"
  59. @click="handleExport"
  60. v-hasPermi="['investigate:table:export']"
  61. >导出</el-button>
  62. </el-col> -->
  63. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
  64. </el-row>
  65. <div>
  66. <el-row :gutter="20">
  67. <!-- postList -->
  68. <el-col :span='5'>
  69. <div style="background-color: #fff;border-radius: 10px;padding: 20px 20px;height: 100vh;">
  70. <p style="margin: 0;border-left: 6px solid #03BF8A;margin-left: -20px;padding-left: 10px;font-weight: 800;">通道列表</p>
  71. <div style=" height: 36px;;line-height: 36px;margin-top: 10px;"v-for="(item,index) in 6">
  72. <div @click="ishg(item)" style="display: flex;align-items: center;justify-content: space-between;">
  73. <div style="font-size: 16px;
  74. color: #333333;"> 通道{{ index >8 ? index + 1 : '0' + (index + 1)}}</div>
  75. <img src="../../../assets/images/icon_htgl_zd.png" alt="" style="width: 10px;height: 12px;">
  76. </div>
  77. </div>
  78. </div>
  79. </el-col>
  80. <!-- v-if="isshoe" -->
  81. <el-col :span='19' style="padding-left: 30px; background-color: #fff;border-radius: 10px;padding: 20px; height: 100vh;" >
  82. <div style="display: flex;align-items: center;justify-content: space-between;">
  83. <p style="margin: 0;border-left: 6px solid #03BF8A;margin-left: -20px;padding-left: 10px;font-weight: 800;">实时预览</p>
  84. <div>
  85. <el-button type="danger" plain>删除</el-button>
  86. <el-button type="warning" plain>置顶</el-button>
  87. <el-button type="success" plain>关闭</el-button>
  88. </div>
  89. </div>
  90. <div style="width: 100%; height: 480px;">
  91. <div v-if="isfse" id="divPlugin" style="width: 100%; height: 480px;" ></div>
  92. </div>
  93. <!-- <img src="../../../assets/images/pic_ssyl_lt.png" alt="" style="width: 100%; margin-top: 20px;"> -->
  94. <!-- 344 -->
  95. <!-- <video id="video" controls autoplay muted width="100%" height="480px"style="margin-top: 20px;"></video> -->
  96. <!-- <video
  97. class="videosmall"
  98. ref="videosmallone"
  99. preload="auto"
  100. muted
  101. autoplay
  102. width="95%"
  103. type="rtmp/flv"
  104. >
  105. <source src="" />
  106. </video> -->
  107. </el-col>
  108. <!-- <el-col :span="24">
  109. <div class="ihgswq wrapper" ref="wrapper" style=" overflow: hidden;">
  110. <div class="fijge content nhgwesvq" ref="content" style="width:1610px;">
  111. <div class='shotw ' v-for="(item,index) in postList" :key="index" @click="isfgw(item)" >
  112. <img src="../../../assets/images/fengm.png" alt="">
  113. <img src="../../../assets/images/icon_spjk_play.png" alt="" class="iges">
  114. <p style="font-size: 14px;">{{item.name}}</p>
  115. </div>
  116. </div>
  117. </div>
  118. </el-col> -->
  119. </el-row>
  120. <!-- <pagination
  121. v-show="total>0"
  122. :total="total"
  123. :page.sync="queryParams.pageNo"
  124. :limit.sync="queryParams.pageSize"
  125. @pagination="getList"
  126. /> -->
  127. </div>
  128. </div>
  129. <!-- 添加或修改岗位对话框 -->
  130. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  131. </el-dialog>
  132. <el-dialog :title="titles" :visible.sync="opens" width="1000px" append-to-body>
  133. </el-dialog>
  134. <el-dialog title="页面二维码" :visible.sync="opent" width="200px" style="padding: 0;" class="nhgrls" append-to-body>
  135. <div v-show="opent" style="display: flex;justify-content: center;align-items: center;">
  136. <!-- <span>{{'https://qszdh.qs163.cn/pages/index/index?id=' + this.bg}}</span> -->
  137. <!-- <vue-qr :text="'https://qszdh.qs163.cn/pages/index/index?id=' + this.bg" :size="200"></vue-qr> -->
  138. </div>
  139. </el-dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import { listWarnManage, getWarnManage, delWarnManage, addWarnManage, updateWarnManage } from "@/api/manage/warnManage"
  144. // import { listPost, getPost, delPost, addPost, updatePost,updateFs,updateGx } from "@/api/kaoch/renyuan";
  145. // import { listReservat,camera,cameraIndexCode, listReservatd, getReservat, delReservat, addReservat, updateReservat,setPass,delReservathx,openDz,closeDz } from "@/api/tonggi/houtai";
  146. // import vueQr from "vue-qr";
  147. // import videojs from 'video.js'
  148. // import 'video.js/dist/video-js.css'
  149. // import {videoPlayer} from 'vue-video-player'
  150. // import 'videojs-flash'
  151. // import flvjs from 'flv.js/dist/flv.min.js'
  152. // import flvjs from "flv.js";
  153. import Bscroll from "better-scroll";
  154. export default {
  155. name: "Post",
  156. dicts: ['sys_normal_disable','sys_yes_no','youke','tjzh','youkes','lafafen','fange','jluly'],
  157. // components: {
  158. // vueQr,
  159. // videoPlayer
  160. // },
  161. data() {
  162. return {
  163. // 遮罩层
  164. loading: true,
  165. opent:false,
  166. bg:null,
  167. titles:'',
  168. editableTabsValue:'6',
  169. opens:false,
  170. imageUrl:'@/assets/logo/logo.png',
  171. printObj: {
  172. id: "nhgrew", // 这里是要打印元素的ID
  173. popTitle: "", // 打印的标题
  174. },
  175. pickerOptions:{
  176. disabledDate (time) {
  177. //disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
  178. // return time.getTime() > Date.now()//选当前时间之前的时间
  179. return time.getTime() < Date.now() - 8.64e7;//选当前时间之后的时间
  180. }
  181. },
  182. // 选中数组
  183. ids: [],
  184. // 非单个禁用
  185. single: true,
  186. checkedScoreDataDetails: [],
  187. scoreDataDetailsList:[],
  188. tabPosition:'left',
  189. // 非多个禁用
  190. multiple: true,
  191. // 显示搜索条件
  192. showSearch: true,
  193. // 总条数
  194. total: 0,
  195. // 岗位表格数据
  196. postList: [],
  197. // 弹出层标题
  198. title: "",
  199. // 是否显示弹出层
  200. open: false,
  201. // 查询参数
  202. queryParams: {
  203. pageNo: 1,
  204. pageSize:500,
  205. name:null,
  206. postCode: undefined,
  207. postName: undefined,
  208. status: undefined,
  209. reservatType:undefined
  210. },
  211. // 表单参数
  212. form: {},
  213. // 表单校验
  214. rules: {
  215. receptionId: [
  216. { required: true, message: "不能为空", trigger: "blur" }
  217. ],
  218. },
  219. ruless:{
  220. visitName: [
  221. { required: true, message: "不能为空", trigger: "blur" }
  222. ],
  223. visitPhone: [
  224. { required: true, message: "不能为空", trigger: "blur" }
  225. ],
  226. visitNum: [
  227. { required: true, message: "不能为空", trigger: "blur" }
  228. ],
  229. visitDate: [
  230. { required: true, message: "不能为空", trigger: "blur" }
  231. ],
  232. visitTime: [
  233. { required: true, message: "不能为空", trigger: "blur" }
  234. ],
  235. },
  236. forms:{},
  237. tableMaxHeight:'200',
  238. kje:0,
  239. ksjegsg:[],
  240. Scroll: null,
  241. videoShow: false,
  242. flvPlayer:null,
  243. player: null,
  244. name:null,
  245. isshiwa:false,
  246. isjfwe:{},
  247. isshoe:false,
  248. webRtcServer: null,
  249. camera_ip: '127.0.0.1:8000',
  250. g_iWndIndex:0,
  251. iRtspPort:'',//预览中的ip
  252. szDeviceIdentify:'',//ip_port,
  253. isfse:false
  254. };
  255. },
  256. created() {
  257. this.isfse = false
  258. this.getList();
  259. window.onresize = () => {
  260. this.changeTableMaxHeight()
  261. }
  262. this.changeTableMaxHeight()
  263. },
  264. mounted() {
  265. this.webRtcServer = new WebRtcStreamer('video', location.protocol + '//' + this.camera_ip)
  266. //需要查看的rtsp地址,根据自己的摄像头传入对应的rtsp地址即可。注意:视频编码格式必须是H264的,否则无法正常显示,编码格式可在摄像头的后台更改
  267. this.webRtcServer.connect('rtsp://admin:zxy123456@192.168.101.64:554/h264/ch1/main/av_stream')
  268. window.onresize = () => {
  269. this.changeTableMaxHeight()
  270. }
  271. this.changeTableMaxHeight()
  272. this.$nextTick(() => {
  273. this.initScroll()
  274. })
  275. },
  276. beforeDestroy() {
  277. // this.destoryVideo()
  278. if(WebVideoCtrl){
  279. console.log(this.szDeviceIdentify)
  280. WebVideoCtrl.I_Logout(this.szDeviceIdentify)
  281. WebVideoCtrl.I_StopAllPlay()
  282. WebVideoCtrl.I_DestroyPlugin()
  283. WebVideoCtrl.I_Resize()
  284. }
  285. },
  286. methods: {
  287. // 通道点击
  288. ishg(val){
  289. this.isfse = false
  290. this.clickStartRealPlay('192.168.101.64', '80',1, 0, 1);
  291. // this.getVideo()
  292. },
  293. init(val) { //这个val 就是一个地址,例如: http://192.168.2.201:85/live/9311272c49b845baa2b2810ad9bf3f68.flv 这是个服务器返回给我的一个监控视频流地址
  294. setTimeout(() => { //使用定时器是因为,在mounted声明周期里调用,可能会出现DOM没加载出来的原因
  295. var videoElement = this.$refs.videosmallone; // 获取到html中的video标签
  296. this.isshiwa = true
  297. if (flvjs.isSupported()) {
  298. //因为我这个是复用组件,进来先判断 player是否存在,如果存在,销毁掉它,不然会占用TCP名额
  299. if (this.player !== null) {
  300. this.player.pause();
  301. this.player.unload();
  302. this.player.detachMediaElement();
  303. this.player.destroy();
  304. this.player = null;
  305. }
  306. this.player = flvjs.createPlayer( //创建直播流,加载到DOM中去
  307. {
  308. type: "flv",
  309. url: val, //你的url地址
  310. isLive: true, //数据源是否为直播流
  311. hasAudio: false, //数据源是否包含有音频
  312. hasVideo: true, //数据源是否包含有视频
  313. enableStashBuffer: true, //是否启用缓存区
  314. },
  315. {
  316. enableWorker: false, //不启用分离线程
  317. enableStashBuffer: false, //关闭IO隐藏缓冲区
  318. autoCleanupSourceBuffer: true, //自动清除缓存
  319. lazyLoad: false,
  320. }
  321. );
  322. this.isshoe = true
  323. this.player.attachMediaElement(videoElement); //放到dom中去
  324. //!!!!!!这里需要注意,有的时候load加载完成不一定可以播放,要是播放不成功,用settimeout 给下面的this.player.play() 延时几百毫秒再播放
  325. // setTimeout(this.player.play(), 48000);
  326. setTimeout(() =>{
  327. //到时间时只执行一次就停止
  328. this.player.load();//准备完成
  329. this.player.play()
  330. console.log('播放')
  331. },900)
  332. }
  333. }, 500);
  334. },
  335. createVideo() {
  336. if (flvjs.isSupported()) {
  337. console.log(1)
  338. var videoElement = document.getElementById('myFlvVideo')
  339. console.log(videoElement,flvjs)
  340. this.flvPlayer = flvjs.createPlayer(
  341. {
  342. type: 'application/x-mpegURL',
  343. isLive: true,
  344. hasAudio: false,
  345. url:'https://stream1.freetv.fun/86d463c0006da643e45e26b34875df87059dcba13e69d0a5471b185793c122a2.m3u8'
  346. },
  347. {
  348. cors: true, // 是否跨域
  349. enableWorker: false, // 是否多线程工作
  350. enableStashBuffer: false, // 是否启用缓存
  351. stashInitialSize: 400, // 缓存大小(kb) 默认384kb
  352. autoCleanupSourceBuffer: true // 是否自动清理缓存
  353. }
  354. )
  355. this.flvPlayer.attachMediaElement(videoElement)
  356. this.flvPlayer.load()
  357. this.flvPlayer.play()
  358. console.log(1244)
  359. // 报错重连
  360. this.flvPlayer.on(flvjs.Events.ERROR, (errType, errDetail) => {
  361. console.log('errorType:', errType)
  362. console.log('errorDetail:', errDetail)
  363. if (this.flvPlayer) {
  364. this.destoryVideo()
  365. this.createVideo()
  366. }
  367. })
  368. }
  369. console.log(this.flvPlayer.play())
  370. },
  371. destoryVideo() {
  372. this.player.pause()
  373. this.player.unload()
  374. this.player.detachMediaElement()
  375. this.player.destroy()
  376. this.player = null
  377. },
  378. initScroll() {
  379. // 给内层盒子设置宽度,不设置宽度的话无法滚动
  380. // let width = this.goods.length * 60
  381. // // 如果有外边距,可以这样写。需要去掉最后一个元素的外边距,在后面减一下
  382. // let width = this.goodslength * (60 + 10) - 10
  383. let width = 6 * (200 + 10) - 10
  384. // this.$refs.content.style.width = width + 'px'
  385. this.$nextTick(()=>{
  386. if(!this.Scroll) {
  387. this.Scroll = new Bscroll(this.$refs.wrapper,{
  388. click: true, // 配置允许点击事件
  389. scrollX: true, // 开启横向滚动
  390. eventPassthrough: 'vertical', // 当设置 eventPassthrough 为 'vertical' 的时候,scrollY 无效
  391. mouseWheel: true,
  392. scrollbar: { // 滚动条, 要加相对位置
  393. fade: true
  394. }
  395. })
  396. } else {
  397. this.Scroll.refresh() // 重新计算 better-scroll,当 DOM 结构发生变化的时确保滚动效果正常
  398. }
  399. })
  400. },
  401. /** 查询岗位列表 */
  402. getList() {
  403. // this.queryParams
  404. this.loading = true
  405. getWarnManage(this.$route.query.id).then(response => {
  406. this.form = response.data
  407. this.getVideo()
  408. WebVideoCtrl.I_ShowPlugin()
  409. this.loading = false
  410. // this.open = true
  411. // this.title = "修改告警管理"
  412. })
  413. // camera(this.queryParams).then(response => {
  414. // this.postList = response.data.data.list;
  415. // if(response.data.data != null){
  416. // if(response.data.data.list.length != 0){
  417. // let ne = response.data.data.list[0]
  418. // response.data.data.list.filter(rtu=>{
  419. // if(rtu.name == '后门道闸'){
  420. // console.log(3,rtu)
  421. // ne = rtu
  422. // return
  423. // }
  424. // })
  425. // this.isfgw(ne)
  426. // this.isjfwe =ne
  427. // }
  428. // }
  429. // // this.postList=[{'nsje':null,'visitPhone':null,'isReception':'Y'}]
  430. // this.total = response.data.data.total;
  431. // this.loading = false;
  432. // });
  433. },
  434. getListh() {
  435. this.loading = true;
  436. listReservatd().then(response => {
  437. // this.postList = response.rows;
  438. this.ksjegsg= response.data
  439. // this.total = response.total;
  440. this.loading = false;
  441. });
  442. },
  443. isfgw(val){
  444. this.isjfwe = val
  445. let nhge={cameraIndexCode:val.indexCode}
  446. this.isshiwa = false
  447. this.isshoe= false
  448. cameraIndexCode(nhge.cameraIndexCode).then(response => {
  449. console.log(response.data.data.url)
  450. this.isshoe= true
  451. this.init(response.data.data.url)
  452. this.isshiwa = true
  453. // this.postList = response.rows;
  454. // this.total = response.total;
  455. });
  456. console.log(val,4)
  457. },
  458. osge(){
  459. console.log(this.isjfwe,45)
  460. if(this.isjfwe.name == '后门道闸'){
  461. this.isjfwe.name ='后门抓拍一体机1'
  462. }
  463. let nge={equipmentName:this.isjfwe.name}
  464. openDz(nge).then(response => {
  465. });
  466. },
  467. osgef(){
  468. if(this.isjfwe.name == '后门道闸'){
  469. this.isjfwe.name ='后门抓拍一体机1'
  470. }
  471. let nge={equipmentName:this.isjfwe.name}
  472. closeDz(nge).then(response => {
  473. // this.postList = response.rows;
  474. });
  475. },
  476. ilw(row,val){
  477. this.kje = val
  478. // console.log(row)
  479. if(row.value == 0){
  480. this.queryParams.reservatType = undefined
  481. }else{
  482. this.queryParams.reservatType = row.value
  483. }
  484. console.log(this.kje)
  485. this.queryParams.pageNum = 1
  486. this.getList()
  487. },
  488. nhgwel(item){
  489. this.form.receptionId = item.receptionId
  490. this.form.receptionName = item.receptionName
  491. this.form.receptionPhone = item.phonenumber
  492. },
  493. getPass(row) {
  494. const _this = this
  495. this.$confirm('是否审核通过', "提醒", {
  496. confirmButtonText: "确定",
  497. cancelButtonText: "取消",
  498. type: "warning"
  499. }).then(function() {
  500. return setPass({
  501. visitType: 3,
  502. reservatId: row.reservatId,
  503. // xmStatus:row.xmStatus
  504. })
  505. }).then(() => {
  506. _this.getList();
  507. _this.msgSuccess("提交成功");
  508. })
  509. },
  510. infoBtn(row) {
  511. const _this = this
  512. this.$confirm('是否拒绝', "提醒", {
  513. confirmButtonText: "确定",
  514. cancelButtonText: "取消",
  515. type: "warning"
  516. }).then(function() {
  517. return setPass({
  518. visitType: 2,
  519. reservatId: row.reservatId,
  520. // xmStatus:row.xmStatus
  521. })
  522. }).then(() => {
  523. _this.getList();
  524. _this.msgSuccess("提交成功");
  525. })
  526. },
  527. // 取消按钮
  528. cancel() {
  529. this.open = false;
  530. this.opens = false;
  531. this.reset();
  532. },
  533. // 表单重置
  534. reset() {
  535. this.form = {
  536. receptionId:undefined,
  537. receptionPhone:undefined,
  538. // postSort: 0,
  539. // status: "0",
  540. receptionName: undefined
  541. };
  542. this.resetForm("form");
  543. },
  544. /** 搜索按钮操作 */
  545. handleQuery() {
  546. this.queryParams.pageNum = 1;
  547. this.getList();
  548. },
  549. /** 重置按钮操作 */
  550. resetQuery() {
  551. this.resetForm("queryForm");
  552. this.handleQuery();
  553. },
  554. // 多选框选中数据
  555. handleSelectionChange(selection) {
  556. this.ids = selection.map(item => item.reservatId)
  557. this.single = selection.length!=1
  558. this.multiple = !selection.length
  559. },
  560. nhgeo(row){
  561. this.reset();
  562. this.open = true;
  563. this.title = "分配接待人员";
  564. this.form.reservatId = row.reservatId;
  565. this.form.reservatConfigTimeId=row.reservatConfigTimeId;
  566. this.form.visitDate=row.visitDate
  567. },
  568. handleDeleteh(row){
  569. this.$router.push({
  570. path: '/bjqs',
  571. query: {
  572. 'id':row.reservatId,
  573. 'name':null,
  574. 'names':null,
  575. 'isxz':1
  576. }
  577. })
  578. },
  579. /** 新增按钮操作 */
  580. handleAdd() {
  581. this.forms = {
  582. reservatType:'1'
  583. }
  584. this.opens = true;
  585. this.titles = "添加预约人员";
  586. // this.scoreDataDetailsList = []
  587. // this.$router.push({
  588. // path: '/system/bjq',
  589. // })
  590. // this.$router.push({
  591. // path: '/bjqs',
  592. // query: {
  593. // 'id':null,
  594. // 'name':null,
  595. // 'names':null,
  596. // 'isxz':1
  597. // }
  598. // })
  599. },
  600. /** 修改按钮操作 */
  601. handleUpdate(row) {
  602. this.reset();
  603. const recordId = row.recordId || this.ids
  604. getReservat(recordId).then(response => {
  605. this.forms = response.data;
  606. this.opens = true;
  607. this.title = "修改访问记录";
  608. });
  609. },
  610. /** 提交按钮 */
  611. submitForm: function() {
  612. this.$refs["form"].validate(valid => {
  613. if (valid) {
  614. // if (this.form.reservatId != null) {
  615. updateReservat(this.form).then(response => {
  616. this.$modal.msgSuccess("操作成功");
  617. this.open = false;
  618. this.getList();
  619. });
  620. // } else {
  621. // addReservat(this.form).then(response => {
  622. // this.$modal.msgSuccess("新增成功");
  623. // this.open = false;
  624. // this.getList();
  625. // });
  626. // }
  627. }
  628. });
  629. },
  630. submitForms: function() {
  631. this.$refs["forms"].validate(valid => {
  632. if (valid) {
  633. // if (this.form.reservatId != null) {
  634. // updateReservat(this.forms).then(response => {
  635. // this.$modal.msgSuccess("操作成功");
  636. // this.open = false;
  637. // this.getList();
  638. // });
  639. // } else {
  640. this.forms.visitTime = this.forms.visitTime + '-' + this.forms.visitTime
  641. addReservat(this.forms).then(response => {
  642. this.$modal.msgSuccess("新增成功");
  643. this.opens = false;
  644. this.getList();
  645. });
  646. // }
  647. }
  648. });
  649. },
  650. nglqw(val){
  651. this.opent = true
  652. this.bg = val.investigateTableId
  653. },
  654. iszheg(event){
  655. console.log(event);
  656. // 校验身份证:
  657. console.log(reg.test(this.form.idCard),23741)
  658. if ( reg.test(this.form.idCard)|| _IDre15.test(this.form.idCard)) {
  659. // this.idea();
  660. this.go(this.form.idCard);
  661. // callback()
  662. } else {
  663. if(ncjsle.test(this.form.idCard) || nhyeli.test(this.form.idCard)){
  664. console.log(3)
  665. }else{
  666. if(gnse.test(this.form.idCard) ){
  667. console.log(4)
  668. }else{
  669. if(tw.test(this.form.idCard) || twe.test(this.form.idCard)){
  670. console.log(5)
  671. }else{
  672. this.$message.error('证件格式不正确');
  673. }
  674. }
  675. }
  676. }
  677. },
  678. erw(row){
  679. this.$router.push({
  680. path: '/reny/ewm',
  681. query:{
  682. 'tenantId':row.investigateTableId
  683. }
  684. })
  685. },
  686. hussar_17Click(val) {
  687. const _this = this
  688. var url =process.env.VUE_APP_BASE_API + 'pages/index/index?id=' + val.investigateTableId;
  689. console.log(url,this.$refs.canvas,6)
  690. this.opent = true
  691. QRCode.toCanvas(
  692. canvas,
  693. url,//生成二维码的数据
  694. {width: 100, height:100, margin: 1.5},//margin调整二维码的白边大小
  695. function (error) {
  696. if (error) {
  697. console.log(error);
  698. }
  699. }
  700. );
  701. // console.log(qrcode,987)
  702. },
  703. /** 成绩_子添加按钮操作 */
  704. handleAddScoreDataDetails() {
  705. let obj = {};
  706. obj.duty = "";
  707. obj.idCard = "";
  708. obj.phonenumber = "";
  709. obj.userName = "";
  710. this.scoreDataDetailsList.push(obj);
  711. console.log(this.scoreDataDetailsList)
  712. },
  713. /** 成绩_子删除按钮操作 */
  714. handleDeleteScoreDataDetails() {
  715. if (this.checkedScoreDataDetails.length == 0) {
  716. this.$modal.msgError("请先选择要删除的数据");
  717. } else {
  718. const scoreDataDetailsList = this.scoreDataDetailsList;
  719. const checkedScoreDataDetails = this.checkedScoreDataDetails;
  720. this.scoreDataDetailsList = scoreDataDetailsList.filter(function(item) {
  721. return checkedScoreDataDetails.indexOf(item.index) == -1
  722. });
  723. }
  724. },
  725. /** 复选框选中数据 */
  726. handleScoreDataDetailsSelectionChange(selection) {
  727. this.checkedScoreDataDetails = selection.map(item => item.index)
  728. },
  729. /** 成绩_子序号 */
  730. rowScoreDataDetailsIndex({ row, rowIndex }) {
  731. row.index = rowIndex + 1;
  732. },
  733. /** 删除按钮操作 */
  734. handleDelete(row) {
  735. const postIds = row.recordId || this.ids;
  736. delReservat(postIds).then(response => {
  737. this.$modal.msgSuccess("操作成功");
  738. this.getList();
  739. });
  740. // this.$modal.confirm('是否确认删除数据项?').then(function() {
  741. // return delPost(postIds);
  742. // }).then(() => {
  743. // this.getList();
  744. // this.$modal.msgSuccess("删除成功");
  745. // }).catch(() => {});
  746. },
  747. handleDeletehx(row) {
  748. const postIds = row.reservatId || this.ids;
  749. let nhg={}
  750. nhg.reservatId = postIds
  751. delReservathx(nhg).then(response => {
  752. this.$modal.msgSuccess("操作成功");
  753. this.getList();
  754. });
  755. // this.$modal.confirm('是否确认删除数据项?').then(function() {
  756. // return delPost(postIds);
  757. // }).then(() => {
  758. // this.getList();
  759. // this.$modal.msgSuccess("删除成功");
  760. // }).catch(() => {});
  761. },
  762. // 发送短信
  763. handleUpdatefas(row){
  764. updateFs(row).then(response => {
  765. this.$modal.msgSuccess("发送成功");
  766. // this.getList();
  767. });
  768. },
  769. handleDeletegx(row){
  770. updateGx(row).then(response => {
  771. this.$modal.msgSuccess("发送成功");
  772. // this.getList();
  773. });
  774. },
  775. /** 导出按钮操作 */
  776. handleExport() {
  777. this.download('system/reservat/export', {
  778. ...this.queryParams
  779. }, `预约人员.xlsx`)
  780. },
  781. // 获取屏幕高度
  782. showFilterForm () {
  783. this.filterActive = !this.filterActive
  784. this.changeTableMaxHeight()
  785. },
  786. changeTableMaxHeight () {
  787. let height = document.body.offsetHeight // 网页可视区域高度
  788. // if (this.filterActive) {
  789. // this.tableMaxHeight = height - 320
  790. // } else {
  791. this.tableMaxHeight = height - 350
  792. // }
  793. console.log(height)
  794. },
  795. // 播放摄像头
  796. getVideo() {
  797. var that=this;
  798. this.isfse = true
  799. this.initVideoPlay('192.168.101.64', '80', 'admin', 'zxy123456','divPlugin')
  800. },
  801. // 有插件
  802. initVideoPlay(ip, port, username, password,id) {
  803. var that = this;
  804. var g_iWndIndex = 0; //可以不用设置这个变量,有窗口参数的接口中,不用传值,开发包会默认使用当前选择窗口
  805. var g_oLocalConfig = null; //本地配置
  806. // let ip = this.szIP //硬盘录像机ip
  807. // let port = this.szPort //默认为80端口
  808. // let username = this.szUsername //账号:
  809. // let password = this.szPassword // 密码
  810. var iRtspPort = ''
  811. // 1.初始化插件参数及插入插件
  812. WebVideoCtrl.I_InitPlugin({
  813. bWndFull: true, //是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
  814. iWndowType: 1,
  815. bDebugMode: true,
  816. cbSelWnd: function(xmlDoc) {
  817. g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
  818. const szInfo = "当前选择的窗口编号:" + g_iWndIndex;
  819. this.g_iWndIndex = g_iWndIndex;
  820. console.log(szInfo, "szInfo");
  821. },
  822. cbDoubleClickWnd: function(iWndIndex, bFullScreen) {
  823. let szInfo = "当前放大的窗口编号:" + iWndIndex;
  824. if (!bFullScreen) {
  825. szInfo = "当前还原的窗口编号:" + iWndIndex;
  826. }
  827. // console.log(szInfo, "szInfo");
  828. },
  829. cbEvent: function(iEventType, iParam1, iParam2) {
  830. if (2 == iEventType) {
  831. // 回放正常结束
  832. console.log("窗口" + iParam1 + "回放结束!");
  833. } else if (-1 == iEventType) {
  834. console.log("设备" + iParam1 + "网络错误!");
  835. } else if (3001 == iEventType) {
  836. clickStopRecord(g_szRecordType, iParam1);
  837. }
  838. },
  839. //2.登录摄像头
  840. cbInitPluginComplete: function() {
  841. const oLiveView = {
  842. iProtocol: 1, // protocol 1:http, 2:https
  843. szIP: ip, // protocol ip
  844. szPort: port, // protocol port
  845. szUsername: username, // device username
  846. szPassword: password, // device password
  847. iStreamType: 1, // stream 1:main stream 2:sub-stream 3:third stream 4:transcode stream
  848. iChannelID: 1, // channel no
  849. bZeroChannel: false, // zero channel
  850. };
  851. // var swidth=Number((that.width*Number(that.scale))).toFixed(2)
  852. // var sheight=Number((that.height*Number(that.scale))).toFixed(2)
  853. // that.swidth=swidth
  854. // that.sheight=sheight
  855. WebVideoCtrl.I_InsertOBJECTPlugin(id).then(
  856. () => {
  857. // setTimeout(function(){
  858. // WebVideoCtrl.I_Resize(swidth,sheight)
  859. // },300)
  860. WebVideoCtrl.I_Login(
  861. oLiveView.szIP,
  862. oLiveView.iProtocol,
  863. oLiveView.szPort,
  864. oLiveView.szUsername,
  865. oLiveView.szPassword, {
  866. timeout: 3000,
  867. async: false,
  868. success: function(xmlDoc) {
  869. console.log(" 登录成功!");
  870. let a = ip
  871. let b = port
  872. setTimeout(function() {
  873. //延迟方法
  874. setTimeout(function() {
  875. //调用预览摄像头这里可以循环创建
  876. that.clickStartRealPlay(a, b,1, 0, 1);
  877. // that.clickStartRealPlay(a, b, 1, 1,2);
  878. // that.clickStartRealPlay(a, b, 1, 2,3);
  879. // clickStartRealPlay(a,b, 1, 3, 4);
  880. // clickStartRealPlay(a,b, 1, 4, 5);
  881. // clickStartRealPlay(a,b, 1, 5, 6);
  882. // clickStartRealPlay(a,b, 1, 6, 7);
  883. // clickStartRealPlay(a,b, 1, 7, 8);
  884. }, 1000);
  885. setTimeout(function() {
  886. // 获取通道 (如果多个摄像头需要获取多个通道需要调用)
  887. // getChannelInfo(a);
  888. //获取端口 (在这里获取RTSP 端口号 预览时传入)
  889. getDevicePort(a);
  890. }, 10)
  891. }, 10);
  892. },
  893. error: function(oError) {
  894. console.log(" 登录失败!", oError);
  895. },
  896. }
  897. );
  898. // 检查插件是否最新
  899. WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => {
  900. if (bFlag) {
  901. alert(
  902. "检测到新的插件版本,双击开发包目录里的HCWebSDKPlugin.exe升级!"
  903. );
  904. }
  905. });
  906. },
  907. () => {
  908. alert(
  909. "插件初始化失败,请确认是否已安装插件;如果未安装,请双击开发包目录里的HCWebSDKPlugin.exe安装!"
  910. );
  911. }
  912. );
  913. },
  914. });
  915. // 3.获取通道
  916. function getChannelInfo(a) {
  917. var szDeviceIdentify = a,
  918. oSel = null; //通道列表
  919. if (null == szDeviceIdentify) {
  920. return;
  921. }
  922. // 模拟通道 有
  923. WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
  924. success: function(xmlDoc) {
  925. var oChannels = $(xmlDoc).find("VideoInputChannel");
  926. $.each(oChannels, function(i) {
  927. var id = $(this).find("id").eq(0).text(),
  928. name = $(this).find("name").eq(0).text();
  929. if ("" == name) {
  930. name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
  931. }
  932. // console.log(id + "通道id是")
  933. // console.log(name + "通道name是")
  934. });
  935. console.log(szDeviceIdentify + " 获取模拟通道成功!");
  936. },
  937. error: function(oError) {
  938. console.log(szDeviceIdentify + " 获取模拟通道失败!", oError.errorCode, oError.errorMsg);
  939. }
  940. });
  941. // 数字通道
  942. WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, {
  943. success: function(xmlDoc) {
  944. var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
  945. $.each(oChannels, function(i) {
  946. var id = $(this).find("id").eq(0).text(),
  947. name = $(this).find("name").eq(0).text(),
  948. online = $(this).find("online").eq(0).text();
  949. if ("false" == online) { // 过滤禁用的数字通道
  950. return true;
  951. }
  952. if ("" == name) {
  953. name = "IPCamera " + (i < 9 ? "0" + (i + 1) : (i + 1));
  954. }
  955. });
  956. console.log(szDeviceIdentify + " 获取数字通道成功!");
  957. },
  958. error: function(oError) {
  959. console.log(szDeviceIdentify + " 获取数字通道失败!", oError.errorCode, oError.errorMsg);
  960. }
  961. });
  962. // 零通道
  963. WebVideoCtrl.I_GetZeroChannelInfo(szDeviceIdentify, {
  964. success: function(xmlDoc) {
  965. var oChannels = $(xmlDoc).find("ZeroVideoChannel");
  966. $.each(oChannels, function(i) {
  967. var id = $(this).find("id").eq(0).text(),
  968. name = $(this).find("name").eq(0).text();
  969. if ("" == name) {
  970. name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : (i + 1));
  971. }
  972. if ("true" == $(this).find("enabled").eq(0).text()) { // 过滤禁用的零通道
  973. }
  974. });
  975. console.log(szDeviceIdentify + " 获取零通道成功!");
  976. },
  977. error: function(oError) {
  978. console.log(szDeviceIdentify + " 获取零通道失败!", oError.errorCode, oError.errorMsg);
  979. }
  980. });
  981. };
  982. //4.获取端口
  983. function getDevicePort(a) {
  984. var szDeviceIdentify = a;
  985. if (null == szDeviceIdentify) {
  986. return;
  987. }
  988. WebVideoCtrl.I_GetDevicePort(szDeviceIdentify).then((oPort) => {
  989. // console.log(oPort.iDevicePort + "iDevicePort的值是")
  990. // console.log(oPort.iRtspPort + "iRtspPort的值是")
  991. console.log(szDeviceIdentify + " 获取端口成功!");
  992. iRtspPort = oPort.iRtspPort
  993. that.iRtspPort = iRtspPort
  994. }, (oError) => {
  995. var szInfo = "获取端口失败!";
  996. console.log(szDeviceIdentify + szInfo, oError.errorCode, oError.errorMsg);
  997. });
  998. };
  999. },
  1000. // 5.开始预览
  1001. clickStartRealPlay(szIP, szPort, iStreamType, iWndIndex, iChannelID) {
  1002. var oWndInfo = WebVideoCtrl.I_GetWindowStatus(this.g_iWndIndex),
  1003. szDeviceIdentify = szIP + "_" + szPort, //ip
  1004. iChannelID = iChannelID,
  1005. bZeroChannel = false,
  1006. iPort = this.iRtspPort,
  1007. szInfo = "";
  1008. iStreamType = iStreamType;
  1009. if (null == szDeviceIdentify) {
  1010. return null;
  1011. }
  1012. this.szDeviceIdentify = szDeviceIdentify;
  1013. var startRealPlay = function() {
  1014. WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
  1015. iStreamType: iStreamType,
  1016. iChannelID: iChannelID,
  1017. bZeroChannel: bZeroChannel,
  1018. iWndIndex: iWndIndex, //要播放的窗口
  1019. iPort: iPort, //如果多个摄像头需要必填 (RTSP 端口号)
  1020. success: function() {
  1021. szInfo = "开始预览窗口" + iWndIndex + "成功!";
  1022. console.log(szDeviceIdentify + " " + szInfo);
  1023. },
  1024. error: function(oError) {
  1025. console.log(szDeviceIdentify + " 开始预览窗口" + iWndIndex + "失败!", oError
  1026. .errorCode, oError.errorMsg);
  1027. }
  1028. });
  1029. };
  1030. if (oWndInfo != null) { // 已经在播放了,先停止
  1031. WebVideoCtrl.I_Stop({
  1032. success: function() {
  1033. startRealPlay();
  1034. }
  1035. });
  1036. } else {
  1037. startRealPlay();
  1038. }
  1039. },
  1040. }
  1041. };
  1042. </script>
  1043. <style lang="scss">
  1044. .isjses{
  1045. .el-tabs--left .el-tabs__nav-wrap.is-left::after{
  1046. width:6px;
  1047. }
  1048. .el-tabs--left .el-tabs__active-bar.is-left,{
  1049. width:6px;
  1050. }
  1051. }
  1052. .ingaqe{
  1053. .el-input--medium{
  1054. width:100%;
  1055. }
  1056. }
  1057. .nhgrls{
  1058. .el-dialog__body{
  1059. padding: 0;
  1060. }
  1061. }
  1062. .hyr{
  1063. span{
  1064. text-decoration:underline;
  1065. }
  1066. }
  1067. </style>
  1068. <style scoped lang="scss">
  1069. .nghwgq{
  1070. display: flex;
  1071. flex-direction: column;
  1072. justify-content: center;
  1073. align-items: center;
  1074. margin-top: 90px;
  1075. div{
  1076. color:#aaa;
  1077. }
  1078. }
  1079. .ihgswq{
  1080. // width:100%;
  1081. // overflow-x: hidden;
  1082. // margin-top: 30px;
  1083. }
  1084. .fijge{
  1085. // width: 110%;
  1086. display: flex;
  1087. display: -webkit-flex;
  1088. justify-content: space-between;
  1089. .shotw{
  1090. position: relative;
  1091. // width:32%;
  1092. width: 238px;
  1093. height: 140px;
  1094. margin-left: 0;
  1095. margin-right: 20px;
  1096. margin-bottom: 15px;
  1097. img{
  1098. height: 100%;
  1099. cursor:pointer;
  1100. }
  1101. p{
  1102. // bottom:-10px;
  1103. margin: 0;
  1104. font-weight: bold;
  1105. font-size: 16px;
  1106. padding: 5px 10px;
  1107. cursor:pointer;
  1108. }
  1109. .iges{
  1110. position: absolute;
  1111. top:50%;
  1112. left:50%;
  1113. width:30px;
  1114. height: 30px;
  1115. transform: translate(-50%,-50%);
  1116. cursor:pointer;
  1117. }
  1118. }
  1119. }
  1120. .nhgwesvq{
  1121. width:1610px !important;
  1122. }
  1123. .shotw{
  1124. position: relative;
  1125. margin-left: -20px;
  1126. margin-right: -20px;
  1127. img{
  1128. width:100%;
  1129. height: 80vh;
  1130. }
  1131. p{
  1132. position: absolute;
  1133. bottom: 0;
  1134. left:0;
  1135. background-color: rgba(0, 0, 0, .5);
  1136. width: 100%;
  1137. padding: 13px 5px;
  1138. color:#fff;
  1139. font-weight: bold;
  1140. font-size: 18px;
  1141. }
  1142. .p{
  1143. top:0px;
  1144. height: 60px;
  1145. margin: 0;
  1146. padding-left: 20px;
  1147. }
  1148. }
  1149. .ksfpo{
  1150. background-color: #3464EB;
  1151. padding: 6px 12px;
  1152. border-radius: 4px ;
  1153. color:#fff;
  1154. cursor:pointer;
  1155. }
  1156. .ksfpok{
  1157. background-color: #FFFFFF;
  1158. padding: 5px 11px;
  1159. border-radius: 4px;
  1160. color:#3464EB;
  1161. border: 1px solid #3464EB;
  1162. margin-left: 10px;
  1163. cursor:pointer;
  1164. }
  1165. .ksfpofg{
  1166. background-color: #75DB75;
  1167. padding: 5px 11px;
  1168. border-radius: 4px;
  1169. color:#FFFFFF;
  1170. border: 1px solid #75DB75;
  1171. margin-left: 10px;
  1172. cursor:pointer;
  1173. }
  1174. .iuer{
  1175. display: flex;
  1176. justify-content: space-between;
  1177. align-items: center;
  1178. .ite{
  1179. display: flex;
  1180. justify-content: space-between;
  1181. align-items: center;
  1182. p{
  1183. cursor:pointer;
  1184. margin: 0;
  1185. font-size: 15px;
  1186. font-family: PingFang SC;
  1187. font-weight: 500;
  1188. color:#666666;
  1189. padding: 4px 12px;
  1190. background: #Fff;
  1191. border-radius: 4px;
  1192. margin-right: 20px;
  1193. position: relative;
  1194. }
  1195. .actt{
  1196. background: #fff;
  1197. // border-bottom: 3px solid #5974E0;
  1198. // border-radius: 0;
  1199. // border-bottom-right-radius: 4px;
  1200. color: #5974E0;
  1201. }
  1202. .actt{
  1203. &::after {
  1204. content: "";
  1205. width: 40%;
  1206. height: 5px;
  1207. border-radius: 3px;
  1208. transform: translate(-50%);
  1209. background-color: #5974E0;
  1210. position: absolute;
  1211. left: 50%;
  1212. bottom:-3px;
  1213. }
  1214. }
  1215. }
  1216. }
  1217. .lqw{
  1218. padding: 0 10px;
  1219. margin: 0;
  1220. margin-bottom: 20px;
  1221. }
  1222. .nhgel{
  1223. height: 170px;
  1224. background-color: #313b61;
  1225. width: 100%;
  1226. position: absolute;
  1227. top:0;
  1228. left:0;
  1229. z-index: 0;
  1230. }
  1231. .app-container{
  1232. background-color: #f3f4f6;
  1233. padding-top: 10px;
  1234. height: 180vh;
  1235. }
  1236. .ntgs{
  1237. position: relative;
  1238. // background-color: #fff;
  1239. padding: 5px;
  1240. // border-radius: 5px;
  1241. padding-top: 10px;
  1242. padding: 10px 20px;
  1243. .pagination-container{
  1244. height: 50px;
  1245. }
  1246. }
  1247. .nghfs{
  1248. position: relative;
  1249. background-color: #fff;
  1250. padding-top: 18px !important;
  1251. padding: 5px;
  1252. // border-radius: 5px;
  1253. // margin-bottom: 20px;
  1254. }
  1255. .ksf{
  1256. img{
  1257. width:100%;
  1258. height: 100%;
  1259. }
  1260. }
  1261. .ingwfaq{
  1262. font-weight: bold;
  1263. font-size: 16px;
  1264. }
  1265. </style>