tky-manage.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <template>
  2. <div>
  3. <div class="app-container">
  4. <el-row :gutter="16">
  5. <el-col :sm="24" :md="24">
  6. <!-- <el-select v-model="query.deviceManageId" size="mini" placeholder="请选择设备" @change="deviceChange">
  7. <el-option
  8. v-for="item in griderErections"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value"
  12. />
  13. </el-select> -->
  14. <el-input v-model="query.deviceCode" disabled style="width:30%">
  15. <template slot="prepend">设备编号</template>
  16. </el-input>
  17. <!-- <el-tag type="success" style="margin-left: 6px;" size="mini">在线</el-tag> -->
  18. <!-- <el-input v-model="query.beamCode" disabled style="float:right;margin-right: 6px;width:30%">
  19. <template slot="prepend">梁片编号</template>
  20. </el-input> -->
  21. <el-select v-model="query.beamCode" style="float:right;margin-right: 6px;height:45px;width:30%" placeholder="请选择梁片编码" @change="change">
  22. <el-option
  23. v-for="item in beams"
  24. :key="item.name"
  25. :label="item.name"
  26. :value="item.value"
  27. />
  28. </el-select></el-col>
  29. <!-- <el-col :sm="6" :md="6">
  30. <span style="font-size: 18px;">视频监控</span>
  31. <a style="font-size: 18px;float:right" @click="clickAllVideos">更多视频</a>
  32. </el-col> -->
  33. </el-row>
  34. <el-row>
  35. <el-col :lg="24" :sm="24" :xs="24" :xl="24" :md="24" style="padding-right: 8px">
  36. <div class="boxall">
  37. <el-row>
  38. <el-col :lg="6" :sm="6" :xs="6" :xl="6" :md="6">
  39. <div class="boxCenter" style="cursor:pointer " @click="warningClick">
  40. <div class="box-warning"><i class="el-icon-warning" /><span style="margin-left:5px">报警信息</span></div>
  41. <div class="left-div"><span style="font-size: 25px;color: #0086ff;">{{ data.warningCount }}</span>次</div>
  42. <div class="left-foot">已解除报警{{ data.doneWarningCount }}次</div>
  43. </div>
  44. <div class="boxCenter">
  45. <div class="box-warning"><i class="el-icon-timer" /><span style="margin-left:5px">工作时长</span></div>
  46. <div class="left-div"><span style="font-size: 25px;color: #0086ff;">{{ data.timeCount }}</span>小时</div>
  47. <div class="left-foot">累计工作{{ data.allTimeCount }}小时</div>
  48. </div>
  49. <div class="boxCenter">
  50. <div class="box-warning"><i class="el-icon-refresh" /><span style="margin-left:5px">循环次数</span></div>
  51. <div class="left-div"><span style="font-size: 25px;color: #0086ff;">{{ data.allCycleCount }}</span>次</div>
  52. <div class="left-foot">累计循环{{ data.allCycleCount }}次</div>
  53. </div>
  54. </el-col>
  55. <el-col :lg="18" :sm="18" :xs="18" :xl="18" :md="18">
  56. <div class="titleup">
  57. <span>最近更新时间:</span><span style="color: #0086ff;font-weight: bold;">{{ noGuide.monitorTime | datetimeseconds }}</span>
  58. <div style="float:right">
  59. <el-button v-if="!playback.isAnimRunning && !playback.anim" type="primary" size="mini" @click="hitoryClick">开始回放</el-button>
  60. <el-button v-if="playback.anim" type="primary" size="mini" @click="stopPlayback">停止回放</el-button>
  61. <el-button v-if="!playback.isAnimRunning && playback.anim" type="primary" size="mini" @click="goon">继续</el-button>
  62. <el-button v-if="playback.isAnimRunning && playback.anim" type="danger" size="mini" @click="pause">暂停</el-button>
  63. <el-button v-if="playback.anim" type="primary" size="mini" @click="speedUp">加速</el-button>
  64. <el-button v-if="playback.anim" type="primary" size="mini" @click="speedDown">减速</el-button>
  65. <el-button type="primary" size="mini" @click="zoomIn">放大</el-button>
  66. <el-button type="primary" size="mini" @click="zoomOut">缩小</el-button>
  67. </div>
  68. </div>
  69. <div ref="canvasdiv" style="background: #0AA4BC">
  70. <New2d v-if="modelVisible" ref="towD" @playbacking="playbacking" @returndata="returndata" />
  71. <Kiosk2dModel v-if="!modelVisible" />
  72. </div>
  73. </el-col>
  74. </el-row>
  75. <div class="boxfoot" />
  76. </div>
  77. </el-col>
  78. <!-- <el-col :xs="6" :sm="6" :md="6">
  79. <div class="boxall">
  80. <el-row :gutter="8" style="margin-top:6px">
  81. <el-col v-for="(item,index) in videos" :key="item.name" :sm="12" :md="12">
  82. <video
  83. :id="'video' + index"
  84. controls
  85. autoplay
  86. muted
  87. style="height:210px;width:100%;background:#000"
  88. />
  89. </el-col>
  90. </el-row>
  91. <div class="boxfoot" />
  92. </div>
  93. </el-col> -->
  94. </el-row>
  95. <el-row>
  96. <el-col :lg="24" :sm="24" :xs="24" :xl="24" :md="24">
  97. <div class="boxall">
  98. <el-row :gutter="16">
  99. <el-col :lg="16" :sm="16" :xs="16" :xl="16" :md="16">
  100. <el-row>
  101. <el-col :lg="24" :sm="24" :xs="24" :xl="24" :md="24">
  102. <box icon="el-icon-help" title="限位状态" class="boxColor">
  103. <div>
  104. <LimitState ref="limitState" />
  105. </div>
  106. </box>
  107. </el-col>
  108. </el-row>
  109. <el-row :gutter="16">
  110. <el-col :lg="12" :sm="12" :xs="12" :xl="12" :md="12">
  111. <box icon="el-icon-help" title="基本信息" class="boxInfo">
  112. <div>
  113. <THAInfo ref="thaInfo" />
  114. </div>
  115. </box>
  116. </el-col>
  117. <el-col :lg="12" :sm="12" :xs="12" :xl="12" :md="12">
  118. <box icon="el-icon-help" title="主梁和支座" class="boxInfo">
  119. <div>
  120. <BeamSupport ref="beamSupport" />
  121. </div>
  122. </box>
  123. </el-col>
  124. </el-row>
  125. </el-col>
  126. <el-col :lg="8" :sm="8" :xs="8" :xl="8" :md="8">
  127. <box icon="el-icon-help" title="起吊系统" class="boxColor">
  128. <div>
  129. <TacklingSys ref="tacklingSys" />
  130. </div>
  131. </box>
  132. </el-col>
  133. </el-row>
  134. <div class="boxfoot" />
  135. </div>
  136. </el-col>
  137. </el-row>
  138. </div>
  139. <el-dialog title="预警详情" :close-on-click-modal="false" :visible.sync="proDucitonVisible" class="roll-dialog" top="20vh" width="50%">
  140. <el-table v-loading="listLoading" row-key="id" :data="warnings" border stripe fit highlight-current-row height="400px">
  141. <el-table-column label="序号" type="index" align="center" />
  142. <el-table-column label="报警时间" prop="warningDate" align="center">
  143. <template slot-scope="{row}">
  144. {{ row.warningDate |datetimeseconds }}
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="报警记录" prop="warningRecord" align="center" />
  148. <el-table-column label="解除报警时间" align="center">
  149. <template slot-scope="{row}">
  150. {{ row.relieveDate |datetimeseconds }}
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="是否解除" align="center">
  154. <template slot-scope="{row}">
  155. <el-tag size="mini" :type="row.isAlarm?'success':'danger'">{{ row.isAlarm?"已解除":"未解除" }}</el-tag>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. <div slot="footer" class="dialog-footer">
  160. <el-button @click="proDucitonVisible = false">取消</el-button>
  161. </div>
  162. </el-dialog>
  163. </div>
  164. </template>
  165. <script>
  166. import Box from '@/components/Box/Box'
  167. import waves from '@/directive/waves' // waves directive
  168. import THAInfo from '@/views/bridge/device-manage/components//THAInfo'
  169. import New2d from '@/views/grider-erections/gride-work-info/components//new-2d.vue'
  170. import BeamSupport from '@/views/bridge/device-manage/components/beam-support.vue'
  171. import TacklingSys from '@/views/bridge/device-manage/components/tackling-sys.vue'
  172. import LimitState from '@/views/bridge/device-manage/components//limit-state.vue'
  173. import Kiosk2dModel from '@/views/grider-erections/gride-work-info/components/kiosk-2d-model.vue'
  174. import * as griderErectionApi from '@/api/grider-erection'
  175. // import JSWebrtc from '@/utils/webRtc'
  176. import _ from 'lodash'
  177. export default {
  178. directives: { waves },
  179. components: {
  180. Box, //, InnerSidebar, ProjectSectionDeviceTree
  181. New2d,
  182. THAInfo,
  183. BeamSupport,
  184. TacklingSys,
  185. LimitState,
  186. Kiosk2dModel
  187. },
  188. data() {
  189. return {
  190. query: {
  191. deviceCode: '',
  192. beamCode: ''
  193. },
  194. beams: [],
  195. listLoading: false,
  196. proDucitonVisible: false,
  197. modelVisible: true,
  198. data: {},
  199. noGuide: {},
  200. videos: [
  201. {
  202. name: '沪苏湖2标1#摄像头',
  203. webRtc: 'webrtc://120.78.220.33:1985/live/0002@HSH_Crane_V1'
  204. },
  205. {
  206. name: '沪苏湖2标2#摄像头',
  207. webRtc: 'webrtc://120.78.220.33:1985/live/0002@CJH_Crane_V2'
  208. },
  209. {
  210. name: '沪苏湖2标3#摄像头',
  211. webRtc: 'webrtc://120.78.220.33:1985/live/0002@CJH_Crane_V3'
  212. },
  213. {
  214. name: '沪苏湖2标4#摄像头',
  215. webRtc: 'webrtc://120.78.220.33:1985/live/0003@HSH_Crane_V5'
  216. }
  217. ],
  218. warnings: [],
  219. playback: { anim: null, isAnimRunning: false }
  220. }
  221. },
  222. created() {
  223. },
  224. async mounted() {
  225. this.loading = true
  226. // try {
  227. // await this.$store.dispatch('user/login', { username: 'test-grider', password: crypto.decryptAES('B0B10217A69BFEE4F3043E5769106053') })
  228. // this.loading = false
  229. // } catch (ex) {
  230. // console.log(ex)
  231. // }
  232. // try {
  233. // await this.$store.dispatch('user/login', { username: 'yjlview419', password: cryptosss.decryptAES('B00BB09C02A845CE99A9EE6DAF052DC7') })
  234. // this.loading = false
  235. // } catch (ex) {
  236. // console.log(ex)
  237. // }
  238. // this.$nextTick(() => {
  239. // _.forEach(this.videos, (i, index) => {
  240. // var id = 'video' + index
  241. // var video = document.getElementById(id)
  242. // new JSWebrtc.Player(i.webRtc, {
  243. // video: video,
  244. // autoplay: true,
  245. // onPlay: obj => {}
  246. // })
  247. // })
  248. // })
  249. },
  250. methods: {
  251. show(data) {
  252. this.query.deviceCode = data.deviceCode
  253. this.beams = data.beams
  254. if (this.beams.length > 0 && !this.query.beamCode) {
  255. this.query.beamCode = this.beams[0].value
  256. }
  257. this.data = data.data
  258. if (this.data.splitTypeNoGuideBeams.length > 0) {
  259. this.noGuide = this.data.splitTypeNoGuideBeams[0]
  260. this.returndata(this.data.splitTypeNoGuideBeams[0])
  261. }
  262. },
  263. hitoryClick() {
  264. this.$refs.towD.playBack(this.data.splitTypeNoGuideBeams)
  265. },
  266. playbacking(data) {
  267. this.playback = data
  268. },
  269. stopPlayback() {
  270. this.$refs.towD.stopPlayback()
  271. },
  272. pause() {
  273. this.$refs.towD.suspend()
  274. },
  275. goon() {
  276. this.$refs.towD.goon()
  277. },
  278. zoomIn() {
  279. this.$refs.towD.zoomIn()
  280. },
  281. zoomOut() {
  282. this.$refs.towD.zoomOut()
  283. },
  284. speedUp() {
  285. this.$refs.towD.speedUp()
  286. },
  287. speedDown() {
  288. this.$refs.towD.speedDown()
  289. },
  290. returndata(data) {
  291. this.noGuide = data
  292. this.$refs.limitState.show(data)
  293. this.$refs.thaInfo.show(data)
  294. this.$refs.beamSupport.show(data)
  295. this.$refs.tacklingSys.show(data)
  296. },
  297. warningClick() {
  298. this.proDucitonVisible = true
  299. this.listLoading = true
  300. griderErectionApi.getWarnings(this.query)
  301. .then(res => {
  302. this.warnings = res
  303. this.listLoading = false
  304. })
  305. },
  306. deviceChange(id) {
  307. var grider = _.find(this.griderErections, ['value', id])
  308. if (grider.type === 1) {
  309. this.modelVisible = true
  310. } else {
  311. this.modelVisible = false
  312. }
  313. },
  314. change() {
  315. this.$emit('node-click', this.query.beamCode)
  316. },
  317. clickAllVideos() {
  318. // var href = 'http://14.18.41.63:5000/portal/camera/dashboard'
  319. // window.open(href, '_blank')
  320. }
  321. }
  322. }
  323. </script>
  324. <style lang="scss" scoped>
  325. .content-height-fit {
  326. height: calc(100vh - 0px) !important;
  327. }
  328. // ::v-deep .el-table__body-wrapper {
  329. // &::-webkit-scrollbar { // 整个滚动条
  330. // width: 0; // 纵向滚动条的宽度
  331. // background: rgba(213,215,220,0.3);
  332. // border: none;
  333. // }
  334. // &::-webkit-scrollbar-track { // 滚动条轨道
  335. // border: none;
  336. // }
  337. // }
  338. ::v-deep .el-table th.gutter{
  339. display: none;
  340. width:0
  341. }
  342. ::v-deep .el-table colgroup col[name='gutter']{
  343. display: none;
  344. width: 0;
  345. }
  346. ::v-deep .el-table__body{
  347. width: 100% !important;
  348. }
  349. .boxall {
  350. margin-top: 8px;
  351. border: 2px solid #1b5677;
  352. padding: 0rem .3rem .3rem;
  353. position: relative;
  354. //margin-bottom: 1rem;
  355. height: 445px;
  356. }
  357. .boxCenter{
  358. border: 2px solid #0A3054;
  359. padding: 0rem .3rem .3rem;
  360. position: relative;
  361. width: 80%;
  362. margin: auto;
  363. //margin-bottom: 1rem;
  364. height: 120px;
  365. margin-top: 20px;
  366. }
  367. .box-warning{
  368. //color: #fff;
  369. margin-top: 10px;
  370. margin-left: 5px;
  371. }
  372. .left-div{
  373. //border-bottom: 1px solid;
  374. margin: 5px 25px;
  375. //color: #fff;
  376. }
  377. .left-foot{
  378. //border-bottom: 1px solid;
  379. margin-top: 0px;
  380. margin-left: 25px;
  381. //color: #fff;
  382. }
  383. .boxall:before,
  384. .boxall:after {
  385. position: absolute;
  386. width: 1rem;
  387. height: 1rem;
  388. content: "";
  389. //border-top: 3px solid #02a6b5;
  390. top: 0;
  391. }
  392. .boxall:before,
  393. .boxfoot:before {
  394. //border-left: 3px solid #02a6b5;
  395. left: 0;
  396. }
  397. .boxall:after,
  398. .boxfoot:after {
  399. //border-right: 3px solid #02a6b5;
  400. right: 0;
  401. }
  402. .boxfoot {
  403. position: absolute;
  404. bottom: 0;
  405. width: 100%;
  406. left: 0;
  407. }
  408. .boxfoot:before,
  409. .boxfoot:after {
  410. position: absolute;
  411. width: 1rem;
  412. height: 1rem;
  413. content: "";
  414. //border-bottom: 3px solid #02a6b5;
  415. bottom: 0;
  416. }
  417. .titleup{
  418. padding: 6px 0px;
  419. //color: white;
  420. }
  421. .boxColor{
  422. //background: #162B56;
  423. margin-bottom:0px;
  424. margin-top: 20px;
  425. }
  426. .boxInfo {
  427. //background: #162B56;
  428. margin-bottom: 0px;
  429. margin-top: 35px;
  430. }
  431. ::v-deep .card-header {
  432. background-color: transparent;
  433. border-bottom: 1px solid rgba(0,0,0,.125);
  434. padding: 0.25rem 1.25rem;
  435. position: relative;
  436. border-top-left-radius: .25rem;
  437. border-top-right-radius: .25rem;
  438. }
  439. ::v-deep .card-title {
  440. float: left;
  441. font-size: 1.1rem;
  442. font-weight: bold;
  443. //color: white;
  444. margin: 0;
  445. }
  446. ::v-deep .card-body {
  447. -ms-flex: 1 1 auto;
  448. -webkit-box-flex: 1;
  449. flex: 1 1 auto;
  450. min-height: 1px;
  451. padding: 0.25rem;
  452. }
  453. </style>