Преглед на файлове

修改数字滚动效果

zy1125 преди 1 година
родител
ревизия
d4e829c747
променени са 7 файла, в които са добавени 82 реда и са изтрити 63 реда
  1. 6 1
      package-lock.json
  2. 1 0
      package.json
  3. 1 1
      src/assets/css/left.scss
  4. 37 5
      src/components/CircleProgress.vue
  5. 2 2
      src/components/UeVideo.vue
  6. 3 0
      src/components/left.vue
  7. 32 54
      src/components/right.vue

+ 6 - 1
package-lock.json

@@ -1033,7 +1033,7 @@
1033
     },
1033
     },
1034
     "throttle-debounce": {
1034
     "throttle-debounce": {
1035
       "version": "3.0.1",
1035
       "version": "3.0.1",
1036
-      "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-3.0.1.tgz",
1036
+      "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz",
1037
       "integrity": "sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg=="
1037
       "integrity": "sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg=="
1038
     },
1038
     },
1039
     "to-regex-range": {
1039
     "to-regex-range": {
@@ -1218,6 +1218,11 @@
1218
         "vue-count-to": "^1.0.13"
1218
         "vue-count-to": "^1.0.13"
1219
       }
1219
       }
1220
     },
1220
     },
1221
+    "vue3-number-roll-plus": {
1222
+      "version": "0.1.3",
1223
+      "resolved": "https://registry.npmjs.org/vue3-number-roll-plus/-/vue3-number-roll-plus-0.1.3.tgz",
1224
+      "integrity": "sha512-DngEDTyEIrDPIefl3ZEH5ZFtnTw0xNOb71DELLOW6PeQxep41jQ1ntJPWugj2csEIzMW7jlLNSBAASBGR81Ykw=="
1225
+    },
1221
     "vue3-video-play": {
1226
     "vue3-video-play": {
1222
       "version": "1.3.1-beta.6",
1227
       "version": "1.3.1-beta.6",
1223
       "resolved": "https://registry.npmjs.org/vue3-video-play/-/vue3-video-play-1.3.1-beta.6.tgz",
1228
       "resolved": "https://registry.npmjs.org/vue3-video-play/-/vue3-video-play-1.3.1-beta.6.tgz",

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
16
     "postcss-pxtorem": "^6.0.0",
16
     "postcss-pxtorem": "^6.0.0",
17
     "vue": "^3.2.25",
17
     "vue": "^3.2.25",
18
     "vue3-count-to": "^1.1.2",
18
     "vue3-count-to": "^1.1.2",
19
+    "vue3-number-roll-plus": "^0.1.3",
19
     "vue3-video-play": "^1.3.1-beta.6"
20
     "vue3-video-play": "^1.3.1-beta.6"
20
   },
21
   },
21
   "devDependencies": {
22
   "devDependencies": {

+ 1 - 1
src/assets/css/left.scss

@@ -78,7 +78,7 @@
78
              //  width: 93px;
78
              //  width: 93px;
79
              box-sizing: border-box;
79
              box-sizing: border-box;
80
              // margin-top: 42px;
80
              // margin-top: 42px;
81
-             margin: 40px 16px 39px 22px;
81
+             margin: 33px 16px 39px 22px;
82
 
82
 
83
              img {
83
              img {
84
                  width: 22px;
84
                  width: 22px;

+ 37 - 5
src/components/CircleProgress.vue

@@ -3,7 +3,13 @@
3
         <div class="number" v-if="textPosition == 'top'">
3
         <div class="number" v-if="textPosition == 'top'">
4
             <ul class="flex">
4
             <ul class="flex">
5
                 <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
5
                 <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
6
-                <count-to :useEasing="true" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to>
6
+                <vue-number-roll-plus
7
+                    :number="targetValue"
8
+                    background="transparent"
9
+                    speed="1.4"
10
+                    >
11
+                </vue-number-roll-plus>
12
+                <!-- <count-to :useEasing="true" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to> -->
7
                 <span>个</span>
13
                 <span>个</span>
8
             </ul>
14
             </ul>
9
         </div>
15
         </div>
@@ -23,8 +29,15 @@
23
     <div class="bottomNumber" v-if="textPosition == 'bottom'">
29
     <div class="bottomNumber" v-if="textPosition == 'bottom'">
24
         <ul class="flex" style="width: 65px;display: flex;align-items: center;justify-content: center;">
30
         <ul class="flex" style="width: 65px;display: flex;align-items: center;justify-content: center;">
25
             <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
31
             <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
26
-            <div style="color: #fff;font-weight: 600; ">
27
-                <count-to :useEasing="true" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to>
32
+            <div style="color: #fff;font-weight: 600;  ">
33
+                <vue-number-roll-plus
34
+                    :number="targetValue"
35
+                    background="transparent"
36
+                    speed="1.4"
37
+                    >
38
+                </vue-number-roll-plus>
39
+
40
+                <!-- <count-to :useEasing="true" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to> -->
28
             </div>
41
             </div>
29
             <span style="color: antiquewhite;"   v-if="text.includes('课程')">(节)</span>
42
             <span style="color: antiquewhite;"   v-if="text.includes('课程')">(节)</span>
30
             <span style="color: antiquewhite;" v-else>(人)</span>
43
             <span style="color: antiquewhite;" v-else>(人)</span>
@@ -33,10 +46,16 @@
33
     </div>
46
     </div>
34
 </template>
47
 </template>
35
 <script setup lang="ts">
48
 <script setup lang="ts">
36
-import { ref, computed, toRefs, watch, onMounted,reactive  } from 'vue';
37
-import ScrollNum from './roll.vue';
49
+
50
+import VueNumberRollPlus from "vue3-number-roll-plus"
51
+import "vue3-number-roll-plus/main.css"
52
+
53
+import { ref, computed, toRefs, watch, onMounted,reactive,  } from 'vue';
54
+// import ScrollNum from './roll.vue';
38
 import { CountTo } from 'vue3-count-to';
55
 import { CountTo } from 'vue3-count-to';
39
 
56
 
57
+
58
+
40
 const props = defineProps({
59
 const props = defineProps({
41
     targetValue: {
60
     targetValue: {
42
         type: Number,
61
         type: Number,
@@ -148,6 +167,9 @@ watch(textPosition, (newValue) => {
148
 .number {
167
 .number {
149
     font-size: 14px;
168
     font-size: 14px;
150
     font-weight: bold;
169
     font-weight: bold;
170
+    height: 28px;
171
+    // background-color: #2196f3;
172
+    margin-top: -8px;
151
 
173
 
152
     span {
174
     span {
153
         font-size: 12px;
175
         font-size: 12px;
@@ -174,4 +196,14 @@ ul {
174
         margin-left: 4px;
196
         margin-left: 4px;
175
     }
197
     }
176
 }
198
 }
199
+
177
 </style>
200
 </style>
201
+<style lang="scss">
202
+.real-time-num{
203
+    // background-color: rgb(137, 80, 5) !important;
204
+    width: 9px!important;
205
+    height: 33px !important;
206
+    margin-left: 0px !important;
207
+
208
+}
209
+</style>

+ 2 - 2
src/components/UeVideo.vue

@@ -1,7 +1,7 @@
1
 
1
 
2
 <template>
2
 <template>
3
-  <!-- <div  ref="video" id="player"></div> -->
4
-  <div style="background-color: rgba(156, 167, 84, 0.667); width: 100vw;height: 100vh;position: absolute;" ></div>
3
+  <div  ref="video" id="player"></div>
4
+  <!-- <div style="background-color: rgba(156, 167, 84, 0.667); width: 100vw;height: 100vh;position: absolute;" ></div> -->
5
   <Login :class="loginShow ? '' : 'hidden'"></Login>
5
   <Login :class="loginShow ? '' : 'hidden'"></Login>
6
   <home></home>
6
   <home></home>
7
   <!-- <div @click="toUE" style="position: absolute;top: 5%; left: 50%;background-color: darkcyan;z-index: 200">向UE发信息</div> -->
7
   <!-- <div @click="toUE" style="position: absolute;top: 5%; left: 50%;background-color: darkcyan;z-index: 200">向UE发信息</div> -->

+ 3 - 0
src/components/left.vue

@@ -88,6 +88,9 @@
88
 </template>
88
 </template>
89
 
89
 
90
 <script >
90
 <script >
91
+
92
+
93
+
91
 import * as echarts from "echarts";
94
 import * as echarts from "echarts";
92
 import { reactive, onMounted, ref, onBeforeUnmount, onUnmounted, nextTick, getCurrentInstance } from 'vue';
95
 import { reactive, onMounted, ref, onBeforeUnmount, onUnmounted, nextTick, getCurrentInstance } from 'vue';
93
 import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem } from "element-plus";
96
 import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem } from "element-plus";

+ 32 - 54
src/components/right.vue

@@ -209,29 +209,7 @@ export default ({
209
         let interDevice = ref([])
209
         let interDevice = ref([])
210
         // 智慧教室
210
         // 智慧教室
211
         let carouselData = ref([
211
         let carouselData = ref([
212
-            {
213
-                activeMonitor:{
214
-    "array": [
215
-        {
216
-            "src": "http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8",
217
-            "title": "录播设备"
218
-        },
219
-       
220
-    ],
221
-    "title1": "010431",
222
-    "array1": [
223
-        {
224
-            "src": "http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8",
225
-            "title": "录播设备"
226
-        },
227
-        {
228
-            "src": "http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8",
229
-            "title": "录播设备"
230
-        }
231
-    ],
232
-    "title": "010429"
233
-}
234
-            }
212
+           
235
         ])
213
         ])
236
 
214
 
237
         //获取页面数据
215
         //获取页面数据
@@ -254,50 +232,50 @@ export default ({
254
             // 物联设备类型数据
232
             // 物联设备类型数据
255
             console.log('sadui12u31',category);
233
             console.log('sadui12u31',category);
256
             //截取数组前6项
234
             //截取数组前6项
257
-            interDevice.value = category.slice(0,6);
235
+            interDevice.value = category;
258
       
236
       
259
-            //  // 互动教室
260
-            //  carouselData.value = monitor;
237
+             // 互动教室
238
+             carouselData.value = monitor;
261
       
239
       
262
-            //  carouselData.value.map((res)=>{
263
-            //     console.log('sadhi2',res.activeMonitor);
240
+             carouselData.value.map((res)=>{
241
+                console.log('sadhi2',res.activeMonitor);
264
 
242
 
265
-            //     res.activeMonitor.array.map(array =>{
243
+                res.activeMonitor.array.map(array =>{
266
               
244
               
267
-            //         //视频转码
268
-            //         getvideo({
269
-            //         "rtsp": array.src,
270
-            //         }).then((res)=>{
271
-            //             console.log('sadnuq21',res.data);
272
-            //             console.log('sadnuq2121',res.data.httpFlv);
273
-            //              array.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
274
-            //            // array.src=res.data.httpFlv
275
-            //         })
245
+                    //视频转码
246
+                    getvideo({
247
+                    "rtsp": array.src,
248
+                    }).then((res)=>{
249
+                        console.log('sadnuq21',res.data);
250
+                        console.log('sadnuq2121',res.data.httpFlv);
251
+                
252
+                       array.src=res.data.httpFlv
253
+                    })
276
 
254
 
277
                     
255
                     
278
-            //     })
279
-            //     res.activeMonitor.array1.map(array1 =>{
280
-            //         console.log('asdui1231',array1);
281
-            //            //视频转码
282
-            //            getvideo({
283
-            //         "rtsp": array1.src,
284
-            //         }).then((res)=>{
285
-            //             console.log('sadnuq212123s2',res.data);
286
-            //              array1.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
287
-            //            // array.src=res.data.httpFlv
288
-            //         })
289
-            //     })
256
+                })
257
+                res.activeMonitor.array1.map(array1 =>{
258
+                    console.log('asdui1231',array1);
259
+                       //视频转码
260
+                       getvideo({
261
+                    "rtsp": array1.src,
262
+                    }).then((res)=>{
263
+                        console.log('sadnuq212123s2',res.data);
264
+                    
265
+                       array.src=res.data.httpFlv
266
+                    })
267
+                })
290
 
268
 
291
 
269
 
292
-            // })
270
+            })
293
 
271
 
294
                  
272
                  
295
 
273
 
296
 
274
 
297
 
275
 
298
-                setTimeout(() => {
299
-                    console.log('处理后监控视频数据===',carouselData.value);
300
-                }, 2000);
276
+                // setTimeout(() => {
277
+                //     console.log('处理后监控视频数据===',carouselData.value);
278
+                // }, 2000);
301
 
279
 
302
             //物联设备统计
280
             //物联设备统计
303
             equipmentTotal.value = status
281
             equipmentTotal.value = status