소스 검색

feat: style / 大屏2这个缓存问题 未读取数据自动刷新 / 这个全屏应该放到最上图层

@dayan_hjm 2 년 전
부모
커밋
e80ee0d3a8
3개의 변경된 파일24개의 추가작업 그리고 14개의 파일을 삭제
  1. 1 1
      src/pages/frame/component/top/style.less
  2. 5 3
      src/pages/gvc/component/mapView2.jsx
  3. 18 10
      src/pages/gvc/view.jsx

+ 1 - 1
src/pages/frame/component/top/style.less

@@ -19,7 +19,7 @@
19 19
     .allP_png {
20 20
       position: absolute;
21 21
     right: 1em;
22
-    top: 2em;
22
+    top: 1em;
23 23
     opacity: 0.8;
24 24
     width: 4em;
25 25
     display: flex;

+ 5 - 3
src/pages/gvc/component/mapView2.jsx

@@ -14,7 +14,7 @@
14 14
         preload 属性 :
15 15
         设置 auto , 表示 预先加载视频 ;
16 16
         设置 none , 表示 不预先加载视频 ;
17
- * @Last Modified time: 2023-11-22 16:15:21
17
+ * @Last Modified time: 2023-12-27 14:15:02
18 18
  */
19 19
 import React, { useState, useEffect, Component } from "react";
20 20
 import { useHistory, useLocation, withRouter } from "react-router-dom";
@@ -89,8 +89,10 @@ class MapViewTwo extends Component {
89 89
         btn.removeEventListener('click', play);
90 90
       }
91 91
       else {
92
-        model.style.display = 'block';
93
-        btn.addEventListener('click', play);
92
+        if(model){
93
+          model.style.display = 'block';
94
+        }
95
+        if(btn){btn.addEventListener('click', play);}
94 96
       }
95 97
     }
96 98
     play()

+ 18 - 10
src/pages/gvc/view.jsx

@@ -2,7 +2,7 @@
2 2
  * @Author: dayan_hjm  产供销价值链
3 3
  * @Date: 2023-11-10 10:19:34 
4 4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-12-19 15:49:21
5
+ * @Last Modified time: 2023-12-27 14:18:06
6 6
  */
7 7
 
8 8
 import React, { useState, useEffect, Component } from "react";
@@ -123,8 +123,10 @@ class Gvc extends Component {
123 123
         btn.removeEventListener('click', play);
124 124
         // 如果他自动播放了就隐藏按钮,消除点击事件
125 125
       } catch (err) {
126
+      if(model){
126 127
         model.style.display = 'block';
127
-        btn.addEventListener('click', play);
128
+      }
129
+      if(btn){btn.addEventListener('click', play);}
128 130
         // 如果Promise返回的是error就引导用户点击按钮,在调用play方法
129 131
       }
130 132
     }
@@ -145,9 +147,11 @@ class Gvc extends Component {
145 147
         btn.removeEventListener('click', play);
146 148
       }
147 149
       else {
148
-        model.style.display = 'block';
149
-        btn.addEventListener('click', play);
150
-      }
150
+        if(model){
151
+          model.style.display = 'block';
152
+        }
153
+        if(btn){btn.addEventListener('click', play);}
154
+        }
151 155
     }
152 156
     play()
153 157
 
@@ -230,7 +234,9 @@ class Gvc extends Component {
230 234
 
231 235
         console.log(old_imgMsgData, "old_imgMsgData")
232 236
         this.store.saveState({ imgMsgData: old_imgMsgData });
233
-        this.getUrl5()
237
+        setTimeout(()=>{
238
+          this.getUrl5()
239
+        },500)
234 240
       }
235 241
     });
236 242
   }
@@ -261,7 +267,9 @@ class Gvc extends Component {
261 267
         old_imgMsgData[7] = { ...old_imgMsgData[7], ...d_5 };
262 268
         console.log(old_imgMsgData, "1111old_imgMsgData")
263 269
         this.store.saveState({ imgMsgData: old_imgMsgData });
264
-        this.getUrl6()
270
+        setTimeout(()=>{
271
+          this.getUrl6()
272
+        },1000)
265 273
 
266 274
       }
267 275
     });
@@ -456,13 +464,13 @@ class Gvc extends Component {
456 464
                                 <span>月:{item.mood}</span>
457 465
                                 <span>年:{item.year}</span>
458 466
                               </div>
459
-                              <div style={{ width: index == 5 ? "58%" : "55%" }}>
467
+                              <div style={{ width: index == 5 ? "58%" : "57%" }}>
460 468
                                 <p className="title">
461 469
                                   库存/吨
462 470
                                 </p>
463 471
                                 {
464 472
                                   get(item, "rawMaterial", []).map((ra, rai) => {
465
-                                    return <span>{ra.prodCatgory}{ra.indexValue}</span>
473
+                                    return <span>{ra.prodCatgory}:{ra.indexValue}</span>
466 474
                                   })
467 475
                                 }
468 476
                               </div>
@@ -479,7 +487,7 @@ class Gvc extends Component {
479 487
 
480 488
                               <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
481 489
                             </div>
482
-                            <div>
490
+                            <div style={{width:"60%"}}>
483 491
                               <p>产品库存</p>
484 492
                               {
485 493
                                 !changGif ? <span class="nums shu1">{item.inventory}</span> : <span class="nums">{getThousandNum(item.inventory)}</span>