|
|
@@ -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-11-27 17:16:02
|
|
|
5
|
+ * @Last Modified time: 2023-11-28 10:30:13
|
|
6
|
6
|
*/
|
|
7
|
7
|
|
|
8
|
8
|
import React, { useState, useEffect, Component } from "react";
|
|
|
@@ -24,6 +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 } from "@utils/util";
|
|
27
|
28
|
|
|
28
|
29
|
import 'animate.css';
|
|
29
|
30
|
import { get } from "lodash";
|
|
|
@@ -68,26 +69,31 @@ class Gvc extends Component {
|
|
68
|
69
|
}
|
|
69
|
70
|
}
|
|
70
|
71
|
componentDidMount() {
|
|
71
|
|
- // this.fontMsgChange();
|
|
72
|
72
|
this.getUrl();
|
|
73
|
73
|
this.getUrl2()
|
|
74
|
74
|
this.getUrl4()
|
|
75
|
75
|
this.getUrl3();
|
|
76
|
|
-
|
|
77
|
|
-
|
|
78
|
76
|
setTimeout(() => {
|
|
79
|
77
|
this.videoStart();
|
|
80
|
78
|
}, 200)
|
|
81
|
79
|
setTimeout(() => {
|
|
82
|
80
|
//替换gif
|
|
83
|
|
- this.setState({ changGif: true });
|
|
84
|
|
- $(".shu1").numScroll();
|
|
|
81
|
+ $(".shu1").numScroll({time:3000});
|
|
|
82
|
+ // this.changeAllShu()
|
|
85
|
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
|
97
|
videoStart() {
|
|
92
|
98
|
/* Chrome 浏览器的视频自动播放策略
|
|
93
|
99
|
1.始终允许静音模式下自动播放
|
|
|
@@ -147,7 +153,7 @@ class Gvc extends Component {
|
|
147
|
153
|
async getUrl() {
|
|
148
|
154
|
await leftService().then(({ data = [], resultCode }) => {
|
|
149
|
155
|
if (+resultCode === 0) {
|
|
150
|
|
- let LeftHtml = [], name_ = ["碳酸锂", '氢氧化钠', '氯化锂', '金属锂'];
|
|
|
156
|
+ let LeftHtml = [], name_ = ["碳酸锂", '氢氧化锂', '氯化锂', '金属锂'];
|
|
151
|
157
|
data.map((x, i) => {
|
|
152
|
158
|
if (i >= 4) {
|
|
153
|
159
|
return
|
|
|
@@ -194,7 +200,7 @@ class Gvc extends Component {
|
|
194
|
200
|
async getUrl4() {
|
|
195
|
201
|
await smallShopService().then(({ data = [], resultCode }) => {
|
|
196
|
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
|
204
|
data = data.map((x, i) => {0
|
|
199
|
205
|
return {
|
|
200
|
206
|
...x,
|
|
|
@@ -205,8 +211,8 @@ class Gvc extends Component {
|
|
205
|
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
|
216
|
const d_3 = data.filter(x => { return x.factoryCode == 3 })[0];
|
|
211
|
217
|
const d_4 = data.filter(x => { return x.factoryCode == 2 })[0];
|
|
212
|
218
|
const d_5 = data.filter(x => { return x.factoryCode == 1 })[0];
|
|
|
@@ -216,6 +222,8 @@ class Gvc extends Component {
|
|
216
|
222
|
old_imgMsgData[5] = d_3;
|
|
217
|
223
|
old_imgMsgData[6] = d_4;
|
|
218
|
224
|
old_imgMsgData[7] = d_5;
|
|
|
225
|
+
|
|
|
226
|
+
|
|
219
|
227
|
console.log(old_imgMsgData, "old_imgMsgData")
|
|
220
|
228
|
this.store.saveState({ imgMsgData: old_imgMsgData });
|
|
221
|
229
|
this.getUrl5()
|
|
|
@@ -228,13 +236,13 @@ class Gvc extends Component {
|
|
228
|
236
|
function getItems(num) {
|
|
229
|
237
|
const datas = data.filter(x => { return x.factoryCode == num });
|
|
230
|
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
|
243
|
return par
|
|
236
|
244
|
}
|
|
237
|
|
-
|
|
|
245
|
+
|
|
238
|
246
|
const d_1 = getItems(5);
|
|
239
|
247
|
const d_2 = getItems(4);
|
|
240
|
248
|
const d_3 = getItems(3);
|
|
|
@@ -263,7 +271,7 @@ class Gvc extends Component {
|
|
263
|
271
|
const rawMaterial = datas.map((item, index) => {
|
|
264
|
272
|
return {
|
|
265
|
273
|
prodCatgory: item.prodCatgory,
|
|
266
|
|
- indexValue: item.indexValue,
|
|
|
274
|
+ indexValue: getThousandNum(item.indexValue),
|
|
267
|
275
|
}
|
|
268
|
276
|
})
|
|
269
|
277
|
// const par = {
|
|
|
@@ -298,6 +306,8 @@ class Gvc extends Component {
|
|
298
|
306
|
const d_3 = getItems(3);
|
|
299
|
307
|
const d_4 = getItems(2);
|
|
300
|
308
|
const d_5 = getItems(1);
|
|
|
309
|
+
|
|
|
310
|
+
|
|
301
|
311
|
let old_imgMsgData = this.store.state.imgMsgData;
|
|
302
|
312
|
old_imgMsgData[3] = { ...old_imgMsgData[3], ...d_1 };
|
|
303
|
313
|
old_imgMsgData[4] = { ...old_imgMsgData[4], ...d_2 };
|
|
|
@@ -322,29 +332,9 @@ class Gvc extends Component {
|
|
322
|
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
|
336
|
getLeftHtml(x, i) {
|
|
|
337
|
+ const { changGif } = this.state;
|
|
348
|
338
|
return (
|
|
349
|
339
|
<li>
|
|
350
|
340
|
<div className={"top_div"}>
|
|
|
@@ -363,11 +353,18 @@ class Gvc extends Component {
|
|
363
|
353
|
<div className="text">
|
|
364
|
354
|
<div>
|
|
365
|
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
|
361
|
</div>
|
|
368
|
362
|
<div>
|
|
369
|
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
|
368
|
</div>
|
|
372
|
369
|
</div>
|
|
373
|
370
|
</li>
|
|
|
@@ -378,7 +375,7 @@ class Gvc extends Component {
|
|
378
|
375
|
render() {
|
|
379
|
376
|
const stores = this.store.state;
|
|
380
|
377
|
let { totalValue, yearDecline, yearSend, imgMsgData } = this.store.state;
|
|
381
|
|
- let { LeftHtml, updateTime } = this.state;
|
|
|
378
|
+ let { LeftHtml, updateTime,changGif } = this.state;
|
|
382
|
379
|
return (
|
|
383
|
380
|
<div className={[styles.gvc_home + ' home_box ']}>
|
|
384
|
381
|
<div className={"all_box"}>
|
|
|
@@ -414,7 +411,10 @@ class Gvc extends Component {
|
|
414
|
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
|
420
|
item.totalName && <span className="sma">吨</span>
|
|
|
@@ -449,11 +449,18 @@ class Gvc extends Component {
|
|
449
|
449
|
item.cumulativeProduction !== null && <div className="chanL text">
|
|
450
|
450
|
<div>
|
|
451
|
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
|
457
|
</div>
|
|
454
|
458
|
<div>
|
|
455
|
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
|
464
|
</div>
|
|
458
|
465
|
|
|
459
|
466
|
</div>
|