血透系统PC前端

bulletinBoard.vue 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button
  6. size="small"
  7. icon="el-icon-menu"
  8. @click="fullscreenboard"
  9. type="primary"
  10. >全屏投影</el-button
  11. >
  12. </div>
  13. <div
  14. class="app-container"
  15. id="dialysis-board-box"
  16. v-loading="loading"
  17. element-loading-text="加载中"
  18. >
  19. <el-menu class="el-menu-demo" mode="horizontal">
  20. <el-menu-item>{{ orgname }}</el-menu-item>
  21. <el-menu-item :class="rightItem">{{ week }}</el-menu-item>
  22. <el-menu-item :class="rightItem">{{ today }}</el-menu-item>
  23. </el-menu>
  24. <el-table
  25. id="board-table-data"
  26. :data="boardData"
  27. border
  28. :row-style="{ color: '#303133' }"
  29. :header-cell-style="{
  30. backgroundColor: 'rgb(245, 247, 250)',
  31. color: '#606266'
  32. }"
  33. style="width: 100%"
  34. >
  35. <el-table-column align="center" prop="date" label="姓名" width="180">
  36. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  37. </el-table-column>
  38. <el-table-column align="center" prop="name" label="透析号" width="180">
  39. <template slot-scope="scope">{{
  40. scope.row.patient.dialysis_no
  41. }}</template>
  42. </el-table-column>
  43. <el-table-column align="center" prop="address" label="模式">
  44. <template slot-scope="scope">{{
  45. modeName(scope.row.mode_id)
  46. }}</template>
  47. </el-table-column>
  48. <el-table-column align="center" prop="address" label="分区">
  49. <template slot-scope="scope">{{
  50. scope.row.device_zone ? scope.row.device_zone.name : ""
  51. }}</template>
  52. </el-table-column>
  53. <el-table-column align="center" prop="address" label="床位">
  54. <template slot-scope="scope">{{
  55. scope.row.device_number ? scope.row.device_number.number : ""
  56. }}</template>
  57. </el-table-column>
  58. <el-table-column align="center" prop="address" label="状态">
  59. <template slot-scope="scope">{{ boradData(scope.row) }}</template>
  60. </el-table-column>
  61. <el-table-column align="center" prop="address" label="下次透析时间">
  62. <template slot-scope="scope">{{
  63. nextSchedule(scope.row.next_schedules)
  64. }}</template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. <div id="fullscreenbroad" v-show="dialogTableVisible">
  69. <el-row>
  70. <el-button
  71. @click="openSetting"
  72. icon="el-icon-setting"
  73. circle
  74. id="fullscreenbroad-setting"
  75. ></el-button>
  76. <el-button
  77. type="primary"
  78. icon="el-icon-rank"
  79. v-if="showSetting"
  80. id="fullscreenbroad-setting"
  81. @click="togglefullscreen"
  82. >切换模式</el-button
  83. >
  84. <el-button
  85. type="primary"
  86. icon="el-icon-menu"
  87. v-if="showSetting"
  88. id="fullscreenbroad-setting"
  89. @click="outfullscreenboard"
  90. >退出全屏投影</el-button
  91. >
  92. </el-row>
  93. <el-menu class="el-menu-demo" mode="horizontal">
  94. <el-menu-item>{{ orgname }}</el-menu-item>
  95. <el-menu-item :class="rightItem">{{ week }}</el-menu-item>
  96. <el-menu-item :class="rightItem">{{ today }}</el-menu-item>
  97. </el-menu>
  98. <el-table
  99. :data="boardData"
  100. border
  101. style="width: 100%"
  102. :row-style="{ color: '#303133' }"
  103. :header-cell-style="{
  104. backgroundColor: 'rgb(245, 247, 250)',
  105. color: '#606266'
  106. }"
  107. >
  108. <el-table-column align="center" prop="date" label="姓名" width="180">
  109. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  110. </el-table-column>
  111. <el-table-column align="center" prop="name" label="透析号" width="180">
  112. <template slot-scope="scope">{{
  113. scope.row.patient.dialysis_no
  114. }}</template>
  115. </el-table-column>
  116. <el-table-column align="center" prop="address" label="模式">
  117. <template slot-scope="scope">{{
  118. modeName(scope.row.mode_id)
  119. }}</template>
  120. </el-table-column>
  121. <el-table-column align="center" prop="address" label="分区">
  122. <template slot-scope="scope">{{
  123. scope.row.device_zone ? scope.row.device_zone.name : ""
  124. }}</template>
  125. </el-table-column>
  126. <el-table-column align="center" prop="address" label="床位">
  127. <template slot-scope="scope">{{
  128. scope.row.device_number ? scope.row.device_number.number : ""
  129. }}</template>
  130. </el-table-column>
  131. <el-table-column align="center" prop="address" label="状态">
  132. <template slot-scope="scope">{{ boradData(scope.row) }}</template>
  133. </el-table-column>
  134. <el-table-column align="center" prop="address" label="下次透析时间">
  135. <template slot-scope="scope">{{
  136. nextSchedule(scope.row.next_schedules)
  137. }}</template>
  138. </el-table-column>
  139. </el-table>
  140. </div>
  141. </div>
  142. </template>
  143. <script>
  144. import { getBoards } from '@/api/board'
  145. import bulletinboard from './components/bulletinboard'
  146. import { parseTime } from '@/utils'
  147. import BreadCrumb from '../components/bread-crumb'
  148. import screenfull from 'screenfull'
  149. export default {
  150. components: { BreadCrumb, bulletinboard },
  151. name: 'bulletinBoard',
  152. data() {
  153. return {
  154. dialogTableVisible: false,
  155. showSetting: false,
  156. crumbs: [
  157. { path: false, name: '透析管理' },
  158. { path: 'dialysis/board', name: '数据看板' }
  159. ],
  160. orgname: '',
  161. today: '今天',
  162. week: '--',
  163. timer: null,
  164. rightItem: 'board-right-menu-item',
  165. boardData: [],
  166. showTime: 120,
  167. currentPage: 0,
  168. loading: true,
  169. weekDay: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  170. roonOptions: { 1: '上午', 2: '下午', 3: '晚上' },
  171. modeOptions: {}
  172. }
  173. },
  174. created() {
  175. var xtuser = this.$store.getters.xt_user
  176. this.orgname = xtuser.org.org_name
  177. // this.orgname = "遂溪方济医院";
  178. this.modeOptions = this.$store.getters.treatment_mode
  179. this.initData()
  180. }, beforeDestroy() {
  181. clearInterval(this.timer)
  182. this.timer = null
  183. this.$once('hook:beforeDestroy', () => {
  184. clearInterval(this.timer)
  185. })
  186. },
  187. methods: {
  188. fullscreenboard: function() {
  189. this.dialogTableVisible = true
  190. // let routeData = this.$router.resolve({ path: '/fullscreenboard' })
  191. // window.open(routeData.href, '_blank')
  192. },
  193. outfullscreenboard: function() {
  194. this.dialogTableVisible = false
  195. this.showSetting = false
  196. },
  197. togglefullscreen: function() {
  198. if (!screenfull.enabled) {
  199. this.$message({
  200. message: '你的浏览器不支持',
  201. type: 'warning'
  202. })
  203. return false
  204. }
  205. screenfull.toggle()
  206. this.showSetting = false
  207. },
  208. openSetting() {
  209. if (this.showSetting == false) {
  210. this.showSetting = true
  211. } else {
  212. this.showSetting = false
  213. }
  214. },
  215. initData: function() {
  216. var _this = this
  217. var timeOut = this.showTime * 1000
  218. this.currentPage++
  219. this.getBoards()
  220. this.timer = window.setInterval(() => {
  221. setTimeout(this.getBoards(), 0)
  222. }, 120000)
  223. },
  224. getBoards: function() {
  225. getBoards(this.currentPage).then(response => {
  226. this.loading = false
  227. var r = response.data
  228. if (r.state == 0) {
  229. this.$message.error(r.msg)
  230. return false
  231. } else {
  232. if (r.data.boards.length == 0) {
  233. this.currentPage = 1
  234. // this.getBoards()
  235. } else {
  236. this.today = r.data.today
  237. this.week =
  238. r.data.week in this.weekDay ? this.weekDay[r.data.week] : '--'
  239. this.boardData = r.data.boards
  240. }
  241. }
  242. })
  243. },
  244. modeName: function(mode_id) {
  245. return mode_id in this.modeOptions ? this.modeOptions[mode_id].name : ''
  246. },
  247. boradData: function(record) {
  248. if (record.dialysis_order) {
  249. if (record.dialysis_order.stage == 2) {
  250. return '已下机'
  251. } else {
  252. return '透析中'
  253. }
  254. } else if (record.sign) {
  255. return '已签到'
  256. } else {
  257. return '未签到'
  258. }
  259. },
  260. nextSchedule: function(nextlist) {
  261. if (nextlist.length == 0) {
  262. return '——'
  263. }
  264. var dayTime = parseTime(nextlist[0].schedule_date, '{m}月{d}日')
  265. var noon =
  266. nextlist[0].schedule_type in this.roonOptions
  267. ? ' ' + this.roonOptions[nextlist[0].schedule_type]
  268. : ''
  269. return dayTime + noon
  270. }
  271. }
  272. }
  273. </script>
  274. <style lang="scss" scoped>
  275. .board-right-menu-item {
  276. float: right !important;
  277. }
  278. .el-menu--horizontal > .el-menu-item {
  279. color: #000 !important;
  280. }
  281. .el-menu--horizontal {
  282. border-bottom: 0px !important;
  283. }
  284. </style>
  285. <style>
  286. #fullscreenbroad {
  287. position: fixed;
  288. top: 0;
  289. right: 0;
  290. bottom: 0;
  291. left: 0;
  292. overflow: auto;
  293. margin: 0;
  294. background: #fff;
  295. padding: 20px;
  296. /* width: 100%;
  297. margin-top: 0;
  298. margin-bottom: 0;
  299. height: 100%;
  300. overflow: auto; */
  301. }
  302. #fullscreenbroad #fullscreenbroad-setting {
  303. float: right;
  304. }
  305. #fullscreenbroad {
  306. z-index: 9999 !important;
  307. }
  308. #fullscreenbroad .el-button + .el-button {
  309. margin-left: 0px;
  310. }
  311. #fullscreenbroad .el-button:nth-child(1) {
  312. margin-left: 10px;
  313. }
  314. #fullscreenbroad .el-button:nth-child(2) {
  315. margin-left: 10px;
  316. }
  317. #fullscreenbroad .el-menu-item {
  318. font-size: 30px !important;
  319. }
  320. #fullscreenbroad .board-right-menu-item {
  321. font-size: 20px !important;
  322. }
  323. #fullscreenbroad .el-table th > .cell {
  324. font-size: 20px !important;
  325. }
  326. #fullscreenbroad .el-table .cell {
  327. font-size: 20px !important;
  328. }
  329. .el-table td,
  330. .el-table th.is-leaf,
  331. .el-table--border,
  332. .el-table--group {
  333. border-color: #d0d3da;
  334. }
  335. .el-table--border::after,
  336. .el-table--group::after,
  337. .el-table::before {
  338. background-color: #d0d3da;
  339. }
  340. </style>