App.vue 7.4 KB

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