App.vue 4.4 KB

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