xt-element-ui 1.1.9 → 1.1.91

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.
@@ -1,1138 +0,0 @@
1
- ((typeof self !== 'undefined' ? self : this)["webpackJsonpxt_element_ui"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpxt_element_ui"] || []).push([[4],{
2
-
3
- /***/ "20f2":
4
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5
-
6
- "use strict";
7
- // ESM COMPAT FLAG
8
- __webpack_require__.r(__webpack_exports__);
9
-
10
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3d759d14-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ex-chart/ExMulti.vue?vue&type=template&id=18661424&scoped=true
11
- var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:"multilinechart",staticClass:"multiline-box"})
12
- }
13
- var staticRenderFns = []
14
-
15
-
16
- // CONCATENATED MODULE: ./src/components/ex-chart/ExMulti.vue?vue&type=template&id=18661424&scoped=true
17
-
18
- // EXTERNAL MODULE: ./src/components/ex-chart/utils.js + 5 modules
19
- var utils = __webpack_require__("22f5");
20
-
21
- // CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ex-chart/ExMulti.vue?vue&type=script&lang=js
22
-
23
-
24
- /* harmony default export */ var ExMultivue_type_script_lang_js = ({
25
- name: "XtMulti",
26
- props: {
27
- isDark: {
28
- type: Boolean, // 设置文字标线为白色系
29
- default: false
30
- },
31
- theme: {},
32
- size: {
33
- type: String,
34
- default: "medium"
35
- },
36
- config: {
37
- type: Object,
38
- default() {
39
- return {
40
- interval: 0,
41
- rotate: 0,
42
- gridbottom: 40,
43
- isShowthreshold: false
44
-
45
- };
46
- }
47
- },
48
- chartData: {
49
- type: Array,
50
- default: () => {
51
- return [
52
- {
53
- label: "入户数",
54
- data: [
55
- { label: "01月", value: 980 },
56
- { label: "02月", value: 806 },
57
- { label: "03月", value: 930 },
58
- { label: "04月", value: 804 },
59
- { label: "05月", value: 750 },
60
- { label: "06月", value: 660 },
61
- { label: "07月", value: 780 },
62
- { label: "08月", value: 630 },
63
- { label: "09月", value: 806 },
64
- { label: "10月", value: 950 },
65
- { label: "11月", value: 810 },
66
- { label: "12月", value: 703 }
67
- ]
68
- },
69
- {
70
- label: "隐患数",
71
- data: [
72
- { label: "01月", value: 200 },
73
- { label: "02月", value: 120 },
74
- { label: "03月", value: 110 },
75
- { label: "04月", value: 109 },
76
- { label: "05月", value: 108 },
77
- { label: "06月", value: 150 },
78
- { label: "07月", value: 126 },
79
- { label: "08月", value: 130 },
80
- { label: "09月", value: 108 },
81
- { label: "10月", value: 109 },
82
- { label: "11月", value: 140 },
83
- { label: "12月", value: 106 }
84
- ]
85
- },
86
- {
87
- label: "整改数",
88
- data: [
89
- { label: "01月", value: 25 },
90
- { label: "02月", value: 19 },
91
- { label: "03月", value: 34 },
92
- { label: "04月", value: 12 },
93
- { label: "05月", value: 16 },
94
- { label: "06月", value: 20 },
95
- { label: "07月", value: 19 },
96
- { label: "08月", value: 18 },
97
- { label: "09月", value: 14 },
98
- { label: "10月", value: 12 },
99
- { label: "11月", value: 11 },
100
- { label: "12月", value: 16 }
101
- ]
102
- }
103
- ];
104
- }
105
- },
106
- colors: {
107
- type: Array,
108
- default: () => { return []; }
109
- },
110
- selectedNew: {
111
- type: Object,
112
- default: null
113
- },
114
- energyType: {
115
- type: [String, Array],
116
- default: ""
117
- }
118
- },
119
- data() {
120
- return {
121
- myChart: null
122
- // chartList: []
123
- };
124
- },
125
- watch: {
126
- chartData: {
127
- deep: true,
128
- handler(newVal, oldVal) {
129
- const _self = this;
130
- this.myChart && this.myChart.dispose();
131
- this.myChart = null;
132
- _self.initChart();
133
- }
134
- },
135
- energyType: {
136
- deep: true,
137
- handler(newVal, oldVal) {
138
- if (newVal && oldVal && newVal.toString() == oldVal.toString()) {
139
- return;
140
- }
141
- this.myChart && this.myChart.dispose();
142
- this.myChart = null;
143
- const _self = this;
144
- _self.initChart();
145
- }
146
- },
147
- theme(newVal) {
148
- this.myChart && this.myChart.dispose();
149
- this.myChart = null;
150
- this.initChart();
151
- }
152
- },
153
- mounted() {
154
- this.initChart();
155
- },
156
- methods: {
157
- initChart() {
158
- const _self = this;
159
- // 数据处理
160
- const groupYAxis = (unit) => {
161
- return {
162
- type: "value",
163
- name: unit,
164
- axisLine: {
165
- show: false,
166
- lineStyle: {
167
- }
168
- },
169
- axisTick: {
170
- show: false
171
- },
172
- splitLine: {
173
- lineStyle: {
174
- type: "dashed"
175
- }
176
- },
177
- axisLabel: {
178
- formatter: function(value, index) {
179
- if (value >= 10000 && value < 10000000) {
180
- value = Math.floor(value / 10000) + "万";
181
- } else if (value >= 10000000) {
182
- value = Math.floor(value / 10000000) + "千万";
183
- }
184
- return value;
185
- }
186
- }
187
- };
188
- };
189
- const option = {
190
- legend: {
191
- right: 20,
192
- top: 0,
193
- show: true,
194
- data: _self.chartData.map((item) => {
195
- return item.label;
196
- }),
197
- selectedMode: "multiple",
198
- selected: _self.selectedNew,
199
- textStyle: {
200
- fontSize: 12
201
- }
202
- },
203
- tooltip: {
204
- borderWidth: 1,
205
- trigger: "axis",
206
- axisPointer: {
207
- type: "shadow"
208
- }
209
- },
210
- grid: {
211
- top: "25%",
212
- left: "40",
213
- right: "15",
214
- bottom: this.config.gridbottom == null ? 20 : this.config.gridbottom
215
- },
216
- xAxis: {
217
- type: "category",
218
- // splitLine: {
219
- // show: true,
220
- // lineStyle: {
221
- // type: "dashed"
222
- // }
223
- // },
224
- axisLabel: {
225
- rotate: this.config.rotate
226
- },
227
- data: _self.chartData && _self.chartData.length ? _self.chartData[0].data.map((item) => {
228
- return item.label;
229
- }) : []
230
- },
231
- yAxis: typeof _self.energyType == "string" ? groupYAxis(_self.energyType) : this.energyType.map(unit => groupYAxis(unit)),
232
- dataZoom: [
233
- {
234
- type: "inside",
235
- xAxisIndex: [0],
236
- start: 1,
237
- end: 100
238
- }
239
- ],
240
- series: this.getSeriesData()
241
- };
242
- this.myChart = utils["a" /* default */].init(_self.$refs.multilinechart, this.theme, option, this.size);
243
- },
244
- getSeriesData() {
245
- // 创建 24小时 时间数据填充对象
246
- const _self = this;
247
-
248
- const _seriesData = [];
249
- _self.chartData.map((item, ind) => {
250
- // debugger;
251
- const _isNUll = item.data.some(it => !it.value || it.value == "--");
252
- const _itemNull = {
253
- type: "",
254
- name: item.label,
255
- connectNulls: true, // 断点连线,true-连接,false-不连接
256
- data: item.data.map(it => it.value),
257
- tooltip: {
258
- show: false
259
- }
260
- };
261
- const _item = {
262
- animation: true,
263
- name: item.label,
264
- type: item.type || "bar",
265
- avoidLabelOverlap: true,
266
- data: item.data.map(it => it.value)
267
- };
268
- _seriesData.push(_item);
269
- });
270
- return _seriesData;
271
- }
272
- }
273
- });
274
-
275
- // CONCATENATED MODULE: ./src/components/ex-chart/ExMulti.vue?vue&type=script&lang=js
276
- /* harmony default export */ var ex_chart_ExMultivue_type_script_lang_js = (ExMultivue_type_script_lang_js);
277
- // EXTERNAL MODULE: ./src/components/ex-chart/ExMulti.vue?vue&type=style&index=0&id=18661424&prod&lang=scss&scoped=true
278
- var ExMultivue_type_style_index_0_id_18661424_prod_lang_scss_scoped_true = __webpack_require__("a68f");
279
-
280
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
281
- var componentNormalizer = __webpack_require__("2877");
282
-
283
- // CONCATENATED MODULE: ./src/components/ex-chart/ExMulti.vue
284
-
285
-
286
-
287
-
288
-
289
-
290
- /* normalize component */
291
-
292
- var component = Object(componentNormalizer["a" /* default */])(
293
- ex_chart_ExMultivue_type_script_lang_js,
294
- render,
295
- staticRenderFns,
296
- false,
297
- null,
298
- "18661424",
299
- null
300
-
301
- )
302
-
303
- /* harmony default export */ var ExMulti = __webpack_exports__["default"] = (component.exports);
304
-
305
- /***/ }),
306
-
307
- /***/ "22f5":
308
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
309
-
310
- "use strict";
311
-
312
- // UNUSED EXPORTS: getEcharts
313
-
314
- // CONCATENATED MODULE: ./src/components/ex-chart/theme/white.js
315
- /* harmony default export */ var white = ({
316
- color: ["#1890ff", "#37c3a4", "#29c0ce", "#6480D7", "#8cce6f", "#3a5dca", "#ffb74d"],
317
- backgroundColor: "#ffffff",
318
- textStyle: {
319
- fontFamily: "Microsoft YaHei, sans-serif"
320
- },
321
- title: {
322
- textStyle: {
323
- color: "#333",
324
- fontSize: 16
325
- },
326
- subtextStyle: {
327
- color: "#666666",
328
- fontSize: 12
329
- }
330
- },
331
- line: {
332
- itemStyle: {
333
- },
334
- lineStyle: {
335
- width: 2
336
- }
337
- },
338
- bar: {
339
- itemStyle: {
340
- borderRadius: 4
341
- }
342
- },
343
- pie: {
344
- roseType: "radius",
345
- label: {
346
- color: "#333"
347
- }
348
- },
349
- radar: {
350
- indicator: {
351
- color: "#666666"
352
- }
353
- },
354
- map: {
355
- label: {
356
- color: "#333"
357
- },
358
- itemStyle: {
359
- borderColor: "#fff"
360
- }
361
- },
362
- gauge: {
363
- axisLine: {
364
- lineStyle: {
365
- color: [[1, "#5470c6"]]
366
- }
367
- }
368
- },
369
- toolbox: {
370
- iconStyle: {
371
- borderColor: "#666666"
372
- }
373
- },
374
- xAxis: {
375
- axisLine: {
376
- lineStyle: {
377
- color: "#DFE9EE"
378
- }
379
- },
380
- axisTick: {
381
- lineStyle: {
382
- color: "#DFE9EE"
383
- },
384
- show: false
385
- }
386
- },
387
- yAxis: {
388
- axisLine: {
389
- lineStyle: {
390
- color: "#DFE9EE"
391
- }
392
- },
393
- axisTick: {
394
- lineStyle: {
395
- color: "#DFE9EE"
396
- }
397
- },
398
- splitLine: {
399
- show: true,
400
- lineStyle: {
401
- type: "dashed",
402
- color: "#DFE9EE"
403
- }
404
- }
405
- },
406
- splitArea: {
407
- areaStyle: {
408
- color: ["#f7f8fa", "#ffffff"]
409
- }
410
- },
411
- legend: {
412
- textStyle: {
413
- color: "#333333"
414
- }
415
- },
416
- tooltip: {
417
- borderWidth: 1,
418
- backgroundColor: "#ffffff",
419
- textStyle: {
420
- color: "#333333"
421
- },
422
- trigger: "axis"
423
- }
424
- });
425
-
426
- // CONCATENATED MODULE: ./src/components/ex-chart/theme/dark.js
427
- /* harmony default export */ var dark = ({
428
- color: ["#0de7ff", "#a782ff", "#fcdd60", "#0de7ff", "#ffc5a1", "#6291ae", "#13ce66"],
429
- backgroundColor: "transparent",
430
- textStyle: {
431
- fontFamily: "Microsoft YaHei, sans-serif"
432
- },
433
- title: {
434
- textStyle: {
435
- color: "#333"
436
- },
437
- subtextStyle: {
438
- color: "#666666"
439
- }
440
- },
441
- line: {
442
- itemStyle: {
443
- },
444
- lineStyle: {
445
- width: 2
446
- }
447
- },
448
- bar: {
449
- itemStyle: {
450
- borderRadius: 4
451
- }
452
- },
453
- pie: {
454
- roseType: "radius",
455
- label: {
456
- color: "#333"
457
- }
458
- },
459
- radar: {
460
- indicator: {
461
- color: "#666666"
462
- }
463
- },
464
- map: {
465
- label: {
466
- color: "#333"
467
- },
468
- itemStyle: {
469
- borderColor: "#fff"
470
- }
471
- },
472
- gauge: {
473
- axisLine: {
474
- lineStyle: {
475
- color: [[1, "#5470c6"]]
476
- }
477
- }
478
- },
479
- toolbox: {
480
- iconStyle: {
481
- borderColor: "#666666"
482
- }
483
- },
484
- axisLine: {
485
- lineStyle: {
486
- color: "#DCDFE6"
487
- }
488
- },
489
- axisTick: {
490
- lineStyle: {
491
- color: "#DCDFE6"
492
- }
493
- },
494
- splitLine: {
495
- lineStyle: {
496
- color: "#ebeef5"
497
- }
498
- },
499
- splitArea: {
500
- areaStyle: {
501
- color: ["#f7f8fa", "#ffffff"]
502
- }
503
- },
504
- legend: {
505
- textStyle: {
506
- color: "#666"
507
- }
508
- },
509
- tooltip: {
510
- backgroundColor: "rgba(255, 255, 255, 0.95)",
511
- borderColor: "#DCDFE6",
512
- borderWidth: 1,
513
- textStyle: {
514
- color: "#333"
515
- }
516
- }
517
- });
518
-
519
- // CONCATENATED MODULE: ./src/components/ex-chart/theme/blue.js
520
- /* harmony default export */ var blue = ({
521
- color: ["#2CDEB3", "#A17EE6", "#E57E40", "#409EFF"],
522
- backgroundColor: "#ffffff",
523
- textStyle: {
524
- fontFamily: "Microsoft YaHei, sans-serif"
525
- },
526
- title: {
527
- textStyle: {
528
- color: "#333"
529
- },
530
- subtextStyle: {
531
- color: "#666666"
532
- }
533
- },
534
- line: {
535
- itemStyle: {
536
- },
537
- lineStyle: {
538
- width: 2
539
- }
540
- },
541
- bar: {
542
- itemStyle: {
543
- borderRadius: 4
544
- }
545
- },
546
- pie: {
547
- roseType: "radius",
548
- label: {
549
- color: "#333"
550
- }
551
- },
552
- radar: {
553
- indicator: {
554
- color: "#666666"
555
- }
556
- },
557
- map: {
558
- label: {
559
- color: "#333"
560
- },
561
- itemStyle: {
562
- borderColor: "#fff"
563
- }
564
- },
565
- gauge: {
566
- axisLine: {
567
- lineStyle: {
568
- color: [[1, "#5470c6"]]
569
- }
570
- }
571
- },
572
- toolbox: {
573
- iconStyle: {
574
- borderColor: "#666666"
575
- }
576
- },
577
- axisLine: {
578
- lineStyle: {
579
- color: "#DCDFE6"
580
- }
581
- },
582
- axisTick: {
583
- lineStyle: {
584
- color: "#DCDFE6"
585
- }
586
- },
587
- splitLine: {
588
- lineStyle: {
589
- color: "#ebeef5"
590
- }
591
- },
592
- splitArea: {
593
- areaStyle: {
594
- color: ["#f7f8fa", "#ffffff"]
595
- }
596
- },
597
- legend: {
598
- textStyle: {
599
- color: "#666"
600
- }
601
- },
602
- tooltip: {
603
- backgroundColor: "rgba(255, 255, 255, 0.95)",
604
- borderColor: "#DCDFE6",
605
- borderWidth: 1,
606
- textStyle: {
607
- color: "#333"
608
- }
609
- }
610
- });
611
-
612
- // CONCATENATED MODULE: ./src/components/ex-chart/theme/starry.js
613
- /* harmony default export */ var starry = ({
614
- color: [
615
- "#1685a9", // 石青
616
- "#21a675", // 松柏绿
617
- "#1bd1a5", // 飞燕草蓝
618
- "#8c4356", // 绛紫
619
- "#0dafc6", // 孔雀蓝
620
- "#4b5cc4", // 宝蓝
621
- "#758a99", // 墨灰
622
- "#cca4e3", // 丁香色
623
- "#205277", // 靛青色
624
- "#d9b611", // 秋香色
625
- "#ff8c31", // 杏红
626
- "#9d2933", // 胭脂
627
- "#0288c5", // 浅靛青蓝
628
- "#44cef6" // 天蓝色
629
- ],
630
- backgroundColor: "#ffffff",
631
- textStyle: {
632
- fontFamily: "Microsoft YaHei, sans-serif"
633
- },
634
- title: {
635
- textStyle: {
636
- color: "#333"
637
- },
638
- subtextStyle: {
639
- color: "#666666"
640
- }
641
- },
642
- line: {
643
- itemStyle: {
644
- },
645
- lineStyle: {
646
- width: 2
647
- }
648
- },
649
- bar: {
650
- itemStyle: {
651
- borderRadius: 4
652
- }
653
- },
654
- pie: {
655
- roseType: "radius",
656
- label: {
657
- color: "#333"
658
- }
659
- },
660
- radar: {
661
- indicator: {
662
- color: "#666666"
663
- }
664
- },
665
- map: {
666
- label: {
667
- color: "#333"
668
- },
669
- itemStyle: {
670
- borderColor: "#fff"
671
- }
672
- },
673
- gauge: {
674
- axisLine: {
675
- lineStyle: {
676
- color: [[1, "#5470c6"]]
677
- }
678
- }
679
- },
680
- toolbox: {
681
- iconStyle: {
682
- borderColor: "#666666"
683
- }
684
- },
685
- axisLine: {
686
- lineStyle: {
687
- color: "#DCDFE6"
688
- }
689
- },
690
- axisTick: {
691
- lineStyle: {
692
- color: "#DCDFE6"
693
- }
694
- },
695
- splitLine: {
696
- lineStyle: {
697
- color: "#ebeef5"
698
- }
699
- },
700
- splitArea: {
701
- areaStyle: {
702
- color: ["#f7f8fa", "#ffffff"]
703
- }
704
- },
705
- legend: {
706
- textStyle: {
707
- color: "#666"
708
- }
709
- },
710
- tooltip: {
711
- backgroundColor: "rgba(255, 255, 255, 0.95)",
712
- borderColor: "#DCDFE6",
713
- borderWidth: 1,
714
- textStyle: {
715
- color: "#333"
716
- }
717
- }
718
- });
719
-
720
- // CONCATENATED MODULE: ./src/components/ex-chart/theme/orange.js
721
- /* harmony default export */ var orange = ({
722
- color: ["#e69419", "#A5b4da", "#F8792C", "#97bfb4", "#de747b", "#d6bac0", "#e62737", "#f35969", "#f1ccb0", "#b7394e", "#fe9c1c2"],
723
- backgroundColor: "#ffffff",
724
- textStyle: {
725
- fontFamily: "Microsoft YaHei, sans-serif"
726
- },
727
- title: {
728
- textStyle: {
729
- color: "#333"
730
- },
731
- subtextStyle: {
732
- color: "#666666"
733
- }
734
- },
735
- line: {
736
- itemStyle: {
737
- color: "#e69419"
738
- },
739
- lineStyle: {
740
- width: 2
741
- }
742
- },
743
- bar: {
744
- itemStyle: {
745
- borderRadius: 4
746
- }
747
- },
748
- pie: {
749
- roseType: "radius",
750
- label: {
751
- color: "#333"
752
- }
753
- },
754
- radar: {
755
- indicator: {
756
- color: "#666666"
757
- }
758
- },
759
- map: {
760
- label: {
761
- color: "#333"
762
- },
763
- itemStyle: {
764
- borderColor: "#fff"
765
- }
766
- },
767
- gauge: {
768
- axisLine: {
769
- lineStyle: {
770
- color: [[1, "#5470c6"]]
771
- }
772
- }
773
- },
774
- toolbox: {
775
- iconStyle: {
776
- borderColor: "#666666"
777
- }
778
- },
779
- axisLine: {
780
- lineStyle: {
781
- color: "#DCDFE6"
782
- }
783
- },
784
- axisTick: {
785
- lineStyle: {
786
- color: "#DCDFE6"
787
- }
788
- },
789
- splitLine: {
790
- lineStyle: {
791
- color: "#ebeef5"
792
- }
793
- },
794
- splitArea: {
795
- areaStyle: {
796
- color: ["#f7f8fa", "#ffffff"]
797
- }
798
- },
799
- legend: {
800
- textStyle: {
801
- color: "#666"
802
- }
803
- },
804
- tooltip: {
805
- backgroundColor: "rgba(255, 255, 255, 0.95)",
806
- borderColor: "#DCDFE6",
807
- borderWidth: 1,
808
- textStyle: {
809
- color: "#333"
810
- }
811
- }
812
- });
813
-
814
- // CONCATENATED MODULE: ./src/components/ex-chart/utils.js
815
-
816
-
817
-
818
-
819
-
820
-
821
- const themeKeys = {
822
- "default": white,
823
- "white": white,
824
- "dark": dark,
825
- "blue": blue,
826
- "starry": starry,
827
- "orange": orange
828
- };
829
-
830
- // echarts 仅在客户端加载,避免 SSR 编译/渲染报错
831
- let echarts = null;
832
-
833
- function getEcharts() {
834
- if (!echarts && typeof window !== 'undefined') {
835
- try {
836
- echarts = __webpack_require__("313e");
837
- // 注册所有主题
838
- for (const key in themeKeys) {
839
- echarts.registerTheme(key, themeKeys[key]);
840
- }
841
- } catch (e) {
842
- console.warn('[ExChart] echarts 加载失败:', e.message);
843
- }
844
- }
845
- return echarts;
846
- }
847
-
848
- // 字体大小配置
849
- const fontSizeMap = {
850
- small: {
851
- title: 14,
852
- subtitle: 11,
853
- legend: 11,
854
- axisLabel: 10,
855
- tooltip: 11,
856
- label: 11
857
- },
858
- medium: {
859
- title: 16,
860
- subtitle: 12,
861
- legend: 12,
862
- axisLabel: 12,
863
- tooltip: 12,
864
- label: 12
865
- },
866
- large: {
867
- title: 18,
868
- subtitle: 14,
869
- legend: 14,
870
- axisLabel: 14,
871
- tooltip: 14,
872
- label: 14
873
- }
874
- };
875
-
876
- function EchartsUtil() {}
877
-
878
- EchartsUtil.currentTheme = "default";
879
- EchartsUtil.currentSize = "medium";
880
- EchartsUtil.inverse = false;
881
-
882
- EchartsUtil.baseOption = {
883
- backgroundColor: "transparent",
884
- tooltip: {
885
- trigger: "axis",
886
- borderWidth: 1
887
- },
888
- legend: {
889
- right: 20,
890
- top: 0,
891
- show: true,
892
- textStyle: {
893
- fontSize: 12
894
- }
895
- },
896
- grid: {
897
- top: "25%",
898
- left: "40",
899
- right: "15",
900
- bottom: "40"
901
- },
902
- xAxis: {
903
- type: "category",
904
- boundaryGap: false,
905
- axisTick: {
906
- show: true,
907
- length: 4
908
- },
909
- axisLabel: {
910
- fontSize: 12,
911
- interval: 0,
912
- formatter: function(value) {
913
- return !this.reverse && this.longLable ? value.replace(new RegExp(`(.{${this.longLableSplitNum}})`, "g"), `$1\n`) : value;
914
- }
915
- }
916
- },
917
- yAxis: {
918
- type: "value",
919
- axisTick: {
920
- show: false
921
- },
922
- min: null,
923
- max: null,
924
- axisLabel: {
925
- show: false
926
- },
927
- splitLine: {
928
- lineStyle: {
929
- type: "dashed",
930
- width: 1
931
- }
932
- }
933
- }
934
- };
935
-
936
- EchartsUtil.chartInstanceList = [];
937
-
938
- EchartsUtil.mergeOptions = function(themeOption, customOption) {
939
- return Object.assign({}, this.baseOption, themeOption, customOption);
940
- };
941
-
942
- // 根据字体大小调整主题配置
943
- EchartsUtil.applyFontSize = function(themeOption, size) {
944
- const fontSizeConfig = fontSizeMap[size] || fontSizeMap.medium;
945
-
946
- const result = JSON.parse(JSON.stringify(themeOption));
947
-
948
- // 调整标题字体大小
949
- if (result.title && result.title.textStyle) {
950
- result.title.textStyle.fontSize = fontSizeConfig.title;
951
- }
952
- if (result.title && result.title.subtextStyle) {
953
- result.title.subtextStyle.fontSize = fontSizeConfig.subtitle;
954
- }
955
-
956
- // 调整图例字体大小
957
- if (result.legend && result.legend.textStyle) {
958
- result.legend.textStyle.fontSize = fontSizeConfig.legend;
959
- }
960
-
961
- // 调整提示框字体大小
962
- if (result.tooltip && result.tooltip.textStyle) {
963
- result.tooltip.textStyle.fontSize = fontSizeConfig.tooltip;
964
- }
965
-
966
- // 调整饼图标签字体大小
967
- if (result.pie && result.pie.label) {
968
- if (typeof result.pie.label === 'object') {
969
- result.pie.label.fontSize = fontSizeConfig.label;
970
- }
971
- }
972
-
973
- // 调整雷达图指示器字体大小
974
- if (result.radar && result.radar.indicator) {
975
- if (typeof result.radar.indicator === 'object' && result.radar.indicator.textStyle) {
976
- result.radar.indicator.textStyle.fontSize = fontSizeConfig.label;
977
- }
978
- }
979
-
980
- // 调整地图标签字体大小
981
- if (result.map && result.map.label) {
982
- if (typeof result.map.label === 'object') {
983
- result.map.label.fontSize = fontSizeConfig.label;
984
- }
985
- }
986
-
987
- return result;
988
- };
989
-
990
- EchartsUtil.init = function(dom, theme, customOption, size) {
991
- const ec = getEcharts();
992
- // SSR 环境下忽略初始化
993
- if (!ec || !dom) return null;
994
-
995
- theme = theme || "default";
996
- size = size || "medium";
997
- customOption = customOption || {};
998
-
999
- const useTheme = this.currentTheme || theme;
1000
- const useSize = this.currentSize || size;
1001
-
1002
- this.currentTheme = useTheme;
1003
- this.currentSize = useSize;
1004
-
1005
- let themeOption = themeKeys[useTheme];
1006
- // 应用字体大小配置
1007
- themeOption = this.applyFontSize(themeOption, useSize);
1008
-
1009
- const option = this.mergeOptions(themeOption, customOption);
1010
-
1011
- const chart = ec.init(dom, useTheme);
1012
- chart.setOption(option, true);
1013
-
1014
- this.chartInstanceList.push({
1015
- dom,
1016
- chart,
1017
- customOption,
1018
- size: useSize
1019
- });
1020
-
1021
- this.bindResize(chart);
1022
- return chart;
1023
- };
1024
-
1025
- EchartsUtil.changeSingleTheme = function(dom, chartIns, customOption, newTheme) {
1026
- const ec = getEcharts();
1027
- if (!ec || !dom || !chartIns) return;
1028
-
1029
- customOption = customOption || {};
1030
- newTheme = newTheme || "default";
1031
-
1032
- this.currentTheme = newTheme;
1033
- chartIns.dispose();
1034
-
1035
- const newChart = ec.init(dom, newTheme, customOption);
1036
-
1037
- const item = this.chartInstanceList.find(function(v) {
1038
- return v.dom === dom;
1039
- });
1040
-
1041
- if (item) {
1042
- item.chart = newChart;
1043
- }
1044
-
1045
- return newChart;
1046
- };
1047
-
1048
- EchartsUtil.changeAllTheme = function(newTheme, newSize) {
1049
- const ec = getEcharts();
1050
- if (!ec || !newTheme) return;
1051
-
1052
- this.currentTheme = newTheme;
1053
- // 如果传入了新的 size,则更新全局 size
1054
- if (newSize) {
1055
- this.currentSize = newSize;
1056
- }
1057
-
1058
- this.chartInstanceList.forEach(function(item) {
1059
- const dom = item.dom;
1060
- const chart = item.chart;
1061
- const customOption = item.customOption;
1062
- // 使用图表自己的 size,如果没有则使用全局 size
1063
- const useSize = item.size || EchartsUtil.currentSize;
1064
-
1065
- if (chart) {
1066
- chart.dispose();
1067
- }
1068
-
1069
- const newChart = ec.init(dom, newTheme);
1070
- let themeOption = themeKeys[newTheme];
1071
- // 应用字体大小配置
1072
- themeOption = EchartsUtil.applyFontSize(themeOption, useSize);
1073
- const option = EchartsUtil.mergeOptions(themeOption, customOption);
1074
-
1075
- newChart.setOption(option, true);
1076
- item.chart = newChart;
1077
- // 更新图表的 size 记录
1078
- item.size = useSize;
1079
- EchartsUtil.bindResize(newChart);
1080
- });
1081
- };
1082
-
1083
- EchartsUtil.bindResize = function(chartIns) {
1084
- if (!chartIns || chartIns.resizeLocked) return;
1085
-
1086
- window.addEventListener("resize", function() {
1087
- chartIns.resize();
1088
- });
1089
-
1090
- chartIns._resizeLocked = true;
1091
- };
1092
-
1093
- EchartsUtil.destroy = function(chartIns) {
1094
- if (chartIns) {
1095
- chartIns.dispose();
1096
- }
1097
-
1098
- this.chartInstanceList = this.chartInstanceList.filter(function(item) {
1099
- return item.chart !== chartIns;
1100
- });
1101
- };
1102
-
1103
- EchartsUtil.destroyAll = function() {
1104
- this.chartInstanceList.forEach(function(item) {
1105
- if (item.chart) {
1106
- item.chart.dispose();
1107
- }
1108
- });
1109
-
1110
- this.chartInstanceList = [];
1111
- };
1112
-
1113
- /* harmony default export */ var utils = __webpack_exports__["a"] = (EchartsUtil);
1114
-
1115
-
1116
-
1117
-
1118
- /***/ }),
1119
-
1120
- /***/ "a68f":
1121
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1122
-
1123
- "use strict";
1124
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ExMulti_vue_vue_type_style_index_0_id_18661424_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("f7d1");
1125
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ExMulti_vue_vue_type_style_index_0_id_18661424_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_vue_cli_service_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ExMulti_vue_vue_type_style_index_0_id_18661424_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
1126
- /* unused harmony reexport * */
1127
-
1128
-
1129
- /***/ }),
1130
-
1131
- /***/ "f7d1":
1132
- /***/ (function(module, exports, __webpack_require__) {
1133
-
1134
- // extracted by mini-css-extract-plugin
1135
-
1136
- /***/ })
1137
-
1138
- }]);