血透系统PC前端

bulletinBoard.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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. var xtuser = this.$store.getters.xt_user
  157. this.orgname = xtuser.org.org_name;
  158. // this.orgname = "遂溪方济医院";
  159. this.modeOptions = this.$store.getters.treatment_mode;
  160. this.initData();
  161. },
  162. methods: {
  163. fullscreenboard: function() {
  164. this.dialogTableVisible = true;
  165. // let routeData = this.$router.resolve({ path: '/fullscreenboard' })
  166. // window.open(routeData.href, '_blank')
  167. },
  168. outfullscreenboard:function(){
  169. this.dialogTableVisible = false;
  170. this.showSetting = false;
  171. },
  172. togglefullscreen:function(){
  173. if (!screenfull.enabled) {
  174. this.$message({
  175. message: '你的浏览器不支持',
  176. type: 'warning'
  177. })
  178. return false
  179. }
  180. screenfull.toggle();
  181. this.showSetting = false;
  182. },
  183. openSetting(){
  184. if(this.showSetting==false) {
  185. this.showSetting = true;
  186. }else {
  187. this.showSetting=false
  188. }
  189. },
  190. initData:function() {
  191. var _this = this;
  192. var timeOut = this.showTime * 1000;
  193. this.currentPage++;
  194. this.getBoards();
  195. setTimeout(function(){
  196. _this.initData();
  197. }, timeOut);
  198. },
  199. getBoards:function(){
  200. getBoards(this.currentPage).then(response=>{
  201. this.loading = false;
  202. var r = response.data;
  203. if (r.state == 0) {
  204. this.$message.error(r.msg);
  205. return false;
  206. } else {
  207. if(r.data.boards.length==0) {
  208. this.currentPage = 1;
  209. this.getBoards();
  210. }else {
  211. this.today = r.data.today;
  212. this.week = (r.data.week in this.weekDay)?this.weekDay[r.data.week]:'--';
  213. this.boardData = r.data.boards;
  214. }
  215. }
  216. })
  217. },
  218. modeName:function(mode_id) {
  219. return (mode_id in this.modeOptions)? this.modeOptions[mode_id].name:'';
  220. },
  221. boradData:function(record) {
  222. if(record.dialysis_order) {
  223. if(record.dialysis_order.stage == 2) {
  224. return '已下机';
  225. }else {
  226. return '透析中';
  227. }
  228. }else if(record.sign) {
  229. return '已签到';
  230. }else {
  231. return '未签到';
  232. }
  233. },
  234. nextSchedule:function(nextlist){
  235. if(nextlist.length==0) {
  236. return '——';
  237. }
  238. var dayTime = parseTime(nextlist[0].schedule_date, '{m}月{d}日');
  239. var noon = (nextlist[0].schedule_type in this.roonOptions) ? ' ' + this.roonOptions[nextlist[0].schedule_type]:'';
  240. return dayTime + noon;
  241. }
  242. }
  243. }
  244. </script>
  245. <style lang="scss" scoped>
  246. .board-right-menu-item{
  247. float: right !important;
  248. }
  249. .el-menu--horizontal>.el-menu-item {
  250. color: #000 !important;
  251. }
  252. .el-menu--horizontal {
  253. border-bottom: 0px !important;
  254. }
  255. </style>
  256. <style >
  257. #fullscreenbroad {
  258. position: fixed;
  259. top: 0;
  260. right: 0;
  261. bottom: 0;
  262. left: 0;
  263. overflow: auto;
  264. margin: 0;
  265. background: #fff;
  266. padding:20px;
  267. /* width: 100%;
  268. margin-top: 0;
  269. margin-bottom: 0;
  270. height: 100%;
  271. overflow: auto; */
  272. }
  273. #fullscreenbroad #fullscreenbroad-setting {
  274. float: right;
  275. }
  276. #fullscreenbroad {
  277. z-index: 9999 !important;
  278. }
  279. #fullscreenbroad .el-button+.el-button {
  280. margin-left: 0px;
  281. }
  282. #fullscreenbroad .el-button:nth-child(1) {
  283. margin-left: 10px;
  284. }
  285. #fullscreenbroad .el-button:nth-child(2) {
  286. margin-left: 10px;
  287. }
  288. #fullscreenbroad .el-menu-item{
  289. font-size: 30px !important;
  290. }
  291. #fullscreenbroad .board-right-menu-item{
  292. font-size: 20px !important;
  293. }
  294. #fullscreenbroad .el-table th>.cell {
  295. font-size: 20px !important;
  296. }
  297. #fullscreenbroad .el-table .cell{
  298. font-size: 20px !important;
  299. }
  300. </style>