top.jsp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8" %>
  3. <!DOCTYPE html>
  4. <!-- 头部区域 -->
  5. <style>
  6. .notice_ul {
  7. display: flex;
  8. align-items: center;
  9. float: right;
  10. width: 565px;
  11. height: 20px;
  12. margin: 5px 10px 0 0;
  13. padding: 20px;
  14. box-sizing: border-box;
  15. font-size: 20px;
  16. color: #FF8D02;
  17. background: #FFEEB6;
  18. border-radius: 13px;
  19. overflow: hidden;
  20. }
  21. /* .notice_ul li {
  22. height: 30px;
  23. line-height: 60px;
  24. } */
  25. .notice_title {
  26. display: flex;
  27. overflow: hidden;
  28. text-overflow: ellipsis;
  29. white-space: nowrap;
  30. }
  31. .notice_icon {
  32. width: 20px;
  33. height: 22px;
  34. margin: auto 30px auto 7px;
  35. background-image: url(${domain}/asset/css/images/icon_notice.svg);
  36. background-size: 100% 100%;
  37. }
  38. .top-cutline-normal {
  39. width: 1px;
  40. height: 50px;
  41. background: #0B2F60;
  42. box-shadow: 1px 0px 0px 0px #1C56A3;
  43. }
  44. .top-avatar {
  45. width: 37px;
  46. height: 37px;
  47. margin: 9px 0 auto 9px;
  48. border-radius: 50%;
  49. background-image: url(${domain}/asset/css/images/avatar-default.png);
  50. background-size: 100% 100%;
  51. }
  52. .layui-logo {
  53. left: 0;
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. height: 100%;
  58. width: 265px !important;
  59. font-size: 18px;
  60. }
  61. </style>
  62. <div class="layui-header" id="top">
  63. <%--<div class="menu-collapse" @click="changeSide">
  64. <div class="menu-collapse-icon" :class="{close: collapse}"></div>
  65. </div>
  66. <div class="top-cutline"></div>
  67. <div class="layui-logo" style="">哈密市投资项目智慧平台</div>--%>
  68. <div class="prompt"><span class="date">{{dateWeek}}</span></div>
  69. <c:if test="${isShowDialog==1}">
  70. <div class="top-task" onClick="toTask()">
  71. <div class="top-dashboard-icon"></div>
  72. 调度
  73. </div>
  74. </c:if>
  75. <div class="top-dashboard" onClick="toWorkBench()">
  76. <div class="top-dashboard-icon"></div>
  77. 工作台
  78. </div>
  79. <%--<div class="top-arrow"></div>
  80. <div class="top-breadcrumb"></div>--%>
  81. <ul class="layui-nav layui-layout-right">
  82. <li class="layui-nav-item" style="flex: 1;">
  83. <div id="noticeUl"></div>
  84. </li>
  85. <%--<li class="layui-nav-item">
  86. <div class="top-cutline-normal"></div>
  87. </li>--%>
  88. <li class="layui-nav-item">
  89. <div style="display: flex; align-items: center; height: 100%;">
  90. <button class="layui-btn"
  91. style="border-radius: 5px; background-color: #0073EF;"
  92. @click="changeSystem"
  93. >返回主系统</button>
  94. </div>
  95. </li>
  96. <li class="layui-nav-item">
  97. <a style="padding:0;margin-left:25px;">
  98. <span class="txt">
  99. ${realName}
  100. </span>
  101. <ul class="sub_menu">
  102. <li onClick="openRestPanel()"><img src="${WebSite.asset }/css/images/u48.svg"/>修改密码</li>
  103. </ul>
  104. </a>
  105. </li>
  106. <li class="layui-nav-item">
  107. <div class="top-avatar"></div>
  108. </li>
  109. <li class="layui-nav-item"><a href="${domain}/logout"><span class="logout"
  110. style="margin: 0"
  111. ></span>退出</a></li>
  112. </ul>
  113. </div>
  114. <script type="text/javascript">
  115. new Vue({
  116. el: "#top",
  117. data: {
  118. collapse: true,
  119. dateWeek: ""
  120. },
  121. created() {
  122. this.dateWeek = this.formatDate(new Date());
  123. },
  124. methods: {
  125. changeSide: function () {
  126. this.collapse = !this.collapse;
  127. window.parent.postMessage({collapse: this.collapse}, "*");
  128. },
  129. changeSystem() {
  130. App.postJson("/api/app/switch/toFgw", {type:'0'}, function (res) {
  131. console.log(res);
  132. if(res.code ===200){
  133. var targetUrl = res.msg+"/index";
  134. var cookiesToSend = "rememberMe="+res.data.token;
  135. // 将需要携带的cookie通过URL参数的形式附加到目标URL上
  136. targetUrl += "?cookies=" + encodeURIComponent(cookiesToSend);
  137. window.location.href = targetUrl;
  138. }
  139. });
  140. },
  141. formatDate(date) {
  142. const weekdays = ["日", "一", "二", "三", "四", "五", "六"];
  143. const year = date.getFullYear();
  144. const month = date.getMonth() + 1; // JavaScript中的月份是从0开始的,所以需要加1
  145. const day = date.getDate();
  146. const weekday = weekdays[date.getDay()]; // JavaScript中的getDay()方法返回的是一周中的第几天,从0(星期日)到6(星期六)
  147. return year+`年`+(month < 10 ? '0' + month : month)+`月`+(day < 10 ? '0' + day : day)+`日 星期`+weekday;
  148. }
  149. }
  150. })
  151. </script>