dcim-topology2d 2.1.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chart-diagram/index.d.ts +1 -1
- package/chart-diagram/index.js +1 -1
- package/chart-diagram/src/echarts/index.js +112 -109
- package/chart-diagram/src/utils/changeOptions.d.ts +8 -8
- package/chart-diagram/src/utils/changeOptions.js +8 -2
- package/chart-diagram/src/utils/conversion.d.ts +19 -19
- package/chart-diagram/src/utils/conversion.js +601 -559
- package/chart-diagram/src/utils/drawGraphic.d.ts +3 -3
- package/chart-diagram/src/utils/drawGraphic.js +97 -97
- package/chart-diagram/src/utils/index.d.ts +5 -5
- package/chart-diagram/src/utils/index.js +5 -5
- package/chart-diagram/src/utils/render.js +4 -0
- package/core/index.js +1 -19
- package/core/src/activeLayer.js +23 -23
- package/core/src/calling.js +32 -33
- package/core/src/common.d.ts +1 -0
- package/core/src/common.js +115 -83
- package/core/src/core.js +15 -1
- package/core/src/element/common.js +12 -4
- package/core/src/element/datePicker.js +13 -16
- package/core/src/element/select.d.ts +1 -1
- package/core/src/element/select.js +1 -3
- package/core/src/element/tab.js +3 -8
- package/core/src/healps/changeData.js +64 -41
- package/core/src/middles/default.js +49 -43
- package/core/src/middles/index.d.ts +1 -2
- package/core/src/middles/index.js +3 -2
- package/core/src/middles/nodes/formDatePicker.js +54 -12
- package/core/src/middles/nodes/formoverflow.js +17 -16
- package/core/src/middles/nodes/formselect.js +14 -5
- package/core/src/middles/nodes/index.d.ts +3 -1
- package/core/src/middles/nodes/index.js +2 -0
- package/core/src/middles/nodes/progress.d.ts +2 -0
- package/core/src/middles/nodes/progress.js +63 -0
- package/core/src/middles/nodes/progress.js.map +1 -0
- package/core/src/middles/nodes/rectangle.js +54 -15
- package/core/src/middles/nodes/switchs.d.ts +2 -0
- package/core/src/middles/nodes/switchs.js +46 -0
- package/core/src/models/line.js +7 -7
- package/core/src/models/node.js +90 -81
- package/core/src/models/pen.js +21 -12
- package/core/src/offscreen.js +19 -19
- package/core/src/preview.js +75 -40
- package/core/src/store/data.d.ts +11 -0
- package/core/src/store/data.js +11 -0
- package/core/src/utils/assignment.d.ts +1 -1
- package/core/src/utils/assignment.js +50 -6
- package/core/src/utils/construction.d.ts +24 -0
- package/core/src/utils/construction.js +22 -1
- package/core/src/utils/conversion.d.ts +2 -0
- package/core/src/utils/conversion.js +109 -0
- package/core/src/utils/math.d.ts +0 -1
- package/core/src/utils/math.js +0 -3
- package/core/src/utils/onmousevent.js +1 -1
- package/core/src/utils/params.d.ts +1 -0
- package/core/src/utils/params.js +75 -4
- package/package.json +1 -1
- package/static/echartsDefaultData.js +178 -178
- package/store/actions.js +2 -1
- package/store/clear.js +4 -0
- package/store/default.js +22 -0
- package/store/index.js +2 -1
- /package/myShape-diagram/{index.ts → index.d.ts} +0 -0
|
@@ -1,559 +1,601 @@
|
|
|
1
|
-
import {echartsDataRoom, echartsColorData, rankingTopImageName} from '../../../static';
|
|
2
|
-
import {
|
|
3
|
-
setSeriesRenderGroup,
|
|
4
|
-
drawGraphicShape,
|
|
5
|
-
setChartLegendData,
|
|
6
|
-
setChartXAxisData,
|
|
7
|
-
setChartYAxisData,
|
|
8
|
-
setLineSeriesStyleData,
|
|
9
|
-
setRingPreSeriesOptions,
|
|
10
|
-
setRingProSeriesOptions,
|
|
11
|
-
set3DPieOptions,
|
|
12
|
-
mapFormatterSet,
|
|
13
|
-
set3DPieMouseHover
|
|
14
|
-
} from '../utils';
|
|
15
|
-
import {
|
|
16
|
-
gaugeNormalAuto,
|
|
17
|
-
lineBarDataAuto,
|
|
18
|
-
pieRingAssetTotalAuto,
|
|
19
|
-
pieRingProportionAuto,
|
|
20
|
-
pieRingNormalAuto,
|
|
21
|
-
topRankingListAuto,
|
|
22
|
-
scatterDataAuto,
|
|
23
|
-
barPileStaticDataAuto
|
|
24
|
-
} from './render';
|
|
25
|
-
import {commonStore, echartsStaticType} from "../../../core";
|
|
26
|
-
|
|
27
|
-
export function getXYAxisLabelVal(index, intervalNum, value) {
|
|
28
|
-
if (index === 0 || index % intervalNum === 0) {
|
|
29
|
-
return value;
|
|
30
|
-
} else {
|
|
31
|
-
return '';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @param node 元件节点
|
|
38
|
-
*/
|
|
39
|
-
export function
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
if(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
dataZoomNode.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
dataZoomNode.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
dataZoomNode.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
series.itemStyle.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
//
|
|
146
|
-
export function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if
|
|
155
|
-
if
|
|
156
|
-
|
|
157
|
-
if
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}else {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
rich
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
//
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
}
|
|
1
|
+
import {echartsDataRoom, echartsColorData, rankingTopImageName} from '../../../static';
|
|
2
|
+
import {
|
|
3
|
+
setSeriesRenderGroup,
|
|
4
|
+
drawGraphicShape,
|
|
5
|
+
setChartLegendData,
|
|
6
|
+
setChartXAxisData,
|
|
7
|
+
setChartYAxisData,
|
|
8
|
+
setLineSeriesStyleData,
|
|
9
|
+
setRingPreSeriesOptions,
|
|
10
|
+
setRingProSeriesOptions,
|
|
11
|
+
set3DPieOptions,
|
|
12
|
+
mapFormatterSet,
|
|
13
|
+
set3DPieMouseHover
|
|
14
|
+
} from '../utils';
|
|
15
|
+
import {
|
|
16
|
+
gaugeNormalAuto,
|
|
17
|
+
lineBarDataAuto,
|
|
18
|
+
pieRingAssetTotalAuto,
|
|
19
|
+
pieRingProportionAuto,
|
|
20
|
+
pieRingNormalAuto,
|
|
21
|
+
topRankingListAuto,
|
|
22
|
+
scatterDataAuto,
|
|
23
|
+
barPileStaticDataAuto
|
|
24
|
+
} from './render';
|
|
25
|
+
import {commonStore, echartsStaticType} from "../../../core";
|
|
26
|
+
|
|
27
|
+
export function getXYAxisLabelVal(index, intervalNum, value) {
|
|
28
|
+
if (index === 0 || index % intervalNum === 0) {
|
|
29
|
+
return value;
|
|
30
|
+
} else {
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 初始化图表与其他组件关联的配置数据
|
|
37
|
+
* @param node 元件节点
|
|
38
|
+
*/
|
|
39
|
+
export function initBindCorrelationSetting(node) {
|
|
40
|
+
if(!node.data.params || node.data.params.staticForType !== 'OTHER') return null;
|
|
41
|
+
const tabStaticKey = node.tags && node.tags.find((tag) => {return tag.includes('switchTabType')});
|
|
42
|
+
if(!tabStaticKey) return null; // 与tabs关联?
|
|
43
|
+
const switchTabData = tabStaticKey && commonStore[node.TID].switchTabDataPool[`${tabStaticKey}Data`];
|
|
44
|
+
if(switchTabData) {
|
|
45
|
+
const tabNode = Object.values(switchTabData)[0];
|
|
46
|
+
const tabEventNode = tabNode.events.find((ev) => {return ev.action === 8});
|
|
47
|
+
const tabStaticType = tabEventNode && tabEventNode.dcimStaticForType || '';
|
|
48
|
+
node.data.params.staticForType = tabStaticType;
|
|
49
|
+
return {
|
|
50
|
+
type: tabStaticType,
|
|
51
|
+
data: tabNode.tabData
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 自动滑动展示数据
|
|
57
|
+
export function setMapAutoMoveOptions(option, chartNode, node, callback) {
|
|
58
|
+
option.dataZoom = echartsDataRoom;
|
|
59
|
+
const dataZoomNode = option.dataZoom[0];
|
|
60
|
+
const {start, end, time} = node.appearance.zoomParams;
|
|
61
|
+
const zoomStart = Number(start);
|
|
62
|
+
const zoomEnd = Number(end);
|
|
63
|
+
const zoomTime = Number(time);
|
|
64
|
+
dataZoomNode.start = zoomStart;
|
|
65
|
+
dataZoomNode.end = zoomEnd;
|
|
66
|
+
chartNode.timeTicket = setInterval(() => {
|
|
67
|
+
if (Number(dataZoomNode.end) > 100) {
|
|
68
|
+
dataZoomNode.end = zoomEnd;
|
|
69
|
+
dataZoomNode.start = zoomStart;
|
|
70
|
+
} else {
|
|
71
|
+
dataZoomNode.end = dataZoomNode.end + 1 * (100 / option.series[0].data.length);
|
|
72
|
+
dataZoomNode.start = dataZoomNode.start + 1 * (100 / option.series[0].data.length);
|
|
73
|
+
}
|
|
74
|
+
callback(option);
|
|
75
|
+
}, zoomTime * 1000);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// 停止自动滑动展示数据
|
|
79
|
+
export function setMapStopAutoMoveOptions(chartNode) {
|
|
80
|
+
|
|
81
|
+
clearInterval(chartNode.timeTicket);
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 自动配置散点图的节点数据
|
|
86
|
+
export function setMapScatterOptions(option, node) {
|
|
87
|
+
if(node.appearance.series) {
|
|
88
|
+
for (let i = 0; i < option.series.length; i++) {
|
|
89
|
+
const series = option.series[i];
|
|
90
|
+
const setSeries = node.appearance.series[i];
|
|
91
|
+
if(setSeries) {
|
|
92
|
+
series.itemStyle.color = setSeries.itemColor;
|
|
93
|
+
series.itemStyle.borderColor = setSeries.itemBorderColor;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if(node.appearance.yAxis && node.appearance.yAxis.axisLabel && node.appearance.yAxis.axisLabel.length) {
|
|
98
|
+
const yAxisAxisLabelRich = option.yAxis[0].axisLabel.rich;
|
|
99
|
+
const yAxisAxisLabel = node.appearance.yAxis.axisLabel;
|
|
100
|
+
const yAxisData = [];
|
|
101
|
+
for (let i = 0; i < yAxisAxisLabel.length; i++) {
|
|
102
|
+
const axisLabel = yAxisAxisLabel[i];
|
|
103
|
+
yAxisAxisLabelRich[`f${i+1}`] = {
|
|
104
|
+
color: axisLabel.color
|
|
105
|
+
};
|
|
106
|
+
if(axisLabel.label) yAxisData.push(axisLabel.label);
|
|
107
|
+
}
|
|
108
|
+
option.yAxis[0].data = yAxisData;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function setLineBarLinear(item, appearance, index) {
|
|
112
|
+
if(!appearance.seriesOptions[index]) {
|
|
113
|
+
appearance.seriesOptions.push({
|
|
114
|
+
colorStops: [
|
|
115
|
+
{
|
|
116
|
+
offset: 0,
|
|
117
|
+
color: echartsColorData[index],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
offset: 1,
|
|
121
|
+
color: 'rgba(255, 255, 255, 1)',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
label: {
|
|
125
|
+
show: false,
|
|
126
|
+
position: 'top',
|
|
127
|
+
distance: 5,
|
|
128
|
+
color: '#fff',
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
const seriesSetItem = appearance.seriesOptions[index];
|
|
133
|
+
item.itemStyle = {
|
|
134
|
+
color: {
|
|
135
|
+
x: 0,
|
|
136
|
+
y: 1,
|
|
137
|
+
x2: 0,
|
|
138
|
+
y2: 0,
|
|
139
|
+
type: 'linear',
|
|
140
|
+
colorStops: seriesSetItem.colorStops,
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
item.label = seriesSetItem.label;
|
|
144
|
+
}
|
|
145
|
+
// 自动配置折线和柱状图的节点数据
|
|
146
|
+
export function setMapLineBarOptions(option, node) {
|
|
147
|
+
option.color = node.appearance.color;
|
|
148
|
+
option.xAxis[0].axisLabel.formatter = function (value, index) {
|
|
149
|
+
return getXYAxisLabelVal(index, node.appearance.intervalNumX, value);
|
|
150
|
+
}
|
|
151
|
+
option.yAxis[0].axisLabel.formatter = function (value, index) {
|
|
152
|
+
return getXYAxisLabelVal(index, node.appearance.intervalNumY, value);
|
|
153
|
+
}
|
|
154
|
+
if(node.appearance.linear) setLineBarLinear(option.series[0], node.appearance, 0); // 线性渐变
|
|
155
|
+
if(option.series.length < 2) return;
|
|
156
|
+
const total = node.appearance.total;
|
|
157
|
+
if(total && total.length) {
|
|
158
|
+
const seriesData = option.series[0].data;
|
|
159
|
+
if(seriesData.length < total.length && total[total.length - 1].value) seriesData.push(20);
|
|
160
|
+
const data2 = [];
|
|
161
|
+
for (let i = 0; i < seriesData.length; i++) {
|
|
162
|
+
const dr = node.appearance.total[i] ? node.appearance.total[i].value - Number(seriesData[i]) : option.series[1].data[i];
|
|
163
|
+
data2.push(dr);
|
|
164
|
+
}
|
|
165
|
+
option.series[1].data = data2;
|
|
166
|
+
}else {
|
|
167
|
+
for (let i = 0; i < option.series.length; i++) {
|
|
168
|
+
const item = option.series[i];
|
|
169
|
+
if(node.appearance.linear){
|
|
170
|
+
// 线性渐变
|
|
171
|
+
setLineBarLinear(item, node.appearance, i);
|
|
172
|
+
}else {
|
|
173
|
+
// 非线性渐变
|
|
174
|
+
if(!(item.itemStyle && item.itemStyle.normal && item.itemStyle.normal.color)) {
|
|
175
|
+
item.itemStyle = {
|
|
176
|
+
normal: {
|
|
177
|
+
color : echartsColorData[i]
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// chartOption.yAxis[0].splitLine = node.appearance.splitLine;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 自动配置仪表盘的节点数据
|
|
188
|
+
export function setMapGaugeOptions(option, node) {
|
|
189
|
+
//const chartOption = JSON.parse(JSON.stringify(option));
|
|
190
|
+
const seriesNode = option.series[0];
|
|
191
|
+
const appearance = node.appearance;
|
|
192
|
+
if(!appearance.min) appearance.min = 0;
|
|
193
|
+
if(!appearance.max) appearance.max = 100;
|
|
194
|
+
if (typeof appearance.min === 'number') seriesNode.min = appearance.min;
|
|
195
|
+
if (appearance.max) seriesNode.max = appearance.max;
|
|
196
|
+
if (appearance.splitNumber) seriesNode.splitNumber = appearance.splitNumber;
|
|
197
|
+
if (appearance.pointer) seriesNode.pointer = appearance.pointer;
|
|
198
|
+
if (appearance.axisLabel) seriesNode.axisLabel = appearance.axisLabel;
|
|
199
|
+
if (appearance.axisLine) seriesNode.axisLine.lineStyle = appearance.axisLine.lineStyle;
|
|
200
|
+
if (appearance.detail) seriesNode.detail = appearance.detail;
|
|
201
|
+
if (appearance.data) seriesNode.data = appearance.data;
|
|
202
|
+
if (appearance.detail) seriesNode.detail = appearance.detail;
|
|
203
|
+
if (appearance.data) seriesNode.data = appearance.data;
|
|
204
|
+
if (option.isGaugeLinear) {
|
|
205
|
+
seriesNode.axisLine.lineStyle.color = [
|
|
206
|
+
[1, new echarts.graphic.LinearGradient(0, 0, 1, 0, option.linearColors)]
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// 自动配置环形图和饼图的节点数据
|
|
212
|
+
export function setMapRingOptions(option, node) {
|
|
213
|
+
//const chartOption = JSON.parse(JSON.stringify(option));
|
|
214
|
+
const appearance = node.appearance;
|
|
215
|
+
if(appearance.type === 'ringPre'){
|
|
216
|
+
//环形‘设备告警统计图’节点展示配置
|
|
217
|
+
setRingPreSeriesOptions(option, appearance);
|
|
218
|
+
|
|
219
|
+
}else if(appearance.type === 'ringPro'){
|
|
220
|
+
//环形‘内存、硬盘、CPU指标占比统计’节点展示配置
|
|
221
|
+
setRingProSeriesOptions(option, appearance);
|
|
222
|
+
|
|
223
|
+
}else if(appearance.type === 'ring3d' || appearance.type === 'pie3d'){
|
|
224
|
+
// 3D饼图配置
|
|
225
|
+
option.backgroundColor = appearance.backgroundColor;
|
|
226
|
+
option.grid3D = {
|
|
227
|
+
show: false,
|
|
228
|
+
top: appearance.grid.top,
|
|
229
|
+
left: appearance.grid.left,
|
|
230
|
+
right: appearance.grid.right,
|
|
231
|
+
bottom: appearance.grid.bottom,
|
|
232
|
+
viewControl: {
|
|
233
|
+
alpha: appearance.grid.alpha, //角度
|
|
234
|
+
distance: appearance.grid.distance, //调整视角到主体的距离,类似调整zoom
|
|
235
|
+
rotateSensitivity: 0, //设置为0无法旋转
|
|
236
|
+
zoomSensitivity: 0, //设置为0无法缩放
|
|
237
|
+
panSensitivity: 0, //设置为0无法平移
|
|
238
|
+
autoRotate: false, //自动旋转
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
if(appearance.grid.beta) option.grid3D.viewControl.beta = appearance.grid.beta;
|
|
242
|
+
Object.assign(option.legend, appearance.legend);
|
|
243
|
+
if(appearance.labelLine && appearance.labelLine.show) set3DPieLabelLine(option, appearance.labelLine, node.TID, node.id);
|
|
244
|
+
if(appearance.legendTextStyle) {
|
|
245
|
+
const {fontSize, align, color, width, data} = appearance.legendTextStyle;
|
|
246
|
+
const rich = {
|
|
247
|
+
a: {
|
|
248
|
+
color,
|
|
249
|
+
width
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
for (let i = 0; i < data.length; i++) {
|
|
253
|
+
rich[`b${i}`] = data[i];
|
|
254
|
+
}
|
|
255
|
+
option.legend.textStyle = {
|
|
256
|
+
fontSize,
|
|
257
|
+
align,
|
|
258
|
+
rich
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}else {
|
|
262
|
+
// 基础图表的配置
|
|
263
|
+
const seriesNode = option.series[0];
|
|
264
|
+
if ((!appearance.label || typeof appearance.label.showValue !== 'boolean')) {
|
|
265
|
+
appearance.label = {
|
|
266
|
+
showValue: appearance.type === 'ring',
|
|
267
|
+
unit: appearance.type === 'ring' ? '%' : ''
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
seriesNode.label = {
|
|
271
|
+
normal: {
|
|
272
|
+
show: true,
|
|
273
|
+
position: 'outside',
|
|
274
|
+
color: appearance.label.color || '',
|
|
275
|
+
fontSize: appearance.label.fontSize || '12'
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
seriesNode.labelLine = appearance.labelLine && {...appearance.labelLine} || {};
|
|
280
|
+
|
|
281
|
+
if(seriesNode.labelLine.lineStyle && !seriesNode.labelLine.lineStyle.color) {
|
|
282
|
+
delete seriesNode.labelLine.lineStyle['color'];
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const rich = {};
|
|
286
|
+
|
|
287
|
+
if(appearance.cir && appearance.cir.show) {
|
|
288
|
+
rich.cir = {...appearance.cir};
|
|
289
|
+
if(!rich.cir.borderColor) rich.cir.borderColor = 'auto';
|
|
290
|
+
if(!rich.cir.backgroundColor) rich.cir.backgroundColor = 'transparent';
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if(appearance.labelDetail && appearance.labelDetail.length) {
|
|
294
|
+
// 环形明细展示配置,线条样式配置
|
|
295
|
+
rich.a = {
|
|
296
|
+
color: appearance.label.color || '',
|
|
297
|
+
fontSize: appearance.label.fontSize || '12'
|
|
298
|
+
};
|
|
299
|
+
for (let i = 0; i < appearance.labelDetail.length; i++) {
|
|
300
|
+
const detail = appearance.labelDetail[i];
|
|
301
|
+
rich[`b${i+1}`] = {
|
|
302
|
+
color: detail.color,
|
|
303
|
+
fontSize: detail.fontSize || '12'
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
seriesNode.label.normal.rich = rich;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function getItemNode(color, fontSize, fontWeight, padding) {
|
|
312
|
+
return {
|
|
313
|
+
color,
|
|
314
|
+
fontSize,
|
|
315
|
+
fontWeight,
|
|
316
|
+
padding
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// 设置3D饼图引线样式
|
|
321
|
+
function set3DPieLabelLine(option, labelLine, TID, id){
|
|
322
|
+
const rich = {};
|
|
323
|
+
const { data, color, lengthWidth, startAngle, clockwise, center, radius } = labelLine;
|
|
324
|
+
const lineData = [];
|
|
325
|
+
for (let i = 0; i < data.length; i ++){
|
|
326
|
+
const {
|
|
327
|
+
length,
|
|
328
|
+
length2,
|
|
329
|
+
nameFontSize,
|
|
330
|
+
nameFontWeight,
|
|
331
|
+
nameColor,
|
|
332
|
+
namePadding,
|
|
333
|
+
valueFontSize,
|
|
334
|
+
valueFontWeight,
|
|
335
|
+
valueColor,
|
|
336
|
+
valuePadding,
|
|
337
|
+
unitFontSize,
|
|
338
|
+
unitFontWeight,
|
|
339
|
+
unitColor,
|
|
340
|
+
unitPadding
|
|
341
|
+
} = data[i];
|
|
342
|
+
rich[`name${i+1}`] = getItemNode(nameColor, nameFontSize, nameFontWeight, namePadding);
|
|
343
|
+
rich[`unit${i+1}`] = getItemNode(unitColor, unitFontSize, unitFontWeight, unitPadding);
|
|
344
|
+
rich[`value${i+1}`] = getItemNode(valueColor, valueFontSize, valueFontWeight, valuePadding);
|
|
345
|
+
lineData.push({
|
|
346
|
+
minTurnAngle: 90,
|
|
347
|
+
length: length,
|
|
348
|
+
length2: length2,
|
|
349
|
+
lineStyle: {
|
|
350
|
+
width: lengthWidth
|
|
351
|
+
}
|
|
352
|
+
})
|
|
353
|
+
}
|
|
354
|
+
commonStore[TID].echartsDataPool[id].labelLineData = {
|
|
355
|
+
name: 'pie2d',
|
|
356
|
+
type: 'pie',
|
|
357
|
+
hoverAnimation: false,
|
|
358
|
+
label: {
|
|
359
|
+
opacity: 1,
|
|
360
|
+
color,
|
|
361
|
+
rich
|
|
362
|
+
},
|
|
363
|
+
startAngle, //起始角度,支持范围[0, 360]。
|
|
364
|
+
clockwise, //饼图的扇区是否是顺时针排布。上述这两项配置主要是为了对齐3d的样式
|
|
365
|
+
radius, // 两个值设置成相同的,环形就隐藏了
|
|
366
|
+
center, //指示线的位置
|
|
367
|
+
data: lineData
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// 自动配置3D柱状图的节点数据
|
|
372
|
+
export function setMap3dBarOptions(option, node) {
|
|
373
|
+
// 取消注册自定义形状
|
|
374
|
+
//const chartOption = JSON.parse(JSON.stringify(option));
|
|
375
|
+
const seriesNode = option.series[0];
|
|
376
|
+
const appearance = node.appearance;
|
|
377
|
+
if (appearance.seriesCubeLeftLinear) appearance.seriesCubeLeftColor = 'rgb(0, 128, 215)';
|
|
378
|
+
if (appearance.seriesCubeRightLinear) appearance.seriesCubeRightColor = 'rgb(3, 58, 125)';
|
|
379
|
+
if (appearance.graphicShape) {
|
|
380
|
+
const {CubeLeft, CubeRight, CubeTop} = drawGraphicShape(appearance);
|
|
381
|
+
// 注册三个面图形
|
|
382
|
+
echarts.graphic.registerShape('CubeLeft', CubeLeft);
|
|
383
|
+
echarts.graphic.registerShape('CubeRight', CubeRight);
|
|
384
|
+
echarts.graphic.registerShape('CubeTop', CubeTop);
|
|
385
|
+
}
|
|
386
|
+
option.tooltip.formatter = function (params) {
|
|
387
|
+
const item = params[0];
|
|
388
|
+
return item.name + ' : ' + item.value;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function renderMap3dBarSeriesItem(seriesNode, appearance) {
|
|
393
|
+
seriesNode.renderItem = (params, api) => {
|
|
394
|
+
const seriesRenderData = setSeriesRenderGroup(appearance, api);
|
|
395
|
+
return {
|
|
396
|
+
type: 'group',
|
|
397
|
+
children: seriesRenderData,
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export function setMapTopOptions(option, node) {
|
|
403
|
+
//const chartOption = JSON.parse(JSON.stringify(option));
|
|
404
|
+
const appearance = node.appearance;
|
|
405
|
+
Object.assign(option.grid, appearance.grid);
|
|
406
|
+
if(!appearance.type.includes('TOPRanking')) return;
|
|
407
|
+
const yNode = option.yAxis[0];
|
|
408
|
+
if(yNode.axisLabel.rich['a1']) return;
|
|
409
|
+
for (let i = 0, length = yNode.data.length; i < length; i++) {
|
|
410
|
+
const order = i + 1;
|
|
411
|
+
yNode.axisLabel.rich[`a${order}`] = {
|
|
412
|
+
width: 30,
|
|
413
|
+
height: 17,
|
|
414
|
+
lineHeight: 22,
|
|
415
|
+
verticalAlign: 'bottom',
|
|
416
|
+
backgroundColor: {
|
|
417
|
+
image: `../../../images/TOP/NO-${order}-${rankingTopImageName[i]}.png`
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* 公共配置
|
|
425
|
+
* @param option 图表配置数据
|
|
426
|
+
* @param node 元件数据
|
|
427
|
+
*/
|
|
428
|
+
export function setMapGlobalOptions(option, node) {
|
|
429
|
+
// const chartOption = JSON.parse(JSON.stringify(option));
|
|
430
|
+
const appearance = node.appearance;
|
|
431
|
+
// 图表网格数据
|
|
432
|
+
if (appearance.grid && !appearance.grid.distance) {
|
|
433
|
+
|
|
434
|
+
option.grid ? Object.assign(option.grid, appearance.grid) : option.grid = appearance.grid;
|
|
435
|
+
|
|
436
|
+
}
|
|
437
|
+
// 图表X轴数据
|
|
438
|
+
if (option.xAxis) setChartXAxisData(option.xAxis, appearance);
|
|
439
|
+
// 图表Y轴数据
|
|
440
|
+
if (option.yAxis) setChartYAxisData(option.yAxis, appearance);
|
|
441
|
+
// 图表图例数据
|
|
442
|
+
if (appearance.legend) setChartLegendData(option.legend, appearance);
|
|
443
|
+
// 曲线样式数据
|
|
444
|
+
if (appearance.type.includes('line')) setLineSeriesStyleData(option.series, appearance);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// 实时改变图表data值
|
|
448
|
+
export function setMapDataOptions(option, node) {
|
|
449
|
+
const currentStore = commonStore[node.TID];
|
|
450
|
+
let optionNode = currentStore.echartsOptionsPool[node.id].option;
|
|
451
|
+
const appearance = node.appearance;
|
|
452
|
+
const params = node.params;
|
|
453
|
+
// 3d 柱状图
|
|
454
|
+
if (appearance.type === '3dBar') renderMap3dBarSeriesItem(optionNode.series[0], appearance);
|
|
455
|
+
const displayMode = parseInt(option.displayMode); // 图表类型
|
|
456
|
+
const staticForType = params && params.staticForType || ''; //统计类型:日,周,月,年,实时,其他
|
|
457
|
+
const syncEchartsData = commonStore[node.TID].echartsRealDataPool[node.id]; // 统计图实时数据
|
|
458
|
+
let staticTypeData = null; // 统计类型数据
|
|
459
|
+
if(staticForType === 'OTHER'){
|
|
460
|
+
// 其他类型,类型中的数据通常统计的都是历史数据,日、周、月、年、实时中的某一类,通常搭配分组统计使用。
|
|
461
|
+
// 类型中绑定一个测点为一个类型,绑定多个测点为多个类型。比如:有电功率和功率因数为两个分类,图表分组中分类数据绑定时就要同时绑定有电功率和功率因数两个测点,否则无法实现切换
|
|
462
|
+
for (let i = 0 ; i < echartsStaticType.length; i++) {
|
|
463
|
+
const chartData = syncEchartsData && syncEchartsData[`${echartsStaticType[i]}_Data`];
|
|
464
|
+
if(chartData) staticTypeData = chartData;
|
|
465
|
+
}
|
|
466
|
+
}else {
|
|
467
|
+
// 日,周,月,年,实时类型,不与分组统计一起使用
|
|
468
|
+
staticTypeData = staticForType ? syncEchartsData && syncEchartsData[`${staticForType}_Data`] : syncEchartsData;
|
|
469
|
+
}
|
|
470
|
+
let dataDictionary = {};
|
|
471
|
+
// 实时数据加载
|
|
472
|
+
if(staticTypeData) {
|
|
473
|
+
|
|
474
|
+
if (displayMode === 1 || displayMode === 2) { // 折线图,柱状图
|
|
475
|
+
|
|
476
|
+
if(node.tabData && node.tabData.data.state && optionNode.yAxis[0].max) Object.assign(optionNode.yAxis[0], node.tabData.data); //若Tabs切换配置了数据,则修改Y轴原有配置
|
|
477
|
+
|
|
478
|
+
if(appearance.type === 'barPileStatic') {
|
|
479
|
+
|
|
480
|
+
barPileStaticDataAuto(optionNode, staticTypeData, appearance);
|
|
481
|
+
|
|
482
|
+
}else {
|
|
483
|
+
|
|
484
|
+
lineBarDataAuto(optionNode, params, staticTypeData, appearance);
|
|
485
|
+
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
}
|
|
489
|
+
if(displayMode === 4) { // top排行榜-电量仪
|
|
490
|
+
|
|
491
|
+
topRankingListAuto(optionNode, staticTypeData, appearance);
|
|
492
|
+
|
|
493
|
+
}
|
|
494
|
+
if(displayMode === 7) { // 散点图
|
|
495
|
+
|
|
496
|
+
scatterDataAuto(optionNode, staticTypeData);
|
|
497
|
+
|
|
498
|
+
}
|
|
499
|
+
if (displayMode === 5 || displayMode === 3) { // 饼图/环形图
|
|
500
|
+
const pieData = staticTypeData && staticTypeData.data || staticTypeData || [];
|
|
501
|
+
if(appearance.type === 'ringPre') {
|
|
502
|
+
// 按照资产总台数统计设备告警数量
|
|
503
|
+
pieRingAssetTotalAuto(optionNode, pieData, appearance.total, appearance.alarmCount);
|
|
504
|
+
|
|
505
|
+
}else if(appearance.type === 'ringPro'){
|
|
506
|
+
// 按照百分比统计设备配置情况
|
|
507
|
+
pieRingProportionAuto(optionNode, pieData, appearance.proportion);
|
|
508
|
+
|
|
509
|
+
}else if(appearance.type === 'ring3d' || appearance.type === 'pie3d'){
|
|
510
|
+
for (let i = 0; i < pieData.length; i++){
|
|
511
|
+
pieData[i].itemOpacity = 0.9;
|
|
512
|
+
pieData[i].itemColor = appearance.chartData[i] && appearance.chartData[i].itemColor || echartsColorData[i];
|
|
513
|
+
}
|
|
514
|
+
// 3D饼图图例更新
|
|
515
|
+
const labelLineData = currentStore.echartsDataPool[node.id].labelLineData;
|
|
516
|
+
dataDictionary = set3DPieOptions(optionNode, appearance, labelLineData, pieData);
|
|
517
|
+
|
|
518
|
+
}else {
|
|
519
|
+
|
|
520
|
+
pieRingNormalAuto(optionNode, pieData);
|
|
521
|
+
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if(displayMode === 6) { // 仪表盘
|
|
525
|
+
|
|
526
|
+
gaugeNormalAuto(optionNode, staticTypeData);
|
|
527
|
+
|
|
528
|
+
}
|
|
529
|
+
}else {
|
|
530
|
+
if(option.title && option.title.text) {
|
|
531
|
+
optionNode.title.text = option.title.text;
|
|
532
|
+
}
|
|
533
|
+
if (option.legend) {
|
|
534
|
+
optionNode.legend = option.legend;
|
|
535
|
+
} else {
|
|
536
|
+
delete optionNode['legend'];
|
|
537
|
+
}
|
|
538
|
+
if (option.xAxis) {
|
|
539
|
+
for (let i = 0; i < option.xAxis.length; i++) {
|
|
540
|
+
const item = option.xAxis[i];
|
|
541
|
+
if (item.data) {
|
|
542
|
+
optionNode.xAxis[i].data = item.data;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
if (option.yAxis) {
|
|
547
|
+
for (let i = 0; i < option.yAxis.length; i++) {
|
|
548
|
+
const item = option.yAxis[i];
|
|
549
|
+
if (item.data) {
|
|
550
|
+
optionNode.yAxis[i].data = item.data;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
if(option.series[0] && option.series[0].pieData) {
|
|
555
|
+
// 3D饼图图例初始化
|
|
556
|
+
const labelLineData = currentStore.echartsDataPool[node.id].labelLineData;
|
|
557
|
+
dataDictionary = set3DPieOptions(option, appearance, labelLineData);
|
|
558
|
+
optionNode = option;
|
|
559
|
+
}else {
|
|
560
|
+
if (option.series) {
|
|
561
|
+
for (let i = 0; i < option.series.length; i++) {
|
|
562
|
+
const item = option.series[i];
|
|
563
|
+
if(item.name) optionNode.series[i].name = item.name;
|
|
564
|
+
optionNode.series[i].data = item.data;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
mapFormatterSet(appearance, optionNode, staticTypeData, dataDictionary);
|
|
571
|
+
|
|
572
|
+
const currentChartNode = commonStore[node.TID].echartsDataPool[node.id];
|
|
573
|
+
const mapChart = currentChartNode.chart;
|
|
574
|
+
clearInterval(currentChartNode.timeTicket);
|
|
575
|
+
currentChartNode.timeTicket = null;
|
|
576
|
+
// 自动滑动展示数据
|
|
577
|
+
if (appearance.timeTicket) {
|
|
578
|
+
mapChart.off('mouseover');
|
|
579
|
+
mapChart.off('mouseout');
|
|
580
|
+
mapChart.on('mouseover', function () {
|
|
581
|
+
setMapStopAutoMoveOptions(currentChartNode);
|
|
582
|
+
});
|
|
583
|
+
mapChart.on('mouseout', function () {
|
|
584
|
+
setMapAutoMoveOptions(optionNode, currentChartNode, node, function (chartNode) {
|
|
585
|
+
return mapChart.setOption(chartNode);
|
|
586
|
+
})
|
|
587
|
+
});
|
|
588
|
+
setMapAutoMoveOptions(optionNode, currentChartNode, node, function (chartNode) {
|
|
589
|
+
return mapChart.setOption(chartNode);
|
|
590
|
+
})
|
|
591
|
+
}
|
|
592
|
+
// 鼠标hover状态,用于3D饼图
|
|
593
|
+
if(appearance.mouseHoverState) {
|
|
594
|
+
mapChart.off('mouseover');
|
|
595
|
+
mapChart.off('globalout');
|
|
596
|
+
let type = appearance.type.includes('pie') ? 'pie' : 'ring';
|
|
597
|
+
set3DPieMouseHover(mapChart, type, option, appearance.seriesStyleData);
|
|
598
|
+
}
|
|
599
|
+
mapChart.setOption(optionNode);
|
|
600
|
+
mapChart.resize();
|
|
601
|
+
}
|