| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <template>
- <div class="module-main">
- <div class="module-box">
- <div class="main-one">
- <div class="title" @click="clickUserRanking()">员工好评度排名</div>
- <dv-scroll-board v-if="userPraiseFlag" :config="config" class="data" />
- </div>
- <div class="main-one">
- <div class="title" @click="clickMateRanking()">耗材使用排名</div>
- <dv-scroll-board v-if="flag2" :config="config2" class="data" />
- </div>
- <div class="main-there">
- <div class="module-title">
- <span @click="clickDepRanking()">热点科室排名</span>
- <select v-model="type" class="module-select" @change="updateData">
- <option value="1">运送</option>
- <option value="2">陪护</option>
- </select>
- </div>
- <dv-scroll-board v-if="flag3" :config="config3" class="data" />
- </div>
- </div>
- <popup-3 :visible="userVisible" @closeClick="()=>{userVisible=false}" />
- <popup-4 :visible="mateVisible" @closeClick="()=>{mateVisible=false}" />
- <popup-5 :visible="depVisible" :ctype="type" @closeClick="()=>{depVisible=false}" />
- </div>
- </template>
- <script>
- import Vue from 'vue';
- import Component from 'vue-class-component';
- import Popup3 from '../popup/popup3.vue';
- import Popup4 from '../popup/popup4.vue';
- import Popup5 from '../popup/popup5.vue';
- import api from '../../api';
- @Component({
- components: {
- Popup3,
- Popup4,
- Popup5,
- },
- props: {
- data: {
- type: Object,
- default: null,
- },
- },
- })
- export default class Echarts extends Vue {
- userVisible = false;
- mateVisible = false;
- depVisible = false;
- config = {
- data: [],
- rowNum: '4',
- oddRowBGC: 'rgba(17, 43, 117, 0.5)',
- evenRowBGC: 'rgba(9, 32, 99, 0.5)',
- }
- config2 = {
- data: [
- ],
- rowNum: '4',
- oddRowBGC: 'rgba(17, 43, 117, 0.5)',
- evenRowBGC: 'rgba(9, 32, 99, 0.5)',
- }
- config3 = {
- data: [
- ],
- rowNum: '4',
- oddRowBGC: 'rgba(17, 43, 117, 0.5)',
- evenRowBGC: 'rgba(9, 32, 99, 0.5)',
- }
- userPraiseFlag = false;
- flag2 = false;
- flag3 = false;
- timer = null;
- type = '1';
- created() {
- this.getUserPraise();
- this.getHotMate();
- this.getHotDep();
- setInterval(() => {
- this.getUserPraise();
- this.getHotMate();
- this.getHotDep();
- }, 5000 * 60);
- }
- updateData() {
- if (this.timer) { // 清除定时器
- clearInterval(this.timer);
- }
- this.getHotDep();
- this.timer = setInterval(() => {
- this.getHotDep();
- }, 1000 * 60 * 10);
- }
- getUserPraise() {
- api.getUserPraise().then((res) => {
- this.userPraiseFlag = false;
- this.$nextTick(() => {
- this.userPraiseFlag = true;
- this.config.data = res.data;
- });
- }).catch(() => {}).finally(() => {
- this.userPraiseFlag = true;
- });
- }
- getHotMate() {
- api.getHotMate().then((res) => {
- this.flag2 = false;
- this.$nextTick(() => {
- this.config2.data = res.data;
- this.flag2 = true;
- });
- }).catch(() => {}).finally(() => {
- this.flag2 = true;
- });
- }
- getHotDep() {
- api.getHotDep({
- type: this.type,
- }).then((res) => {
- this.flag3 = false;
- this.$nextTick(() => {
- this.config3.data = res.data;
- this.flag3 = true;
- });
- }).catch(() => {}).finally(() => {
- this.flag3 = true;
- });
- }
- clickUserRanking() {
- this.userVisible = true;
- }
- clickMateRanking() {
- this.mateVisible = true;
- }
- clickDepRanking() {
- this.depVisible = true;
- }
- }
- </script>
- <style scoped lang="scss">
- .main-one{
- width: 33.3%;
- height: 100%;
- display: inline-block;
- float: left;
- }
- .main-one .title{
- width: calc(100% - 10px);
- height: 40px;
- line-height: 40px;
- font-size: 14px;
- color: #FFFFFF;
- padding-left: 10px;
- cursor: pointer;
- }
- .main-one .data{
- width: calc(100% - 20px);
- height: calc(100% - 50px);
- padding:0px 10px;
- }
- .main-there {
- width: 33.3%;
- height: 100%;
- display: inline-block;
- float: left;
- }
- .main-there .module-title{
- /* width: calc(100% - 10px);
- height: 40px;
- line-height: 40px;
- font-size: 14px;
- font-family: Source Han Sans CN;
- font-weight: bold;
- color: #FFFFFF;
- padding-left: 10px;
- overflow: hidden; */
- position: relative;
- height: 40px;
- line-height: 40px;
- font-size: 14px;
- cursor: pointer;
- }
- .main-there .data{
- width: calc(100% - 20px);
- height: calc(100% - 50px);
- padding:0px 10px;
- }
- .module-select{
- width: 50px;
- height: 20px;
- color: #A6D6FF;
- background-color: #3D7FFF;
- outline: none;
- border: 1px solid #A6D6FF;
- float: right;
- vertical-align: middle;
- margin-top: 10px;
- margin-right: 5px;
- }
- </style>
|