| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478 |
- <template>
- <div class="monitor-container" style="cursor: default">
- <el-breadcrumb separator-class="el-icon-arrow-right">
- <el-breadcrumb-item>监控系统</el-breadcrumb-item>
- <el-breadcrumb-item>监控</el-breadcrumb-item>
- </el-breadcrumb>
- <div class="basicsbox_text">
- <el-button size="mini" type="primary" @click="addEquip()" class="addequip"
- >添加设备</el-button
- >
- <el-button size="mini" @click="bindingSIM()" class="addequipA">绑定SIM卡</el-button>
- </div>
- <div class="monitor_hint" v-if="longtimetf">
- <div class="monitor_hint_text">
- <img src="../../../../static/images/monitor/laba.png" alt />
- <p>您已持续观看监控很久了,长时间观看监控会耗尽物联网卡流量,请您注意</p>
- </div>
- <i class="el-icon-close" @click="guanbilong"></i>
- </div>
- <div class="monitor-wrap">
- <div class="video-box">
- <div class="video-container" ref="videoContainerRef">
- <!-- 插件播放 -->
- <div class="x" v-if="playType == 1" v-html="html" style="width: 100%; height: 100%"></div>
- <!-- 非插件播放 ,默认非插件播放-->
- <div class="v" style="width: 100%; height: 100%" v-if="playType == 0">
- <div
- :class="{
- videoItem: true,
- a1: divNum == 1,
- a4: divNum == 4,
- a9: divNum == 9,
- selected: count == selected
- }"
- v-for="count in divNum"
- :key="divNum + count"
- @click.capture="selectVideo(count)"
- >
- <div style="width: 100%; height: 100%" :id="'my-video' + count"></div>
- </div>
- </div>
- </div>
- <div v-show="false" class="split-screen">
- <div>
- <span class="sp sp01" @click="splitView(1)"></span>
- <span class="sp sp02" @click="splitView(4)"></span>
- <span class="sp sp03" @click="splitView(9)"></span>
- </div>
- <el-radio-group
- v-model="videoType"
- size="mini"
- @input="changeVideoType"
- v-if="isShowType"
- >
- <el-radio-button label="sd">标清</el-radio-button>
- <el-radio-button label="hd">高清</el-radio-button>
- </el-radio-group>
- </div>
- </div>
- <div class="nav-box">
- <div class="view-box">
- <div class="search">
- <el-autocomplete
- style="width: 262px"
- size="mini"
- v-model="state"
- :fetch-suggestions="querySearchAsync"
- placeholder="请输入设备ID"
- @select="handleSelect"
- @input="axiosList"
- >
- </el-autocomplete>
- <el-button style="margin-left: 8px" @click="axiosList" type="primary" size="mini"
- >查询</el-button
- >
- </div>
- <ul class="viewLists">
- <li
- v-for="(item, index) in Idlist"
- :key="index"
- :class="{ active: activeIndex == index }"
- @click="selectEquip(item.device_id, item.jktype, index)"
- >
- <span :class="['status', item.status == 1 ? 'onLine' : 'outLine']">{{
- item.status == 1 ? '在线' : '离线'
- }}</span>
- <el-tooltip class="item" effect="dark">
- <div slot="content">
- 设备名称:{{ item.device_name }}<br /><br />设备id:{{ item.device_id }}
- </div>
- <div class="titleBox">
- <span class="device-name" :title="item.device_name">{{ item | formatName }}</span>
- <span class="device-id">ID:{{ item.device_id }}</span>
- </div>
- </el-tooltip>
- <!--查看图片 查看回放原来逻辑 -->
- <div class="viewPhoto" v-if="false">
- <i
- v-if="$QueryPermission(188)"
- class="el-icon-picture"
- @click.stop="viewPhoto(item.device_id)"
- ></i>
- <i
- class="el-icon-video-camera-solid"
- @click.stop="toplay(item.device_id, item.type_id, item.token, item.gb)"
- v-if="$QueryPermission(236) && item.camera_playback == 1"
- ></i>
- </div>
- <div class="more">
- <el-popover placement="top" popper-class="hoverpopover" :width="10" trigger="click">
- <div>
- <p class="cursor" @click="reName(item.device_id, item.device_name)">信息修改</p>
- <p class="cursor" style="color: #ff5951">删除设备</p>
- </div>
- <span slot="reference" class="yficonfont icon-gengduo"></span>
- </el-popover>
- </div>
- <!-- -->
- <!-- <span @click.stop="viewPhoto(item.device_id)" class="viewPhoto"
- >查看图片</span
- >-->
- </li>
- </ul>
- <div class="splitPage" onselectstart="return false">
- <el-pagination
- :small="true"
- background
- @current-change="handleCurrentChange"
- :current-page.sync="currPage"
- :page-size="8"
- :pager-count="5"
- layout="prev, pager, next"
- :total="totalPage"
- >
- </el-pagination>
- </div>
- </div>
- <div class="view-box" v-show="true">
- <div class="camera-control">
- <span
- class="zoom-in el-icon-minus"
- @mousedown="configCamera('move', 9)"
- @mouseup="stopConfigCamera()"
- ></span>
- <div class="control-ring">
- <div
- @mousedown="configCamera('move', 0, 'up')"
- @mouseup="stopConfigCamera()"
- class="div-opt upCtr el-icon-arrow-up"
- ></div>
- <div
- @mousedown="configCamera('move', 1, 'down')"
- @mouseup="stopConfigCamera()"
- class="div-opt downCtr el-icon-arrow-down"
- ></div>
- <div
- @mousedown="configCamera('move', 2, 'left')"
- @mouseup="stopConfigCamera()"
- class="div-opt leftCtr el-icon-arrow-left"
- ></div>
- <div
- @mousedown="configCamera('move', 3, 'right')"
- @mouseup="stopConfigCamera()"
- class="div-opt rightCtr el-icon-arrow-right"
- ></div>
- <div class="outer-ring">
- <div class="quarter-sector" :class="'opt-active-' + optActive"></div>
- </div>
- <div class="inner-circle">
- <i @click="photograph()" class="el-icon-camera-solid camera-icon"></i>
- </div>
- </div>
- <span
- class="zoom-out el-icon-plus"
- @mousedown="configCamera('move', 8)"
- @mouseup="stopConfigCamera()"
- ></span>
- </div>
- <div class="btnBox">
- <el-button size="small" @click.stop="viewPhoto()">查看图片</el-button>
- <el-button size="small" @click.stop="toplay()">查看回放</el-button>
- <!-- <div class="zoom">
- <span
- class="addCtr"
- @mousedown="configCamera('move', 8)"
- @mouseup="stopConfigCamera()"
- ></span>
- <span
- class="reduceCtr"
- @mousedown="configCamera('move', 9)"
- @mouseup="stopConfigCamera()"
- ></span>
- </div> -->
- <!-- <div
- v-show="jktype == 1"
- class="playBack"
- @click="playBackDialogVisible = true"
- id="playBack"
- ></div> -->
- <!-- <div @click="addEquip()" class="addequip"></div>
- <div @click="bindingSIM()" class="addequipA"></div> -->
- </div>
- </div>
- </div>
- </div>
- <!-- 拍照 -->
- <el-dialog title="手动下载" :visible.sync="takePhotoDialogVisible" width="30%">
- <el-input type="textarea" id="picUrl" v-model="picUrl"></el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="takePhotoDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="copyPicUrl">复制</el-button>
- </span>
- </el-dialog>
- <!-- 查看回放 -->
- <el-dialog
- title="查看回放"
- :visible.sync="playBackDialogVisible"
- width="600px"
- @close="palyBackClose"
- >
- <el-form ref="backFormRef" :model="backForm" :rules="backFormRules" label-width="80px">
- <el-form-item label="时间范围" prop="time">
- <el-date-picker
- v-model="backForm.time"
- type="datetimerange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <!-- <el-form-item label="通道" prop="aisle">
- <el-select
- style="width: 400px"
- v-model="backForm.aisle"
- placeholder="请选择"
- >
- <el-option
- v-for="item in Number(jktype)"
- :key="item"
- :label="'通道' + item"
- :value="item"
- >
- </el-option>
- </el-select>
- </el-form-item>-->
- <el-form-item>
- <el-button type="default" @click="playBackDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="playBackSubmit">确定</el-button>
- </el-form-item>
- </el-form>
- <div id="videoBack">
- <div id="playWind"></div>
- </div>
- </el-dialog>
- <!-- 测试添加设备 -->
- <el-dialog
- title="添加设备"
- :visible.sync="addEquipment"
- width="575px"
- :before-close="handleClose"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- >
- <!-- 测试 -->
- <div class="facility_box">
- <ul
- style="
- margin: -30px 0 0 -20px;
- width: 545px;
- display: flex;
- justify-content: space-around;
- "
- >
- <li
- v-for="(item, index) in tltArray"
- :key="index"
- :class="stepIndex == index ? 'addClass' : ''"
- @click="next(index)"
- style="padding: 10px 0 10px 0; width: 50%; text-align: center"
- >
- {{ item.name }}
- </li>
- </ul>
- <!-- 第一步 -->
- <div v-if="stepIndex == 0" class="facility_boxOne">
- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 136px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span> 账号:
- </span>
- <el-input placeholder="请输入账号" v-model="FluoriteClouduser" clearable></el-input>
- </div>
- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 136px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span> 业务员名称:
- </span>
- <el-input
- placeholder="请输入账号所相关的业务员名称"
- v-model="salesman"
- clearable
- ></el-input>
- </div>
- <!-- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 136px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span> token:
- </span>
- <el-input placeholder="请输入token" v-model="tokenData" clearable></el-input>
- </div> -->
- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 136px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span> appkey:
- </span>
- <el-input placeholder="请输入秘钥" v-model="secretKey" clearable></el-input>
- </div>
- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 136px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span> appSecret:
- </span>
- <el-input placeholder="请输入appSecret" v-model="furtiveData" clearable></el-input>
- </div>
- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 100px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span> 设备厂家:
- </span>
- <el-radio v-model="radio" label="0" style="margin-top: 10px">海康</el-radio>
- <el-radio v-model="radio" label="1" style="margin-top: 10px">大华</el-radio>
- </div>
- <span style="margin: 0 0 0 310px" slot="footer" class="dialog-footer">
- <el-button @click="addEquipment = false">取 消</el-button>
- <el-button type="primary" @click="FluoriteClouduserAdd()">确 定</el-button>
- </span>
- </div>
- <!-- 第二步 -->
- <el-form
- label-width="150px"
- class="facility_boxTwo"
- ref="addDeviceRef"
- v-else-if="stepIndex == 1"
- :model="addDevice"
- :rules="addDeviceRules"
- >
- <el-form-item label="萤石云账号id" prop="FluoriteClouduserID">
- <el-select
- v-model="addDevice.FluoriteClouduserID"
- placeholder="请选择萤石云账号id"
- clearable
- >
- <el-option
- v-for="item in userNameID"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="设备id" prop="equipmentID">
- <el-input
- placeholder="请输入设备id"
- v-model="addDevice.equipmentID"
- clearable
- ></el-input>
- </el-form-item>
- <!-- <el-form-item label="国标id">
- <el-input placeholder="请输入国标id" v-model="addDevice.gb" clearable></el-input>
- </el-form-item> -->
- <el-form-item v-if="user_tag == 1" label="销售" prop="sale_uid">
- <el-select v-model="addDevice.sale_uid" placeholder="请选择销售" clearable>
- <el-option
- v-for="item in salesmanID"
- :key="item.uid"
- :label="item.username"
- :value="item.uid"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="user_tag == 1" label="任务单号" prop="task_num">
- <el-input
- placeholder="请输入任务单号"
- v-model="addDevice.task_num"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item label="sim卡号" prop="iccid">
- <el-input placeholder="请输入sim卡号" v-model="addDevice.iccid" clearable></el-input>
- </el-form-item>
- <el-form-item label="通道" prop="equipmentNumber">
- <el-select v-model="addDevice.equipmentNumber" placeholder="请选择设备通道号" clearable>
- <el-option
- v-for="item in equipmentChannel"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="回放" prop="playback">
- <el-switch
- v-model="addDevice.playback"
- active-color="#13ce66"
- inactive-color="#ff4949"
- active-text="支持回放功能"
- inactive-text="不支持回放功能"
- ></el-switch>
- </el-form-item>
- <el-form-item>
- <el-button @click="addEquipment = false">取 消</el-button>
- <el-button type="primary" @click="addConfirm()">确 定</el-button>
- </el-form-item>
- </el-form>
- <!-- <div class="facility_boxTwo"> -->
- <!-- <div style="display: flex; width: 80%; margin: 15px auto">
- <span
- style="
- width: 130px;
- text-align: right;
- line-height: 35px;
- margin: 0 15px 0 0;
- "
- >
- <span style="color: red">*</span> 萤石云账号id
- </span>
- <el-select
- style="width: 412px"
- v-model="FluoriteClouduserID"
- placeholder="请选择萤石云账号id"
- clearable
- >
- <el-option
- v-for="item in userNameID"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </div> -->
- <!-- <div style="display: flex; width: 80%; margin: 15px auto">
- <span
- style="
- width: 130px;
- text-align: right;
- line-height: 35px;
- margin: 0 15px 0 0;
- "
- >
- <span style="color: red">*</span> 设备id
- </span>
- <el-input placeholder="请输入设备id" v-model="equipmentID" clearable></el-input>
- </div> -->
- <!-- <div style="display: flex; width: 80%; margin: 15px auto">
- <span
- style="
- width: 130px;
- text-align: right;
- line-height: 35px;
- margin: 0 15px 0 0;
- "
- >
- <span style="color: red">*</span> 通道
- </span>
- <el-select
- style="width: 412px"
- v-model="equipmentNumber"
- placeholder="请选择设备通道号"
- clearable
- >
- <el-option
- v-for="item in equipmentChannel"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </div> -->
- <!-- <div style="display: flex; width: 91%; margin: 15px auto">
- <span
- style="
- width: 130px;
- text-align: right;
- line-height: 24px;
- margin: 0 15px 0 0;
- "
- >
- <span style="color: red">*</span> 回放
- </span>
- <el-switch
- style="display: block"
- v-model="playback"
- active-color="#13ce66"
- inactive-color="#ff4949"
- active-text="支持回放功能"
- inactive-text="不支持回放功能"
- ></el-switch>
- </div> -->
- <!-- <span style="margin: 0 0 0 310px" slot="footer" class="dialog-footer">
- <el-button @click="addEquipment = false">取 消</el-button>
- <el-button type="primary" @click="addConfirm()">确 定</el-button>
- </span>
- </div> -->
- </div>
- <!-- 测试 -->
- </el-dialog>
- <!-- 绑定SIM弹框 -->
- <el-dialog title="绑定SIM" :visible.sync="addEquipmentA" width="30%">
- <div v-loading="simloading">
- <!-- <div style="display: flex; width: 80%; margin: 15px auto">
- <span
- style="
- width: 75px;
- text-align: right;
- line-height: 35px;
- margin: 0 15px 0 0;
- "
- ><span style="color: red">*</span>搜索id
- </span>
- <el-select
- v-model="query"
- filterable
- remote
- placeholder="请输入关键词"
- :remote-method="simsearch"
- :loading="false"
- @change="simidchangae"
- style="width: 412px"
- >
- <el-option
- v-for="item in equipmentIDlist"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>-->
- <!-- <div style="display: flex; width: 80%; margin: 15px auto">
- <span
- style="
- width: 75px;
- text-align: right;
- line-height: 35px;
- margin: 0 15px 0 0;
- "
- >
- <span style="color: red">*</span>设备id
- </span>
- <el-select
- filterable
- style="width: 412px"
- v-model="equipmentID"
- placeholder="请选择设备id"
- @change="simidchangaeB"
- >
- <el-option
- v-for="item in equipmentOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>-->
- <!-- <el-select
- v-model="bangDsimId"
- filterable
- remote
- reserve-keyword
- placeholder="请输入关键词"
- :remote-method="remoteMethod"
- :loading="loading"
- style="width: 412px"
- @change="bangDsimIdselect"
- >
- <el-option
- v-for="item in bangDsimoptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </div> -->
- <div style="display: flex; width: 80%; margin: 15px auto">
- <span style="width: 75px; text-align: right; line-height: 35px; margin: 0 15px 0 0">
- <span style="color: red">*</span>ICCID
- </span>
- <el-input placeholder="请输入iccid" v-model="equipmentValue" clearable></el-input>
- </div>
- <div style="width: 50%; margin: 15px auto">
- <el-button type="primary" @click=";(addEquipment = false), addEquipmentBfirm()"
- >查 询</el-button
- >
- </div>
- <div style="width: 100%; display: flex; justify-content: flex-end">
- <div>
- <el-button @click=";(addEquipmentA = false), addCancel()">取 消</el-button>
- <el-button type="primary" @click=";(addEquipment = false), addConfirmSIM()"
- >确 定</el-button
- >
- </div>
- </div>
- </div>
- </el-dialog>
- <!-- 查询SIM卡弹框 -->
- <!-- <el-dialog
- title="查询SIM"
- :visible.sync="addEquipmentB"
- width="30%"
- >
- <div style="display: flex; width: 80%; margin: 15px auto" >
- <span
- style="
- width: 75px;
- text-align: right;
- line-height: 35px;
- margin: 0 15px 0 0;
- "
- ><span style="color: red">*</span> ICCID</span
- >
- <el-input placeholder="请输入iccid" v-model="equipmentICCID" clearable>
- </el-input>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="(addEquipmentB = false), addEquipmentBCancel()"
- >取 消</el-button
- >
- <el-button
- type="primary"
- @click="(addEquipment = false), addEquipmentBfirm()"
- >确 定</el-button
- >
- </span>
- </el-dialog>-->
- <!-- SIM卡数据-->
- <el-dialog title="SIM卡" :visible.sync="simCodeVisible" width="30%">
- <div class="simCodeBox">
- <div>
- <span class="simCodeTitle">ICCID:</span>
- <div>{{ sim.iccid }}</div>
- </div>
- <div>
- <span class="simCodeTitle">厂家:</span>
- <div>{{ sim.company }}</div>
- </div>
- <div>
- <span class="simCodeTitle">状态:</span>
- <div>{{ sim.status }}</div>
- </div>
- <div>
- <span class="simCodeTitle">套餐:</span>
- <span>{{ sim.total }}MB</span>
- </div>
- <div>
- <span class="simCodeTitle">已用流量:</span>
- <span>{{ sim.used }}MB</span>
- </div>
- <div>
- <span class="simCodeTitle">到期时间:</span>
- <!-- <div>{{ (sim.expiry_date * 1000) | formatTime }}</div> -->
- <div>{{ sim.expire }}</div>
- </div>
- <div class="operateBtn">
- <el-button size="mini" @click="simCodeVisible = false">关闭</el-button>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import videojs from 'video.js'
- import 'video.js/dist/video-js.css'
- import ymPlayer from '../comp/videoPlayer.vue'
- import HlsPlayer from '@ezuikit/player-hls'
- export default {
- comments: {
- ymPlayer
- },
- data() {
- return {
- user_tag: localStorage.getItem('user_tag'), // 用户类型
- videoType: 'sd', // hd高清 sd标清
- isShowType: true, // 视频类型是否显示
- currPage: 1, // 当前分页
- totalPage: 0, // 总分页
- id: '', // 右侧菜单选中的设备ID
- activeIndex: 0, // 控制设备列表选中状态
- jktype: '', // 为1有回放,否则无回放
- divNum: 1, // 默认分屏数量
- hlsHdSrc: '',
- rtmpHdSrc: '',
- takePhotoDialogVisible: false, // 拍照弹框
- Idlist: [], // 右侧设备列表
- divMainHeight: '', // 视频盒子高度
- selected: 1, // 默认选中第一个视频窗口
- playType: 0, // 0:直播 ; 1:插件
- html: '', // 插件播放内容
- picUrl: '', // 视频拍照地址
- playBackDialogVisible: false,
- mapTojkId: this.$route.query.id, // 四情基地监控设备id
- mapTojktype: this.$route.query.jktype, // 四情基地监控设备jktype
- newVideo: false,
- myVideo: {},
- backForm: {
- time: '',
- start: '',
- end: '',
- aisle: 1
- },
- backFormRules: {
- time: [{ required: true, message: '请选择时间范围', trigger: 'change' }],
- aisle: [{ required: true, message: '请选择通道', trigger: 'change' }]
- },
- accessToken: '',
- addEquipment: false, // 测试添加设备
- equipmentID: '', // 添加设备ID
- equipmentIDlist: [], // 搜索Id集合
- equipmentOptions: [
- // 设备id集合
- ],
- equipmentChannel: [
- {
- value: '0',
- label: '0'
- },
- {
- value: 1,
- label: 1
- },
- {
- value: 2,
- label: 2
- },
- {
- value: 3,
- label: 3
- },
- {
- value: 4,
- label: 4
- },
- {
- value: 5,
- label: 5
- },
- {
- value: 6,
- label: 6
- },
- {
- value: 7,
- label: 7
- },
- {
- value: 8,
- label: 8
- },
- {
- value: 9,
- label: 9
- },
- {
- value: 10,
- label: 10
- },
- {
- value: 11,
- label: 11
- },
- {
- value: 12,
- label: 12
- },
- {
- value: 13,
- label: 13
- },
- {
- value: 14,
- label: 14
- },
- {
- value: 15,
- label: 15
- },
- {
- value: 16,
- label: 16
- },
- {
- value: 17,
- label: 17
- },
- {
- value: 18,
- label: 18
- },
- {
- value: 19,
- label: 19
- },
- {
- value: 20,
- label: 20
- },
- {
- value: 21,
- label: 21
- },
- {
- value: 22,
- label: 22
- },
- {
- value: 23,
- label: 23
- },
- {
- value: 24,
- label: 24
- },
- {
- value: 25,
- label: 25
- },
- {
- value: 26,
- label: 26
- },
- {
- value: 27,
- label: 27
- },
- {
- value: 28,
- label: 28
- },
- {
- value: 29,
- label: 29
- },
- {
- value: 30,
- label: 30
- },
- {
- value: 31,
- label: 31
- }
- ],
- equipmentNumber: '', // 设备通道
- playback: false, // 是否添加回放功能
- // 搜索
- restaurants: [],
- state: '',
- timeout: null,
- idName: '',
- addEquipmentA: false, // 绑定SIM卡弹框
- addEquipmentB: false, // 查询SIM卡弹框
- equipmentICCID: '', // 查询SIM input
- // sim卡
- sim: {
- iccid: '',
- account_status: 0, // 卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
- data_plan: 0, // 套餐大小
- data_usage: 0, // 当月用量
- data_balance: 0, // 剩余流量
- expiry_date: 0 // 到期日期
- },
- simCodeVisible: false,
- input3: '',
- value3: [],
- code: 0, // 设备型号,
- query: [],
- simloading: false,
- equipmentValue: '', // iccid
- // 添加设备
- FluoriteClouduser: '', // 萤石云账号
- salesman: '', // 萤石云账号所相关的业务员名称
- tokenData: '', // token
- secretKey: '', // appkey
- furtiveData: '', // appSecret
- addDevice: {
- FluoriteClouduserID: '', // 萤石云账号ID
- equipmentID: '', // 设备ID
- equipmentNumber: '', // 设备通道
- sale_uid: '', // 业务员ID
- task_num: '', // 任务ID
- playback: false, // 是否添加回放功能
- iccid: '', // sim卡
- gb: '' // 国标ID
- },
- salesmanID: [], // 业务员ID集合
- addDeviceRules: {
- FluoriteClouduserID: [{ required: true, message: '请选择萤石云账号id', trigger: 'change' }],
- equipmentID: [{ required: true, message: '请输入设备id', trigger: 'blur' }],
- equipmentNumber: [{ required: true, message: '请选择设备通道号', trigger: 'change' }]
- },
- // FluoriteClouduserID: '', // 萤石云账号ID
- stepIndex: 0, // 步骤下标
- tltArray: [
- {
- name: '添加账号'
- },
- {
- name: '添加监控设备'
- }
- ],
- userNameID: [
- // {
- // value: 1,
- // label: 1,
- // },
- ],
- bangDsimoptions: [], // 绑定sim设备id集合
- bangDsimId: null, // 当前设备ID
- VideoList: [], // 视频直播列表
- longtimetf: false,
- monthitortime: null,
- radio: '0',
- optActive: '',
- stopTimer: 0
- }
- },
- filters: {
- formatName: function (value) {
- // 设备名字
- // if (!value) return "";
- // if (value.equip_name) {
- // if (value.equip_name.length > 5) {
- // return value.equip_name.slice(0, 5) + "...";
- // }
- // return value.equip_name;
- // } else {
- // if (value.device_id.length > 5) {
- // return value.device_id.slice(0, 5) + "...";
- // }
- // return value.device_id;
- // }
- // -----------------------------------------------------------
- let name = ''
- if (!value.device_name) {
- name = '暂无名称'
- } else if (value.device_name.length > 7) {
- name = value.device_name.slice(0, 7) + '...'
- } else {
- name = value.device_name
- }
- return name
- }
- },
- computed: {
- notifyStyle() {
- if (this.$store.state.homeNotify) {
- return {
- top: '72px'
- }
- } else {
- return {
- top: '60px'
- }
- }
- }
- },
- mounted() {
- if (this.$route.query.id !== undefined) {
- this.idName = this.$route.query.id
- }
- this.getJkList()
- this.$store.dispatch('getSaleUserList')
- // this.restaurants = this.loadAll(); // 搜索数据
- },
- created() {},
- beforeDestroy() {
- for (let item in this.myVideo) {
- if ('destroy' in this.myVideo[item]) {
- this.myVideo[item].destroy()
- }
- }
- },
- destroyed() {
- // this.player.dispose()
- // console.log(this.VideoList);
- // this.VideoList.forEach(item => {
- // if (item.hasOwnProperty('stop')) {
- // item.stop();
- // } else {
- // if(item) {
- // item.dispose();
- // }
- // }
- // })
- },
- methods: {
- reName(id, device_name) {
- var that = this
- let value = device_name
- this.$prompt('', '修改名字', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- inputValidator: function (value) {
- if (value.length > 16) {
- return '设备名称不能超过16个字符'
- }
- },
- inputPlaceholder: device_name
- })
- .then(({ value }) => {
- if (value) {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
- data: this.qs.stringify({
- device_id: id,
- device_name: value
- })
- }).then((res) => {
- if (res.data.message == '') {
- this.getJkList()
- this.$message({
- type: 'success',
- message: '修改成功'
- })
- }
- })
- } else {
- this.$message({
- type: 'info',
- message: '内容不能为空'
- })
- }
- })
- .catch(() => {
- this.$message({
- type: 'info',
- message: '取消输入'
- })
- })
- },
- /**
- * 更改视频清晰度
- *
- * @param type 视频清晰度 hd高清, sd标清
- * @returns 无返回值
- */
- changeVideoType(type) {
- let newUrl = ''
- if (type === 'hd') {
- let newUrlList = this.myVideo[`myPlayer${this.selected}`].url.split('live')
- newUrl = `${newUrlList[0]}hd.live`
- } else if (type === 'sd') {
- let newUrlList = this.myVideo[`myPlayer${this.selected}`].url.split('hd')
- newUrl = `${newUrlList[0]}live`
- }
- console.log(newUrl)
- this.myVideo[`myPlayer${this.selected}`].changePlayUrl({
- url: newUrl
- })
- },
- viewPhoto(id, gbId) {
- this.$router.push('/index/photoViewDgp/' + this.Idlist[this.activeIndex].device_id)
- },
- // 获取视频列表
- getJkList() {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.list_camera',
- data: this.qs.stringify({
- page: this.currPage,
- page_size: 8,
- device_id: this.idName,
- device_type_id: 44 // 多光谱设备
- })
- }).then((res) => {
- if (res.data.message == '') {
- this.Idlist = res.data.data.data
- this.accessToken = res.data.data.accessToken
- this.totalPage = res.data.data.counts
- if (this.mapTojkId && this.mapTojktype) {
- // 基地展示跳转过来
- this.selectEquip(this.mapTojkId, this.mapTojktype, 99999)
- } else {
- this.selectEquip(this.Idlist[0].device_id, this.Idlist[0].jktype, 0)
- }
- }
- // console.log(this.Idlist);
- for (var i = 0; i < this.Idlist.length; i++) {
- var obj = {
- value: i,
- label: this.Idlist[i].device_id
- }
- this.equipmentOptions.push(obj)
- }
- this.restaurants = this.loadAll() // 搜索数据
- })
- },
- // 视频分页
- splitPage(str) {
- if (str == 'jian') {
- if (this.currPage > 1) {
- this.currPage--
- this.getJkList()
- }
- } else {
- if (this.currPage < this.totalPage) {
- this.currPage++
- this.getJkList()
- }
- }
- },
- handleCurrentChange(page) {
- this.currPage = page
- this.getJkList()
- },
- // 关闭方向
- stopConfigCamera() {
- if (this.stopTimer) clearTimeout(this.stopTimer)
- this.stopTimer = setTimeout(() => {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.mulit_stop_move',
- data: this.qs.stringify({
- device_id: this.id
- })
- })
- }, 3000)
- },
- // 上下左右
- configCamera(ctrl, movenum, action) {
- this.optActive = action
- if (ctrl == 'takephoto') {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.multi_camera_takephoto',
- data: this.qs.stringify({
- device_id: this.id
- })
- }).then((res) => {
- let data = JSON.parse(res.data.data)
- if (data.code == 200) {
- this.picUrl = data.data.picUrl
- this.takePhotoDialogVisible = true
- } else {
- this.$message.error(data.msg)
- }
- })
- } else {
- // 上下左右、放大、缩小
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.multi_ctrl_camera',
- data: this.qs.stringify({
- device_id: this.id,
- ctrl: movenum
- })
- }).then((res) => {
- // if (res.data.message == '') {
- // this.$message.success('指令下发成功')
- // // this.stopConfigCamera() //关闭方向
- // }
- })
- }
- },
- // 拍照
- photograph() {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.multi_camera_takephoto',
- data: this.qs.stringify({
- device_id: this.id
- })
- })
- .then((res) => {
- if (res.data.data == 'true') {
- this.picUrl = res.data.data.addr
- // this.takePhotoDialogVisible = true;
- this.$message({
- message: '拍照成功',
- type: 'success'
- })
- } else {
- this.$message({
- message: '拍照失败',
- type: 'warning',
- duration: 1500
- })
- }
- })
- .catch((err) => {
- // console.log(err);
- })
- },
- // 选中右侧菜单设备
- selectEquip(device_id, jktype, index, isStop, num) {
- this.jktype = jktype
- this.activeIndex = index // 菜单选中状态
- this.id = device_id // 保存选中的设备id
- this.$axios({
- url: '/api/api_gateway?method=camera.camera_manage.multi_addr_camera',
- method: 'POST',
- data: this.qs.stringify({ device_id: device_id })
- }).then((res) => {
- if (res.data.message == '') {
- var data = res.data.data
- console.log(data, 'data')
- let rtmpHdSrc = data.rtmp
- if (this.playType == 1) {
- // 插件
- this.html = `<div id="player" autoplay muted poster='' controls playsInline webkit-playsinline src="${rtmpHdSrc}" style="width:100%; height:100%;"></div>`
- setTimeout(() => {
- this.myVideo['xPlayer'] = new EZUIKit.EZUIKitPlayer({
- id: 'player',
- url: rtmpHdSrc
- })
- // this.myVideo['xPlayer'].play();
- }, 1000)
- } else if (this.playType == 0) {
- // 固定走非插件
- if (data.type_id == -1) {
- // 分屏的时候不销毁
- if (isStop != true) {
- if (this.myVideo[`myPlayer${this.selected}`] && this.newVideo) {
- if ('dispose' in this.myVideo[`myPlayer${this.selected}`]) {
- this.myVideo[`myPlayer${this.selected}`].dispose()
- }
- if ('stop' in this.myVideo[`myPlayer${this.selected}`]) {
- this.myVideo[`myPlayer${this.selected}`].stop()
- }
- }
- }
- this.myVideo[`myPlayer${this.selected}`] = null
- document.getElementById('my-video' + this.selected).innerHTML = ''
- let playHtml = `<video id="myPlayer${this.selected}" muted autoplay poster='' controls playsInline webkit-playsinline src="${hlsHdSrc}" style="width:100%; height:100%;"></video>`
- document.getElementById('my-video' + this.selected).innerHTML = playHtml
- // 非插件
- this.$nextTick(() => {
- console.log(rtmpHdSrc, '---rtmpHdSrc')
- this.myVideo[`myPlayer${this.selected}`] = videojs(
- `myPlayer${this.selected}`,
- {
- controls: false,
- autoplay: false,
- sources: [
- {
- type: 'application/x-mpegURL',
- src: rtmpHdSrc
- }
- ]
- },
- () => {
- this.myVideo[`myPlayer${this.selected}`].play()
- this.VideoList.push(this.myVideo[`myPlayer${this.selected}`])
- }
- )
- })
- } else {
- if (isStop != true) {
- if (this.myVideo[`myPlayer${this.selected}`] && this.newVideo) {
- if ('dispose' in this.myVideo[`myPlayer${this.selected}`]) {
- this.myVideo[`myPlayer${this.selected}`].dispose()
- }
- if ('stop' in this.myVideo[`myPlayer${this.selected}`]) {
- this.myVideo[`myPlayer${this.selected}`].stop()
- }
- }
- }
- let playHtml = `<div id="myPlayer${this.selected}" muted autoplay poster='' controls playsInline webkit-playsinline src="${rtmpHdSrc}" style="width:100%; height:100%;"></div>`
- document.getElementById('my-video' + this.selected).innerHTML = playHtml
- // 非插件
- // this.$nextTick(() => {
- // console.log(data, '走到播放了')
- // this.myVideo[`myPlayer${this.selected}`] = new EZUIKit.EZUIKitPlayer({
- // id: `myPlayer${this.selected}`,
- // url: data.rtmp,
- // accessToken: this.accessToken,
- // handleError: (err) => {
- // console.log('监控播放失败了!!!', err)
- // this.myVideo[`myPlayer${this.selected}`].play()
- // }
- // })
- // this.VideoList.push(this.myVideo[`myPlayer${this.selected}`])
- // })
- this.$nextTick(() => {
- const container = this.$refs.videoContainerRef
- console.log('视频宽度,高度::', container.clientWidth, container.clientHeight)
- this.myVideo[`myPlayer${this.selected}`] = new HlsPlayer({
- id: `myPlayer${this.selected}`, // 目标 dom 容器节点的 id
- url: data.rtmp, // hls 取流地址
- staticPath: '/static/hls/', // decoder静态资源文件夹 默认根目录
- width: container.clientWidth, // 播放器宽度
- height: container.clientHeight
- })
- })
- // this.$nextTick(() => {
- // console.log(rtmpHdSrc, '---rtmpHdSrc')
- // this.myVideo[`myPlayer${this.selected}`] = videojs(
- // `myPlayer${this.selected}`,
- // {
- // controls: false,
- // autoplay: false,
- // sources: [
- // {
- // type: 'application/x-mpegURL',
- // src: rtmpHdSrc
- // }
- // ]
- // },
- // () => {
- // this.myVideo[`myPlayer${this.selected}`].play()
- // this.VideoList.push(this.myVideo[`myPlayer${this.selected}`])
- // }
- // )
- // })
- }
- }
- this.newVideo = true
- this.guanbilong()
- } else {
- this.$message.error(res.data.message)
- }
- })
- },
- // 点击分屏
- splitView(num) {
- for (let item in this.myVideo) {
- if ('stop' in this.myVideo[item]) {
- this.myVideo[item].stop()
- } else if ('dispose' in this.myVideo[item]) {
- this.myVideo[item].dispose()
- }
- }
- this.divNum = num
- this.selected = 1
- this.selectEquip(this.id, this.jktype, this.activeIndex, true, num)
- },
- // 点击视频
- selectVideo(i) {
- // console.log(i);
- this.selected = i
- },
- // 播放模式切换,插件/视频直播
- checkPlayType(i) {
- this.playType = i
- for (let item in this.myVideo) {
- this.myVideo[item].stop()
- }
- // console.log(this.myVideo);
- this.selectEquip(this.id, this.jktype, this.activeIndex)
- },
- // 复制拍照地址
- copyPicUrl() {
- document.getElementById('picUrl').select()
- this.$message({
- showClose: true,
- message: '手动复制,在浏览器打开,另存为'
- })
- },
- // 添加设备
- addConfirm() {
- this.$refs.addDeviceRef.validate((valid) => {
- if (!valid) {
- return false
- }
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.multi_add_camera',
- data: this.qs.stringify({
- device_id: this.addDevice.equipmentID,
- camera_channel: this.addDevice.equipmentNumber,
- camera_playback: this.addDevice.playback == true ? 1 : 0,
- account_id: this.addDevice.FluoriteClouduserID,
- sale_uid: this.addDevice.sale_uid,
- task_num: this.addDevice.task_num,
- iccid: this.addDevice.iccid
- // gb: this.addDevice.gb
- })
- }).then((res) => {
- if (res.data.message == '') {
- // console.log(456);
- this.$message({
- message: '添加成功',
- type: 'success',
- duration: 1500
- })
- this.$refs.addDeviceRef.resetFields()
- // this.equipmentID = '';
- // this.equipmentNumber = '';
- // this.playback = false;
- this.addEquipment = false
- this.getJkList()
- } else {
- this.$message({
- message: res.data.message,
- type: 'warning',
- duration: 1500
- })
- }
- })
- })
- // console.log(this.equipmentNumber);
- // if (this.equipmentID == '') {
- // this.$message({
- // message: '设备ID不能为空',
- // type: 'warning',
- // duration: 1500,
- // });
- // } else if (this.equipmentNumber == '') {
- // this.$message({
- // message: '通道号不能为空',
- // type: 'warning',
- // duration: 1500,
- // });
- // } else if (this.FluoriteClouduserID == '') {
- // this.$message({
- // message: '萤石云账号ID不能为空',
- // type: 'warning',
- // duration: 1500,
- // });
- // } else if (this.equipmentID !== '' && this.equipmentNumber !== '') {
- // this.$axios({
- // method: 'POST',
- // url: '/api/api_gateway?method=camera.camera_manage.add_camera',
- // data: this.qs.stringify({
- // device_id: this.equipmentID,
- // camera_channel: this.equipmentNumber,
- // camera_playback: this.playback == true ? 1 : 0,
- // account_id: this.FluoriteClouduserID,
- // }),
- // }).then((res) => {
- // if (res.data.message == '') {
- // // console.log(456);
- // this.$message({
- // message: '添加成功',
- // type: 'success',
- // duration: 1500,
- // });
- // this.equipmentID = '';
- // this.equipmentNumber = '';
- // this.playback = false;
- // this.addEquipment = false;
- // this.getJkList();
- // }
- // });
- // }
- },
- // addEquip() {
- // this.$prompt("添加设备id", "提示", {
- // confirmButtonText: "确定",
- // cancelButtonText: "取消",
- // })
- // .then(({ value }) => {
- // this.$axios({
- // method: "POST",
- // url: "/api/api_gateway?method=camera.camera_manage.add_camera",
- // data: this.qs.stringify({ device_id: value }),
- // }).then((res) => {
- // if (res.data.message == "") {
- // //console.log(456);
- // this.getJkList();
- // }
- // });
- // })
- // .catch(() => {
- // this.$message({
- // type: "info",
- // message: "取消添加",
- // });
- // });
- // },
- addEquip() {
- this.addEquipment = true
- this.salesmanID = this.$store.state.saleUserList
- this.addDevice = {
- FluoriteClouduserID: '', // 萤石云账号ID
- equipmentID: '', // 设备ID
- equipmentNumber: '', // 设备通道
- sale_uid: '', // 业务员ID
- task_num: '', // 任务ID
- playback: false, // 是否添加回放功能
- iccid: '' // sim卡
- }
- // console.log(this.$store.state.saleUserList);
- },
- handleClose() {
- this.addEquipment = false
- },
- // 确定添加
- addConfirmSIM() {
- // console.log(this.bangDsimId);
- // console.log(this.bangDsimoptions);
- // if (this.bangDsimId == null) {
- // this.$message({
- // message: '设备ID不能为空',
- // type: 'warning',
- // duration: 1500,
- // });
- // } else
- if (this.equipmentValue == '') {
- this.$message({
- message: 'iccid不能为空',
- type: 'warning',
- duration: 1500
- })
- } else if (this.equipmentValue !== '') {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.add_camera_sim',
- data: this.qs.stringify({
- device_id: this.id, // 设备id
- iccid: this.equipmentValue
- })
- })
- .then((res) => {
- // console.log(res);
- if (res.data.data == true) {
- this.$message({
- type: 'success',
- message: 'sim卡绑定成功',
- duration: 1500
- })
- this.bangDsimId = ''
- this.equipmentValue = ''
- this.playback = false
- this.addEquipmentA = false
- } else {
- this.$message({
- type: 'error',
- message: res.data.message,
- duration: 1500
- })
- }
- })
- .catch((err) => {
- // console.log(err);
- this.$message({
- type: 'error',
- message: 'sim卡绑定失败',
- duration: 1500
- })
- })
- }
- // console.log(this.equipmentID + '设备ID');
- // console.log(this.equipmentValue + '设备通道');
- // console.log(this.playback + '是否支持回放功能');
- },
- // 取消添加
- addCancel() {
- this.equipmentID = ''
- this.equipmentValue = ''
- this.playback = false
- this.$message({
- type: 'info',
- message: '取消添加'
- })
- this.input3 = ''
- },
- // 测试添加设备
- // 回放
- playBackSubmit() {
- this.$refs.backFormRef.validate((valid) => {
- if (!valid) {
- return false
- }
- let start = new Date(this.backForm.time[0])
- let end = new Date(this.backForm.time[1])
- let beginVal = ''
- let endVal = ''
- function checked(num) {
- if (num < 10) {
- num = '0' + num
- }
- return num
- }
- beginVal =
- beginVal +
- start.getFullYear() +
- checked(start.getMonth() + 1) +
- checked(start.getDate()) +
- checked(start.getHours()) +
- checked(start.getMinutes()) +
- checked(start.getSeconds())
- endVal =
- endVal +
- end.getFullYear() +
- checked(end.getMonth() + 1) +
- checked(end.getDate()) +
- checked(end.getHours()) +
- checked(end.getMinutes()) +
- checked(end.getSeconds())
- if (!document.getElementById('playWind')) {
- document.getElementById('videoBack').innerHTML = '<div id="playWind"></div>'
- }
- let url = `ezopen://open.ys7.com/${this.id}/${this.backForm.aisle}.local.rec?begin=${beginVal}&end=${endVal}`
- this.playback = new EZUIKit.EZUIKitPlayer({
- id: 'playWind',
- autoplay: true,
- url: url,
- accessToken: this.accessToken,
- decoderPath: 'static/js/',
- width: 560,
- height: 460
- })
- })
- },
- palyBackClose() {
- this.$refs.backFormRef.resetFields()
- this.playback.stop()
- document.getElementById('videoBack').innerHTML = ''
- },
- // 搜索
- loadAll() {
- var list = this.Idlist
- var arr = []
- for (var i = 0; i < list.length; i++) {
- var obj = {}
- obj['value'] = list[i].device_id
- obj['name'] = list[i].device_name == '' ? '暂无设备名称' : list[i].device_name
- arr.push(obj)
- }
- return arr
- },
- querySearchAsync(queryString, cb) {
- var restaurants = this.restaurants
- var results = queryString
- ? restaurants.filter(this.createStateFilter(queryString))
- : restaurants
- clearTimeout(this.timeout)
- this.timeout = setTimeout(() => {
- cb(results)
- }, 3000 * Math.random())
- },
- createStateFilter(queryString) {
- return (state) => {
- return state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
- }
- },
- // 搜索事件
- handleSelect(item) {
- this.idName = item.value
- this.currPage = 1
- this.getJkList()
- },
- axiosList() {
- this.idName = this.state
- this.currPage = 1
- this.getJkList()
- },
- // 绑定SIM
- bindingSIM() {
- this.addEquipmentA = true
- this.equipmentValue = this.Idlist[this.activeIndex].sim
- },
- // sim卡id查询
- simsearch(query) {
- this.equipmentIDlist = []
- // console.log(query);
- if (query != '') {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.list_camera',
- data: this.qs.stringify({
- device_id: query,
- device_type_id: 44
- })
- }).then((res) => {
- // this.equipmentID = res.data.data.data
- var list = res.data.data.data
- // console.log(list);
- // this.equipmentValue = list[0].sim
- for (var i = 0; i < list.length; i++) {
- var obj = {
- label: list[i].device_id,
- value: i
- }
- this.equipmentIDlist.push(obj)
- }
- })
- }
- },
- simsearchB(simid) {
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.list_camera',
- data: this.qs.stringify({
- device_id: simid,
- device_type_id: 44
- })
- }).then((res) => {
- var list = res.data.data.data
- // console.log(list[0].sim);
- this.equipmentValue = list[0].sim
- })
- },
- simidchangae(value) {
- // 点击选择id
- // console.log(value);
- this.equipmentID = this.equipmentIDlist[value].label
- this.simsearchB(this.equipmentIDlist[value].label)
- },
- simidchangaeB(value) {
- // //console.log(this.equipmentOptions[value].label); //equipmentOptions
- // console.log(value, this.equipmentOptions);
- this.equipmentID = this.equipmentOptions[value].label
- this.simsearchB(this.equipmentOptions[value].label)
- },
- // 查询SIM
- inquireSIM() {
- this.addEquipmentB = true
- },
- // 确定
- addEquipmentBfirm() {
- if (this.equipmentValue == '') {
- this.$message({
- type: 'info',
- message: '请输入正确的iccid'
- })
- } else {
- var postData = this.qs.stringify({
- iccid: this.equipmentValue
- })
- this.simloading = true
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=forecast.send_control.sim_query_new',
- data: postData
- })
- .then((res) => {
- this.simloading = false
- // console.log(res.data);
- if (!res.data.data.code) {
- this.sim = res.data.data
- this.simCodeVisible = true
- } else {
- this.$message({
- type: 'info',
- message: res.data.data.msg
- })
- }
- // if (res.data.message == "") {
- // let data = eval("(" + res.data.data.data + ")");
- // // let cardInfo = data.data.card_list[0]
- // let cardInfo = data.data;
- // this.sim = cardInfo;
- // }
- })
- .catch((err) => {
- // console.log(err);
- })
- }
- },
- // 取消
- addEquipmentBCancel() {},
- // 添加设备-下一步
- next(index) {
- if (index == 1) {
- this.FluoriteClouduserUserID() // 请求获取萤石云账号ID接口
- }
- this.stepIndex = index
- },
- // 萤石云账号添加
- FluoriteClouduserAdd() {
- if (this.FluoriteClouduser == '') {
- this.$message({
- message: '账号不能为空,请填写!',
- type: 'warning',
- duration: 1500
- })
- } else if (this.salesman == '') {
- this.$message({
- message: '业务员不能为空,请填写!',
- type: 'warning',
- duration: 1500
- })
- } else if (this.secretKey == '') {
- this.$message({
- message: 'appkey不能为空,请填写!',
- type: 'warning',
- duration: 1500
- })
- } else if (this.furtiveData == '') {
- this.$message({
- message: 'appSecret不能为空,请填写!',
- type: 'warning',
- duration: 1500
- })
- } else {
- var postData = this.qs.stringify({
- account: this.FluoriteClouduser, // 萤石云账号
- salesman: this.salesman, // 萤石云账号所相关的业务员名称
- // app_token: this.tokenData, // 萤石云账号 token
- app_key: this.secretKey, // 萤石云账号 appkey
- app_secret: this.furtiveData, // 萤石云账号 appSecret
- account_type: this.radio
- })
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.multi_add_camera_account',
- data: postData
- })
- .then((res) => {
- // console.log(res);
- if (res.data.data == true) {
- this.$message({
- message: '添加萤石云账号成功!',
- type: 'success',
- duration: 1500
- })
- this.addEquipment = false
- } else {
- this.$message({
- message: '添加萤石云账号失败',
- type: 'warning',
- duration: 1500
- })
- }
- })
- .catch((err) => {
- // console.log(err);
- this.$message({
- message: '添加萤石云账号失败',
- type: 'warning',
- duration: 1500
- })
- })
- }
- },
- // 萤石云账号ID接口
- FluoriteClouduserUserID() {
- var postData = this.qs.stringify({
- account: '', // 按萤石云账号名字搜索
- salesman: '' // 按业务员名称搜索
- })
- this.$axios({
- method: 'POST',
- url: '/api/api_gateway?method=camera.camera_manage.see_camera_account',
- data: postData
- })
- .then((res) => {
- // console.log(res.data.data);
- if (res.data.data.length !== 0) {
- var data = res.data.data
- var arr = []
- for (var i = 0; i < data.length; i++) {
- var obj = {}
- obj['value'] = data[i].id
- obj['label'] = data[i].account
- arr.push(obj)
- }
- this.userNameID = arr
- }
- })
- .catch((err) => {
- // console.log(err);
- })
- },
- remoteMethod(e) {
- // sim卡绑定 设备id查询
- this.$axios({
- url: '/api/api_gateway?method=camera.camera_manage.list_camera',
- method: 'POST',
- data: this.qs.stringify({ device_id: e, device_type_id: 44 })
- }).then((res) => {
- // console.log(res.data.data.data);
- this.bangDsimoptions = []
- var datas = res.data.data.data
- for (var i = 0; i < datas.length; i++) {
- this.bangDsimoptions.push({
- value: i,
- label: datas[i].device_id,
- iccid: datas[i].sim
- })
- }
- })
- },
- bangDsimIdselect(e) {
- // SIM卡绑定 设备id切换
- this.equipmentValue = this.bangDsimoptions[e].iccid
- if (this.bangDsimoptions[e].iccid == '') {
- this.$message({
- message: '该设备尚未绑定sim卡!',
- type: 'warning'
- })
- }
- },
- guanbilong() {
- this.longtimetf = false
- if (this.monthitortime) {
- clearTimeout(this.monthitortime)
- }
- this.monthitortime = setTimeout(() => {
- this.longtimetf = true
- }, 1800000)
- },
- toplay() {
- let { device_id: id, type_id: type, token, gb: gbId } = this.Idlist[this.activeIndex]
- // 新国标协议兼容,25.7.24
- if (gbId) {
- id = gbId + '-1'
- }
- this.$router.push(
- `/index/${type == 0 ? 'playbackDgp' : 'playbackDgp'}?id=${id}&accessKey=${token}`
- )
- }
- },
- watch: {
- // 添加设备弹框
- addEquipment(val) {
- if (val == false) {
- // 第二步
- this.equipmentID = '' // 设备ID
- this.equipmentValue = '' // iccid
- this.playback = false // 回放
- this.equipmentNumber = '' // 通道号
- this.FluoriteClouduserID = '' // 萤石云账号ID
- // 第一步
- this.FluoriteClouduser = '' // 萤石云账号
- this.salesman = '' // 萤石云账号所相关的业务员名称
- this.tokenData = '' // token
- this.secretKey = '' // appKey
- this.furtiveData = '' // appSecret
- this.stepIndex = 0 // 步骤下标
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .facility_boxTwo {
- margin-top: 15px;
- width: 405px;
- }
- .monitor-container {
- position: relative;
- display: flex;
- flex-direction: column;
- height: 100%;
- position: relative;
- /deep/.el-breadcrumb {
- margin-bottom: 12px;
- }
- .el-select {
- width: 100%;
- }
- .monitor_hint {
- position: fixed;
- top: 105px;
- left: 200px;
- height: 30px;
- line-height: 30px;
- color: #eb6767;
- width: 89%;
- background-color: #fff;
- padding: 0 20px;
- display: flex;
- box-sizing: border-box;
- justify-content: space-between;
- z-index: 1999999;
- .monitor_hint_text {
- height: 25px;
- display: flex;
- img {
- width: 20px;
- height: 20px;
- margin-right: 10px;
- margin-top: 5px;
- }
- }
- .el-icon-close {
- line-height: 30px;
- }
- }
- .monitor-wrap {
- display: flex;
- justify-content: space-between;
- // background: #323a47;
- flex: 1;
- .video-box {
- position: relative;
- flex: 1;
- padding-right: 10px;
- .video-container {
- width: 100%;
- height: calc(100% - 16px);
- background: rgb(97, 93, 93);
- & > div {
- display: flex;
- flex-wrap: wrap;
- .videoItem {
- border: 1px solid #000;
- box-sizing: border-box;
- }
- .videoItem:hover {
- border-color: aquamarine;
- }
- .selected {
- border: 1px solid aquamarine;
- }
- .a1 {
- width: 100%;
- height: 100%;
- }
- .a4 {
- width: 50%;
- height: 50%;
- }
- .a9 {
- width: 33.3%;
- height: 33.3%;
- }
- }
- }
- .split-screen {
- display: flex;
- justify-content: space-between;
- padding: 15px 24px;
- align-items: center;
- width: calc(100% - 12px);
- background: rgba(0, 0, 0, 0.5);
- position: absolute;
- bottom: 17px;
- left: 1px;
- box-sizing: border-box;
- .sp {
- width: 17px;
- height: 17px;
- display: inline-block;
- margin-right: 10px;
- cursor: pointer;
- }
- .sp01 {
- background: url(../../../assets/images/forecasting/monitor/sp1.png);
- }
- .sp02 {
- background: url(../../../assets/images/forecasting/monitor/sp2.png);
- }
- .sp03 {
- background: url(../../../assets/images/forecasting/monitor/sp3.png);
- }
- .sp01:hover {
- background: url(../../../assets/images/forecasting/monitor/sp1-active.png);
- }
- .sp02:hover {
- background: url(../../../assets/images/forecasting/monitor/sp2-active.png);
- }
- .sp03:hover {
- background: url(../../../assets/images/forecasting/monitor/sp3-active.png);
- }
- }
- }
- .nav-box {
- .view-box {
- width: 364px;
- background: #fff;
- color: #333;
- font-size: 14px;
- padding: 16px;
- box-sizing: border-box;
- border-radius: 4px;
- height: 550px;
- // height: calc(100% - 16px);
- }
- .view-box:last-child {
- margin-top: 16px;
- height: calc(100% - 583px);
- overflow-y: hidden;
- padding: 10px 26px 26px 26px;
- }
- .search {
- padding: 8px;
- border-radius: 4px;
- margin-bottom: 8px;
- background: #f5f7fa;
- }
- .viewLists {
- // height: 50%;
- height: calc(100% - 94px);
- overflow: auto;
- padding: 0;
- li {
- display: flex;
- align-items: center;
- padding: 0 15px;
- cursor: pointer;
- overflow: hidden;
- height: 53px;
- background: #f5f7fa;
- border-radius: 4px;
- margin-bottom: 8px;
- .titleBox {
- display: inline-block;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- max-width: 210px;
- // height: 30px;
- // line-height: 30px;
- .device-id {
- color: #999;
- font-size: 12px;
- margin-left: 8px;
- }
- }
- .viewPhoto {
- color: #eba219;
- float: right;
- font-size: 18px;
- cursor: pointer;
- margin: 0 0 0 10px;
- }
- // .viewPhoto:hover {
- // text-decoration: underline;
- // }
- .more {
- margin-left: auto;
- display: none;
- }
- .status {
- font-size: 12px;
- border-radius: 4px;
- padding: 2px 8px;
- margin-right: 16px;
- }
- .onLine {
- color: rgba(20, 164, 120, 1);
- background: rgba(20, 164, 120, 0.1);
- }
- .outLine {
- color: rgba(255, 89, 81, 1);
- background: rgba(255, 89, 81, 0.15);
- }
- }
- li.active {
- background: linear-gradient(90deg, rgba(20, 164, 120, 0.08) 64%, #f5f7fa);
- .more {
- display: block;
- }
- }
- li:hover {
- background: linear-gradient(90deg, rgba(20, 164, 120, 0.08) 64%, #f5f7fa);
- }
- li:last-child {
- margin-bottom: 0;
- }
- }
- .splitPage {
- height: 3%;
- margin-top: 2%;
- text-align: center;
- color: #15bb88;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- .arrow {
- font-size: 20px;
- cursor: pointer;
- }
- }
- .camera-control {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .zoom-in,
- .zoom-out {
- display: inline-block;
- width: 40px;
- height: 40px;
- line-height: 40px;
- cursor: pointer;
- background: #f5f7fa;
- box-shadow: 6px 8px 14px 0 #00000014;
- border-radius: 4px;
- text-align: center;
- font-size: 22px;
- color: #666;
- font-weight: 600;
- }
- }
- .control-ring {
- position: relative;
- width: 180px;
- height: 180px;
- .div-opt {
- position: absolute;
- width: 42px;
- height: 42px;
- line-height: 42px;
- cursor: pointer;
- font-size: 24px;
- text-align: center;
- z-index: 100;
- color: #666;
- font-weight: 600;
- }
- .upCtr {
- top: 0px;
- left: 50%;
- margin-left: -21px;
- }
- .downCtr {
- bottom: 0px;
- left: 50%;
- margin-left: -21px;
- }
- .leftCtr {
- top: 50%;
- left: 0px;
- margin-top: -21px;
- }
- .rightCtr {
- top: 50%;
- right: 0px;
- margin-top: -21px;
- }
- }
- .outer-ring {
- position: absolute;
- width: 100%;
- height: 100%;
- border-radius: 50%;
- background: linear-gradient(132deg, #e7edf0 15.24%, #f9fbfc 85.9%);
- box-shadow: -9px -5px 18.6px 0 rgba(255, 255, 255, 0.97),
- 13px 19px 34.5px -18px rgba(0, 0, 0, 0.15);
- }
- .quarter-sector {
- position: absolute;
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- .inner-circle {
- position: absolute;
- width: 96px;
- height: 96px;
- background: white;
- border-radius: 50%;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06), inset 0 0 10px rgba(0, 0, 0, 0.03);
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .camera-icon {
- font-size: 33px;
- color: #666;
- }
- // .upCtr:hover ~ .outer-ring .quarter-sector {
- // background: conic-gradient(
- // from 0deg at center,
- // #cfdce6 0deg,
- // #dfe4e8 90deg,
- // transparent 0% 100%
- // );
- // transform: rotate(-45deg);
- // }
- // .downCtr:hover ~ .outer-ring .quarter-sector {
- // background: conic-gradient(
- // from 0deg at center,
- // #cfdce6 0deg,
- // #dfe4e8 90deg,
- // transparent 0% 100%
- // );
- // transform: rotate(135deg);
- // }
- // .leftCtr:hover ~ .outer-ring .quarter-sector {
- // background: conic-gradient(
- // from 0deg at center,
- // #cfdce6 0deg,
- // #dfe4e8 90deg,
- // transparent 0% 100%
- // );
- // transform: rotate(-135deg);
- // }
- // .rightCtr:hover ~ .outer-ring .quarter-sector {
- // background: conic-gradient(
- // from 0deg at center,
- // #cfdce6 0deg,
- // #dfe4e8 90deg,
- // transparent 0% 100%
- // );
- // transform: rotate(45deg);
- // }
- .opt-active-up {
- background: conic-gradient(
- from 0deg at center,
- #cfdce6 0deg,
- #dfe4e8 90deg,
- transparent 0% 100%
- );
- transform: rotate(-45deg);
- }
- .opt-active-down {
- background: conic-gradient(
- from 0deg at center,
- #cfdce6 0deg,
- #dfe4e8 90deg,
- transparent 0% 100%
- );
- transform: rotate(135deg);
- }
- .opt-active-left {
- background: conic-gradient(
- from 0deg at center,
- #cfdce6 0deg,
- #dfe4e8 90deg,
- transparent 0% 100%
- );
- transform: rotate(-135deg);
- }
- .opt-active-right {
- background: conic-gradient(
- from 0deg at center,
- #cfdce6 0deg,
- #dfe4e8 90deg,
- transparent 0% 100%
- );
- transform: rotate(45deg);
- }
- .direc {
- text-align: center;
- width: 100%;
- height: 100%;
- // margin: 5% 0 5% 0;
- position: relative;
- background: url(../../../assets/images/forecasting/monitor/direction-btn.png) no-repeat
- center;
- background-size: contain;
- & > div {
- position: absolute;
- width: 50px;
- height: 50px;
- cursor: pointer;
- }
- .upCtr {
- top: 10px;
- left: 50%;
- margin-left: -25px;
- }
- .downCtr {
- bottom: 10px;
- left: 50%;
- margin-left: -25px;
- }
- .leftCtr {
- top: 50%;
- left: 28px;
- margin-top: -25px;
- }
- .rightCtr {
- top: 50%;
- right: 28px;
- margin-top: -25px;
- }
- .cameraCtr {
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- margin: auto;
- }
- }
- .btnBox {
- margin-top: 16px;
- display: flex;
- justify-content: space-between;
- gap: 16px;
- .el-button {
- width: 50%;
- }
- }
- }
- }
- }
- // SIM
- .simCodeBox {
- > div {
- line-height: 40px;
- display: flex;
- align-content: center;
- .simCodeTitle {
- width: 100px;
- text-align: right;
- font-size: 14px;
- color: #333;
- }
- > div {
- flex: 1;
- .el-progress {
- margin-top: 17px;
- }
- }
- span {
- width: 85px;
- font-size: 12px;
- padding-left: 3px;
- color: #909090;
- }
- .el-input {
- width: 60%;
- }
- }
- .operateBtn {
- display: block;
- text-align: right;
- }
- }
- .siminput {
- position: relative;
- height: 36px;
- .simgather {
- position: absolute;
- top: 36px;
- width: 100%;
- height: 50px;
- background-color: #fff;
- z-index: 9999;
- }
- }
- .addClass {
- // background: rgb(122, 121, 121);
- background: #c1bfbf;
- color: #fff;
- }
- .custom-ffffff .el-pagination {
- text-align: right;
- margin-top: 16px;
- }
- .basicsbox_text {
- display: flex;
- // margin-top: 30px;
- position: absolute;
- top: -4px;
- // height: 44px;
- padding: 15px 10px;
- z-index: 1110;
- right: 24px;
- span {
- margin-right: 25px;
- font-size: 14px;
- line-height: 1;
- color: #909399;
- }
- }
- </style>
|