App.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div id="app" @click="handleClick">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. import { getToken, setToken } from '@/utils/auth';
  8. export default {
  9. name: 'App',
  10. data() {
  11. return {
  12. lastTime: null,
  13. currentTime: null,
  14. timeOut: 0.5 * 3600000,
  15. token: '',
  16. timer: '',
  17. };
  18. },
  19. mounted() {
  20. this.lastTime = new Date().getTime();
  21. this.token = getToken();
  22. },
  23. methods: {
  24. handleClick() {
  25. setTimeout(() => {
  26. this.lastTime = new Date().getTime();
  27. if (this.$route.path.includes('/hospital') || this.$route.path.includes('/embedIndex')) {
  28. clearInterval(this.timer);
  29. this.timer = setInterval(this.isTimeOut, 1000);
  30. } else {
  31. clearInterval(this.timer);
  32. this.lastTime = new Date().getTime();
  33. }
  34. }, 1000);
  35. },
  36. isTimeOut() {
  37. this.currentTime = new Date().getTime();
  38. console.log(6666)
  39. // 判断上次最后一次点击的时间和这次点击的时间间隔是否大于30分钟
  40. if (this.currentTime - this.lastTime > this.timeOut) {
  41. if (null != this.token) {
  42. // 是否是登录状态
  43. clearInterval(this.timer);
  44. this.$message.info('30分钟内无操作,请重新登录。');
  45. setToken('');
  46. sessionStorage.removeItem('route');
  47. this.$router.push({ path: `/login` });
  48. } else {
  49. this.lastTime = new Date().getTime();
  50. }
  51. }
  52. },
  53. },
  54. };
  55. </script>
  56. <style>
  57. * {
  58. font-size: 14px;
  59. margin: 0;
  60. padding: 0;
  61. }
  62. .btn1 {
  63. background: #185da6;
  64. color: #fff;
  65. }
  66. .btn2 {
  67. background: #f1f6ff;
  68. color: #13171e;
  69. border: 0;
  70. }
  71. .eInput {
  72. /* width:350px; */
  73. border: none !important;
  74. }
  75. /* 三种方法选择自己喜欢的一个即可 */
  76. /* .el-input--prefix .el-input__inner{
  77. border: none;
  78. } */
  79. /* .el-input--small .el-input__inner {
  80. border: none;
  81. } */
  82. /* .textMsg {
  83. position: absolute;
  84. top: 80px;
  85. cursor: pointer;
  86. left: 3px;
  87. } */
  88. /* 重写input */
  89. .row-bg {
  90. width: 100%;
  91. }
  92. .flexTable .el-input__inner {
  93. border-top: none !important;
  94. border-left: none !important;
  95. border-right: none !important;
  96. margin-bottom: 2px;
  97. border-radius: 0px !important;
  98. }
  99. .tableReach .el-input__inner {
  100. border-top: none !important;
  101. border-left: none !important;
  102. border-right: none !important;
  103. border-radius: 0px !important;
  104. border-bottom: 1px solid #f5f5f5 !important;
  105. }
  106. .tableReaches .el-input__inner {
  107. border-top: none !important;
  108. border-left: none !important;
  109. border-right: none !important;
  110. height: 30px !important;
  111. line-height: 30px !important;
  112. border-bottom: 0.5px solid #f5f5f5 !important;
  113. border-radius: 0px !important;
  114. }
  115. .tableReachCCC .el-input__inner {
  116. border-top: none !important;
  117. border-left: none !important;
  118. border-right: none !important;
  119. border-radius: 0px !important;
  120. border-bottom: 0.5px solid #f5f5f5 !important;
  121. }
  122. #hh .el-input__inner {
  123. border-top: 0px !important;
  124. border-left: 0px !important;
  125. border-right: 0px !important;
  126. border-radius: 0px !important;
  127. border-bottom: 1px solid #ccc !important;
  128. }
  129. .flexView {
  130. display: flex;
  131. width: 100%;
  132. align-items: center;
  133. justify-content: center;
  134. }
  135. .tabright .el-input__inner {
  136. border-top: none !important;
  137. border-left: none !important;
  138. border-right: 0.5px !important;
  139. border-bottom: none !important;
  140. }
  141. .tableReachInput .flexView div {
  142. width: 33%;
  143. }
  144. .refachInput {
  145. display: flex;
  146. }
  147. .tablex td {
  148. border-top: none !important;
  149. border-left: none !important;
  150. border-right: none !important;
  151. }
  152. .tablexs span {
  153. font-size: 12px !important;
  154. }
  155. .refachInput span {
  156. height: 40px;
  157. line-height: 40px;
  158. font-weight: bold;
  159. text-align: left;
  160. display: inline-block;
  161. }
  162. .tred td {
  163. border-top: none !important;
  164. border-left: none !important;
  165. border-right: none !important;
  166. }
  167. .refachInput .el-input__inner {
  168. border-top: none !important;
  169. border-left: none !important;
  170. border-right: none !important;
  171. margin-bottom: 2px;
  172. border-radius: 0px !important;
  173. }
  174. .msgBoxDetail span {
  175. margin-left: 10px;
  176. }
  177. /* 质控下拉append */
  178. .zkSelect {
  179. display: inline-block;
  180. }
  181. .zkSelect .el-input-group__append {
  182. border-left: 0;
  183. width: 62px !important;
  184. }
  185. .tableBox .el-table .el-table__header tr th:first-child {
  186. /* border-radius: 10px 0px 0px 10px; */
  187. border-radius: 0 !important;
  188. }
  189. .flextab {
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. margin: 10px 0px;
  194. }
  195. .dashboard-container {
  196. padding: 0;
  197. margin: 16px !important;
  198. }
  199. </style>