index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div class="header">
  3. <div class="headertitle">
  4. <img src="../../assets/images/启东市铁路沿线综合治理信息化管理平台@2x.png" />
  5. </div>
  6. <div class="mum">
  7. <div :class='currentindex==1?"active":""' @click="goTarget(1)">首页</div>
  8. <div :class='currentindex==7?"active":""' @click="goTarget(7)">交通局简介</div>
  9. <div :class='currentindex==2?"active":""'>
  10. <div style="display:inline-flex">
  11. <div>{{menuName}}</div>
  12. <div style="margin-left:0.5rem" @click="rightMenu" v-show="showMenu"><i class="el-icon-arrow-right"></i></div>
  13. <div style="margin-left:0.5rem" @click="leftMenu" v-show="!showMenu"><i class="el-icon-arrow-left"></i></div>
  14. </div>
  15. </div>
  16. <div @click="goTarget(9)" v-show="!showMenu">视频监测</div>
  17. <div @click="goTarget(10)" v-show="!showMenu">无人机监测</div>
  18. <div @click="goTarget(11)" v-show="!showMenu">巡检监测</div>
  19. <div @click="goTarget(11)" v-show="!showMenu">巡逻电车监测</div>
  20. <div :class='currentindex==6?"active":""' @click="goTarget(6)" v-show="showMenu">综合管理</div>
  21. <div :class='currentindex==3?"active":""' @click="goTarget(3)" v-show="showMenu">治理态势</div>
  22. <div :class='currentindex==4?"active":""' @click="goTarget(4)" v-show="showMenu">安全态势</div>
  23. <div :class='currentindex==5?"active":""' @click="goTarget(5)" v-show="showMenu">公众服务</div>
  24. </div>
  25. <!--
  26. <div class="menu-dropDown">
  27. <div class='menu_item_class'>设施监测</div>
  28. <div class='menu_item_class'>无人机监测</div>
  29. </div> -->
  30. <div class="time">
  31. <img src="../../assets/images/图层 9@2x.png" /><span>{{ currenttime }}</span>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import moment from "moment";
  37. export default {
  38. name: "HeaderDiv",
  39. props: {
  40. currentindexP:Number,
  41. menuNameP:{
  42. type: String, // 约束color值的类型
  43. default: "更多监测", // color变量默认值(外部不给 我color传值,使用默认值)
  44. },
  45. },
  46. data() {
  47. return {
  48. // 版本号
  49. version: "3.8.1",
  50. currenttime: moment().format("YYYY-MM-DD HH:mm:ss"),
  51. currentindex:this.currentindexP,
  52. showMenu:true,
  53. menuName:this.menuNameP
  54. };
  55. },
  56. mounted() {
  57. console.log(this.currentindexP);
  58. console.log(this.menuNameP);
  59. setInterval(() => {
  60. this.currenttime = moment().format("YYYY-MM-DD HH:mm:ss");
  61. }, 1000);
  62. },
  63. methods: {
  64. goTarget(index) {
  65. if(index == 1){
  66. this.$router.push('/big')
  67. }else if(index == 9){
  68. this.$router.push('/video')
  69. }else if(index == 10){
  70. this.$router.push('/drone')
  71. }else if(index == 3){
  72. this.$router.push('/governance')
  73. }else if(index == 4){
  74. this.$router.push('/safe')
  75. }else if(index == 5){
  76. this.$router.push('/public')
  77. }else if(index == 6){
  78. this.$router.push('/qdlt/area')
  79. }else if(index == 7){
  80. this.$router.push('/introduction')
  81. }
  82. },
  83. rightMenu(){
  84. this.showMenu = false
  85. },
  86. leftMenu(){
  87. this.showMenu = true
  88. }
  89. },
  90. };
  91. </script>
  92. <style rel="stylesheet/scss" lang="scss">
  93. .header {
  94. background: url("../../assets/images/top@2x.png") no-repeat;
  95. background-size: 100% 100%;
  96. max-height: 5.2rem;
  97. position: relative;
  98. z-index: 1;
  99. .headertitle {
  100. margin-left: 1.1rem;
  101. img {
  102. width: 41.36rem;
  103. height: 4.2rem;
  104. }
  105. }
  106. .mum {
  107. font-size: 1.6rem;
  108. color: #fff;
  109. position: absolute;
  110. top: 1.2rem;
  111. left: 30%;
  112. >div {
  113. display: inline-block;
  114. margin-right: 7.9rem;
  115. cursor: pointer;
  116. }
  117. .active {
  118. color: #30FFEA;
  119. }
  120. .active::before {
  121. display: inline-block;
  122. content: "";
  123. background: url("../../assets/images/左@2x.png") no-repeat;
  124. width: 2.2rem;
  125. height: 1.4rem;
  126. background-size: 100% 100%;
  127. margin-right: 0.2rem;
  128. }
  129. .active::after {
  130. display: inline-block;
  131. content: "";
  132. background: url("../../assets/images/左@2x.png") no-repeat;
  133. width: 2.2rem;
  134. height: 1.4rem;
  135. background-size: 100% 100%;
  136. margin-left: 0.2rem;
  137. }
  138. }
  139. .time {
  140. position: absolute;
  141. top: 1.2rem;
  142. right: 4.7rem;
  143. font-size: 1.6rem;
  144. color: #fff;
  145. img {
  146. width: 2.4rem;
  147. height: 2.4rem;
  148. vertical-align: middle;
  149. margin-top: -0.1rem;
  150. margin-right: 1.6rem;
  151. }
  152. }
  153. }
  154. .bottombg{
  155. background: url("../../assets/images/底部菜单bg@2x.png");
  156. position: absolute;
  157. background-size: 100% 100%;
  158. z-index: 1;
  159. width: 85.1rem;
  160. height: 16.3rem;
  161. bottom: 0;
  162. left: 50%;
  163. transform: translate(-50%,-0%);
  164. display: flex;
  165. flex-direction: row;
  166. align-items: center;
  167. color:#fff;
  168. font-size:1.6rem;
  169. .item:hover{
  170. cursor: pointer;
  171. }
  172. .item{
  173. width: 33%;
  174. text-align: center;
  175. justify-content: center;
  176. position: relative;
  177. .num{
  178. font-size:3rem;
  179. color:#25f8bd;
  180. }
  181. }
  182. .item1{
  183. width: 33%;
  184. }
  185. .item2::after{
  186. content: "";
  187. background: url("../../assets/images/图层\ 2@2x.png");
  188. background-size: 100% 100%;
  189. width: 0.2rem;
  190. height: 7.3rem;
  191. position: absolute;
  192. top: 0;
  193. right: 0;
  194. }
  195. }
  196. .ol-zoom-in,.ol-zoom-out{
  197. display: none !important;
  198. }
  199. .menu-dropDown{
  200. position: absolute;
  201. top: 0.5rem;
  202. left: 95rem;
  203. width: 16rem;
  204. height: 3.2rem;
  205. background-color: #30FDFF;
  206. opacity: 1;
  207. padding-left:1rem;
  208. display: inline-flex;
  209. font-size:1.6rem;
  210. color:#D6DEE7;
  211. }
  212. .menu_item_class{
  213. }
  214. </style>