rtcpts 0.0.28 → 0.0.30
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/{charts-D_0khFg_.js → charts-DFjKd2J4.js} +264 -214
- package/dist/charts-DpNGi6Y4.cjs +1 -0
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +1 -1
- package/dist/components/j-c-editable-proxy/index.d.ts +9 -8
- package/dist/components/j-c-list-editor/index.d.ts +5 -4
- package/dist/components/j-c-nested-select/NestedMenuItem.d.ts +51 -0
- package/dist/components/j-c-nested-select/index.d.ts +199 -0
- package/dist/components/j-c-nested-select/types.d.ts +27 -0
- package/dist/components/j-c-table/index.d.ts +5 -4
- package/dist/components/j-c-tooltip/index.d.ts +5 -5
- package/dist/components/j-c-tooltip/types.d.ts +125 -7
- package/dist/components/j-c-tooltip-ellipsis/index.d.ts +7 -7
- package/dist/components/j-c-tree-select/index.d.ts +13 -12
- package/dist/components/j-ch-bar/index.d.ts +11 -0
- package/dist/components/j-ch-bar/types.d.ts +42 -0
- package/dist/components/j-ch-bar-line/index.d.ts +11 -0
- package/dist/components/j-ch-bar-line/types.d.ts +42 -0
- package/dist/components/j-ch-bubble/index.d.ts +11 -0
- package/dist/components/j-ch-bubble/types.d.ts +51 -0
- package/dist/components/j-ch-line/index.d.ts +11 -0
- package/dist/components/j-ch-line/types.d.ts +42 -0
- package/dist/components/j-ch-pie-doughnut/index.d.ts +11 -0
- package/dist/components/j-ch-pie-doughnut/types.d.ts +55 -0
- package/dist/components/j-ch-radar/index.d.ts +11 -0
- package/dist/components/j-ch-radar/types.d.ts +42 -0
- package/dist/components/j-q-autocomplete/index.d.ts +5 -4
- package/dist/components/j-q-button/index.d.ts +9 -9
- package/dist/components/j-q-confirm/index.d.ts +9 -8
- package/dist/components/j-q-confirm-dialog/index.d.ts +0 -321
- package/dist/components/j-q-detail-list/index.d.ts +11 -10
- package/dist/components/j-q-form-label/index.d.ts +5 -4
- package/dist/components/j-q-message/index.d.ts +1 -1
- package/dist/components/j-q-option-group/index.d.ts +5 -4
- package/dist/components/j-q-search-form/index.d.ts +9 -8
- package/dist/components/j-q-table/index.d.ts +5 -4
- package/dist/components/j-q-table/pagination.d.ts +19 -20
- package/dist/global.d.ts +74 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/rtcpt-styles.css +1 -1
- package/dist/rtcpt.cjs.js +1 -1
- package/dist/rtcpt.es.js +2405 -2112
- package/dist/utils/chart.d.ts +28 -0
- package/package.json +1 -1
- package/dist/charts-B7LwnjcQ.cjs +0 -1
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Chart as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
for (const [l,
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
}
|
|
1
|
+
import { defineComponent as g, ref as f, onMounted as m, watch as C, createElementBlock as x, openBlock as v, createElementVNode as y, normalizeStyle as k } from "vue";
|
|
2
|
+
import { Chart as $ } from "chart.js/auto";
|
|
3
|
+
const O = (e, s) => {
|
|
4
|
+
const a = e.__vccOpts || e;
|
|
5
|
+
for (const [l, o] of s)
|
|
6
|
+
a[l] = o;
|
|
7
|
+
return a;
|
|
8
|
+
};
|
|
9
|
+
function T(e) {
|
|
10
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
11
|
+
}
|
|
12
|
+
function h(e, s) {
|
|
13
|
+
if (!s)
|
|
14
|
+
return { ...e };
|
|
15
|
+
const a = { ...e };
|
|
16
|
+
for (const l of Object.keys(s)) {
|
|
17
|
+
const o = s[l], c = e[l];
|
|
18
|
+
if (o !== void 0) {
|
|
19
|
+
if (o === null) {
|
|
20
|
+
a[l] = null;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
T(c) && T(o) ? a[l] = h(c, o) : a[l] = o;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return a;
|
|
27
|
+
}
|
|
28
|
+
const q = g({
|
|
9
29
|
name: "JChBar",
|
|
10
30
|
props: {
|
|
11
31
|
labels: {
|
|
@@ -17,53 +37,58 @@ const $ = (t, o) => {
|
|
|
17
37
|
type: Array,
|
|
18
38
|
required: !0
|
|
19
39
|
},
|
|
40
|
+
options: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => ({}),
|
|
43
|
+
required: !1
|
|
44
|
+
},
|
|
20
45
|
height: {
|
|
21
46
|
type: Number,
|
|
22
47
|
default: 300
|
|
23
48
|
}
|
|
24
49
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
50
|
+
setup(e) {
|
|
51
|
+
const s = f(null), a = f(null);
|
|
27
52
|
let l = null;
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
}, c = (
|
|
32
|
-
const { chart:
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
53
|
+
const o = (i) => {
|
|
54
|
+
let t = i.querySelector("div.chartjs-tooltip");
|
|
55
|
+
return t || (t = document.createElement("div"), t.className = "chartjs-tooltip", t.style.background = "#ffffff", t.style.borderRadius = "8px", t.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", t.style.color = "#323232", t.style.opacity = "0", t.style.pointerEvents = "none", t.style.position = "absolute", t.style.transform = "translate(-50%, 0)", t.style.transition = "all .1s ease", t.style.padding = "8px 10px", t.style.font = "12px Open Sans, sans-serif", i.appendChild(t)), t;
|
|
56
|
+
}, c = (i) => {
|
|
57
|
+
const { chart: t, tooltip: r } = i, d = a.value;
|
|
58
|
+
if (!d) return;
|
|
59
|
+
const n = o(d);
|
|
35
60
|
if (r.opacity === 0) {
|
|
36
|
-
|
|
61
|
+
n.style.opacity = "0";
|
|
37
62
|
return;
|
|
38
63
|
}
|
|
39
64
|
if (r.body) {
|
|
40
|
-
const _ = r.title || [],
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
|
|
65
|
+
const _ = r.title || [], A = r.body.map((u) => u.lines);
|
|
66
|
+
if (n.innerHTML = "", _.length) {
|
|
67
|
+
const u = document.createElement("div");
|
|
68
|
+
u.style.fontWeight = "600", u.style.marginBottom = "4px", u.textContent = _.join(" "), n.appendChild(u);
|
|
44
69
|
}
|
|
45
|
-
|
|
70
|
+
A.forEach((u) => {
|
|
46
71
|
const w = document.createElement("div");
|
|
47
|
-
w.textContent =
|
|
72
|
+
w.textContent = u.join(" "), n.appendChild(w);
|
|
48
73
|
});
|
|
49
74
|
}
|
|
50
|
-
const { offsetLeft:
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
var
|
|
75
|
+
const { offsetLeft: b, offsetTop: S } = t.canvas;
|
|
76
|
+
n.style.opacity = "1", n.style.left = `${b + r.caretX}px`, n.style.top = `${S + r.caretY}px`;
|
|
77
|
+
}, p = () => {
|
|
78
|
+
var d;
|
|
54
79
|
l && l.destroy();
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
labels:
|
|
59
|
-
datasets:
|
|
60
|
-
...
|
|
80
|
+
const i = (d = s.value) == null ? void 0 : d.getContext("2d");
|
|
81
|
+
if (!i) return;
|
|
82
|
+
const t = {
|
|
83
|
+
labels: e.labels,
|
|
84
|
+
datasets: e.datasets.map((n) => ({
|
|
85
|
+
...n,
|
|
61
86
|
type: "bar",
|
|
62
|
-
borderWidth:
|
|
63
|
-
borderRadius:
|
|
64
|
-
maxBarThickness:
|
|
87
|
+
borderWidth: n.borderWidth ?? 0,
|
|
88
|
+
borderRadius: n.borderRadius ?? 4,
|
|
89
|
+
maxBarThickness: n.maxBarThickness ?? 34,
|
|
65
90
|
// 确保填充色使用传入的颜色,而不是渐变色
|
|
66
|
-
backgroundColor:
|
|
91
|
+
backgroundColor: n.backgroundColor || "#3A416F"
|
|
67
92
|
}))
|
|
68
93
|
}, r = {
|
|
69
94
|
responsive: !0,
|
|
@@ -123,40 +148,40 @@ const $ = (t, o) => {
|
|
|
123
148
|
}
|
|
124
149
|
}
|
|
125
150
|
};
|
|
126
|
-
l = new
|
|
151
|
+
l = new $(i, {
|
|
127
152
|
type: "bar",
|
|
128
|
-
data:
|
|
129
|
-
options: r
|
|
153
|
+
data: t,
|
|
154
|
+
options: h(r, e.options)
|
|
130
155
|
});
|
|
131
156
|
};
|
|
132
|
-
return
|
|
133
|
-
|
|
134
|
-
}),
|
|
135
|
-
[() =>
|
|
157
|
+
return m(() => {
|
|
158
|
+
p();
|
|
159
|
+
}), C(
|
|
160
|
+
[() => e.labels, () => e.datasets, () => e.height],
|
|
136
161
|
() => {
|
|
137
|
-
|
|
162
|
+
p();
|
|
138
163
|
},
|
|
139
164
|
{ deep: !0 }
|
|
140
165
|
), {
|
|
141
|
-
barChartCanvas:
|
|
142
|
-
chartContainer:
|
|
166
|
+
barChartCanvas: s,
|
|
167
|
+
chartContainer: a
|
|
143
168
|
};
|
|
144
169
|
}
|
|
145
|
-
}),
|
|
170
|
+
}), H = {
|
|
146
171
|
ref: "chartContainer",
|
|
147
172
|
style: { position: "relative" }
|
|
148
173
|
};
|
|
149
|
-
function
|
|
150
|
-
return
|
|
174
|
+
function j(e, s, a, l, o, c) {
|
|
175
|
+
return v(), x("div", H, [
|
|
151
176
|
y("div", null, [
|
|
152
177
|
y("canvas", {
|
|
153
178
|
ref: "barChartCanvas",
|
|
154
|
-
style:
|
|
179
|
+
style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
|
|
155
180
|
}, null, 4)
|
|
156
181
|
])
|
|
157
182
|
], 512);
|
|
158
183
|
}
|
|
159
|
-
const
|
|
184
|
+
const Z = /* @__PURE__ */ O(q, [["render", j], ["__scopeId", "data-v-ab70454a"]]), E = g({
|
|
160
185
|
name: "JChBarLine",
|
|
161
186
|
props: {
|
|
162
187
|
labels: {
|
|
@@ -168,24 +193,29 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
|
|
|
168
193
|
type: Array,
|
|
169
194
|
required: !0
|
|
170
195
|
},
|
|
196
|
+
options: {
|
|
197
|
+
type: Object,
|
|
198
|
+
default: () => ({}),
|
|
199
|
+
required: !1
|
|
200
|
+
},
|
|
171
201
|
height: {
|
|
172
202
|
type: Number,
|
|
173
203
|
default: 300
|
|
174
204
|
// 默认高度 300px
|
|
175
205
|
}
|
|
176
206
|
},
|
|
177
|
-
setup(
|
|
178
|
-
const
|
|
179
|
-
let
|
|
207
|
+
setup(e) {
|
|
208
|
+
const s = f(null);
|
|
209
|
+
let a = null;
|
|
180
210
|
const l = () => {
|
|
181
|
-
var
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
185
|
-
const c =
|
|
186
|
-
let
|
|
187
|
-
const
|
|
188
|
-
return r.type === "line" ?
|
|
211
|
+
var t;
|
|
212
|
+
a && a.destroy();
|
|
213
|
+
const o = (t = s.value) == null ? void 0 : t.getContext("2d");
|
|
214
|
+
if (!o) return;
|
|
215
|
+
const c = e.datasets.map((r) => {
|
|
216
|
+
let d = {};
|
|
217
|
+
const n = r.type === "line" ? "line" : "bar";
|
|
218
|
+
return r.type === "line" ? d = {
|
|
189
219
|
type: "line",
|
|
190
220
|
tension: 0.4,
|
|
191
221
|
pointRadius: 0,
|
|
@@ -194,7 +224,7 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
|
|
|
194
224
|
// 关键:取消填充
|
|
195
225
|
backgroundColor: "transparent",
|
|
196
226
|
maxBarThickness: void 0
|
|
197
|
-
} : r.type === "bar" && (
|
|
227
|
+
} : r.type === "bar" && (d = {
|
|
198
228
|
type: "bar",
|
|
199
229
|
borderWidth: 0,
|
|
200
230
|
borderRadius: 4,
|
|
@@ -203,14 +233,14 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
|
|
|
203
233
|
maxBarThickness: 34,
|
|
204
234
|
backgroundColor: r.backgroundColor
|
|
205
235
|
}), {
|
|
206
|
-
type:
|
|
236
|
+
type: n,
|
|
207
237
|
...r,
|
|
208
|
-
...
|
|
238
|
+
...d
|
|
209
239
|
};
|
|
210
|
-
}),
|
|
211
|
-
labels:
|
|
240
|
+
}), p = {
|
|
241
|
+
labels: e.labels,
|
|
212
242
|
datasets: c
|
|
213
|
-
},
|
|
243
|
+
}, i = {
|
|
214
244
|
responsive: !0,
|
|
215
245
|
maintainAspectRatio: !1,
|
|
216
246
|
plugins: {
|
|
@@ -272,41 +302,41 @@ const X = /* @__PURE__ */ $(A, [["render", H], ["__scopeId", "data-v-63c1cbe6"]]
|
|
|
272
302
|
color: "#969799",
|
|
273
303
|
padding: 10,
|
|
274
304
|
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 },
|
|
275
|
-
callback: (r,
|
|
276
|
-
const
|
|
277
|
-
return
|
|
305
|
+
callback: (r, d) => {
|
|
306
|
+
const n = e.labels[d];
|
|
307
|
+
return n && n.length > 13 ? `${n.slice(0, 13)}...` : n;
|
|
278
308
|
}
|
|
279
309
|
}
|
|
280
310
|
}
|
|
281
311
|
}
|
|
282
312
|
};
|
|
283
|
-
|
|
284
|
-
data:
|
|
285
|
-
options:
|
|
313
|
+
a = new $(o, {
|
|
314
|
+
data: p,
|
|
315
|
+
options: h(i, e.options)
|
|
286
316
|
});
|
|
287
317
|
};
|
|
288
|
-
return
|
|
318
|
+
return m(() => {
|
|
289
319
|
l();
|
|
290
|
-
}),
|
|
291
|
-
[() =>
|
|
320
|
+
}), C(
|
|
321
|
+
[() => e.labels, () => e.datasets, () => e.height],
|
|
292
322
|
() => {
|
|
293
323
|
l();
|
|
294
324
|
},
|
|
295
325
|
{ deep: !0 }
|
|
296
326
|
), {
|
|
297
|
-
mixedChartCanvas:
|
|
327
|
+
mixedChartCanvas: s
|
|
298
328
|
};
|
|
299
329
|
}
|
|
300
330
|
});
|
|
301
|
-
function
|
|
302
|
-
return
|
|
331
|
+
function W(e, s, a, l, o, c) {
|
|
332
|
+
return v(), x("div", null, [
|
|
303
333
|
y("canvas", {
|
|
304
334
|
ref: "mixedChartCanvas",
|
|
305
|
-
style:
|
|
335
|
+
style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
|
|
306
336
|
}, null, 4)
|
|
307
337
|
]);
|
|
308
338
|
}
|
|
309
|
-
const
|
|
339
|
+
const M = /* @__PURE__ */ O(E, [["render", W]]), z = g({
|
|
310
340
|
name: "JChBubble",
|
|
311
341
|
props: {
|
|
312
342
|
labels: {
|
|
@@ -318,27 +348,32 @@ const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
|
|
|
318
348
|
type: Array,
|
|
319
349
|
required: !0
|
|
320
350
|
},
|
|
351
|
+
options: {
|
|
352
|
+
type: Object,
|
|
353
|
+
default: () => ({}),
|
|
354
|
+
required: !1
|
|
355
|
+
},
|
|
321
356
|
height: {
|
|
322
357
|
type: Number,
|
|
323
358
|
default: 300
|
|
324
359
|
}
|
|
325
360
|
},
|
|
326
|
-
setup(
|
|
327
|
-
const
|
|
328
|
-
let
|
|
361
|
+
setup(e) {
|
|
362
|
+
const s = f(null);
|
|
363
|
+
let a = null;
|
|
329
364
|
const l = () => {
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
365
|
+
var i;
|
|
366
|
+
a && a.destroy();
|
|
367
|
+
const o = (i = s.value) == null ? void 0 : i.getContext("2d");
|
|
368
|
+
if (!o) return;
|
|
334
369
|
const c = {
|
|
335
|
-
labels:
|
|
336
|
-
datasets:
|
|
337
|
-
...
|
|
370
|
+
labels: e.labels,
|
|
371
|
+
datasets: e.datasets.map((t) => ({
|
|
372
|
+
...t,
|
|
338
373
|
// 确保类型正确,并设置透明度
|
|
339
|
-
backgroundColor:
|
|
374
|
+
backgroundColor: t.backgroundColor || "rgba(54, 162, 235, 0.6)"
|
|
340
375
|
}))
|
|
341
|
-
},
|
|
376
|
+
}, p = {
|
|
342
377
|
responsive: !0,
|
|
343
378
|
maintainAspectRatio: !1,
|
|
344
379
|
plugins: {
|
|
@@ -361,7 +396,7 @@ const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
|
|
|
361
396
|
borderColor: "#eeeeee",
|
|
362
397
|
padding: 12,
|
|
363
398
|
callbacks: {
|
|
364
|
-
label: (
|
|
399
|
+
label: (t) => `${t.dataset.label || ""}: ${t.formattedValue}`
|
|
365
400
|
}
|
|
366
401
|
}
|
|
367
402
|
},
|
|
@@ -386,42 +421,42 @@ const Y = /* @__PURE__ */ $(E, [["render", q]]), W = b({
|
|
|
386
421
|
color: "#969799",
|
|
387
422
|
padding: 10,
|
|
388
423
|
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 },
|
|
389
|
-
callback: (
|
|
390
|
-
const
|
|
391
|
-
return
|
|
424
|
+
callback: (t, r) => {
|
|
425
|
+
const d = e.labels[r];
|
|
426
|
+
return d ? typeof d == "string" && d.length > 13 ? `${d.slice(0, 13)}...` : d : t;
|
|
392
427
|
}
|
|
393
428
|
}
|
|
394
429
|
}
|
|
395
430
|
}
|
|
396
431
|
};
|
|
397
|
-
|
|
432
|
+
a = new $(o, {
|
|
398
433
|
type: "bubble",
|
|
399
434
|
data: c,
|
|
400
|
-
options:
|
|
435
|
+
options: h(p, e.options)
|
|
401
436
|
});
|
|
402
437
|
};
|
|
403
|
-
return
|
|
438
|
+
return m(() => {
|
|
404
439
|
l();
|
|
405
|
-
}),
|
|
406
|
-
[() =>
|
|
440
|
+
}), C(
|
|
441
|
+
[() => e.labels, () => e.datasets, () => e.height],
|
|
407
442
|
() => {
|
|
408
443
|
l();
|
|
409
444
|
},
|
|
410
445
|
{ deep: !0 }
|
|
411
446
|
), {
|
|
412
|
-
bubbleChartCanvas:
|
|
447
|
+
bubbleChartCanvas: s
|
|
413
448
|
};
|
|
414
449
|
}
|
|
415
450
|
});
|
|
416
|
-
function
|
|
417
|
-
return
|
|
451
|
+
function R(e, s, a, l, o, c) {
|
|
452
|
+
return v(), x("div", null, [
|
|
418
453
|
y("canvas", {
|
|
419
454
|
ref: "bubbleChartCanvas",
|
|
420
|
-
style:
|
|
455
|
+
style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
|
|
421
456
|
}, null, 4)
|
|
422
457
|
]);
|
|
423
458
|
}
|
|
424
|
-
const
|
|
459
|
+
const F = /* @__PURE__ */ O(z, [["render", R]]), L = g({
|
|
425
460
|
name: "JChLine",
|
|
426
461
|
props: {
|
|
427
462
|
labels: {
|
|
@@ -433,24 +468,29 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
|
|
|
433
468
|
type: Array,
|
|
434
469
|
required: !0
|
|
435
470
|
},
|
|
471
|
+
options: {
|
|
472
|
+
type: Object,
|
|
473
|
+
default: () => ({}),
|
|
474
|
+
required: !1
|
|
475
|
+
},
|
|
436
476
|
height: {
|
|
437
477
|
type: Number,
|
|
438
478
|
default: 300
|
|
439
479
|
}
|
|
440
480
|
},
|
|
441
|
-
setup(
|
|
442
|
-
const
|
|
443
|
-
let
|
|
481
|
+
setup(e) {
|
|
482
|
+
const s = f(null);
|
|
483
|
+
let a = null;
|
|
444
484
|
const l = () => {
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
const
|
|
448
|
-
if (!
|
|
485
|
+
var i;
|
|
486
|
+
a && a.destroy();
|
|
487
|
+
const o = (i = s.value) == null ? void 0 : i.getContext("2d");
|
|
488
|
+
if (!o) return;
|
|
449
489
|
const c = {
|
|
450
|
-
labels:
|
|
490
|
+
labels: e.labels,
|
|
451
491
|
// 使用 props.labels
|
|
452
|
-
datasets:
|
|
453
|
-
...
|
|
492
|
+
datasets: e.datasets.map((t) => ({
|
|
493
|
+
...t,
|
|
454
494
|
tension: 0.4,
|
|
455
495
|
pointRadius: 2,
|
|
456
496
|
borderWidth: 3,
|
|
@@ -458,7 +498,7 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
|
|
|
458
498
|
backgroundColor: "transparent",
|
|
459
499
|
type: "line"
|
|
460
500
|
}))
|
|
461
|
-
},
|
|
501
|
+
}, p = {
|
|
462
502
|
responsive: !0,
|
|
463
503
|
maintainAspectRatio: !1,
|
|
464
504
|
plugins: {
|
|
@@ -490,7 +530,7 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
|
|
|
490
530
|
// Optional: Add a border color
|
|
491
531
|
padding: 12,
|
|
492
532
|
callbacks: {
|
|
493
|
-
label: (
|
|
533
|
+
label: (t) => `${t.dataset.label || ""}: ${t.formattedValue}`
|
|
494
534
|
}
|
|
495
535
|
}
|
|
496
536
|
},
|
|
@@ -538,48 +578,48 @@ const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
|
|
|
538
578
|
family: "Open Sans",
|
|
539
579
|
style: "normal"
|
|
540
580
|
},
|
|
541
|
-
callback: (
|
|
542
|
-
const
|
|
543
|
-
return
|
|
581
|
+
callback: (t, r, d) => {
|
|
582
|
+
const n = e.labels[r];
|
|
583
|
+
return n.length > 13 ? `${n.slice(0, 13)}...` : n;
|
|
544
584
|
}
|
|
545
585
|
}
|
|
546
586
|
}
|
|
547
587
|
}
|
|
548
588
|
};
|
|
549
|
-
|
|
589
|
+
a = new $(o, {
|
|
550
590
|
type: "line",
|
|
551
591
|
data: c,
|
|
552
|
-
options:
|
|
592
|
+
options: h(p, e.options)
|
|
553
593
|
});
|
|
554
594
|
};
|
|
555
|
-
return
|
|
595
|
+
return m(() => {
|
|
556
596
|
l();
|
|
557
|
-
}),
|
|
558
|
-
[() =>
|
|
597
|
+
}), C(
|
|
598
|
+
[() => e.labels, () => e.datasets],
|
|
559
599
|
() => {
|
|
560
600
|
l();
|
|
561
601
|
},
|
|
562
602
|
{ deep: !0 }
|
|
563
603
|
), {
|
|
564
|
-
lineChartCanvas:
|
|
604
|
+
lineChartCanvas: s
|
|
565
605
|
};
|
|
566
606
|
}
|
|
567
|
-
}),
|
|
568
|
-
function
|
|
569
|
-
return
|
|
607
|
+
}), B = { ref: "chartContainer" };
|
|
608
|
+
function N(e, s, a, l, o, c) {
|
|
609
|
+
return v(), x("div", B, [
|
|
570
610
|
y("canvas", {
|
|
571
611
|
ref: "lineChartCanvas",
|
|
572
|
-
style:
|
|
612
|
+
style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
|
|
573
613
|
}, null, 4)
|
|
574
614
|
], 512);
|
|
575
615
|
}
|
|
576
|
-
const
|
|
616
|
+
const G = /* @__PURE__ */ O(L, [["render", N], ["__scopeId", "data-v-3bd61468"]]), P = g({
|
|
577
617
|
name: "JChPieDoughnut",
|
|
578
618
|
props: {
|
|
579
619
|
type: {
|
|
580
620
|
type: String,
|
|
581
621
|
required: !0,
|
|
582
|
-
validator: (
|
|
622
|
+
validator: (e) => ["pie", "doughnut"].includes(e)
|
|
583
623
|
},
|
|
584
624
|
labels: {
|
|
585
625
|
type: Array,
|
|
@@ -591,52 +631,57 @@ const M = /* @__PURE__ */ $(R, [["render", B], ["__scopeId", "data-v-c86e6b6d"]]
|
|
|
591
631
|
type: Array,
|
|
592
632
|
required: !0
|
|
593
633
|
},
|
|
634
|
+
options: {
|
|
635
|
+
type: Object,
|
|
636
|
+
default: () => ({}),
|
|
637
|
+
required: !1
|
|
638
|
+
},
|
|
594
639
|
height: {
|
|
595
640
|
type: Number,
|
|
596
641
|
default: 300
|
|
597
642
|
}
|
|
598
643
|
},
|
|
599
|
-
setup(
|
|
600
|
-
const
|
|
644
|
+
setup(e) {
|
|
645
|
+
const s = f(null), a = f(null);
|
|
601
646
|
let l = null;
|
|
602
|
-
const
|
|
603
|
-
let
|
|
604
|
-
return
|
|
605
|
-
}, c = (
|
|
606
|
-
const { chart:
|
|
607
|
-
if (!
|
|
608
|
-
const
|
|
647
|
+
const o = (i) => {
|
|
648
|
+
let t = i.querySelector("div.chartjs-tooltip");
|
|
649
|
+
return t || (t = document.createElement("div"), t.className = "chartjs-tooltip", t.style.background = "#ffffff", t.style.borderRadius = "8px", t.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", t.style.color = "#323232", t.style.opacity = "0", t.style.pointerEvents = "none", t.style.position = "absolute", t.style.transform = "translate(-50%, 0)", t.style.transition = "all .1s ease", t.style.padding = "8px 10px", t.style.font = "12px Open Sans, sans-serif", i.appendChild(t)), t;
|
|
650
|
+
}, c = (i) => {
|
|
651
|
+
const { chart: t, tooltip: r } = i, d = a.value;
|
|
652
|
+
if (!d) return;
|
|
653
|
+
const n = o(d);
|
|
609
654
|
if (r.opacity === 0) {
|
|
610
|
-
|
|
655
|
+
n.style.opacity = "0";
|
|
611
656
|
return;
|
|
612
657
|
}
|
|
613
658
|
if (r.body) {
|
|
614
|
-
const _ = r.title || [],
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
|
|
659
|
+
const _ = r.title || [], A = r.body.map((u) => u.lines);
|
|
660
|
+
if (n.innerHTML = "", _.length) {
|
|
661
|
+
const u = document.createElement("div");
|
|
662
|
+
u.style.fontWeight = "600", u.style.marginBottom = "4px", u.textContent = _.join(" "), n.appendChild(u);
|
|
618
663
|
}
|
|
619
|
-
|
|
664
|
+
A.forEach((u) => {
|
|
620
665
|
const w = document.createElement("div");
|
|
621
|
-
w.textContent =
|
|
666
|
+
w.textContent = u.join(" "), n.appendChild(w);
|
|
622
667
|
});
|
|
623
668
|
}
|
|
624
|
-
const { offsetLeft:
|
|
625
|
-
|
|
626
|
-
},
|
|
627
|
-
var
|
|
669
|
+
const { offsetLeft: b, offsetTop: S } = t.canvas;
|
|
670
|
+
n.style.opacity = "1", n.style.left = `${b + r.caretX}px`, n.style.top = `${S + r.caretY}px`;
|
|
671
|
+
}, p = () => {
|
|
672
|
+
var n;
|
|
628
673
|
l && l.destroy();
|
|
629
|
-
const
|
|
630
|
-
if (!
|
|
631
|
-
const
|
|
632
|
-
labels:
|
|
633
|
-
datasets:
|
|
634
|
-
...
|
|
635
|
-
type:
|
|
674
|
+
const i = (n = s.value) == null ? void 0 : n.getContext("2d");
|
|
675
|
+
if (!i) return;
|
|
676
|
+
const t = e.type, r = {
|
|
677
|
+
labels: e.labels,
|
|
678
|
+
datasets: e.datasets.map((b) => ({
|
|
679
|
+
...b,
|
|
680
|
+
type: t,
|
|
636
681
|
// 关键:动态设置 ChartDataSet 的类型
|
|
637
|
-
borderWidth:
|
|
682
|
+
borderWidth: b.borderWidth ?? 2
|
|
638
683
|
}))
|
|
639
|
-
},
|
|
684
|
+
}, d = {
|
|
640
685
|
responsive: !0,
|
|
641
686
|
maintainAspectRatio: !1,
|
|
642
687
|
plugins: {
|
|
@@ -663,39 +708,39 @@ const M = /* @__PURE__ */ $(R, [["render", B], ["__scopeId", "data-v-c86e6b6d"]]
|
|
|
663
708
|
},
|
|
664
709
|
interaction: { intersect: !1, mode: "index" }
|
|
665
710
|
};
|
|
666
|
-
l = new
|
|
667
|
-
type:
|
|
711
|
+
l = new $(i, {
|
|
712
|
+
type: t,
|
|
668
713
|
data: r,
|
|
669
714
|
// 需要使用 'as any' 来避免 TypeScript 对不同 ChartOptions 类型的严格检查
|
|
670
|
-
options:
|
|
715
|
+
options: h(d, e.options)
|
|
671
716
|
});
|
|
672
717
|
};
|
|
673
|
-
return
|
|
674
|
-
|
|
675
|
-
}),
|
|
676
|
-
[() =>
|
|
718
|
+
return m(() => {
|
|
719
|
+
p();
|
|
720
|
+
}), C(
|
|
721
|
+
[() => e.labels, () => e.datasets, () => e.type],
|
|
677
722
|
() => {
|
|
678
|
-
|
|
723
|
+
p();
|
|
679
724
|
},
|
|
680
725
|
{ deep: !0 }
|
|
681
726
|
), {
|
|
682
|
-
chartCanvas:
|
|
683
|
-
chartContainer:
|
|
727
|
+
chartCanvas: s,
|
|
728
|
+
chartContainer: a
|
|
684
729
|
};
|
|
685
730
|
}
|
|
686
|
-
}),
|
|
731
|
+
}), D = {
|
|
687
732
|
ref: "chartContainer",
|
|
688
733
|
style: { position: "relative" }
|
|
689
734
|
};
|
|
690
|
-
function
|
|
691
|
-
return
|
|
735
|
+
function I(e, s, a, l, o, c) {
|
|
736
|
+
return v(), x("div", D, [
|
|
692
737
|
y("canvas", {
|
|
693
738
|
ref: "chartCanvas",
|
|
694
|
-
style:
|
|
739
|
+
style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
|
|
695
740
|
}, null, 4)
|
|
696
741
|
], 512);
|
|
697
742
|
}
|
|
698
|
-
const
|
|
743
|
+
const K = /* @__PURE__ */ O(P, [["render", I]]), V = g({
|
|
699
744
|
name: "JChRadar",
|
|
700
745
|
props: {
|
|
701
746
|
labels: {
|
|
@@ -707,30 +752,35 @@ const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
|
|
|
707
752
|
type: Array,
|
|
708
753
|
required: !0
|
|
709
754
|
},
|
|
755
|
+
options: {
|
|
756
|
+
type: Object,
|
|
757
|
+
default: () => ({}),
|
|
758
|
+
required: !1
|
|
759
|
+
},
|
|
710
760
|
height: {
|
|
711
761
|
type: Number,
|
|
712
762
|
default: 300
|
|
713
763
|
}
|
|
714
764
|
},
|
|
715
|
-
setup(
|
|
716
|
-
const
|
|
717
|
-
let
|
|
765
|
+
setup(e) {
|
|
766
|
+
const s = f(null);
|
|
767
|
+
let a = null;
|
|
718
768
|
const l = () => {
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
const
|
|
722
|
-
if (!
|
|
769
|
+
var i;
|
|
770
|
+
a && a.destroy();
|
|
771
|
+
const o = (i = s.value) == null ? void 0 : i.getContext("2d");
|
|
772
|
+
if (!o) return;
|
|
723
773
|
const c = {
|
|
724
|
-
labels:
|
|
725
|
-
datasets:
|
|
726
|
-
...
|
|
774
|
+
labels: e.labels,
|
|
775
|
+
datasets: e.datasets.map((t) => ({
|
|
776
|
+
...t,
|
|
727
777
|
type: "radar",
|
|
728
|
-
fill:
|
|
729
|
-
backgroundColor:
|
|
730
|
-
borderColor:
|
|
731
|
-
borderWidth:
|
|
778
|
+
fill: t.fill ?? !0,
|
|
779
|
+
backgroundColor: t.backgroundColor || "rgba(58,65,111,0.2)",
|
|
780
|
+
borderColor: t.borderColor || "rgba(58,65,111,1)",
|
|
781
|
+
borderWidth: t.borderWidth ?? 2
|
|
732
782
|
}))
|
|
733
|
-
},
|
|
783
|
+
}, p = {
|
|
734
784
|
responsive: !0,
|
|
735
785
|
maintainAspectRatio: !1,
|
|
736
786
|
plugins: {
|
|
@@ -759,7 +809,7 @@ const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
|
|
|
759
809
|
borderColor: "#eeeeee",
|
|
760
810
|
padding: 12,
|
|
761
811
|
callbacks: {
|
|
762
|
-
label: (
|
|
812
|
+
label: (t) => `${t.dataset.label || ""}: ${t.formattedValue}`
|
|
763
813
|
}
|
|
764
814
|
}
|
|
765
815
|
},
|
|
@@ -787,40 +837,40 @@ const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
|
|
|
787
837
|
}
|
|
788
838
|
}
|
|
789
839
|
};
|
|
790
|
-
|
|
840
|
+
a = new $(o, {
|
|
791
841
|
type: "radar",
|
|
792
842
|
data: c,
|
|
793
|
-
options:
|
|
843
|
+
options: h(p, e.options)
|
|
794
844
|
});
|
|
795
845
|
};
|
|
796
|
-
return
|
|
846
|
+
return m(() => {
|
|
797
847
|
l();
|
|
798
|
-
}),
|
|
799
|
-
[() =>
|
|
848
|
+
}), C(
|
|
849
|
+
[() => e.labels, () => e.datasets, () => e.height],
|
|
800
850
|
() => {
|
|
801
851
|
l();
|
|
802
852
|
},
|
|
803
853
|
{ deep: !0 }
|
|
804
854
|
), {
|
|
805
|
-
radarChartCanvas:
|
|
855
|
+
radarChartCanvas: s
|
|
806
856
|
};
|
|
807
857
|
}
|
|
808
858
|
});
|
|
809
|
-
function
|
|
810
|
-
return
|
|
859
|
+
function J(e, s, a, l, o, c) {
|
|
860
|
+
return v(), x("div", null, [
|
|
811
861
|
y("canvas", {
|
|
812
862
|
ref: "radarChartCanvas",
|
|
813
|
-
style:
|
|
863
|
+
style: k([{ width: "100%" }, { height: e.height + "px", maxHeight: e.height + "px" }])
|
|
814
864
|
}, null, 4)
|
|
815
865
|
]);
|
|
816
866
|
}
|
|
817
|
-
const
|
|
867
|
+
const Q = /* @__PURE__ */ O(V, [["render", J]]);
|
|
818
868
|
export {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
869
|
+
O as _,
|
|
870
|
+
M as a,
|
|
871
|
+
F as b,
|
|
872
|
+
G as c,
|
|
873
|
+
K as d,
|
|
874
|
+
Q as e,
|
|
875
|
+
Z as i
|
|
826
876
|
};
|