smodule54.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div class="module-main">
  3. <div class="module-box">
  4. <div class="main-one">
  5. <div class="title" @click="clickUserRanking()">员工好评度排名</div>
  6. <dv-scroll-board v-if="userPraiseFlag" :config="config" class="data" />
  7. </div>
  8. <div class="main-one">
  9. <div class="title" @click="clickMateRanking()">耗材使用排名</div>
  10. <dv-scroll-board v-if="flag2" :config="config2" class="data" />
  11. </div>
  12. <div class="main-there">
  13. <div class="module-title">
  14. <span @click="clickDepRanking()">热点科室排名</span>
  15. <select v-model="type" class="module-select" @change="updateData">
  16. <option value="1">运送</option>
  17. <option value="2">陪护</option>
  18. </select>
  19. </div>
  20. <dv-scroll-board v-if="flag3" :config="config3" class="data" />
  21. </div>
  22. </div>
  23. <popup-3 :visible="userVisible" @closeClick="()=>{userVisible=false}" />
  24. <popup-4 :visible="mateVisible" @closeClick="()=>{mateVisible=false}" />
  25. <popup-5 :visible="depVisible" :ctype="type" @closeClick="()=>{depVisible=false}" />
  26. </div>
  27. </template>
  28. <script>
  29. import Vue from 'vue';
  30. import Component from 'vue-class-component';
  31. import Popup3 from '../popup/popup3.vue';
  32. import Popup4 from '../popup/popup4.vue';
  33. import Popup5 from '../popup/popup5.vue';
  34. import api from '../../api';
  35. @Component({
  36. components: {
  37. Popup3,
  38. Popup4,
  39. Popup5,
  40. },
  41. props: {
  42. data: {
  43. type: Object,
  44. default: null,
  45. },
  46. },
  47. })
  48. export default class Echarts extends Vue {
  49. userVisible = false;
  50. mateVisible = false;
  51. depVisible = false;
  52. config = {
  53. data: [],
  54. rowNum: '4',
  55. oddRowBGC: 'rgba(17, 43, 117, 0.5)',
  56. evenRowBGC: 'rgba(9, 32, 99, 0.5)',
  57. }
  58. config2 = {
  59. data: [
  60. ],
  61. rowNum: '4',
  62. oddRowBGC: 'rgba(17, 43, 117, 0.5)',
  63. evenRowBGC: 'rgba(9, 32, 99, 0.5)',
  64. }
  65. config3 = {
  66. data: [
  67. ],
  68. rowNum: '4',
  69. oddRowBGC: 'rgba(17, 43, 117, 0.5)',
  70. evenRowBGC: 'rgba(9, 32, 99, 0.5)',
  71. }
  72. userPraiseFlag = false;
  73. flag2 = false;
  74. flag3 = false;
  75. timer = null;
  76. type = '1';
  77. created() {
  78. this.getUserPraise();
  79. this.getHotMate();
  80. this.getHotDep();
  81. setInterval(() => {
  82. this.getUserPraise();
  83. this.getHotMate();
  84. this.getHotDep();
  85. }, 5000 * 60);
  86. }
  87. updateData() {
  88. if (this.timer) { // 清除定时器
  89. clearInterval(this.timer);
  90. }
  91. this.getHotDep();
  92. this.timer = setInterval(() => {
  93. this.getHotDep();
  94. }, 1000 * 60 * 10);
  95. }
  96. getUserPraise() {
  97. api.getUserPraise().then((res) => {
  98. this.userPraiseFlag = false;
  99. this.$nextTick(() => {
  100. this.userPraiseFlag = true;
  101. this.config.data = res.data;
  102. });
  103. }).catch(() => {}).finally(() => {
  104. this.userPraiseFlag = true;
  105. });
  106. }
  107. getHotMate() {
  108. api.getHotMate().then((res) => {
  109. this.flag2 = false;
  110. this.$nextTick(() => {
  111. this.config2.data = res.data;
  112. this.flag2 = true;
  113. });
  114. }).catch(() => {}).finally(() => {
  115. this.flag2 = true;
  116. });
  117. }
  118. getHotDep() {
  119. api.getHotDep({
  120. type: this.type,
  121. }).then((res) => {
  122. this.flag3 = false;
  123. this.$nextTick(() => {
  124. this.config3.data = res.data;
  125. this.flag3 = true;
  126. });
  127. }).catch(() => {}).finally(() => {
  128. this.flag3 = true;
  129. });
  130. }
  131. clickUserRanking() {
  132. this.userVisible = true;
  133. }
  134. clickMateRanking() {
  135. this.mateVisible = true;
  136. }
  137. clickDepRanking() {
  138. this.depVisible = true;
  139. }
  140. }
  141. </script>
  142. <style scoped lang="scss">
  143. .main-one{
  144. width: 33.3%;
  145. height: 100%;
  146. display: inline-block;
  147. float: left;
  148. }
  149. .main-one .title{
  150. width: calc(100% - 10px);
  151. height: 40px;
  152. line-height: 40px;
  153. font-size: 14px;
  154. color: #FFFFFF;
  155. padding-left: 10px;
  156. cursor: pointer;
  157. }
  158. .main-one .data{
  159. width: calc(100% - 20px);
  160. height: calc(100% - 50px);
  161. padding:0px 10px;
  162. }
  163. .main-there {
  164. width: 33.3%;
  165. height: 100%;
  166. display: inline-block;
  167. float: left;
  168. }
  169. .main-there .module-title{
  170. /* width: calc(100% - 10px);
  171. height: 40px;
  172. line-height: 40px;
  173. font-size: 14px;
  174. font-family: Source Han Sans CN;
  175. font-weight: bold;
  176. color: #FFFFFF;
  177. padding-left: 10px;
  178. overflow: hidden; */
  179. position: relative;
  180. height: 40px;
  181. line-height: 40px;
  182. font-size: 14px;
  183. cursor: pointer;
  184. }
  185. .main-there .data{
  186. width: calc(100% - 20px);
  187. height: calc(100% - 50px);
  188. padding:0px 10px;
  189. }
  190. .module-select{
  191. width: 50px;
  192. height: 20px;
  193. color: #A6D6FF;
  194. background-color: #3D7FFF;
  195. outline: none;
  196. border: 1px solid #A6D6FF;
  197. float: right;
  198. vertical-align: middle;
  199. margin-top: 10px;
  200. margin-right: 5px;
  201. }
  202. </style>