App.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <router-view v-slot="{ Component }">
  3. <keep-alive>
  4. <component :is="Component"/>
  5. </keep-alive>
  6. </router-view>
  7. </template>
  8. <script>
  9. import {defineComponent} from 'vue'
  10. import locale from 'element-plus/lib/locale/lang/zh-cn'
  11. import {useStore} from 'vuex'
  12. import store from "@/store";
  13. import {setCallback} from "@/utils/websocket";
  14. import {ElMessageBox, ElNotification} from "element-plus";
  15. import sleep from "@/utils/sleep";
  16. export default defineComponent({
  17. name: 'App',
  18. setup() {
  19. const store = useStore()
  20. let windowSize = getWindowSize()
  21. store.commit('app/setWindowSize', windowSize)
  22. store.commit('app/setJdt', {
  23. title: '数据上传',
  24. isOpen: false,
  25. abnormalClosing: false,
  26. })
  27. window.onresize = () => {
  28. store.commit('app/setWindowSize', getWindowSize())
  29. }
  30. onMounted(() => {
  31. setCallback('refreshToken', (data) => {
  32. store.commit('user/tokenChange', data.token)
  33. })
  34. setCallback('sidSingle', async () => {
  35. await store.dispatch('user/loginOut')
  36. await ElMessageBox.alert('您的账号已在其他地方登陆,如需修改密码请在个人中心中修改。', '提示', {
  37. type: 'warning',
  38. })
  39. })
  40. setCallback('criticalValue', (data) => {
  41. ElMessageBox.alert(data.message, '患者危急值', {
  42. type: 'error'
  43. }).then(() => {
  44. }).catch(() => {
  45. })
  46. })
  47. setCallback('systemNotification', (data) => {
  48. if (data.count) {
  49. let newCount = store.state.app.unreadMessageCount + data.count
  50. store.commit('app/setUnreadMessageCount', newCount)
  51. }
  52. if (data.refreshDelay) {
  53. sleep(data.refreshDelay).then(() => {
  54. location.reload();
  55. })
  56. }
  57. if (data?.donTDisplay) {
  58. return
  59. }
  60. ElNotification({
  61. title: typeof data.title === 'undefined' ? '新消息' : data.title,
  62. message: data.message,
  63. dangerouslyUseHTMLString: true,
  64. type: typeof data.type === 'undefined' ? 'warning' : data.type,
  65. duration: 0,
  66. })
  67. })
  68. })
  69. return {
  70. locale,
  71. }
  72. },
  73. })
  74. function getWindowSize() {
  75. const w = window.innerWidth
  76. const h = window.innerHeight - 96
  77. return {w, h}
  78. }
  79. </script>
  80. <style lang="scss">
  81. ::-webkit-scrollbar {
  82. width: 6px;
  83. &:hover {
  84. cursor: pointer;
  85. }
  86. }
  87. ::-webkit-scrollbar-thumb {
  88. border-radius: 4px;
  89. background: rgba(144, 147, 153, .3);
  90. &:hover {
  91. cursor: pointer;
  92. }
  93. }
  94. ::-webkit-scrollbar-button {
  95. width: 0;
  96. height: 0;
  97. display: none;
  98. }
  99. html,
  100. body,
  101. #app {
  102. height: 100%;
  103. margin: 0;
  104. padding: 0;
  105. background-color: #f5f5f5;
  106. }
  107. ul, li {
  108. list-style: none;
  109. margin: 0;
  110. padding: 0;
  111. }
  112. .小手指 {
  113. cursor: pointer;
  114. }
  115. .xc_box {
  116. box-shadow: 0 4px 8px rgb(0 0 0 / 20%), 0 6px 20px rgb(0 0 0 / 19%);
  117. }
  118. #app {
  119. font-family: Avenir, Helvetica, Arial, sans-serif;
  120. -webkit-font-smoothing: antialiased;
  121. -moz-osx-font-smoothing: grayscale;
  122. color: #2c3e50;
  123. width: 100%;
  124. height: 100vh;
  125. font-size: 13px;
  126. }
  127. .ellipsis-text {
  128. text-overflow: ellipsis;
  129. white-space: nowrap;
  130. overflow: hidden;
  131. }
  132. .sex-icon {
  133. width: 15px;
  134. height: 15px;
  135. }
  136. .el-table .cell {
  137. padding-left: 4px;
  138. padding-right: 4px;
  139. }
  140. .el-header {
  141. padding: 0 14px;
  142. height: 36px;
  143. display: flex;
  144. align-items: center;
  145. justify-content: flex-start;
  146. }
  147. .el-header > * {
  148. flex-wrap: nowrap;
  149. flex-shrink: 0;
  150. flex-grow: 0;
  151. }
  152. .el-main {
  153. padding: 0 14px;
  154. overflow: hidden;
  155. }
  156. .el-table__body tr.current-row > td,
  157. .el-table--striped .el-table__body tr.el-table__row--striped.current-row td {
  158. background-color: #a7d3ff !important;
  159. }
  160. .el-input.is-disabled .el-input__inner {
  161. color: blue;
  162. }
  163. .icon-shangxiatuodong {
  164. cursor: move;
  165. font-size: 12px;
  166. }
  167. .shangxiatuodong {
  168. cursor: move;
  169. }
  170. .el-checkbox__inner {
  171. width: 16px;
  172. height: 16px;
  173. border: 1px solid #000;
  174. border-radius: 4px;
  175. }
  176. .axios-loading2 {
  177. animation: axiosloading 1s;
  178. background-image: url('/src/assets/images/loading.gif');
  179. -webkit-background-image: url('/src/assets/images/loading.gif');
  180. background-repeat: no-repeat;
  181. background-position: center;
  182. }
  183. .el-dialog__header {
  184. border-bottom: 1px solid #ebeef5;
  185. background-color: #f8f8f8;
  186. border-radius: 4px;
  187. }
  188. .el-dialog {
  189. border-radius: 4px;
  190. }
  191. @keyframes axiosloading {
  192. 0% {
  193. opacity: 0;
  194. }
  195. 99% {
  196. opacity: 0;
  197. }
  198. 100% {
  199. opacity: 1;
  200. }
  201. }
  202. .component-box-wrapper__fullscreen {
  203. position: fixed;
  204. top: 0;
  205. left: 0;
  206. bottom: 0;
  207. right: 0;
  208. background: white;
  209. padding: 20px;
  210. z-index: 10000;
  211. height: 100%;
  212. overflow: auto;
  213. }
  214. .component-box-wrapper__half-transparent {
  215. position: fixed;
  216. top: 0;
  217. left: 0;
  218. bottom: 0;
  219. right: 0;
  220. background: rgba(0, 0, 0, 0.7);
  221. padding: 20px;
  222. z-index: 1000;
  223. height: 100%;
  224. overflow: auto;
  225. display: flex;
  226. align-items: flex-start;
  227. justify-content: center;
  228. }
  229. .finger:hover {
  230. cursor: pointer;
  231. }
  232. .component-content-box__dialog-like {
  233. width: 60%;
  234. padding: 20px;
  235. background: white;
  236. margin-top: 15vh;
  237. }
  238. .component-header-box {
  239. position: relative;
  240. width: 100%;
  241. display: flex;
  242. padding: 0 0 12px 0;
  243. }
  244. .component-header__title {
  245. width: 70%;
  246. font-size: 16px;
  247. display: flex;
  248. align-items: center;
  249. }
  250. .component-header__close-button {
  251. width: 30%;
  252. text-align: right;
  253. }
  254. table th.star div::before {
  255. content: '*';
  256. color: #f56c6cff;
  257. margin-right: 4px;
  258. }
  259. .bi_tian .el-form-item__label::before {
  260. content: '*';
  261. color: #f56c6cff;
  262. margin-right: 4px;
  263. }
  264. .el-select-dropdown__item.selected {
  265. background-color: #71abed66;
  266. }
  267. .el-select-dropdown__item.hover,
  268. .el-select-dropdown__item:hover {
  269. background-color: #fac44d;
  270. color: white;
  271. }
  272. .el-message {
  273. border: none;
  274. border-radius: 2px;
  275. background-color: white;
  276. padding: 10px 16px;
  277. box-shadow: 1px 3px 8px 4px rgb(0 0 0 / 10%);
  278. .el-message__content {
  279. color: #333333;
  280. }
  281. }
  282. .el-table .el_table__current {
  283. background-color: #a7d3ff;
  284. }
  285. .remove_hover tbody tr:hover > td {
  286. background-color: transparent !important;
  287. }
  288. input[type=number] {
  289. -moz-appearance: textfield;
  290. }
  291. input[type=number]::-webkit-inner-spin-button,
  292. input[type=number]::-webkit-outer-spin-button {
  293. -webkit-appearance: none;
  294. margin: 0;
  295. }
  296. </style>