index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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)">
  9. <!-- <div style="display:inline-flex">
  10. <div>{{menuName2}}</div>
  11. <div style="margin-left:0.5rem" @click="rightMenu" v-show="showMenu == 0"><i class="el-icon-arrow-right"></i></div>
  12. <div style="margin-left:0.5rem" @click="leftMenu" v-show="showMenu"><i class="el-icon-arrow-left"></i></div>
  13. </div> -->
  14. 铁路护路联防
  15. </div>
  16. <div :class='currentindex==13?"active":""' @click="goTarget(13)">
  17. <!-- <div style="display:inline-flex">
  18. <div>{{menuName2}}</div>
  19. <div style="margin-left:0.5rem" @click="rightMenu" v-show="showMenu == 0"><i class="el-icon-arrow-right"></i></div>
  20. <div style="margin-left:0.5rem" @click="leftMenu" v-show="showMenu"><i class="el-icon-arrow-left"></i></div>
  21. </div> -->
  22. 隐患处理
  23. </div>
  24. <div :class='currentindex==2?"active":""'>
  25. <div style="display:inline-flex">
  26. <div>{{menuName}}</div>
  27. <div style="margin-left:0.5rem" @click="rightMenu(1)" v-show="showMenu == 0"><i class="el-icon-arrow-right"></i></div>
  28. <div style="margin-left:0.5rem" @click="leftMenu(0)" v-show="showMenu == 1"><i class="el-icon-arrow-left"></i></div>
  29. </div>
  30. </div>
  31. <!--
  32. <div @click="goTarget(9)" v-show="showMenu">视频监测</div>
  33. <div @click="goTarget(10)" v-show="!showMenu">无人机监测</div>
  34. <div @click="goTarget(11)" v-show="!showMenu">巡检监测</div>
  35. <div @click="goTarget(11)" v-show="!showMenu">巡逻电车监测</div> -->
  36. <div :class='currentindex==9?"active":""' @click="goTarget(9)" v-show="showMenu == 1">视频监测</div>
  37. <div :class='currentindex==10?"active":""' @click="goTarget(10)" v-show="showMenu == 1">无人机监测</div>
  38. <div :class='currentindex==11?"active":""' @click="goTarget(11)" v-show="showMenu == 1">巡检监测</div>
  39. <div :class='currentindex==12?"active":""' @click="goTarget(12)" v-show="showMenu == 1">巡逻电车监测</div>
  40. <div :class='currentindex==3?"active":""' @click="goTarget(3)" v-show="showMenu == 0">治理态势</div>
  41. <!-- <div :class='currentindex==5?"active":""' @click="goTarget(5)" v-show="showMenu == 0">公众服务</div> -->
  42. <div :class='currentindex==6?"active":""' @click="goTarget(6)" v-show="showMenu == 0">综合管理</div>
  43. <!-- <div :class='currentindex==4?"active":""' @click="goTarget(4)" v-show="showMenu == 0">安全态势</div> -->
  44. </div>
  45. <!--
  46. <div class="menu-dropDown">
  47. <div class='menu_item_class'>设施监测</div>
  48. <div class='menu_item_class'>无人机监测</div>
  49. </div> -->
  50. <div class="time">
  51. <img src="../../assets/images/图层 9@2x.png" /><span>{{ currenttime }}</span>
  52. </div>
  53. <div class="exit">
  54. <i class="el-icon-switch-button" @click="logout"></i>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import moment from "moment";
  60. import TopNav from '@/components/TopNav'
  61. export default {
  62. components: {
  63. TopNav
  64. },
  65. name: "HeaderDiv",
  66. props: {
  67. currentindexP:Number,
  68. menuNameP:{
  69. type: String, // 约束color值的类型
  70. default: "设施监测", // color变量默认值(外部不给 我color传值,使用默认值)
  71. },
  72. menuNameP2:{
  73. type: String, // 约束color值的类型
  74. default: "交通局简介", // color变量默认值(外部不给 我color传值,使用默认值)
  75. },
  76. fatherMethod: {
  77. type: Function,
  78. default: null
  79. }
  80. },
  81. data() {
  82. return {
  83. // 版本号
  84. version: "3.8.1",
  85. currenttime: moment().format("YYYY-MM-DD HH:mm:ss"),
  86. currentindex:this.currentindexP,
  87. showMenu:0,
  88. menuName:this.menuNameP,
  89. menuName2:this.menuNameP2
  90. };
  91. },
  92. mounted() {
  93. console.log(this.currentindexP);
  94. console.log(this.menuNameP);
  95. setInterval(() => {
  96. this.currenttime = moment().format("YYYY-MM-DD HH:mm:ss");
  97. }, 1000);
  98. },
  99. methods: {
  100. async logout() {
  101. this.$confirm('确定注销并退出系统吗?', '提示', {
  102. confirmButtonText: '确定',
  103. cancelButtonText: '取消',
  104. type: 'warning'
  105. }).then(() => {
  106. this.$store.dispatch('LogOut').then(() => {
  107. location.href = '#/login';
  108. })
  109. }).catch(() => {});
  110. },
  111. goTarget(index) {
  112. if(index == 1){
  113. this.$router.push('/big');
  114. this.fatherMethod();
  115. }else if(index == 9){
  116. this.$router.push('/video')
  117. }else if(index == 10){
  118. this.$router.push('/drone')
  119. }else if(index == 11){
  120. this.$router.push('/keepWatch')
  121. }else if(index == 3){
  122. this.$router.push('/new')
  123. }else if(index == 4){
  124. this.$router.push('/safe')
  125. }else if(index == 5){
  126. this.$router.push('/public')
  127. }else if(index == 6){
  128. this.$router.push('/plan/statics')
  129. }else if(index == 7){
  130. this.$router.push('/introduction')
  131. }else if(index == 12){
  132. this.$router.push('/electri')
  133. }else if(index == 13){
  134. this.$router.push('/trouble')
  135. }
  136. },
  137. rightMenu(index){
  138. this.showMenu = index
  139. },
  140. leftMenu(index){
  141. this.showMenu = index
  142. }
  143. },
  144. };
  145. </script>
  146. <style rel="stylesheet/scss" lang="scss">
  147. .header {
  148. background: url("../../assets/images/top@2x.png") no-repeat;
  149. background-size: 100% 100%;
  150. max-height: 5vh;
  151. position: relative;
  152. z-index: 1;
  153. .headertitle {
  154. margin-left: 1.1rem;
  155. img {
  156. width: 41.36rem;
  157. height: 4.2rem;
  158. }
  159. }
  160. .mum {
  161. font-size: 1.6rem;
  162. color: #fff;
  163. position: absolute;
  164. top: 1.2rem;
  165. left: 30%;
  166. >div {
  167. display: inline-block;
  168. margin-right: 4.9rem;
  169. cursor: pointer;
  170. }
  171. .active {
  172. color: #30FFEA;
  173. }
  174. .active::before {
  175. display: inline-block;
  176. content: "";
  177. background: url("../../assets/images/左@2x.png") no-repeat;
  178. width: 2.2rem;
  179. height: 1.4rem;
  180. background-size: 100% 100%;
  181. margin-right: 0.2rem;
  182. }
  183. .active::after {
  184. display: inline-block;
  185. content: "";
  186. background: url("../../assets/images/左@2x.png") no-repeat;
  187. width: 2.2rem;
  188. height: 1.4rem;
  189. background-size: 100% 100%;
  190. margin-left: 0.2rem;
  191. }
  192. }
  193. .time {
  194. position: absolute;
  195. top: 1.2rem;
  196. right: 5.7rem;
  197. font-size: 1.6rem;
  198. color: #fff;
  199. img {
  200. width: 2.4rem;
  201. height: 2.4rem;
  202. vertical-align: middle;
  203. margin-top: -0.1rem;
  204. margin-right: 1.6rem;
  205. }
  206. }
  207. .exit{
  208. position: absolute;
  209. top: 0.6rem;
  210. right: 2.2rem;
  211. font-size: 2rem;
  212. color: white;
  213. }
  214. }
  215. .bottombg{
  216. background: url("../../assets/images/底部菜单bg@2x.png");
  217. position: absolute;
  218. background-size: 100% 100%;
  219. z-index: 1;
  220. width: 85.1rem;
  221. height: 16.3rem;
  222. bottom: 0;
  223. left: 50%;
  224. transform: translate(-50%,-0%);
  225. display: flex;
  226. flex-direction: row;
  227. align-items: center;
  228. color:#fff;
  229. font-size:1.6rem;
  230. .item:hover{
  231. cursor: pointer;
  232. }
  233. .item{
  234. width: 33%;
  235. text-align: center;
  236. justify-content: center;
  237. position: relative;
  238. .num{
  239. font-size:3rem;
  240. color:#25f8bd;
  241. }
  242. }
  243. .item1{
  244. width: 33%;
  245. }
  246. .item2::after{
  247. content: "";
  248. background: url("../../assets/images/图层\ 2@2x.png");
  249. background-size: 100% 100%;
  250. width: 0.2rem;
  251. height: 7.3rem;
  252. position: absolute;
  253. top: 0;
  254. right: 0;
  255. }
  256. }
  257. .ol-zoom-in,.ol-zoom-out{
  258. display: none !important;
  259. }
  260. .menu-dropDown{
  261. position: absolute;
  262. top: 0.5rem;
  263. left: 95rem;
  264. width: 16rem;
  265. height: 3.2rem;
  266. background-color: #30FDFF;
  267. opacity: 1;
  268. padding-left:1rem;
  269. display: inline-flex;
  270. font-size:1.6rem;
  271. color:#D6DEE7;
  272. }
  273. .menu_item_class{
  274. }
  275. </style>