|
|
@@ -1,16 +1,18 @@
|
|
1
|
1
|
/*
|
|
2
|
|
- * @Author: dayan_hjm 碳排放
|
|
|
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:05:47
|
|
|
5
|
+ * @Last Modified time: 2023-11-13 16:14:33
|
|
6
|
6
|
*/
|
|
7
|
7
|
|
|
8
|
|
-
|
|
9
|
8
|
import React, { useState, useEffect, Component } from "react";
|
|
10
|
9
|
import styles from "../style.less";
|
|
11
|
10
|
import { useHistory, useLocation, withRouter } from "react-router-dom";
|
|
12
|
11
|
import mod from '../mod';
|
|
13
|
|
-
|
|
|
12
|
+import Slider from "react-slick";
|
|
|
13
|
+import "slick-carousel/slick/slick.css";
|
|
|
14
|
+import "slick-carousel/slick/slick-theme.css";
|
|
|
15
|
+import { Progress } from 'antd';
|
|
14
|
16
|
import { getArrMax } from "@utils/util";
|
|
15
|
17
|
import {
|
|
16
|
18
|
dataengineCenterOneservice,
|
|
|
@@ -25,283 +27,152 @@ class RightBottomView extends Component {
|
|
25
|
27
|
super(props, context);
|
|
26
|
28
|
this.store = mod;
|
|
27
|
29
|
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
|
|
|
30
|
+ data_item: [
|
|
|
31
|
+ {
|
|
|
32
|
+ name: '很长的很长的很长的很长的很长的很长的很长的布置岛实业有限公司',
|
|
|
33
|
+ num: 666969988666969988666969988666969988,
|
|
|
34
|
+ percent:99.5
|
|
76
|
35
|
},
|
|
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
|
|
|
36
|
+ {
|
|
|
37
|
+ name: '布置岛实业有限公司',
|
|
|
38
|
+ num: 966,
|
|
|
39
|
+ percent:95.5
|
|
93
|
40
|
|
|
94
|
41
|
},
|
|
95
|
42
|
{
|
|
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,
|
|
|
43
|
+ name: '布置岛实业有限公司',
|
|
|
44
|
+ num: 666969988,
|
|
|
45
|
+ percent:85.5
|
|
119
|
46
|
},
|
|
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
|
|
-
|
|
|
47
|
+ {
|
|
|
48
|
+ name: '布置岛实业有限公司',
|
|
|
49
|
+ num: 666969988,
|
|
|
50
|
+ percent:59.5
|
|
172
|
51
|
|
|
173
|
|
- // 使用刚指定的配置项和数据显示图表。
|
|
174
|
|
- myChart.setOption(option);
|
|
175
|
|
- window.addEventListener("resize", function () {
|
|
176
|
|
- myChart.resize();
|
|
177
|
|
- });
|
|
178
|
|
- }, 3000)
|
|
179
|
|
- }
|
|
|
52
|
+ },
|
|
|
53
|
+ {
|
|
|
54
|
+ name: '布置岛实业有限公司',
|
|
|
55
|
+ num: 666969988,
|
|
|
56
|
+ percent:48.5
|
|
180
|
57
|
|
|
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
|
58
|
},
|
|
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']
|
|
|
59
|
+ {
|
|
|
60
|
+ name: '布置岛实业有限公司',
|
|
|
61
|
+ num: 36,
|
|
|
62
|
+ percent:6
|
|
212
|
63
|
|
|
213
|
64
|
},
|
|
214
|
65
|
{
|
|
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
|
|
- };
|
|
|
66
|
+ name: '布置岛实业有限公司',
|
|
|
67
|
+ num: 666969988,
|
|
|
68
|
+ percent:78
|
|
|
69
|
+ },
|
|
|
70
|
+ {
|
|
|
71
|
+ name: '布置岛实业有限公司',
|
|
|
72
|
+ num: 666969988,
|
|
|
73
|
+ percent:45
|
|
|
74
|
+ },
|
|
|
75
|
+ {
|
|
|
76
|
+ name: '布置岛实业有限公司',
|
|
|
77
|
+ num: 666969988,
|
|
|
78
|
+ percent:36
|
|
|
79
|
+ },
|
|
|
80
|
+ {
|
|
|
81
|
+ name: '布置岛实业有限公司',
|
|
|
82
|
+ num: 666969988,
|
|
|
83
|
+ percent:36
|
|
|
84
|
+ },
|
|
|
85
|
+ {
|
|
|
86
|
+ name: '布置岛实业有限公司',
|
|
|
87
|
+ num: 666969988,
|
|
|
88
|
+ percent:98
|
|
|
89
|
+ },
|
|
|
90
|
+ {
|
|
|
91
|
+ name: '布置岛实业有限公司',
|
|
|
92
|
+ num: 666969988,
|
|
|
93
|
+ percent:65
|
|
|
94
|
+ },
|
|
|
95
|
+ {
|
|
|
96
|
+ name: '布置岛实业有限公司',
|
|
|
97
|
+ num: 666969988,
|
|
|
98
|
+ percent:36
|
|
|
99
|
+ },
|
|
|
100
|
+ ],
|
|
|
101
|
+ };
|
|
|
102
|
+ }
|
|
283
|
103
|
|
|
|
104
|
+ componentDidMount() {
|
|
|
105
|
+ }
|
|
284
|
106
|
|
|
285
|
|
- // 使用刚指定的配置项和数据显示图表。
|
|
286
|
|
- myChart.setOption(option);
|
|
287
|
|
- window.addEventListener("resize", function () {
|
|
288
|
|
- myChart.resize();
|
|
289
|
|
- });
|
|
|
107
|
+ async getUrl() {
|
|
|
108
|
+ // await dataengineCenterOneservice().then(({ data=[], resultCode }) => {
|
|
|
109
|
+ // if (+resultCode === 0) {
|
|
|
110
|
+ // let year = [],missionsIntensity_arr = [],missionsTotal_arr = [],max1=[],max2=[];
|
|
|
111
|
+ // data.map((x,i)=>{
|
|
|
112
|
+ // year.unshift(x.byear)
|
|
|
113
|
+ // missionsIntensity_arr.unshift(x.missionsIntensity)
|
|
|
114
|
+ // missionsTotal_arr.unshift(x.missionsTotal)
|
|
|
115
|
+ // });
|
|
|
116
|
+ // const max_1 = getArrMax(missionsIntensity_arr);
|
|
|
117
|
+ // const max_2 = getArrMax(missionsTotal_arr);
|
|
|
118
|
+ // for (let index = 0; index < data.length; index++) {
|
|
|
119
|
+ // max1.unshift(max_1/0.8)
|
|
|
120
|
+ // max2.unshift(max_2/0.8)
|
|
|
121
|
+ // }
|
|
|
122
|
+ // this.setState({year,missionsIntensity_arr,missionsTotal_arr,max1,max2});
|
|
|
123
|
+ // this.setData();
|
|
|
124
|
+ // this.setData2();
|
|
|
125
|
+ // }
|
|
|
126
|
+ // });
|
|
290
|
127
|
|
|
291
|
|
- }, 3000)
|
|
292
|
128
|
}
|
|
293
|
129
|
|
|
294
|
130
|
render() {
|
|
295
|
|
-
|
|
|
131
|
+ const settings = {
|
|
|
132
|
+ dots: false,
|
|
|
133
|
+ arrows:false,
|
|
|
134
|
+ infinite: true,
|
|
|
135
|
+ autoplay: true,
|
|
|
136
|
+ autoplaySpeed: 2500,//自动播放的时间
|
|
|
137
|
+ // fade: true,//是否采用淡入淡出的效果 竖着的滚动方式不能添加此动效
|
|
|
138
|
+ slidesToShow: 8,
|
|
|
139
|
+ slidesToScroll: 1,
|
|
|
140
|
+ vertical: true,
|
|
|
141
|
+ verticalSwiping: true,
|
|
|
142
|
+ beforeChange: function (currentSlide, nextSlide) {
|
|
|
143
|
+ console.log("before change", currentSlide, nextSlide);
|
|
|
144
|
+ },
|
|
|
145
|
+ afterChange: function (currentSlide) {
|
|
|
146
|
+ console.log("after change", currentSlide);
|
|
|
147
|
+ }
|
|
|
148
|
+ };
|
|
|
149
|
+ const { data_item } = this.state;
|
|
296
|
150
|
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>
|
|
|
151
|
+ <div className={["eacharView cbRightBottomView slider_item_box"]}>
|
|
|
152
|
+ <p className="title_">累计销量客户/吨</p>
|
|
|
153
|
+ <Slider {...settings}>
|
|
|
154
|
+ {
|
|
|
155
|
+ data_item.map((x, i) => {
|
|
|
156
|
+ return (
|
|
|
157
|
+ <div className="slider_box">
|
|
|
158
|
+ <div className="slider_top">
|
|
|
159
|
+ <p>{i + 1}.<span>{x.name}</span></p>
|
|
|
160
|
+ <p className="p2">{x.num}</p>
|
|
|
161
|
+ </div>
|
|
|
162
|
+ <Progress
|
|
|
163
|
+ strokeColor={{
|
|
|
164
|
+ from: '#a98911cf',
|
|
|
165
|
+ to: 'rgb(248,204,41,0.9)',
|
|
|
166
|
+ }}
|
|
|
167
|
+ percent={x.percent}
|
|
|
168
|
+ status="active"
|
|
|
169
|
+ />
|
|
|
170
|
+ </div>
|
|
|
171
|
+ )
|
|
|
172
|
+ })
|
|
|
173
|
+ }
|
|
|
174
|
+
|
|
|
175
|
+ </Slider>
|
|
305
|
176
|
</div>
|
|
306
|
177
|
)
|
|
307
|
178
|
}
|