Przeglądaj źródła

feat: 产供销价值链-基础页面提交

@dayan_hjm 2 lat temu
rodzic
commit
907b9014df

BIN
public/favicon.ico


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


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


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


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


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


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


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


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


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


+ 2 - 2
src/index.js

@@ -78,9 +78,9 @@ if (ticket && ssoEmpId) {
78 78
 // reportWebVitals();
79 79
 
80 80
 if (process.env.NODE_ENV === "production") {
81
-  document.title = "运营数据中心";
81
+  document.title = "天齐锂业·数据大屏";
82 82
 } else {
83
-  document.title = "(测试)运营数据中心";
83
+  document.title = "(测试)天齐锂业·数据大屏";
84 84
 }
85 85
 
86 86
 // 获取socket id , 建立socket连接

+ 6 - 120
src/pages/frame/component/top/view.jsx

@@ -576,50 +576,8 @@ export default observer(function (props) {
576 576
     console.log($store.app.avator);
577 577
   }, []);
578 578
 
579
-  //表单配置
580
-  const formItemLayout = {
581
-    labelCol: { span: 4 },
582
-    wrapperCol: { span: 20 },
583
-  };
584
-  /**点击联系我们 */
585
-  const handleContact = () => {
586
-    setShowContactModalVisible(true);
587
-  };
588
-  /**点击转换主题 */
589
-  const changeThemesStyle = () => {
590
-    const name = Cookie.get("themesName");
591
-    Cookie.set("themesName", name == "chaBaiDao" ? "yaLeJu" : "chaBaiDao");
592
-    window.location.reload();
593
-  };
594 579
 
595 580
 
596
-  /**提交联系我们 */
597
-  const handleContactOk = () => {
598
-    //判断是否是固定的负责人
599
-    form.validateFields().then(() => {
600
-      // let isFixDirector =
601
-      //   probType === 0 ? copyPeople : directorInfo.itManagerAccountId;
602
-      // let copyAggregate = [...new Set([copyPeople, isFixDirector])];
603
-      form.setFieldsValue({
604
-        problemChargePersonId: "1500661792542593026",
605
-        problemSendPersonId: ["1500661792542593026"],
606
-      });
607
-      const config = form.getFieldValue();
608
-      //固定accountId为1500661792542593026
609
-      const accountId = sessionStorage.getItem("accountId");
610
-      const params = Object.assign({ ...config }, { accountId });
611
-      feedBack(params).then(({ data, resultCode }) => {
612
-        if (+resultCode === 0) {
613
-          message.success("反馈成功");
614
-        }
615
-      });
616
-      form.resetFields();
617
-      setIptValue(0);
618
-      setShowContactModalVisible(false);
619
-      getUnReadNum();
620
-    });
621
-  };
622
-
623 581
   //获取 未读消息的数量
624 582
   const getUnReadNum = () => {
625 583
     let accountId = sessionStorage.getItem("accountId");
@@ -630,83 +588,11 @@ export default observer(function (props) {
630 588
     //   }
631 589
     // });
632 590
   };
633
-
634
-  /**控制输入字数 */
635
-  let timer = null;
636
-  const handleInput = (e) => {
637
-    clearTimeout(timer);
638
-    timer = setTimeout(() => {
639
-      setIptValue(e.target.value.length);
640
-    }, 500);
641
-  };
642
-
643
-  //处理 消息 详情
644
-  const goHandleMessage = () => {
645
-    const { messageDetailType, messageContentObjectId, messageType } = detailInfo || {};
646
-    if (messageType == 'System_bulletin' && (messageDetailType == 'newResourceMsg' || messageDetailType == 'fineReportChange' || messageDetailType == 'fineDataResourceChange') && !hasPermission) {
647
-      message.warning("该报表无权限!");
648
-      return;
649
-    }
650
-    switch (messageDetailType) {
651
-      case "fineDataResourceChange":
652
-        //根据id 找到 该元数据
653
-        getMenuDesc({ resourceId: messageContentObjectId }).then(
654
-          ({ data, resultCode }) => {
655
-            if (+resultCode === 0) {
656
-              $store.app.setMetaData({
657
-                data,
658
-                visible: true,
659
-              });
660
-            }
661
-          }
662
-        );
663
-        break;
664
-      case "fineReportChange":
665
-        getReportInfo({ resourceId: messageContentObjectId }).then(
666
-          ({ data, resultCode }) => {
667
-            if (+resultCode === 0) {
668
-              switchPage({
669
-                // pageId: relationship[key].pageId,
670
-                modelName: data.resourceName,
671
-                pageName: data.resourceName,
672
-                pageUrl: data.resourceUrl,
673
-                resourceId: data.resourceId,
674
-                visitId: sessionStorage.getItem("unionId"),
675
-              });
676
-              let dataOpt = {
677
-                id: data.resourceId,
678
-                name: data.resourceName,
679
-                openType: "self",
680
-                path: data.resourceUrl,
681
-                type: data.resourceType,
682
-              };
683
-              dealDiffSheetType(data).then((response) => {
684
-                $store.app.setNavList({ ...dataOpt });
685
-                $store.app.setCurNav(dataOpt.path);
686
-                if (response.type === "sys") {
687
-                  history.push(response.link);
688
-                } else {
689
-                  history.push(`/home/outer/${response.activeItem.resourceId}`);
690
-                }
691
-              });
692
-            }
693
-          }
694
-        );
695
-        break;
696
-      default:
697
-        setIsShowDetail(false);
698
-    }
699
-
700
-  };
701
-
702
-  const userAvator = sessionStorage.getItem("avator");
703
-  const {
704
-    createTime,
705
-    messageContent,
706
-    messageDetailType,
707
-    messageTypeValue,
708
-    messageSourceName,
709
-  } = detailMessage || {}; /**解构 当前点击的详情数据 */
591
+  const name_arr = {
592
+    "#/home/gvc":"产供销价值链",
593
+    "#/home/operation":"运营数据中心",
594
+  }
595
+   window.lo
710 596
   return (
711 597
     <div class="top2 animate__animated animate__fadeInDown animate__delay-1s animate__slower">
712 598
       <div className={$store.app.styleCommon.theme == 'chaBaiDao' ? [styles.top + ' top'] : styles.top}>
@@ -716,7 +602,7 @@ export default observer(function (props) {
716 602
             width="17"
717 603
           />
718 604
           <span></span>
719
-          <h1>运营数据中心</h1>
605
+          <h1>{name_arr[window.location.hash] || ''}</h1>
720 606
         </div>
721 607
         {/* {history.location.pathname === "/home/index" && (
722 608
           <>

+ 3 - 16
src/pages/frame/view.jsx

@@ -458,13 +458,7 @@ export default observer(function Frame(props) {
458 458
       {/* <div className="nowifi-tip">当前网络状态不佳</div> */}
459 459
 
460 460
       {/* 正文 */}
461
-      <div style={history.location.pathname === "/home/index" || history.location.pathname === '/home/operation'? { display: "flex", height: '100%' } : (history.location.pathname.indexOf("/home/outer") > -1 ?{
462
-        overflow: "hidden",
463
-        display: "flex",
464
-        background: 'rgb(255, 255, 255)',
465
-        height: "100%",
466
-      } : {display: "flex", height: '100%'})}>
467
-
461
+      <div style={{ display: "flex", height: '100%' }}>
468 462
         {$store.sysMenu.submenuList.length > 0 && !collapsed && (
469 463
           <div
470 464
             className="movebar"
@@ -477,18 +471,11 @@ export default observer(function Frame(props) {
477 471
         {isMove && <div className="markmore"></div>}
478 472
 
479 473
         <div
480
-          className={`${history.location.pathname !== "/home/index" && history.location.pathname !== '/home/operation'&&
481
-              $store.app.navList.length > 0
482
-              ? (history.location.pathname.indexOf("/home/outer") > -1 ? "body_box outer_body_box" : 'body_box') : "body_box homePage"
483
-            }`}
474
+          className={"body_box homePage"}
484 475
         >
485 476
           <Navigator
486 477
             style={{
487
-              display:
488
-                history.location.pathname !== "/home/index" && history.location.pathname !== '/home/operation'&&
489
-                  $store.app.navList.length > 0
490
-                  ? "flex"
491
-                  : "none",
478
+              display:"none",
492 479
             }}
493 480
           />
494 481
           <TipMsg onRef={onRef2}></TipMsg>

+ 231 - 0
src/pages/gvc/api.js

@@ -0,0 +1,231 @@
1
+import request from "@utils/request";
2
+
3
+/**登录*/
4
+export function checkToken(params) {
5
+  return request({
6
+    url: `/api/yonghong/checkToken?token=${params}`,
7
+    method: "GEt",
8
+  });
9
+}
10
+
11
+/**碳排放 */
12
+export function dataengineCenterOneservice(params) {
13
+  return request({
14
+    url: "/dataengine-center-oneservice/list/1356250396177503367",
15
+    method: "POST",
16
+    data: {
17
+      "apiId": "1356250396177503367",
18
+      "appKey": "200000134",
19
+      "env": "PROD",
20
+      "reqProtocol": 1,
21
+      "returnFields": [
22
+        "byear",
23
+        "missionsIntensity",
24
+        "missionsTotal",
25
+        "biz_id"
26
+      ],
27
+      "pageNum": 1,
28
+      "pageSize": 10,
29
+      "useResultCache": false
30
+    },
31
+    headers: {
32
+      sign: '19c3cdb58b80e44f2490b8eba3b7f938',
33
+      account: 'yunxi_fuxue',
34
+      'Cache-Control': 'no-cache',
35
+      apiId: '1356250396177503367',
36
+      appKey: '200000134',
37
+      execType: '3',
38
+      env: 'PROD',
39
+    }
40
+  });
41
+}
42
+
43
+
44
+/**库存金额 */
45
+export function momeyService(params) {
46
+  return request({
47
+    url: "/dataengine-center-oneservice/list/1356776817075459329",
48
+    method: "POST",
49
+    data: {
50
+      "apiId": "1356776817075459329",
51
+      "appKey": "200000134",
52
+      "env": "PROD",
53
+      "reqProtocol": 1,
54
+      "returnFields": [
55
+        "indexName",
56
+        "prodCatgory",
57
+        "indexValue"
58
+      ],
59
+      "pageNum": 1,
60
+      "pageSize": 10,
61
+      "useResultCache": false
62
+    },
63
+    headers: {
64
+      sign: 'd58de970856e583f126d186662251024',
65
+      account: 'yunxi_fuxue',
66
+      'Cache-Control': 'no-cache',
67
+      apiId: '1356776817075459329',
68
+      appKey: '200000134',
69
+      execType: '3',
70
+      env: 'PROD',
71
+    }
72
+  });
73
+}
74
+
75
+
76
+/**百万工时损工率   产量计划完成率*/
77
+export function timeService(params) {
78
+  return request({
79
+    url: "/dataengine-center-oneservice/list/1356250124518724729",
80
+    method: "POST",
81
+    data: {
82
+      "apiId": "1356250124518724729",
83
+      "appKey": "200000134",
84
+      "env": "PROD",
85
+      "reqProtocol": 1,
86
+      "returnFields": [
87
+        "indexName",
88
+        "factoryName",
89
+        "indexValue"
90
+      ],
91
+      "pageNum": 1,
92
+      "pageSize": 10,
93
+      "useResultCache": false
94
+    },
95
+    headers: {
96
+      sign: '46847fe90889330f13cdc3318d848d45',
97
+      account: 'yunxi_fuxue',
98
+      'Cache-Control': 'no-cache',
99
+      apiId: '1356250124518724729',
100
+      appKey: '200000134',
101
+      execType: '3',
102
+      env: 'PROD',
103
+    }
104
+  });
105
+}
106
+
107
+/**产值+发货量+产量+库存*/
108
+export function numberService(params) {
109
+  return request({
110
+    url: "/dataengine-center-oneservice/list/1356243326548087867",
111
+    method: "POST",
112
+    data: {
113
+      "apiId": "1356243326548087867",
114
+      "appKey": "200000134",
115
+      "env": "PROD",
116
+      "reqProtocol": 1,
117
+      "returnFields": [
118
+        "indexName",
119
+        "indexValue"
120
+      ],
121
+      "pageNum": 1,
122
+      "pageSize": 10,
123
+      "useResultCache": false
124
+    },
125
+    headers: {
126
+      sign: '2f079b53e1e63b753bb6f9807f6c6818',
127
+      account: 'yunxi_fuxue',
128
+      'Cache-Control': 'no-cache',
129
+      apiId: '1356243326548087867',
130
+      appKey: '200000134',
131
+      execType: '3',
132
+      env: 'PROD',
133
+    }
134
+  });
135
+}
136
+
137
+
138
+/**近30天产量*/
139
+export function mondService(params) {
140
+  return request({
141
+    url: "/dataengine-center-oneservice/list/1356244872119751767",
142
+    method: "POST",
143
+    data: {
144
+      "apiId": "1356244872119751767",
145
+      "appKey": "200000134",
146
+      "env": "PROD",
147
+      "reqProtocol": 1,
148
+      "returnFields": [
149
+        "indexName",
150
+        "indexDate",
151
+        "indexValue"
152
+      ],
153
+      "pageNum": 1,
154
+      "pageSize": 10,
155
+      "useResultCache": false
156
+    },
157
+    headers: {
158
+      sign: 'ef3ecc442896d925cc02d36f1107d9e3',
159
+      account: 'yunxi_fuxue',
160
+      'Cache-Control': 'no-cache',
161
+      apiId: '1356244872119751767',
162
+      appKey: '200000134',
163
+      execType: '3',
164
+      env: 'PROD',
165
+    }
166
+  });
167
+}
168
+
169
+/**月度产量/发货量+一次合格率*/
170
+export function twoService(params) {
171
+  return request({
172
+    url: "/dataengine-center-oneservice/list/1356411403496625359",
173
+    method: "POST",
174
+    data: {
175
+      "apiId": "1356411403496625359",
176
+      "appKey": "200000134",
177
+      "env": "PROD",
178
+      "reqProtocol": 1,
179
+      "returnFields": [
180
+        "bMonth",
181
+        "proQty",
182
+        "deliveryQty",
183
+        "qcRate",
184
+        "targeRate",
185
+      ],
186
+      "pageNum": 1,
187
+      "pageSize": 10,
188
+      "useResultCache": false
189
+    },
190
+    headers: {
191
+      sign: '9c472223a9acbdb9f16bebb7002e0c40',
192
+      account: 'yunxi_fuxue',
193
+      'Cache-Control': 'no-cache',
194
+      apiId: '1356411403496625359',
195
+      appKey: '200000134',
196
+      execType: '3',
197
+      env: 'PROD',
198
+    }
199
+  });
200
+}
201
+
202
+/**更新时间*/
203
+export function updateTimeService(params) {
204
+  return request({
205
+    url: "/dataengine-center-oneservice/list/1356778817327502618",
206
+    method: "POST",
207
+    data: {
208
+      "apiId": "1356778817327502618",
209
+      "appKey": "200000134",
210
+      "env": "PROD",
211
+      "reqProtocol": 1,
212
+      "returnFields": [
213
+        "etlTime"
214
+      ],
215
+      "pageNum": 1,
216
+      "pageSize": 10,
217
+      "useResultCache": false
218
+    },
219
+    headers: {
220
+      sign: '4365b6564b25c852fcf0228188f48114',
221
+      account: 'yunxi_fuxue',
222
+      'Cache-Control': 'no-cache',
223
+      apiId: '1356778817327502618',
224
+      appKey: '200000134',
225
+      execType: '3',
226
+      env: 'PROD',
227
+    }
228
+  });
229
+}
230
+
231
+

+ 309 - 0
src/pages/gvc/component/rightBottomView.jsx

@@ -0,0 +1,309 @@
1
+/*
2
+ * @Author: dayan_hjm 碳排放
3
+ * @Date: 2023-10-23 09:32:12 
4
+ * @Last Modified by: dayan_hjm
5
+ * @Last Modified time: 2023-11-08 16:05:47
6
+ */
7
+
8
+
9
+import React, { useState, useEffect, Component } from "react";
10
+import styles from "../style.less";
11
+import { useHistory, useLocation, withRouter } from "react-router-dom";
12
+import mod from '../mod';
13
+
14
+import { getArrMax } from "@utils/util";
15
+import {
16
+  dataengineCenterOneservice,
17
+} from "../api";
18
+import { get, } from "lodash";
19
+
20
+@withRouter
21
+
22
+class RightBottomView extends Component {
23
+  // 构造函数,组件的实例创建时,最先执行
24
+  constructor(props, context) {
25
+    super(props, context);
26
+    this.store = mod;
27
+    this.state = {
28
+      missionsTotal_arr:[],
29
+      year:[],
30
+      missionsIntensity_arr:[],
31
+      max1:0,
32
+      max2:0,
33
+    };
34
+  }
35
+
36
+  componentDidMount() {
37
+    this.getUrl()
38
+  }
39
+
40
+  async getUrl(){
41
+    await dataengineCenterOneservice().then(({ data=[], resultCode }) => {
42
+      if (+resultCode === 0) {
43
+        let year = [],missionsIntensity_arr = [],missionsTotal_arr = [],max1=[],max2=[];
44
+        data.map((x,i)=>{
45
+          year.unshift(x.byear)
46
+          missionsIntensity_arr.unshift(x.missionsIntensity)
47
+          missionsTotal_arr.unshift(x.missionsTotal)
48
+        });
49
+        const max_1 = getArrMax(missionsIntensity_arr);
50
+        const max_2 = getArrMax(missionsTotal_arr);
51
+        for (let index = 0; index < data.length; index++) {
52
+          max1.unshift(max_1/0.8)
53
+          max2.unshift(max_2/0.8)
54
+        }
55
+        this.setState({year,missionsIntensity_arr,missionsTotal_arr,max1,max2});
56
+          this.setData();
57
+          this.setData2();    
58
+      }
59
+    });
60
+
61
+  }
62
+
63
+  setData() {
64
+    setTimeout(() => {
65
+      // 基于准备好的dom,初始化echarts实例
66
+      var myChart = echarts.init(document.getElementById('echarts8'));
67
+      var myColor = ['#eb2100', '#eb3600', '#d0570e', '#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3'];
68
+      var option = {
69
+
70
+        grid: {
71
+          left: '3%',
72
+          top: '15%',
73
+          right: '5%',
74
+          bottom: '0%',
75
+          containLabel: true
76
+        },
77
+        xAxis: [{
78
+          show: false,
79
+        }],
80
+        yAxis: [{
81
+          axisTick: 'none',
82
+          axisLine: 'none',
83
+          axisLabel: {
84
+            padding:[0,22,0,0],
85
+            textStyle: {
86
+              color: '#69FFDE',
87
+              fontSize: '16',
88
+              fontWeight: 700,
89
+              fontFamily: 'DingTalkJinBuTi',
90
+            }
91
+          },
92
+          data: this.state.year
93
+
94
+        },
95
+        {
96
+          name: '单位:件',
97
+          nameGap: '50',
98
+          nameTextStyle: {
99
+            color: 'rgba(255,255,255,.6)',
100
+            fontSize: '16',
101
+          },
102
+          axisLine: {
103
+            lineStyle: {
104
+              color: 'rgba(0,0,0,0)'
105
+            }
106
+          },
107
+          data: [],
108
+        }],
109
+        legend: {
110
+          data: '碳排放强度',
111
+          // right: 'center',
112
+          // top: 0,
113
+          textStyle: {
114
+            color: "#fff",
115
+            fontSize: 12
116
+          },
117
+          itemWidth: 12,
118
+          itemHeight: 10,
119
+        },
120
+        series: [{
121
+          name: '条',
122
+          type: 'bar',
123
+          yAxisIndex: 0,
124
+          data: this.state.missionsTotal_arr,
125
+          label: {
126
+            normal: {
127
+              show: true,
128
+              position: 'insideLeft',
129
+              formatter: function (param) {
130
+                return param.value;
131
+              },
132
+              textStyle: {
133
+                color: 'rgba(255,255,255,1)',
134
+                fontSize: '15',
135
+                padding:[5,5,0,5]
136
+              }
137
+            }
138
+          },
139
+          barWidth: 24,
140
+          itemStyle: {
141
+            normal: {
142
+              color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
143
+                { offset: 0, color: 'rgb(255 242 72)' },
144
+                { offset: 0.7, color: '#ffe06a99' },
145
+                { offset: 1, color: '#ffe06a99' },
146
+              ]),
147
+              barBorderRadius: 15,
148
+              borderColor: "rgb(255 242 72)",
149
+              borderWidth: 1
150
+
151
+            },
152
+          },
153
+          z: 2
154
+        }, {
155
+          name: '白框',
156
+          type: 'bar',
157
+          yAxisIndex: 1,
158
+          barGap: '-100%',
159
+          data: this.state.max2,
160
+          barWidth: 24,
161
+          itemStyle: {
162
+            normal: {
163
+              color: '#ffffff24',
164
+              barBorderRadius: 15,
165
+
166
+            }
167
+          },
168
+          z: 1
169
+        }]
170
+      };
171
+
172
+
173
+      // 使用刚指定的配置项和数据显示图表。
174
+      myChart.setOption(option);
175
+      window.addEventListener("resize", function () {
176
+        myChart.resize();
177
+      });
178
+    }, 3000)
179
+  }
180
+
181
+  setData2() {
182
+    setTimeout(() => {
183
+      // 基于准备好的dom,初始化echarts实例
184
+      var myChart = echarts.init(document.getElementById('echarts9'));
185
+      var myColor = ['#eb2100', '#eb3600', '#d0570e', '#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3'];
186
+      var option = {
187
+        grid: {
188
+          left: '0%',
189
+          top: '15%',
190
+          right: '5%',
191
+          bottom: '0%',
192
+          containLabel: true
193
+        },
194
+        xAxis: [{
195
+          show: false,
196
+          inverse: true,
197
+        }],
198
+        yAxis: [{
199
+          axisTick: 'none',
200
+          axisLine: 'none',
201
+          offset: '15',
202
+          axisLine: {
203
+            onZero: false
204
+          },
205
+          axisLabel: {
206
+            textStyle: {
207
+              color: 'rgba(255,255,255,.6)',
208
+              fontSize: '0',
209
+            }
210
+          },
211
+          data: ['字段1', '字段2', '字段3']
212
+
213
+        },
214
+        {
215
+          name: '单位:件',
216
+          nameGap: '50',
217
+          nameTextStyle: {
218
+            color: 'rgba(255,255,255,.6)',
219
+            fontSize: '16',
220
+          },
221
+          axisLine: {
222
+            lineStyle: {
223
+              color: 'rgba(0,0,0,0)'
224
+            }
225
+          },
226
+          data: [],
227
+        }],
228
+        series: [{
229
+          name: '条',
230
+          type: 'bar',
231
+          yAxisIndex: 0,
232
+          data: this.state.missionsIntensity_arr,
233
+          animation:true,
234
+          animationDuration:3000,
235
+          smooth: true,
236
+          label: {
237
+            normal: {
238
+              show: true,
239
+              position: 'insideRight',
240
+              formatter: function (param) {
241
+                return param.value;
242
+              },
243
+              textStyle: {
244
+                color: 'rgba(255,255,255,1)',
245
+                fontSize: '15',
246
+                padding:[5,5,0,5]
247
+              }
248
+            }
249
+          },
250
+          barWidth: 23,
251
+          itemStyle: {
252
+            normal: {
253
+              color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
254
+                { offset: 1, color: '#69FFDE' },
255
+                { offset: 0.75, color: '#69FFDE' },
256
+                { offset: 0, color: 'rgb(83 211 183 / 15%)' },
257
+              ]),
258
+              barBorderRadius: 15,
259
+              borderColor: "#69FFDE",
260
+              borderWidth: 1
261
+            }
262
+          },
263
+          z: 2
264
+        }, {
265
+          name: '白框',
266
+          type: 'bar',
267
+          yAxisIndex: 1,
268
+          barGap: '-100%',
269
+          data: this.state.max1,
270
+          animation:true,
271
+          animationDuration:3000,
272
+          smooth: true,
273
+          barWidth: 23,
274
+          itemStyle: {
275
+            normal: {
276
+              color: '#ffffff24',
277
+              barBorderRadius: 15,
278
+            }
279
+          },
280
+          z: 1
281
+        }]
282
+      };
283
+
284
+
285
+      // 使用刚指定的配置项和数据显示图表。
286
+      myChart.setOption(option);
287
+      window.addEventListener("resize", function () {
288
+        myChart.resize();
289
+      });
290
+
291
+    }, 3000)
292
+  }
293
+
294
+  render() {
295
+
296
+    return (
297
+      <div className={["eacharView cbRightBottomView"]}>
298
+        <span className="right_b_tip1">碳排放强度</span>
299
+        <div id="echarts9"></div>
300
+        {/* <div className="fonts">
301
+
302
+        </div> */}
303
+        <span className="right_b_tip2">碳排放总量/万吨</span>
304
+        <div id="echarts8"></div>
305
+      </div>
306
+    )
307
+  }
308
+}
309
+export default RightBottomView;

+ 72 - 0
src/pages/gvc/mod.js

@@ -0,0 +1,72 @@
1
+/*
2
+ * @Author: dayan_hjm 
3
+ * @Date: 2022-10-27 11:11:30 
4
+ * @Last modified by:   dayan_hjm 
5
+ * @Last modified time: 2022-10-27 11:11:30 
6
+ */
7
+
8
+// 状态管理方法
9
+import { observable, action, configure, makeObservable, runInAction } from 'mobx';
10
+// 工具方法
11
+import { cloneDeep, get, groupBy, isEmpty, orderBy, pick, values } from "lodash";
12
+
13
+import { message } from 'antd';
14
+
15
+// 默认状态
16
+const defaultState = {
17
+  totalValue:0,
18
+  yearDecline:0,
19
+  yearSend:0,
20
+  productInventory:0,
21
+  list:[{name:'营运数据大屏'},{name:'经营大盘'},{name:'到家专题'},{name:'门店大盘'},{name:'自助跑数SQL平台'},{name:'月度包材预警跑数模板'}],
22
+  rightlist:[],
23
+  bumen:'数字化中心/数据工程部',
24
+  gw:'数据产品经理',
25
+}
26
+
27
+// 严格模式
28
+configure({
29
+  enforceActions: 'observed'
30
+});
31
+
32
+
33
+/**
34
+ * mod层 - 业务逻辑,数据逻辑应该存储于此
35
+ */
36
+class Mod {
37
+  constructor() {
38
+    makeObservable(this);
39
+  }
40
+  // 监视状态
41
+  @observable state = cloneDeep(defaultState);
42
+
43
+  @action saveState = async (payload) => {
44
+    runInAction(() => {
45
+      this.state = {
46
+        ...this.state,
47
+        ...payload
48
+      };
49
+    });
50
+  };
51
+
52
+
53
+  // 新增/编辑运营商
54
+  // @action customerOperatorsmod = async (par, type) => {
55
+  //   try {
56
+  //     const { data, resultCode, resultMsg } = await Serv.customerOperatorsServ(par, type);
57
+  //     if (resultCode + '' === '0') {
58
+  //       runInAction(() => {
59
+  //         message.success('操作成功!')
60
+  //         this.state.addEditVisiable = false;
61
+  //         this.state.version = Math.random()
62
+  //       });
63
+  //     }
64
+  //   } catch (e) {
65
+  //     console.log('e: ', e);
66
+  //   }
67
+  // }
68
+}
69
+
70
+// 将组件实例化,这意味着组件将不能从别处实例化
71
+const mod = new Mod();
72
+export default mod;

+ 100 - 0
src/pages/gvc/style.less

@@ -0,0 +1,100 @@
1
+@import url("../../themes/themes.less");
2
+
3
+@assetUrl: "../../assets/imgs/home";
4
+
5
+.home_box {
6
+  background: url(../../assets/imgs/gvc/homeBgDataV.png) no-repeat 0 -10em / 100% 120% #041b40;
7
+
8
+  :global {
9
+    .all_box {
10
+      width: 100%;
11
+      height: 100%;
12
+
13
+      .gvcHome {
14
+        height: 100%;
15
+
16
+        .leftContent {
17
+          width: 8%;
18
+          /* padding: 0 1em; */
19
+          height: 70%;
20
+          margin-top: 5%;
21
+          margin-left: 1%;
22
+
23
+          >ul {
24
+            width: 100%;
25
+            display: flex;
26
+            justify-content: center;
27
+            height: 100%;
28
+            flex-wrap: wrap;
29
+
30
+            >li {
31
+              height: 20%;
32
+              width: 100%;
33
+              color: #fff;
34
+              display: block;
35
+
36
+              .top_div {
37
+                background: none;
38
+                width: 100%;
39
+                height: 60%;
40
+                display: flex;
41
+                align-items: center;
42
+                justify-content: center;
43
+
44
+                >div {
45
+                  width: 60%;
46
+                  position: relative;
47
+                  display: block;
48
+
49
+                  .img1 {
50
+                    width: 100%;
51
+                  }
52
+
53
+                  >span {
54
+                    font-size: 0.9em;
55
+                    position: absolute;
56
+                    width: 100%;
57
+                    bottom: 15%;
58
+                    left: 63%;
59
+                    transform: skew(4deg, 334deg);
60
+                    font-weight: normal;
61
+                    color: #ededed;
62
+
63
+                  }
64
+
65
+                  .img2 {
66
+                    width: 37%;
67
+                    position: absolute;
68
+                    left: 32%;
69
+                    top: 24%;
70
+                  }
71
+                }
72
+              }
73
+
74
+              .text {
75
+                width: 100%;
76
+                display: flex;
77
+                align-items: center;
78
+                justify-content: space-between;
79
+                margin-top: 0.5em;
80
+                font-weight: normal;
81
+                font-size: 0.8em;
82
+                color: #CDF1FF;
83
+                padding: 0.8em 0.9em 0.2em;
84
+                background: linear-gradient(0deg, #ffffff26 0%, #ffffff00 100%);
85
+                border-radius: 0.2em;
86
+
87
+                .topMsg_number {
88
+                  color: #69FFDE;
89
+                  font-size: 1.2em;
90
+                  margin-right: 0.2em;
91
+                  margin-top: 0.2em;
92
+                }
93
+              }
94
+            }
95
+          }
96
+        }
97
+      }
98
+    }
99
+  }
100
+}

+ 308 - 0
src/pages/gvc/view.jsx

@@ -0,0 +1,308 @@
1
+/*
2
+ * @Author: dayan_hjm  产供销价值链
3
+ * @Date: 2023-11-10 10:19:34 
4
+ * @Last Modified by: dayan_hjm
5
+ * @Last Modified time: 2023-11-10 16:43:06
6
+ */
7
+
8
+import React, { useState, useEffect, Component } from "react";
9
+import styles from "./style.less";
10
+import { useHistory, useLocation, withRouter } from "react-router-dom";
11
+import { observer, observable } from "mobx-react";
12
+import { message, Space, Form, Popconfirm, Modal, Tooltip, Icon, Button } from "antd";
13
+import mod from './mod';
14
+import { toJS } from "mobx";
15
+import RightBottomView from "./component/rightBottomView.jsx";
16
+import {
17
+  timeService,
18
+  numberService,
19
+  checkToken,
20
+  updateTimeService
21
+} from "./api";
22
+
23
+import 'animate.css';
24
+@withRouter
25
+
26
+class Gvc extends Component {
27
+  // 构造函数,组件的实例创建时,最先执行
28
+  constructor(props, context) {
29
+    super(props, context);
30
+    this.store = mod;
31
+    this.state = {
32
+      LeftHtml: [
33
+        {
34
+          txt_name: '碳酸锂',
35
+          num1: 1222,
36
+          num2: 1000,
37
+        },
38
+        {
39
+          txt_name: '氢氧化钠',
40
+          num1: 2525,
41
+          num2: 25,
42
+        },
43
+        {
44
+          txt_name: '氯化锂',
45
+          num1: 3654,
46
+          num2: 7541,
47
+        },
48
+        {
49
+          txt_name: '金属锂',
50
+          num1: 45,
51
+          num2: 698,
52
+        },
53
+      ],
54
+      updateTime: '',
55
+      changGif: false,
56
+      plannedCompletionData: [
57
+      ],
58
+      plannedCompletionNum: 1,
59
+      manHourData: [
60
+      ],
61
+      manHourNum: 1,
62
+    };
63
+    this.timer = null //定时器,用于检测同步状态
64
+  }
65
+  componentWillMount() {
66
+    if (window.location.host.indexOf("localhost") == -1) {
67
+      this.getToken()
68
+    }
69
+  }
70
+
71
+  async getToken() {
72
+    if (!sessionStorage.getItem("tqcVToken")) {
73
+      this.props.history.replace("/home/index");
74
+    } else {
75
+      await checkToken(sessionStorage.getItem("tqcVToken")).then(({ data, resultCode }) => {
76
+        if (data?.userId) {
77
+          // this.props.history.push('/')
78
+        } else {
79
+          this.props.history.replace("/home/index");
80
+        }
81
+      });
82
+    }
83
+  }
84
+  componentDidMount() {
85
+    this.fontMsgChange();
86
+    this.getUrl();
87
+    this.getUrl2()
88
+    this.getUrl3();
89
+    setTimeout(() => {
90
+      this.videoStart();
91
+    }, 200)
92
+    setTimeout(() => {
93
+      //替换gif
94
+      this.setState({ changGif: true });
95
+
96
+    }, 2000)
97
+  }
98
+  videoStart() {
99
+    /*     Chrome 浏览器的视频自动播放策略
100
+        1.始终允许静音模式下自动播放
101
+        2.在以下的情况中,带声音播放会被允许:
102
+          ①用户已经与当前的域进行了交互(也就是click,tap事件)。
103
+          ②在桌面设备上,用户的媒体参与度指数阈值已经超过,这意味着用户之前播放过有声视频。
104
+          ③用户已经将网站添加到移动设备上的主屏幕或允在桌面上安装了PWA。
105
+        3.顶部帧可以将自动播放权限委派给其iframe,来允许自动播放声音
106
+        
107
+        媒体参与度(Media Engagement)是指用户与媒体内容进行互动的程度,可以通过多个指标来衡量。这些指标主要包括观看时间、观看率、转化率、交互行为等。
108
+        可以通过:chrome://media-engagement/ 查看
109
+     */
110
+    const video = document.querySelector('.video2');
111
+    console.log(video.play());
112
+
113
+    const model = document.querySelector('.model')
114
+    const btn = document.querySelector('button')
115
+    // 第一种方法 引导用户去与页面交互实现播放
116
+    async function play() {
117
+      try {
118
+        await video.play();
119
+        //使用await的原因是因为video.play()方法返回的是一个Promise,所以在这里我们可以对他进行一些处理
120
+        model.style.display = 'none';
121
+        btn.removeEventListener('click', play);
122
+        // 如果他自动播放了就隐藏按钮,消除点击事件
123
+      } catch (err) {
124
+        model.style.display = 'block';
125
+        btn.addEventListener('click', play);
126
+        // 如果Promise返回的是error就引导用户点击按钮,在调用play方法
127
+      }
128
+    }
129
+    play();
130
+
131
+    //第二种方法比较主流,类似的有网页版抖音以及B站
132
+    function play() {
133
+      video.muted = true;//设置视频为静音
134
+      video.play();//调用播放方法
135
+      const ctx = new AudioContext();
136
+      const canAutoPlay = ctx.state === 'running'; //通过这个可以判断出视频能不能够自动播放 如何可以它的值就是“running” 否则为"suspended"
137
+      // 如果是不能播放我们就执行下面的逻辑,其实就是类似于第一种方法,让用户与其交互
138
+      ctx.close();
139
+      if (canAutoPlay) {
140
+        video.muted = false;
141
+        model.style.display = 'none';
142
+        btn.removeEventListener('click', play);
143
+      }
144
+      else {
145
+        model.style.display = 'block';
146
+        btn.addEventListener('click', play);
147
+      }
148
+    }
149
+    play()
150
+
151
+  }
152
+
153
+  async getUrl() {
154
+    await timeService().then(({ data = [], resultCode }) => {
155
+      if (+resultCode === 0) {
156
+        let plannedCompletionData = [], manHourData = [];
157
+        data.map((x, i) => {
158
+          if (x.indexName == '产量计划完成率') {
159
+            plannedCompletionData.push({
160
+              name: x.factoryName,
161
+              value: x.indexValue * 100,
162
+            })
163
+          } else {
164
+            manHourData.push({
165
+              name: x.factoryName,
166
+              value: x.indexValue * 100,
167
+            })
168
+          }
169
+        });
170
+        this.setState({ plannedCompletionData, manHourData, plannedCompletionNum: 1, manHourNum: 1 });
171
+      }
172
+    });
173
+  }
174
+  async getUrl2() {
175
+    await numberService().then(({ data = [], resultCode }) => {
176
+      if (+resultCode === 0) {
177
+        let totalValue = 0, yearDecline = 0, yearSend = 0, productInventory = 0;
178
+        data.map((x, i) => {
179
+          if (x.indexName == '产值') {
180
+            totalValue = x.indexValue
181
+          } else if (x.indexName == '年度产量') {
182
+            yearDecline = x.indexValue
183
+          } else if (x.indexName == '产品库存') {
184
+            yearSend = x.indexValue
185
+          } else if (x.indexName == '年度发货量') {
186
+            productInventory = x.indexValue
187
+          }
188
+        });
189
+        this.store.saveState({ totalValue, yearDecline, yearSend, productInventory });
190
+        setTimeout(() => {
191
+          $(".shu1").numScroll();
192
+        }, 2500)
193
+      }
194
+    });
195
+  }
196
+  async getUrl3() {
197
+    await updateTimeService().then(({ data = [], resultCode }) => {
198
+      if (+resultCode === 0) {
199
+        this.setState({ updateTime: data?.[0]?.etlTime || '' })
200
+      }
201
+    });
202
+  }
203
+
204
+  componentDidCatch() {
205
+    clearInterval(this.timer);
206
+    this.timer = null;
207
+  }
208
+
209
+  fontMsgChange() {
210
+    this.timer = setInterval(() => {
211
+      const { plannedCompletionData, plannedCompletionNum, manHourData, manHourNum } = this.state;
212
+
213
+      //产量计划完成率
214
+      var p1 = document.getElementById('plannedCompletionBox');
215
+      const datas_ = plannedCompletionData[plannedCompletionNum - 1];
216
+      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>';
217
+      p1.innerHTML = res;
218
+
219
+      //百万工时损工率
220
+      var p2 = document.getElementById('manHourBox');
221
+      const datas_2 = manHourData[manHourNum - 1];
222
+      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
+      p2.innerHTML = res2;
224
+
225
+      const num_ = plannedCompletionNum + 1 >= plannedCompletionData.length ? 1 : plannedCompletionNum + 1;
226
+      const num_2 = manHourNum + 1 >= manHourData.length ? 1 : manHourNum + 1;
227
+      this.setState({ plannedCompletionNum: num_, manHourNum: num_2 })
228
+    }, 4000)
229
+  }
230
+
231
+  getLeftHtml(x, i) {
232
+    return (
233
+      <li>
234
+        <div className={"top_div"}>
235
+          <div class="animate__animated animate__pulse animate__slower animate__infinite">
236
+            {i === 0 && <img className={"img1"} src={require("@assets/imgs/gvc/qiu1.png").default} alt="" />}
237
+            {i === 1 && <img className={"img1"} src={require("@assets/imgs/gvc/qiu2.png").default} alt="" />}
238
+            {i === 2 && <img className={"img1"} src={require("@assets/imgs/gvc/qiu3.png").default} alt="" />}
239
+            {i === 3 && <img className={"img1"} src={require("@assets/imgs/gvc/qiu4.png").default} alt="" />}
240
+            {i === 0 && <img src={require("@assets/imgs/gvc/qiuH1.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
241
+            {i === 1 && <img src={require("@assets/imgs/gvc/qiuH2.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
242
+            {i === 2 && <img src={require("@assets/imgs/gvc/qiuH3.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
243
+            {i === 3 && <img src={require("@assets/imgs/gvc/qiuH4.png").default} alt="" class="img2 animate__animated animate__heartBeat animate__slower animate__infinite" />}
244
+            <span>{x.txt_name}</span>
245
+          </div>
246
+        </div>
247
+        <div className="text">
248
+          <div>
249
+            <p>累计产量</p>
250
+            <span class="topMsg_number shu1">{x.num1}</span><span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
251
+          </div>
252
+          <div>
253
+            <p>产品库存</p>
254
+            <span class="topMsg_number shu1">{x.num2}</span><span class="topMsg_number_2" style={{ fontSize: "0.75em", color: "#fff" }}>吨</span>
255
+          </div>
256
+        </div>
257
+      </li>
258
+
259
+    )
260
+  }
261
+
262
+  render() {
263
+    const stores = this.store.state;
264
+    let { totalValue, yearDecline, yearSend, productInventory } = this.store.state;
265
+    let { LeftHtml, } = this.state;
266
+    return (
267
+      <div className={[styles.home_box + ' home_box']}>
268
+        <div className={"all_box"}>
269
+          <div className={"video_box"}>
270
+            <video src={require("@assets/imgs/dataVImg/homeVideo2.mp4").default} autoplay="autoplay" loop="loop" class="video2 center_box2 animate__animated animate__fadeIn animate__delay-2s"></video>
271
+          </div>
272
+          <div className={"gvcHome home cbHome"}>
273
+            <div className="leftContent">
274
+              <ul>
275
+                {
276
+                  LeftHtml.map((x, i) => {
277
+                    return this.getLeftHtml(x, i)
278
+                  })
279
+                }
280
+              </ul>
281
+            </div>
282
+
283
+            <div className="centerCon">
284
+            </div>
285
+
286
+            {/* 右侧信息栏 */}
287
+            <div className="rightContent">
288
+
289
+              <div class="bottomContent2 animate__animated animate__fadeInDown animate__slower  animate__delay-1s">
290
+                <div className="bottomContent bigDivPd">
291
+                  <Tooltip placement="bottom" title={' ● 近三年的碳排放强度、碳排放总量数据'}>
292
+                    <p className="topMsg_title">碳排放</p>
293
+                  </Tooltip>
294
+                  <div className="topMsg_content">
295
+                    <RightBottomView></RightBottomView>
296
+                  </div>
297
+                </div>
298
+              </div>
299
+            </div>
300
+            <div className="bottom_box">
301
+            </div>
302
+          </div>
303
+        </div>
304
+      </div>
305
+    )
306
+  }
307
+}
308
+export default Gvc;

+ 2 - 2
src/pages/jurisDiction/view.jsx

@@ -32,7 +32,7 @@ class JrisDiction extends Component {
32 32
   componentWillMount() { 
33 33
     let searchInstance = queryToObj(); // url查询参数对象化
34 34
     if(window.location.host.indexOf("localhost") > -1){
35
-      this.props.history.replace("/home/operation");
35
+      this.props.history.replace(searchInstance?.type == 1 ? "/home/operation" : "/home/gvc");
36 36
     }else if(searchInstance?.token){
37 37
       this.getUrl(searchInstance?.token);
38 38
     }else{
@@ -47,7 +47,7 @@ class JrisDiction extends Component {
47 47
     await checkToken(token).then(({ data, resultCode }) => {
48 48
       sessionStorage.setItem("tqcVToken",token)
49 49
       if (data?.userId) {
50
-        this.props.history.replace("/home/operation");
50
+        this.props.history.replace(searchInstance?.type == 1 ? "/home/operation" : "/home/gvc");
51 51
         // this.props.history.push('/')
52 52
       } else {
53 53
         this.setState({ showMsg: true })

+ 2 - 2
src/pages/tqcDataVHome/component/oneQualified.jsx

@@ -2,7 +2,7 @@
2 2
  * @Author: dayan_hjm 一次合格率
3 3
  * @Date: 2023-10-23 09:32:12 
4 4
  * @Last Modified by: dayan_hjm
5
- * @Last Modified time: 2023-11-08 16:45:11
5
+ * @Last Modified time: 2023-11-08 17:53:47
6 6
  */
7 7
 
8 8
 
@@ -75,7 +75,7 @@ class BottomLineForSend extends Component {
75 75
         legend: {
76 76
           data: ['目标一次及格率', '实际一次及格率'],
77 77
           right: 'center',
78
-          padding: [0, 0, 0, 5],
78
+          padding: [10, 0, 0, 5],
79 79
           top: 0,
80 80
           textStyle: {
81 81
             color: "#fff",

+ 6 - 0
src/router/router.js

@@ -14,6 +14,7 @@ import Login from "@pages/login/view.jsx";
14 14
 import NotFound from "@pages/notFound/view.jsx";
15 15
 import Home from '@pages/home/view.jsx';
16 16
 import HomeForchaBaiDao from '@pages/tqcDataVHome/view.jsx';
17
+import GVC from '@pages/gvc/view.jsx';
17 18
 import JurisDiction from '@pages/jurisDiction/view.jsx';
18 19
 import Loading from "@components/Loading/view.jsx";
19 20
 import $store from "@store/";
@@ -61,6 +62,11 @@ const routes = [
61 62
         // component: $store.app.styleCommon.theme == 'chaBaiDao' ? HomeForchaBaiDao : Home,
62 63
         // navigator: true,
63 64
       },
65
+      {
66
+        name: "产供销价值链",
67
+        path: "/home/gvc",
68
+        component: GVC,
69
+      },
64 70
     ],
65 71
   },
66 72
   {