hamster-charts 0.4.3 → 0.4.5
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/hamster-charts.css +1 -1
- package/dist/hamster-charts.js +315 -245
- package/dist/hamster-charts.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/hamster-charts.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.h-panel[data-v-474190fc]{width:100%;height:100%;background-size:100% 100%;background-repeat:no-repeat}.h-header[data-v-b83cf769]{background-size:100% 100%;background-repeat:no-repeat;position:relative}.h-main[data-v-1025786b]{width:100%}.h-chart[data-v-ad5727b9]{background-size:100% 100%;background-repeat:no-repeat}.h-chart .chart[data-v-ad5727b9]{width:100%}.h-left[data-v-65e91535],.h-right[data-v-e897c957]{height:100%}.h-top[data-v-54014ba4],.h-bottom[data-v-086bec2a]{width:100%}.h-chart-title[data-v-36cebf9b]{width:100%;background-size:100% 100%;background-repeat:no-repeat}.h-item-chart[data-v-7c5da244]{background-size:100% 100%;background-repeat:no-repeat}[data-v-937cc59c]::-webkit-scrollbar{width:0px}[data-v-937cc59c]::-webkit-scrollbar-track{background:#31313181}[data-v-937cc59c]::-webkit-scrollbar-thumb{background:#444;border-radius:10px}[data-v-937cc59c]::-webkit-scrollbar-thumb:hover{background:#555}.h-list[data-v-937cc59c]{position:relative;overflow:hidden}.list-header[data-v-937cc59c]{display:flex;align-items:center;width:100%}.header-item[data-v-937cc59c]{flex:1;display:flex;justify-content:center;align-items:center;font-weight:700}.scroll-wrapper[data-v-937cc59c]{position:relative;width:100%;will-change:transform}.data-list[data-v-937cc59c]{width:100%}.data-list-item[data-v-937cc59c]{display:flex;transition:all .3s ease;border-bottom:1px solid rgba(255,255,255,.1)}.data-list-item[data-v-937cc59c]:hover{background:#ffffff0d}.data-item-cell[data-v-937cc59c]{flex:1;display:flex;justify-content:center;align-items:center;padding:8px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.h-data-label[data-v-f0ce86db]{background-repeat:no-repeat;background-size:100% 100%}.h-button[data-v-0a183c56]{outline:none;background-repeat:no-repeat;background-size:100% 100%;border-radius:2px;border:none}.h-grid[data-v-34e7422b]{border:1px solid red}.h-grid .h-grid-item[data-v-34e7422b]{border:1px solid rebeccapurple}.h-counter[data-v-
|
|
1
|
+
.h-panel[data-v-474190fc]{width:100%;height:100%;background-size:100% 100%;background-repeat:no-repeat}.h-header[data-v-b83cf769]{background-size:100% 100%;background-repeat:no-repeat;position:relative}.h-main[data-v-1025786b]{width:100%}.h-chart[data-v-ad5727b9]{background-size:100% 100%;background-repeat:no-repeat}.h-chart .chart[data-v-ad5727b9]{width:100%}.h-left[data-v-65e91535],.h-right[data-v-e897c957]{height:100%}.h-top[data-v-54014ba4],.h-bottom[data-v-086bec2a]{width:100%}.h-chart-title[data-v-36cebf9b]{width:100%;background-size:100% 100%;background-repeat:no-repeat}.h-item-chart[data-v-7c5da244]{background-size:100% 100%;background-repeat:no-repeat}[data-v-937cc59c]::-webkit-scrollbar{width:0px}[data-v-937cc59c]::-webkit-scrollbar-track{background:#31313181}[data-v-937cc59c]::-webkit-scrollbar-thumb{background:#444;border-radius:10px}[data-v-937cc59c]::-webkit-scrollbar-thumb:hover{background:#555}.h-list[data-v-937cc59c]{position:relative;overflow:hidden}.list-header[data-v-937cc59c]{display:flex;align-items:center;width:100%}.header-item[data-v-937cc59c]{flex:1;display:flex;justify-content:center;align-items:center;font-weight:700}.scroll-wrapper[data-v-937cc59c]{position:relative;width:100%;will-change:transform}.data-list[data-v-937cc59c]{width:100%}.data-list-item[data-v-937cc59c]{display:flex;transition:all .3s ease;border-bottom:1px solid rgba(255,255,255,.1)}.data-list-item[data-v-937cc59c]:hover{background:#ffffff0d}.data-item-cell[data-v-937cc59c]{flex:1;display:flex;justify-content:center;align-items:center;padding:8px 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.h-view[data-v-490e5736]{background-size:100% 100%;background-repeat:no-repeat}.h-data-label[data-v-f0ce86db]{background-repeat:no-repeat;background-size:100% 100%}.h-button[data-v-0a183c56]{outline:none;background-repeat:no-repeat;background-size:100% 100%;border-radius:2px;border:none}.h-grid[data-v-34e7422b]{border:1px solid red}.h-grid .h-grid-item[data-v-34e7422b]{border:1px solid rebeccapurple}.h-counter[data-v-fba32a26]{display:flex;align-items:center}.counter-digit[data-v-fba32a26]{position:relative;overflow:hidden}.digit-scroll[data-v-fba32a26]{display:flex;flex-direction:column;will-change:transform}.digit-item[data-v-fba32a26]{flex-shrink:0}.h-layout[data-v-957ea318]{height:100%}.h-flex[data-v-c8c463ea]{background-size:100% 100%;background-repeat:no-repeat}
|
package/dist/hamster-charts.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { computed as y, openBlock as
|
|
2
|
-
import * as
|
|
3
|
-
import { useDebounceFn as
|
|
1
|
+
import { computed as y, openBlock as o, createElementBlock as u, normalizeStyle as c, unref as h, renderSlot as b, toDisplayString as C, createCommentVNode as j, ref as v, onMounted as it, onBeforeUnmount as at, watch as G, withDirectives as ut, createElementVNode as z, vShow as dt, Fragment as O, renderList as D } from "vue";
|
|
2
|
+
import * as rt from "echarts";
|
|
3
|
+
import { useDebounceFn as lt, useResizeObserver as st } from "@vueuse/core";
|
|
4
4
|
const m = (e, t) => {
|
|
5
5
|
const i = e.__vccOpts || e;
|
|
6
6
|
for (const [r, l] of t)
|
|
7
7
|
i[r] = l;
|
|
8
8
|
return i;
|
|
9
|
-
},
|
|
9
|
+
}, pt = {
|
|
10
10
|
name: "hPanel",
|
|
11
11
|
chineseName: "面板",
|
|
12
12
|
description: "页面主体容器"
|
|
13
|
-
},
|
|
13
|
+
}, ct = /* @__PURE__ */ Object.assign(pt, {
|
|
14
14
|
props: {
|
|
15
15
|
url: {
|
|
16
16
|
type: String,
|
|
@@ -27,22 +27,22 @@ const m = (e, t) => {
|
|
|
27
27
|
position: t.position,
|
|
28
28
|
backgroundImage: t.url ? `url(${t.url})` : "none"
|
|
29
29
|
}));
|
|
30
|
-
return (r, l) => (
|
|
30
|
+
return (r, l) => (o(), u("div", {
|
|
31
31
|
class: "h-panel",
|
|
32
|
-
style:
|
|
32
|
+
style: c(h(i))
|
|
33
33
|
}, [
|
|
34
34
|
b(r.$slots, "default", {}, void 0, !0)
|
|
35
35
|
], 4));
|
|
36
36
|
}
|
|
37
|
-
}), T = /* @__PURE__ */ m(
|
|
37
|
+
}), T = /* @__PURE__ */ m(ct, [["__scopeId", "data-v-474190fc"]]);
|
|
38
38
|
T.install = (e) => {
|
|
39
39
|
e.component(T.name, T);
|
|
40
40
|
};
|
|
41
|
-
const
|
|
41
|
+
const ft = {
|
|
42
42
|
name: "hHeader",
|
|
43
43
|
chineseName: "标题",
|
|
44
44
|
description: "页面标题容器"
|
|
45
|
-
},
|
|
45
|
+
}, gt = /* @__PURE__ */ Object.assign(ft, {
|
|
46
46
|
props: {
|
|
47
47
|
url: {
|
|
48
48
|
type: String,
|
|
@@ -103,26 +103,26 @@ const ct = {
|
|
|
103
103
|
left: t.textLeft,
|
|
104
104
|
transform: t.textTransform
|
|
105
105
|
}));
|
|
106
|
-
return (l, S) => (
|
|
106
|
+
return (l, S) => (o(), u("div", {
|
|
107
107
|
class: "h-header",
|
|
108
|
-
style:
|
|
108
|
+
style: c(h(i))
|
|
109
109
|
}, [
|
|
110
|
-
h(t).showText ? (
|
|
110
|
+
h(t).showText ? (o(), u("span", {
|
|
111
111
|
key: 0,
|
|
112
|
-
style:
|
|
112
|
+
style: c(h(r))
|
|
113
113
|
}, C(h(t).text), 5)) : j("", !0),
|
|
114
114
|
b(l.$slots, "default", {}, void 0, !0)
|
|
115
115
|
], 4));
|
|
116
116
|
}
|
|
117
|
-
}),
|
|
118
|
-
|
|
119
|
-
e.component(
|
|
117
|
+
}), W = /* @__PURE__ */ m(gt, [["__scopeId", "data-v-b83cf769"]]);
|
|
118
|
+
W.install = (e) => {
|
|
119
|
+
e.component(W.name, W);
|
|
120
120
|
};
|
|
121
|
-
const
|
|
121
|
+
const yt = {
|
|
122
122
|
name: "hMain",
|
|
123
123
|
chineseName: "主内容区",
|
|
124
124
|
description: "页面主内容工作区"
|
|
125
|
-
},
|
|
125
|
+
}, ht = /* @__PURE__ */ Object.assign(yt, {
|
|
126
126
|
props: {
|
|
127
127
|
height: {
|
|
128
128
|
type: String,
|
|
@@ -153,20 +153,20 @@ const gt = {
|
|
|
153
153
|
rowGap: t.rowGap,
|
|
154
154
|
padding: t.padding
|
|
155
155
|
}));
|
|
156
|
-
return (r, l) => (
|
|
156
|
+
return (r, l) => (o(), u("div", {
|
|
157
157
|
class: "h-main",
|
|
158
|
-
style:
|
|
158
|
+
style: c(h(i))
|
|
159
159
|
}, [
|
|
160
160
|
b(r.$slots, "default", {}, void 0, !0)
|
|
161
161
|
], 4));
|
|
162
162
|
}
|
|
163
|
-
}),
|
|
164
|
-
|
|
165
|
-
e.component(
|
|
163
|
+
}), B = /* @__PURE__ */ m(ht, [["__scopeId", "data-v-1025786b"]]);
|
|
164
|
+
B.install = (e) => {
|
|
165
|
+
e.component(B.name, B);
|
|
166
166
|
};
|
|
167
|
-
const
|
|
167
|
+
const mt = {
|
|
168
168
|
name: "hChart"
|
|
169
|
-
},
|
|
169
|
+
}, St = /* @__PURE__ */ Object.assign(mt, {
|
|
170
170
|
props: {
|
|
171
171
|
height: {
|
|
172
172
|
type: String,
|
|
@@ -214,29 +214,29 @@ const ht = {
|
|
|
214
214
|
backgroundImage: l.url ? `url(${l.url})` : "none",
|
|
215
215
|
flex: l.flex,
|
|
216
216
|
height: l.height
|
|
217
|
-
})),
|
|
217
|
+
})), x = y(() => ({
|
|
218
218
|
height: l.chartsh !== "auto" && l.chartsh !== "0" ? `calc(100% - ${l.chartsh})` : l.chartsh
|
|
219
|
-
})), p =
|
|
220
|
-
let
|
|
221
|
-
const I =
|
|
222
|
-
|
|
219
|
+
})), p = v(null);
|
|
220
|
+
let f = null;
|
|
221
|
+
const I = lt(() => {
|
|
222
|
+
f && (f.resize(), r("chart-resize", { instance: f }));
|
|
223
223
|
}, 100), k = () => {
|
|
224
|
-
if (!
|
|
224
|
+
if (!f) return;
|
|
225
225
|
["click", "dblclick", "mouseover", "mouseout"].forEach((a) => {
|
|
226
|
-
|
|
227
|
-
r(`chart-${a}`,
|
|
226
|
+
f.on(a, (d) => {
|
|
227
|
+
r(`chart-${a}`, d);
|
|
228
228
|
});
|
|
229
229
|
});
|
|
230
230
|
}, A = () => {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}),
|
|
231
|
+
f && (["click", "dblclick", "mouseover", "mouseout"].forEach((a) => {
|
|
232
|
+
f.off(a);
|
|
233
|
+
}), f.dispose(), f = null);
|
|
234
234
|
}, $ = () => {
|
|
235
235
|
if (A(), !!p.value)
|
|
236
236
|
try {
|
|
237
237
|
const n = g(l.chartsOption);
|
|
238
|
-
|
|
239
|
-
instance:
|
|
238
|
+
f = rt.init(p.value), f.setOption(n, { notMerge: !0 }), k(), r("chart-ready", {
|
|
239
|
+
instance: f,
|
|
240
240
|
dom: p.value
|
|
241
241
|
});
|
|
242
242
|
} catch (n) {
|
|
@@ -246,31 +246,31 @@ const ht = {
|
|
|
246
246
|
if (!n || typeof n != "object")
|
|
247
247
|
return { series: [] };
|
|
248
248
|
const a = JSON.parse(JSON.stringify(n));
|
|
249
|
-
return a.series ? Array.isArray(a.series) || (a.series = [a.series]) : a.series = [], a.series = a.series.map((
|
|
250
|
-
if (!
|
|
249
|
+
return a.series ? Array.isArray(a.series) || (a.series = [a.series]) : a.series = [], a.series = a.series.map((d) => {
|
|
250
|
+
if (!d || typeof d != "object")
|
|
251
251
|
return { type: "line" };
|
|
252
|
-
const
|
|
252
|
+
const _ = {
|
|
253
253
|
type: "line",
|
|
254
|
-
...
|
|
255
|
-
type:
|
|
254
|
+
...d,
|
|
255
|
+
type: d.type || "line"
|
|
256
256
|
};
|
|
257
|
-
return
|
|
257
|
+
return _.type === "pie" && _.data && (_.data = _.data.map((w) => typeof w == "object" && w !== null ? {
|
|
258
258
|
type: "line",
|
|
259
259
|
...w,
|
|
260
260
|
type: w.type || "line"
|
|
261
|
-
} : w)),
|
|
262
|
-
}), a.xAxis ? Array.isArray(a.xAxis) ? a.xAxis = a.xAxis.map((
|
|
261
|
+
} : w)), _;
|
|
262
|
+
}), a.xAxis ? Array.isArray(a.xAxis) ? a.xAxis = a.xAxis.map((d) => !d || typeof d != "object" ? { type: "category" } : {
|
|
263
263
|
type: "category",
|
|
264
|
-
...
|
|
265
|
-
type:
|
|
264
|
+
...d,
|
|
265
|
+
type: d.type || "category"
|
|
266
266
|
}) : typeof a.xAxis == "object" ? a.xAxis = {
|
|
267
267
|
type: "category",
|
|
268
268
|
...a.xAxis,
|
|
269
269
|
type: a.xAxis.type || "category"
|
|
270
|
-
} : a.xAxis = { type: "category" } : a.xAxis = { type: "category" }, a.yAxis ? Array.isArray(a.yAxis) ? a.yAxis = a.yAxis.map((
|
|
270
|
+
} : a.xAxis = { type: "category" } : a.xAxis = { type: "category" }, a.yAxis ? Array.isArray(a.yAxis) ? a.yAxis = a.yAxis.map((d) => !d || typeof d != "object" ? { type: "value" } : {
|
|
271
271
|
type: "value",
|
|
272
|
-
...
|
|
273
|
-
type:
|
|
272
|
+
...d,
|
|
273
|
+
type: d.type || "value"
|
|
274
274
|
}) : typeof a.yAxis == "object" ? a.yAxis = {
|
|
275
275
|
type: "value",
|
|
276
276
|
...a.yAxis,
|
|
@@ -281,60 +281,60 @@ const ht = {
|
|
|
281
281
|
}, s = () => {
|
|
282
282
|
I();
|
|
283
283
|
};
|
|
284
|
-
return
|
|
284
|
+
return it(() => {
|
|
285
285
|
setTimeout(() => {
|
|
286
286
|
$();
|
|
287
|
-
}, 0), window.addEventListener("resize", s),
|
|
287
|
+
}, 0), window.addEventListener("resize", s), st(p, (n) => {
|
|
288
288
|
I();
|
|
289
289
|
});
|
|
290
|
-
}),
|
|
290
|
+
}), at(() => {
|
|
291
291
|
window.removeEventListener("resize", s), A();
|
|
292
292
|
}), G(() => l.chartsOption, (n, a) => {
|
|
293
293
|
if (n)
|
|
294
294
|
try {
|
|
295
|
-
const
|
|
296
|
-
if (!
|
|
295
|
+
const d = g(n);
|
|
296
|
+
if (!f) {
|
|
297
297
|
$();
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
instance:
|
|
302
|
-
option:
|
|
300
|
+
f.setOption(d, { notMerge: !0 }), r("chart-update", {
|
|
301
|
+
instance: f,
|
|
302
|
+
option: d
|
|
303
303
|
});
|
|
304
|
-
} catch (
|
|
305
|
-
console.error("更新图表配置时出错:",
|
|
304
|
+
} catch (d) {
|
|
305
|
+
console.error("更新图表配置时出错:", d), console.error(" 错误堆栈:", d.stack);
|
|
306
306
|
}
|
|
307
307
|
}, { deep: !0 }), G(() => l.showChart, (n) => {
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
f && setTimeout(() => {
|
|
309
|
+
f.resize();
|
|
310
310
|
}, 0);
|
|
311
311
|
}), t({
|
|
312
|
-
getInstance: () =>
|
|
312
|
+
getInstance: () => f,
|
|
313
313
|
resize: () => I(),
|
|
314
|
-
dispatchAction: (n) =>
|
|
314
|
+
dispatchAction: (n) => f == null ? void 0 : f.dispatchAction(n),
|
|
315
315
|
dispose: A
|
|
316
|
-
}), (n, a) => (
|
|
316
|
+
}), (n, a) => (o(), u("div", {
|
|
317
317
|
class: "h-chart",
|
|
318
|
-
style:
|
|
318
|
+
style: c(S.value)
|
|
319
319
|
}, [
|
|
320
320
|
b(n.$slots, "default", {}, void 0, !0),
|
|
321
|
-
|
|
321
|
+
ut(z("div", {
|
|
322
322
|
class: "chart",
|
|
323
323
|
ref_key: "charts",
|
|
324
324
|
ref: p,
|
|
325
|
-
style:
|
|
325
|
+
style: c(x.value)
|
|
326
326
|
}, null, 4), [
|
|
327
|
-
[
|
|
327
|
+
[dt, l.showChart]
|
|
328
328
|
])
|
|
329
329
|
], 4));
|
|
330
330
|
}
|
|
331
|
-
}),
|
|
332
|
-
|
|
333
|
-
e.component(
|
|
331
|
+
}), F = /* @__PURE__ */ m(St, [["__scopeId", "data-v-ad5727b9"]]);
|
|
332
|
+
F.install = (e) => {
|
|
333
|
+
e.component(F.name, F);
|
|
334
334
|
};
|
|
335
|
-
const
|
|
335
|
+
const xt = {
|
|
336
336
|
name: "hLeft"
|
|
337
|
-
}, _t = /* @__PURE__ */ Object.assign(
|
|
337
|
+
}, _t = /* @__PURE__ */ Object.assign(xt, {
|
|
338
338
|
props: {
|
|
339
339
|
width: {
|
|
340
340
|
type: String,
|
|
@@ -365,20 +365,20 @@ const St = {
|
|
|
365
365
|
columnGap: t.columnGap,
|
|
366
366
|
rowGap: t.rowGap
|
|
367
367
|
}));
|
|
368
|
-
return (r, l) => (
|
|
368
|
+
return (r, l) => (o(), u("div", {
|
|
369
369
|
class: "h-left",
|
|
370
|
-
style:
|
|
370
|
+
style: c(h(i))
|
|
371
371
|
}, [
|
|
372
372
|
b(r.$slots, "default", {}, void 0, !0)
|
|
373
373
|
], 4));
|
|
374
374
|
}
|
|
375
|
-
}),
|
|
376
|
-
|
|
377
|
-
e.component(
|
|
375
|
+
}), H = /* @__PURE__ */ m(_t, [["__scopeId", "data-v-65e91535"]]);
|
|
376
|
+
H.install = (e) => {
|
|
377
|
+
e.component(H.name, H);
|
|
378
378
|
};
|
|
379
379
|
const vt = {
|
|
380
380
|
name: "hRight"
|
|
381
|
-
},
|
|
381
|
+
}, bt = /* @__PURE__ */ Object.assign(vt, {
|
|
382
382
|
props: {
|
|
383
383
|
width: {
|
|
384
384
|
type: String,
|
|
@@ -409,20 +409,20 @@ const vt = {
|
|
|
409
409
|
columnGap: t.columnGap,
|
|
410
410
|
rowGap: t.rowGap
|
|
411
411
|
}));
|
|
412
|
-
return (r, l) => (
|
|
412
|
+
return (r, l) => (o(), u("div", {
|
|
413
413
|
class: "h-right",
|
|
414
|
-
style:
|
|
414
|
+
style: c(h(i))
|
|
415
415
|
}, [
|
|
416
416
|
b(r.$slots, "default", {}, void 0, !0)
|
|
417
417
|
], 4));
|
|
418
418
|
}
|
|
419
|
-
}), L = /* @__PURE__ */ m(
|
|
419
|
+
}), L = /* @__PURE__ */ m(bt, [["__scopeId", "data-v-e897c957"]]);
|
|
420
420
|
L.install = (e) => {
|
|
421
421
|
e.component(L.name, L);
|
|
422
422
|
};
|
|
423
|
-
const
|
|
423
|
+
const wt = {
|
|
424
424
|
name: "hCenter"
|
|
425
|
-
},
|
|
425
|
+
}, $t = /* @__PURE__ */ Object.assign(wt, {
|
|
426
426
|
props: {
|
|
427
427
|
width: {
|
|
428
428
|
type: String,
|
|
@@ -458,20 +458,20 @@ const bt = {
|
|
|
458
458
|
columnGap: t.columnGap,
|
|
459
459
|
rowGap: t.rowGap
|
|
460
460
|
}));
|
|
461
|
-
return (r, l) => (
|
|
461
|
+
return (r, l) => (o(), u("div", {
|
|
462
462
|
class: "h-center",
|
|
463
|
-
style:
|
|
463
|
+
style: c(h(i))
|
|
464
464
|
}, [
|
|
465
465
|
b(r.$slots, "default", {}, void 0, !0)
|
|
466
466
|
], 4));
|
|
467
467
|
}
|
|
468
|
-
}), E = /* @__PURE__ */ m(
|
|
468
|
+
}), E = /* @__PURE__ */ m($t, [["__scopeId", "data-v-73b498de"]]);
|
|
469
469
|
E.install = (e) => {
|
|
470
470
|
e.component(E.name, E);
|
|
471
471
|
};
|
|
472
|
-
const
|
|
472
|
+
const At = {
|
|
473
473
|
name: "hTop"
|
|
474
|
-
},
|
|
474
|
+
}, It = /* @__PURE__ */ Object.assign(At, {
|
|
475
475
|
props: {
|
|
476
476
|
height: {
|
|
477
477
|
type: String,
|
|
@@ -492,20 +492,20 @@ const $t = {
|
|
|
492
492
|
display: t.display,
|
|
493
493
|
position: t.position
|
|
494
494
|
}));
|
|
495
|
-
return (r, l) => (
|
|
495
|
+
return (r, l) => (o(), u("div", {
|
|
496
496
|
class: "h-top",
|
|
497
|
-
style:
|
|
497
|
+
style: c(h(i))
|
|
498
498
|
}, [
|
|
499
499
|
b(r.$slots, "default", {}, void 0, !0)
|
|
500
500
|
], 4));
|
|
501
501
|
}
|
|
502
|
-
}), R = /* @__PURE__ */ m(
|
|
502
|
+
}), R = /* @__PURE__ */ m(It, [["__scopeId", "data-v-54014ba4"]]);
|
|
503
503
|
R.install = (e) => {
|
|
504
504
|
e.component(R.name, R);
|
|
505
505
|
};
|
|
506
|
-
const
|
|
506
|
+
const kt = {
|
|
507
507
|
name: "hBottom"
|
|
508
|
-
},
|
|
508
|
+
}, Ct = /* @__PURE__ */ Object.assign(kt, {
|
|
509
509
|
props: {
|
|
510
510
|
height: {
|
|
511
511
|
type: String,
|
|
@@ -536,20 +536,20 @@ const It = {
|
|
|
536
536
|
rowGap: t.rowGap,
|
|
537
537
|
columnGap: t.columnGap
|
|
538
538
|
}));
|
|
539
|
-
return (r, l) => (
|
|
539
|
+
return (r, l) => (o(), u("div", {
|
|
540
540
|
class: "h-bottom",
|
|
541
|
-
style:
|
|
541
|
+
style: c(h(i))
|
|
542
542
|
}, [
|
|
543
543
|
b(r.$slots, "default", {}, void 0, !0)
|
|
544
544
|
], 4));
|
|
545
545
|
}
|
|
546
|
-
}), M = /* @__PURE__ */ m(
|
|
546
|
+
}), M = /* @__PURE__ */ m(Ct, [["__scopeId", "data-v-086bec2a"]]);
|
|
547
547
|
M.install = (e) => {
|
|
548
548
|
e.component(M.name, M);
|
|
549
549
|
};
|
|
550
|
-
const
|
|
550
|
+
const zt = {
|
|
551
551
|
name: "hChartTitle"
|
|
552
|
-
},
|
|
552
|
+
}, Gt = /* @__PURE__ */ Object.assign(zt, {
|
|
553
553
|
props: {
|
|
554
554
|
fontSize: {
|
|
555
555
|
type: String,
|
|
@@ -590,23 +590,23 @@ const Ct = {
|
|
|
590
590
|
paddingTop: t.paddingTop,
|
|
591
591
|
paddingBottom: t.paddingBottom
|
|
592
592
|
}));
|
|
593
|
-
return (r, l) => (
|
|
593
|
+
return (r, l) => (o(), u("div", {
|
|
594
594
|
class: "h-chart-title",
|
|
595
|
-
style:
|
|
595
|
+
style: c(h(i))
|
|
596
596
|
}, [
|
|
597
597
|
b(r.$slots, "title", {}, void 0, !0),
|
|
598
598
|
b(r.$slots, "content", {}, void 0, !0)
|
|
599
599
|
], 4));
|
|
600
600
|
}
|
|
601
|
-
}), P = /* @__PURE__ */ m(
|
|
601
|
+
}), P = /* @__PURE__ */ m(Gt, [["__scopeId", "data-v-36cebf9b"]]);
|
|
602
602
|
P.install = (e) => {
|
|
603
603
|
e.component(P.name, P);
|
|
604
604
|
};
|
|
605
|
-
const
|
|
605
|
+
const jt = {
|
|
606
606
|
name: "hItemChart",
|
|
607
607
|
chineseName: "独立图表",
|
|
608
608
|
description: "独立的 ECharts 图表容器组件,适用于大屏数据可视化展示"
|
|
609
|
-
},
|
|
609
|
+
}, Ot = /* @__PURE__ */ Object.assign(jt, {
|
|
610
610
|
props: {
|
|
611
611
|
height: {
|
|
612
612
|
type: String,
|
|
@@ -634,9 +634,9 @@ const Gt = {
|
|
|
634
634
|
const r = i, l = e, S = y(() => ({
|
|
635
635
|
backgroundImage: l.url ? `url(${l.url})` : "none",
|
|
636
636
|
height: l.height
|
|
637
|
-
})),
|
|
637
|
+
})), x = v(null);
|
|
638
638
|
let p = null;
|
|
639
|
-
const
|
|
639
|
+
const f = lt(() => {
|
|
640
640
|
p && (p.resize(), r("chart-resize", { instance: p }));
|
|
641
641
|
}, 100), I = () => {
|
|
642
642
|
if (!p) return;
|
|
@@ -650,12 +650,12 @@ const Gt = {
|
|
|
650
650
|
p.off(n);
|
|
651
651
|
}), p.dispose(), p = null);
|
|
652
652
|
}, A = () => {
|
|
653
|
-
if (k(), !!
|
|
653
|
+
if (k(), !!x.value)
|
|
654
654
|
try {
|
|
655
655
|
const s = $(l.chartsOption);
|
|
656
|
-
p =
|
|
656
|
+
p = rt.init(x.value), p.setOption(s, { notMerge: !0 }), I(), r("chart-ready", {
|
|
657
657
|
instance: p,
|
|
658
|
-
dom:
|
|
658
|
+
dom: x.value
|
|
659
659
|
});
|
|
660
660
|
} catch (s) {
|
|
661
661
|
console.error("ECharts initialization failed:", s);
|
|
@@ -667,15 +667,15 @@ const Gt = {
|
|
|
667
667
|
return n.series ? Array.isArray(n.series) || (n.series = [n.series]) : n.series = [], n.series = n.series.map((a) => {
|
|
668
668
|
if (!a || typeof a != "object")
|
|
669
669
|
return { type: "line" };
|
|
670
|
-
const
|
|
670
|
+
const d = {
|
|
671
671
|
type: "line",
|
|
672
672
|
...a,
|
|
673
673
|
type: a.type || "line"
|
|
674
674
|
};
|
|
675
|
-
return
|
|
676
|
-
value:
|
|
677
|
-
name:
|
|
678
|
-
} :
|
|
675
|
+
return d.type === "pie" && d.data && (d.data = d.data.map((_) => typeof _ == "object" && _ !== null ? {
|
|
676
|
+
value: _.value || 0,
|
|
677
|
+
name: _.name || ""
|
|
678
|
+
} : _)), d;
|
|
679
679
|
}), n.xAxis ? Array.isArray(n.xAxis) ? n.xAxis = n.xAxis.map((a) => !a || typeof a != "object" ? { type: "category" } : {
|
|
680
680
|
type: "category",
|
|
681
681
|
...a,
|
|
@@ -696,15 +696,15 @@ const Gt = {
|
|
|
696
696
|
data: n.legend
|
|
697
697
|
})), n;
|
|
698
698
|
}, g = () => {
|
|
699
|
-
|
|
699
|
+
f();
|
|
700
700
|
};
|
|
701
|
-
return
|
|
701
|
+
return it(() => {
|
|
702
702
|
setTimeout(() => {
|
|
703
703
|
A();
|
|
704
|
-
}, 0), window.addEventListener("resize", g),
|
|
705
|
-
|
|
704
|
+
}, 0), window.addEventListener("resize", g), st(x, (s) => {
|
|
705
|
+
f();
|
|
706
706
|
});
|
|
707
|
-
}),
|
|
707
|
+
}), at(() => {
|
|
708
708
|
window.removeEventListener("resize", g), k();
|
|
709
709
|
}), G(() => l.chartsOption, (s) => {
|
|
710
710
|
if (s)
|
|
@@ -723,25 +723,25 @@ const Gt = {
|
|
|
723
723
|
}
|
|
724
724
|
}, { deep: !0 }), t({
|
|
725
725
|
getInstance: () => p,
|
|
726
|
-
resize: () =>
|
|
726
|
+
resize: () => f(),
|
|
727
727
|
dispatchAction: (s) => p == null ? void 0 : p.dispatchAction(s),
|
|
728
728
|
dispose: k
|
|
729
|
-
}), (s, n) => (
|
|
729
|
+
}), (s, n) => (o(), u("div", {
|
|
730
730
|
class: "h-item-chart",
|
|
731
731
|
ref_key: "itemCharts",
|
|
732
|
-
ref:
|
|
733
|
-
style:
|
|
732
|
+
ref: x,
|
|
733
|
+
style: c(S.value)
|
|
734
734
|
}, null, 4));
|
|
735
735
|
}
|
|
736
|
-
}),
|
|
737
|
-
|
|
738
|
-
e.component(
|
|
736
|
+
}), V = /* @__PURE__ */ m(Ot, [["__scopeId", "data-v-7c5da244"]]);
|
|
737
|
+
V.install = (e) => {
|
|
738
|
+
e.component(V.name, V);
|
|
739
739
|
};
|
|
740
|
-
const
|
|
740
|
+
const Dt = {
|
|
741
741
|
name: "hList",
|
|
742
742
|
chineseName: "滚动列表",
|
|
743
743
|
description: "支持自动滚动的数据列表组件,适用于大屏数据展示"
|
|
744
|
-
},
|
|
744
|
+
}, Nt = /* @__PURE__ */ Object.assign(Dt, {
|
|
745
745
|
props: {
|
|
746
746
|
// 容器样式
|
|
747
747
|
width: {
|
|
@@ -803,7 +803,7 @@ const Ot = {
|
|
|
803
803
|
}
|
|
804
804
|
},
|
|
805
805
|
setup(e, { expose: t }) {
|
|
806
|
-
const i = e, r =
|
|
806
|
+
const i = e, r = v(0), l = v(null), S = v(0), x = v([]), p = v(null), f = y(() => ({
|
|
807
807
|
width: i.width,
|
|
808
808
|
height: i.height,
|
|
809
809
|
backgroundColor: i.backgroundColor,
|
|
@@ -826,8 +826,8 @@ const Ot = {
|
|
|
826
826
|
})), A = (a) => a === l.value ? i.highlightStyle : {};
|
|
827
827
|
G(r, (a) => {
|
|
828
828
|
if (i.data.length > 0) {
|
|
829
|
-
const
|
|
830
|
-
l.value =
|
|
829
|
+
const d = a % i.data.length;
|
|
830
|
+
l.value = d;
|
|
831
831
|
}
|
|
832
832
|
});
|
|
833
833
|
let $ = null;
|
|
@@ -838,11 +838,11 @@ const Ot = {
|
|
|
838
838
|
}, s = () => {
|
|
839
839
|
$ && (clearInterval($), $ = null);
|
|
840
840
|
}, n = () => {
|
|
841
|
-
|
|
841
|
+
x.value && x.value[0] && (S.value = x.value[0].offsetHeight || 40);
|
|
842
842
|
};
|
|
843
|
-
return
|
|
843
|
+
return it(() => {
|
|
844
844
|
n(), g(), window.addEventListener("resize", n);
|
|
845
|
-
}),
|
|
845
|
+
}), at(() => {
|
|
846
846
|
s(), window.removeEventListener("resize", n);
|
|
847
847
|
}), G(() => i.data, (a) => {
|
|
848
848
|
a.length > 0 ? (r.value = 0, l.value = null, setTimeout(() => {
|
|
@@ -857,58 +857,62 @@ const Ot = {
|
|
|
857
857
|
scrollTo: (a) => {
|
|
858
858
|
a >= 0 && a < i.data.length && (r.value = a);
|
|
859
859
|
}
|
|
860
|
-
}), (a,
|
|
860
|
+
}), (a, d) => (o(), u("div", {
|
|
861
861
|
class: "h-list",
|
|
862
|
-
style: f
|
|
862
|
+
style: c(f.value)
|
|
863
863
|
}, [
|
|
864
|
-
e.showHeader ? (
|
|
864
|
+
e.showHeader ? (o(), u("div", {
|
|
865
865
|
key: 0,
|
|
866
866
|
class: "list-header",
|
|
867
|
-
style:
|
|
867
|
+
style: c(I.value)
|
|
868
868
|
}, [
|
|
869
|
-
(
|
|
869
|
+
(o(!0), u(O, null, D(e.header, (_, w) => (o(), u("p", {
|
|
870
870
|
key: w,
|
|
871
871
|
class: "header-item"
|
|
872
|
-
}, C(
|
|
872
|
+
}, C(_), 1))), 128))
|
|
873
873
|
], 4)) : j("", !0),
|
|
874
|
-
e.enableScroll ? (
|
|
874
|
+
e.enableScroll ? (o(), u("div", {
|
|
875
875
|
key: 1,
|
|
876
876
|
class: "scroll-wrapper",
|
|
877
|
-
style:
|
|
877
|
+
style: c(k.value)
|
|
878
878
|
}, [
|
|
879
879
|
z("div", {
|
|
880
880
|
class: "data-list",
|
|
881
881
|
ref_key: "listContainer",
|
|
882
882
|
ref: p
|
|
883
883
|
}, [
|
|
884
|
-
(
|
|
884
|
+
(o(!0), u(O, null, D(e.data, (_, w) => (o(), u("div", {
|
|
885
885
|
key: w,
|
|
886
886
|
class: "data-list-item",
|
|
887
|
-
style:
|
|
887
|
+
style: c(A(w)),
|
|
888
888
|
ref_for: !0,
|
|
889
889
|
ref_key: "listItems",
|
|
890
|
-
ref:
|
|
890
|
+
ref: x
|
|
891
891
|
}, [
|
|
892
|
-
(
|
|
892
|
+
(o(!0), u(O, null, D(_, (nt, N) => (o(), u("p", {
|
|
893
893
|
key: N,
|
|
894
894
|
class: "data-item-cell"
|
|
895
|
-
}, C(
|
|
895
|
+
}, C(nt), 1))), 128))
|
|
896
896
|
], 4))), 128))
|
|
897
897
|
], 512)
|
|
898
898
|
], 4)) : j("", !0)
|
|
899
899
|
], 4));
|
|
900
900
|
}
|
|
901
|
-
}),
|
|
902
|
-
|
|
903
|
-
e.component(
|
|
901
|
+
}), Y = /* @__PURE__ */ m(Nt, [["__scopeId", "data-v-937cc59c"]]);
|
|
902
|
+
Y.install = (e) => {
|
|
903
|
+
e.component(Y.name, Y);
|
|
904
904
|
};
|
|
905
|
-
const
|
|
906
|
-
name: "
|
|
907
|
-
},
|
|
905
|
+
const Tt = {
|
|
906
|
+
name: "hView"
|
|
907
|
+
}, Wt = /* @__PURE__ */ Object.assign(Tt, {
|
|
908
908
|
props: {
|
|
909
909
|
height: {
|
|
910
910
|
type: String,
|
|
911
|
-
default: "
|
|
911
|
+
default: "100%"
|
|
912
|
+
},
|
|
913
|
+
width: {
|
|
914
|
+
type: String,
|
|
915
|
+
default: "50px"
|
|
912
916
|
},
|
|
913
917
|
display: {
|
|
914
918
|
type: String,
|
|
@@ -925,30 +929,36 @@ const Nt = {
|
|
|
925
929
|
columnGap: {
|
|
926
930
|
type: String,
|
|
927
931
|
default: "0"
|
|
932
|
+
},
|
|
933
|
+
flex: {
|
|
934
|
+
type: String,
|
|
935
|
+
default: "0.2"
|
|
928
936
|
}
|
|
929
937
|
},
|
|
930
938
|
setup(e) {
|
|
931
939
|
let t = e, i = y(() => ({
|
|
940
|
+
width: t.width,
|
|
932
941
|
height: t.height,
|
|
933
942
|
display: t.display,
|
|
934
943
|
flexDirection: t.flexDirection,
|
|
935
944
|
rowGap: t.rowGap,
|
|
936
|
-
columnGap: t.columnGap
|
|
945
|
+
columnGap: t.columnGap,
|
|
946
|
+
flex: t.flex
|
|
937
947
|
}));
|
|
938
|
-
return (r, l) => (
|
|
939
|
-
class: "h-
|
|
940
|
-
style:
|
|
948
|
+
return (r, l) => (o(), u("div", {
|
|
949
|
+
class: "h-view",
|
|
950
|
+
style: c(h(i))
|
|
941
951
|
}, [
|
|
942
952
|
b(r.$slots, "default", {}, void 0, !0)
|
|
943
953
|
], 4));
|
|
944
954
|
}
|
|
945
|
-
}),
|
|
946
|
-
|
|
947
|
-
e.component(
|
|
955
|
+
}), J = /* @__PURE__ */ m(Wt, [["__scopeId", "data-v-490e5736"]]);
|
|
956
|
+
J.install = (e) => {
|
|
957
|
+
e.component(J.name, J);
|
|
948
958
|
};
|
|
949
959
|
const Bt = {
|
|
950
960
|
name: "hDataLabel"
|
|
951
|
-
},
|
|
961
|
+
}, Ft = /* @__PURE__ */ Object.assign(Bt, {
|
|
952
962
|
props: {
|
|
953
963
|
url: {
|
|
954
964
|
type: String,
|
|
@@ -1080,7 +1090,7 @@ const Bt = {
|
|
|
1080
1090
|
}
|
|
1081
1091
|
},
|
|
1082
1092
|
setup(e) {
|
|
1083
|
-
let t = e, i =
|
|
1093
|
+
let t = e, i = v({
|
|
1084
1094
|
width: t.width,
|
|
1085
1095
|
height: t.height,
|
|
1086
1096
|
position: t.position,
|
|
@@ -1096,49 +1106,49 @@ const Bt = {
|
|
|
1096
1106
|
justifyContent: t.justifyContent,
|
|
1097
1107
|
alignItems: t.alignItems,
|
|
1098
1108
|
color: t.color
|
|
1099
|
-
}), r =
|
|
1109
|
+
}), r = v({
|
|
1100
1110
|
fontSize: t.numFontSize,
|
|
1101
1111
|
fontWeight: t.numFontWeight,
|
|
1102
1112
|
color: t.numColor
|
|
1103
|
-
}), l =
|
|
1113
|
+
}), l = v({
|
|
1104
1114
|
fontSize: t.textFontSize,
|
|
1105
1115
|
fontWeight: t.textFontWeight,
|
|
1106
1116
|
color: t.textColor
|
|
1107
|
-
}), S =
|
|
1117
|
+
}), S = v({
|
|
1108
1118
|
fontSize: t.titleFontSize,
|
|
1109
1119
|
fontWeight: t.titleFontWeight,
|
|
1110
1120
|
color: t.titleColor,
|
|
1111
1121
|
lineHeight: t.titlelineHeight,
|
|
1112
1122
|
textAlign: t.titletextAlign
|
|
1113
1123
|
});
|
|
1114
|
-
return (
|
|
1124
|
+
return (x, p) => (o(), u("div", {
|
|
1115
1125
|
class: "h-data-label",
|
|
1116
|
-
style:
|
|
1126
|
+
style: c(h(i))
|
|
1117
1127
|
}, [
|
|
1118
|
-
e.show ? (
|
|
1128
|
+
e.show ? (o(), u("span", {
|
|
1119
1129
|
key: 0,
|
|
1120
1130
|
class: "h-data-label-num",
|
|
1121
|
-
style:
|
|
1131
|
+
style: c(h(r))
|
|
1122
1132
|
}, C(e.num), 5)) : j("", !0),
|
|
1123
|
-
e.show ? (
|
|
1133
|
+
e.show ? (o(), u("span", {
|
|
1124
1134
|
key: 1,
|
|
1125
1135
|
class: "h-data-label-text",
|
|
1126
|
-
style:
|
|
1136
|
+
style: c(h(l))
|
|
1127
1137
|
}, C(e.text), 5)) : j("", !0),
|
|
1128
|
-
e.titleShow ? (
|
|
1138
|
+
e.titleShow ? (o(), u("span", {
|
|
1129
1139
|
key: 2,
|
|
1130
1140
|
class: "h-data-label-title",
|
|
1131
|
-
style:
|
|
1141
|
+
style: c(h(S))
|
|
1132
1142
|
}, C(e.someText), 5)) : j("", !0)
|
|
1133
1143
|
], 4));
|
|
1134
1144
|
}
|
|
1135
|
-
}), q = /* @__PURE__ */ m(
|
|
1145
|
+
}), q = /* @__PURE__ */ m(Ft, [["__scopeId", "data-v-f0ce86db"]]);
|
|
1136
1146
|
q.install = (e) => {
|
|
1137
1147
|
e.component(q.name, q);
|
|
1138
1148
|
};
|
|
1139
1149
|
const Ht = {
|
|
1140
1150
|
name: "hButton"
|
|
1141
|
-
},
|
|
1151
|
+
}, Lt = /* @__PURE__ */ Object.assign(Ht, {
|
|
1142
1152
|
props: {
|
|
1143
1153
|
url: {
|
|
1144
1154
|
type: String,
|
|
@@ -1178,7 +1188,7 @@ const Ht = {
|
|
|
1178
1188
|
}
|
|
1179
1189
|
},
|
|
1180
1190
|
setup(e) {
|
|
1181
|
-
let t = e, i =
|
|
1191
|
+
let t = e, i = v({
|
|
1182
1192
|
width: t.width,
|
|
1183
1193
|
height: t.height,
|
|
1184
1194
|
padding: t.padding,
|
|
@@ -1189,18 +1199,18 @@ const Ht = {
|
|
|
1189
1199
|
fontWeight: t.fontWeight,
|
|
1190
1200
|
color: t.color
|
|
1191
1201
|
});
|
|
1192
|
-
return (r, l) => (
|
|
1202
|
+
return (r, l) => (o(), u("button", {
|
|
1193
1203
|
class: "h-button",
|
|
1194
|
-
style:
|
|
1204
|
+
style: c(h(i))
|
|
1195
1205
|
}, C(h(t).text), 5));
|
|
1196
1206
|
}
|
|
1197
|
-
}), U = /* @__PURE__ */ m(
|
|
1207
|
+
}), U = /* @__PURE__ */ m(Lt, [["__scopeId", "data-v-0a183c56"]]);
|
|
1198
1208
|
U.install = (e) => {
|
|
1199
1209
|
e.component(U.name, U);
|
|
1200
1210
|
};
|
|
1201
|
-
const
|
|
1211
|
+
const Et = {
|
|
1202
1212
|
name: "hGrid"
|
|
1203
|
-
},
|
|
1213
|
+
}, Rt = /* @__PURE__ */ Object.assign(Et, {
|
|
1204
1214
|
props: {
|
|
1205
1215
|
width: {
|
|
1206
1216
|
type: String,
|
|
@@ -1244,25 +1254,25 @@ const Lt = {
|
|
|
1244
1254
|
}
|
|
1245
1255
|
},
|
|
1246
1256
|
setup(e) {
|
|
1247
|
-
let t = e, i =
|
|
1257
|
+
let t = e, i = v({
|
|
1248
1258
|
width: t.width,
|
|
1249
1259
|
height: t.height,
|
|
1250
1260
|
display: t.display,
|
|
1251
1261
|
gridTemplateColumns: `repeat(${t.gridTemplateColumns}, ${t.gridWidth})`,
|
|
1252
1262
|
gridTemplateRows: `repeat(${t.gridTemplateRows}, ${t.gridHeight})`
|
|
1253
|
-
}), r =
|
|
1263
|
+
}), r = v({
|
|
1254
1264
|
width: t.iwidth,
|
|
1255
1265
|
height: t.iheight,
|
|
1256
1266
|
display: t.idisplay
|
|
1257
1267
|
});
|
|
1258
|
-
return (l, S) => (
|
|
1268
|
+
return (l, S) => (o(), u("div", {
|
|
1259
1269
|
class: "h-grid",
|
|
1260
|
-
style:
|
|
1270
|
+
style: c(h(i))
|
|
1261
1271
|
}, [
|
|
1262
|
-
(
|
|
1263
|
-
key:
|
|
1272
|
+
(o(), u(O, null, D(6, (x) => z("div", {
|
|
1273
|
+
key: x,
|
|
1264
1274
|
class: "h-grid-item",
|
|
1265
|
-
style:
|
|
1275
|
+
style: c(h(r))
|
|
1266
1276
|
}, S[0] || (S[0] = [
|
|
1267
1277
|
z("div", { class: "h-grid-item-left" }, [
|
|
1268
1278
|
z("img", {
|
|
@@ -1275,15 +1285,15 @@ const Lt = {
|
|
|
1275
1285
|
b(l.$slots, "default", {}, void 0, !0)
|
|
1276
1286
|
], 4));
|
|
1277
1287
|
}
|
|
1278
|
-
}), K = /* @__PURE__ */ m(
|
|
1288
|
+
}), K = /* @__PURE__ */ m(Rt, [["__scopeId", "data-v-34e7422b"]]);
|
|
1279
1289
|
K.install = (e) => {
|
|
1280
1290
|
e.component(K.name, K);
|
|
1281
1291
|
};
|
|
1282
|
-
const
|
|
1283
|
-
name: "
|
|
1292
|
+
const Mt = {
|
|
1293
|
+
name: "hCounter",
|
|
1284
1294
|
chineseName: "数字计数器",
|
|
1285
1295
|
description: "支持老虎机滚动动画的数字计数器组件,每个数字位独立从0滚动到目标值"
|
|
1286
|
-
},
|
|
1296
|
+
}, Pt = /* @__PURE__ */ Object.assign(Mt, {
|
|
1287
1297
|
props: {
|
|
1288
1298
|
// 数据相关
|
|
1289
1299
|
data: {
|
|
@@ -1423,7 +1433,7 @@ const Rt = {
|
|
|
1423
1433
|
}
|
|
1424
1434
|
},
|
|
1425
1435
|
setup(e, { expose: t }) {
|
|
1426
|
-
const i = e, r =
|
|
1436
|
+
const i = e, r = v([]), l = v(!1), S = y(() => {
|
|
1427
1437
|
let g = i.data;
|
|
1428
1438
|
i.decimalPlaces >= 0 && typeof g == "number" && (g = g.toFixed(i.decimalPlaces));
|
|
1429
1439
|
let s = String(g);
|
|
@@ -1432,7 +1442,7 @@ const Rt = {
|
|
|
1432
1442
|
n[0] = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, i.separator), s = n.join(".");
|
|
1433
1443
|
}
|
|
1434
1444
|
return i.prefix && (s = i.prefix + s), i.suffix && (s = s + i.suffix), s.split("");
|
|
1435
|
-
}),
|
|
1445
|
+
}), x = y(() => i.digitWidth ? i.digitWidth : `${(parseInt(i.digitFontSize) || 32) * 1.2}px`), p = y(() => i.digitHeight ? i.digitHeight : `${(parseInt(i.digitFontSize) || 32) * 1.5}px`), f = () => {
|
|
1436
1446
|
if (!i.enableAnimation) {
|
|
1437
1447
|
r.value = S.value.map(() => 0);
|
|
1438
1448
|
return;
|
|
@@ -1444,14 +1454,14 @@ const Rt = {
|
|
|
1444
1454
|
r.value[n] = s;
|
|
1445
1455
|
return;
|
|
1446
1456
|
}
|
|
1447
|
-
const a = parseInt(s),
|
|
1457
|
+
const a = parseInt(s), d = n * i.digitDelay, _ = i.animationDuration;
|
|
1448
1458
|
setTimeout(() => {
|
|
1449
1459
|
let w = 0;
|
|
1450
|
-
const
|
|
1451
|
-
w <= a && (r.value[n] = w, w++, w <= a ? setTimeout(N,
|
|
1460
|
+
const nt = _ / (a + 1), N = () => {
|
|
1461
|
+
w <= a && (r.value[n] = w, w++, w <= a ? setTimeout(N, nt) : (n === g.length - 1 || g.slice(n + 1).every((ot) => isNaN(parseInt(ot)))) && (l.value = !1));
|
|
1452
1462
|
};
|
|
1453
1463
|
N();
|
|
1454
|
-
},
|
|
1464
|
+
}, d);
|
|
1455
1465
|
});
|
|
1456
1466
|
}, I = (g) => {
|
|
1457
1467
|
const s = r.value[g];
|
|
@@ -1482,7 +1492,7 @@ const Rt = {
|
|
|
1482
1492
|
zIndex: i.zIndex,
|
|
1483
1493
|
transform: i.transform || void 0
|
|
1484
1494
|
})), A = y(() => ({
|
|
1485
|
-
width:
|
|
1495
|
+
width: x.value,
|
|
1486
1496
|
height: p.value,
|
|
1487
1497
|
overflow: "hidden",
|
|
1488
1498
|
position: "relative",
|
|
@@ -1502,42 +1512,42 @@ const Rt = {
|
|
|
1502
1512
|
lineHeight: "1"
|
|
1503
1513
|
}));
|
|
1504
1514
|
return G(() => i.data, () => {
|
|
1505
|
-
|
|
1506
|
-
}),
|
|
1507
|
-
|
|
1515
|
+
f();
|
|
1516
|
+
}), it(() => {
|
|
1517
|
+
f();
|
|
1508
1518
|
}), t({
|
|
1509
|
-
restart:
|
|
1519
|
+
restart: f,
|
|
1510
1520
|
getCurrentValue: () => r.value.join("")
|
|
1511
|
-
}), (g, s) => (
|
|
1521
|
+
}), (g, s) => (o(), u("div", {
|
|
1512
1522
|
class: "h-counter",
|
|
1513
|
-
style:
|
|
1523
|
+
style: c(k.value)
|
|
1514
1524
|
}, [
|
|
1515
|
-
(
|
|
1525
|
+
(o(!0), u(O, null, D(S.value, (n, a) => (o(), u("div", {
|
|
1516
1526
|
key: a,
|
|
1517
1527
|
class: "counter-digit",
|
|
1518
|
-
style:
|
|
1528
|
+
style: c(A.value)
|
|
1519
1529
|
}, [
|
|
1520
1530
|
z("div", {
|
|
1521
1531
|
class: "digit-scroll",
|
|
1522
|
-
style:
|
|
1532
|
+
style: c(I(a))
|
|
1523
1533
|
}, [
|
|
1524
|
-
(
|
|
1525
|
-
key:
|
|
1534
|
+
(o(), u(O, null, D(10, (d) => z("div", {
|
|
1535
|
+
key: d - 1,
|
|
1526
1536
|
class: "digit-item",
|
|
1527
|
-
style:
|
|
1528
|
-
}, C(
|
|
1537
|
+
style: c($.value)
|
|
1538
|
+
}, C(d - 1), 5)), 64))
|
|
1529
1539
|
], 4)
|
|
1530
1540
|
], 4))), 128)),
|
|
1531
1541
|
b(g.$slots, "default", {}, void 0, !0)
|
|
1532
1542
|
], 4));
|
|
1533
1543
|
}
|
|
1534
|
-
}), Q = /* @__PURE__ */ m(
|
|
1544
|
+
}), Q = /* @__PURE__ */ m(Pt, [["__scopeId", "data-v-fba32a26"]]);
|
|
1535
1545
|
Q.install = (e) => {
|
|
1536
1546
|
e.component(Q.name, Q);
|
|
1537
1547
|
};
|
|
1538
|
-
const
|
|
1548
|
+
const Vt = {
|
|
1539
1549
|
name: "hButtonGroup"
|
|
1540
|
-
}, Yt = /* @__PURE__ */ Object.assign(
|
|
1550
|
+
}, Yt = /* @__PURE__ */ Object.assign(Vt, {
|
|
1541
1551
|
props: {
|
|
1542
1552
|
width: {
|
|
1543
1553
|
type: String,
|
|
@@ -1585,7 +1595,7 @@ const Pt = {
|
|
|
1585
1595
|
}
|
|
1586
1596
|
},
|
|
1587
1597
|
setup(e) {
|
|
1588
|
-
let t = e, i =
|
|
1598
|
+
let t = e, i = v({
|
|
1589
1599
|
position: t.position,
|
|
1590
1600
|
left: t.left,
|
|
1591
1601
|
right: t.right,
|
|
@@ -1597,9 +1607,9 @@ const Pt = {
|
|
|
1597
1607
|
columnGap: t.columnGap,
|
|
1598
1608
|
flexWrap: t.flexWrap
|
|
1599
1609
|
});
|
|
1600
|
-
return (r, l) => (
|
|
1610
|
+
return (r, l) => (o(), u("div", {
|
|
1601
1611
|
class: "h-button-group",
|
|
1602
|
-
style:
|
|
1612
|
+
style: c(h(i))
|
|
1603
1613
|
}, [
|
|
1604
1614
|
b(r.$slots, "default", {}, void 0, !0)
|
|
1605
1615
|
], 4));
|
|
@@ -1608,11 +1618,11 @@ const Pt = {
|
|
|
1608
1618
|
X.install = (e) => {
|
|
1609
1619
|
e.component(X.name, X);
|
|
1610
1620
|
};
|
|
1611
|
-
const Jt = { class: "h-text" },
|
|
1621
|
+
const Jt = { class: "h-text" }, qt = {
|
|
1612
1622
|
name: "hText",
|
|
1613
1623
|
chineseName: "文本",
|
|
1614
1624
|
description: "用于显示文本内容"
|
|
1615
|
-
},
|
|
1625
|
+
}, Ut = /* @__PURE__ */ Object.assign(qt, {
|
|
1616
1626
|
props: {
|
|
1617
1627
|
text: {
|
|
1618
1628
|
type: String,
|
|
@@ -1629,17 +1639,17 @@ const Jt = { class: "h-text" }, Vt = {
|
|
|
1629
1639
|
},
|
|
1630
1640
|
setup(e) {
|
|
1631
1641
|
let t = e;
|
|
1632
|
-
return (i, r) => (
|
|
1642
|
+
return (i, r) => (o(), u("span", Jt, C(h(t).text), 1));
|
|
1633
1643
|
}
|
|
1634
|
-
}), Z = /* @__PURE__ */ m(
|
|
1644
|
+
}), Z = /* @__PURE__ */ m(Ut, [["__scopeId", "data-v-bc52bf83"]]);
|
|
1635
1645
|
Z.install = (e) => {
|
|
1636
1646
|
e.component(Z.name, Z);
|
|
1637
1647
|
};
|
|
1638
|
-
const
|
|
1648
|
+
const Kt = {
|
|
1639
1649
|
name: "hLayout",
|
|
1640
1650
|
chineseName: "布局",
|
|
1641
1651
|
description: "页面布局容器"
|
|
1642
|
-
},
|
|
1652
|
+
}, Qt = /* @__PURE__ */ Object.assign(Kt, {
|
|
1643
1653
|
props: {
|
|
1644
1654
|
width: {
|
|
1645
1655
|
type: String,
|
|
@@ -1675,42 +1685,102 @@ const Ut = {
|
|
|
1675
1685
|
columnGap: t.columnGap,
|
|
1676
1686
|
rowGap: t.rowGap
|
|
1677
1687
|
}));
|
|
1678
|
-
return (r, l) => (
|
|
1688
|
+
return (r, l) => (o(), u("div", {
|
|
1679
1689
|
class: "h-layout",
|
|
1680
|
-
style:
|
|
1690
|
+
style: c(h(i))
|
|
1681
1691
|
}, [
|
|
1682
1692
|
b(r.$slots, "default", {}, void 0, !0)
|
|
1683
1693
|
], 4));
|
|
1684
1694
|
}
|
|
1685
|
-
}), tt = /* @__PURE__ */ m(
|
|
1695
|
+
}), tt = /* @__PURE__ */ m(Qt, [["__scopeId", "data-v-957ea318"]]);
|
|
1686
1696
|
tt.install = (e) => {
|
|
1687
1697
|
e.component(tt.name, tt);
|
|
1688
1698
|
};
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
},
|
|
1692
|
-
|
|
1699
|
+
const Xt = {
|
|
1700
|
+
name: "hFlex"
|
|
1701
|
+
}, Zt = /* @__PURE__ */ Object.assign(Xt, {
|
|
1702
|
+
props: {
|
|
1703
|
+
width: {
|
|
1704
|
+
type: String,
|
|
1705
|
+
default: "100%"
|
|
1706
|
+
},
|
|
1707
|
+
height: {
|
|
1708
|
+
type: String,
|
|
1709
|
+
default: "100px"
|
|
1710
|
+
},
|
|
1711
|
+
url: {
|
|
1712
|
+
type: String,
|
|
1713
|
+
default: ""
|
|
1714
|
+
},
|
|
1715
|
+
display: {
|
|
1716
|
+
type: String,
|
|
1717
|
+
default: "flex"
|
|
1718
|
+
},
|
|
1719
|
+
flexDirection: {
|
|
1720
|
+
type: String,
|
|
1721
|
+
default: ""
|
|
1722
|
+
},
|
|
1723
|
+
flexWrap: {
|
|
1724
|
+
type: String,
|
|
1725
|
+
default: "wrap"
|
|
1726
|
+
},
|
|
1727
|
+
rowGap: {
|
|
1728
|
+
type: String,
|
|
1729
|
+
default: "0"
|
|
1730
|
+
},
|
|
1731
|
+
columnGap: {
|
|
1732
|
+
type: String,
|
|
1733
|
+
default: "0"
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
setup(e) {
|
|
1737
|
+
let t = e, i = y(() => ({
|
|
1738
|
+
display: t.display,
|
|
1739
|
+
width: t.width,
|
|
1740
|
+
height: t.height,
|
|
1741
|
+
backgroundImage: t.url ? `url(${t.url})` : "none",
|
|
1742
|
+
rowGap: t.rowGap,
|
|
1743
|
+
columnGap: t.columnGap,
|
|
1744
|
+
flexDirection: t.flexDirection,
|
|
1745
|
+
flexWrap: t.flexWrap
|
|
1746
|
+
}));
|
|
1747
|
+
return (r, l) => (o(), u("div", {
|
|
1748
|
+
class: "h-flex",
|
|
1749
|
+
style: c(h(i))
|
|
1750
|
+
}, [
|
|
1751
|
+
b(r.$slots, "default", {}, void 0, !0)
|
|
1752
|
+
], 4));
|
|
1753
|
+
}
|
|
1754
|
+
}), et = /* @__PURE__ */ m(Zt, [["__scopeId", "data-v-c8c463ea"]]);
|
|
1755
|
+
et.install = (e) => {
|
|
1756
|
+
e.component(et.name, et);
|
|
1757
|
+
};
|
|
1758
|
+
const te = (e) => {
|
|
1759
|
+
e.use(T), e.use(W), e.use(tt), e.use(B), e.use(F), e.use(H), e.use(L), e.use(E), e.use(R), e.use(M), e.use(P), e.use(V), e.use(Y), e.use(J), e.use(q), e.use(U), e.use(K), e.use(Q), e.use(X), e.use(Z), e.use(et);
|
|
1760
|
+
}, ne = {
|
|
1761
|
+
install: te
|
|
1693
1762
|
};
|
|
1694
1763
|
export {
|
|
1695
|
-
|
|
1764
|
+
ne as default,
|
|
1696
1765
|
M as hBottom,
|
|
1697
1766
|
U as hButton,
|
|
1698
1767
|
X as hButtonGroup,
|
|
1699
1768
|
E as hCenter,
|
|
1700
|
-
|
|
1769
|
+
F as hChart,
|
|
1701
1770
|
P as hChartTitle,
|
|
1702
|
-
Q as
|
|
1771
|
+
Q as hCounter,
|
|
1703
1772
|
q as hDataLabel,
|
|
1704
|
-
|
|
1773
|
+
et as hFlex,
|
|
1705
1774
|
K as hGrid,
|
|
1706
|
-
|
|
1707
|
-
|
|
1775
|
+
W as hHeader,
|
|
1776
|
+
V as hItemChart,
|
|
1708
1777
|
tt as hLayout,
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1778
|
+
H as hLeft,
|
|
1779
|
+
Y as hList,
|
|
1780
|
+
B as hMain,
|
|
1712
1781
|
T as hPanel,
|
|
1713
1782
|
L as hRight,
|
|
1714
1783
|
Z as hText,
|
|
1715
|
-
R as hTop
|
|
1784
|
+
R as hTop,
|
|
1785
|
+
J as hView
|
|
1716
1786
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("echarts"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","echarts","@vueuse/core"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f.HamsterCharts={},f.Vue,f.echarts,f.VueUse))})(this,function(f,t,J,M){"use strict";function U(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>n[a]})}}return e.default=n,Object.freeze(e)}const Y=U(J),y=(n,e)=>{const a=n.__vccOpts||n;for(const[l,o]of e)a[l]=o;return a},$=y(Object.assign({name:"hPanel",chineseName:"面板",description:"页面主体容器"},{props:{url:{type:String,default:""},position:{type:String,default:"relative",validator:n=>["static","relative","absolute","fixed","sticky"].includes(n)}},setup(n){let e=n,a=t.computed(()=>({position:e.position,backgroundImage:e.url?`url(${e.url})`:"none"}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-panel",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-474190fc"]]);$.install=n=>{n.component($.name,$)};const w=y(Object.assign({name:"hHeader",chineseName:"标题",description:"页面标题容器"},{props:{url:{type:String,default:""},width:{type:String,default:"100%"},height:{type:String,default:"70px"},text:{type:String,default:"测试标题"},fontSize:{type:String,default:"26px"},color:{type:String,default:"#fff"},showText:{type:Boolean,default:!0},textPosition:{type:String,default:"absolute",validator:n=>["static","relative","absolute","fixed","sticky"].includes(n)},textTop:{type:String,default:"50%"},textLeft:{type:String,default:"50%"},textTransform:{type:String,default:"translate(-50%, -50%)"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,backgroundImage:`url( ${e.url})`})),l=t.computed(()=>({color:e.color,fontSize:e.fontSize,position:e.textPosition,top:e.textTop,left:e.textLeft,transform:e.textTransform}));return(o,g)=>(t.openBlock(),t.createElementBlock("div",{class:"h-header",style:t.normalizeStyle(t.unref(a))},[t.unref(e).showText?(t.openBlock(),t.createElementBlock("span",{key:0,style:t.normalizeStyle(t.unref(l))},t.toDisplayString(t.unref(e).text),5)):t.createCommentVNode("",!0),t.renderSlot(o.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-b83cf769"]]);w.install=n=>{n.component(w.name,w)};const B=y(Object.assign({name:"hMain",chineseName:"主内容区",description:"页面主内容工作区"},{props:{height:{type:String,default:"200px"},display:{type:String,default:"flex"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"},padding:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({height:e.height!=="auto"||e.height!=="0"?`calc(100% - ${e.height})`:e.height,display:e.display,columnGap:e.columnGap,rowGap:e.rowGap,padding:e.padding}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-main",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-1025786b"]]);B.install=n=>{n.component(B.name,B)};const z=y(Object.assign({name:"hChart"},{props:{height:{type:String,default:"auto"},showChart:{type:Boolean,default:!0},chartsh:{type:String,default:"auto"},url:{type:String,default:""},flex:{type:Number,default:.3},chartsOption:{type:Object,required:!0}},emits:["chart-ready","chart-update","chart-resize","chart-click","chart-dblclick","chart-mouseover","chart-mouseout"],setup(n,{expose:e,emit:a}){const l=a,o=n,g=t.computed(()=>({backgroundImage:o.url?`url(${o.url})`:"none",flex:o.flex,height:o.height})),h=t.computed(()=>({height:o.chartsh!=="auto"&&o.chartsh!=="0"?`calc(100% - ${o.chartsh})`:o.chartsh})),d=t.ref(null);let p=null;const x=M.useDebounceFn(()=>{p&&(p.resize(),l("chart-resize",{instance:p}))},100),k=()=>{if(!p)return;["click","dblclick","mouseover","mouseout"].forEach(i=>{p.on(i,c=>{l(`chart-${i}`,c)})})},b=()=>{p&&(["click","dblclick","mouseover","mouseout"].forEach(i=>{p.off(i)}),p.dispose(),p=null)},S=()=>{if(b(),!!d.value)try{const r=u(o.chartsOption);p=Y.init(d.value),p.setOption(r,{notMerge:!0}),k(),l("chart-ready",{instance:p,dom:d.value})}catch(r){console.error("ECharts initialization failed:",r)}},u=r=>{if(!r||typeof r!="object")return{series:[]};const i=JSON.parse(JSON.stringify(r));return i.series?Array.isArray(i.series)||(i.series=[i.series]):i.series=[],i.series=i.series.map(c=>{if(!c||typeof c!="object")return{type:"line"};const m={type:"line",...c,type:c.type||"line"};return m.type==="pie"&&m.data&&(m.data=m.data.map(_=>typeof _=="object"&&_!==null?{type:"line",..._,type:_.type||"line"}:_)),m}),i.xAxis?Array.isArray(i.xAxis)?i.xAxis=i.xAxis.map(c=>!c||typeof c!="object"?{type:"category"}:{type:"category",...c,type:c.type||"category"}):typeof i.xAxis=="object"?i.xAxis={type:"category",...i.xAxis,type:i.xAxis.type||"category"}:i.xAxis={type:"category"}:i.xAxis={type:"category"},i.yAxis?Array.isArray(i.yAxis)?i.yAxis=i.yAxis.map(c=>!c||typeof c!="object"?{type:"value"}:{type:"value",...c,type:c.type||"value"}):typeof i.yAxis=="object"?i.yAxis={type:"value",...i.yAxis,type:i.yAxis.type||"value"}:i.yAxis={type:"value"}:i.yAxis={type:"value"},i.legend&&(typeof i.legend=="object"&&!Array.isArray(i.legend)||Array.isArray(i.legend)&&(i.legend={data:i.legend})),i},s=()=>{x()};return t.onMounted(()=>{setTimeout(()=>{S()},0),window.addEventListener("resize",s),M.useResizeObserver(d,r=>{x()})}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",s),b()}),t.watch(()=>o.chartsOption,(r,i)=>{if(r)try{const c=u(r);if(!p){S();return}p.setOption(c,{notMerge:!0}),l("chart-update",{instance:p,option:c})}catch(c){console.error("更新图表配置时出错:",c),console.error(" 错误堆栈:",c.stack)}},{deep:!0}),t.watch(()=>o.showChart,r=>{p&&setTimeout(()=>{p.resize()},0)}),e({getInstance:()=>p,resize:()=>x(),dispatchAction:r=>p==null?void 0:p.dispatchAction(r),dispose:b}),(r,i)=>(t.openBlock(),t.createElementBlock("div",{class:"h-chart",style:t.normalizeStyle(g.value)},[t.renderSlot(r.$slots,"default",{},void 0,!0),t.withDirectives(t.createElementVNode("div",{class:"chart",ref_key:"charts",ref:d,style:t.normalizeStyle(h.value)},null,4),[[t.vShow,o.showChart]])],4))}}),[["__scopeId","data-v-ad5727b9"]]);z.install=n=>{n.component(z.name,z)};const A=y(Object.assign({name:"hLeft"},{props:{width:{type:String,default:"25%"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-left",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-65e91535"]]);A.install=n=>{n.component(A.name,A)};const C=y(Object.assign({name:"hRight"},{props:{width:{type:String,default:"25%"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-right",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-e897c957"]]);C.install=n=>{n.component(C.name,C)};const I=y(Object.assign({name:"hCenter"},{props:{width:{type:String,default:"50%"},height:{type:String,default:"100%"},display:{type:String,default:"block"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-center",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-73b498de"]]);I.install=n=>{n.component(I.name,I)};const E=y(Object.assign({name:"hTop"},{props:{height:{type:String,default:"70%"},display:{type:String,default:"block"},position:{type:String,default:"relative"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,display:e.display,position:e.position}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-top",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-54014ba4"]]);E.install=n=>{n.component(E.name,E)};const j=y(Object.assign({name:"hBottom"},{props:{height:{type:String,default:"30%"},display:{type:String,default:"flex"},gap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"},columnGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,display:e.display,gap:e.gap,rowGap:e.rowGap,columnGap:e.columnGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-bottom",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-086bec2a"]]);j.install=n=>{n.component(j.name,j)};const G=y(Object.assign({name:"hChartTitle"},{props:{fontSize:{type:String,default:"16px"},url:{type:String,default:""},height:{type:String,default:"50px"},paddingLeft:{type:String,default:"auto"},paddingRight:{type:String,default:"auto"},paddingTop:{type:String,default:"auto"},paddingBottom:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,backgroundImage:`url(${e.url})`,fontSize:e.fontSize,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-chart-title",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"title",{},void 0,!0),t.renderSlot(l.$slots,"content",{},void 0,!0)],4))}}),[["__scopeId","data-v-36cebf9b"]]);G.install=n=>{n.component(G.name,G)};const O=y(Object.assign({name:"hItemChart",chineseName:"独立图表",description:"独立的 ECharts 图表容器组件,适用于大屏数据可视化展示"},{props:{height:{type:String,default:"200px"},url:{type:String,default:""},chartsOption:{type:Object,required:!0}},emits:["chart-ready","chart-update","chart-resize","chart-click","chart-dblclick","chart-mouseover","chart-mouseout"],setup(n,{expose:e,emit:a}){const l=a,o=n,g=t.computed(()=>({backgroundImage:o.url?`url(${o.url})`:"none",height:o.height})),h=t.ref(null);let d=null;const p=M.useDebounceFn(()=>{d&&(d.resize(),l("chart-resize",{instance:d}))},100),x=()=>{if(!d)return;["click","dblclick","mouseover","mouseout"].forEach(r=>{d.on(r,i=>{l(`chart-${r}`,i)})})},k=()=>{d&&(["click","dblclick","mouseover","mouseout"].forEach(r=>{d.off(r)}),d.dispose(),d=null)},b=()=>{if(k(),!!h.value)try{const s=S(o.chartsOption);d=Y.init(h.value),d.setOption(s,{notMerge:!0}),x(),l("chart-ready",{instance:d,dom:h.value})}catch(s){console.error("ECharts initialization failed:",s)}},S=s=>{if(!s||typeof s!="object")return{series:[]};const r=JSON.parse(JSON.stringify(s));return r.series?Array.isArray(r.series)||(r.series=[r.series]):r.series=[],r.series=r.series.map(i=>{if(!i||typeof i!="object")return{type:"line"};const c={type:"line",...i,type:i.type||"line"};return c.type==="pie"&&c.data&&(c.data=c.data.map(m=>typeof m=="object"&&m!==null?{value:m.value||0,name:m.name||""}:m)),c}),r.xAxis?Array.isArray(r.xAxis)?r.xAxis=r.xAxis.map(i=>!i||typeof i!="object"?{type:"category"}:{type:"category",...i,type:i.type||"category"}):typeof r.xAxis=="object"?r.xAxis={type:"category",...r.xAxis,type:r.xAxis.type||"category"}:r.xAxis={type:"category"}:r.xAxis={type:"category"},r.yAxis?Array.isArray(r.yAxis)?r.yAxis=r.yAxis.map(i=>!i||typeof i!="object"?{type:"value"}:{type:"value",...i,type:i.type||"value"}):typeof r.yAxis=="object"?r.yAxis={type:"value",...r.yAxis,type:r.yAxis.type||"value"}:r.yAxis={type:"value"}:r.yAxis={type:"value"},r.legend&&(typeof r.legend=="object"&&!Array.isArray(r.legend)||Array.isArray(r.legend)&&(r.legend={data:r.legend})),r},u=()=>{p()};return t.onMounted(()=>{setTimeout(()=>{b()},0),window.addEventListener("resize",u),M.useResizeObserver(h,s=>{p()})}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",u),k()}),t.watch(()=>o.chartsOption,s=>{if(s)try{if(!d){b();return}const r=S(s);d.setOption(r,{notMerge:!0}),l("chart-update",{instance:d,option:r})}catch(r){console.error("更新图表配置时出错:",r)}},{deep:!0}),e({getInstance:()=>d,resize:()=>p(),dispatchAction:s=>d==null?void 0:d.dispatchAction(s),dispose:k}),(s,r)=>(t.openBlock(),t.createElementBlock("div",{class:"h-item-chart",ref_key:"itemCharts",ref:h,style:t.normalizeStyle(g.value)},null,4))}}),[["__scopeId","data-v-7c5da244"]]);O.install=n=>{n.component(O.name,O)};const D=y(Object.assign({name:"hList",chineseName:"滚动列表",description:"支持自动滚动的数据列表组件,适用于大屏数据展示"},{props:{width:{type:String,default:"100%"},height:{type:String,default:"100%"},backgroundColor:{type:String,default:"transparent"},data:{type:Array,default:()=>[]},header:{type:Array,default:()=>[]},showHeader:{type:Boolean,default:!1},enableScroll:{type:Boolean,default:!0},headerHeight:{type:String,default:"40px"},headerBackground:{type:String,default:"rgba(255, 255, 255, 0.1)"},scrollDuration:{type:Number,default:2e3},scrollSpeed:{type:Number,default:500},highlightStyle:{type:Object,default:()=>({background:"rgba(0, 102, 255, 0.3)",color:"#fff",boxShadow:"0 0 10px rgba(0, 102, 255, 0.5)"})}},setup(n,{expose:e}){const a=n,l=t.ref(0),o=t.ref(null),g=t.ref(0),h=t.ref([]),d=t.ref(null),p=t.computed(()=>({width:a.width,height:a.height,backgroundColor:a.backgroundColor,position:"relative",overflow:"hidden"})),x=t.computed(()=>({height:a.headerHeight,display:"flex",alignItems:"center",background:a.headerBackground,position:"absolute",top:0,left:0,zIndex:10,width:"100%"})),k=t.computed(()=>({transform:`translateY(-${l.value*g.value}px)`,transition:`transform ${a.scrollSpeed}ms ease-in-out`,marginTop:a.showHeader?a.headerHeight:"0"})),b=i=>i===o.value?a.highlightStyle:{};t.watch(l,i=>{if(a.data.length>0){const c=i%a.data.length;o.value=c}});let S=null;const u=()=>{!a.enableScroll||a.data.length===0||(clearInterval(S),S=setInterval(()=>{l.value=(l.value+1)%a.data.length},a.scrollDuration))},s=()=>{S&&(clearInterval(S),S=null)},r=()=>{h.value&&h.value[0]&&(g.value=h.value[0].offsetHeight||40)};return t.onMounted(()=>{r(),u(),window.addEventListener("resize",r)}),t.onBeforeUnmount(()=>{s(),window.removeEventListener("resize",r)}),t.watch(()=>a.data,i=>{i.length>0?(l.value=0,o.value=null,setTimeout(()=>{r(),u()},100)):s()},{deep:!0}),t.watch(()=>a.enableScroll,i=>{i?u():(s(),l.value=0)}),e({startScroll:u,stopScroll:s,getCurrentIndex:()=>l.value,scrollTo:i=>{i>=0&&i<a.data.length&&(l.value=i)}}),(i,c)=>(t.openBlock(),t.createElementBlock("div",{class:"h-list",style:t.normalizeStyle(p.value)},[n.showHeader?(t.openBlock(),t.createElementBlock("div",{key:0,class:"list-header",style:t.normalizeStyle(x.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.header,(m,_)=>(t.openBlock(),t.createElementBlock("p",{key:_,class:"header-item"},t.toDisplayString(m),1))),128))],4)):t.createCommentVNode("",!0),n.enableScroll?(t.openBlock(),t.createElementBlock("div",{key:1,class:"scroll-wrapper",style:t.normalizeStyle(k.value)},[t.createElementVNode("div",{class:"data-list",ref_key:"listContainer",ref:d},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.data,(m,_)=>(t.openBlock(),t.createElementBlock("div",{key:_,class:"data-list-item",style:t.normalizeStyle(b(_)),ref_for:!0,ref_key:"listItems",ref:h},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,(q,P)=>(t.openBlock(),t.createElementBlock("p",{key:P,class:"data-item-cell"},t.toDisplayString(q),1))),128))],4))),128))],512)],4)):t.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-937cc59c"]]);D.install=n=>{n.component(D.name,D)};const N=y(Object.assign({name:"hDiy"},{props:{height:{type:String,default:"200px"},display:{type:String,default:"block"},flexDirection:{type:String,default:"column"},rowGap:{type:String,default:"0"},columnGap:{type:String,default:"0"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,display:e.display,flexDirection:e.flexDirection,rowGap:e.rowGap,columnGap:e.columnGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-diy",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-18c6061f"]]);N.install=n=>{n.component(N.name,N)};const T=y(Object.assign({name:"hDataLabel"},{props:{url:{type:String,default:""},num:{type:Number,default:12345},text:{type:String,default:"测试"},someText:{type:String,default:"测试"},show:{type:Boolean,default:!0},width:{type:String,default:"230px"},height:{type:String,default:"54px"},position:{type:String,default:"absolute"},left:{type:String,default:"0"},right:{type:String,default:""},top:{type:String,default:"0"},bottom:{type:String,default:""},zIndex:{type:String,default:"1"},display:{type:String,default:""},border:{type:String,default:"none"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},justifyContent:{type:String,default:"center"},alignItems:{type:String,default:"center"},color:{type:String,default:"#fff"},numFontSize:{type:String,default:"20px"},numFontWeight:{type:String,default:"600"},numColor:{type:String,default:"#fff"},textFontSize:{type:String,default:"10px"},textFontWeight:{type:String,default:""},textColor:{type:String,default:"#fff"},titlelineHeight:{type:String,default:""},titletextAlign:{type:String,default:""},titleFontSize:{type:String,default:"10px"},titleFontWeight:{type:String,default:""},titleColor:{type:String,default:"#fff"},titleShow:{type:Boolean,default:!1}},setup(n){let e=n,a=t.ref({width:e.width,height:e.height,position:e.position,left:e.left,right:e.right,top:e.top,bottom:e.bottom,zIndex:e.zIndex,display:e.display,border:e.border,backgroundImage:`url(${e.url})`,flexDirection:e.flexDirection,justifyContent:e.justifyContent,alignItems:e.alignItems,color:e.color}),l=t.ref({fontSize:e.numFontSize,fontWeight:e.numFontWeight,color:e.numColor}),o=t.ref({fontSize:e.textFontSize,fontWeight:e.textFontWeight,color:e.textColor}),g=t.ref({fontSize:e.titleFontSize,fontWeight:e.titleFontWeight,color:e.titleColor,lineHeight:e.titlelineHeight,textAlign:e.titletextAlign});return(h,d)=>(t.openBlock(),t.createElementBlock("div",{class:"h-data-label",style:t.normalizeStyle(t.unref(a))},[n.show?(t.openBlock(),t.createElementBlock("span",{key:0,class:"h-data-label-num",style:t.normalizeStyle(t.unref(l))},t.toDisplayString(n.num),5)):t.createCommentVNode("",!0),n.show?(t.openBlock(),t.createElementBlock("span",{key:1,class:"h-data-label-text",style:t.normalizeStyle(t.unref(o))},t.toDisplayString(n.text),5)):t.createCommentVNode("",!0),n.titleShow?(t.openBlock(),t.createElementBlock("span",{key:2,class:"h-data-label-title",style:t.normalizeStyle(t.unref(g))},t.toDisplayString(n.someText),5)):t.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-f0ce86db"]]);T.install=n=>{n.component(T.name,T)};const L=y(Object.assign({name:"hButton"},{props:{url:{type:String,default:""},padding:{type:String,default:"5px 15px"},margin:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},fontSize:{type:String,default:""},fontWeight:{type:Number,default:400},color:{type:String,default:""},text:{type:String,default:"测试按钮"}},setup(n){let e=n,a=t.ref({width:e.width,height:e.height,padding:e.padding,margin:e.margin,border:e.border,backgroundImage:`url(${e.url})`,fontSize:e.fontSize,fontWeight:e.fontWeight,color:e.color});return(l,o)=>(t.openBlock(),t.createElementBlock("button",{class:"h-button",style:t.normalizeStyle(t.unref(a))},t.toDisplayString(t.unref(e).text),5))}}),[["__scopeId","data-v-0a183c56"]]);L.install=n=>{n.component(L.name,L)};const F=y(Object.assign({name:"hGrid"},{props:{width:{type:String,default:"100%"},height:{type:String,default:"100%"},gridWidth:{type:String,default:"1fr"},gridHeight:{type:String,default:"1fr"},display:{type:String,default:"grid"},gridTemplateColumns:{type:String,default:"3"},gridTemplateRows:{type:String,default:"2"},iwidth:{type:String,default:""},iheight:{type:String,default:""},idisplay:{type:String,default:"flex"}},setup(n){let e=n,a=t.ref({width:e.width,height:e.height,display:e.display,gridTemplateColumns:`repeat(${e.gridTemplateColumns}, ${e.gridWidth})`,gridTemplateRows:`repeat(${e.gridTemplateRows}, ${e.gridHeight})`}),l=t.ref({width:e.iwidth,height:e.iheight,display:e.idisplay});return(o,g)=>(t.openBlock(),t.createElementBlock("div",{class:"h-grid",style:t.normalizeStyle(t.unref(a))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(6,h=>t.createElementVNode("div",{key:h,class:"h-grid-item",style:t.normalizeStyle(t.unref(l))},g[0]||(g[0]=[t.createElementVNode("div",{class:"h-grid-item-left"},[t.createElementVNode("img",{src:"",alt:""})],-1),t.createElementVNode("div",{class:"h-grid-item-right"},null,-1)]),4)),64)),t.renderSlot(o.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-34e7422b"]]);F.install=n=>{n.component(F.name,F)};const W=y(Object.assign({name:"HCounter",chineseName:"数字计数器",description:"支持老虎机滚动动画的数字计数器组件,每个数字位独立从0滚动到目标值"},{props:{data:{type:[Number,String],default:123456},width:{type:String,default:"auto"},height:{type:String,default:"auto"},backgroundColor:{type:String,default:"transparent"},backgroundImage:{type:String,default:""},display:{type:String,default:"flex"},justifyContent:{type:String,default:"center"},alignItems:{type:String,default:"center"},gap:{type:String,default:"5px"},position:{type:String,default:"relative",validator:n=>["static","relative","absolute","fixed","sticky"].includes(n)},left:{type:String,default:""},right:{type:String,default:""},top:{type:String,default:""},bottom:{type:String,default:""},zIndex:{type:Number,default:1},digitWidth:{type:String,default:""},digitHeight:{type:String,default:""},digitBackgroundImage:{type:String,default:""},digitColor:{type:String,default:"#fff"},digitFontSize:{type:String,default:"32px"},digitFontWeight:{type:String,default:"bold"},digitBackgroundColor:{type:String,default:"transparent"},digitBorderRadius:{type:String,default:"4px"},showSeparator:{type:Boolean,default:!1},separator:{type:String,default:","},decimalPlaces:{type:Number,default:-1},prefix:{type:String,default:""},suffix:{type:String,default:""},enableAnimation:{type:Boolean,default:!0},animationDuration:{type:Number,default:2e3},digitDelay:{type:Number,default:100},transform:{type:String,default:"none"}},setup(n,{expose:e}){const a=n,l=t.ref([]),o=t.ref(!1),g=t.computed(()=>{let u=a.data;a.decimalPlaces>=0&&typeof u=="number"&&(u=u.toFixed(a.decimalPlaces));let s=String(u);if(a.showSeparator&&typeof a.data=="number"){const r=s.split(".");r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,a.separator),s=r.join(".")}return a.prefix&&(s=a.prefix+s),a.suffix&&(s=s+a.suffix),s.split("")}),h=t.computed(()=>a.digitWidth?a.digitWidth:`${(parseInt(a.digitFontSize)||32)*1.2}px`),d=t.computed(()=>a.digitHeight?a.digitHeight:`${(parseInt(a.digitFontSize)||32)*1.5}px`),p=()=>{if(!a.enableAnimation){l.value=g.value.map(()=>0);return}o.value=!0,l.value=g.value.map(()=>0);const u=g.value;u.forEach((s,r)=>{if(isNaN(parseInt(s))){l.value[r]=s;return}const i=parseInt(s),c=r*a.digitDelay,m=a.animationDuration;setTimeout(()=>{let _=0;const q=m/(i+1),P=()=>{_<=i&&(l.value[r]=_,_++,_<=i?setTimeout(P,q):(r===u.length-1||u.slice(r+1).every(X=>isNaN(parseInt(X))))&&(o.value=!1))};P()},c)})},x=u=>{const s=l.value[u];if(isNaN(parseInt(s)))return{transform:"translateY(0)",transition:"none"};const r=parseInt(d.value)||60;return{transform:`translateY(${-parseInt(s)*r}px)`,transition:`transform ${a.animationDuration}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`}},k=t.computed(()=>({width:a.width,height:a.height,backgroundColor:a.backgroundColor,backgroundImage:a.backgroundImage?`url(${a.backgroundImage})`:"none",display:a.display,justifyContent:a.justifyContent,alignItems:a.alignItems,gap:a.gap,position:a.position,left:a.left||void 0,right:a.right||void 0,top:a.top||void 0,bottom:a.bottom||void 0,zIndex:a.zIndex,transform:a.transform||void 0})),b=t.computed(()=>({width:h.value,height:d.value,overflow:"hidden",position:"relative",borderRadius:a.digitBorderRadius,backgroundColor:a.digitBackgroundColor})),S=t.computed(()=>({width:"100%",height:d.value,color:a.digitColor,fontSize:a.digitFontSize,fontWeight:a.digitFontWeight,display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",flexShrink:0,lineHeight:"1"}));return t.watch(()=>a.data,()=>{p()}),t.onMounted(()=>{p()}),e({restart:p,getCurrentValue:()=>l.value.join("")}),(u,s)=>(t.openBlock(),t.createElementBlock("div",{class:"h-counter",style:t.normalizeStyle(k.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,(r,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"counter-digit",style:t.normalizeStyle(b.value)},[t.createElementVNode("div",{class:"digit-scroll",style:t.normalizeStyle(x(i))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(10,c=>t.createElementVNode("div",{key:c-1,class:"digit-item",style:t.normalizeStyle(S.value)},t.toDisplayString(c-1),5)),64))],4)],4))),128)),t.renderSlot(u.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-c03db97b"]]);W.install=n=>{n.component(W.name,W)};const H=y(Object.assign({name:"hButtonGroup"},{props:{width:{type:String,default:""},height:{type:String,default:""},rowGap:{type:String,default:"5px"},columnGap:{type:String,default:"5px"},position:{type:String,default:"relative"},left:{type:String,default:""},right:{type:String,default:""},top:{type:String,default:""},bottom:{type:String,default:""},display:{type:String,default:"flex"},flexWrap:{type:String,default:"nowrap"}},setup(n){let e=n,a=t.ref({position:e.position,left:e.left,right:e.right,top:e.top,bottom:e.bottom,display:e.display,gap:e.gap,rowGap:e.rowGap,columnGap:e.columnGap,flexWrap:e.flexWrap});return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-button-group",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-7bf905ff"]]);H.install=n=>{n.component(H.name,H)};const K={class:"h-text"},R=y(Object.assign({name:"hText",chineseName:"文本",description:"用于显示文本内容"},{props:{text:{type:String,default:"测试文字"},fontSize:{type:String,default:"16px"},color:{type:String,default:"#fff"}},setup(n){let e=n;return(a,l)=>(t.openBlock(),t.createElementBlock("span",K,t.toDisplayString(t.unref(e).text),1))}}),[["__scopeId","data-v-bc52bf83"]]);R.install=n=>{n.component(R.name,R)};const V=y(Object.assign({name:"hLayout",chineseName:"布局",description:"页面布局容器"},{props:{width:{type:String,default:"25%"},height:{type:String,default:"100%"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-layout",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-957ea318"]]);V.install=n=>{n.component(V.name,V)};const Q={install:n=>{n.use($),n.use(w),n.use(V),n.use(B),n.use(z),n.use(A),n.use(C),n.use(I),n.use(E),n.use(j),n.use(G),n.use(O),n.use(D),n.use(N),n.use(T),n.use(L),n.use(F),n.use(W),n.use(H),n.use(R)}};f.default=Q,f.hBottom=j,f.hButton=L,f.hButtonGroup=H,f.hCenter=I,f.hChart=z,f.hChartTitle=G,f.hCounters=W,f.hDataLabel=T,f.hDiy=N,f.hGrid=F,f.hHeader=w,f.hItemChart=O,f.hLayout=V,f.hLeft=A,f.hList=D,f.hMain=B,f.hPanel=$,f.hRight=C,f.hText=R,f.hTop=E,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("echarts"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","echarts","@vueuse/core"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f.HamsterCharts={},f.Vue,f.echarts,f.VueUse))})(this,function(f,t,U,P){"use strict";function K(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>n[a]})}}return e.default=n,Object.freeze(e)}const J=K(U),y=(n,e)=>{const a=n.__vccOpts||n;for(const[l,o]of e)a[l]=o;return a},$=y(Object.assign({name:"hPanel",chineseName:"面板",description:"页面主体容器"},{props:{url:{type:String,default:""},position:{type:String,default:"relative",validator:n=>["static","relative","absolute","fixed","sticky"].includes(n)}},setup(n){let e=n,a=t.computed(()=>({position:e.position,backgroundImage:e.url?`url(${e.url})`:"none"}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-panel",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-474190fc"]]);$.install=n=>{n.component($.name,$)};const w=y(Object.assign({name:"hHeader",chineseName:"标题",description:"页面标题容器"},{props:{url:{type:String,default:""},width:{type:String,default:"100%"},height:{type:String,default:"70px"},text:{type:String,default:"测试标题"},fontSize:{type:String,default:"26px"},color:{type:String,default:"#fff"},showText:{type:Boolean,default:!0},textPosition:{type:String,default:"absolute",validator:n=>["static","relative","absolute","fixed","sticky"].includes(n)},textTop:{type:String,default:"50%"},textLeft:{type:String,default:"50%"},textTransform:{type:String,default:"translate(-50%, -50%)"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,backgroundImage:`url( ${e.url})`})),l=t.computed(()=>({color:e.color,fontSize:e.fontSize,position:e.textPosition,top:e.textTop,left:e.textLeft,transform:e.textTransform}));return(o,g)=>(t.openBlock(),t.createElementBlock("div",{class:"h-header",style:t.normalizeStyle(t.unref(a))},[t.unref(e).showText?(t.openBlock(),t.createElementBlock("span",{key:0,style:t.normalizeStyle(t.unref(l))},t.toDisplayString(t.unref(e).text),5)):t.createCommentVNode("",!0),t.renderSlot(o.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-b83cf769"]]);w.install=n=>{n.component(w.name,w)};const B=y(Object.assign({name:"hMain",chineseName:"主内容区",description:"页面主内容工作区"},{props:{height:{type:String,default:"200px"},display:{type:String,default:"flex"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"},padding:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({height:e.height!=="auto"||e.height!=="0"?`calc(100% - ${e.height})`:e.height,display:e.display,columnGap:e.columnGap,rowGap:e.rowGap,padding:e.padding}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-main",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-1025786b"]]);B.install=n=>{n.component(B.name,B)};const z=y(Object.assign({name:"hChart"},{props:{height:{type:String,default:"auto"},showChart:{type:Boolean,default:!0},chartsh:{type:String,default:"auto"},url:{type:String,default:""},flex:{type:Number,default:.3},chartsOption:{type:Object,required:!0}},emits:["chart-ready","chart-update","chart-resize","chart-click","chart-dblclick","chart-mouseover","chart-mouseout"],setup(n,{expose:e,emit:a}){const l=a,o=n,g=t.computed(()=>({backgroundImage:o.url?`url(${o.url})`:"none",flex:o.flex,height:o.height})),h=t.computed(()=>({height:o.chartsh!=="auto"&&o.chartsh!=="0"?`calc(100% - ${o.chartsh})`:o.chartsh})),d=t.ref(null);let p=null;const b=P.useDebounceFn(()=>{p&&(p.resize(),l("chart-resize",{instance:p}))},100),k=()=>{if(!p)return;["click","dblclick","mouseover","mouseout"].forEach(i=>{p.on(i,c=>{l(`chart-${i}`,c)})})},x=()=>{p&&(["click","dblclick","mouseover","mouseout"].forEach(i=>{p.off(i)}),p.dispose(),p=null)},S=()=>{if(x(),!!d.value)try{const r=u(o.chartsOption);p=J.init(d.value),p.setOption(r,{notMerge:!0}),k(),l("chart-ready",{instance:p,dom:d.value})}catch(r){console.error("ECharts initialization failed:",r)}},u=r=>{if(!r||typeof r!="object")return{series:[]};const i=JSON.parse(JSON.stringify(r));return i.series?Array.isArray(i.series)||(i.series=[i.series]):i.series=[],i.series=i.series.map(c=>{if(!c||typeof c!="object")return{type:"line"};const m={type:"line",...c,type:c.type||"line"};return m.type==="pie"&&m.data&&(m.data=m.data.map(_=>typeof _=="object"&&_!==null?{type:"line",..._,type:_.type||"line"}:_)),m}),i.xAxis?Array.isArray(i.xAxis)?i.xAxis=i.xAxis.map(c=>!c||typeof c!="object"?{type:"category"}:{type:"category",...c,type:c.type||"category"}):typeof i.xAxis=="object"?i.xAxis={type:"category",...i.xAxis,type:i.xAxis.type||"category"}:i.xAxis={type:"category"}:i.xAxis={type:"category"},i.yAxis?Array.isArray(i.yAxis)?i.yAxis=i.yAxis.map(c=>!c||typeof c!="object"?{type:"value"}:{type:"value",...c,type:c.type||"value"}):typeof i.yAxis=="object"?i.yAxis={type:"value",...i.yAxis,type:i.yAxis.type||"value"}:i.yAxis={type:"value"}:i.yAxis={type:"value"},i.legend&&(typeof i.legend=="object"&&!Array.isArray(i.legend)||Array.isArray(i.legend)&&(i.legend={data:i.legend})),i},s=()=>{b()};return t.onMounted(()=>{setTimeout(()=>{S()},0),window.addEventListener("resize",s),P.useResizeObserver(d,r=>{b()})}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",s),x()}),t.watch(()=>o.chartsOption,(r,i)=>{if(r)try{const c=u(r);if(!p){S();return}p.setOption(c,{notMerge:!0}),l("chart-update",{instance:p,option:c})}catch(c){console.error("更新图表配置时出错:",c),console.error(" 错误堆栈:",c.stack)}},{deep:!0}),t.watch(()=>o.showChart,r=>{p&&setTimeout(()=>{p.resize()},0)}),e({getInstance:()=>p,resize:()=>b(),dispatchAction:r=>p==null?void 0:p.dispatchAction(r),dispose:x}),(r,i)=>(t.openBlock(),t.createElementBlock("div",{class:"h-chart",style:t.normalizeStyle(g.value)},[t.renderSlot(r.$slots,"default",{},void 0,!0),t.withDirectives(t.createElementVNode("div",{class:"chart",ref_key:"charts",ref:d,style:t.normalizeStyle(h.value)},null,4),[[t.vShow,o.showChart]])],4))}}),[["__scopeId","data-v-ad5727b9"]]);z.install=n=>{n.component(z.name,z)};const A=y(Object.assign({name:"hLeft"},{props:{width:{type:String,default:"25%"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-left",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-65e91535"]]);A.install=n=>{n.component(A.name,A)};const I=y(Object.assign({name:"hRight"},{props:{width:{type:String,default:"25%"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-right",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-e897c957"]]);I.install=n=>{n.component(I.name,I)};const C=y(Object.assign({name:"hCenter"},{props:{width:{type:String,default:"50%"},height:{type:String,default:"100%"},display:{type:String,default:"block"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-center",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-73b498de"]]);C.install=n=>{n.component(C.name,C)};const E=y(Object.assign({name:"hTop"},{props:{height:{type:String,default:"70%"},display:{type:String,default:"block"},position:{type:String,default:"relative"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,display:e.display,position:e.position}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-top",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-54014ba4"]]);E.install=n=>{n.component(E.name,E)};const G=y(Object.assign({name:"hBottom"},{props:{height:{type:String,default:"30%"},display:{type:String,default:"flex"},gap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"},columnGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,display:e.display,gap:e.gap,rowGap:e.rowGap,columnGap:e.columnGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-bottom",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-086bec2a"]]);G.install=n=>{n.component(G.name,G)};const j=y(Object.assign({name:"hChartTitle"},{props:{fontSize:{type:String,default:"16px"},url:{type:String,default:""},height:{type:String,default:"50px"},paddingLeft:{type:String,default:"auto"},paddingRight:{type:String,default:"auto"},paddingTop:{type:String,default:"auto"},paddingBottom:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({height:e.height,backgroundImage:`url(${e.url})`,fontSize:e.fontSize,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-chart-title",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"title",{},void 0,!0),t.renderSlot(l.$slots,"content",{},void 0,!0)],4))}}),[["__scopeId","data-v-36cebf9b"]]);j.install=n=>{n.component(j.name,j)};const O=y(Object.assign({name:"hItemChart",chineseName:"独立图表",description:"独立的 ECharts 图表容器组件,适用于大屏数据可视化展示"},{props:{height:{type:String,default:"200px"},url:{type:String,default:""},chartsOption:{type:Object,required:!0}},emits:["chart-ready","chart-update","chart-resize","chart-click","chart-dblclick","chart-mouseover","chart-mouseout"],setup(n,{expose:e,emit:a}){const l=a,o=n,g=t.computed(()=>({backgroundImage:o.url?`url(${o.url})`:"none",height:o.height})),h=t.ref(null);let d=null;const p=P.useDebounceFn(()=>{d&&(d.resize(),l("chart-resize",{instance:d}))},100),b=()=>{if(!d)return;["click","dblclick","mouseover","mouseout"].forEach(r=>{d.on(r,i=>{l(`chart-${r}`,i)})})},k=()=>{d&&(["click","dblclick","mouseover","mouseout"].forEach(r=>{d.off(r)}),d.dispose(),d=null)},x=()=>{if(k(),!!h.value)try{const s=S(o.chartsOption);d=J.init(h.value),d.setOption(s,{notMerge:!0}),b(),l("chart-ready",{instance:d,dom:h.value})}catch(s){console.error("ECharts initialization failed:",s)}},S=s=>{if(!s||typeof s!="object")return{series:[]};const r=JSON.parse(JSON.stringify(s));return r.series?Array.isArray(r.series)||(r.series=[r.series]):r.series=[],r.series=r.series.map(i=>{if(!i||typeof i!="object")return{type:"line"};const c={type:"line",...i,type:i.type||"line"};return c.type==="pie"&&c.data&&(c.data=c.data.map(m=>typeof m=="object"&&m!==null?{value:m.value||0,name:m.name||""}:m)),c}),r.xAxis?Array.isArray(r.xAxis)?r.xAxis=r.xAxis.map(i=>!i||typeof i!="object"?{type:"category"}:{type:"category",...i,type:i.type||"category"}):typeof r.xAxis=="object"?r.xAxis={type:"category",...r.xAxis,type:r.xAxis.type||"category"}:r.xAxis={type:"category"}:r.xAxis={type:"category"},r.yAxis?Array.isArray(r.yAxis)?r.yAxis=r.yAxis.map(i=>!i||typeof i!="object"?{type:"value"}:{type:"value",...i,type:i.type||"value"}):typeof r.yAxis=="object"?r.yAxis={type:"value",...r.yAxis,type:r.yAxis.type||"value"}:r.yAxis={type:"value"}:r.yAxis={type:"value"},r.legend&&(typeof r.legend=="object"&&!Array.isArray(r.legend)||Array.isArray(r.legend)&&(r.legend={data:r.legend})),r},u=()=>{p()};return t.onMounted(()=>{setTimeout(()=>{x()},0),window.addEventListener("resize",u),P.useResizeObserver(h,s=>{p()})}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",u),k()}),t.watch(()=>o.chartsOption,s=>{if(s)try{if(!d){x();return}const r=S(s);d.setOption(r,{notMerge:!0}),l("chart-update",{instance:d,option:r})}catch(r){console.error("更新图表配置时出错:",r)}},{deep:!0}),e({getInstance:()=>d,resize:()=>p(),dispatchAction:s=>d==null?void 0:d.dispatchAction(s),dispose:k}),(s,r)=>(t.openBlock(),t.createElementBlock("div",{class:"h-item-chart",ref_key:"itemCharts",ref:h,style:t.normalizeStyle(g.value)},null,4))}}),[["__scopeId","data-v-7c5da244"]]);O.install=n=>{n.component(O.name,O)};const D=y(Object.assign({name:"hList",chineseName:"滚动列表",description:"支持自动滚动的数据列表组件,适用于大屏数据展示"},{props:{width:{type:String,default:"100%"},height:{type:String,default:"100%"},backgroundColor:{type:String,default:"transparent"},data:{type:Array,default:()=>[]},header:{type:Array,default:()=>[]},showHeader:{type:Boolean,default:!1},enableScroll:{type:Boolean,default:!0},headerHeight:{type:String,default:"40px"},headerBackground:{type:String,default:"rgba(255, 255, 255, 0.1)"},scrollDuration:{type:Number,default:2e3},scrollSpeed:{type:Number,default:500},highlightStyle:{type:Object,default:()=>({background:"rgba(0, 102, 255, 0.3)",color:"#fff",boxShadow:"0 0 10px rgba(0, 102, 255, 0.5)"})}},setup(n,{expose:e}){const a=n,l=t.ref(0),o=t.ref(null),g=t.ref(0),h=t.ref([]),d=t.ref(null),p=t.computed(()=>({width:a.width,height:a.height,backgroundColor:a.backgroundColor,position:"relative",overflow:"hidden"})),b=t.computed(()=>({height:a.headerHeight,display:"flex",alignItems:"center",background:a.headerBackground,position:"absolute",top:0,left:0,zIndex:10,width:"100%"})),k=t.computed(()=>({transform:`translateY(-${l.value*g.value}px)`,transition:`transform ${a.scrollSpeed}ms ease-in-out`,marginTop:a.showHeader?a.headerHeight:"0"})),x=i=>i===o.value?a.highlightStyle:{};t.watch(l,i=>{if(a.data.length>0){const c=i%a.data.length;o.value=c}});let S=null;const u=()=>{!a.enableScroll||a.data.length===0||(clearInterval(S),S=setInterval(()=>{l.value=(l.value+1)%a.data.length},a.scrollDuration))},s=()=>{S&&(clearInterval(S),S=null)},r=()=>{h.value&&h.value[0]&&(g.value=h.value[0].offsetHeight||40)};return t.onMounted(()=>{r(),u(),window.addEventListener("resize",r)}),t.onBeforeUnmount(()=>{s(),window.removeEventListener("resize",r)}),t.watch(()=>a.data,i=>{i.length>0?(l.value=0,o.value=null,setTimeout(()=>{r(),u()},100)):s()},{deep:!0}),t.watch(()=>a.enableScroll,i=>{i?u():(s(),l.value=0)}),e({startScroll:u,stopScroll:s,getCurrentIndex:()=>l.value,scrollTo:i=>{i>=0&&i<a.data.length&&(l.value=i)}}),(i,c)=>(t.openBlock(),t.createElementBlock("div",{class:"h-list",style:t.normalizeStyle(p.value)},[n.showHeader?(t.openBlock(),t.createElementBlock("div",{key:0,class:"list-header",style:t.normalizeStyle(b.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.header,(m,_)=>(t.openBlock(),t.createElementBlock("p",{key:_,class:"header-item"},t.toDisplayString(m),1))),128))],4)):t.createCommentVNode("",!0),n.enableScroll?(t.openBlock(),t.createElementBlock("div",{key:1,class:"scroll-wrapper",style:t.normalizeStyle(k.value)},[t.createElementVNode("div",{class:"data-list",ref_key:"listContainer",ref:d},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.data,(m,_)=>(t.openBlock(),t.createElementBlock("div",{key:_,class:"data-list-item",style:t.normalizeStyle(x(_)),ref_for:!0,ref_key:"listItems",ref:h},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,(Y,q)=>(t.openBlock(),t.createElementBlock("p",{key:q,class:"data-item-cell"},t.toDisplayString(Y),1))),128))],4))),128))],512)],4)):t.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-937cc59c"]]);D.install=n=>{n.component(D.name,D)};const N=y(Object.assign({name:"hView"},{props:{height:{type:String,default:"100%"},width:{type:String,default:"50px"},display:{type:String,default:"block"},flexDirection:{type:String,default:"column"},rowGap:{type:String,default:"0"},columnGap:{type:String,default:"0"},flex:{type:String,default:"0.2"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,display:e.display,flexDirection:e.flexDirection,rowGap:e.rowGap,columnGap:e.columnGap,flex:e.flex}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-view",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-490e5736"]]);N.install=n=>{n.component(N.name,N)};const T=y(Object.assign({name:"hDataLabel"},{props:{url:{type:String,default:""},num:{type:Number,default:12345},text:{type:String,default:"测试"},someText:{type:String,default:"测试"},show:{type:Boolean,default:!0},width:{type:String,default:"230px"},height:{type:String,default:"54px"},position:{type:String,default:"absolute"},left:{type:String,default:"0"},right:{type:String,default:""},top:{type:String,default:"0"},bottom:{type:String,default:""},zIndex:{type:String,default:"1"},display:{type:String,default:""},border:{type:String,default:"none"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},justifyContent:{type:String,default:"center"},alignItems:{type:String,default:"center"},color:{type:String,default:"#fff"},numFontSize:{type:String,default:"20px"},numFontWeight:{type:String,default:"600"},numColor:{type:String,default:"#fff"},textFontSize:{type:String,default:"10px"},textFontWeight:{type:String,default:""},textColor:{type:String,default:"#fff"},titlelineHeight:{type:String,default:""},titletextAlign:{type:String,default:""},titleFontSize:{type:String,default:"10px"},titleFontWeight:{type:String,default:""},titleColor:{type:String,default:"#fff"},titleShow:{type:Boolean,default:!1}},setup(n){let e=n,a=t.ref({width:e.width,height:e.height,position:e.position,left:e.left,right:e.right,top:e.top,bottom:e.bottom,zIndex:e.zIndex,display:e.display,border:e.border,backgroundImage:`url(${e.url})`,flexDirection:e.flexDirection,justifyContent:e.justifyContent,alignItems:e.alignItems,color:e.color}),l=t.ref({fontSize:e.numFontSize,fontWeight:e.numFontWeight,color:e.numColor}),o=t.ref({fontSize:e.textFontSize,fontWeight:e.textFontWeight,color:e.textColor}),g=t.ref({fontSize:e.titleFontSize,fontWeight:e.titleFontWeight,color:e.titleColor,lineHeight:e.titlelineHeight,textAlign:e.titletextAlign});return(h,d)=>(t.openBlock(),t.createElementBlock("div",{class:"h-data-label",style:t.normalizeStyle(t.unref(a))},[n.show?(t.openBlock(),t.createElementBlock("span",{key:0,class:"h-data-label-num",style:t.normalizeStyle(t.unref(l))},t.toDisplayString(n.num),5)):t.createCommentVNode("",!0),n.show?(t.openBlock(),t.createElementBlock("span",{key:1,class:"h-data-label-text",style:t.normalizeStyle(t.unref(o))},t.toDisplayString(n.text),5)):t.createCommentVNode("",!0),n.titleShow?(t.openBlock(),t.createElementBlock("span",{key:2,class:"h-data-label-title",style:t.normalizeStyle(t.unref(g))},t.toDisplayString(n.someText),5)):t.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-f0ce86db"]]);T.install=n=>{n.component(T.name,T)};const F=y(Object.assign({name:"hButton"},{props:{url:{type:String,default:""},padding:{type:String,default:"5px 15px"},margin:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},fontSize:{type:String,default:""},fontWeight:{type:Number,default:400},color:{type:String,default:""},text:{type:String,default:"测试按钮"}},setup(n){let e=n,a=t.ref({width:e.width,height:e.height,padding:e.padding,margin:e.margin,border:e.border,backgroundImage:`url(${e.url})`,fontSize:e.fontSize,fontWeight:e.fontWeight,color:e.color});return(l,o)=>(t.openBlock(),t.createElementBlock("button",{class:"h-button",style:t.normalizeStyle(t.unref(a))},t.toDisplayString(t.unref(e).text),5))}}),[["__scopeId","data-v-0a183c56"]]);F.install=n=>{n.component(F.name,F)};const L=y(Object.assign({name:"hGrid"},{props:{width:{type:String,default:"100%"},height:{type:String,default:"100%"},gridWidth:{type:String,default:"1fr"},gridHeight:{type:String,default:"1fr"},display:{type:String,default:"grid"},gridTemplateColumns:{type:String,default:"3"},gridTemplateRows:{type:String,default:"2"},iwidth:{type:String,default:""},iheight:{type:String,default:""},idisplay:{type:String,default:"flex"}},setup(n){let e=n,a=t.ref({width:e.width,height:e.height,display:e.display,gridTemplateColumns:`repeat(${e.gridTemplateColumns}, ${e.gridWidth})`,gridTemplateRows:`repeat(${e.gridTemplateRows}, ${e.gridHeight})`}),l=t.ref({width:e.iwidth,height:e.iheight,display:e.idisplay});return(o,g)=>(t.openBlock(),t.createElementBlock("div",{class:"h-grid",style:t.normalizeStyle(t.unref(a))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(6,h=>t.createElementVNode("div",{key:h,class:"h-grid-item",style:t.normalizeStyle(t.unref(l))},g[0]||(g[0]=[t.createElementVNode("div",{class:"h-grid-item-left"},[t.createElementVNode("img",{src:"",alt:""})],-1),t.createElementVNode("div",{class:"h-grid-item-right"},null,-1)]),4)),64)),t.renderSlot(o.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-34e7422b"]]);L.install=n=>{n.component(L.name,L)};const W=y(Object.assign({name:"hCounter",chineseName:"数字计数器",description:"支持老虎机滚动动画的数字计数器组件,每个数字位独立从0滚动到目标值"},{props:{data:{type:[Number,String],default:123456},width:{type:String,default:"auto"},height:{type:String,default:"auto"},backgroundColor:{type:String,default:"transparent"},backgroundImage:{type:String,default:""},display:{type:String,default:"flex"},justifyContent:{type:String,default:"center"},alignItems:{type:String,default:"center"},gap:{type:String,default:"5px"},position:{type:String,default:"relative",validator:n=>["static","relative","absolute","fixed","sticky"].includes(n)},left:{type:String,default:""},right:{type:String,default:""},top:{type:String,default:""},bottom:{type:String,default:""},zIndex:{type:Number,default:1},digitWidth:{type:String,default:""},digitHeight:{type:String,default:""},digitBackgroundImage:{type:String,default:""},digitColor:{type:String,default:"#fff"},digitFontSize:{type:String,default:"32px"},digitFontWeight:{type:String,default:"bold"},digitBackgroundColor:{type:String,default:"transparent"},digitBorderRadius:{type:String,default:"4px"},showSeparator:{type:Boolean,default:!1},separator:{type:String,default:","},decimalPlaces:{type:Number,default:-1},prefix:{type:String,default:""},suffix:{type:String,default:""},enableAnimation:{type:Boolean,default:!0},animationDuration:{type:Number,default:2e3},digitDelay:{type:Number,default:100},transform:{type:String,default:"none"}},setup(n,{expose:e}){const a=n,l=t.ref([]),o=t.ref(!1),g=t.computed(()=>{let u=a.data;a.decimalPlaces>=0&&typeof u=="number"&&(u=u.toFixed(a.decimalPlaces));let s=String(u);if(a.showSeparator&&typeof a.data=="number"){const r=s.split(".");r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,a.separator),s=r.join(".")}return a.prefix&&(s=a.prefix+s),a.suffix&&(s=s+a.suffix),s.split("")}),h=t.computed(()=>a.digitWidth?a.digitWidth:`${(parseInt(a.digitFontSize)||32)*1.2}px`),d=t.computed(()=>a.digitHeight?a.digitHeight:`${(parseInt(a.digitFontSize)||32)*1.5}px`),p=()=>{if(!a.enableAnimation){l.value=g.value.map(()=>0);return}o.value=!0,l.value=g.value.map(()=>0);const u=g.value;u.forEach((s,r)=>{if(isNaN(parseInt(s))){l.value[r]=s;return}const i=parseInt(s),c=r*a.digitDelay,m=a.animationDuration;setTimeout(()=>{let _=0;const Y=m/(i+1),q=()=>{_<=i&&(l.value[r]=_,_++,_<=i?setTimeout(q,Y):(r===u.length-1||u.slice(r+1).every(Z=>isNaN(parseInt(Z))))&&(o.value=!1))};q()},c)})},b=u=>{const s=l.value[u];if(isNaN(parseInt(s)))return{transform:"translateY(0)",transition:"none"};const r=parseInt(d.value)||60;return{transform:`translateY(${-parseInt(s)*r}px)`,transition:`transform ${a.animationDuration}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`}},k=t.computed(()=>({width:a.width,height:a.height,backgroundColor:a.backgroundColor,backgroundImage:a.backgroundImage?`url(${a.backgroundImage})`:"none",display:a.display,justifyContent:a.justifyContent,alignItems:a.alignItems,gap:a.gap,position:a.position,left:a.left||void 0,right:a.right||void 0,top:a.top||void 0,bottom:a.bottom||void 0,zIndex:a.zIndex,transform:a.transform||void 0})),x=t.computed(()=>({width:h.value,height:d.value,overflow:"hidden",position:"relative",borderRadius:a.digitBorderRadius,backgroundColor:a.digitBackgroundColor})),S=t.computed(()=>({width:"100%",height:d.value,color:a.digitColor,fontSize:a.digitFontSize,fontWeight:a.digitFontWeight,display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",flexShrink:0,lineHeight:"1"}));return t.watch(()=>a.data,()=>{p()}),t.onMounted(()=>{p()}),e({restart:p,getCurrentValue:()=>l.value.join("")}),(u,s)=>(t.openBlock(),t.createElementBlock("div",{class:"h-counter",style:t.normalizeStyle(k.value)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,(r,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"counter-digit",style:t.normalizeStyle(x.value)},[t.createElementVNode("div",{class:"digit-scroll",style:t.normalizeStyle(b(i))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(10,c=>t.createElementVNode("div",{key:c-1,class:"digit-item",style:t.normalizeStyle(S.value)},t.toDisplayString(c-1),5)),64))],4)],4))),128)),t.renderSlot(u.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-fba32a26"]]);W.install=n=>{n.component(W.name,W)};const H=y(Object.assign({name:"hButtonGroup"},{props:{width:{type:String,default:""},height:{type:String,default:""},rowGap:{type:String,default:"5px"},columnGap:{type:String,default:"5px"},position:{type:String,default:"relative"},left:{type:String,default:""},right:{type:String,default:""},top:{type:String,default:""},bottom:{type:String,default:""},display:{type:String,default:"flex"},flexWrap:{type:String,default:"nowrap"}},setup(n){let e=n,a=t.ref({position:e.position,left:e.left,right:e.right,top:e.top,bottom:e.bottom,display:e.display,gap:e.gap,rowGap:e.rowGap,columnGap:e.columnGap,flexWrap:e.flexWrap});return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-button-group",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-7bf905ff"]]);H.install=n=>{n.component(H.name,H)};const Q={class:"h-text"},V=y(Object.assign({name:"hText",chineseName:"文本",description:"用于显示文本内容"},{props:{text:{type:String,default:"测试文字"},fontSize:{type:String,default:"16px"},color:{type:String,default:"#fff"}},setup(n){let e=n;return(a,l)=>(t.openBlock(),t.createElementBlock("span",Q,t.toDisplayString(t.unref(e).text),1))}}),[["__scopeId","data-v-bc52bf83"]]);V.install=n=>{n.component(V.name,V)};const R=y(Object.assign({name:"hLayout",chineseName:"布局",description:"页面布局容器"},{props:{width:{type:String,default:"25%"},height:{type:String,default:"100%"},display:{type:String,default:"flex"},flexDirection:{type:String,default:"column"},columnGap:{type:String,default:"auto"},rowGap:{type:String,default:"auto"}},setup(n){let e=n,a=t.computed(()=>({width:e.width,height:e.height,display:e.display,flexDirection:e.flexDirection,columnGap:e.columnGap,rowGap:e.rowGap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-layout",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-957ea318"]]);R.install=n=>{n.component(R.name,R)};const M=y(Object.assign({name:"hFlex"},{props:{width:{type:String,default:"100%"},height:{type:String,default:"100px"},url:{type:String,default:""},display:{type:String,default:"flex"},flexDirection:{type:String,default:""},flexWrap:{type:String,default:"wrap"},rowGap:{type:String,default:"0"},columnGap:{type:String,default:"0"}},setup(n){let e=n,a=t.computed(()=>({display:e.display,width:e.width,height:e.height,backgroundImage:e.url?`url(${e.url})`:"none",rowGap:e.rowGap,columnGap:e.columnGap,flexDirection:e.flexDirection,flexWrap:e.flexWrap}));return(l,o)=>(t.openBlock(),t.createElementBlock("div",{class:"h-flex",style:t.normalizeStyle(t.unref(a))},[t.renderSlot(l.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-c8c463ea"]]);M.install=n=>{n.component(M.name,M)};const X={install:n=>{n.use($),n.use(w),n.use(R),n.use(B),n.use(z),n.use(A),n.use(I),n.use(C),n.use(E),n.use(G),n.use(j),n.use(O),n.use(D),n.use(N),n.use(T),n.use(F),n.use(L),n.use(W),n.use(H),n.use(V),n.use(M)}};f.default=X,f.hBottom=G,f.hButton=F,f.hButtonGroup=H,f.hCenter=C,f.hChart=z,f.hChartTitle=j,f.hCounter=W,f.hDataLabel=T,f.hFlex=M,f.hGrid=L,f.hHeader=w,f.hItemChart=O,f.hLayout=R,f.hLeft=A,f.hList=D,f.hMain=B,f.hPanel=$,f.hRight=I,f.hText=V,f.hTop=E,f.hView=N,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hamster-charts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
5
|
-
"description": "HamsterCharts
|
|
4
|
+
"version": "0.4.5",
|
|
5
|
+
"description": "HamsterCharts-更新了-新的hFlex组件和组件更换名称",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/hamster-charts.umd.cjs",
|
|
8
8
|
"module": "./dist/hamster-charts.js",
|