123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695 |
- <template>
- <div class="app-container" style="padding-top: 20px;height: 120vh;" v-loading="loading"
- element-loading-text="拼命加载中"
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.8)">
- <div class="ntgs">
- <el-row :gutter="10" class="mb8">
- <div class="iuer" style="margin-bottom:10px;">
- <!-- <div style="display: flex;align-items: center; " class="ingaqe">
- <el-select v-model="queryParams.name" placeholder="请选监控名称" clearable>
- <el-option
- v-for="dict in postList"
- :key="dict.indexCode"
- :label="dict.name"
- :value="dict.name"
- />
- </el-select>
- <div class="ksfpofg" @click="handleQuery">
- 搜索
- </div>
- </div> -->
- <!-- <div class="ite">
- <div class="ksfpo" @click="osge" v-hasPermi="['system:camera:openDz']">
- <img src="../../../assets/images/icon_ssjk_kman_open.png" alt="" style="width:10px;height: 10px;">
- 开门</div>
- <div class="ksfpo ksfpok" @click="osgef" v-hasPermi="['system:camera:closeDz']">
- <img src="../../../assets/images/icon_ssjk_kman_close.png" alt="" style="width:10px;height: 10px;">
- 关门</div>
- </div> -->
- <!-- -->
- </div>
- <!-- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['investigate:table:add']"
- >新增</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['investigate:table:remove']"
- >删除</el-button>
- </el-col> -->
- <!-- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['investigate:table:export']"
- >导出</el-button>
- </el-col> -->
- <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
- </el-row>
- <div>
- <el-row :gutter="20">
- <!-- postList -->
- <el-col :span='5'>
- <div style="background-color: #fff;border-radius: 10px;padding: 20px 20px;height: 100vh;">
- <p style="margin: 0;border-left: 6px solid #03BF8A;margin-left: -20px;padding-left: 10px;font-weight: 800;">通道列表</p>
- <div style=" height: 36px;;line-height: 36px;margin-top: 10px;"v-for="(item,index) in channelNumberList">
- <div @click="ishg(item)" style="display: flex;align-items: center;justify-content: space-between;">
- <div style="font-size: 16px;
- color: #333333;"> {{item.channelNum == null?'暂无数据' : item.channelNum}}</div>
- <img src="../../../assets/images/icon_htgl_zd.png" alt="" style="width: 10px;height: 12px;">
- </div>
- </div>
- </div>
- </el-col>
- <!-- v-if="isshoe" -->
- <el-col :span='14' style="padding-left: 30px; background-color: #fff;border-radius: 10px;padding: 20px; height: 100vh;" >
- <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 18px;">
- <p style="margin: 0;border-left: 6px solid #03BF8A;margin-left: -20px;padding-left: 10px;font-weight: 800;">实时预览
- </p>
- <div>
- <!-- <el-button type="danger" plain>删除</el-button>
- <el-button type="warning" plain>置顶</el-button> -->
- <el-button type="success" plain>关闭</el-button>
- </div>
- </div>
- <div class="dflext mb10">
- <div>
- <el-button type="primary" @click="clickEnableDraw">绘图</el-button>
- <el-button type="primary" plain @click="clickAddSnapPolygon">添加图形</el-button>
- <el-button type="primary" plain @click="clickDelAllSnapPolygon">清除所有图形</el-button>
- <el-button type="primary" plain @click="clickGetSnapPolygon">获取坐标点</el-button>
- </div>
- <div style="flex: 1;"></div>
- <div class="disbtn" @click="getdrawFn">
- <img src="../../../assets/images/dchose.png" v-if="isdisflag"/>
- <img src="../../../assets/images/dnchose.png" v-else/>
- 禁用绘制
- </div>
- <!-- <el-button type="primary" plain @click="clickCapturePic">抓图</el-button> -->
- </div>
- <span style="font-size: 12px;color: red;">先点击绘图按钮,在点击添加图片按钮开始绘制,若绘制多个框每次绘制前需点击添加图片按钮,绘制完成后点击获取坐标点
- 。</span>
- <div style="width: 100%; height: 480px;">
- <div v-if="isfse" id="divPlugin" style="width: 100%; height: 440px;" ></div>
- </div>
- <!-- <img src="../../../assets/images/pic_ssyl_lt.png" alt="" style="width: 100%; margin-top: 20px;"> -->
- <!-- 344 -->
- <!-- <video id="video" controls autoplay muted width="100%" height="480px"style="margin-top: 20px;"></video> -->
- <!-- <video
- class="videosmall"
- ref="videosmallone"
- preload="auto"
- muted
- autoplay
- width="95%"
- type="rtmp/flv"
- >
- <source src="" />
- </video> -->
- </el-col>
- <el-col :span="5">
- <div style="background-color: #fff;border-radius: 10px;padding: 20px 20px;height: 100vh;">
- <p style="margin: 0;border-left: 6px solid #03BF8A;margin-left: -20px;padding-left: 10px;font-weight: 800;">绘制区域</p>
- <div class="drawings-list">
- <div class="tflex" v-for="(shape, index) in shapes" :key="index">
- <!-- :class="{ selected: selectedIndex === index }" -->
- <div class="txt" >
- <el-popover
- placement="top-start"
- width="200"
- trigger="hover"
- >
- <div v-for="(ite,idx) in shape.points">
- {{ite.x}},{{ite.y}}
- </div>
- <div slot="reference">区域{{shape.id}}</div>
- </el-popover>
- </div>
- <img class="delimg" src="../../../assets/images/del.png" @click.stop="clickDelSnapPolygon(shape.id,index)"/>
- </div>
- </div>
- </div>
- </el-col>
- <!-- <el-col :span="24">
- <div class="ihgswq wrapper" ref="wrapper" style=" overflow: hidden;">
- <div class="fijge content nhgwesvq" ref="content" style="width:1610px;">
- <div class='shotw ' v-for="(item,index) in postList" :key="index" @click="isfgw(item)" >
- <img src="../../../assets/images/fengm.png" alt="">
- <img src="../../../assets/images/icon_spjk_play.png" alt="" class="iges">
- <p style="font-size: 14px;">{{item.name}}</p>
- </div>
- </div>
- </div>
- </el-col> -->
- </el-row>
- <!-- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNo"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- /> -->
- </div>
- </div>
- <!-- 添加或修改岗位对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
- </el-dialog>
- <el-dialog :title="titles" :visible.sync="opens" width="1000px" append-to-body>
- </el-dialog>
- <el-dialog title="页面二维码" :visible.sync="opent" width="200px" style="padding: 0;" class="nhgrls" append-to-body>
- <div v-show="opent" style="display: flex;justify-content: center;align-items: center;">
- <!-- <span>{{'https://qszdh.qs163.cn/pages/index/index?id=' + this.bg}}</span> -->
- <!-- <vue-qr :text="'https://qszdh.qs163.cn/pages/index/index?id=' + this.bg" :size="200"></vue-qr> -->
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listChannelNumber, listChannelNumbernopa,getChannelNumber, delChannelNumber, addChannelNumber, updateChannelNumber } from "@/api/system/channelNumber"
- import { listWarnManage, getWarnManage, delWarnManage, addWarnManage, updateWarnManage } from "@/api/manage/warnManage"
- // import { listPost, getPost, delPost, addPost, updatePost,updateFs,updateGx } from "@/api/kaoch/renyuan";
- // import { listReservat,camera,cameraIndexCode, listReservatd, getReservat, delReservat, addReservat, updateReservat,setPass,delReservathx,openDz,closeDz } from "@/api/tonggi/houtai";
- // import vueQr from "vue-qr";
- // import videojs from 'video.js'
- // import 'video.js/dist/video-js.css'
- // import {videoPlayer} from 'vue-video-player'
- // import 'videojs-flash'
- // import flvjs from 'flv.js/dist/flv.min.js'
- // import flvjs from "flv.js";
- import mqtt from 'mqtt';
- import { MqttClient } from 'mqtt'
- // 状态变量
- // const client = mqtt.connect('ws://13.229.167.76:1884/mqtt')
- var client = MqttClient||null
- import Bscroll from "better-scroll";
- export default {
- name: "Post",
- dicts: ['sys_normal_disable','sys_yes_no','youke','tjzh','youkes','lafafen','fange','jluly'],
- // components: {
- // vueQr,
- // videoPlayer
- // },
- data() {
- return {
- // 遮罩层
- loading: true,
- opent:false,
- bg:null,
- titles:'',
- editableTabsValue:'6',
- opens:false,
- // 通道管理表格数据
- channelNumberList: [],
- imageUrl:'@/assets/logo/logo.png',
- printObj: {
- id: "nhgrew", // 这里是要打印元素的ID
- popTitle: "", // 打印的标题
- },
- pickerOptions:{
- disabledDate (time) {
- //disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
- // return time.getTime() > Date.now()//选当前时间之前的时间
- return time.getTime() < Date.now() - 8.64e7;//选当前时间之后的时间
- }
- },
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- checkedScoreDataDetails: [],
- scoreDataDetailsList:[],
- tabPosition:'left',
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 岗位表格数据
- postList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNo: 1,
- pageSize:500,
- name:null,
- postCode: undefined,
- postName: undefined,
- status: undefined,
- reservatType:undefined
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- receptionId: [
- { required: true, message: "不能为空", trigger: "blur" }
- ],
- },
- ruless:{
- visitName: [
- { required: true, message: "不能为空", trigger: "blur" }
- ],
- visitPhone: [
- { required: true, message: "不能为空", trigger: "blur" }
- ],
- visitNum: [
- { required: true, message: "不能为空", trigger: "blur" }
- ],
- visitDate: [
- { required: true, message: "不能为空", trigger: "blur" }
- ],
- visitTime: [
- { required: true, message: "不能为空", trigger: "blur" }
- ],
- },
- forms:{},
- tableMaxHeight:'200',
- kje:0,
- ksjegsg:[],
- Scroll: null,
- videoShow: false,
- flvPlayer:null,
- player: null,
- name:null,
- isshiwa:false,
- isjfwe:{},
- isshoe:false,
- webRtcServer: null,
- camera_ip: '127.0.0.1:8000',
- g_iWndIndex:0,
- iRtspPort:'',//预览中的ip
- szDeviceIdentify:'',//ip_port,
- isfse:false,
- g_bEnableDraw:false,
- // 所有绘制的图形
- shapes: [],
- // 禁用
- isdisflag:false,
- connectionStatus:'',
- isConnected:false,
- connecting:false,
- messages:[{ type: 'sent' , content: '', timestamp: '' }],
- messageToSend:[],
- mqttConfig:{
- url: 'ws://13.229.167.76:1884/mqtt',
- topic: 'detection/rect'
- },
- mqttThemeName:{
- url: 'ws://13.229.167.76:1884/mqtt',
- topic: 'detection/rect'
- },
- };
- },
- created() {
- this.isfse = false
- // this.getList();
- this.getListtd()
- window.onresize = () => {
- this.changeTableMaxHeight()
- }
- this.changeTableMaxHeight()
- },
- mounted() {
- this.toggleConnection()
- // this.webRtcServer = new WebRtcStreamer('video', location.protocol + '//' + this.camera_ip)
- // //需要查看的rtsp地址,根据自己的摄像头传入对应的rtsp地址即可。注意:视频编码格式必须是H264的,否则无法正常显示,编码格式可在摄像头的后台更改
- // this.webRtcServer.connect('rtsp://admin:zxy123456@192.168.101.64:554/h264/ch1/main/av_stream')
- window.onresize = () => {
- this.changeTableMaxHeight()
- }
- this.changeTableMaxHeight()
- this.$nextTick(() => {
- this.initScroll()
- })
- },
- beforeDestroy() {
- // this.destoryVideo()
- if(WebVideoCtrl){
- console.log(this.szDeviceIdentify)
- WebVideoCtrl.I_Logout(this.szDeviceIdentify)
- WebVideoCtrl.I_StopAllPlay()
- WebVideoCtrl.I_DestroyPlugin()
- WebVideoCtrl.I_Resize()
- }
- },
- methods: {
- /** 查询通道管理列表 */
- getListtd() {
- this.loading = true
- let queryParams = {}
- listChannelNumbernopa().then(response => {
- this.channelNumberList = response.rows
- if(this.channelNumberList.length !=0){
- let snghs = this.channelNumberList[0].videoAddress.split('@')
- let snghst = snghs[1].split(':')
- let snsgduan = snghst[1].split('/')
- console.log(snghs,snghst,snsgduan)
- let sgse={'ip':snghst[0],'duank':snsgduan[0],
- 'account':this.channelNumberList[0].account,
- 'password':this.channelNumberList[0].password,
- }
- this.getVideo(sgse)
- WebVideoCtrl.I_ShowPlugin()
- this.loading = false
- }
- // getWarnManage(this.$route.query.id).then(response => {
- // this.form = response.data
- this.loading = false
- })
- },
- clickEnableDraw() {
- WebVideoCtrl.I_SetDrawStatus(true).then(() => {
- this.g_bEnableDraw = true;
- // showOPInfo("启用绘制成功!");
- }, (oError) => {
- // showOPInfo("启用绘制失败!", oError.errorCode, oError.errorMsg);
- });
- },
- getdrawFn(){
- this.isdisflag=!this.isdisflag;
- if(this.isdisflag){
- this.clickDisableDraw()
- }else{
- this.clickEnableDraw()
- }
- },
- // 禁用多边形绘制
- clickDisableDraw() {
- WebVideoCtrl.I_SetDrawStatus(false).then(() => {
- this.g_bEnableDraw = false;
- // showOPInfo("禁用绘制成功!");
- this.clickAddSnapPolygon()
- }, (oError) => {
- // showOPInfo("禁用绘制失败!", oError.errorCode, oError.errorMsg);
- });
- },
- clickGetSnapPolygon() {
- var that=this;
- WebVideoCtrl.I_GetSnapPolygonInfo(this.g_iWndIndex).then((szXml) => {
- console.log('获取图形:', szXml);
- that.getpoint(szXml)
- });
- },
- //获取x,y轴
- getpoint(xmlString){
- var that=this;
- const parser = new DOMParser();
- const xmlDoc = parser.parseFromString(xmlString, "text/xml");
- // 获取所有 SnapPolygon 节点
- const polygonNodes = xmlDoc.querySelectorAll("SnapPolygon");
- var newArr=[];
- var arr1=JSON.parse(JSON.stringify(this.shapes))
- // 提取每个多边形的 id 和坐标点
- this.polygons = Array.from(polygonNodes).map((polygonNode) => {
- const id = polygonNode.querySelector("id").textContent;
- const pointNodes = polygonNode.querySelectorAll("point");
- const points = Array.from(pointNodes).map((pointNode) => ({
- x: pointNode.querySelector("x").textContent,
- y: pointNode.querySelector("y").textContent,
- }));
- var newobj={
- id:id,
- points:points
- }
- newArr.push(newobj)
- // return { id, points };
- });
- this.shapes = arr1.map(item1 => {
- const matchedItem = newArr.find(item2 => item2.id == item1.id);
- return {
- id: item1.id,
- points: matchedItem ? matchedItem.points : item1.points
- };
- });
- // this.shapes=JSON.parse(JSON.stringify(newArr))
- this.messageToSend = this.shapes
- this.sendMessage()
- console.log(this.shapes)
- },
- toggleConnection(){
- if (this.isConnected) {
- // 断开连接
- client.end()
- this.isConnected= false
- this.connectionStatus = 'Disconnected'
- return
- }
- // 建立连接
- this.connecting = true
- try {
- client= mqtt.connect(this.mqttConfig.url, {
- clientId: 'mqttjs_' + Math.random().toString(16).substr(2, 8),
- keepalive: 60,
- clean: true,
- connectTimeout: 4000,
- reconnectPeriod: 1000
- })
- client.on('connect', () => {
- this.isConnected = true
- this.connectionStatus= 'Connected'
- this.connecting = false
- console.log(3)
- // 订阅主题
- client.subscribe(this.mqttConfig.topic, (err) => {
- if (err) {
- console.error('Subscribe error:', err)
- }else{
- console.log('成功订阅 detection/rect 主题!')
- }
- })
- })
- client.on('message', (topic, message) => {
- // 接受信息
- console.log(topic,message)
- this.messages.unshift({
- type: 'received',
- content: message.toString(),
- timestamp: new Date().toLocaleTimeString()
- })
- })
- client.on('error', (err) => {
- console.error('MQTT Error:', err)
- this.connectionStatus= 'Error'
- this.connecting = false
- })
- } catch (error) {
- console.error('Connection error:', error)
- this.connectionStatus= 'Error'
- this.connecting = false
- }
- },
- sendMessage(){
- if (!client || !this.messageToSend) return
- this.messageToSend = JSON.stringify(this.messageToSend)
- console.log(this.messageToSend)
- client.publish(this.mqttConfig.topic, this.messageToSend)
- this.messages.unshift({
- type: 'sent',
- content: this.messageToSend,
- timestamp: new Date().toLocaleTimeString()
- })
- this.messageToSend = []
- },
- // 添加图形,最多不超过16个图形
- clickAddSnapPolygon() {
- var that=this;
- if (!this.g_bEnableDraw) {
- return;
- }
- var shapes=JSON.parse(JSON.stringify(this.shapes))
- let szId = 1; // 默认从 1 开始
- if(shapes&&shapes.length>0){
- const ids = shapes.map(item => item.id).sort((a, b) => a - b);
- for (const id of ids) {
- if (id > szId) {
- // 如果当前 id > szId,说明 szId 未被使用
- break;
- }
- szId = Number(id) + 1; // 否则,继续检查下一个
- }
- }
- if (!/^[1-9]\d*$/.test(szId)) {
- alert("图形ID只能为正整数!");
- return
- }
- if (Number(szId) > 32) {
- alert("图形ID范围1-32!");
- return
- }
- console.log(szId)
- // var szName = encodeString($("#snapName").val());
- var szName = '';
- var szInfo={
- }
- var szInfo = "<?xml version='1.0' encoding='utf-8'?>";
- szInfo += "<SnapPolygonList>";
- szInfo += "<SnapPolygon>";
- szInfo += "<id>" + szId + "</id>"; // [1, 32]
- szInfo += "<polygonType>0</polygonType>"; //如果想绘制多边形,polygonType指需要改为1
- szInfo += "<PointNumMax>17</PointNumMax>"; // [MinClosed, 17]
- szInfo += "<MinClosed>4</MinClosed>"; // [4, 17]
- szInfo += "<tips>#" + szId + "#" + szName + "</tips>";
- szInfo += "<isClosed>false</isClosed>";
- szInfo += "<color><r>0</r><g>255</g><b>0</b></color>";
- szInfo += "<pointList/>";
- szInfo += "</SnapPolygon>";
- szInfo += "</SnapPolygonList>";
- WebVideoCtrl.I_SetSnapPolygonInfo(this.g_iWndIndex, szInfo).then(() => {
- // showOPInfo("添加图形成功!");
- var obj={
- id:szId,
- points:[]
- }
- if(this.shapes&&this.shapes.length){
- this.shapes.splice(Number(szId)-1,0,obj)
- }else{
- this.shapes.push(obj)
- }
- });
- WebVideoCtrl.I_SetSnapDrawMode(this.g_iWndIndex, 2);
- },
- //删除图形
- clickDelSnapPolygon(szId,idx) {
- if (!this.g_bEnableDraw) {
- return;
- }
- var aShapes = [];
- aShapes.push({
- polygonType: 0,
- id: szId
- });
- this.shapes.splice(idx,1)
- WebVideoCtrl.I_ClearSnapInfo(this.g_iWndIndex, aShapes);
- },
- // 清空图形
- clickDelAllSnapPolygon() {
- if (!this.g_bEnableDraw) {
- return;
- }
- WebVideoCtrl.I_ClearSnapInfo(this.g_iWndIndex).then(() => {
- // showOPInfo("清空图形成功!");
- this.shapes=[];
- }, (oError) => {
- // showOPInfo("清空图形失败!", oError.errorCode, oError.errorMsg);
- });
- },
- // 通道点击
- ishg(val){
- this.isfse = false
- if(WebVideoCtrl){
- console.log(this.szDeviceIdentify)
- this.clickDelAllSnapPolygon()
- WebVideoCtrl.I_Logout(this.szDeviceIdentify)
- WebVideoCtrl.I_StopAllPlay()
- WebVideoCtrl.I_DestroyPlugin()
- WebVideoCtrl.I_Resize()
- }
- let snghs = val.videoAddress.split('@')
- let snghst = snghs[1].split(':')
- let snsgduan = snghst[1].split('/')
- console.log(snghs,snghst,snsgduan)
- let sgse={'ip':snghst[0],'duank':snsgduan[0],
- 'account':val.account,
- 'password':val.password,
- }
- this.getVideo(sgse)
- WebVideoCtrl.I_ShowPlugin()
- // this.clickStartRealPlay('192.168.101.64', '80',1, 0, 1);
- },
- init(val) { //这个val 就是一个地址,例如: http://192.168.2.201:85/live/9311272c49b845baa2b2810ad9bf3f68.flv 这是个服务器返回给我的一个监控视频流地址
- setTimeout(() => { //使用定时器是因为,在mounted声明周期里调用,可能会出现DOM没加载出来的原因
- var videoElement = this.$refs.videosmallone; // 获取到html中的video标签
- this.isshiwa = true
- if (flvjs.isSupported()) {
- //因为我这个是复用组件,进来先判断 player是否存在,如果存在,销毁掉它,不然会占用TCP名额
- if (this.player !== null) {
- this.player.pause();
- this.player.unload();
- this.player.detachMediaElement();
- this.player.destroy();
- this.player = null;
- }
- this.player = flvjs.createPlayer( //创建直播流,加载到DOM中去
- {
- type: "flv",
- url: val, //你的url地址
- isLive: true, //数据源是否为直播流
- hasAudio: false, //数据源是否包含有音频
- hasVideo: true, //数据源是否包含有视频
- enableStashBuffer: true, //是否启用缓存区
- },
- {
- enableWorker: false, //不启用分离线程
- enableStashBuffer: false, //关闭IO隐藏缓冲区
- autoCleanupSourceBuffer: true, //自动清除缓存
- lazyLoad: false,
- }
- );
- this.isshoe = true
- this.player.attachMediaElement(videoElement); //放到dom中去
- //!!!!!!这里需要注意,有的时候load加载完成不一定可以播放,要是播放不成功,用settimeout 给下面的this.player.play() 延时几百毫秒再播放
- // setTimeout(this.player.play(), 48000);
- setTimeout(() =>{
- //到时间时只执行一次就停止
- this.player.load();//准备完成
- this.player.play()
- console.log('播放')
- },900)
- }
- }, 500);
- },
- createVideo() {
- if (flvjs.isSupported()) {
- console.log(1)
- var videoElement = document.getElementById('myFlvVideo')
- console.log(videoElement,flvjs)
- this.flvPlayer = flvjs.createPlayer(
- {
- type: 'application/x-mpegURL',
- isLive: true,
- hasAudio: false,
- url:'https://stream1.freetv.fun/86d463c0006da643e45e26b34875df87059dcba13e69d0a5471b185793c122a2.m3u8'
- },
- {
- cors: true, // 是否跨域
- enableWorker: false, // 是否多线程工作
- enableStashBuffer: false, // 是否启用缓存
- stashInitialSize: 400, // 缓存大小(kb) 默认384kb
- autoCleanupSourceBuffer: true // 是否自动清理缓存
- }
- )
- this.flvPlayer.attachMediaElement(videoElement)
- this.flvPlayer.load()
- this.flvPlayer.play()
- console.log(1244)
- // 报错重连
- this.flvPlayer.on(flvjs.Events.ERROR, (errType, errDetail) => {
- console.log('errorType:', errType)
- console.log('errorDetail:', errDetail)
- if (this.flvPlayer) {
- this.destoryVideo()
- this.createVideo()
- }
- })
- }
- console.log(this.flvPlayer.play())
- },
- destoryVideo() {
- this.player.pause()
- this.player.unload()
- this.player.detachMediaElement()
- this.player.destroy()
- this.player = null
- },
- initScroll() {
- // 给内层盒子设置宽度,不设置宽度的话无法滚动
- // let width = this.goods.length * 60
- // // 如果有外边距,可以这样写。需要去掉最后一个元素的外边距,在后面减一下
- // let width = this.goodslength * (60 + 10) - 10
- let width = 6 * (200 + 10) - 10
- // this.$refs.content.style.width = width + 'px'
- this.$nextTick(()=>{
- if(!this.Scroll) {
- this.Scroll = new Bscroll(this.$refs.wrapper,{
- click: true, // 配置允许点击事件
- scrollX: true, // 开启横向滚动
- eventPassthrough: 'vertical', // 当设置 eventPassthrough 为 'vertical' 的时候,scrollY 无效
- mouseWheel: true,
- scrollbar: { // 滚动条, 要加相对位置
- fade: true
- }
- })
- } else {
- this.Scroll.refresh() // 重新计算 better-scroll,当 DOM 结构发生变化的时确保滚动效果正常
- }
- })
- },
- /** 查询岗位列表 */
- getList() {
- // this.queryParams
- this.loading = true
- // getWarnManage(this.$route.query.id).then(response => {
- // this.form = response.data
- const url = new URL('rtsp://admin:zxy123456@192.168.101.64:554/h264/ch1/main/av_stream');
- const auth = url.username + ':' + url.password;
- console.log(url.username,url.password,8)
- // this.username = url.username;
- // this.password = url.password;
- this.getVideo()
- WebVideoCtrl.I_ShowPlugin()
- this.loading = false
- // this.open = true
- // this.title = "修改告警管理"
- // })
- // camera(this.queryParams).then(response => {
- // this.postList = response.data.data.list;
- // if(response.data.data != null){
- // if(response.data.data.list.length != 0){
- // let ne = response.data.data.list[0]
- // response.data.data.list.filter(rtu=>{
- // if(rtu.name == '后门道闸'){
- // console.log(3,rtu)
- // ne = rtu
- // return
- // }
- // })
- // this.isfgw(ne)
- // this.isjfwe =ne
- // }
- // }
- // // this.postList=[{'nsje':null,'visitPhone':null,'isReception':'Y'}]
- // this.total = response.data.data.total;
- // this.loading = false;
- // });
- },
- getListh() {
- this.loading = true;
- listReservatd().then(response => {
- // this.postList = response.rows;
- this.ksjegsg= response.data
- // this.total = response.total;
- this.loading = false;
- });
- },
- isfgw(val){
- this.isjfwe = val
- let nhge={cameraIndexCode:val.indexCode}
- this.isshiwa = false
- this.isshoe= false
- cameraIndexCode(nhge.cameraIndexCode).then(response => {
- console.log(response.data.data.url)
- this.isshoe= true
- this.init(response.data.data.url)
- this.isshiwa = true
- // this.postList = response.rows;
- // this.total = response.total;
- });
- console.log(val,4)
- },
- osge(){
- console.log(this.isjfwe,45)
- if(this.isjfwe.name == '后门道闸'){
- this.isjfwe.name ='后门抓拍一体机1'
- }
- let nge={equipmentName:this.isjfwe.name}
- openDz(nge).then(response => {
- });
- },
- osgef(){
- if(this.isjfwe.name == '后门道闸'){
- this.isjfwe.name ='后门抓拍一体机1'
- }
- let nge={equipmentName:this.isjfwe.name}
- closeDz(nge).then(response => {
- // this.postList = response.rows;
- });
- },
- ilw(row,val){
- this.kje = val
- // console.log(row)
- if(row.value == 0){
- this.queryParams.reservatType = undefined
- }else{
- this.queryParams.reservatType = row.value
- }
- console.log(this.kje)
- this.queryParams.pageNum = 1
- this.getList()
- },
- nhgwel(item){
- this.form.receptionId = item.receptionId
- this.form.receptionName = item.receptionName
- this.form.receptionPhone = item.phonenumber
- },
- getPass(row) {
- const _this = this
- this.$confirm('是否审核通过', "提醒", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return setPass({
- visitType: 3,
- reservatId: row.reservatId,
- // xmStatus:row.xmStatus
- })
- }).then(() => {
- _this.getList();
- _this.msgSuccess("提交成功");
- })
- },
- infoBtn(row) {
- const _this = this
- this.$confirm('是否拒绝', "提醒", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return setPass({
- visitType: 2,
- reservatId: row.reservatId,
- // xmStatus:row.xmStatus
- })
- }).then(() => {
- _this.getList();
- _this.msgSuccess("提交成功");
- })
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.opens = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- receptionId:undefined,
- receptionPhone:undefined,
- // postSort: 0,
- // status: "0",
- receptionName: undefined
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.reservatId)
- this.single = selection.length!=1
- this.multiple = !selection.length
- },
- nhgeo(row){
- this.reset();
- this.open = true;
- this.title = "分配接待人员";
- this.form.reservatId = row.reservatId;
- this.form.reservatConfigTimeId=row.reservatConfigTimeId;
- this.form.visitDate=row.visitDate
- },
- handleDeleteh(row){
- this.$router.push({
- path: '/bjqs',
- query: {
- 'id':row.reservatId,
- 'name':null,
- 'names':null,
- 'isxz':1
- }
- })
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.forms = {
- reservatType:'1'
- }
- this.opens = true;
- this.titles = "添加预约人员";
- // this.scoreDataDetailsList = []
- // this.$router.push({
- // path: '/system/bjq',
- // })
- // this.$router.push({
- // path: '/bjqs',
- // query: {
- // 'id':null,
- // 'name':null,
- // 'names':null,
- // 'isxz':1
- // }
- // })
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const recordId = row.recordId || this.ids
- getReservat(recordId).then(response => {
- this.forms = response.data;
- this.opens = true;
- this.title = "修改访问记录";
- });
- },
- /** 提交按钮 */
- submitForm: function() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- // if (this.form.reservatId != null) {
- updateReservat(this.form).then(response => {
- this.$modal.msgSuccess("操作成功");
- this.open = false;
- this.getList();
- });
- // } else {
- // addReservat(this.form).then(response => {
- // this.$modal.msgSuccess("新增成功");
- // this.open = false;
- // this.getList();
- // });
- // }
- }
- });
- },
- submitForms: function() {
- this.$refs["forms"].validate(valid => {
- if (valid) {
- // if (this.form.reservatId != null) {
- // updateReservat(this.forms).then(response => {
- // this.$modal.msgSuccess("操作成功");
- // this.open = false;
- // this.getList();
- // });
- // } else {
- this.forms.visitTime = this.forms.visitTime + '-' + this.forms.visitTime
- addReservat(this.forms).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.opens = false;
- this.getList();
- });
- // }
- }
- });
- },
- nglqw(val){
- this.opent = true
- this.bg = val.investigateTableId
- },
- iszheg(event){
- console.log(event);
- // 校验身份证:
- console.log(reg.test(this.form.idCard),23741)
- if ( reg.test(this.form.idCard)|| _IDre15.test(this.form.idCard)) {
- // this.idea();
- this.go(this.form.idCard);
- // callback()
- } else {
- if(ncjsle.test(this.form.idCard) || nhyeli.test(this.form.idCard)){
- console.log(3)
- }else{
- if(gnse.test(this.form.idCard) ){
- console.log(4)
- }else{
- if(tw.test(this.form.idCard) || twe.test(this.form.idCard)){
- console.log(5)
- }else{
- this.$message.error('证件格式不正确');
- }
- }
- }
- }
- },
- erw(row){
- this.$router.push({
- path: '/reny/ewm',
- query:{
- 'tenantId':row.investigateTableId
- }
- })
- },
- hussar_17Click(val) {
- const _this = this
- var url =process.env.VUE_APP_BASE_API + 'pages/index/index?id=' + val.investigateTableId;
- console.log(url,this.$refs.canvas,6)
- this.opent = true
- QRCode.toCanvas(
- canvas,
- url,//生成二维码的数据
- {width: 100, height:100, margin: 1.5},//margin调整二维码的白边大小
- function (error) {
- if (error) {
- console.log(error);
- }
- }
- );
- // console.log(qrcode,987)
- },
- /** 成绩_子添加按钮操作 */
- handleAddScoreDataDetails() {
- let obj = {};
- obj.duty = "";
- obj.idCard = "";
- obj.phonenumber = "";
- obj.userName = "";
- this.scoreDataDetailsList.push(obj);
- console.log(this.scoreDataDetailsList)
- },
- /** 成绩_子删除按钮操作 */
- handleDeleteScoreDataDetails() {
- if (this.checkedScoreDataDetails.length == 0) {
- this.$modal.msgError("请先选择要删除的数据");
- } else {
- const scoreDataDetailsList = this.scoreDataDetailsList;
- const checkedScoreDataDetails = this.checkedScoreDataDetails;
- this.scoreDataDetailsList = scoreDataDetailsList.filter(function(item) {
- return checkedScoreDataDetails.indexOf(item.index) == -1
- });
- }
- },
- /** 复选框选中数据 */
- handleScoreDataDetailsSelectionChange(selection) {
- this.checkedScoreDataDetails = selection.map(item => item.index)
- },
- /** 成绩_子序号 */
- rowScoreDataDetailsIndex({ row, rowIndex }) {
- row.index = rowIndex + 1;
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const postIds = row.recordId || this.ids;
- delReservat(postIds).then(response => {
- this.$modal.msgSuccess("操作成功");
- this.getList();
- });
- // this.$modal.confirm('是否确认删除数据项?').then(function() {
- // return delPost(postIds);
- // }).then(() => {
- // this.getList();
- // this.$modal.msgSuccess("删除成功");
- // }).catch(() => {});
- },
- handleDeletehx(row) {
- const postIds = row.reservatId || this.ids;
- let nhg={}
- nhg.reservatId = postIds
- delReservathx(nhg).then(response => {
- this.$modal.msgSuccess("操作成功");
- this.getList();
- });
- // this.$modal.confirm('是否确认删除数据项?').then(function() {
- // return delPost(postIds);
- // }).then(() => {
- // this.getList();
- // this.$modal.msgSuccess("删除成功");
- // }).catch(() => {});
- },
- // 发送短信
- handleUpdatefas(row){
- updateFs(row).then(response => {
- this.$modal.msgSuccess("发送成功");
- // this.getList();
- });
- },
- handleDeletegx(row){
- updateGx(row).then(response => {
- this.$modal.msgSuccess("发送成功");
- // this.getList();
- });
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download('system/reservat/export', {
- ...this.queryParams
- }, `预约人员.xlsx`)
- },
- // 获取屏幕高度
- showFilterForm () {
- this.filterActive = !this.filterActive
- this.changeTableMaxHeight()
- },
- changeTableMaxHeight () {
- let height = document.body.offsetHeight // 网页可视区域高度
- // if (this.filterActive) {
- // this.tableMaxHeight = height - 320
- // } else {
- this.tableMaxHeight = height - 350
- // }
- console.log(height)
- },
- // 播放摄像头
- getVideo(row) {
- var that=this;
- this.isfse = true
- console.log(row)
- this.initVideoPlay(row.ip, '80', row.account, row.password,'divPlugin')
- },
- // 有插件
- initVideoPlay(ip, port, username, password,id) {
- var that = this;
- var g_iWndIndex = 0; //可以不用设置这个变量,有窗口参数的接口中,不用传值,开发包会默认使用当前选择窗口
- var g_oLocalConfig = null; //本地配置
- // let ip = this.szIP //硬盘录像机ip
- // let port = this.szPort //默认为80端口
- // let username = this.szUsername //账号:
- // let password = this.szPassword // 密码
- var iRtspPort = ''
- // 1.初始化插件参数及插入插件
- WebVideoCtrl.I_InitPlugin({
- bWndFull: true, //是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
- iWndowType: 1,
- bDebugMode: true,
- cbSelWnd: function(xmlDoc) {
- g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
- const szInfo = "当前选择的窗口编号:" + g_iWndIndex;
- this.g_iWndIndex = g_iWndIndex;
- console.log(szInfo, "szInfo");
- },
- cbDoubleClickWnd: function(iWndIndex, bFullScreen) {
- let szInfo = "当前放大的窗口编号:" + iWndIndex;
- if (!bFullScreen) {
- szInfo = "当前还原的窗口编号:" + iWndIndex;
- }
- // console.log(szInfo, "szInfo");
- },
- cbEvent: function(iEventType, iParam1, iParam2) {
- if (2 == iEventType) {
- // 回放正常结束
- console.log("窗口" + iParam1 + "回放结束!");
- } else if (-1 == iEventType) {
- console.log("设备" + iParam1 + "网络错误!");
- } else if (3001 == iEventType) {
- clickStopRecord(g_szRecordType, iParam1);
- }
- },
- //2.登录摄像头
- cbInitPluginComplete: function() {
- const oLiveView = {
- iProtocol: 1, // protocol 1:http, 2:https
- szIP: ip, // protocol ip
- szPort: port, // protocol port
- szUsername: username, // device username
- szPassword: password, // device password
- iStreamType: 1, // stream 1:main stream 2:sub-stream 3:third stream 4:transcode stream
- iChannelID: 1, // channel no
- bZeroChannel: false, // zero channel
- };
- // var swidth=Number((that.width*Number(that.scale))).toFixed(2)
- // var sheight=Number((that.height*Number(that.scale))).toFixed(2)
- // that.swidth=swidth
- // that.sheight=sheight
- WebVideoCtrl.I_InsertOBJECTPlugin(id).then(
- () => {
- // setTimeout(function(){
- // WebVideoCtrl.I_Resize(swidth,sheight)
- // },300)
- WebVideoCtrl.I_Login(
- oLiveView.szIP,
- oLiveView.iProtocol,
- oLiveView.szPort,
- oLiveView.szUsername,
- oLiveView.szPassword, {
- timeout: 3000,
- async: false,
- success: function(xmlDoc) {
- console.log(" 登录成功!");
- let a = ip
- let b = port
- setTimeout(function() {
- //延迟方法
- setTimeout(function() {
- //调用预览摄像头这里可以循环创建
- that.clickStartRealPlay(a, b,1, 0, 1);
- // that.clickStartRealPlay(a, b, 1, 1,2);
- // that.clickStartRealPlay(a, b, 1, 2,3);
- // clickStartRealPlay(a,b, 1, 3, 4);
- // clickStartRealPlay(a,b, 1, 4, 5);
- // clickStartRealPlay(a,b, 1, 5, 6);
- // clickStartRealPlay(a,b, 1, 6, 7);
- // clickStartRealPlay(a,b, 1, 7, 8);
- }, 1000);
- setTimeout(function() {
- // 获取通道 (如果多个摄像头需要获取多个通道需要调用)
- // getChannelInfo(a);
- //获取端口 (在这里获取RTSP 端口号 预览时传入)
- getDevicePort(a);
- }, 10)
- }, 10);
- },
- error: function(oError) {
- console.log(" 登录失败!", oError);
- },
- }
- );
- // 检查插件是否最新
- WebVideoCtrl.I_CheckPluginVersion().then((bFlag) => {
- if (bFlag) {
- alert(
- "检测到新的插件版本,双击开发包目录里的HCWebSDKPlugin.exe升级!"
- );
- }
- });
- },
- () => {
- alert(
- "插件初始化失败,请确认是否已安装插件;如果未安装,请双击开发包目录里的HCWebSDKPlugin.exe安装!"
- );
- }
- );
- },
- });
- // 3.获取通道
- function getChannelInfo(a) {
- var szDeviceIdentify = a,
- oSel = null; //通道列表
- if (null == szDeviceIdentify) {
- return;
- }
- // 模拟通道 有
- WebVideoCtrl.I_GetAnalogChannelInfo(szDeviceIdentify, {
- success: function(xmlDoc) {
- var oChannels = $(xmlDoc).find("VideoInputChannel");
- $.each(oChannels, function(i) {
- var id = $(this).find("id").eq(0).text(),
- name = $(this).find("name").eq(0).text();
- if ("" == name) {
- name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
- }
- // console.log(id + "通道id是")
- // console.log(name + "通道name是")
- });
- console.log(szDeviceIdentify + " 获取模拟通道成功!");
- },
- error: function(oError) {
- console.log(szDeviceIdentify + " 获取模拟通道失败!", oError.errorCode, oError.errorMsg);
- }
- });
- // 数字通道
- WebVideoCtrl.I_GetDigitalChannelInfo(szDeviceIdentify, {
- success: function(xmlDoc) {
- var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
- $.each(oChannels, function(i) {
- var id = $(this).find("id").eq(0).text(),
- name = $(this).find("name").eq(0).text(),
- online = $(this).find("online").eq(0).text();
- if ("false" == online) { // 过滤禁用的数字通道
- return true;
- }
- if ("" == name) {
- name = "IPCamera " + (i < 9 ? "0" + (i + 1) : (i + 1));
- }
- });
- console.log(szDeviceIdentify + " 获取数字通道成功!");
- },
- error: function(oError) {
- console.log(szDeviceIdentify + " 获取数字通道失败!", oError.errorCode, oError.errorMsg);
- }
- });
- // 零通道
- WebVideoCtrl.I_GetZeroChannelInfo(szDeviceIdentify, {
- success: function(xmlDoc) {
- var oChannels = $(xmlDoc).find("ZeroVideoChannel");
- $.each(oChannels, function(i) {
- var id = $(this).find("id").eq(0).text(),
- name = $(this).find("name").eq(0).text();
- if ("" == name) {
- name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : (i + 1));
- }
- if ("true" == $(this).find("enabled").eq(0).text()) { // 过滤禁用的零通道
- }
- });
- console.log(szDeviceIdentify + " 获取零通道成功!");
- },
- error: function(oError) {
- console.log(szDeviceIdentify + " 获取零通道失败!", oError.errorCode, oError.errorMsg);
- }
- });
- };
- //4.获取端口
- function getDevicePort(a) {
- var szDeviceIdentify = a;
- if (null == szDeviceIdentify) {
- return;
- }
- WebVideoCtrl.I_GetDevicePort(szDeviceIdentify).then((oPort) => {
- // console.log(oPort.iDevicePort + "iDevicePort的值是")
- // console.log(oPort.iRtspPort + "iRtspPort的值是")
- console.log(szDeviceIdentify + " 获取端口成功!");
- iRtspPort = oPort.iRtspPort
- that.iRtspPort = iRtspPort
- }, (oError) => {
- var szInfo = "获取端口失败!";
- console.log(szDeviceIdentify + szInfo, oError.errorCode, oError.errorMsg);
- });
- };
- },
- // 5.开始预览
- clickStartRealPlay(szIP, szPort, iStreamType, iWndIndex, iChannelID) {
- var that=this;
- var oWndInfo = WebVideoCtrl.I_GetWindowStatus(this.g_iWndIndex),
- szDeviceIdentify = szIP + "_" + szPort, //ip
- iChannelID = iChannelID,
- bZeroChannel = false,
- iPort = this.iRtspPort,
- szInfo = "";
- iStreamType = iStreamType;
- if (null == szDeviceIdentify) {
- return null;
- }
- this.szDeviceIdentify = szDeviceIdentify;
- var startRealPlay = function() {
- WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
- iStreamType: iStreamType,
- iChannelID: iChannelID,
- bZeroChannel: bZeroChannel,
- iWndIndex: iWndIndex, //要播放的窗口
- iPort: iPort, //如果多个摄像头需要必填 (RTSP 端口号)
- success: function() {
- szInfo = "开始预览窗口" + iWndIndex + "成功!";
- console.log(szDeviceIdentify + " " + szInfo);
- },
- error: function(oError) {
- console.log(szDeviceIdentify + " 开始预览窗口" + iWndIndex + "失败!", oError
- .errorCode, oError.errorMsg);
- }
- });
- };
- if (oWndInfo != null) { // 已经在播放了,先停止
- WebVideoCtrl.I_Stop({
- success: function() {
- startRealPlay();
- }
- });
- } else {
- startRealPlay();
- }
- },
- }
- };
- </script>
- <style lang="scss">
- .isjses{
- .el-tabs--left .el-tabs__nav-wrap.is-left::after{
- width:6px;
- }
- .el-tabs--left .el-tabs__active-bar.is-left,{
- width:6px;
- }
- }
- .ingaqe{
- .el-input--medium{
- width:100%;
- }
- }
- .nhgrls{
- .el-dialog__body{
- padding: 0;
- }
- }
- .hyr{
- span{
- text-decoration:underline;
- }
- }
- </style>
- <style scoped lang="scss">
- .nghwgq{
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- margin-top: 90px;
- div{
- color:#aaa;
- }
- }
- .ihgswq{
- // width:100%;
- // overflow-x: hidden;
- // margin-top: 30px;
- }
- .fijge{
- // width: 110%;
- display: flex;
- display: -webkit-flex;
- justify-content: space-between;
- .shotw{
- position: relative;
- // width:32%;
- width: 238px;
- height: 140px;
- margin-left: 0;
- margin-right: 20px;
- margin-bottom: 15px;
- img{
- height: 100%;
- cursor:pointer;
- }
- p{
- // bottom:-10px;
- margin: 0;
- font-weight: bold;
- font-size: 16px;
- padding: 5px 10px;
- cursor:pointer;
- }
- .iges{
- position: absolute;
- top:50%;
- left:50%;
- width:30px;
- height: 30px;
- transform: translate(-50%,-50%);
- cursor:pointer;
- }
- }
- }
- .nhgwesvq{
- width:1610px !important;
- }
- .shotw{
- position: relative;
- margin-left: -20px;
- margin-right: -20px;
- img{
- width:100%;
- height: 80vh;
- }
- p{
- position: absolute;
- bottom: 0;
- left:0;
- background-color: rgba(0, 0, 0, .5);
- width: 100%;
- padding: 13px 5px;
- color:#fff;
- font-weight: bold;
- font-size: 18px;
- }
- .p{
- top:0px;
- height: 60px;
- margin: 0;
- padding-left: 20px;
- }
- }
- .ksfpo{
- background-color: #3464EB;
- padding: 6px 12px;
- border-radius: 4px ;
- color:#fff;
- cursor:pointer;
- }
- .ksfpok{
- background-color: #FFFFFF;
- padding: 5px 11px;
- border-radius: 4px;
- color:#3464EB;
- border: 1px solid #3464EB;
- margin-left: 10px;
- cursor:pointer;
- }
- .ksfpofg{
- background-color: #75DB75;
- padding: 5px 11px;
- border-radius: 4px;
- color:#FFFFFF;
- border: 1px solid #75DB75;
- margin-left: 10px;
- cursor:pointer;
- }
- .iuer{
- display: flex;
- justify-content: space-between;
- align-items: center;
- .ite{
- display: flex;
- justify-content: space-between;
- align-items: center;
- p{
- cursor:pointer;
- margin: 0;
- font-size: 15px;
- font-family: PingFang SC;
- font-weight: 500;
- color:#666666;
- padding: 4px 12px;
- background: #Fff;
- border-radius: 4px;
- margin-right: 20px;
- position: relative;
- }
- .actt{
- background: #fff;
- // border-bottom: 3px solid #5974E0;
- // border-radius: 0;
- // border-bottom-right-radius: 4px;
- color: #5974E0;
- }
- .actt{
- &::after {
- content: "";
- width: 40%;
- height: 5px;
- border-radius: 3px;
- transform: translate(-50%);
- background-color: #5974E0;
- position: absolute;
- left: 50%;
- bottom:-3px;
- }
- }
- }
- }
- .lqw{
- padding: 0 10px;
- margin: 0;
- margin-bottom: 20px;
- }
- .nhgel{
- height: 170px;
- background-color: #313b61;
- width: 100%;
- position: absolute;
- top:0;
- left:0;
- z-index: 0;
- }
- .app-container{
- background-color: #f3f4f6;
- padding-top: 10px;
- height: 180vh;
- }
- .ntgs{
- position: relative;
- // background-color: #fff;
- padding: 5px;
- // border-radius: 5px;
- padding-top: 10px;
- padding: 10px 20px;
- .pagination-container{
- height: 50px;
- }
- }
- .nghfs{
- position: relative;
- background-color: #fff;
- padding-top: 18px !important;
- padding: 5px;
- // border-radius: 5px;
- // margin-bottom: 20px;
- }
- .ksf{
- img{
- width:100%;
- height: 100%;
- }
- }
- .ingwfaq{
- font-weight: bold;
- font-size: 16px;
- }
- .dflex{display: flex;}
- .dflext{display: flex;align-items: flex-start;}
- .drawings-list{width: 100%;flex: 0 0 auto;padding-left: 10px;line-height:36px ;
- .delimg{width: 15px;height: 15px;margin-left: 5px;}
- .txt{font-size: 12px;padding-left: 5px;flex: 1;}
- .tflex{display: flex;align-items: center;}
- }
- .disbtn{display: flex;align-items: center;flex: 0 0 auto;min-height: 34px;cursor: pointer;
- img{width: 14px;height: 14px;margin-right: 10px;}
- font-weight: 500;
- font-size: 14px;
- color: #444444;
- }
- </style>
|