xt-element-ui 1.1.2 → 1.1.4
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/lib/css/2.9f53fb10.css +1 -0
- package/lib/css/3.f955b130.css +1 -0
- package/lib/css/4.04feac2c.css +1 -0
- package/lib/css/5.6a8558e0.css +1 -0
- package/lib/css/6.e474b334.css +1 -0
- package/lib/index.common.0.js +16448 -15696
- package/lib/index.common.2.js +298 -270
- package/lib/index.common.3.js +82 -54
- package/lib/index.common.4.js +519 -489
- package/lib/index.common.5.js +74 -46
- package/lib/index.common.6.js +76 -48
- package/lib/index.common.js +826 -308
- package/lib/index.css +1 -1
- package/lib/index.umd.0.js +16448 -15696
- package/lib/index.umd.2.js +298 -270
- package/lib/index.umd.3.js +82 -54
- package/lib/index.umd.4.js +519 -489
- package/lib/index.umd.5.js +74 -46
- package/lib/index.umd.6.js +76 -48
- package/lib/index.umd.js +832 -313
- package/lib/index.umd.min.0.js +3 -3
- package/lib/index.umd.min.2.js +1 -1
- package/lib/index.umd.min.3.js +1 -1
- package/lib/index.umd.min.4.js +1 -1
- package/lib/index.umd.min.5.js +1 -1
- package/lib/index.umd.min.6.js +1 -1
- package/lib/index.umd.min.js +1 -1
- package/package.json +2 -1
- package/src/components/ex-button/index.js +2 -0
- package/src/components/ex-button/index.vue +61 -0
- package/src/components/ex-button/style/index.scss +31 -0
- package/src/components/ex-card/index.js +7 -0
- package/src/components/ex-card/index.vue +150 -0
- package/src/components/ex-card/style/index.scss +69 -0
- package/src/components/{chart → ex-chart}/ExBar.vue +3 -0
- package/src/components/{chart → ex-chart}/ExLine.vue +3 -0
- package/src/components/{chart → ex-chart}/ExMulti.vue +5 -0
- package/src/components/{chart → ex-chart}/ExPie.vue +3 -0
- package/src/components/{chart → ex-chart}/ExTrend.vue +3 -0
- package/src/components/ex-chart/index.js +2 -0
- package/src/components/ex-chart/index.vue +134 -0
- package/src/components/{chart → ex-chart}/theme/dark.js +1 -1
- package/src/components/{chart → ex-chart}/utils.js +40 -12
- package/src/components/index.scss +13 -7
- package/src/components/{button → xt-button}/index.vue +1 -1
- package/src/components/{card-item → xt-card-item}/index.vue +1 -1
- package/src/components/{config-provider → xt-config-provider}/index.vue +66 -0
- package/src/components/{date-picker → xt-date-picker}/index.vue +1 -1
- package/src/components/{date-picker → xt-date-picker}/quarter.vue +4 -2
- package/src/components/{table → xt-table}/index.vue +48 -107
- package/src/config/element-registry.js +136 -0
- package/src/index.js +56 -32
- package/src/styles/theme/colors.scss +1 -0
- package/lib/css/2.3f7aa432.css +0 -1
- package/lib/css/3.ffcc175d.css +0 -1
- package/lib/css/4.9abd1f2b.css +0 -1
- package/lib/css/5.1a31ed8a.css +0 -1
- package/lib/css/6.c2d0d77e.css +0 -1
- package/src/components/chart/index.js +0 -2
- package/src/components/chart/index.vue +0 -51
- /package/src/components/{chart → ex-chart}/pieList.vue +0 -0
- /package/src/components/{chart → ex-chart}/theme/blue.js +0 -0
- /package/src/components/{chart → ex-chart}/theme/orange.js +0 -0
- /package/src/components/{chart → ex-chart}/theme/starry.js +0 -0
- /package/src/components/{chart → ex-chart}/theme/white.js +0 -0
- /package/src/components/{button → xt-button}/index.js +0 -0
- /package/src/components/{button → xt-button}/style/index.scss +0 -0
- /package/src/components/{card → xt-card}/index.js +0 -0
- /package/src/components/{card → xt-card}/index.vue +0 -0
- /package/src/components/{card → xt-card}/style/index.scss +0 -0
- /package/src/components/{card-item → xt-card-item}/index.js +0 -0
- /package/src/components/{card-item → xt-card-item}/style/index.scss +0 -0
- /package/src/components/{config-provider → xt-config-provider}/index.js +0 -0
- /package/src/components/{config-provider → xt-config-provider}/style/index.scss +0 -0
- /package/src/components/{date-picker → xt-date-picker}/SearchDate.vue +0 -0
- /package/src/components/{date-picker → xt-date-picker}/index.js +0 -0
- /package/src/components/{flex-box → xt-flex-box}/index.js +0 -0
- /package/src/components/{flex-box → xt-flex-box}/index.vue +0 -0
- /package/src/components/{flex-box → xt-flex-box}/style/index.scss +0 -0
- /package/src/components/{grid-box → xt-grid-box}/index.js +0 -0
- /package/src/components/{grid-box → xt-grid-box}/index.vue +0 -0
- /package/src/components/{input → xt-input}/index.js +0 -0
- /package/src/components/{input → xt-input}/index.vue +0 -0
- /package/src/components/{input → xt-input}/style/index.scss +0 -0
- /package/src/components/{layout → xt-layout}/BaseCollapse.vue +0 -0
- /package/src/components/{layout → xt-layout}/ExFieldset.vue +0 -0
- /package/src/components/{page → xt-page}/index.js +0 -0
- /package/src/components/{page → xt-page}/index.vue +0 -0
- /package/src/components/{select-tree → xt-select-tree}/index.js +0 -0
- /package/src/components/{select-tree → xt-select-tree}/index.vue +0 -0
- /package/src/components/{table → xt-table}/ExCell.vue +0 -0
- /package/src/components/{table → xt-table}/ExColumn.vue +0 -0
- /package/src/components/{table → xt-table}/index.js +0 -0
- /package/src/components/{table → xt-table}/processor.js +0 -0
- /package/src/components/{text → xt-text}/index.js +0 -0
- /package/src/components/{text → xt-text}/index.vue +0 -0
- /package/src/components/{text → xt-text}/style/index.scss +0 -0
- /package/src/components/{upload → xt-upload}/index.js +0 -0
- /package/src/components/{upload → xt-upload}/index.vue +0 -0
- /package/src/components/{upload → xt-upload}/preview.vue +0 -0
package/lib/index.umd.2.js
CHANGED
|
@@ -1,23 +1,267 @@
|
|
|
1
1
|
((typeof self !== 'undefined' ? self : this)["webpackJsonpxt_element_ui"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpxt_element_ui"] || []).push([[2],{
|
|
2
2
|
|
|
3
|
-
/***/ "
|
|
3
|
+
/***/ "04dd":
|
|
4
4
|
/***/ (function(module, exports, __webpack_require__) {
|
|
5
5
|
|
|
6
6
|
// extracted by mini-css-extract-plugin
|
|
7
7
|
|
|
8
8
|
/***/ }),
|
|
9
9
|
|
|
10
|
-
/***/ "
|
|
10
|
+
/***/ "1b46":
|
|
11
11
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
12
12
|
|
|
13
13
|
"use strict";
|
|
14
|
+
// ESM COMPAT FLAG
|
|
15
|
+
__webpack_require__.r(__webpack_exports__);
|
|
16
|
+
|
|
17
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4207ee36-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/ExBar.vue?vue&type=template&id=10acd2fc&scoped=true
|
|
18
|
+
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:"barchart",staticClass:"bar-box"})
|
|
19
|
+
}
|
|
20
|
+
var staticRenderFns = []
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/ExBar.vue?vue&type=template&id=10acd2fc&scoped=true
|
|
24
|
+
|
|
25
|
+
// EXTERNAL MODULE: ./src/components/ex-chart/utils.js + 5 modules
|
|
26
|
+
var utils = __webpack_require__("22f5");
|
|
27
|
+
|
|
28
|
+
// 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/ExBar.vue?vue&type=script&lang=js
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/* harmony default export */ var ExBarvue_type_script_lang_js = ({
|
|
32
|
+
name: "XtBar",
|
|
33
|
+
props: {
|
|
34
|
+
chartData: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => {
|
|
37
|
+
return [
|
|
38
|
+
{ value: 65, name: "吴十" },
|
|
39
|
+
{ value: 70, name: "唐九" },
|
|
40
|
+
{ value: 73, name: "钱一" },
|
|
41
|
+
{ value: 78, name: "孙二" },
|
|
42
|
+
{ value: 88, name: "刘八" },
|
|
43
|
+
{ value: 93, name: "王七" },
|
|
44
|
+
{ value: 99, name: "赵六" },
|
|
45
|
+
{ value: 103, name: "宋五" },
|
|
46
|
+
{ value: 113, name: "李四" },
|
|
47
|
+
{ value: 125, name: "张三" }
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
theme: {},
|
|
52
|
+
size: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "medium"
|
|
55
|
+
},
|
|
56
|
+
// name: {
|
|
57
|
+
// type: String,
|
|
58
|
+
// default: ""
|
|
59
|
+
// },
|
|
60
|
+
markPoint: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
energyType: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ""
|
|
67
|
+
},
|
|
68
|
+
showZoom: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
reverse: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false
|
|
75
|
+
},
|
|
76
|
+
longLable: { // 名称占50% 的 grid值
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
longLableSplitNum: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 1
|
|
83
|
+
},
|
|
84
|
+
longLablePx: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: 150
|
|
87
|
+
},
|
|
88
|
+
splitNumber: {
|
|
89
|
+
type: Number,
|
|
90
|
+
default: 5
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
data() {
|
|
94
|
+
return {
|
|
95
|
+
myChart: null,
|
|
96
|
+
name: "数量"
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
watch: {
|
|
100
|
+
chartData: {
|
|
101
|
+
deep: true,
|
|
102
|
+
handler(newVal, oldVal) {
|
|
103
|
+
const _self = this;
|
|
104
|
+
_self.initChart();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
energyType: {
|
|
108
|
+
deep: true,
|
|
109
|
+
handler(newVal, oldVal) {
|
|
110
|
+
const _self = this;
|
|
111
|
+
if (newVal == "kW.h") {
|
|
112
|
+
_self.name = "用电量";
|
|
113
|
+
} else if (newVal == "m³") {
|
|
114
|
+
_self.name = "用气量";
|
|
115
|
+
}
|
|
116
|
+
_self.initChart();
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
theme(newVal) {
|
|
120
|
+
this.initChart();
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
mounted() {
|
|
124
|
+
this.initChart();
|
|
125
|
+
},
|
|
126
|
+
methods: {
|
|
127
|
+
initChart() {
|
|
128
|
+
const _self = this;
|
|
129
|
+
// 数据处理
|
|
130
|
+
const _xAxis = {
|
|
131
|
+
type: "category",
|
|
132
|
+
inverse: this.reverse,
|
|
133
|
+
axisLabel: {
|
|
134
|
+
interval: 0,
|
|
135
|
+
formatter: function(value) {
|
|
136
|
+
return !_self.reverse && _self.longLable ? value.replace(new RegExp(`(.{${_self.longLableSplitNum}})`, 'g'), `$1\n`) : value;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
data: _self.chartData.map((item) => {
|
|
140
|
+
return item.name;
|
|
141
|
+
})
|
|
142
|
+
};
|
|
143
|
+
const _yAxis = {
|
|
144
|
+
type: "value",
|
|
145
|
+
splitLine: {
|
|
146
|
+
lineStyle: {
|
|
147
|
+
type: "dashed"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
name: _self.energyType,
|
|
151
|
+
axisTick: {
|
|
152
|
+
inside: true
|
|
153
|
+
},
|
|
154
|
+
min: 0,
|
|
155
|
+
splitNumber: _self.splitNumber,
|
|
156
|
+
max: function(value) {
|
|
157
|
+
return Math.ceil(value.max / _self.splitNumber) * _self.splitNumber;
|
|
158
|
+
},
|
|
159
|
+
scale: true,
|
|
160
|
+
axisLabel: {
|
|
161
|
+
margin: 2,
|
|
162
|
+
formatter: function(value, index) {
|
|
163
|
+
if (value >= 10000 && value < 10000000) {
|
|
164
|
+
value = value / 10000 + "万";
|
|
165
|
+
} else if (value >= 10000000) {
|
|
166
|
+
value = value / 10000000 + "千万";
|
|
167
|
+
}
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const option = {
|
|
174
|
+
legend: {
|
|
175
|
+
right: 20,
|
|
176
|
+
top: 0,
|
|
177
|
+
textStyle: {
|
|
178
|
+
fontSize: 12
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
tooltip: {
|
|
182
|
+
borderWidth: 1,
|
|
183
|
+
trigger: "item"
|
|
184
|
+
},
|
|
185
|
+
grid: {
|
|
186
|
+
top: "10",
|
|
187
|
+
left: 40 + (this.reverse && this.longLable ? _self.longLablePx : 0),
|
|
188
|
+
right: "10",
|
|
189
|
+
bottom: (_self.showZoom ? 50 : 20) + (!_self.reverse && _self.longLable ? _self.longLablePx : 0),
|
|
190
|
+
containLabel: true
|
|
191
|
+
},
|
|
192
|
+
xAxis: this.reverse ? _yAxis : _xAxis,
|
|
193
|
+
yAxis: this.reverse ? _xAxis : _yAxis,
|
|
194
|
+
series: [{
|
|
195
|
+
name: _self.name,
|
|
196
|
+
type: "bar",
|
|
197
|
+
markPoint: {
|
|
198
|
+
data: [
|
|
199
|
+
{ type: "min", name: "Min" },
|
|
200
|
+
{ type: "max", name: "Max" }
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
avoidLabelOverlap: true,
|
|
204
|
+
data: _self.chartData.map((item, ind) => {
|
|
205
|
+
const { name, value } = item;
|
|
206
|
+
return {
|
|
207
|
+
value,
|
|
208
|
+
name,
|
|
209
|
+
tooltip: {
|
|
210
|
+
borderWidth: 1
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
})
|
|
214
|
+
}],
|
|
215
|
+
dataZoom: _self.showZoom ? [{ height: 20, bottom: 0 }] : [],
|
|
216
|
+
};
|
|
217
|
+
if (!this.markPoint) {
|
|
218
|
+
this.$delete(option.series[0], "markPoint");
|
|
219
|
+
}
|
|
220
|
+
this.myChart = utils["a" /* default */].init(_self.$refs.barchart, this.theme, option, this.size);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/ExBar.vue?vue&type=script&lang=js
|
|
226
|
+
/* harmony default export */ var ex_chart_ExBarvue_type_script_lang_js = (ExBarvue_type_script_lang_js);
|
|
227
|
+
// EXTERNAL MODULE: ./src/components/ex-chart/ExBar.vue?vue&type=style&index=0&id=10acd2fc&prod&lang=scss&scoped=true
|
|
228
|
+
var ExBarvue_type_style_index_0_id_10acd2fc_prod_lang_scss_scoped_true = __webpack_require__("9ea1");
|
|
229
|
+
|
|
230
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
231
|
+
var componentNormalizer = __webpack_require__("2877");
|
|
14
232
|
|
|
15
|
-
//
|
|
233
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/ExBar.vue
|
|
16
234
|
|
|
17
|
-
// EXTERNAL MODULE: ./node_modules/echarts/index.js + 575 modules
|
|
18
|
-
var echarts = __webpack_require__("313e");
|
|
19
235
|
|
|
20
|
-
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
/* normalize component */
|
|
241
|
+
|
|
242
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
243
|
+
ex_chart_ExBarvue_type_script_lang_js,
|
|
244
|
+
render,
|
|
245
|
+
staticRenderFns,
|
|
246
|
+
false,
|
|
247
|
+
null,
|
|
248
|
+
"10acd2fc",
|
|
249
|
+
null
|
|
250
|
+
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
/* harmony default export */ var ExBar = __webpack_exports__["default"] = (component.exports);
|
|
254
|
+
|
|
255
|
+
/***/ }),
|
|
256
|
+
|
|
257
|
+
/***/ "22f5":
|
|
258
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
259
|
+
|
|
260
|
+
"use strict";
|
|
261
|
+
|
|
262
|
+
// UNUSED EXPORTS: getEcharts
|
|
263
|
+
|
|
264
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/theme/white.js
|
|
21
265
|
/* harmony default export */ var white = ({
|
|
22
266
|
color: ["#1890ff", "#37c3a4", "#29c0ce", "#6480D7", "#8cce6f", "#3a5dca", "#ffb74d"],
|
|
23
267
|
backgroundColor: "#ffffff",
|
|
@@ -129,10 +373,10 @@ var echarts = __webpack_require__("313e");
|
|
|
129
373
|
}
|
|
130
374
|
});
|
|
131
375
|
|
|
132
|
-
// CONCATENATED MODULE: ./src/components/chart/theme/dark.js
|
|
376
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/theme/dark.js
|
|
133
377
|
/* harmony default export */ var dark = ({
|
|
134
378
|
color: ["#0de7ff", "#a782ff", "#fcdd60", "#0de7ff", "#ffc5a1", "#6291ae", "#13ce66"],
|
|
135
|
-
backgroundColor: "
|
|
379
|
+
backgroundColor: "transparent",
|
|
136
380
|
textStyle: {
|
|
137
381
|
fontFamily: "Microsoft YaHei, sans-serif"
|
|
138
382
|
},
|
|
@@ -222,7 +466,7 @@ var echarts = __webpack_require__("313e");
|
|
|
222
466
|
}
|
|
223
467
|
});
|
|
224
468
|
|
|
225
|
-
// CONCATENATED MODULE: ./src/components/chart/theme/blue.js
|
|
469
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/theme/blue.js
|
|
226
470
|
/* harmony default export */ var blue = ({
|
|
227
471
|
color: ["#2CDEB3", "#A17EE6", "#E57E40", "#409EFF"],
|
|
228
472
|
backgroundColor: "#ffffff",
|
|
@@ -315,7 +559,7 @@ var echarts = __webpack_require__("313e");
|
|
|
315
559
|
}
|
|
316
560
|
});
|
|
317
561
|
|
|
318
|
-
// CONCATENATED MODULE: ./src/components/chart/theme/starry.js
|
|
562
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/theme/starry.js
|
|
319
563
|
/* harmony default export */ var starry = ({
|
|
320
564
|
color: [
|
|
321
565
|
"#1685a9", // 石青
|
|
@@ -423,7 +667,7 @@ var echarts = __webpack_require__("313e");
|
|
|
423
667
|
}
|
|
424
668
|
});
|
|
425
669
|
|
|
426
|
-
// CONCATENATED MODULE: ./src/components/chart/theme/orange.js
|
|
670
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/theme/orange.js
|
|
427
671
|
/* harmony default export */ var orange = ({
|
|
428
672
|
color: ["#e69419", "#A5b4da", "#F8792C", "#97bfb4", "#de747b", "#d6bac0", "#e62737", "#f35969", "#f1ccb0", "#b7394e", "#fe9c1c2"],
|
|
429
673
|
backgroundColor: "#ffffff",
|
|
@@ -517,9 +761,7 @@ var echarts = __webpack_require__("313e");
|
|
|
517
761
|
}
|
|
518
762
|
});
|
|
519
763
|
|
|
520
|
-
// CONCATENATED MODULE: ./src/components/chart/utils.js
|
|
521
|
-
|
|
522
|
-
|
|
764
|
+
// CONCATENATED MODULE: ./src/components/ex-chart/utils.js
|
|
523
765
|
|
|
524
766
|
|
|
525
767
|
|
|
@@ -535,8 +777,22 @@ const themeKeys = {
|
|
|
535
777
|
"orange": orange
|
|
536
778
|
};
|
|
537
779
|
|
|
538
|
-
|
|
539
|
-
|
|
780
|
+
// echarts 仅在客户端加载,避免 SSR 编译/渲染报错
|
|
781
|
+
let echarts = null;
|
|
782
|
+
|
|
783
|
+
function getEcharts() {
|
|
784
|
+
if (!echarts && typeof window !== 'undefined') {
|
|
785
|
+
try {
|
|
786
|
+
echarts = __webpack_require__("313e");
|
|
787
|
+
// 注册所有主题
|
|
788
|
+
for (const key in themeKeys) {
|
|
789
|
+
echarts.registerTheme(key, themeKeys[key]);
|
|
790
|
+
}
|
|
791
|
+
} catch (e) {
|
|
792
|
+
console.warn('[ExChart] echarts 加载失败:', e.message);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
return echarts;
|
|
540
796
|
}
|
|
541
797
|
|
|
542
798
|
// 字体大小配置
|
|
@@ -682,6 +938,10 @@ EchartsUtil.applyFontSize = function(themeOption, size) {
|
|
|
682
938
|
};
|
|
683
939
|
|
|
684
940
|
EchartsUtil.init = function(dom, theme, customOption, size) {
|
|
941
|
+
const ec = getEcharts();
|
|
942
|
+
// SSR 环境下忽略初始化
|
|
943
|
+
if (!ec || !dom) return null;
|
|
944
|
+
|
|
685
945
|
theme = theme || "default";
|
|
686
946
|
size = size || "medium";
|
|
687
947
|
customOption = customOption || {};
|
|
@@ -698,7 +958,7 @@ EchartsUtil.init = function(dom, theme, customOption, size) {
|
|
|
698
958
|
|
|
699
959
|
const option = this.mergeOptions(themeOption, customOption);
|
|
700
960
|
|
|
701
|
-
const chart =
|
|
961
|
+
const chart = ec.init(dom, useTheme);
|
|
702
962
|
chart.setOption(option, true);
|
|
703
963
|
|
|
704
964
|
this.chartInstanceList.push({
|
|
@@ -713,7 +973,8 @@ EchartsUtil.init = function(dom, theme, customOption, size) {
|
|
|
713
973
|
};
|
|
714
974
|
|
|
715
975
|
EchartsUtil.changeSingleTheme = function(dom, chartIns, customOption, newTheme) {
|
|
716
|
-
|
|
976
|
+
const ec = getEcharts();
|
|
977
|
+
if (!ec || !dom || !chartIns) return;
|
|
717
978
|
|
|
718
979
|
customOption = customOption || {};
|
|
719
980
|
newTheme = newTheme || "default";
|
|
@@ -721,7 +982,7 @@ EchartsUtil.changeSingleTheme = function(dom, chartIns, customOption, newTheme)
|
|
|
721
982
|
this.currentTheme = newTheme;
|
|
722
983
|
chartIns.dispose();
|
|
723
984
|
|
|
724
|
-
const newChart =
|
|
985
|
+
const newChart = ec.init(dom, newTheme, customOption);
|
|
725
986
|
|
|
726
987
|
const item = this.chartInstanceList.find(function(v) {
|
|
727
988
|
return v.dom === dom;
|
|
@@ -734,26 +995,37 @@ EchartsUtil.changeSingleTheme = function(dom, chartIns, customOption, newTheme)
|
|
|
734
995
|
return newChart;
|
|
735
996
|
};
|
|
736
997
|
|
|
737
|
-
EchartsUtil.changeAllTheme = function(newTheme) {
|
|
738
|
-
|
|
998
|
+
EchartsUtil.changeAllTheme = function(newTheme, newSize) {
|
|
999
|
+
const ec = getEcharts();
|
|
1000
|
+
if (!ec || !newTheme) return;
|
|
739
1001
|
|
|
740
1002
|
this.currentTheme = newTheme;
|
|
1003
|
+
// 如果传入了新的 size,则更新全局 size
|
|
1004
|
+
if (newSize) {
|
|
1005
|
+
this.currentSize = newSize;
|
|
1006
|
+
}
|
|
741
1007
|
|
|
742
1008
|
this.chartInstanceList.forEach(function(item) {
|
|
743
1009
|
const dom = item.dom;
|
|
744
1010
|
const chart = item.chart;
|
|
745
1011
|
const customOption = item.customOption;
|
|
1012
|
+
// 使用图表自己的 size,如果没有则使用全局 size
|
|
1013
|
+
const useSize = item.size || EchartsUtil.currentSize;
|
|
746
1014
|
|
|
747
1015
|
if (chart) {
|
|
748
1016
|
chart.dispose();
|
|
749
1017
|
}
|
|
750
1018
|
|
|
751
|
-
const newChart =
|
|
752
|
-
|
|
1019
|
+
const newChart = ec.init(dom, newTheme);
|
|
1020
|
+
let themeOption = themeKeys[newTheme];
|
|
1021
|
+
// 应用字体大小配置
|
|
1022
|
+
themeOption = EchartsUtil.applyFontSize(themeOption, useSize);
|
|
753
1023
|
const option = EchartsUtil.mergeOptions(themeOption, customOption);
|
|
754
1024
|
|
|
755
1025
|
newChart.setOption(option, true);
|
|
756
1026
|
item.chart = newChart;
|
|
1027
|
+
// 更新图表的 size 记录
|
|
1028
|
+
item.size = useSize;
|
|
757
1029
|
EchartsUtil.bindResize(newChart);
|
|
758
1030
|
});
|
|
759
1031
|
};
|
|
@@ -795,259 +1067,15 @@ EchartsUtil.destroyAll = function() {
|
|
|
795
1067
|
|
|
796
1068
|
/***/ }),
|
|
797
1069
|
|
|
798
|
-
/***/ "
|
|
1070
|
+
/***/ "9ea1":
|
|
799
1071
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
800
1072
|
|
|
801
1073
|
"use strict";
|
|
802
|
-
/* harmony import */ var
|
|
803
|
-
/* harmony import */ var
|
|
1074
|
+
/* 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_ExBar_vue_vue_type_style_index_0_id_10acd2fc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("04dd");
|
|
1075
|
+
/* 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_ExBar_vue_vue_type_style_index_0_id_10acd2fc_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_ExBar_vue_vue_type_style_index_0_id_10acd2fc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
804
1076
|
/* unused harmony reexport * */
|
|
805
1077
|
|
|
806
1078
|
|
|
807
|
-
/***/ }),
|
|
808
|
-
|
|
809
|
-
/***/ "5234":
|
|
810
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
811
|
-
|
|
812
|
-
"use strict";
|
|
813
|
-
// ESM COMPAT FLAG
|
|
814
|
-
__webpack_require__.r(__webpack_exports__);
|
|
815
|
-
|
|
816
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"f5ad930a-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/chart/ExBar.vue?vue&type=template&id=730aa873&scoped=true
|
|
817
|
-
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:"barchart",staticClass:"bar-box"})
|
|
818
|
-
}
|
|
819
|
-
var staticRenderFns = []
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
// CONCATENATED MODULE: ./src/components/chart/ExBar.vue?vue&type=template&id=730aa873&scoped=true
|
|
823
|
-
|
|
824
|
-
// EXTERNAL MODULE: ./src/components/chart/utils.js + 5 modules
|
|
825
|
-
var utils = __webpack_require__("202d");
|
|
826
|
-
|
|
827
|
-
// 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/chart/ExBar.vue?vue&type=script&lang=js
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
/* harmony default export */ var ExBarvue_type_script_lang_js = ({
|
|
831
|
-
name: "XtBar",
|
|
832
|
-
props: {
|
|
833
|
-
chartData: {
|
|
834
|
-
type: Array,
|
|
835
|
-
default: () => {
|
|
836
|
-
return [
|
|
837
|
-
{ value: 65, name: "吴十" },
|
|
838
|
-
{ value: 70, name: "唐九" },
|
|
839
|
-
{ value: 73, name: "钱一" },
|
|
840
|
-
{ value: 78, name: "孙二" },
|
|
841
|
-
{ value: 88, name: "刘八" },
|
|
842
|
-
{ value: 93, name: "王七" },
|
|
843
|
-
{ value: 99, name: "赵六" },
|
|
844
|
-
{ value: 103, name: "宋五" },
|
|
845
|
-
{ value: 113, name: "李四" },
|
|
846
|
-
{ value: 125, name: "张三" }
|
|
847
|
-
];
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
theme: {},
|
|
851
|
-
size: {
|
|
852
|
-
type: String,
|
|
853
|
-
default: "medium"
|
|
854
|
-
},
|
|
855
|
-
// name: {
|
|
856
|
-
// type: String,
|
|
857
|
-
// default: ""
|
|
858
|
-
// },
|
|
859
|
-
markPoint: {
|
|
860
|
-
type: Boolean,
|
|
861
|
-
default: false
|
|
862
|
-
},
|
|
863
|
-
energyType: {
|
|
864
|
-
type: String,
|
|
865
|
-
default: ""
|
|
866
|
-
},
|
|
867
|
-
showZoom: {
|
|
868
|
-
type: Boolean,
|
|
869
|
-
default: false
|
|
870
|
-
},
|
|
871
|
-
reverse: {
|
|
872
|
-
type: Boolean,
|
|
873
|
-
default: false
|
|
874
|
-
},
|
|
875
|
-
longLable: { // 名称占50% 的 grid值
|
|
876
|
-
type: Boolean,
|
|
877
|
-
default: false
|
|
878
|
-
},
|
|
879
|
-
longLableSplitNum: {
|
|
880
|
-
type: Number,
|
|
881
|
-
default: 1
|
|
882
|
-
},
|
|
883
|
-
longLablePx: {
|
|
884
|
-
type: Number,
|
|
885
|
-
default: 150
|
|
886
|
-
},
|
|
887
|
-
splitNumber: {
|
|
888
|
-
type: Number,
|
|
889
|
-
default: 5
|
|
890
|
-
}
|
|
891
|
-
},
|
|
892
|
-
data() {
|
|
893
|
-
return {
|
|
894
|
-
myChart: null,
|
|
895
|
-
name: "数量"
|
|
896
|
-
};
|
|
897
|
-
},
|
|
898
|
-
watch: {
|
|
899
|
-
chartData: {
|
|
900
|
-
deep: true,
|
|
901
|
-
handler(newVal, oldVal) {
|
|
902
|
-
const _self = this;
|
|
903
|
-
_self.initChart();
|
|
904
|
-
}
|
|
905
|
-
},
|
|
906
|
-
energyType: {
|
|
907
|
-
deep: true,
|
|
908
|
-
handler(newVal, oldVal) {
|
|
909
|
-
const _self = this;
|
|
910
|
-
if (newVal == "kW.h") {
|
|
911
|
-
_self.name = "用电量";
|
|
912
|
-
} else if (newVal == "m³") {
|
|
913
|
-
_self.name = "用气量";
|
|
914
|
-
}
|
|
915
|
-
_self.initChart();
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
},
|
|
919
|
-
mounted() {
|
|
920
|
-
this.initChart();
|
|
921
|
-
},
|
|
922
|
-
methods: {
|
|
923
|
-
initChart() {
|
|
924
|
-
const _self = this;
|
|
925
|
-
// 数据处理
|
|
926
|
-
const _xAxis = {
|
|
927
|
-
type: "category",
|
|
928
|
-
inverse: this.reverse,
|
|
929
|
-
axisLabel: {
|
|
930
|
-
interval: 0,
|
|
931
|
-
formatter: function(value) {
|
|
932
|
-
return !_self.reverse && _self.longLable ? value.replace(new RegExp(`(.{${_self.longLableSplitNum}})`, 'g'), `$1\n`) : value;
|
|
933
|
-
}
|
|
934
|
-
},
|
|
935
|
-
data: _self.chartData.map((item) => {
|
|
936
|
-
return item.name;
|
|
937
|
-
})
|
|
938
|
-
};
|
|
939
|
-
const _yAxis = {
|
|
940
|
-
type: "value",
|
|
941
|
-
splitLine: {
|
|
942
|
-
lineStyle: {
|
|
943
|
-
type: "dashed"
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
name: _self.energyType,
|
|
947
|
-
axisTick: {
|
|
948
|
-
inside: true
|
|
949
|
-
},
|
|
950
|
-
min: 0,
|
|
951
|
-
splitNumber: _self.splitNumber,
|
|
952
|
-
max: function(value) {
|
|
953
|
-
return Math.ceil(value.max / _self.splitNumber) * _self.splitNumber;
|
|
954
|
-
},
|
|
955
|
-
scale: true,
|
|
956
|
-
axisLabel: {
|
|
957
|
-
margin: 2,
|
|
958
|
-
formatter: function(value, index) {
|
|
959
|
-
if (value >= 10000 && value < 10000000) {
|
|
960
|
-
value = value / 10000 + "万";
|
|
961
|
-
} else if (value >= 10000000) {
|
|
962
|
-
value = value / 10000000 + "千万";
|
|
963
|
-
}
|
|
964
|
-
return value;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
|
|
969
|
-
const option = {
|
|
970
|
-
legend: {
|
|
971
|
-
right: 20,
|
|
972
|
-
top: 0,
|
|
973
|
-
textStyle: {
|
|
974
|
-
fontSize: 12
|
|
975
|
-
}
|
|
976
|
-
},
|
|
977
|
-
tooltip: {
|
|
978
|
-
borderWidth: 1,
|
|
979
|
-
trigger: "item"
|
|
980
|
-
},
|
|
981
|
-
grid: {
|
|
982
|
-
top: "10",
|
|
983
|
-
left: 40 + (this.reverse && this.longLable ? _self.longLablePx : 0),
|
|
984
|
-
right: "10",
|
|
985
|
-
bottom: (_self.showZoom ? 50 : 20) + (!_self.reverse && _self.longLable ? _self.longLablePx : 0),
|
|
986
|
-
containLabel: true
|
|
987
|
-
},
|
|
988
|
-
xAxis: this.reverse ? _yAxis : _xAxis,
|
|
989
|
-
yAxis: this.reverse ? _xAxis : _yAxis,
|
|
990
|
-
series: [{
|
|
991
|
-
name: _self.name,
|
|
992
|
-
type: "bar",
|
|
993
|
-
markPoint: {
|
|
994
|
-
data: [
|
|
995
|
-
{ type: "min", name: "Min" },
|
|
996
|
-
{ type: "max", name: "Max" }
|
|
997
|
-
]
|
|
998
|
-
},
|
|
999
|
-
avoidLabelOverlap: true,
|
|
1000
|
-
data: _self.chartData.map((item, ind) => {
|
|
1001
|
-
const { name, value } = item;
|
|
1002
|
-
return {
|
|
1003
|
-
value,
|
|
1004
|
-
name,
|
|
1005
|
-
tooltip: {
|
|
1006
|
-
borderWidth: 1
|
|
1007
|
-
}
|
|
1008
|
-
};
|
|
1009
|
-
})
|
|
1010
|
-
}],
|
|
1011
|
-
dataZoom: _self.showZoom ? [{ height: 20, bottom: 0 }] : [],
|
|
1012
|
-
};
|
|
1013
|
-
if (!this.markPoint) {
|
|
1014
|
-
this.$delete(option.series[0], "markPoint");
|
|
1015
|
-
}
|
|
1016
|
-
this.myChart = utils["a" /* default */].init(_self.$refs.barchart, this.theme, option, this.size);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
|
|
1021
|
-
// CONCATENATED MODULE: ./src/components/chart/ExBar.vue?vue&type=script&lang=js
|
|
1022
|
-
/* harmony default export */ var chart_ExBarvue_type_script_lang_js = (ExBarvue_type_script_lang_js);
|
|
1023
|
-
// EXTERNAL MODULE: ./src/components/chart/ExBar.vue?vue&type=style&index=0&id=730aa873&prod&lang=scss&scoped=true
|
|
1024
|
-
var ExBarvue_type_style_index_0_id_730aa873_prod_lang_scss_scoped_true = __webpack_require__("51a0");
|
|
1025
|
-
|
|
1026
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
1027
|
-
var componentNormalizer = __webpack_require__("2877");
|
|
1028
|
-
|
|
1029
|
-
// CONCATENATED MODULE: ./src/components/chart/ExBar.vue
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
/* normalize component */
|
|
1037
|
-
|
|
1038
|
-
var component = Object(componentNormalizer["a" /* default */])(
|
|
1039
|
-
chart_ExBarvue_type_script_lang_js,
|
|
1040
|
-
render,
|
|
1041
|
-
staticRenderFns,
|
|
1042
|
-
false,
|
|
1043
|
-
null,
|
|
1044
|
-
"730aa873",
|
|
1045
|
-
null
|
|
1046
|
-
|
|
1047
|
-
)
|
|
1048
|
-
|
|
1049
|
-
/* harmony default export */ var ExBar = __webpack_exports__["default"] = (component.exports);
|
|
1050
|
-
|
|
1051
1079
|
/***/ })
|
|
1052
1080
|
|
|
1053
1081
|
}]);
|