Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

monitor.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="page_process">
  8. <new-nav activeName="monitor"></new-nav>
  9. <div class="cell clearfix">
  10. <el-form :inline="true">
  11. <el-form-item label>
  12. <el-autocomplete
  13. class="checkSearch"
  14. popper-class="my-autocomplete"
  15. v-model="search_value"
  16. :fetch-suggestions="querySearchAsync"
  17. :trigger-on-focus="false"
  18. placeholder="请输入病人名字"
  19. @select="handleSelect"
  20. >
  21. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  22. <template slot-scope="{ item }">
  23. <div class="name">{{ item.name }}</div>
  24. </template>
  25. </el-autocomplete>
  26. </el-form-item>
  27. </el-form>
  28. <el-select v-model="query.statistics_type" placeholder="请选择" style="width:110px;margin-right:10px" @change="changeProject">
  29. <el-option
  30. v-for="item in options"
  31. :key="item.value"
  32. :label="item.name"
  33. :value="item.value"
  34. ></el-option>
  35. </el-select>
  36. <label class="title">
  37. <span class="name">日期查询</span> :
  38. </label>
  39. <el-date-picker
  40. v-model="query.start_time"
  41. prefix-icon="el-icon-date"
  42. @change="changeTime"
  43. :editable="false"
  44. style="width: 150px;"
  45. type="date"
  46. :picker-options="pickerOptions"
  47. placeholder="选择日期时间"
  48. align="right"
  49. format="yyyy-MM-dd"
  50. value-format="yyyy-MM-dd"
  51. ></el-date-picker>
  52. <span class>-</span>
  53. <el-date-picker
  54. v-model="query.end_time"
  55. prefix-icon="el-icon-date"
  56. @change="changeEndTime"
  57. :editable="false"
  58. :picker-options="pickerOptions"
  59. style="width: 150px;"
  60. type="date"
  61. placeholder="选择日期时间"
  62. align="right"
  63. format="yyyy-MM-dd"
  64. value-format="yyyy-MM-dd"
  65. ></el-date-picker>
  66. </div>
  67. <el-container>
  68. <div style="width:150px">
  69. <div class="tableTitle">患者列表</div>
  70. <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500" :row-style="{ color: '#303133' }"
  71. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  72. highlight-current-row
  73. @current-change="handleChange">
  74. <el-table-column prop="dialysis_no" label="透析号" width="80">
  75. <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
  76. </el-table-column>
  77. <el-table-column prop="name" label="姓名" width="80">
  78. <template slot-scope="scope">{{ scope.row.name }}</template>
  79. </el-table-column>
  80. </el-table>
  81. </div>
  82. <div style="padding-left:10px;flex:1;width:0;">
  83. <div class="tableTitle">指标趋势</div>
  84. <div>
  85. <line-chart :options="chart"></line-chart>
  86. </div>
  87. <div class="tableTitle">统计表</div>
  88. <div>
  89. <el-table :data="tableData" style="width: 100%" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  90. <el-table-column fixed width="100" label="监测时间" align="center">
  91. <template slot-scope="scope">
  92. <!--{{getTime(scope.row.operate_time)}}-->
  93. {{scope.row.operate_time | parseTime("{y}-{m}-{d} {h}:{i}") }}
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="收缩压" align="center">
  97. <template slot-scope="scope">
  98. {{scope.row.systolic_blood_pressure?scope.row.systolic_blood_pressure:''}}
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="舒张压" align="center">
  102. <template slot-scope="scope">
  103. {{scope.row.diastolic_blood_pressure?scope.row.diastolic_blood_pressure:''}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="脉搏" align="center">
  107. <template slot-scope="scope">
  108. {{scope.row.pulse_frequency?scope.row.pulse_frequency:''}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="呼吸" align="center">
  112. <template slot-scope="scope">
  113. {{scope.row.breathing_rate?scope.row.breathing_rate:''}}
  114. </template>
  115. </el-table-column>
  116. <el-table-column label="体温" align="center">
  117. <template slot-scope="scope">
  118. {{ scope.row.temperature?scope.row.temperature:''}}
  119. </template>
  120. </el-table-column>
  121. <el-table-column label="血流量" align="center">
  122. <template slot-scope="scope">
  123. {{ scope.row.blood_flow_volume?scope.row.blood_flow_volume:''}}
  124. </template>
  125. </el-table-column>
  126. <el-table-column label="静脉压" align="center">
  127. <template slot-scope="scope">
  128. {{ scope.row.venous_pressure?scope.row.venous_pressure:''}}
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="动脉压" align="center">
  132. <template slot-scope="scope">
  133. {{ scope.row.arterial_pressure?scope.row.arterial_pressure:''}}
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="跨膜压" align="center">
  137. <template slot-scope="scope">
  138. {{ scope.row.transmembrane_pressure?scope.row.transmembrane_pressure:''}}
  139. </template>
  140. </el-table-column>
  141. <el-table-column width="110" label="透析液温度" align="center">
  142. <template slot-scope="scope">
  143. {{ scope.row.dialysate_temperature?scope.row.dialysate_temperature:''}}
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="超滤率" align="center">
  147. <template slot-scope="scope">
  148. {{ scope.row.ultrafiltration_rate?scope.row.ultrafiltration_rate:''}}
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="超滤量" align="center">
  152. <template slot-scope="scope">
  153. {{ scope.row.ultrafiltration_volume?scope.row.ultrafiltration_volume:''}}
  154. </template>
  155. </el-table-column>
  156. </el-table>
  157. <el-pagination
  158. align="right"
  159. @size-change="handleSizeChange"
  160. @current-change="handleCurrentChange"
  161. :current-page="query.page"
  162. :page-sizes="[10, 20, 50, 100]"
  163. :page-size="10"
  164. background
  165. style="margin-top:20px;"
  166. layout="total, sizes, prev, pager, next, jumper"
  167. :total="total"
  168. ></el-pagination>
  169. </div>
  170. </div>
  171. </el-container>
  172. </div>
  173. </div>
  174. </div>
  175. </template>
  176. <script>
  177. import echarts from 'echarts'
  178. import NewNav from '../indicatorControlAnalysis/components/NewNav'
  179. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  180. import LineChart from '../../qcd/components/LineChart'
  181. import { getCurrentOrgPatients } from "@/api/common/common";
  182. import {
  183. GetDefalutPatient,
  184. GetDialysisWatchChartData,
  185. GetDialysisWatchTableData
  186. } from '@/api/common/statistics'
  187. import {
  188. PostSearch
  189. } from '@/api/patient'
  190. import { uParseTime } from "@/utils/tools";
  191. import { getDataConfig } from "@/utils/data";
  192. export default {
  193. components: {
  194. LineChart,
  195. BreadCrumb,
  196. NewNav
  197. },
  198. data() {
  199. return {
  200. pickerOptions: {
  201. disabledDate(time) {
  202. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
  203. return time.getTime() > Date.now() || time.getTime() < threeMonths;;
  204. }
  205. },
  206. patientsData:[],
  207. loading: false,
  208. search_value: '',
  209. total: 0,
  210. query: {
  211. patient_id: '',
  212. statistics_type: 1,
  213. start_time: '',
  214. end_time: '',
  215. limit: 10,
  216. page: 1
  217. },
  218. options: [
  219. { value: 1, name: '收缩压' },
  220. { value: 2, name: '舒张压' },
  221. { value: 3, name: '脉搏' },
  222. { value: 4, name: '呼吸' },
  223. { value: 5, name: '体温' },
  224. { value: 6, name: '血流量' },
  225. { value: 7, name: '静脉压' },
  226. { value: 8, name: '动脉压' },
  227. { value: 9, name: '跨膜压' },
  228. { value: 10, name: '透析液温度' },
  229. { value: 11, name: '超滤率' },
  230. { value: 12, name: '超滤量' },
  231. ],
  232. crumbs: [
  233. { path: false, name: '质控管理' },
  234. { path: false, name: '指标评估统计' },
  235. { path: false, name: '透析过程指标统计' }
  236. ],
  237. tableData: [],
  238. tableData1: [],
  239. chart: {
  240. title: {
  241. text: 'ECharts 入门示例'
  242. },
  243. tooltip: {},
  244. legend: {
  245. data: [],
  246. left: 0
  247. },
  248. xAxis: {
  249. data: []
  250. },
  251. yAxis: {
  252. axisLabel: {
  253. formatter: '{value} %'
  254. },
  255. show: false
  256. },
  257. series: [
  258. {
  259. name: '',
  260. type: 'line',
  261. data: [],
  262. barWidth: 30,
  263. label: {
  264. normal: {
  265. show: true,
  266. position: 'top',
  267. formatter: '{c}'
  268. }
  269. },
  270. //配置样式
  271. itemStyle: {
  272. //通常情况下:
  273. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  274. normal: {
  275. color: function(params) {
  276. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  277. var colorList = [
  278. ['#A9E0F3', '#9FBDFC'],
  279. ['#FFD7C0', '#FF9994']
  280. ]
  281. var index = params.dataIndex
  282. if (params.dataIndex >= colorList.length) {
  283. index = params.dataIndex % colorList.length
  284. }
  285. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  286. { offset: 0, color: colorList[index][0] },
  287. // { offset: 0.5, color: colorList[index][1] },
  288. { offset: 1, color: colorList[index][1] }
  289. ])
  290. },
  291. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  292. },
  293. //鼠标悬停时:
  294. emphasis: {
  295. shadowBlur: 10,
  296. shadowOffsetX: 0,
  297. shadowColor: 'rgba(0, 0, 0, 0.5)'
  298. }
  299. }
  300. }
  301. ]
  302. },
  303. bar: {
  304. title: {
  305. text: 'ECharts 入门示例'
  306. },
  307. tooltip: {},
  308. legend: {
  309. data: [],
  310. left: 0
  311. },
  312. xAxis: {
  313. data: []
  314. },
  315. yAxis: {
  316. axisLabel: {
  317. formatter: '{value} %'
  318. },
  319. show: false
  320. },
  321. series: [
  322. {
  323. name: '',
  324. type: 'bar',
  325. data: [],
  326. barWidth: 30,
  327. label: {
  328. normal: {
  329. show: true,
  330. position: 'top',
  331. formatter: '{c}次'
  332. }
  333. },
  334. //配置样式
  335. itemStyle: {
  336. //通常情况下:
  337. //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
  338. normal: {
  339. color: function(params) {
  340. //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
  341. var colorList = [
  342. ['#A9E0F3', '#9FBDFC'],
  343. ['#FFD7C0', '#FF9994']
  344. ]
  345. var index = params.dataIndex
  346. if (params.dataIndex >= colorList.length) {
  347. index = params.dataIndex % colorList.length
  348. }
  349. return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  350. { offset: 0, color: colorList[index][0] },
  351. // { offset: 0.5, color: colorList[index][1] },
  352. { offset: 1, color: colorList[index][1] }
  353. ])
  354. },
  355. barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
  356. },
  357. //鼠标悬停时:
  358. emphasis: {
  359. shadowBlur: 10,
  360. shadowOffsetX: 0,
  361. shadowColor: 'rgba(0, 0, 0, 0.5)'
  362. }
  363. }
  364. }
  365. ],
  366. dataZoom: [
  367. {
  368. // Y轴固定,让内容滚动
  369. type: 'slider',
  370. show: false,
  371. xAxisIndex: [0],
  372. start: 1,
  373. end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
  374. zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
  375. },
  376. {
  377. type: 'inside',
  378. xAxisIndex: [0],
  379. start: 1,
  380. end: 20,
  381. zoomLock: true // 锁定区域禁止缩放
  382. }
  383. ]
  384. }
  385. }
  386. },
  387. methods: {
  388. changeProject(val){
  389. this.query.statistics_type = val
  390. this.query.page = 1
  391. this.GetDialysisWatchChartData(this.query)
  392. },
  393. handleChange(val){
  394. this.query.patient_id = val.id
  395. this.query.page = 1
  396. this.GetDialysisWatchTableData(this.query)
  397. this.GetDialysisWatchChartData(this.query)
  398. },
  399. handleSizeChange(limit) {
  400. this.query.limit = limit;
  401. this.GetDialysisWatchTableData(this.query)
  402. },
  403. handleCurrentChange(page) {
  404. this.query.page = page;
  405. this.GetDialysisWatchTableData(this.query)
  406. },
  407. changeTime(val) {
  408. var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time);
  409. if (time > 0) {
  410. this.$message.error("结束时间不能小于开始时间");
  411. this.query.start_time = "";
  412. } else {
  413. // this.getDialysisList()
  414. this.query.page = 1;
  415. this.GetDialysisWatchChartData(this.query)
  416. this.GetDialysisWatchTableData(this.query)
  417. }
  418. },
  419. changeEndTime(val) {
  420. var time =
  421. this.getTimestamp(val) - this.getTimestamp(this.query.start_time);
  422. if (time < 0) {
  423. this.$message.error("结束时间不能小于开始时间");
  424. this.query.end_time = "";
  425. } else {
  426. this.query.page = 1;
  427. this.GetDialysisWatchChartData(this.query)
  428. this.GetDialysisWatchTableData(this.query)
  429. }
  430. },
  431. getTimestamp(time) {
  432. // 把时间日期转成时间戳
  433. return new Date(time).getTime() / 1000;
  434. },
  435. QueryOperaById: function(val) {
  436. let vascular_access_desc_name = "";
  437. let vascular_access_desc = getDataConfig(
  438. "hemodialysis",
  439. "vascular_access_desc"
  440. );
  441. for (let i = 0; i < vascular_access_desc.length; i++) {
  442. if (vascular_access_desc[i].id == val) {
  443. vascular_access_desc_name = vascular_access_desc[i].name;
  444. }
  445. }
  446. return vascular_access_desc_name;
  447. },
  448. GetAnticoagulantById: function (val) {
  449. let anticoagulan_name = ''
  450. var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
  451. let anticoagulant = anticoagulantsConfitTwo
  452. for (let keys in anticoagulant) {
  453. if (anticoagulant[keys].id == val) {
  454. anticoagulan_name = anticoagulant[keys].name
  455. }
  456. }
  457. return anticoagulan_name
  458. },
  459. getModeName(mode_id){
  460. return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name: ""
  461. }, GetDialysisWatchTableData(params) {
  462. this.loading = true
  463. this.tableData = []
  464. GetDialysisWatchTableData(params)
  465. .then(rs => {
  466. var resp = rs.data
  467. if (resp.state == 1) {
  468. this.loading = false
  469. for (let i = 0; i < resp.data.data.length; i++) {
  470. this.tableData.push(resp.data.data[i])
  471. }
  472. this.total = resp.data.total
  473. } else {
  474. this.loading = false
  475. }
  476. })
  477. .catch(error => {
  478. })
  479. },
  480. GetDialysisWatchChartData(params) {
  481. this.chart.xAxis.data = []
  482. this.chart.series[0].data = []
  483. this.bar.xAxis.data = []
  484. this.bar.series[0].data = []
  485. GetDialysisWatchChartData(params)
  486. .then(rs => {
  487. var resp = rs.data
  488. if (resp.state == 1) {
  489. for (let i = 0; i < resp.data.data.length; i++) {
  490. this.chart.xAxis.data.push(resp.data.data[i].date)
  491. this.chart.series[0].data.push(resp.data.data[i].value)
  492. }
  493. this.getArrLength(this.chart.xAxis.data)
  494. } else {
  495. }
  496. })
  497. .catch(error => {
  498. })
  499. },
  500. handleSelect(val) {
  501. this.query.patient_id = val.id
  502. this.query.page = 1
  503. this.GetDialysisWatchTableData(this.query)
  504. this.GetDialysisWatchChartData(this.query)
  505. for (let i = 0;i < this.patientsData.length; i++){
  506. if (this.patientsData[i].id == val.id){
  507. this.$refs.table.setCurrentRow(this.patientsData[i])
  508. }
  509. }
  510. },
  511. querySearchAsync(keyword, cb) {
  512. let key = ''
  513. if (keyword != undefined) {
  514. key = keyword
  515. }
  516. let searchArray = []
  517. PostSearch(key).then(response => {
  518. if (response.data.state == 1) {
  519. searchArray = response.data.data.patient
  520. cb(searchArray)
  521. } else {
  522. cb([])
  523. }
  524. })
  525. },
  526. chooseWay(way) {
  527. this.wayType = way
  528. }, getCurrentOrgPatients(){
  529. getCurrentOrgPatients().then(response=>{
  530. if(response.data.state == 1){
  531. var patients = response.data.data.patients
  532. this.patientsData = patients
  533. this.GetDefaultPatient()
  534. }
  535. })
  536. }, GetDefaultPatient() {
  537. GetDefalutPatient().then(response => {
  538. if (response.data.state == 1) {
  539. var patient = response.data.data.patient
  540. for (let i = 0;i < this.patientsData.length; i++){
  541. if (this.patientsData[i].id == patient.id){
  542. this.$refs.table.setCurrentRow(this.patientsData[i])
  543. }
  544. }
  545. }
  546. })
  547. },
  548. getArrLength(result){
  549. if(result.length > 10){
  550. var dataZoom_end = (10/result.length)*100;
  551. this.chart.dataZoom[0].end = dataZoom_end
  552. }else{
  553. var dataZoom_end = 100;
  554. this.chart.dataZoom[0].end = dataZoom_end
  555. }
  556. }
  557. }, created() {
  558. var date = new Date()
  559. var year = date.getFullYear() //获取完整的年份(4位)
  560. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  561. var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
  562. var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
  563. this.query.patient_id = 0
  564. this.query.end_time = year + '-' + month + '-' + day
  565. this.query.start_time = year + '-' + last_month + '-' + day
  566. this.query.statistics_type = 1
  567. this.GetDialysisWatchChartData(this.query)
  568. this.GetDialysisWatchTableData(this.query)
  569. this.getCurrentOrgPatients()
  570. }
  571. }
  572. </script>
  573. <style lang="scss" scoped>
  574. .tableTitle {
  575. font-size: 16px;
  576. color: #000;
  577. font-weight: bold;
  578. margin-bottom: 10px;
  579. }
  580. </style>
  581. <style lang="scss">
  582. .page_process {
  583. .el-button--medium {
  584. padding: 10px 8px;
  585. }
  586. .el-form-item {
  587. margin-bottom: 0;
  588. }
  589. }
  590. </style>