index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div style="width:100%;height:100%;position:relative">
  3. <div style="width:100%;height:100%;padding-top:5.1rem;position:absolute">
  4. <!-- <LivePlayer :videoUrl="videoUrl" fluent autoplay live stretch></LivePlayer> -->
  5. <!-- <mapdiv ref="mapdiv" style=""></mapdiv> -->
  6. <!-- <zhgl></zhgl> -->
  7. <introduction></introduction>
  8. </div>
  9. <headerdiv ref="headerDiv" :currentindexP = currentindexNew></headerdiv>
  10. <!-- <div class="bottombg">
  11. <div class="item item2" @click="changeMapTab(1)"><div class="num">1123</div><div>静态资源</div></div>
  12. <div class="item item1 item2" @click="changeMapTab(2)"><div class="num">113</div><div>动态资源</div></div>
  13. <div class="item item1 item2" @click="changeMapTab(3)"><div class="num">531</div><div>重点区域</div></div>
  14. <div class="item"><div class="num" @click="changeMapTab(4)">16</div><div>实时告警</div></div>
  15. </div> -->
  16. <!-- <videodiv :cameracode="ccode" style="width:700px;height:300px;position:absolute;top:100px;left:100px"></videodiv> -->
  17. </div>
  18. </template>
  19. <script>
  20. import moment from "moment";
  21. import mapdiv from "../../components/map/index.vue"
  22. import introduction from './introduction.vue'
  23. import zhgl from "../../components/zhgl/index.vue"
  24. import headerdiv from '@/components/HeaderDiv/index.vue'
  25. import { httpRequest } from "@/api/data/http";
  26. import { getLineData,getResource } from "@/api/qdtl/data";
  27. // import LivePlayer from '@liveqing/liveplayer' // vue2
  28. import videodiv from "../../components/Videoplayer/index.vue"
  29. export default {
  30. name: "big",
  31. data() {
  32. return {
  33. videoUrl:'rtmp://39.104.22.45:30498/rtp/34020001001320000001_34020001001320000001',
  34. currenttime: moment().format("YYYY-MM-DD HH:mm:ss"),
  35. currentindexNew:7,
  36. ccode:"32068166001320000235",
  37. videoParams:{
  38. url:'http://2.90.220.252:9017/artemis-web/debug',
  39. params:'{"httpMethod":"POST","path":"/api/resource/v1/cameras","headers":{},"query":{},"parameter":{},"body":{"pageNo": 1,"pageSize": 5000,"treeCode": "0"},"contentType":"application/json;charset=UTF-8","mock":false,"appKey":"27794545","appSecret":"5Xi27Gl7JrbHHF1MpdaB"}'
  40. },
  41. };
  42. },
  43. components:{
  44. mapdiv,
  45. zhgl,
  46. headerdiv,
  47. videodiv,
  48. introduction
  49. },
  50. mounted() {
  51. // this.getTrain();
  52. this.getResource();
  53. this.getvideoList();
  54. // this.$$refs.headerDiv.currentindex = 1;
  55. setInterval(() => {
  56. this.currenttime = moment().format("YYYY-MM-DD HH:mm:ss");
  57. }, 1000);
  58. },
  59. methods:{
  60. changeMapTab(index){
  61. this.$refs.mapdiv.iconSelect = index
  62. },
  63. getTrain(){
  64. this.$refs.mapdiv.addPoint('video.png');
  65. },
  66. getResource(){
  67. getResource({date:'2022-03-12'}).then(response =>{
  68. var trainArry = [];
  69. var bridgeArry = [];
  70. var railArry = [];
  71. var stationLocation = [];
  72. var areaList = [];
  73. for(var index in response.data.staticLocation){
  74. var obj = response.data.staticLocation[index]
  75. obj.fence = obj.lnglat
  76. obj.name = obj.locationName
  77. stationLocation.push(obj)
  78. }
  79. for(var index in response.data.area){
  80. var obj = response.data.area[index]
  81. if(obj.areaType == '1'){
  82. areaList.push(obj);
  83. }else if(obj.areaType == '2'){
  84. obj.name = obj.areaName
  85. trainArry.push(obj);
  86. }else if(obj.areaType == '3'){
  87. obj.name = obj.areaName
  88. bridgeArry.push(obj);
  89. }else if(obj.areaType == '4'){
  90. obj.name = obj.areaName
  91. railArry.push(obj);
  92. }
  93. }
  94. for(var index in areaList){
  95. var json = JSON.parse(areaList[index].fence)
  96. this.$refs.mapdiv.addPolygon(json);
  97. }
  98. for(var key in response.data.deviceTrail){
  99. var jsonStr = '['
  100. for(var index in response.data.deviceTrail[key]){
  101. var obj = response.data.deviceTrail[key][index]
  102. if(index == response.data.deviceTrail[key].length - 1){
  103. var location = '['+obj.fence.split(',')[0]+','+obj.fence.split(',')[1]+']'
  104. }else{
  105. var location = '['+obj.fence.split(',')[0]+','+obj.fence.split(',')[1]+'],'
  106. }
  107. jsonStr += location
  108. // deviceArry.push(obj.fence.split(','));
  109. }
  110. jsonStr += ']'
  111. var json = JSON.parse(jsonStr);
  112. this.$refs.mapdiv.addPoints(response.data.deviceTrail[key],'device.png',0.6,'device');
  113. this.$refs.mapdiv.addline(json,'device');
  114. }
  115. this.$refs.mapdiv.addPoints(trainArry,'train.png',0.6,'train');
  116. this.$refs.mapdiv.addPoints(bridgeArry,'bridge.png',0.6,'bridge');
  117. this.$refs.mapdiv.addPoints(railArry,'rail.png',0.6,'rail');
  118. this.$refs.mapdiv.addPoints(stationLocation,'location.png',0.6,'location');
  119. })
  120. },
  121. getvideoList(){
  122. httpRequest(this.videoParams).then(data =>{
  123. var json = JSON.parse(data.data);
  124. this.$refs.mapdiv.addPoints(json.data.list,'video.png',0.6,'video');
  125. });
  126. }
  127. }
  128. };
  129. </script>
  130. <style rel="stylesheet/scss" lang="scss">
  131. .bottombg{
  132. background: url("../../assets/images/底部菜单bg@2x.png");
  133. position: absolute;
  134. background-size: 100% 100%;
  135. z-index: 1;
  136. width: 85.1rem;
  137. height: 16.3rem;
  138. bottom: 0;
  139. left: 50%;
  140. transform: translate(-50%,-0%);
  141. display: flex;
  142. flex-direction: row;
  143. align-items: center;
  144. color:#fff;
  145. font-size:1.6rem;
  146. .item{
  147. width: 27%;
  148. text-align: center;
  149. justify-content: center;
  150. position: relative;
  151. .num{
  152. font-size:3rem;
  153. color:#25f8bd;
  154. }
  155. }
  156. .item1{
  157. width: 23%;
  158. }
  159. .item2::after{
  160. content: "";
  161. background: url("../../assets/images/图层\ 2@2x.png");
  162. background-size: 100% 100%;
  163. width: 0.2rem;
  164. height: 7.3rem;
  165. position: absolute;
  166. top: 0;
  167. right: 0;
  168. }
  169. }
  170. .ol-zoom-in,.ol-zoom-out{
  171. display: none !important;
  172. }
  173. </style>