TodayClinicResource.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <div class="parent-wrapper">
  3. <div class="title-box">
  4. <img :src="logo" alt="">
  5. <p class="title-text">今日开放号源</p>
  6. <p class="title-time">{{ currentTimeText }}</p>
  7. </div>
  8. <table>
  9. <tr>
  10. <td class="colored-background w22">科室</td>
  11. <td class="colored-background w12">医生</td>
  12. <td class="colored-background w18">号别</td>
  13. <td class="colored-background w12">时间</td>
  14. <td class="colored-background w14">挂号费</td>
  15. <td class="colored-background w22">地点</td>
  16. </tr>
  17. </table>
  18. <dv-scroll-board :config="config" style="height: 79vh"/>
  19. </div>
  20. </template>
  21. <script setup>
  22. import logo from '@/assets/thyylogo.png'
  23. import {selectTodayClinicResource} from "@/api/single-page/today-clinic-resource";
  24. import {reactive} from "vue";
  25. const width = window.innerWidth
  26. const w12 = width * 0.12
  27. const w14 = width * 0.14
  28. const w18 = width * 0.18
  29. const w22 = width * 0.22
  30. const config = reactive({
  31. data: [],
  32. rowNum: 4,
  33. columnWidth: [w22, w12, w18, w12, w14, w22],
  34. align: ['center', 'center', 'center', 'center', 'center', 'center'],
  35. carousel: 'single',
  36. hoverPause: false
  37. })
  38. const data = ref([])
  39. const resourceList = ref([])
  40. const queryResourceData = () => {
  41. selectTodayClinicResource().then(res => {
  42. resourceList.value = res
  43. analyzeStatistics()
  44. })
  45. }
  46. const currentTimeText = ref('')
  47. const analyzeStatistics = () => {
  48. if (resourceList.value.length === 0) {
  49. return
  50. }
  51. resourceList.value.forEach(item => {
  52. let temp = []
  53. temp.push(`<span style="font-size: 50px;font-weight: bold">${item.deptName || ''}</span>`)
  54. temp.push(`<span style="font-size: 50px;font-weight: bold">${item.doctorName || ''}</span>`)
  55. temp.push(`<span style="font-size: 50px;font-weight: bold">${item.reqType || ''}</span>`)
  56. temp.push(`<span style="font-size: 50px;font-weight: bold">${item.reqTime || ''}</span>`)
  57. temp.push(`<span style="font-size: 50px;font-weight: bold">${item.reqFee || ''}</span>`)
  58. temp.push(`<span style="font-size: 50px;font-weight: bold">${item.reqAddress || ''}</span>`)
  59. data.value.push(temp)
  60. })
  61. config.data = data.value
  62. }
  63. onMounted(() => {
  64. queryResourceData()
  65. setInterval(() => {
  66. let date = new Date();
  67. let dateStr = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate();
  68. let timeStr = date.toLocaleTimeString();
  69. let weekStr = '星期' + '日一二三四五六'.charAt(new Date().getDay());
  70. currentTimeText.value = dateStr + " --- " + timeStr + " --- " + weekStr;
  71. }, 1000)
  72. })
  73. </script>
  74. <style scoped lang="scss">
  75. * {
  76. margin: 0;
  77. padding: 0;
  78. box-sizing: border-box;
  79. }
  80. .parent-wrapper {
  81. width: 100vw;
  82. height: 100vh;
  83. .title-box {
  84. position: relative;
  85. background-image: linear-gradient(to top, white 0%, lightskyblue 100%);
  86. display: table;
  87. width: 100vw;
  88. height: 10vh;
  89. img {
  90. position: relative;
  91. margin-left: 20px;
  92. height: 75%;
  93. width: 20%;
  94. margin-top: 5px;
  95. }
  96. .title-text {
  97. position: absolute;
  98. top: 0;
  99. left: 17.5%;
  100. text-align: center;
  101. line-height: 200%;
  102. border-bottom-left-radius: 30%;
  103. border-bottom-right-radius: 30%;
  104. height: 100%;
  105. width: 20%;
  106. color: white;
  107. font-size: 50px;
  108. font-weight: bold;
  109. background-image: linear-gradient(to top, rgba(0, 82, 94, 0.88), rgba(0, 82, 94, 0.48) 100%);
  110. }
  111. .title-time {
  112. background-image: linear-gradient(to top, rgba(0, 82, 94, 0.88), rgba(0, 82, 94, 0.48) 100%);
  113. border-radius: 10px;
  114. width: 45%;
  115. font-size: 45px;
  116. color: white;
  117. font-weight: bold;
  118. display: table-cell;
  119. vertical-align: middle;
  120. text-align: center;
  121. }
  122. }
  123. table {
  124. margin-top: 8px;
  125. width: 100vw;
  126. height: 10vh;
  127. text-align: center;
  128. font-size: 50px;
  129. font-weight: bold;
  130. border-collapse: collapse;
  131. color: white;
  132. background-color: rgb(0, 82, 94);
  133. .w12 {
  134. width: 12%;
  135. }
  136. .w14 {
  137. width: 14%;
  138. }
  139. .w18 {
  140. width: 18%;
  141. }
  142. .w22 {
  143. width: 22%;
  144. }
  145. }
  146. }
  147. </style>