JiMuBaoBiao.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <el-container style="margin-top: 10px">
  3. <el-header>
  4. <el-date-picker
  5. type="daterange"
  6. size="mini"
  7. v-model="zhuYuanShiJianChaoTime"
  8. range-separator="至"
  9. start-placeholder="开始日期"
  10. end-placeholder="结束日期"
  11. :shortcuts="shortcuts"
  12. ></el-date-picker>
  13. <el-button size="mini" type="primary" style="margin-left: 10px" @click="query">查询</el-button>
  14. </el-header>
  15. <el-container>
  16. <el-main>
  17. <el-row>
  18. <el-col :span="12">
  19. <div style="width: 100%; height: 300px" id="huanZheChao30"></div>
  20. </el-col>
  21. <el-col :span="12">
  22. <div style="width: 100%; height: 300px" id="pingJunZhuYuan"></div>
  23. </el-col>
  24. </el-row>
  25. </el-main>
  26. </el-container>
  27. </el-container>
  28. </template>
  29. <script>
  30. import { onMounted, ref } from 'vue'
  31. import { zhuYuanShiJianChao } from '@/api/querydata/jimubaobiao'
  32. import { getDateRangeFormatDate } from '@/utils/date'
  33. import { pieUtils } from '@/utils/echarts-utils'
  34. import { shortcuts } from '@/data/shortcuts'
  35. export default {
  36. setup() {
  37. // 引入
  38. // 住院时间超过
  39. const zhuYuanShiJianChaoTime = ref([])
  40. zhuYuanShiJianChaoTime.value[0] = '2020-01-01'
  41. zhuYuanShiJianChaoTime.value[1] = '2021-11-01'
  42. const query = () => {
  43. let daterange = getDateRangeFormatDate(zhuYuanShiJianChaoTime.value)
  44. let startTime = daterange.stratTime
  45. let endTime = daterange.endTime
  46. zhuYuanShiJianChao(startTime, endTime).then((res) => {
  47. pieUtils(huanZheChao30, '住院时间超30日患者例数', res.huanZheChao30)
  48. pieUtils(pingJunZhuYuan, '住院患者平均住院日', res.pingJunZhuYuan)
  49. })
  50. }
  51. onMounted(() => {
  52. setTimeout(() => {
  53. query()
  54. }, 100)
  55. })
  56. return {
  57. zhuYuanShiJianChaoTime,
  58. query,
  59. shortcuts,
  60. }
  61. },
  62. }
  63. </script>
  64. <style></style>