smart-web-ui 1.0.0 → 1.0.1
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/dist/BuildingList.js +8 -0
- package/dist/CategoryPieChart.js +435 -0
- package/dist/ChartModel.js +46 -0
- package/dist/ChartTable.js +162 -0
- package/dist/CircularPieChart.js +314 -0
- package/dist/CloseButtonA.js +39 -0
- package/dist/ColumnDiagram.js +352 -0
- package/dist/DataColumnDiagram.js +275 -0
- package/dist/DatePicker.js +142 -0
- package/dist/DateTimePicker.js +146 -0
- package/dist/DateYearPicker.js +152 -0
- package/dist/DayTimerShaft.js +894 -0
- package/dist/DoubleColumnDiagram.js +360 -0
- package/dist/DoubleLineChart.js +410 -0
- package/dist/DoubleStraightLineChart.js +405 -0
- package/dist/EffectLoading.js +15 -0
- package/dist/GradientCircularPieChart.js +372 -0
- package/dist/GradientPieChart.js +501 -0
- package/dist/HikPlayer.js +10 -0
- package/dist/ImaginaryAndRealLineChart.js +405 -0
- package/dist/InfiniteScrollingTable.js +2150 -0
- package/dist/JessibucaPlayer.js +181 -0
- package/dist/LineChart.js +279 -0
- package/dist/MenuOne.js +75 -0
- package/dist/MultiDataColumnDiagram.js +398 -0
- package/dist/MultigraphChart.js +392 -0
- package/dist/MultitermBorderColumnDiagram.js +384 -0
- package/dist/MultitermColumnDiagram.js +359 -0
- package/dist/MyButton.js +8 -0
- package/dist/MyInput.js +42 -0
- package/dist/OnlinePieChart.js +365 -0
- package/dist/PantiltControl.js +147 -0
- package/dist/PictorialChart.js +205 -0
- package/dist/PieChart.js +252 -0
- package/dist/PieChartLegendCustom.js +251 -0
- package/dist/PieChartOne.js +438 -0
- package/dist/PopupFrame.js +131 -0
- package/dist/RangTimePicker.js +160 -0
- package/dist/RangePicker.js +156 -0
- package/dist/SingleLineChart.js +405 -0
- package/dist/SplitPie.js +242 -0
- package/dist/SplitPieChart.js +294 -0
- package/dist/StacketColumnDiagram.js +345 -0
- package/dist/TechnologyBlueFrameworkOne.js +183 -0
- package/dist/TimerShaft.js +229 -0
- package/dist/ToroidalPieChart.js +318 -0
- package/dist/WordCloudOne.js +138 -0
- package/dist/WordCloudTwo.js +157 -0
- package/dist/chunks/BuildingList-CU-EXKgo.js +126 -0
- package/dist/chunks/HikPlayer-DKfQRkh6.js +422 -0
- package/dist/chunks/MyButton-DvqgvXGG.js +36 -0
- package/dist/chunks/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/chunks/dayjs.min-CQFNnJKC.js +285 -0
- package/dist/chunks/debounce-DmrysiyS.js +84 -0
- package/dist/chunks/index-CBkwld9S.js +43886 -0
- package/dist/chunks/index-CYrEZgNC.js +334 -0
- package/dist/chunks/isObject-Bhos3v62.js +33 -0
- package/dist/chunks/merge-H4ZkNr1T.js +487 -0
- package/dist/chunks/wordCloud-uiqgdIRk.js +737 -0
- package/dist/chunks/zh_CN-BUEgxmeh.js +79 -0
- package/dist/css/BuildingList-Bdnl0gBJ.css +1 -0
- package/dist/css/CategoryPieChart-DBMhOWSp.css +1 -0
- package/dist/css/ChartModel-Dv4h1lb5.css +1 -0
- package/dist/css/ChartTable-Cr0oTeRE.css +1 -0
- package/dist/css/CircularPieChart-C3BGd8fm.css +1 -0
- package/dist/css/CloseButtonA-DY2NFd49.css +1 -0
- package/dist/css/ColumnDiagram-Dis9ikD8.css +1 -0
- package/dist/css/DataColumnDiagram-BT2JWzYV.css +1 -0
- package/dist/css/DatePicker-BcnVF2a0.css +1 -0
- package/dist/css/DateTimePicker-ogqIcJbR.css +1 -0
- package/dist/css/DateYearPicker-Cxi6LOU5.css +1 -0
- package/dist/css/DayTimerShaft-CgF_vvOC.css +1 -0
- package/dist/css/DoubleColumnDiagram-BxutsIuM.css +1 -0
- package/dist/css/DoubleLineChart-BDAn7Vm_.css +1 -0
- package/dist/css/DoubleStraightLineChart-DIRVxSDN.css +1 -0
- package/dist/css/EffectLoading-Ctm_V9PA.css +1 -0
- package/dist/css/GradientCircularPieChart-DwvudWRO.css +1 -0
- package/dist/css/GradientPieChart-BIbCGRqo.css +1 -0
- package/dist/css/HikPlayer-CZ3Esf6X.css +1 -0
- package/dist/css/ImaginaryAndRealLineChart-DM6nwp5j.css +1 -0
- package/dist/css/InfiniteScrollingTable-DI-gbfBL.css +1 -0
- package/dist/css/JessibucaPlayer-DYHP4jB_.css +1 -0
- package/dist/css/LineChart-BMK43A6-.css +1 -0
- package/dist/css/MenuOne-DZagmMAX.css +1 -0
- package/dist/css/MultiDataColumnDiagram-D1yx69tf.css +1 -0
- package/dist/css/MultigraphChart-C4dh2No_.css +1 -0
- package/dist/css/MultitermBorderColumnDiagram-DAn4G2De.css +1 -0
- package/dist/css/MultitermColumnDiagram-CF0BvPJO.css +1 -0
- package/dist/css/MyButton-CE8oLA-0.css +1 -0
- package/dist/css/MyInput-CauB72eE.css +1 -0
- package/dist/css/OnlinePieChart-DjGjF_9i.css +1 -0
- package/dist/css/PantiltControl-DS0BWsLg.css +1 -0
- package/dist/css/PictorialChart-D_NmyxMl.css +1 -0
- package/dist/css/PieChart-ijJKQrDc.css +1 -0
- package/dist/css/PieChartLegendCustom-BIQtqA8m.css +1 -0
- package/dist/css/PieChartOne-D1gY-q_Q.css +1 -0
- package/dist/css/PopupFrame-BuPG741n.css +1 -0
- package/dist/css/RangTimePicker-BhS_Fhaj.css +1 -0
- package/dist/css/RangePicker-Cmdpil97.css +1 -0
- package/dist/css/SingleLineChart-YXl29ldj.css +1 -0
- package/dist/css/SplitPie-vGvTEPG-.css +1 -0
- package/dist/css/SplitPieChart-yTrBBQxd.css +1 -0
- package/dist/css/StacketColumnDiagram-BvMIqlC_.css +1 -0
- package/dist/css/TechnologyBlueFrameworkOne-CMF1mCbl.css +1 -0
- package/dist/css/TimerShaft-LaGF129n.css +1 -0
- package/dist/css/ToroidalPieChart-CcfTDUUR.css +1 -0
- package/dist/css/WordCloudOne-CsMA5RxS.css +1 -0
- package/dist/css/WordCloudTwo-LSvh51aP.css +1 -0
- package/dist/css/index-jBItPHyv.css +1 -0
- package/dist/favicon.svg +1 -0
- package/dist/index.js +151 -0
- package/package.json +51 -50
- package/dist/assets/fonts/D-DIN.otf +0 -0
- package/dist/assets/fonts/PingFangSC.woff2 +0 -0
- package/dist/assets/fonts/SourceHanSansCN-Regular.woff +0 -0
- package/dist/assets/fonts/ysbth.woff +0 -0
- package/dist/smart-web-ui.css +0 -1
- package/dist/smart-web-ui.es.js +0 -67
- package/dist/smart-web-ui.umd.js +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { ref as k, computed as x, watch as _, onMounted as z, onBeforeUnmount as D, openBlock as f, createElementBlock as h, mergeProps as L, nextTick as O, createVNode as F, normalizeStyle as I, createElementVNode as n, Fragment as $, renderList as C, toDisplayString as y } from "vue";
|
|
2
|
+
import { i as N } from "./chunks/index-CBkwld9S.js";
|
|
3
|
+
import { _ as P } from "./chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import { m as B } from "./chunks/merge-H4ZkNr1T.js";
|
|
5
|
+
const E = {
|
|
6
|
+
__name: "SplitPie",
|
|
7
|
+
props: {
|
|
8
|
+
data: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
options: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
total: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 100
|
|
19
|
+
},
|
|
20
|
+
color: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => ["#438AF4", "#a1ffcb", "#f69d7b", "#b9e5ff", "#c392bb", "#65d1f8"]
|
|
23
|
+
},
|
|
24
|
+
loop: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(l) {
|
|
30
|
+
const a = l, p = k(null);
|
|
31
|
+
let e = null;
|
|
32
|
+
const c = x(() => ({
|
|
33
|
+
title: {
|
|
34
|
+
zlevel: 0,
|
|
35
|
+
subtext: 806,
|
|
36
|
+
text: "设备管理",
|
|
37
|
+
top: "30%",
|
|
38
|
+
left: "46.5%",
|
|
39
|
+
textAlign: "center",
|
|
40
|
+
textStyle: {
|
|
41
|
+
color: "#fff",
|
|
42
|
+
fontSize: 12
|
|
43
|
+
},
|
|
44
|
+
subtextStyle: {
|
|
45
|
+
fontSize: 24,
|
|
46
|
+
color: "#99F7FF"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
series: [
|
|
50
|
+
{
|
|
51
|
+
type: "pie",
|
|
52
|
+
name: "外层细圆环",
|
|
53
|
+
radius: ["99%", "98%"],
|
|
54
|
+
hoverAnimation: !1,
|
|
55
|
+
startAngle: 0,
|
|
56
|
+
clockWise: !1,
|
|
57
|
+
itemStyle: {
|
|
58
|
+
normal: {
|
|
59
|
+
color: "rgba(129, 197, 200, 0.5)"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
label: {
|
|
63
|
+
show: !1
|
|
64
|
+
},
|
|
65
|
+
data: [100]
|
|
66
|
+
},
|
|
67
|
+
//环形
|
|
68
|
+
{
|
|
69
|
+
name: "",
|
|
70
|
+
type: "pie",
|
|
71
|
+
clockwise: !1,
|
|
72
|
+
startAngle: 0,
|
|
73
|
+
radius: ["70%", "82%"],
|
|
74
|
+
center: ["50%", "50%"],
|
|
75
|
+
label: {
|
|
76
|
+
normal: {
|
|
77
|
+
show: !1
|
|
78
|
+
},
|
|
79
|
+
emphasis: {
|
|
80
|
+
show: !1
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
zlevel: 1,
|
|
84
|
+
labelLine: {
|
|
85
|
+
normal: {
|
|
86
|
+
show: !1
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
data: a.data.flatMap((o, t) => {
|
|
90
|
+
if (o.value > 0) {
|
|
91
|
+
const i = Math.round(o.value / a.total * 100), r = [];
|
|
92
|
+
for (let s = 0; s < i; s++)
|
|
93
|
+
r.push(
|
|
94
|
+
{
|
|
95
|
+
value: 2,
|
|
96
|
+
// 有颜色部分的宽度
|
|
97
|
+
name: s,
|
|
98
|
+
// ratio: item.ratio,
|
|
99
|
+
itemStyle: {
|
|
100
|
+
normal: { color: a.color[t] }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: 1,
|
|
105
|
+
// 无颜色部分的宽度
|
|
106
|
+
name: "",
|
|
107
|
+
itemStyle: {
|
|
108
|
+
normal: {
|
|
109
|
+
label: { show: !1 },
|
|
110
|
+
labelLine: { show: !1 },
|
|
111
|
+
color: "rgba(0, 0, 0, 0)",
|
|
112
|
+
borderColor: "rgba(0, 0, 0, 0)",
|
|
113
|
+
borderWidth: 0
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
return r;
|
|
119
|
+
}
|
|
120
|
+
return [];
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
// //环形分割线
|
|
124
|
+
// {
|
|
125
|
+
// name: "分割线",
|
|
126
|
+
// type: "gauge",
|
|
127
|
+
// radius: "60%",
|
|
128
|
+
// clockwise: true,
|
|
129
|
+
// startAngle: "90",
|
|
130
|
+
// center: ["50%", "50%"],
|
|
131
|
+
// startAngle: 0,
|
|
132
|
+
// endAngle: "-360",
|
|
133
|
+
// splitNumber: 100,
|
|
134
|
+
// zlevel: 2,
|
|
135
|
+
// detail: {
|
|
136
|
+
// offsetCenter: [10, 20],
|
|
137
|
+
// formatter: " ",
|
|
138
|
+
// },
|
|
139
|
+
// axisLine: {
|
|
140
|
+
// lineStyle: {
|
|
141
|
+
// width: 0,
|
|
142
|
+
// opacity: 0,
|
|
143
|
+
// },
|
|
144
|
+
// },
|
|
145
|
+
// axisTick: {
|
|
146
|
+
// show: false,
|
|
147
|
+
// },
|
|
148
|
+
// markArea: {
|
|
149
|
+
// itemStyle: {
|
|
150
|
+
// color: "#0f0",
|
|
151
|
+
// },
|
|
152
|
+
// },
|
|
153
|
+
// splitLine: {
|
|
154
|
+
// show: true,
|
|
155
|
+
// length: 9,
|
|
156
|
+
// padding: [0, 0, 0],
|
|
157
|
+
// lineStyle: {
|
|
158
|
+
// color: "#00000030",
|
|
159
|
+
// width: 3,
|
|
160
|
+
// },
|
|
161
|
+
// },
|
|
162
|
+
// axisLabel: {
|
|
163
|
+
// show: false,
|
|
164
|
+
// },
|
|
165
|
+
// },
|
|
166
|
+
]
|
|
167
|
+
}));
|
|
168
|
+
function u(o, t) {
|
|
169
|
+
if (!t)
|
|
170
|
+
return;
|
|
171
|
+
let i = -1, r = setInterval(S, 1e3);
|
|
172
|
+
function s() {
|
|
173
|
+
for (let b = 0; b < o.series[1].data.length; b++)
|
|
174
|
+
t.dispatchAction({
|
|
175
|
+
type: "downplay",
|
|
176
|
+
seriesIndex: 1,
|
|
177
|
+
dataIndex: b
|
|
178
|
+
});
|
|
179
|
+
t.dispatchAction({
|
|
180
|
+
type: "highlight",
|
|
181
|
+
seriesIndex: 1,
|
|
182
|
+
dataIndex: i
|
|
183
|
+
}), t.dispatchAction({
|
|
184
|
+
type: "showTip",
|
|
185
|
+
seriesIndex: 1,
|
|
186
|
+
dataIndex: i
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
t.on("mouseover", (d) => {
|
|
190
|
+
d.componentType !== "graphic" && (clearInterval(r), i = d.dataIndex, s());
|
|
191
|
+
}), t.on("mouseout", (d) => {
|
|
192
|
+
r && clearInterval(r), r = setInterval(S, 100);
|
|
193
|
+
}), t.on("dispose", () => {
|
|
194
|
+
clearInterval(r);
|
|
195
|
+
});
|
|
196
|
+
function S() {
|
|
197
|
+
const d = o.series[1].data.length;
|
|
198
|
+
i = (i + 1) % d, s();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const m = x(
|
|
202
|
+
() => B({}, c.value, a.options)
|
|
203
|
+
), A = () => {
|
|
204
|
+
p.value && (e = N(
|
|
205
|
+
p.value,
|
|
206
|
+
{},
|
|
207
|
+
{
|
|
208
|
+
renderer: "svg"
|
|
209
|
+
}
|
|
210
|
+
), v(), a.loop && u(m.value, e), e.dispatchAction({
|
|
211
|
+
type: "takeGlobalCursor",
|
|
212
|
+
key: "dataZoomSelect",
|
|
213
|
+
dataZoomSelectActive: !0
|
|
214
|
+
}));
|
|
215
|
+
}, v = () => {
|
|
216
|
+
e && (e.setOption(m.value, !0), O(() => e.resize()));
|
|
217
|
+
}, g = () => {
|
|
218
|
+
e == null || e.resize({ animation: { duration: 300 } });
|
|
219
|
+
};
|
|
220
|
+
return _(
|
|
221
|
+
() => a.data,
|
|
222
|
+
(o, t) => {
|
|
223
|
+
JSON.stringify(o) !== JSON.stringify(t) && v();
|
|
224
|
+
},
|
|
225
|
+
{ deep: !0 }
|
|
226
|
+
), _(m, v), z(() => {
|
|
227
|
+
A(), window.addEventListener("resize", g);
|
|
228
|
+
}), D(() => {
|
|
229
|
+
window.removeEventListener("resize", g), e == null || e.dispose(), e = null;
|
|
230
|
+
}), (o, t) => (f(), h("div", L({
|
|
231
|
+
ref_key: "chartContainer",
|
|
232
|
+
ref: p
|
|
233
|
+
}, o.$attrs, { class: "echarts-container" }), null, 16));
|
|
234
|
+
}
|
|
235
|
+
}, M = /* @__PURE__ */ P(E, [["__scopeId", "data-v-364c099f"]]), T = { class: "SplitPieChart" }, j = { class: "splitPieData" }, q = { class: "splitPieData-item-left" }, J = { class: "splitPieData-item-right" }, V = {
|
|
236
|
+
__name: "SplitPieChart",
|
|
237
|
+
props: {
|
|
238
|
+
data: {
|
|
239
|
+
type: Array,
|
|
240
|
+
required: !0
|
|
241
|
+
},
|
|
242
|
+
options: {
|
|
243
|
+
type: Object,
|
|
244
|
+
default: () => ({})
|
|
245
|
+
},
|
|
246
|
+
width: {
|
|
247
|
+
type: String,
|
|
248
|
+
default: "180px"
|
|
249
|
+
},
|
|
250
|
+
height: {
|
|
251
|
+
type: String,
|
|
252
|
+
default: "160px"
|
|
253
|
+
},
|
|
254
|
+
color: {
|
|
255
|
+
type: Array,
|
|
256
|
+
default: () => ["#438AF4", "#a1ffcb", "#f69d7b", "#b9e5ff", "#c392bb", "#65d1f8"]
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
setup(l) {
|
|
260
|
+
const a = l;
|
|
261
|
+
return (p, e) => (f(), h("div", T, [
|
|
262
|
+
F(M, {
|
|
263
|
+
data: l.data,
|
|
264
|
+
options: l.options,
|
|
265
|
+
color: a.color,
|
|
266
|
+
style: I({ width: `${a.width}`, height: `${a.height}` })
|
|
267
|
+
}, null, 8, ["data", "options", "color", "style"]),
|
|
268
|
+
n("div", j, [
|
|
269
|
+
(f(!0), h($, null, C(l.data, (c, u) => (f(), h("div", {
|
|
270
|
+
key: `splitPieData_${u}`,
|
|
271
|
+
class: "splitPieData-item"
|
|
272
|
+
}, [
|
|
273
|
+
n("div", q, [
|
|
274
|
+
n("div", {
|
|
275
|
+
class: "splitPieData-item-left-color",
|
|
276
|
+
style: I({ background: `${a.color[u]}` })
|
|
277
|
+
}, null, 4),
|
|
278
|
+
n("span", null, y(c.name), 1)
|
|
279
|
+
]),
|
|
280
|
+
n("div", J, [
|
|
281
|
+
n("b", null, y(c.value), 1),
|
|
282
|
+
n("b", null, y(c.ratio) + "%", 1)
|
|
283
|
+
])
|
|
284
|
+
]))), 128))
|
|
285
|
+
])
|
|
286
|
+
]));
|
|
287
|
+
}
|
|
288
|
+
}, w = /* @__PURE__ */ P(V, [["__scopeId", "data-v-bb785ea4"]]);
|
|
289
|
+
w.install = (l) => {
|
|
290
|
+
l.component("SplitPieChart", w);
|
|
291
|
+
};
|
|
292
|
+
export {
|
|
293
|
+
w as default
|
|
294
|
+
};
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { ref as C, computed as m, watch as c, onMounted as b, onBeforeUnmount as L, openBlock as v, createElementBlock as F, mergeProps as w, nextTick as k } from "vue";
|
|
2
|
+
import { L as z, i as T } from "./chunks/index-CBkwld9S.js";
|
|
3
|
+
import { _ } from "./chunks/_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import { m as O } from "./chunks/merge-H4ZkNr1T.js";
|
|
5
|
+
const D = {
|
|
6
|
+
__name: "StacketColumnDiagram",
|
|
7
|
+
props: {
|
|
8
|
+
data: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
options: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default: () => ({})
|
|
15
|
+
},
|
|
16
|
+
colorData: {
|
|
17
|
+
type: Array,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
zoomKey: {
|
|
21
|
+
type: String,
|
|
22
|
+
// 'none' | 'ctrl' | 'alt' | 'shift'
|
|
23
|
+
default: "ctrl"
|
|
24
|
+
// 默认按住 Ctrl 键缩放
|
|
25
|
+
},
|
|
26
|
+
// 纵轴网格线格式
|
|
27
|
+
xLineType: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "dashed"
|
|
30
|
+
// solid 实线 dashed 虚线 dotted 细点画线
|
|
31
|
+
},
|
|
32
|
+
// 网格线颜色
|
|
33
|
+
lineColor: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "#526B8E"
|
|
36
|
+
},
|
|
37
|
+
// x 轴文字颜色
|
|
38
|
+
xNameColor: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "#fff"
|
|
41
|
+
},
|
|
42
|
+
// x 轴文字长度
|
|
43
|
+
xTextLength: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 4
|
|
46
|
+
},
|
|
47
|
+
// 柱子需要对应到标签上,设置为 false
|
|
48
|
+
boundaryGap: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !0
|
|
51
|
+
},
|
|
52
|
+
// 单位名称
|
|
53
|
+
unitName: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "单位(次)"
|
|
56
|
+
},
|
|
57
|
+
// Y 轴单位文字颜色
|
|
58
|
+
yNameColor: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "#fff"
|
|
61
|
+
},
|
|
62
|
+
// 横轴网格线是否显示
|
|
63
|
+
yLineShow: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !0
|
|
66
|
+
},
|
|
67
|
+
// 横轴网格线格式
|
|
68
|
+
yLineType: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "dashed"
|
|
71
|
+
// solid 实线 dashed 虚线 dotted 细点画线
|
|
72
|
+
},
|
|
73
|
+
// Y 轴名称颜色
|
|
74
|
+
yColor: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "#fff"
|
|
77
|
+
},
|
|
78
|
+
// 柱子宽度
|
|
79
|
+
barWidth: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: 12
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
setup(i) {
|
|
85
|
+
const e = i, l = C(null);
|
|
86
|
+
let o = null;
|
|
87
|
+
const f = () => {
|
|
88
|
+
const t = "0123456789ABCDEF";
|
|
89
|
+
let r = "#";
|
|
90
|
+
for (let a = 0; a < 6; a++)
|
|
91
|
+
r += t[Math.floor(Math.random() * 16)];
|
|
92
|
+
return r;
|
|
93
|
+
}, h = (t) => {
|
|
94
|
+
const r = {};
|
|
95
|
+
return t.forEach((a) => {
|
|
96
|
+
a.children.forEach((n) => {
|
|
97
|
+
r[n.label] || (r[n.label] = []), r[n.label].push(n.value);
|
|
98
|
+
});
|
|
99
|
+
}), Object.keys(r).map((a, n) => {
|
|
100
|
+
var d, y;
|
|
101
|
+
return {
|
|
102
|
+
name: a,
|
|
103
|
+
type: "bar",
|
|
104
|
+
stack: "total",
|
|
105
|
+
label: {
|
|
106
|
+
show: !1,
|
|
107
|
+
color: "#FFFFFF",
|
|
108
|
+
formatter: "{a}"
|
|
109
|
+
},
|
|
110
|
+
barWidth: e.barWidth,
|
|
111
|
+
itemStyle: {
|
|
112
|
+
// 柱子的颜色使用线性渐变
|
|
113
|
+
color: new z(0, 0, 0, 1, [
|
|
114
|
+
{
|
|
115
|
+
offset: 0,
|
|
116
|
+
color: ((d = e.colorData[n]) == null ? void 0 : d.dark) || f()
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
offset: 1,
|
|
120
|
+
color: ((y = e.colorData[n]) == null ? void 0 : y.light) || f()
|
|
121
|
+
}
|
|
122
|
+
])
|
|
123
|
+
},
|
|
124
|
+
emphasis: {
|
|
125
|
+
focus: "series"
|
|
126
|
+
},
|
|
127
|
+
data: r[a]
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
}, S = m(() => ({
|
|
131
|
+
// 网格配置,设置图表上下左右的边距
|
|
132
|
+
grid: {
|
|
133
|
+
top: 30,
|
|
134
|
+
bottom: 30,
|
|
135
|
+
left: 40,
|
|
136
|
+
right: 20
|
|
137
|
+
},
|
|
138
|
+
// 提示框配置,当鼠标悬停在图表上时显示的信息
|
|
139
|
+
tooltip: {
|
|
140
|
+
trigger: "axis",
|
|
141
|
+
// 触发类型为坐标轴
|
|
142
|
+
backgroundColor: "rgba(1, 13, 19, 0.5)",
|
|
143
|
+
// 提示框背景颜色
|
|
144
|
+
borderColor: "#ffffff40",
|
|
145
|
+
// 提示框边框颜色
|
|
146
|
+
axisPointer: {
|
|
147
|
+
type: "shadow"
|
|
148
|
+
// 坐标轴指示器类型为阴影
|
|
149
|
+
},
|
|
150
|
+
textStyle: {
|
|
151
|
+
color: "#ffffff",
|
|
152
|
+
// 提示框文字颜色
|
|
153
|
+
fontSize: 12,
|
|
154
|
+
// 提示框文字大小
|
|
155
|
+
fontFamily: "PingFang SC"
|
|
156
|
+
// 提示框文字字体
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
// 图例配置,显示图表中不同系列的名称和颜色
|
|
160
|
+
legend: {
|
|
161
|
+
show: !0,
|
|
162
|
+
// 显示图例
|
|
163
|
+
right: "5%",
|
|
164
|
+
// 图例相对于右侧的位置
|
|
165
|
+
icon: "circle",
|
|
166
|
+
textStyle: {
|
|
167
|
+
color: "#ffffff",
|
|
168
|
+
// 图例文字颜色
|
|
169
|
+
fontSize: 12,
|
|
170
|
+
// 图例文字大小
|
|
171
|
+
fontFamily: "PingFang SC"
|
|
172
|
+
// 图例文字字体
|
|
173
|
+
},
|
|
174
|
+
itemWidth: 12,
|
|
175
|
+
// 图例项的宽度
|
|
176
|
+
itemHeight: 12
|
|
177
|
+
// 图例项的高度
|
|
178
|
+
},
|
|
179
|
+
// x 轴配置
|
|
180
|
+
xAxis: [
|
|
181
|
+
{
|
|
182
|
+
type: "category",
|
|
183
|
+
// x 轴类型为分类轴
|
|
184
|
+
// 从 props.data 中提取 name 作为 x 轴的数据,处理数据为空或 name 为空的情况
|
|
185
|
+
data: (e.data || []).map((t) => (t == null ? void 0 : t.name) || ""),
|
|
186
|
+
// 设置纵轴网格线样式
|
|
187
|
+
splitLine: {
|
|
188
|
+
show: !0,
|
|
189
|
+
// 显示网格线
|
|
190
|
+
lineStyle: {
|
|
191
|
+
type: e.xLineType,
|
|
192
|
+
// 网格线类型,如虚线
|
|
193
|
+
color: e.lineColor
|
|
194
|
+
// 网格线颜色
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
// 设置 x 轴的位置和样式
|
|
198
|
+
axisLine: {
|
|
199
|
+
lineStyle: {
|
|
200
|
+
type: e.xLineType,
|
|
201
|
+
// 轴线类型,如虚线
|
|
202
|
+
color: e.lineColor
|
|
203
|
+
// 轴线颜色
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
axisTick: {
|
|
207
|
+
show: !1
|
|
208
|
+
// 隐藏 X 轴刻度线
|
|
209
|
+
},
|
|
210
|
+
// 隐藏右侧的标签(如果需要)
|
|
211
|
+
axisLabel: {
|
|
212
|
+
show: !0,
|
|
213
|
+
// 显示 x 轴标签
|
|
214
|
+
interval: 0,
|
|
215
|
+
// 强制显示所有标签
|
|
216
|
+
formatter: function(t) {
|
|
217
|
+
return t.length > e.xTextLength ? t.slice(0, e.xTextLength) + "..." : t;
|
|
218
|
+
},
|
|
219
|
+
textStyle: {
|
|
220
|
+
fontSize: 12,
|
|
221
|
+
// x 轴标签文字大小
|
|
222
|
+
color: e.xNameColor,
|
|
223
|
+
// x 轴标签文字颜色
|
|
224
|
+
fontFamily: "PingFang SC"
|
|
225
|
+
// x 轴标签文字字体
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
// 可以通过调整 boundaryGap 来调整柱子与坐标轴标签的对齐
|
|
229
|
+
boundaryGap: e.boundaryGap
|
|
230
|
+
// 如果柱子需要对应到标签上,设置为 false
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
// y 轴配置
|
|
234
|
+
yAxis: [
|
|
235
|
+
{
|
|
236
|
+
type: "value",
|
|
237
|
+
// y 轴类型为数值轴
|
|
238
|
+
name: e.unitName,
|
|
239
|
+
// y 轴的名称
|
|
240
|
+
nameTextStyle: {
|
|
241
|
+
color: e.yNameColor,
|
|
242
|
+
// y 轴名称文字颜色
|
|
243
|
+
fontSize: 12,
|
|
244
|
+
// y 轴名称文字大小
|
|
245
|
+
fontFamily: "PingFang SC"
|
|
246
|
+
// y 轴名称文字字体
|
|
247
|
+
},
|
|
248
|
+
axisLabel: {
|
|
249
|
+
formatter: "{value}"
|
|
250
|
+
// y 轴标签的格式化方式
|
|
251
|
+
},
|
|
252
|
+
// 设置纵轴网格线样式
|
|
253
|
+
splitLine: {
|
|
254
|
+
show: e.yLineShow,
|
|
255
|
+
// 是否显示网格线
|
|
256
|
+
lineStyle: {
|
|
257
|
+
type: e.yLineType,
|
|
258
|
+
// 网格线类型,如虚线
|
|
259
|
+
color: e.lineColor
|
|
260
|
+
// 网格线颜色
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
axisLabel: {
|
|
264
|
+
textStyle: {
|
|
265
|
+
fontSize: 12,
|
|
266
|
+
// y 轴标签文字大小
|
|
267
|
+
color: e.yColor,
|
|
268
|
+
// y 轴标签文字颜色
|
|
269
|
+
fontFamily: "PingFang SC"
|
|
270
|
+
// y 轴标签文字字体
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
],
|
|
275
|
+
// 数据系列配置
|
|
276
|
+
series: h(e.data),
|
|
277
|
+
// 数据缩放配置
|
|
278
|
+
dataZoom: [
|
|
279
|
+
{
|
|
280
|
+
type: "inside",
|
|
281
|
+
// 内置型数据缩放组件
|
|
282
|
+
xAxisIndex: 0,
|
|
283
|
+
// 控制第一个 x 轴
|
|
284
|
+
// 根据 zoomKey 的值设置是否需要按键触发缩放
|
|
285
|
+
zoomOnMouseWheel: e.zoomKey === "none" ? !0 : e.zoomKey,
|
|
286
|
+
moveOnMouseMove: !0,
|
|
287
|
+
// 允许鼠标拖动平移
|
|
288
|
+
moveOnMouseWheel: !0,
|
|
289
|
+
// 允许鼠标滚轮平移
|
|
290
|
+
preventDefaultMouseMove: !1,
|
|
291
|
+
// 允许默认滚动行为
|
|
292
|
+
throttle: 50,
|
|
293
|
+
// 操作节流时间
|
|
294
|
+
start: 0,
|
|
295
|
+
end: (() => {
|
|
296
|
+
const t = e.data ? e.data.length : 0;
|
|
297
|
+
return t > 30 ? t / 1.7 : t > 23 ? t / 1.5 : t > 13 ? 50 : t > 7 ? 70 : 100;
|
|
298
|
+
})()
|
|
299
|
+
// maxSpan: 80, // 最大缩放范围
|
|
300
|
+
// minSpan: 20, // 最小缩放范围
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
animation: !0
|
|
304
|
+
// 启用动画
|
|
305
|
+
})), u = m(
|
|
306
|
+
() => O({}, S.value, e.options)
|
|
307
|
+
), x = () => {
|
|
308
|
+
l.value && (o = T(
|
|
309
|
+
l.value,
|
|
310
|
+
{},
|
|
311
|
+
{
|
|
312
|
+
renderer: "svg"
|
|
313
|
+
}
|
|
314
|
+
), s(), o.dispatchAction({
|
|
315
|
+
type: "takeGlobalCursor",
|
|
316
|
+
key: "dataZoomSelect",
|
|
317
|
+
dataZoomSelectActive: !0
|
|
318
|
+
}));
|
|
319
|
+
}, s = () => {
|
|
320
|
+
o && (o.setOption(u.value, !0), k(() => o.resize()));
|
|
321
|
+
}, p = () => {
|
|
322
|
+
o == null || o.resize({ animation: { duration: 300 } });
|
|
323
|
+
};
|
|
324
|
+
return c(
|
|
325
|
+
() => e.data,
|
|
326
|
+
(t, r) => {
|
|
327
|
+
JSON.stringify(t) !== JSON.stringify(r) && s();
|
|
328
|
+
},
|
|
329
|
+
{ deep: !0 }
|
|
330
|
+
), c(u, s), b(() => {
|
|
331
|
+
x(), window.addEventListener("resize", p);
|
|
332
|
+
}), L(() => {
|
|
333
|
+
window.removeEventListener("resize", p), o == null || o.dispose(), o = null;
|
|
334
|
+
}), (t, r) => (v(), F("div", w({
|
|
335
|
+
ref_key: "chartContainer",
|
|
336
|
+
ref: l
|
|
337
|
+
}, t.$attrs, { class: "echarts-container" }), null, 16));
|
|
338
|
+
}
|
|
339
|
+
}, g = /* @__PURE__ */ _(D, [["__scopeId", "data-v-08f560f1"]]);
|
|
340
|
+
g.install = (i) => {
|
|
341
|
+
i.component("StacketColumnDiagram", g);
|
|
342
|
+
};
|
|
343
|
+
export {
|
|
344
|
+
g as default
|
|
345
|
+
};
|