血透系统PC前端

bulletinBoard.vue 10KB

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