monitorList.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title></title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css">
  9. <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
  10. <link rel="stylesheet" href="../../css/aui.css">
  11. <link rel="stylesheet" href="../../css/projeck.css">
  12. <style>
  13. body,html{
  14. background: #fff;
  15. overflow: hidden;
  16. -webkit-box-sizing: border-box;
  17. -moz-box-sizing: border-box;
  18. box-sizing: border-box;
  19. position: relative;
  20. }
  21. .api_layout{
  22. height: 100%;
  23. overflow-y: scroll;
  24. -webkit-overflow-scrolling: touch;
  25. }
  26. .monitorList{
  27. padding: 14px 0;
  28. }
  29. .monitorList li{
  30. display: flex;
  31. display: -webkit-flex;
  32. justify-content: flex-start;
  33. -webkit-justify-content: flex-start;
  34. height: 56px;
  35. line-height: 56px;
  36. align-items: center;
  37. color: #5a5a5a;
  38. font-size: 14px;
  39. position: relative;
  40. }
  41. .monitorList li:after{
  42. content: '';
  43. display: table;
  44. position: absolute;
  45. width: 100%;
  46. height: 1px;
  47. background: #e8e9ea;
  48. bottom: 0;
  49. left: 0;
  50. }
  51. .monitorList li img{
  52. width: 42px;
  53. height: 42px;
  54. display: block;
  55. -webkit-border-radius: 50%;
  56. -moz-border-radius: 50%;
  57. border-radius: 50%;
  58. margin-right: 19px;
  59. }
  60. .right_side{
  61. position: absolute;
  62. top: 0;
  63. right: -100%;
  64. width: 100%;
  65. height: 100%;
  66. background: rgba(0,0,0,.6);
  67. transition: .5ms;
  68. }
  69. .list{
  70. position: absolute;
  71. top: 0;
  72. right: -75%;
  73. width: 75%;
  74. height: 100%;
  75. background: #fff;
  76. transition: .3s;
  77. }
  78. .titles{
  79. height: 38px;
  80. line-height: 38px;
  81. padding-left: 15px;
  82. font-size: 15px;
  83. color: #2c3e50;
  84. position: relative;
  85. }
  86. .titles:after{
  87. content: '';
  88. display: table;
  89. position: absolute;
  90. bottom: 0;
  91. left: 0;
  92. width: 100%;
  93. height: 1px;
  94. background: #009fe8;
  95. }
  96. .titles i{
  97. display: block;
  98. width: 19px;
  99. height: 19px;
  100. line-height: 19px;
  101. background: url("../../image/close.png") no-repeat;
  102. background-size: cover;
  103. text-align: center;
  104. -webkit-box-sizing: border-box;
  105. -moz-box-sizing: border-box;
  106. box-sizing: border-box;
  107. position: absolute;
  108. top: 8px;
  109. right: 10px;
  110. color: #ced3d6;
  111. font-size: 8px;
  112. }
  113. .api_lists{
  114. padding: 0 14px;
  115. height: 100%;
  116. overflow-y: scroll;
  117. padding-bottom: 38px;
  118. -webkit-overflow-scrolling: touch;
  119. }
  120. .aui-list-item-inner{
  121. width: 100%;
  122. display: flex;
  123. justify-content: flex-start;
  124. align-items: center;
  125. padding: 0 10px;
  126. font-size: 14px;
  127. color: #333;
  128. }
  129. .aui-collapse-header.aui-active{
  130. background: #fff;
  131. }
  132. .item-inner .aui-icon-home{
  133. font-size: 18px;
  134. margin-right: 30px;
  135. }
  136. .item-inner .aui-list-item-right{
  137. position: absolute;
  138. top: 16px;
  139. right: 10px;
  140. }
  141. .list-item .aui-icon-video{
  142. font-size: 18px;
  143. margin-right: 30px;
  144. }
  145. .api_lists li{
  146. display: flex;
  147. display: -webkit-flex;
  148. justify-content: flex-start;
  149. -webkit-justify-content: flex-start;
  150. height: 90px;
  151. align-items: center;
  152. position: relative;
  153. }
  154. .info p{
  155. font-size: 15px;
  156. }
  157. .api_lists li:after{
  158. content: '';
  159. display: table;
  160. position: absolute;
  161. bottom: 0;
  162. left: 0;
  163. width: 100%;
  164. height: 1px;
  165. background: #e8e9ea;
  166. }
  167. .api_lists li p{
  168. color: #2c3e50;
  169. font-size: 13px;
  170. }
  171. .monitorImg{
  172. width: 75px;
  173. height: 56px;
  174. display: block;
  175. margin-right: 20px;
  176. }
  177. .SeeBtn{
  178. height: 24px;
  179. line-height: 24px;
  180. width: 71px;
  181. text-align: center;
  182. color: #fff;
  183. background: #009fe8;
  184. font-size: 10px;
  185. -webkit-border-radius: 50px;
  186. -moz-border-radius: 50px;
  187. border-radius: 50px;
  188. margin-top: 15px;
  189. }
  190. .api_lists #contetnNo{
  191. text-align: center;
  192. font-size: 14px;
  193. color: #bdc3c7;
  194. height: 50px;
  195. margin-top:20px;
  196. /*justify-content: center;
  197. -webkit-justify-content: center;*/
  198. display: none;
  199. }
  200. .api_lists #contetnNo:after{
  201. content: '';
  202. display: table;
  203. position: absolute;
  204. bottom: 0;
  205. left: 0;
  206. width: 100%;
  207. height: 0;
  208. background: #e8e9ea;
  209. }
  210. #noJurisdiction{
  211. background: url('../../image/no.png') no-repeat;
  212. background-size: contain;
  213. position: absolute;
  214. top: -50%;
  215. left: 0;
  216. bottom: 0;
  217. right: 0;
  218. margin: auto;
  219. width: 125px;
  220. height: 142px;
  221. display: none;
  222. }
  223. .ico-loading{
  224. position: absolute;
  225. top: 0;
  226. left: 0;
  227. bottom: 0;
  228. right: 0;
  229. margin: auto;
  230. width: 35px;
  231. height: 35px;
  232. background: url("../../icon/loading.gif") no-repeat;
  233. background-size: cover;
  234. background-position: center;
  235. display: none;
  236. }
  237. .loading{
  238. position: absolute;
  239. width: 100%;
  240. height: 100%;
  241. background: rgba(255,255,255,.3);
  242. top: 0;
  243. left: 0;
  244. }
  245. .aui-collapse-content li{
  246. padding-left: 40px;
  247. }
  248. .aui-list-item-right .aui-icon-down{
  249. position: absolute;
  250. top:0;
  251. right: 14px;
  252. }
  253. </style>
  254. </head>
  255. <body>
  256. <div class="api_layout aui-collapse">
  257. <ul class="monitorList" id="monitorList">
  258. </ul>
  259. <div id="noJurisdiction"> </div>
  260. </div>
  261. <!--侧滑 遮罩层-->
  262. <div class="right_side" onclick="recoveryFun()"></div>
  263. <!--视频列表-->
  264. <div class="list">
  265. <p class="titles">
  266. <span></span>
  267. <i onclick="recoveryFun()"></i>
  268. </p>
  269. <ul class="api_lists">
  270. <div id="api_lists"></div>
  271. <li id="contetnNo">-暂无内容-</li>
  272. </ul>
  273. <div class="loading">
  274. <i class="ico-loading"></i>
  275. </div>
  276. </div>
  277. <script type="text/template" id="template">
  278. {{~it:value}}
  279. <div class="aui-collapse-item">
  280. <li class="aui-list-item aui-collapse-header">
  281. <div class="aui-list-item-inner">
  282. <img src="../../icon/vhome.png" alt="">
  283. <div class="aui-list-item-title">{{=value.name}}</div>
  284. <div class="aui-list-item-right">
  285. <i class="aui-iconfont aui-icon-down aui-collapse-arrow"></i>
  286. </div>
  287. </div>
  288. </li>
  289. <div class="aui-collapse-content">
  290. {{ for (var j=0;j<value.colls.length;j++) { }}
  291. <li onclick="seeMonitorList('{{=value.colls[j].indexCode}}','{{=value.colls[j].name}}','')">
  292. <img src="../../icon/video.png" alt="">
  293. <span>{{=value.colls[j].name}}</span>
  294. </li>
  295. {{ } }}
  296. </div>
  297. </div>
  298. {{~}}
  299. </script>
  300. <script type="text/template" id="template01">
  301. {{~it:value}}
  302. <li>
  303. <img src="http://jiewei-icon.oss-cn-beijing.aliyuncs.com/default-img-150x112.png" alt="" class="monitorImg">
  304. <div class="info">
  305. <p>{{=value.cameraName}}</p>
  306. <button type="button" class="SeeBtn" onclick="SeeVideo('{{=value.cameraIndexCode}}','{{=value.cameraName}}','{{=value.regionIndexCode}}')">查看监控</button>
  307. </div>
  308. </li>
  309. {{~}}
  310. </script>
  311. <script type="text/template" id="templateType">
  312. {{~it:value}}
  313. {{?value.indexCode!='root000000'}}
  314. <li onclick="seeMonitorList('{{=value.indexCode}}','{{=value.name}}','')" style="padding-left:14px">
  315. <img src="../../icon/video.png" alt="">
  316. <span>{{=value.name}}</span>
  317. </li>
  318. {{?}}
  319. {{~}}
  320. </script>
  321. <script src="../../script/api.js"></script>
  322. <script src="../../script/doT.min.js"></script>
  323. <script src="../../script/aui-collapse.js"></script>
  324. <script src="../../script/config.js"></script>
  325. <script>
  326. var toast = new auiToast(),headers = "";
  327. apiready = function () {
  328. var info = $api.getStorage('data'),
  329. token = JSON.parse(info).data.access_token;
  330. headers = {
  331. "Authorization": "Bearer " + token
  332. };
  333. monitorListFun(headers)
  334. };
  335. function monitorListFun(header) {
  336. $http.fnReuestData(UrlRouter.selectRootRequest,header,'get','',function (ret, err) {
  337. if (ret.code === '0') {
  338. if(videoType === 2){
  339. var rows = [];
  340. for (var i = 0; i < ret.data.list.length; i++) {
  341. if (ret.data.list[i].parentIndexCode === 'root000000') {
  342. rows.push(ret.data.list[i])
  343. }
  344. }
  345. for (var j = 0; j < rows.length; j++) {
  346. rows[j]['colls'] = []
  347. }
  348. for (var i = 0; i < ret.data.list.length; i++) {
  349. for (var j = 0; j < rows.length; j++) {
  350. if (rows[j].indexCode === ret.data.list[i].parentIndexCode) {
  351. rows[j].colls.push(ret.data.list[i])
  352. }
  353. }
  354. }
  355. $apis.html(monitorList,'#template',rows);
  356. var collapse = new auiCollapse({
  357. autoHide:true //是否自动隐藏已经展开的容器
  358. });
  359. }else {
  360. $apis.html(monitorList,'#templateType',ret.data.list);
  361. }
  362. toast.hide()
  363. }
  364. })
  365. }
  366. function seeMonitorList(id,title,name) {
  367. $api.removeCls($api.dom('.loading'), 'hide');
  368. $api.html($api.dom('.titles>span'), title);
  369. var list = document.querySelector('.list'),right_side = document.querySelector('.right_side');
  370. list.style.right = '0';
  371. right_side.style.right = '0';
  372. var regionUuid ={
  373. indexCode:id,
  374. pageNum:1,
  375. pageSize:200
  376. };
  377. $http.fnReuestDataNologing(UrlRouter.selectResourceList,headers,'get',regionUuid,function (ret, err) {
  378. toast.hide();
  379. if (ret.code === '0') {
  380. if (ret.data.list.length>0) {
  381. $apis.html(api_lists,'#template01',ret.data.list);
  382. $api.addCls($api.dom('.loading'), 'hide');
  383. document.getElementById('contetnNo').style.display = 'none'
  384. }else {
  385. $apis.html(api_lists,'#template01','');
  386. $api.addCls($api.dom('.loading'), 'hide');
  387. document.getElementById('contetnNo').style.display = 'block'
  388. }
  389. }
  390. })
  391. }
  392. function recoveryFun() {
  393. var list = document.querySelector('.list'),right_side = document.querySelector('.right_side');
  394. list.style.right = '-75%';
  395. right_side.style.right = '-100%';
  396. }
  397. // 查看视频
  398. function SeeVideo(id,title,regionIndexCode1) {
  399. $http.fnReuestDataNologing(UrlRouter.selectResourcePreviewURLs,headers,'get',{cameraIndexCode:id,regionIndexCode:regionIndexCode1},function (ret, err) {
  400. if (ret.code === '0') {
  401. var pageParam = {
  402. videoUrl:ret.data.url,
  403. title:title
  404. }
  405. var video = api.require('modulehikvision');
  406. var param = {
  407. url:'rtsp://120.253.30.69'+ret.data.url.substring(ret.data.url.lastIndexOf(':'))
  408. }
  409. video.start2HikVisionLogin(param);
  410. }
  411. })
  412. }
  413. </script>
  414. </body>
  415. </html>