@dayan_hjm 1 рік тому
батько
коміт
37585d3c60
3 змінених файлів з 80 додано та 67 видалено
  1. 8 1
      src/assets/css/styleTemplate.less
  2. 28 9
      src/pages/gvc/style.less
  3. 44 57
      src/pages/gvc/view.jsx

+ 8 - 1
src/assets/css/styleTemplate.less

@@ -2,7 +2,7 @@
2 2
  * @Author: dayan_hjm 茶百道主题样式
3 3
  * @Date: 2022-10-27 10:56:37 
4 4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-12-19 16:04:03
5
+ * @Last Modified time: 2024-07-21 17:58:15
6 6
  */
7 7
 
8 8
 @import url("../../themes/themes.less");
@@ -377,6 +377,13 @@
377 377
         padding: 1% 0 0 10%;
378 378
       }
379 379
     }
380
+    @media (max-height: 900px) {
381
+      .video_box{
382
+        top: -2em;
383
+      }
384
+
385
+    }
386
+
380 387
 
381 388
   }
382 389
 

+ 28 - 9
src/pages/gvc/style.less

@@ -64,7 +64,7 @@
64 64
           width: 17%;
65 65
           /* padding: 0 1em; */
66 66
           height: 70%;
67
-          margin-top: 5%;
67
+          margin-top: 4%;
68 68
           margin-left: 1%;
69 69
           padding-right: 7%;
70 70
 
@@ -76,21 +76,21 @@
76 76
             flex-wrap: wrap;
77 77
 
78 78
             >li {
79
-              height: 20%;
79
+              height: 22%;
80 80
               width: 100%;
81 81
               color: #fff;
82 82
               display: block;
83 83
 
84 84
               .top_div {
85 85
                 background: none;
86
-                width: 100%;
86
+                width: 110%;
87 87
                 height: 60%;
88 88
                 display: flex;
89 89
                 align-items: center;
90 90
                 justify-content: center;
91 91
 
92 92
                 >div {
93
-                  width: 51%;
93
+                  width: 47%;
94 94
                   position: relative;
95 95
                   display: block;
96 96
 
@@ -101,7 +101,7 @@
101 101
                   >span {
102 102
                     font-size: 0.9em;
103 103
                     position: absolute;
104
-                    width: 100%;
104
+                    width: 110%;
105 105
                     bottom: 15%;
106 106
                     left: 63%;
107 107
                     transform: skew(4deg, 334deg);
@@ -124,7 +124,7 @@
124 124
                 display: flex;
125 125
                 align-items: center;
126 126
                 justify-content: space-between;
127
-                margin-top: 1em;
127
+                // margin-top: 1em;
128 128
                 font-weight: normal;
129 129
                 font-size: 0.9em;
130 130
                 color: #CDF1FF;
@@ -144,12 +144,17 @@
144 144
         }
145 145
 
146 146
         @media (max-height: 900px) {
147
+          .leftContent{
148
+            margin-top: 1%;
149
+            height: 75%;
150
+          }
147 151
           .leftContent li {
148
-            height: 15% !important;
152
+            height: 23% !important;
149 153
 
150 154
             .text {
151 155
               width: 107% !important;
152
-              margin-top: 1em !important;
156
+              margin-top: 0;
157
+              padding-top: 0.5em !important;
153 158
 
154 159
               .topMsg_number {
155 160
                 font-size: 1em !important;
@@ -197,6 +202,7 @@
197 202
                 
198 203
             }
199 204
           }
205
+
200 206
         }
201 207
 
202 208
         @media (min-height: 900px) {
@@ -239,7 +245,8 @@
239 245
 
240 246
           li {
241 247
             position: absolute;
242
-            width: 19em;
248
+            width: 25em;
249
+            z-index: 10;
243 250
             height: 4em;
244 251
             opacity: 1;
245 252
             background: linear-gradient(0deg, #ffffff26 0%, #ffffff00 100%);
@@ -323,11 +330,23 @@
323 330
               }
324 331
             }
325 332
           }
333
+          @media (max-height: 900px) {
334
+            li .hoverDiv{
335
+              background:linear-gradient(0deg, #292929 0%, #252525 100%)!important;
336
+            }
337
+  
338
+          }
339
+
326 340
 
327 341
           li:hover {
328 342
             background: linear-gradient(0deg, #42ca9840 0%, #42ca9800 98%);
329 343
           }
330 344
         }
345
+        @media (max-height: 900px) {
346
+          .imgMsg {
347
+            top: -1.5em;
348
+          }
349
+        }
331 350
 
332 351
         .rightContent {
333 352
           width: 15%;

+ 44 - 57
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: 2024-01-22 14:26:38
5
+ * @Last Modified time: 2024-07-21 18:00:14
6 6
  */
7 7
 
8 8
 import React, { useState, useEffect, Component } from "react";
@@ -24,7 +24,7 @@ import {
24 24
 } from "./api";
25 25
 import MapViewTwo from "./component/mapView2.jsx";
26 26
 import mpVideoGvc from "@assets/imgs/dataVimg/videoGvc2.mp4";
27
-import { getThousandNum,deleteCacheAndChangeUrl,timestampToTime,setWaterMark } from "@utils/util";
27
+import { getThousandNum, deleteCacheAndChangeUrl, timestampToTime, setWaterMark } from "@utils/util";
28 28
 import 'animate.css';
29 29
 import { get } from "lodash";
30 30
 import $store from "@store/";
@@ -66,7 +66,7 @@ class Gvc extends Component {
66 66
           $store.app.setMarkSrc(
67 67
             setWaterMark({
68 68
               toDataURL: true,
69
-              waterMarkText: [data?.userId || sessionStorage.getItem("tqcUserName"),timestampToTime()],
69
+              waterMarkText: [data?.userId || sessionStorage.getItem("tqcUserName"), timestampToTime()],
70 70
             })
71 71
           );
72 72
         } else {
@@ -127,10 +127,10 @@ class Gvc extends Component {
127 127
         btn.removeEventListener('click', play);
128 128
         // 如果他自动播放了就隐藏按钮,消除点击事件
129 129
       } catch (err) {
130
-      if(model){
131
-        model.style.display = 'block';
132
-      }
133
-      if(btn){btn.addEventListener('click', play);}
130
+        if (model) {
131
+          model.style.display = 'block';
132
+        }
133
+        if (btn) { btn.addEventListener('click', play); }
134 134
         // 如果Promise返回的是error就引导用户点击按钮,在调用play方法
135 135
       }
136 136
     }
@@ -151,11 +151,11 @@ class Gvc extends Component {
151 151
         btn.removeEventListener('click', play);
152 152
       }
153 153
       else {
154
-        if(model){
154
+        if (model) {
155 155
           model.style.display = 'block';
156 156
         }
157
-        if(btn){btn.addEventListener('click', play);}
158
-        }
157
+        if (btn) { btn.addEventListener('click', play); }
158
+      }
159 159
     }
160 160
     play()
161 161
 
@@ -177,6 +177,7 @@ class Gvc extends Component {
177 177
             }
178 178
           );
179 179
         });
180
+        LeftHtml.unshift({ txt_name: '锂辉石(化学级)', num1: 40532.23, num2: '' })
180 181
         this.setState({ LeftHtml });
181 182
       }
182 183
     });
@@ -184,7 +185,7 @@ class Gvc extends Component {
184 185
   async getUrl2() {
185 186
     await bigShopService().then(({ data = [], resultCode }) => {
186 187
       if (+resultCode === 0) {
187
-        const name_ = ["", "锂辉石库存量", "锂辉石库存量", "累计运输锂辉石"];
188
+        const name_ = ["", "锂辉石(化学级)库存量", "锂辉石(化学级)库存量", "累计运输锂辉石(化学级)"];
188 189
         const style__ = [{}, { left: "34%", top: "30%" }, { left: "11%", top: "48%" }, { left: "0%", top: "22%" }]
189 190
         data = data.map((x, i) => {
190 191
           return {
@@ -237,9 +238,9 @@ class Gvc extends Component {
237 238
 
238 239
         console.log(old_imgMsgData, "old_imgMsgData")
239 240
         this.store.saveState({ imgMsgData: old_imgMsgData });
240
-        setTimeout(()=>{
241
+        setTimeout(() => {
241 242
           this.getUrl5()
242
-        },500)
243
+        }, 500)
243 244
       }
244 245
     });
245 246
   }
@@ -270,9 +271,9 @@ class Gvc extends Component {
270 271
         old_imgMsgData[7] = { ...old_imgMsgData[7], ...d_5 };
271 272
         console.log(old_imgMsgData, "1111old_imgMsgData")
272 273
         this.store.saveState({ imgMsgData: old_imgMsgData });
273
-        setTimeout(()=>{
274
+        setTimeout(() => {
274 275
           this.getUrl6()
275
-        },1000)
276
+        }, 1000)
276 277
 
277 278
       }
278 279
     });
@@ -283,36 +284,17 @@ class Gvc extends Component {
283 284
       if (+resultCode === 0) {
284 285
         function getItems(num) {
285 286
           const datas = data.filter(x => { return x.factoryCode == num });
286
-          const rawMaterial = datas.map((item, index) => {
287
+          let rawMaterial = datas.map((item, index) => {
287 288
             return {
288 289
               prodCatgory: item.prodCatgory,
289 290
               indexValue: getThousandNum(item.indexValue),
290 291
             }
291 292
           })
292
-          // const par = {
293
-          //   rawMaterial: [
294
-          //     {
295
-          //       prodCatgory: "原料-鲤辉石",
296
-          //       indexValue: datas?.filter(x => { return x.prodCatgory == 1 })?.[0]?.indexValue || 0,
297
-          //     },
298
-          //     {
299
-          //       prodCatgory: "产品-碳酸锂",
300
-          //       indexValue: datas?.filter(x => { return x.prodCatgory == 2 })?.[0]?.indexValue || 0,
301
-          //     },
302
-          //     {
303
-          //       prodCatgory: "原料-氯化锂",
304
-          //       indexValue: datas?.filter(x => { return x.prodCatgory == 3 })?.[0]?.indexValue || 0,
305
-          //     },
306
-          //     {
307
-          //       prodCatgory: "产品-氢氧化锂",
308
-          //       indexValue: datas?.filter(x => { return x.prodCatgory == 4 })?.[0]?.indexValue || 0,
309
-          //     },
310
-          //     {
311
-          //       prodCatgory: "产品-金属锂",
312
-          //       indexValue: datas?.filter(x => { return x.prodCatgory == 5 })?.[0]?.indexValue || 0,
313
-          //     }
314
-          //   ]
315
-          // }
293
+          // rawMaterial.push({prodCatgory:'锂辉石(化学级)-XXXXX仓',indexValue:33231.88})
294
+          // rawMaterial.push({prodCatgory:'锂辉石(化学级)-XXXXX仓',indexValue:33231.88})
295
+          // rawMaterial.push({prodCatgory:'锂辉石(化学级)-XXXXX仓',indexValue:33231.88})
296
+          // rawMaterial.push({prodCatgory:'锂辉石(化学级)-XXXXX仓',indexValue:33231.88})
297
+          // rawMaterial.push({prodCatgory:'锂辉石(化学级)-XXXXX仓',indexValue:33231.88})
316 298
           return { rawMaterial: rawMaterial }
317 299
         }
318 300
 
@@ -355,32 +337,37 @@ class Gvc extends Component {
355 337
         <div className={"top_div"}>
356 338
           <div class="animate__animated animate__pulse animate__slower animate__infinite">
357 339
             {i === 0 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu1.png").default} alt="" />}
358
-            {i === 1 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu2.png").default} alt="" />}
359
-            {i === 2 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu3.png").default} alt="" />}
360
-            {i === 3 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu4.png").default} alt="" />}
340
+            {i === 1 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu1.png").default} alt="" />}
341
+            {i === 2 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu2.png").default} alt="" />}
342
+            {i === 3 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu3.png").default} alt="" />}
343
+            {i === 4 && <img class="img1" src={require("@assets/imgs/dataVimg/qiu4.png").default} alt="" />}
361 344
             {i === 0 && <img src={require("@assets/imgs/gvc/qiuH1.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
362
-            {i === 1 && <img src={require("@assets/imgs/gvc/qiuH2.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
363
-            {i === 2 && <img src={require("@assets/imgs/gvc/qiuH3.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
364
-            {i === 3 && <img src={require("@assets/imgs/gvc/qiuH4.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
345
+            {i === 1 && <img src={require("@assets/imgs/gvc/qiuH1.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
346
+            {i === 2 && <img src={require("@assets/imgs/gvc/qiuH2.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
347
+            {i === 3 && <img src={require("@assets/imgs/gvc/qiuH3.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
348
+            {i === 4 && <img src={require("@assets/imgs/gvc/qiuH4.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
365 349
             <span>{x.txt_name}</span>
366 350
           </div>
367 351
         </div>
368 352
         <div className="text">
369 353
           <div>
370
-            <p>累计产量</p>
354
+            <p>{i == 0 ? '库存' : '累计产量'}</p>
371 355
             {
372 356
               !changGif ? <span class="topMsg_number shu1">{x.num1}</span> : <span class="topMsg_number">{getThousandNum(x.num1)}</span>
373 357
             }
374 358
 
375 359
             <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
376 360
           </div>
377
-          <div>
378
-            <p>产品库存</p>
379
-            {
380
-              !changGif ? <span class="topMsg_number shu1">{x.num2}</span> : <span class="topMsg_number">{getThousandNum(x.num2)}</span>
381
-            }
382
-            <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
383
-          </div>
361
+          {
362
+            i != 0 && <div>
363
+              <p>产品库存</p>
364
+              {
365
+                !changGif ? <span class="topMsg_number shu1">{x.num2}</span> : <span class="topMsg_number">{getThousandNum(x.num2)}</span>
366
+              }
367
+              <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
368
+            </div>
369
+
370
+          }
384 371
         </div>
385 372
       </li>
386 373
 
@@ -400,7 +387,7 @@ class Gvc extends Component {
400 387
         {/* 右键切换大屏 */}
401 388
         <Tooltip placement="bottom" title={"数据运营中心"}>
402 389
           <img src={require("@assets/imgs/iconJpg/rightJ.png").default} alt="" className={"rightJ_png"} onClick={() => {
403
-            deleteCacheAndChangeUrl("/home/operation",(url)=>{
390
+            deleteCacheAndChangeUrl("/home/operation", (url) => {
404 391
               this.props.history.replace(url);
405 392
             })
406 393
 
@@ -408,7 +395,7 @@ class Gvc extends Component {
408 395
         </Tooltip>
409 396
         <Tooltip placement="bottom" title={"数据运营中心"}>
410 397
           <img src={require("@assets/imgs/iconJpg/rightJL.png").default} alt="" className={"rightJ_png rightJ_png_L"} onClick={() => {
411
-            deleteCacheAndChangeUrl("/home/operation",(url)=>{
398
+            deleteCacheAndChangeUrl("/home/operation", (url) => {
412 399
               this.props.history.replace(url);
413 400
             })
414 401
           }} />
@@ -494,7 +481,7 @@ class Gvc extends Component {
494 481
 
495 482
                               <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
496 483
                             </div>
497
-                            <div style={{width:"60%"}}>
484
+                            <div style={{ width: "60%" }}>
498 485
                               <p>产品库存</p>
499 486
                               {
500 487
                                 !changGif ? <span class="nums shu1">{item.inventory}</span> : <span class="nums">{getThousandNum(item.inventory)}</span>