|
@@ -56,14 +56,14 @@
|
56
|
56
|
</template>
|
57
|
57
|
|
58
|
58
|
<script>
|
59
|
|
-import { post, timer2 } from "./../http/http";
|
|
59
|
+import { post, timer2 } from './../http/http'
|
60
|
60
|
export default {
|
61
|
|
- name: "GroupPraise",
|
62
|
|
- inject: ["hospitalId"],
|
63
|
|
- data() {
|
|
61
|
+ name: 'GroupPraise',
|
|
62
|
+ inject: ['hospitalId'],
|
|
63
|
+ data () {
|
64
|
64
|
return {
|
65
|
65
|
allData: {},
|
66
|
|
- fontSize: parseFloat(document.querySelector("html").style.fontSize),
|
|
66
|
+ fontSize: parseFloat(document.querySelector('html').style.fontSize),
|
67
|
67
|
timer: null,
|
68
|
68
|
animate: false,
|
69
|
69
|
timer1: null,
|
|
@@ -73,65 +73,65 @@ export default {
|
73
|
73
|
disY: 0.375, // 滚动数据偏移量
|
74
|
74
|
disHeight: 0, // 滚动数据高度
|
75
|
75
|
isShow: true // 滚动数据显示隐藏
|
76
|
|
- };
|
|
76
|
+ }
|
77
|
77
|
},
|
78
|
78
|
methods: {
|
79
|
79
|
// 无限滚动
|
80
|
|
- scrollInfinite() {
|
81
|
|
- clearTimeout(this.timer1);
|
|
80
|
+ scrollInfinite () {
|
|
81
|
+ clearTimeout(this.timer1)
|
82
|
82
|
this.timer1 = setTimeout(() => {
|
83
|
|
- this.showMarquee();
|
84
|
|
- this.scrollInfinite();
|
85
|
|
- }, 2000);
|
|
83
|
+ this.showMarquee()
|
|
84
|
+ this.scrollInfinite()
|
|
85
|
+ }, 2000)
|
86
|
86
|
},
|
87
|
87
|
// 处理数组方法
|
88
|
|
- showMarquee() {
|
89
|
|
- this.animate = true;
|
90
|
|
- this.n--;
|
|
88
|
+ showMarquee () {
|
|
89
|
+ this.animate = true
|
|
90
|
+ this.n--
|
91
|
91
|
if (this.n === -this.evaluateUserList.length) {
|
92
|
|
- this.animate = false;
|
93
|
|
- this.n = 0;
|
|
92
|
+ this.animate = false
|
|
93
|
+ this.n = 0
|
94
|
94
|
}
|
95
|
95
|
},
|
96
|
96
|
// 近30天小组好评排行
|
97
|
|
- async getGroupPraise() {
|
|
97
|
+ async getGroupPraise () {
|
98
|
98
|
const srartTime = this.$moment()
|
99
|
|
- .subtract(1, "days")
|
100
|
|
- .format("YYYY-MM-DD"); // 昨日
|
|
99
|
+ .subtract(1, 'days')
|
|
100
|
+ .format('YYYY-MM-DD') // 昨日
|
101
|
101
|
const endTime = this.$moment()
|
102
|
|
- .subtract(1, "days")
|
103
|
|
- .format("YYYY-MM-DD"); // 昨日
|
|
102
|
+ .subtract(1, 'days')
|
|
103
|
+ .format('YYYY-MM-DD') // 昨日
|
104
|
104
|
const result = await post(
|
105
|
105
|
`/largeScreen/getData/gradeRanking/${this.hospitalId}`,
|
106
|
106
|
{ srartTime, endTime, pageSize: 3 }
|
107
|
|
- );
|
108
|
|
- this.gradeRankingList = result.gradeRankingList;
|
109
|
|
- this.evaluateUserList = result.evaluateUserList;
|
110
|
|
- this.polling();
|
|
107
|
+ )
|
|
108
|
+ this.gradeRankingList = result.gradeRankingList
|
|
109
|
+ this.evaluateUserList = result.evaluateUserList
|
|
110
|
+ this.polling()
|
111
|
111
|
if (this.evaluateUserList.length > 0) {
|
112
|
112
|
this.evaluateUserList = [
|
113
|
113
|
...this.evaluateUserList,
|
114
|
114
|
this.evaluateUserList[0]
|
115
|
|
- ];
|
116
|
|
- this.scrollInfinite();
|
|
115
|
+ ]
|
|
116
|
+ this.scrollInfinite()
|
117
|
117
|
}
|
118
|
118
|
},
|
119
|
119
|
// 轮询请求
|
120
|
|
- polling() {
|
121
|
|
- clearTimeout(this.timer);
|
|
120
|
+ polling () {
|
|
121
|
+ clearTimeout(this.timer)
|
122
|
122
|
this.timer = setTimeout(() => {
|
123
|
|
- this.getGroupPraise();
|
124
|
|
- }, timer2);
|
|
123
|
+ this.getGroupPraise()
|
|
124
|
+ }, timer2)
|
125
|
125
|
}
|
126
|
126
|
},
|
127
|
|
- mounted() {
|
128
|
|
- this.getGroupPraise();
|
|
127
|
+ mounted () {
|
|
128
|
+ this.getGroupPraise()
|
129
|
129
|
},
|
130
|
|
- beforeDestroy() {
|
131
|
|
- clearTimeout(this.timer);
|
132
|
|
- clearTimeout(this.timer1);
|
|
130
|
+ beforeDestroy () {
|
|
131
|
+ clearTimeout(this.timer)
|
|
132
|
+ clearTimeout(this.timer1)
|
133
|
133
|
}
|
134
|
|
-};
|
|
134
|
+}
|
135
|
135
|
</script>
|
136
|
136
|
|
137
|
137
|
<style lang="less">
|