@dayan_hjm пре 2 година
родитељ
комит
6d2d506d54

BIN
src/assets/imgs/gvc/car.png


+ 1 - 1
src/pages/gvc/api.js

@@ -59,7 +59,7 @@ export function smallDayService(params) {
59
         "indexValue"
59
         "indexValue"
60
       ],
60
       ],
61
       "pageNum": 1,
61
       "pageNum": 1,
62
-      "pageSize": 10,
62
+      "pageSize": 20,
63
       "useResultCache": false
63
       "useResultCache": false
64
     },
64
     },
65
     headers: {
65
     headers: {

+ 3 - 2
src/pages/gvc/component/rightBottomView.jsx

@@ -2,7 +2,7 @@
2
  * @Author: dayan_hjm 累计销量客户
2
  * @Author: dayan_hjm 累计销量客户
3
  * @Date: 2023-10-23 09:32:12 
3
  * @Date: 2023-10-23 09:32:12 
4
  * @Last Modified by: dayan_hjm
4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-11-16 17:05:05
5
+ * @Last Modified time: 2023-11-28 10:27:31
6
  */
6
  */
7
 
7
 
8
 import React, { useState, useEffect, Component } from "react";
8
 import React, { useState, useEffect, Component } from "react";
@@ -18,6 +18,7 @@ import {
18
   rollService,
18
   rollService,
19
 } from "../api";
19
 } from "../api";
20
 import { get, } from "lodash";
20
 import { get, } from "lodash";
21
+import { getThousandNum } from "@utils/util";
21
 
22
 
22
 @withRouter
23
 @withRouter
23
 
24
 
@@ -84,7 +85,7 @@ class RightBottomView extends Component {
84
                 <div className="slider_box">
85
                 <div className="slider_box">
85
                   <div className="slider_top">
86
                   <div className="slider_top">
86
                     <p>{i + 1}.<span>{x.name}</span></p>
87
                     <p>{i + 1}.<span>{x.name}</span></p>
87
-                    <p className="p2">{x.num}</p>
88
+                    <p className="p2">{getThousandNum(x.num)}</p>
88
                   </div>
89
                   </div>
89
                   <Progress
90
                   <Progress
90
                     strokeColor={{
91
                     strokeColor={{

+ 53 - 46
src/pages/gvc/view.jsx

@@ -2,7 +2,7 @@
2
  * @Author: dayan_hjm  产供销价值链
2
  * @Author: dayan_hjm  产供销价值链
3
  * @Date: 2023-11-10 10:19:34 
3
  * @Date: 2023-11-10 10:19:34 
4
  * @Last Modified by: dayan_hjm
4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-11-27 17:16:02
5
+ * @Last Modified time: 2023-11-28 10:30:13
6
  */
6
  */
7
 
7
 
8
 import React, { useState, useEffect, Component } from "react";
8
 import React, { useState, useEffect, Component } from "react";
@@ -24,6 +24,7 @@ import {
24
 } from "./api";
24
 } from "./api";
25
 import MapViewTwo from "./component/mapView2.jsx";
25
 import MapViewTwo from "./component/mapView2.jsx";
26
 import mpVideoGvc from "@assets/imgs/dataVimg/videoGvc2.mp4";
26
 import mpVideoGvc from "@assets/imgs/dataVimg/videoGvc2.mp4";
27
+import { getThousandNum } from "@utils/util";
27
 
28
 
28
 import 'animate.css';
29
 import 'animate.css';
29
 import { get } from "lodash";
30
 import { get } from "lodash";
@@ -68,26 +69,31 @@ class Gvc extends Component {
68
     }
69
     }
69
   }
70
   }
70
   componentDidMount() {
71
   componentDidMount() {
71
-    // this.fontMsgChange();
72
     this.getUrl();
72
     this.getUrl();
73
     this.getUrl2()
73
     this.getUrl2()
74
     this.getUrl4()
74
     this.getUrl4()
75
     this.getUrl3();
75
     this.getUrl3();
76
-
77
-
78
     setTimeout(() => {
76
     setTimeout(() => {
79
       this.videoStart();
77
       this.videoStart();
80
     }, 200)
78
     }, 200)
81
     setTimeout(() => {
79
     setTimeout(() => {
82
       //替换gif
80
       //替换gif
83
-      this.setState({ changGif: true });
84
-      $(".shu1").numScroll();
81
+      $(".shu1").numScroll({time:3000});
82
+      // this.changeAllShu()
85
     }, 3000)
83
     }, 3000)
86
-    // setTimeout(() => {
87
-    //   setTimeout(() => {
88
-    //   }, 500)
89
-    // }, 4000)
84
+    setTimeout(() => {
85
+      this.setState({ changGif: true });
86
+    }, 4500)
90
   }
87
   }
88
+
89
+  changeAllShu(){
90
+    const stu_input = document.getElementsByClassName("shu1");
91
+    for(var i=0;i<stu_input.length;i++){
92
+      console.log(stu_input[i],"arr_")
93
+      console.log(stu_input[i].value,"arr_")
94
+    }
95
+  }
96
+
91
   videoStart() {
97
   videoStart() {
92
     /*     Chrome 浏览器的视频自动播放策略
98
     /*     Chrome 浏览器的视频自动播放策略
93
         1.始终允许静音模式下自动播放
99
         1.始终允许静音模式下自动播放
@@ -147,7 +153,7 @@ class Gvc extends Component {
147
   async getUrl() {
153
   async getUrl() {
148
     await leftService().then(({ data = [], resultCode }) => {
154
     await leftService().then(({ data = [], resultCode }) => {
149
       if (+resultCode === 0) {
155
       if (+resultCode === 0) {
150
-        let LeftHtml = [], name_ = ["碳酸锂", '氢氧化', '氯化锂', '金属锂'];
156
+        let LeftHtml = [], name_ = ["碳酸锂", '氢氧化', '氯化锂', '金属锂'];
151
         data.map((x, i) => {
157
         data.map((x, i) => {
152
           if (i >= 4) {
158
           if (i >= 4) {
153
             return
159
             return
@@ -194,7 +200,7 @@ class Gvc extends Component {
194
   async getUrl4() {
200
   async getUrl4() {
195
     await smallShopService().then(({ data = [], resultCode }) => {
201
     await smallShopService().then(({ data = [], resultCode }) => {
196
       if (+resultCode === 0) {
202
       if (+resultCode === 0) {
197
-        const style__ = [{}, { left: "88%", top: "28%" }, { left: "70%", top: "46%" }, { left: "52%", top: "59%" }, { left: "11%", top: "90%" }, { left: "29%", top: "76%" }]
203
+        const style__ = [{}, { left: "88%", top: "28%" }, { left: "70%", top: "46%" }, { left: "52%", top: "59%" }, { left: "29%", top: "76%" }, { left: "11%", top: "89%" }]
198
         data = data.map((x, i) => {0
204
         data = data.map((x, i) => {0
199
           return {
205
           return {
200
             ...x,
206
             ...x,
@@ -205,8 +211,8 @@ class Gvc extends Component {
205
             inventory: x.inventory,
211
             inventory: x.inventory,
206
           }
212
           }
207
         });
213
         });
208
-        const d_1 = data.filter(x => { return x.factoryCode == 4 })[0];
209
-        const d_2 = data.filter(x => { return x.factoryCode == 5 })[0];
214
+        const d_1 = data.filter(x => { return x.factoryCode == 5 })[0];
215
+        const d_2 = data.filter(x => { return x.factoryCode == 4 })[0];
210
         const d_3 = data.filter(x => { return x.factoryCode == 3 })[0];
216
         const d_3 = data.filter(x => { return x.factoryCode == 3 })[0];
211
         const d_4 = data.filter(x => { return x.factoryCode == 2 })[0];
217
         const d_4 = data.filter(x => { return x.factoryCode == 2 })[0];
212
         const d_5 = data.filter(x => { return x.factoryCode == 1 })[0];
218
         const d_5 = data.filter(x => { return x.factoryCode == 1 })[0];
@@ -216,6 +222,8 @@ class Gvc extends Component {
216
         old_imgMsgData[5] = d_3;
222
         old_imgMsgData[5] = d_3;
217
         old_imgMsgData[6] = d_4;
223
         old_imgMsgData[6] = d_4;
218
         old_imgMsgData[7] = d_5;
224
         old_imgMsgData[7] = d_5;
225
+        
226
+
219
         console.log(old_imgMsgData, "old_imgMsgData")
227
         console.log(old_imgMsgData, "old_imgMsgData")
220
         this.store.saveState({ imgMsgData: old_imgMsgData });
228
         this.store.saveState({ imgMsgData: old_imgMsgData });
221
         this.getUrl5()
229
         this.getUrl5()
@@ -228,13 +236,13 @@ class Gvc extends Component {
228
         function getItems(num) {
236
         function getItems(num) {
229
           const datas = data.filter(x => { return x.factoryCode == num });
237
           const datas = data.filter(x => { return x.factoryCode == num });
230
           const par = {
238
           const par = {
231
-            day: datas?.filter(x => { return x.dateType == 1 })?.[0]?.indexValue || 0,
232
-            mood: datas?.filter(x => { return x.dateType == 2 })?.[0]?.indexValue || 0,
233
-            year: datas?.filter(x => { return x.dateType == 3 })?.[0]?.indexValue || 0,
239
+            day: getThousandNum(datas?.filter(x => { return x.dateType == 1 })?.[0]?.indexValue || 0),
240
+            mood: getThousandNum(datas?.filter(x => { return x.dateType == 2 })?.[0]?.indexValue || 0),
241
+            year: getThousandNum(datas?.filter(x => { return x.dateType == 3 })?.[0]?.indexValue || 0),
234
           }
242
           }
235
           return par
243
           return par
236
         }
244
         }
237
-
245
+        
238
         const d_1 = getItems(5);
246
         const d_1 = getItems(5);
239
         const d_2 = getItems(4);
247
         const d_2 = getItems(4);
240
         const d_3 = getItems(3);
248
         const d_3 = getItems(3);
@@ -263,7 +271,7 @@ class Gvc extends Component {
263
           const rawMaterial = datas.map((item, index) => {
271
           const rawMaterial = datas.map((item, index) => {
264
             return {
272
             return {
265
               prodCatgory: item.prodCatgory,
273
               prodCatgory: item.prodCatgory,
266
-              indexValue: item.indexValue,
274
+              indexValue: getThousandNum(item.indexValue),
267
             }
275
             }
268
           })
276
           })
269
           // const par = {
277
           // const par = {
@@ -298,6 +306,8 @@ class Gvc extends Component {
298
         const d_3 = getItems(3);
306
         const d_3 = getItems(3);
299
         const d_4 = getItems(2);
307
         const d_4 = getItems(2);
300
         const d_5 = getItems(1);
308
         const d_5 = getItems(1);
309
+        
310
+
301
         let old_imgMsgData = this.store.state.imgMsgData;
311
         let old_imgMsgData = this.store.state.imgMsgData;
302
         old_imgMsgData[3] = { ...old_imgMsgData[3], ...d_1 };
312
         old_imgMsgData[3] = { ...old_imgMsgData[3], ...d_1 };
303
         old_imgMsgData[4] = { ...old_imgMsgData[4], ...d_2 };
313
         old_imgMsgData[4] = { ...old_imgMsgData[4], ...d_2 };
@@ -322,29 +332,9 @@ class Gvc extends Component {
322
     this.timer = null;
332
     this.timer = null;
323
   }
333
   }
324
 
334
 
325
-  fontMsgChange() {
326
-    this.timer = setInterval(() => {
327
-      const { plannedCompletionData, plannedCompletionNum, manHourData, manHourNum } = this.state;
328
-
329
-      //产量计划完成率
330
-      var p1 = document.getElementById('plannedCompletionBox');
331
-      const datas_ = plannedCompletionData[plannedCompletionNum - 1];
332
-      var res = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number shu1">' + datas_?.value.toFixed(2) + '</span><span class="topMsg_number_2" style={{fontSize: "0.75em",color: "#fff"}}>%</span><p class="topMsg_number_p">' + datas_.name + '</p></div>';
333
-      p1.innerHTML = res;
334
-
335
-      //百万工时损工率
336
-      var p2 = document.getElementById('manHourBox');
337
-      const datas_2 = manHourData[manHourNum - 1];
338
-      var res2 = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number shu1">' + datas_2?.value.toFixed(2) + '</span><span class="topMsg_number_2">%</span><p class="topMsg_number_p">' + datas_2.name + '</p></div>';
339
-      p2.innerHTML = res2;
340
-
341
-      const num_ = plannedCompletionNum + 1 >= plannedCompletionData.length ? 1 : plannedCompletionNum + 1;
342
-      const num_2 = manHourNum + 1 >= manHourData.length ? 1 : manHourNum + 1;
343
-      this.setState({ plannedCompletionNum: num_, manHourNum: num_2 })
344
-    }, 4000)
345
-  }
346
 
335
 
347
   getLeftHtml(x, i) {
336
   getLeftHtml(x, i) {
337
+    const { changGif } = this.state;
348
     return (
338
     return (
349
       <li>
339
       <li>
350
         <div className={"top_div"}>
340
         <div className={"top_div"}>
@@ -363,11 +353,18 @@ class Gvc extends Component {
363
         <div className="text">
353
         <div className="text">
364
           <div>
354
           <div>
365
             <p>累计产量</p>
355
             <p>累计产量</p>
366
-            <span class="topMsg_number shu1">{x.num1}</span><span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
356
+            {
357
+              !changGif ? <span class="topMsg_number shu1">{x.num1}</span> : <span class="topMsg_number">{getThousandNum(x.num1)}</span>
358
+            }
359
+            
360
+            <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
367
           </div>
361
           </div>
368
           <div>
362
           <div>
369
             <p>产品库存</p>
363
             <p>产品库存</p>
370
-            <span class="topMsg_number shu1">{x.num2}</span><span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
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>
371
           </div>
368
           </div>
372
         </div>
369
         </div>
373
       </li>
370
       </li>
@@ -378,7 +375,7 @@ class Gvc extends Component {
378
   render() {
375
   render() {
379
     const stores = this.store.state;
376
     const stores = this.store.state;
380
     let { totalValue, yearDecline, yearSend, imgMsgData } = this.store.state;
377
     let { totalValue, yearDecline, yearSend, imgMsgData } = this.store.state;
381
-    let { LeftHtml, updateTime } = this.state;
378
+    let { LeftHtml, updateTime,changGif } = this.state;
382
     return (
379
     return (
383
       <div className={[styles.gvc_home + ' home_box ']}>
380
       <div className={[styles.gvc_home + ' home_box ']}>
384
         <div className={"all_box"}>
381
         <div className={"all_box"}>
@@ -414,7 +411,10 @@ class Gvc extends Component {
414
                           item.totalName && <p className="name">{item.totalName}</p>
411
                           item.totalName && <p className="name">{item.totalName}</p>
415
                         }
412
                         }
416
                         {
413
                         {
417
-                          item.totalName && <span class="shu1 nums">{item.total}</span>
414
+                          item.totalName && !changGif && <span class="shu1 nums">{item.total}</span>
415
+                        }
416
+                        {
417
+                          item.totalName && changGif && <span class="nums">{getThousandNum(item.total)}</span>
418
                         }
418
                         }
419
                         {
419
                         {
420
                           item.totalName && <span className="sma">吨</span>
420
                           item.totalName && <span className="sma">吨</span>
@@ -449,11 +449,18 @@ class Gvc extends Component {
449
                           item.cumulativeProduction !== null && <div className="chanL text">
449
                           item.cumulativeProduction !== null && <div className="chanL text">
450
                             <div>
450
                             <div>
451
                               <p>累计产量</p>
451
                               <p>累计产量</p>
452
-                              <span class="nums shu1">{item.cumulativeProduction}</span><span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
452
+                              {
453
+                                !changGif ? <span class="nums shu1">{item.cumulativeProduction}</span> : <span class="nums">{getThousandNum(item.cumulativeProduction)}</span>
454
+                              }
455
+                              
456
+                              <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
453
                             </div>
457
                             </div>
454
                             <div>
458
                             <div>
455
                               <p>产品库存</p>
459
                               <p>产品库存</p>
456
-                              <span class="nums shu1">{item.inventory}</span><span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
460
+                              {
461
+                                !changGif ? <span class="nums shu1">{item.inventory}</span> : <span class="nums">{getThousandNum(item.inventory)}</span>
462
+                              }
463
+                              <span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
457
                             </div>
464
                             </div>
458
 
465
 
459
                           </div>
466
                           </div>

+ 6 - 5
src/pages/tqcDataVHome/component/leftMenoyView.jsx

@@ -2,7 +2,7 @@
2
  * @Author: dayan_hjm 库存金额
2
  * @Author: dayan_hjm 库存金额
3
  * @Date: 2023-10-23 09:32:12 
3
  * @Date: 2023-10-23 09:32:12 
4
  * @Last Modified by: dayan_hjm
4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-11-16 11:01:51
5
+ * @Last Modified time: 2023-11-28 10:43:30
6
  */
6
  */
7
 
7
 
8
 
8
 
@@ -11,6 +11,7 @@ import styles from "../style.less";
11
 import { useHistory, useLocation, withRouter } from "react-router-dom";
11
 import { useHistory, useLocation, withRouter } from "react-router-dom";
12
 import mod from '../mod';
12
 import mod from '../mod';
13
 import { getArrMax } from "@utils/util";
13
 import { getArrMax } from "@utils/util";
14
+import { getThousandNum } from "@utils/util";
14
 import {
15
 import {
15
   momeyService,
16
   momeyService,
16
 } from "../api";
17
 } from "../api";
@@ -24,12 +25,12 @@ class LeftMenoyView extends Component {
24
     this.store = mod;
25
     this.store = mod;
25
     this.state = {
26
     this.state = {
26
       max1:[],
27
       max1:[],
27
-      year:["碳酸锂","氧化纳",'金属锂',"氢氧化"],
28
+      year:["碳酸锂","氧化纳",'金属锂',"氢氧化"],
28
       missionsIntensity_arr:[
29
       missionsIntensity_arr:[
29
         {value:0,name:"碳酸锂"},
30
         {value:0,name:"碳酸锂"},
30
         {value:0,name:"氧化纳"},
31
         {value:0,name:"氧化纳"},
31
         {value:0,name:'金属锂'},
32
         {value:0,name:'金属锂'},
32
-        {value:0,name:"氢氧化"},
33
+        {value:0,name:"氢氧化"},
33
       ],
34
       ],
34
     };
35
     };
35
   }
36
   }
@@ -208,7 +209,7 @@ class LeftMenoyView extends Component {
208
               show: true,
209
               show: true,
209
               position: 'right',
210
               position: 'right',
210
               formatter: function (param) {
211
               formatter: function (param) {
211
-                return param.value + '万元';
212
+                return getThousandNum(param.value) + '万元';
212
                 // return param.name+":"+param.value + '万元';
213
                 // return param.name+":"+param.value + '万元';
213
 
214
 
214
               },
215
               },
@@ -312,7 +313,7 @@ class LeftMenoyView extends Component {
312
         // //标题
313
         // //标题
313
         // title: {
314
         // title: {
314
         //   text: '16%',
315
         //   text: '16%',
315
-        //   subtext: '氢氧化',
316
+        //   subtext: '氢氧化',
316
         //   x: 'center',
317
         //   x: 'center',
317
         //   y: '40%',
318
         //   y: '40%',
318
         //   textStyle: {
319
         //   textStyle: {

+ 52 - 15
src/pages/tqcDataVHome/view.jsx

@@ -2,7 +2,7 @@
2
  * @Author: dayan_hjm 
2
  * @Author: dayan_hjm 
3
  * @Date: 2023-10-25 10:32:44 
3
  * @Date: 2023-10-25 10:32:44 
4
  * @Last Modified by: dayan_hjm
4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-11-27 17:16:04
5
+ * @Last Modified time: 2023-11-28 10:41:00
6
  */
6
  */
7
 /*
7
 /*
8
  * @Author: dayan_hjm 
8
  * @Author: dayan_hjm 
@@ -30,6 +30,7 @@ import {
30
   checkToken,
30
   checkToken,
31
   updateTimeService
31
   updateTimeService
32
 } from "./api";
32
 } from "./api";
33
+import { getThousandNum } from "@utils/util";
33
 
34
 
34
 import 'animate.css';
35
 import 'animate.css';
35
 @withRouter
36
 @withRouter
@@ -42,6 +43,7 @@ class Home extends Component {
42
     this.state = {
43
     this.state = {
43
       updateTime: '',
44
       updateTime: '',
44
       changGif: false,
45
       changGif: false,
46
+      changNun: false,
45
       plannedCompletionData: [
47
       plannedCompletionData: [
46
       ],
48
       ],
47
       plannedCompletionNum: 1,
49
       plannedCompletionNum: 1,
@@ -52,7 +54,7 @@ class Home extends Component {
52
     this.timer = null //定时器,用于检测同步状态
54
     this.timer = null //定时器,用于检测同步状态
53
   }
55
   }
54
   componentWillMount() {
56
   componentWillMount() {
55
-    if(window.location.host.indexOf("localhost") == -1){
57
+    if (window.location.host.indexOf("localhost") == -1) {
56
       this.getToken()
58
       this.getToken()
57
     }
59
     }
58
   }
60
   }
@@ -81,8 +83,11 @@ class Home extends Component {
81
     setTimeout(() => {
83
     setTimeout(() => {
82
       //替换gif
84
       //替换gif
83
       this.setState({ changGif: true });
85
       this.setState({ changGif: true });
86
+    }, 2000);
87
+    setTimeout(() => {
88
+      this.setState({ changNun: true });
89
+    }, 4500)
84
 
90
 
85
-    }, 2000)
86
   }
91
   }
87
   videoStart() {
92
   videoStart() {
88
     /*     Chrome 浏览器的视频自动播放策略
93
     /*     Chrome 浏览器的视频自动播放策略
@@ -144,7 +149,7 @@ class Home extends Component {
144
       if (+resultCode === 0) {
149
       if (+resultCode === 0) {
145
         let plannedCompletionData = [], manHourData = [];
150
         let plannedCompletionData = [], manHourData = [];
146
         data.map((x, i) => {
151
         data.map((x, i) => {
147
-          if(x.indexValue){
152
+          if (x.indexValue) {
148
             if (x.indexName == '产量计划完成率') {
153
             if (x.indexName == '产量计划完成率') {
149
               plannedCompletionData.push({
154
               plannedCompletionData.push({
150
                 name: x.factoryName,
155
                 name: x.factoryName,
@@ -197,20 +202,30 @@ class Home extends Component {
197
     this.timer = null;
202
     this.timer = null;
198
   }
203
   }
199
 
204
 
200
-  fontMsgChange() {
205
+  fontMsgChange(type) {
201
     this.timer = setInterval(() => {
206
     this.timer = setInterval(() => {
202
       const { plannedCompletionData, plannedCompletionNum, manHourData, manHourNum } = this.state;
207
       const { plannedCompletionData, plannedCompletionNum, manHourData, manHourNum } = this.state;
203
 
208
 
204
       //产量计划完成率
209
       //产量计划完成率
205
       var p1 = document.getElementById('plannedCompletionBox');
210
       var p1 = document.getElementById('plannedCompletionBox');
206
       const datas_ = plannedCompletionData[plannedCompletionNum - 1];
211
       const datas_ = plannedCompletionData[plannedCompletionNum - 1];
207
-      var res = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number shu1">' + datas_?.value.toFixed(2) + '</span><span class="topMsg_number_2" style={{fontSize: "0.75em",color: "#fff"}}>%</span><p class="topMsg_number_p">' + datas_.name + '</p></div>';
212
+      var res;
213
+      if (type) {
214
+        res = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number">' + getThousandNum(datas_?.value.toFixed(2)) + '</span><span class="topMsg_number_2" style={{fontSize: "0.75em",color: "#fff"}}>%</span><p class="topMsg_number_p">' + datas_.name + '</p></div>';
215
+      } else {
216
+        res = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number shu1">' + datas_?.value.toFixed(2) + '</span><span class="topMsg_number_2" style={{fontSize: "0.75em",color: "#fff"}}>%</span><p class="topMsg_number_p">' + datas_.name + '</p></div>';
217
+      }
208
       p1.innerHTML = res;
218
       p1.innerHTML = res;
209
 
219
 
210
       //百万工时损工率
220
       //百万工时损工率
211
       var p2 = document.getElementById('manHourBox');
221
       var p2 = document.getElementById('manHourBox');
212
       const datas_2 = manHourData[manHourNum - 1];
222
       const datas_2 = manHourData[manHourNum - 1];
213
-      var res2 = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number shu1">' + datas_2?.value.toFixed(2) + '</span><span class="topMsg_number_2">%</span><p class="topMsg_number_p">' + datas_2.name + '</p></div>';
223
+      var res2;
224
+      if (type) {
225
+        res2 = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number">' + getThousandNum(datas_2?.value.toFixed(2)) + '</span><span class="topMsg_number_2">%</span><p class="topMsg_number_p">' + datas_2.name + '</p></div>';
226
+      } else {
227
+        res2 = '<div class="topMsg_box animate__animated animate__zoomIn"><span class="topMsg_number shu1">' + datas_2?.value.toFixed(2) + '</span><span class="topMsg_number_2">%</span><p class="topMsg_number_p">' + datas_2.name + '</p></div>';
228
+      }
214
       p2.innerHTML = res2;
229
       p2.innerHTML = res2;
215
 
230
 
216
       const num_ = plannedCompletionNum + 1 > plannedCompletionData.length ? 1 : plannedCompletionNum + 1;
231
       const num_ = plannedCompletionNum + 1 > plannedCompletionData.length ? 1 : plannedCompletionNum + 1;
@@ -222,7 +237,7 @@ class Home extends Component {
222
   render() {
237
   render() {
223
     const stores = this.store.state;
238
     const stores = this.store.state;
224
     let { totalValue, yearDecline, yearSend, productInventory } = this.store.state;
239
     let { totalValue, yearDecline, yearSend, productInventory } = this.store.state;
225
-    let { changGif, updateTime, } = this.state;
240
+    let { changGif, updateTime, changNun } = this.state;
226
     return (
241
     return (
227
       <div className={"home_box"}>
242
       <div className={"home_box"}>
228
         {/* 视频播放器 */}
243
         {/* 视频播放器 */}
@@ -239,7 +254,13 @@ class Home extends Component {
239
                   <p className="topMsg_title">总产值</p>
254
                   <p className="topMsg_title">总产值</p>
240
                 </Tooltip>
255
                 </Tooltip>
241
                 <div className={changGif ? "topMsg_content changBg_topMsg_content" : "topMsg_content"}>
256
                 <div className={changGif ? "topMsg_content changBg_topMsg_content" : "topMsg_content"}>
242
-                  <span className="topMsg_number" class="shu1">{totalValue}</span><span className="topMsg_number_2">万元</span>
257
+                  {
258
+                    !changNun && <span className="topMsg_number" class="shu1">{totalValue}</span>
259
+                  }
260
+                  {
261
+                    changNun && <span className="topMsg_number">{getThousandNum(totalValue)}</span>
262
+                  }
263
+                  <span className="topMsg_number_2">万元</span>
243
                 </div>
264
                 </div>
244
               </div>
265
               </div>
245
             </div>
266
             </div>
@@ -275,7 +296,12 @@ class Home extends Component {
275
                   <div className="topMsg_content">
296
                   <div className="topMsg_content">
276
                     <div className="center_li">
297
                     <div className="center_li">
277
                       <div className="right_li">
298
                       <div className="right_li">
278
-                        <span className="topMsg_number" class="shu1">{yearDecline}</span>
299
+                        {
300
+                          !changNun && <span className="topMsg_number" class="shu1">{yearDecline}</span>
301
+                        }
302
+                        {
303
+                          changNun && <span className="topMsg_number">{getThousandNum(yearDecline)}</span>
304
+                        }
279
                         <p className="topMsg_line"></p>
305
                         <p className="topMsg_line"></p>
280
                         <Tooltip placement="bottom" title={' ● 即为从当年1月1日至更新数据ETL日期当天的产量之和(含外加工)'}>
306
                         <Tooltip placement="bottom" title={' ● 即为从当年1月1日至更新数据ETL日期当天的产量之和(含外加工)'}>
281
                           <span className="topMsg_tip">年度产量/吨</span>
307
                           <span className="topMsg_tip">年度产量/吨</span>
@@ -284,7 +310,12 @@ class Home extends Component {
284
                     </div>
310
                     </div>
285
                     <div className="center_li">
311
                     <div className="center_li">
286
                       <div className="right_li">
312
                       <div className="right_li">
287
-                        <span className="topMsg_number" class="shu1">{productInventory}</span>
313
+                        {
314
+                          !changNun && <span className="topMsg_number" class="shu1">{productInventory}</span>
315
+                        }
316
+                        {
317
+                          changNun && <span className="topMsg_number">{getThousandNum(productInventory)}</span>
318
+                        }
288
                         <p className="topMsg_line"></p>
319
                         <p className="topMsg_line"></p>
289
                         <Tooltip placement="bottom" title={' ● 即为从当年1月1日至更新数据ETL日期当天的发货量之和(含外加工)'}>
320
                         <Tooltip placement="bottom" title={' ● 即为从当年1月1日至更新数据ETL日期当天的发货量之和(含外加工)'}>
290
                           <span className="topMsg_tip">年度发货量/吨</span>
321
                           <span className="topMsg_tip">年度发货量/吨</span>
@@ -292,7 +323,12 @@ class Home extends Component {
292
                       </div>
323
                       </div>
293
                     </div>
324
                     </div>
294
                     <div className="center_li">
325
                     <div className="center_li">
295
-                      <span className="topMsg_number" class="shu1">{yearSend}</span>
326
+                      {
327
+                        !changNun && <span className="topMsg_number" class="shu1">{yearSend}</span>
328
+                      }
329
+                      {
330
+                        changNun && <span className="topMsg_number">{getThousandNum(yearSend)}</span>
331
+                      }
296
                       <p className="topMsg_line"></p>
332
                       <p className="topMsg_line"></p>
297
                       <Tooltip placement="bottom" title={' ● 更新数据ETL日期当天的产品库存数量(含外加工)'}>
333
                       <Tooltip placement="bottom" title={' ● 更新数据ETL日期当天的产品库存数量(含外加工)'}>
298
                         <span className="topMsg_tip">产品库存/吨</span>
334
                         <span className="topMsg_tip">产品库存/吨</span>
@@ -324,7 +360,8 @@ class Home extends Component {
324
                 </Tooltip>
360
                 </Tooltip>
325
                 <div className={changGif ? "topMsg_content changBg_topMsg_content" : "topMsg_content"} id="manHourBox">
361
                 <div className={changGif ? "topMsg_content changBg_topMsg_content" : "topMsg_content"} id="manHourBox">
326
                   <div className="topMsg_box">
362
                   <div className="topMsg_box">
327
-                    <span className="topMsg_number" class="shu1"></span><span className="topMsg_number_2"></span>
363
+                    <span className="topMsg_number" class="shu1"></span>
364
+                    <span className="topMsg_number_2"></span>
328
                     <p className="topMsg_number_p"></p>
365
                     <p className="topMsg_number_p"></p>
329
                   </div>
366
                   </div>
330
                 </div>
367
                 </div>
@@ -369,8 +406,8 @@ class Home extends Component {
369
             </div>
406
             </div>
370
           </div>
407
           </div>
371
           <div className="bottom_box">
408
           <div className="bottom_box">
372
-            <p style={{ color: "#6a818d",lineHeight:'2px' }}>
373
-            更新时间 : {updateTime?updateTime.split(" ")[0]:updateTime}
409
+            <p style={{ color: "#6a818d", lineHeight: '2px' }}>
410
+              更新时间 : {updateTime ? updateTime.split(" ")[0] : updateTime}
374
             </p>
411
             </p>
375
           </div>
412
           </div>
376
 
413
 

+ 7 - 0
src/utils/util.js

@@ -980,6 +980,13 @@ export function mapTree2(tree, c_name, la_name, isChildren = false, fathers) {
980
   return par;
980
   return par;
981
 }
981
 }
982
 
982
 
983
+export function getThousandNum(num){
984
+  if(!num){return 0}
985
+  var TextBox8_all = num+"";
986
+  var text8_sum = TextBox8_all.replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g,'$1,');
987
+  return text8_sum;
988
+}
989
+
983
 
990
 
984
 // 格式化树结构
991
 // 格式化树结构
985
 export function findTreeAllNode(tree) {
992
 export function findTreeAllNode(tree) {