seimin 4 vuotta sitten
vanhempi
commit
031931514d
1 muutettua tiedostoa jossa 37 lisäystä ja 37 poistoa
  1. 37 37
      src/components/GroupPraise.vue

+ 37 - 37
src/components/GroupPraise.vue

@@ -56,14 +56,14 @@
56
 </template>
56
 </template>
57
 
57
 
58
 <script>
58
 <script>
59
-import { post, timer2 } from "./../http/http";
59
+import { post, timer2 } from './../http/http'
60
 export default {
60
 export default {
61
-  name: "GroupPraise",
62
-  inject: ["hospitalId"],
63
-  data() {
61
+  name: 'GroupPraise',
62
+  inject: ['hospitalId'],
63
+  data () {
64
     return {
64
     return {
65
       allData: {},
65
       allData: {},
66
-      fontSize: parseFloat(document.querySelector("html").style.fontSize),
66
+      fontSize: parseFloat(document.querySelector('html').style.fontSize),
67
       timer: null,
67
       timer: null,
68
       animate: false,
68
       animate: false,
69
       timer1: null,
69
       timer1: null,
@@ -73,65 +73,65 @@ export default {
73
       disY: 0.375, // 滚动数据偏移量
73
       disY: 0.375, // 滚动数据偏移量
74
       disHeight: 0, // 滚动数据高度
74
       disHeight: 0, // 滚动数据高度
75
       isShow: true // 滚动数据显示隐藏
75
       isShow: true // 滚动数据显示隐藏
76
-    };
76
+    }
77
   },
77
   },
78
   methods: {
78
   methods: {
79
     // 无限滚动
79
     // 无限滚动
80
-    scrollInfinite() {
81
-      clearTimeout(this.timer1);
80
+    scrollInfinite () {
81
+      clearTimeout(this.timer1)
82
       this.timer1 = setTimeout(() => {
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
       if (this.n === -this.evaluateUserList.length) {
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
     // 近30天小组好评排行
96
     // 近30天小组好评排行
97
-    async getGroupPraise() {
97
+    async getGroupPraise () {
98
       const srartTime = this.$moment()
98
       const srartTime = this.$moment()
99
-        .subtract(1, "days")
100
-        .format("YYYY-MM-DD"); // 昨日
99
+        .subtract(1, 'days')
100
+        .format('YYYY-MM-DD') // 昨日
101
       const endTime = this.$moment()
101
       const endTime = this.$moment()
102
-        .subtract(1, "days")
103
-        .format("YYYY-MM-DD"); // 昨日
102
+        .subtract(1, 'days')
103
+        .format('YYYY-MM-DD') // 昨日
104
       const result = await post(
104
       const result = await post(
105
         `/largeScreen/getData/gradeRanking/${this.hospitalId}`,
105
         `/largeScreen/getData/gradeRanking/${this.hospitalId}`,
106
         { srartTime, endTime, pageSize: 3 }
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
       if (this.evaluateUserList.length > 0) {
111
       if (this.evaluateUserList.length > 0) {
112
         this.evaluateUserList = [
112
         this.evaluateUserList = [
113
           ...this.evaluateUserList,
113
           ...this.evaluateUserList,
114
           this.evaluateUserList[0]
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
       this.timer = setTimeout(() => {
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
 </script>
135
 </script>
136
 
136
 
137
 <style lang="less">
137
 <style lang="less">