HeaderCompBJ.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <div class="NavContainer">
  3. <div class="navFlex">
  4. <div class="top_ban_box">
  5. <div class="list_box">
  6. <div class="weather">
  7. <!-- <div class="wea-left">
  8. <img src="@/assets/images/sun.png" alt="">
  9. </div> -->
  10. <div class="wea-right">
  11. <div class="top">{{ dateHour }}</div>
  12. <div class="bottom">
  13. <span>{{ dateSecond }}</span>
  14. <!-- <span>晴</span> -->
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="titleBox" ref="titleBox">
  20. <div class="back1">
  21. <div class="ttl">
  22. <img src="@/assets/images/logo.png" />
  23. <span class="title">{{ bjTitle }}</span>
  24. <!-- <span class="line"></span> -->
  25. <span class="subtitle">{{ bjSTitle }}</span>
  26. </div>
  27. <div class="tts">- 滨江区 -</div>
  28. </div>
  29. </div>
  30. <div class="list_box"></div>
  31. </div>
  32. <div class="iconGroup">
  33. <!-- <div class="userIcon">
  34. <img src="@/assets/images/user.png" />
  35. <span>{{ syUserName||'管理员' }}</span>
  36. </div> -->
  37. <el-dropdown @command="handleCommand">
  38. <span class="el-dropdown-link">
  39. <img src="@/assets/images/user.png" />
  40. <span>{{ syUserName || '管理员' }}</span>
  41. <i class="el-icon-arrow-down el-icon--right"></i>
  42. </span>
  43. <el-dropdown-menu slot="dropdown">
  44. <el-dropdown-item command="xcryManage">巡查人员管理</el-dropdown-item>
  45. <el-dropdown-item command="updataPwd">修改密码</el-dropdown-item>
  46. <el-dropdown-item command="clearLogin">退出登录</el-dropdown-item>
  47. </el-dropdown-menu>
  48. </el-dropdown>
  49. </div>
  50. </div>
  51. <div class="back"></div>
  52. <UpdataPas ref="pasRef"></UpdataPas>
  53. <XcryDetail ref="xcryRef"></XcryDetail>
  54. </div>
  55. </template>
  56. <script>
  57. import { mapGetters, mapState } from 'vuex';
  58. import UpdataPas from './updataPassWord.vue';
  59. import XcryDetail from './xcryDetail.vue';
  60. export default {
  61. computed: {
  62. ...mapState({
  63. xzqName: (state) => state.BaseData.xzqState,
  64. mapDataOne: (state) => state.BaseData.TDG,
  65. }),
  66. ...mapGetters({
  67. xzqdm: 'BaseData/xzqCodeGetter',
  68. title: 'BaseData/titleGetter',
  69. }),
  70. },
  71. components: { UpdataPas, XcryDetail },
  72. data() {
  73. return {
  74. currentUrl: '',
  75. syUserName: '',
  76. orgRole: false,
  77. dateHour: '',
  78. dateSecond: '',
  79. topShow: false,
  80. bjTitle: '省域空间治理数字化平台',
  81. bjSTitle: '要素一本帐',
  82. };
  83. },
  84. props: {},
  85. mounted() {
  86. if (this.$route.fullPath.indexOf('manage-list') > 0) {
  87. this.bjTitle = '滨江区地块管理';
  88. this.bjSTitle = '';
  89. }
  90. this.syUserName = localStorage.getItem('ybz_syUser');
  91. this.$vm.$on('updateStorage', () => {
  92. this.syUserName = localStorage.getItem('ybz_syUser');
  93. });
  94. this.$vm.$on('orgRoleEvent', (boolean) => {
  95. this.orgRole = boolean;
  96. });
  97. let users = JSON.parse(localStorage.getItem('userInfo'));
  98. if (users) {
  99. this.syUserName = users.nickName;
  100. }
  101. setTimeout(() => {
  102. const showOrgRole = localStorage.getItem('ybz_showOrgRole');
  103. if (showOrgRole == '1') {
  104. this.orgRole = true;
  105. }
  106. const path = this.$router.history.current.path;
  107. this.currentUrl = path;
  108. }, 500);
  109. this.getDate();
  110. let routePath = this.$route.path;
  111. if (
  112. routePath == '/bzybz' ||
  113. routePath == 'bhybz' ||
  114. routePath == '/xyybz' ||
  115. routePath == '/tsyy' ||
  116. routePath == '/ysbzDetail' ||
  117. routePath == '/tsxz' ||
  118. routePath == '/xzll' ||
  119. routePath == '/wmqy' ||
  120. routePath == '/bdgj'
  121. ) {
  122. this.topShow = true;
  123. } else {
  124. this.topShow = false;
  125. }
  126. },
  127. methods: {
  128. handleCommand(command) {
  129. if (command == 'updataPwd') {
  130. this.$refs.pasRef.show();
  131. } else if (command == 'xcryManage') {
  132. this.$refs.xcryRef.show();
  133. } else {
  134. localStorage.clear();
  135. this.$router.push({
  136. path: '/login',
  137. });
  138. }
  139. },
  140. getDate() {
  141. var myDate = new Date();
  142. let year = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
  143. let month = this.add0(myDate.getMonth() + 1); //获取当前月份(0-11,0代表1月)
  144. let day = this.add0(myDate.getDate()); //获取当前日(1-31)
  145. let hour = this.add0(myDate.getHours()); //获取当前小时数(0-23)
  146. let min = this.add0(myDate.getMinutes()); //获取当前分钟数(0-59)
  147. let second = this.add0(myDate.getSeconds()); //获取当前秒数(0-59)
  148. this.dateHour = `${year}年${month}月${day}日`;
  149. this.dateSecond = `${hour}:${min}:${second}`;
  150. setTimeout(this.getDate, 1000);
  151. },
  152. add0(m) {
  153. return m < 10 ? '0' + m : m;
  154. },
  155. topClick() {
  156. // this.$router.push("/home")
  157. this.$router.push({
  158. path: '/',
  159. query: this.$route.query,
  160. });
  161. },
  162. },
  163. };
  164. </script>
  165. <style lang="scss" scoped>
  166. $navHeight: 94px;
  167. .NavContainer {
  168. height: $navHeight;
  169. position: relative;
  170. > img {
  171. position: relative;
  172. z-index: 99;
  173. width: 100%;
  174. height: 100%;
  175. }
  176. > .navFlex {
  177. z-index: 999;
  178. overflow: hidden;
  179. position: absolute;
  180. top: 0px;
  181. height: 100%;
  182. width: 100%;
  183. .list_box {
  184. flex: 1;
  185. &:first-child {
  186. text-align: right;
  187. }
  188. &:last-child {
  189. text-align: left;
  190. }
  191. > span {
  192. display: inline-block;
  193. color: #fff;
  194. padding: 8px 20px;
  195. margin: 0px 10px;
  196. font-size: 18px;
  197. font-weight: bold;
  198. color: #fff;
  199. cursor: pointer;
  200. background-position: bottom;
  201. background-size: 100% 100%;
  202. background-repeat: no-repeat;
  203. &:hover,
  204. &.active {
  205. color: #ffffff;
  206. background-image: url('~@/assets/images/item_active.png');
  207. }
  208. }
  209. }
  210. > .top_ban_box {
  211. position: absolute;
  212. left: 0;
  213. right: 0;
  214. top: 0;
  215. margin: auto;
  216. height: 78px;
  217. display: flex;
  218. align-items: center;
  219. .out-btn-wrapper {
  220. position: absolute;
  221. right: 150px;
  222. top: 23px;
  223. display: inline-block;
  224. line-height: 1.75rem;
  225. padding: 2px 10px;
  226. color: #fff;
  227. font-size: 16px;
  228. text-align: center;
  229. border: 1px solid #468ec0;
  230. background: linear-gradient(0deg, #102a54 0%, #3d5a93 100%);
  231. border-radius: 0.25rem;
  232. cursor: pointer;
  233. &:hover {
  234. font-weight: bold;
  235. border: 2px solid #468ec0;
  236. }
  237. }
  238. > div {
  239. &.list_box {
  240. flex: 1;
  241. > span {
  242. font-size: 22px;
  243. }
  244. .weather {
  245. height: 100%;
  246. display: flex;
  247. margin-left: 30px;
  248. align-items: center;
  249. .wea-left {
  250. text-align: center;
  251. img {
  252. width: 50px;
  253. }
  254. }
  255. .wea-right {
  256. color: #fff;
  257. font-family: AlibabaPuHuiTiR;
  258. font-size: 1.25rem;
  259. margin-left: 20px;
  260. .top {
  261. }
  262. .bottom {
  263. display: flex;
  264. justify-content: space-between;
  265. }
  266. }
  267. }
  268. }
  269. &.titleBox {
  270. text-align: center;
  271. width: 860px;
  272. top: 0px;
  273. margin-top: 0px;
  274. cursor: pointer;
  275. img {
  276. width: 100%;
  277. }
  278. }
  279. }
  280. }
  281. > span {
  282. display: block;
  283. position: absolute;
  284. top: 25px;
  285. left: 0;
  286. right: 0;
  287. margin: auto;
  288. width: 420px;
  289. > img {
  290. width: 100%;
  291. height: 100%;
  292. }
  293. }
  294. .iconGroup {
  295. position: absolute;
  296. right: 20px;
  297. top: 25px;
  298. > div {
  299. display: inline-block;
  300. margin-left: 20px;
  301. font-size: 16px;
  302. cursor: pointer;
  303. > img {
  304. margin-right: 6px;
  305. vertical-align: middle;
  306. width: 30px;
  307. height: 30px;
  308. }
  309. > span {
  310. color: #abd5ff;
  311. }
  312. }
  313. }
  314. }
  315. .back {
  316. height: 80px;
  317. position: relative;
  318. z-index: 9;
  319. background: url('~@/assets/images/top_nav_bg.png') no-repeat;
  320. background-size: 100% 100%;
  321. }
  322. .back1 {
  323. position: absolute;
  324. z-index: 999;
  325. text-align: center;
  326. bottom: 0px;
  327. top: 0px;
  328. height: $navHeight;
  329. width: 860px;
  330. font-weight: 700;
  331. background-image: url('~@/assets/images/nav_title_bg.png');
  332. background-size: 100% 100%;
  333. background-repeat: no-repeat;
  334. .ttl {
  335. margin-top: 5px;
  336. width: 100%;
  337. text-align: center;
  338. text-shadow: 0 0.20833rem 0.20833rem #005d8b;
  339. color: #fff;
  340. display: flex;
  341. align-items: center;
  342. justify-content: center;
  343. > img {
  344. margin-right: 20px;
  345. width: 42px !important;
  346. height: 36px !important;
  347. }
  348. > .line {
  349. width: 30px;
  350. height: 4px;
  351. background: #fff;
  352. margin: 0px 10px;
  353. }
  354. > .title {
  355. font-family: AlibabaPuHuiTi-Medium-105;
  356. font-size: 38px;
  357. }
  358. > .subtitle {
  359. font-family: AlibabaPuHuiTi-Medium-65;
  360. font-size: 32px;
  361. font-weight: 500;
  362. }
  363. }
  364. .tts {
  365. width: 100%;
  366. font-size: 22px;
  367. bottom: 5px;
  368. position: absolute;
  369. color: #ffcd33;
  370. left: 0;
  371. text-align: center;
  372. font-family: AlibabaPuHuiTi-Medium-65;
  373. }
  374. }
  375. }
  376. ::v-deep .iconGroup {
  377. .el-dropdown-link {
  378. display: flex;
  379. align-items: center;
  380. img {
  381. width: 30px;
  382. height: 30px;
  383. margin-right: 5px;
  384. }
  385. }
  386. }
  387. </style>