rtcpts 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +68 -0
- package/dist/charts-D71LM320.cjs +1 -0
- package/dist/charts-DFQ978tO.js +826 -0
- package/dist/charts.cjs.js +1 -0
- package/dist/charts.css +1 -0
- package/dist/charts.d.ts +7 -0
- package/dist/charts.es.js +9 -0
- package/dist/components/j-c-copy/index.d.ts +31 -0
- package/dist/components/j-c-duo-list-editor/index.d.ts +102 -0
- package/dist/components/j-c-editable-proxy/index.d.ts +146 -0
- package/dist/components/j-c-fallback/index.d.ts +56 -0
- package/dist/components/j-c-foldable-list/index.d.ts +66 -0
- package/dist/components/j-c-format-lookup/index.d.ts +65 -0
- package/dist/components/j-c-list-editor/index.d.ts +359 -0
- package/dist/components/j-c-more-menu/index.d.ts +220 -0
- package/dist/components/j-c-permission/index.d.ts +59 -0
- package/dist/components/j-c-tabs/index.d.ts +131 -0
- package/dist/components/j-c-title-line/index.d.ts +15 -0
- package/dist/components/j-c-tree/index.d.ts +16 -0
- package/dist/components/j-c-tree-select/index.d.ts +755 -0
- package/dist/components/j-ch-bar/index.d.ts +39 -0
- package/dist/components/j-ch-bar-line/index.d.ts +38 -0
- package/dist/components/j-ch-bubble/index.d.ts +43 -0
- package/dist/components/j-ch-line/index.d.ts +37 -0
- package/dist/components/j-ch-pie-doughnut/index.d.ts +49 -0
- package/dist/components/j-ch-radar/index.d.ts +38 -0
- package/dist/components/j-q-autocomplete/index.d.ts +71 -0
- package/dist/components/j-q-confirm/index.d.ts +48 -0
- package/dist/components/j-q-confirm-dialog/index.d.ts +65 -0
- package/dist/components/j-q-date/index.d.ts +199 -0
- package/dist/components/j-q-datetime/index.d.ts +166 -0
- package/dist/components/j-q-detail-list/index.d.ts +136 -0
- package/dist/components/j-q-dialog/file.d.ts +5 -0
- package/dist/components/j-q-dialog/form-rules.d.ts +17 -0
- package/dist/components/j-q-dialog/form.d.ts +4 -0
- package/dist/components/j-q-dialog/index.d.ts +53 -0
- package/dist/components/j-q-file/download.d.ts +2 -0
- package/dist/components/j-q-file/index.d.ts +82 -0
- package/dist/components/j-q-form-label/index.d.ts +79 -0
- package/dist/components/j-q-input/index.d.ts +194 -0
- package/dist/components/j-q-message/index.d.ts +19 -0
- package/dist/components/j-q-new-value/index.d.ts +117 -0
- package/dist/components/j-q-option-group/index.d.ts +133 -0
- package/dist/components/j-q-popover/index.d.ts +49 -0
- package/dist/components/j-q-search-form/index.d.ts +67 -0
- package/dist/components/j-q-select/index.d.ts +252 -0
- package/dist/components/j-q-table/index.d.ts +251 -0
- package/dist/components/j-q-table/pagination.d.ts +52 -0
- package/dist/components/j-q-tooltip/index.d.ts +44 -0
- package/dist/components/j-q-tooltip/tooltip.d.ts +3 -0
- package/dist/composables/useI18n.d.ts +14 -0
- package/dist/en-US-BfaBFOjR.cjs +1 -0
- package/dist/en-US-Di49EX5C.js +106 -0
- package/dist/i18n/en-US/index.d.ts +59 -0
- package/dist/i18n/index.d.ts +10 -0
- package/dist/i18n/zh-CN/index.d.ts +59 -0
- package/dist/index-BXXYZm9Q.cjs +1 -0
- package/dist/index-CHKEi8Wc.js +49 -0
- package/dist/index-EGZV35Ev.js +49 -0
- package/dist/index-zt6HltZK.cjs +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/rtcpt-styles.css +1 -0
- package/dist/rtcpt-styles.d.ts +1 -0
- package/dist/rtcpt-styles.js +1 -0
- package/dist/rtcpt.cjs.js +1 -0
- package/dist/rtcpt.es.js +5016 -0
- package/dist/types.d.ts +25 -0
- package/dist/utils/custom-svg.d.ts +3 -0
- package/dist/utils/icon-map.d.ts +9 -0
- package/dist/utils/init.d.ts +15 -0
- package/dist/utils/storage.d.ts +3 -0
- package/dist/utils/tool.d.ts +31 -0
- package/dist/zh-CN-BoRskSmh.js +111 -0
- package/dist/zh-CN-DWWgisNr.cjs +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
import { defineComponent as b, ref as f, onMounted as g, watch as m, createElementBlock as C, openBlock as v, createElementVNode as y, normalizeStyle as x } from "vue";
|
|
2
|
+
import { Chart as k } from "chart.js/auto";
|
|
3
|
+
const $ = (t, o) => {
|
|
4
|
+
const n = t.__vccOpts || t;
|
|
5
|
+
for (const [l, d] of o)
|
|
6
|
+
n[l] = d;
|
|
7
|
+
return n;
|
|
8
|
+
}, A = b({
|
|
9
|
+
name: "JChBar",
|
|
10
|
+
props: {
|
|
11
|
+
labels: {
|
|
12
|
+
type: Array,
|
|
13
|
+
default: () => [],
|
|
14
|
+
required: !0
|
|
15
|
+
},
|
|
16
|
+
datasets: {
|
|
17
|
+
type: Array,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
height: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 300
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(t) {
|
|
26
|
+
const o = f(null), n = f(null);
|
|
27
|
+
let l = null;
|
|
28
|
+
const d = (s) => {
|
|
29
|
+
let e = s.querySelector("div.chartjs-tooltip");
|
|
30
|
+
return e || (e = document.createElement("div"), e.className = "chartjs-tooltip", e.style.background = "#ffffff", e.style.borderRadius = "8px", e.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", e.style.color = "#323232", e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.transform = "translate(-50%, 0)", e.style.transition = "all .1s ease", e.style.padding = "8px 10px", e.style.font = "12px Open Sans, sans-serif", s.appendChild(e)), e;
|
|
31
|
+
}, c = (s) => {
|
|
32
|
+
const { chart: e, tooltip: r } = s, i = n.value;
|
|
33
|
+
if (!i) return;
|
|
34
|
+
const a = d(i);
|
|
35
|
+
if (r.opacity === 0) {
|
|
36
|
+
a.style.opacity = "0";
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (r.body) {
|
|
40
|
+
const _ = r.title || [], O = r.body.map((p) => p.lines);
|
|
41
|
+
if (a.innerHTML = "", _.length) {
|
|
42
|
+
const p = document.createElement("div");
|
|
43
|
+
p.style.fontWeight = "600", p.style.marginBottom = "4px", p.textContent = _.join(" "), a.appendChild(p);
|
|
44
|
+
}
|
|
45
|
+
O.forEach((p) => {
|
|
46
|
+
const w = document.createElement("div");
|
|
47
|
+
w.textContent = p.join(" "), a.appendChild(w);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const { offsetLeft: h, offsetTop: S } = e.canvas;
|
|
51
|
+
a.style.opacity = "1", a.style.left = `${h + r.caretX}px`, a.style.top = `${S + r.caretY}px`;
|
|
52
|
+
}, u = () => {
|
|
53
|
+
var i;
|
|
54
|
+
l && l.destroy();
|
|
55
|
+
const s = (i = o.value) == null ? void 0 : i.getContext("2d");
|
|
56
|
+
if (!s) return;
|
|
57
|
+
const e = {
|
|
58
|
+
labels: t.labels,
|
|
59
|
+
datasets: t.datasets.map((a) => ({
|
|
60
|
+
...a,
|
|
61
|
+
type: "bar",
|
|
62
|
+
borderWidth: a.borderWidth ?? 0,
|
|
63
|
+
borderRadius: a.borderRadius ?? 4,
|
|
64
|
+
maxBarThickness: a.maxBarThickness ?? 34,
|
|
65
|
+
// 确保填充色使用传入的颜色,而不是渐变色
|
|
66
|
+
backgroundColor: a.backgroundColor || "#3A416F"
|
|
67
|
+
}))
|
|
68
|
+
}, r = {
|
|
69
|
+
responsive: !0,
|
|
70
|
+
maintainAspectRatio: !1,
|
|
71
|
+
plugins: {
|
|
72
|
+
legend: {
|
|
73
|
+
display: !0,
|
|
74
|
+
// 关键修改:显示 Legend
|
|
75
|
+
position: "bottom",
|
|
76
|
+
labels: {
|
|
77
|
+
color: "#969799",
|
|
78
|
+
pointStyle: "rect",
|
|
79
|
+
padding: 20,
|
|
80
|
+
usePointStyle: !0,
|
|
81
|
+
font: {
|
|
82
|
+
size: 11,
|
|
83
|
+
family: "Open Sans",
|
|
84
|
+
style: "normal",
|
|
85
|
+
lineHeight: 1
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
tooltip: {
|
|
90
|
+
enabled: !1,
|
|
91
|
+
external: c
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
scales: {
|
|
95
|
+
y: {
|
|
96
|
+
border: { display: !1 },
|
|
97
|
+
grid: {
|
|
98
|
+
display: !0,
|
|
99
|
+
drawOnChartArea: !0,
|
|
100
|
+
drawTicks: !1,
|
|
101
|
+
color: "#f5f6fa"
|
|
102
|
+
// 使用实色细线
|
|
103
|
+
},
|
|
104
|
+
ticks: {
|
|
105
|
+
display: !0,
|
|
106
|
+
padding: 10,
|
|
107
|
+
color: "#969799"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
x: {
|
|
111
|
+
// 关键修改:移除 dash: [5, 5],实现实线分割线
|
|
112
|
+
border: { display: !1 },
|
|
113
|
+
grid: {
|
|
114
|
+
display: !1,
|
|
115
|
+
drawOnChartArea: !0,
|
|
116
|
+
drawTicks: !0
|
|
117
|
+
},
|
|
118
|
+
ticks: {
|
|
119
|
+
display: !0,
|
|
120
|
+
color: "#969799",
|
|
121
|
+
padding: 10
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
l = new k(s, {
|
|
127
|
+
type: "bar",
|
|
128
|
+
data: e,
|
|
129
|
+
options: r
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
return g(() => {
|
|
133
|
+
u();
|
|
134
|
+
}), m(
|
|
135
|
+
[() => t.labels, () => t.datasets, () => t.height],
|
|
136
|
+
() => {
|
|
137
|
+
u();
|
|
138
|
+
},
|
|
139
|
+
{ deep: !0 }
|
|
140
|
+
), {
|
|
141
|
+
barChartCanvas: o,
|
|
142
|
+
chartContainer: n
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}), T = {
|
|
146
|
+
ref: "chartContainer",
|
|
147
|
+
style: { position: "relative" }
|
|
148
|
+
};
|
|
149
|
+
function E(t, o, n, l, d, c) {
|
|
150
|
+
return v(), C("div", T, [
|
|
151
|
+
y("div", null, [
|
|
152
|
+
y("canvas", {
|
|
153
|
+
ref: "barChartCanvas",
|
|
154
|
+
style: x([{ width: "100%" }, { height: t.height + "px" }])
|
|
155
|
+
}, null, 4)
|
|
156
|
+
])
|
|
157
|
+
], 512);
|
|
158
|
+
}
|
|
159
|
+
const X = /* @__PURE__ */ $(A, [["render", E], ["__scopeId", "data-v-6215e032"]]), q = b({
|
|
160
|
+
name: "JChBarLine",
|
|
161
|
+
props: {
|
|
162
|
+
labels: {
|
|
163
|
+
type: Array,
|
|
164
|
+
default: () => [],
|
|
165
|
+
required: !0
|
|
166
|
+
},
|
|
167
|
+
datasets: {
|
|
168
|
+
type: Array,
|
|
169
|
+
required: !0
|
|
170
|
+
},
|
|
171
|
+
height: {
|
|
172
|
+
type: Number,
|
|
173
|
+
default: 300
|
|
174
|
+
// 默认高度 300px
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
setup(t) {
|
|
178
|
+
const o = f(null);
|
|
179
|
+
let n = null;
|
|
180
|
+
const l = () => {
|
|
181
|
+
var e;
|
|
182
|
+
n && n.destroy();
|
|
183
|
+
const d = (e = o.value) == null ? void 0 : e.getContext("2d");
|
|
184
|
+
if (!d) return;
|
|
185
|
+
const c = t.datasets.map((r) => {
|
|
186
|
+
let i = {};
|
|
187
|
+
const a = r.type === "line" ? "line" : "bar";
|
|
188
|
+
return r.type === "line" ? i = {
|
|
189
|
+
type: "line",
|
|
190
|
+
tension: 0.4,
|
|
191
|
+
pointRadius: 0,
|
|
192
|
+
borderWidth: 3,
|
|
193
|
+
fill: !1,
|
|
194
|
+
// 关键:取消填充
|
|
195
|
+
backgroundColor: "transparent",
|
|
196
|
+
maxBarThickness: void 0
|
|
197
|
+
} : r.type === "bar" && (i = {
|
|
198
|
+
type: "bar",
|
|
199
|
+
borderWidth: 0,
|
|
200
|
+
borderRadius: 4,
|
|
201
|
+
borderSkipped: !1,
|
|
202
|
+
fill: void 0,
|
|
203
|
+
maxBarThickness: 34,
|
|
204
|
+
backgroundColor: r.backgroundColor
|
|
205
|
+
}), {
|
|
206
|
+
type: a,
|
|
207
|
+
...r,
|
|
208
|
+
...i
|
|
209
|
+
};
|
|
210
|
+
}), u = {
|
|
211
|
+
labels: t.labels,
|
|
212
|
+
datasets: c
|
|
213
|
+
}, s = {
|
|
214
|
+
responsive: !0,
|
|
215
|
+
maintainAspectRatio: !1,
|
|
216
|
+
plugins: {
|
|
217
|
+
legend: {
|
|
218
|
+
display: !0,
|
|
219
|
+
// 关键:显示 Legend
|
|
220
|
+
position: "bottom",
|
|
221
|
+
labels: {
|
|
222
|
+
color: "#969799",
|
|
223
|
+
pointStyle: "rect",
|
|
224
|
+
padding: 20,
|
|
225
|
+
usePointStyle: !0,
|
|
226
|
+
font: {
|
|
227
|
+
size: 11,
|
|
228
|
+
family: "Open Sans",
|
|
229
|
+
style: "normal",
|
|
230
|
+
lineHeight: 1
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
tooltip: {
|
|
235
|
+
borderWidth: 1,
|
|
236
|
+
backgroundColor: "white",
|
|
237
|
+
titleColor: "black",
|
|
238
|
+
bodyColor: "black",
|
|
239
|
+
borderColor: "#eeeeee",
|
|
240
|
+
padding: 12,
|
|
241
|
+
callbacks: {
|
|
242
|
+
label: (r) => `${r.dataset.label || ""}: ${r.formattedValue}`
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
interaction: {
|
|
247
|
+
intersect: !1,
|
|
248
|
+
mode: "index"
|
|
249
|
+
},
|
|
250
|
+
scales: {
|
|
251
|
+
y: {
|
|
252
|
+
beginAtZero: !0,
|
|
253
|
+
border: { display: !1 },
|
|
254
|
+
grid: {
|
|
255
|
+
display: !0,
|
|
256
|
+
drawOnChartArea: !0,
|
|
257
|
+
drawTicks: !1,
|
|
258
|
+
color: "#f5f6fa"
|
|
259
|
+
},
|
|
260
|
+
ticks: {
|
|
261
|
+
display: !0,
|
|
262
|
+
padding: 10,
|
|
263
|
+
color: "#969799",
|
|
264
|
+
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 }
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
x: {
|
|
268
|
+
border: { display: !1 },
|
|
269
|
+
grid: { display: !1, drawOnChartArea: !0, drawTicks: !0 },
|
|
270
|
+
ticks: {
|
|
271
|
+
display: !0,
|
|
272
|
+
color: "#969799",
|
|
273
|
+
padding: 10,
|
|
274
|
+
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 },
|
|
275
|
+
callback: (r, i) => {
|
|
276
|
+
const a = t.labels[i];
|
|
277
|
+
return a && a.length > 13 ? `${a.slice(0, 13)}...` : a;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
n = new k(d, {
|
|
284
|
+
data: u,
|
|
285
|
+
options: s
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
return g(() => {
|
|
289
|
+
l();
|
|
290
|
+
}), m(
|
|
291
|
+
[() => t.labels, () => t.datasets, () => t.height],
|
|
292
|
+
() => {
|
|
293
|
+
l();
|
|
294
|
+
},
|
|
295
|
+
{ deep: !0 }
|
|
296
|
+
), {
|
|
297
|
+
mixedChartCanvas: o
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
function H(t, o, n, l, d, c) {
|
|
302
|
+
return v(), C("div", null, [
|
|
303
|
+
y("canvas", {
|
|
304
|
+
ref: "mixedChartCanvas",
|
|
305
|
+
style: x([{ width: "100%" }, { height: t.height + "px" }])
|
|
306
|
+
}, null, 4)
|
|
307
|
+
]);
|
|
308
|
+
}
|
|
309
|
+
const Y = /* @__PURE__ */ $(q, [["render", H]]), W = b({
|
|
310
|
+
name: "JChBubble",
|
|
311
|
+
props: {
|
|
312
|
+
labels: {
|
|
313
|
+
type: Array,
|
|
314
|
+
default: () => [],
|
|
315
|
+
required: !1
|
|
316
|
+
},
|
|
317
|
+
datasets: {
|
|
318
|
+
type: Array,
|
|
319
|
+
required: !0
|
|
320
|
+
},
|
|
321
|
+
height: {
|
|
322
|
+
type: Number,
|
|
323
|
+
default: 300
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
setup(t) {
|
|
327
|
+
const o = f(null);
|
|
328
|
+
let n = null;
|
|
329
|
+
const l = () => {
|
|
330
|
+
var s;
|
|
331
|
+
n && n.destroy();
|
|
332
|
+
const d = (s = o.value) == null ? void 0 : s.getContext("2d");
|
|
333
|
+
if (!d) return;
|
|
334
|
+
const c = {
|
|
335
|
+
labels: t.labels,
|
|
336
|
+
datasets: t.datasets.map((e) => ({
|
|
337
|
+
...e,
|
|
338
|
+
// 确保类型正确,并设置透明度
|
|
339
|
+
backgroundColor: e.backgroundColor || "rgba(54, 162, 235, 0.6)"
|
|
340
|
+
}))
|
|
341
|
+
}, u = {
|
|
342
|
+
responsive: !0,
|
|
343
|
+
maintainAspectRatio: !1,
|
|
344
|
+
plugins: {
|
|
345
|
+
legend: {
|
|
346
|
+
display: !0,
|
|
347
|
+
position: "bottom",
|
|
348
|
+
labels: {
|
|
349
|
+
color: "#969799",
|
|
350
|
+
pointStyle: "rect",
|
|
351
|
+
padding: 20,
|
|
352
|
+
usePointStyle: !0,
|
|
353
|
+
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 1 }
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
tooltip: {
|
|
357
|
+
borderWidth: 1,
|
|
358
|
+
backgroundColor: "white",
|
|
359
|
+
titleColor: "black",
|
|
360
|
+
bodyColor: "black",
|
|
361
|
+
borderColor: "#eeeeee",
|
|
362
|
+
padding: 12,
|
|
363
|
+
callbacks: {
|
|
364
|
+
label: (e) => `${e.dataset.label || ""}: ${e.formattedValue}`
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
interaction: { intersect: !1, mode: "index" },
|
|
369
|
+
scales: {
|
|
370
|
+
y: {
|
|
371
|
+
beginAtZero: !0,
|
|
372
|
+
border: { display: !1 },
|
|
373
|
+
grid: { display: !0, drawOnChartArea: !0, drawTicks: !1, color: "#f5f6fa" },
|
|
374
|
+
ticks: {
|
|
375
|
+
display: !0,
|
|
376
|
+
padding: 10,
|
|
377
|
+
color: "#969799",
|
|
378
|
+
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 }
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
x: {
|
|
382
|
+
border: { display: !1 },
|
|
383
|
+
grid: { display: !0, drawOnChartArea: !0, drawTicks: !0, color: "#f5f6fa" },
|
|
384
|
+
ticks: {
|
|
385
|
+
display: !0,
|
|
386
|
+
color: "#969799",
|
|
387
|
+
padding: 10,
|
|
388
|
+
font: { size: 11, family: "Open Sans", style: "normal", lineHeight: 2 },
|
|
389
|
+
callback: (e, r) => {
|
|
390
|
+
const i = t.labels[r];
|
|
391
|
+
return i ? typeof i == "string" && i.length > 13 ? `${i.slice(0, 13)}...` : i : e;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
n = new k(d, {
|
|
398
|
+
type: "bubble",
|
|
399
|
+
data: c,
|
|
400
|
+
options: u
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
return g(() => {
|
|
404
|
+
l();
|
|
405
|
+
}), m(
|
|
406
|
+
[() => t.labels, () => t.datasets, () => t.height],
|
|
407
|
+
() => {
|
|
408
|
+
l();
|
|
409
|
+
},
|
|
410
|
+
{ deep: !0 }
|
|
411
|
+
), {
|
|
412
|
+
bubbleChartCanvas: o
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
function z(t, o, n, l, d, c) {
|
|
417
|
+
return v(), C("div", null, [
|
|
418
|
+
y("canvas", {
|
|
419
|
+
ref: "bubbleChartCanvas",
|
|
420
|
+
style: x([{ width: "100%" }, { height: t.height + "px" }])
|
|
421
|
+
}, null, 4)
|
|
422
|
+
]);
|
|
423
|
+
}
|
|
424
|
+
const Z = /* @__PURE__ */ $(W, [["render", z]]), R = b({
|
|
425
|
+
name: "JChLine",
|
|
426
|
+
props: {
|
|
427
|
+
labels: {
|
|
428
|
+
type: Array,
|
|
429
|
+
default: () => [],
|
|
430
|
+
required: !0
|
|
431
|
+
},
|
|
432
|
+
datasets: {
|
|
433
|
+
type: Array,
|
|
434
|
+
required: !0
|
|
435
|
+
},
|
|
436
|
+
height: {
|
|
437
|
+
type: Number,
|
|
438
|
+
default: 300
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
setup(t) {
|
|
442
|
+
const o = f(null);
|
|
443
|
+
let n = null;
|
|
444
|
+
const l = () => {
|
|
445
|
+
var s;
|
|
446
|
+
n && n.destroy();
|
|
447
|
+
const d = (s = o.value) == null ? void 0 : s.getContext("2d");
|
|
448
|
+
if (!d) return;
|
|
449
|
+
const c = {
|
|
450
|
+
labels: t.labels,
|
|
451
|
+
// 使用 props.labels
|
|
452
|
+
datasets: t.datasets.map((e) => ({
|
|
453
|
+
...e,
|
|
454
|
+
tension: 0.4,
|
|
455
|
+
pointRadius: 2,
|
|
456
|
+
borderWidth: 3,
|
|
457
|
+
fill: !1,
|
|
458
|
+
backgroundColor: "transparent",
|
|
459
|
+
type: "line"
|
|
460
|
+
}))
|
|
461
|
+
}, u = {
|
|
462
|
+
responsive: !0,
|
|
463
|
+
maintainAspectRatio: !1,
|
|
464
|
+
plugins: {
|
|
465
|
+
legend: {
|
|
466
|
+
display: !0,
|
|
467
|
+
position: "bottom",
|
|
468
|
+
labels: {
|
|
469
|
+
color: "#969799",
|
|
470
|
+
pointStyle: "line",
|
|
471
|
+
padding: 20,
|
|
472
|
+
usePointStyle: !0,
|
|
473
|
+
font: {
|
|
474
|
+
size: 11,
|
|
475
|
+
family: "Open Sans",
|
|
476
|
+
style: "normal",
|
|
477
|
+
lineHeight: 1
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
tooltip: {
|
|
482
|
+
borderWidth: 1,
|
|
483
|
+
backgroundColor: "white",
|
|
484
|
+
// Set the background color to white
|
|
485
|
+
titleColor: "black",
|
|
486
|
+
// Set the title color to black
|
|
487
|
+
bodyColor: "black",
|
|
488
|
+
// Set the body color to black
|
|
489
|
+
borderColor: "#eeeeee",
|
|
490
|
+
// Optional: Add a border color
|
|
491
|
+
padding: 12,
|
|
492
|
+
callbacks: {
|
|
493
|
+
label: (e) => `${e.dataset.label || ""}: ${e.formattedValue}`
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
interaction: { intersect: !1, mode: "index" },
|
|
498
|
+
scales: {
|
|
499
|
+
y: {
|
|
500
|
+
beginAtZero: !0,
|
|
501
|
+
border: {
|
|
502
|
+
display: !1
|
|
503
|
+
},
|
|
504
|
+
grid: {
|
|
505
|
+
display: !0,
|
|
506
|
+
drawOnChartArea: !0,
|
|
507
|
+
drawTicks: !1,
|
|
508
|
+
color: "#f5f6fa"
|
|
509
|
+
},
|
|
510
|
+
ticks: {
|
|
511
|
+
display: !0,
|
|
512
|
+
padding: 10,
|
|
513
|
+
color: "#969799",
|
|
514
|
+
font: {
|
|
515
|
+
size: 11,
|
|
516
|
+
family: "Open Sans",
|
|
517
|
+
style: "normal",
|
|
518
|
+
lineHeight: 2
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
x: {
|
|
523
|
+
border: {
|
|
524
|
+
display: !1,
|
|
525
|
+
dash: [5, 5]
|
|
526
|
+
},
|
|
527
|
+
grid: {
|
|
528
|
+
display: !1,
|
|
529
|
+
drawOnChartArea: !1,
|
|
530
|
+
drawTicks: !1
|
|
531
|
+
},
|
|
532
|
+
ticks: {
|
|
533
|
+
display: !0,
|
|
534
|
+
color: "#969799",
|
|
535
|
+
padding: 20,
|
|
536
|
+
font: {
|
|
537
|
+
size: 10,
|
|
538
|
+
family: "Open Sans",
|
|
539
|
+
style: "normal"
|
|
540
|
+
},
|
|
541
|
+
callback: (e, r, i) => {
|
|
542
|
+
const a = t.labels[r];
|
|
543
|
+
return a.length > 13 ? `${a.slice(0, 13)}...` : a;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
n = new k(d, {
|
|
550
|
+
type: "line",
|
|
551
|
+
data: c,
|
|
552
|
+
options: u
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
return g(() => {
|
|
556
|
+
l();
|
|
557
|
+
}), m(
|
|
558
|
+
[() => t.labels, () => t.datasets],
|
|
559
|
+
() => {
|
|
560
|
+
l();
|
|
561
|
+
},
|
|
562
|
+
{ deep: !0 }
|
|
563
|
+
), {
|
|
564
|
+
lineChartCanvas: o
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
}), L = { ref: "chartContainer" };
|
|
568
|
+
function B(t, o, n, l, d, c) {
|
|
569
|
+
return v(), C("div", L, [
|
|
570
|
+
y("canvas", {
|
|
571
|
+
ref: "lineChartCanvas",
|
|
572
|
+
style: x([{ width: "100%" }, { height: t.height + "px" }])
|
|
573
|
+
}, null, 4)
|
|
574
|
+
], 512);
|
|
575
|
+
}
|
|
576
|
+
const M = /* @__PURE__ */ $(R, [["render", B], ["__scopeId", "data-v-00b6cb2b"]]), N = b({
|
|
577
|
+
name: "JChPieDoughnut",
|
|
578
|
+
props: {
|
|
579
|
+
type: {
|
|
580
|
+
type: String,
|
|
581
|
+
required: !0,
|
|
582
|
+
validator: (t) => ["pie", "doughnut"].includes(t)
|
|
583
|
+
},
|
|
584
|
+
labels: {
|
|
585
|
+
type: Array,
|
|
586
|
+
default: () => [],
|
|
587
|
+
required: !0
|
|
588
|
+
},
|
|
589
|
+
// 数据集类型统一为 ChartType
|
|
590
|
+
datasets: {
|
|
591
|
+
type: Array,
|
|
592
|
+
required: !0
|
|
593
|
+
},
|
|
594
|
+
height: {
|
|
595
|
+
type: Number,
|
|
596
|
+
default: 300
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
setup(t) {
|
|
600
|
+
const o = f(null), n = f(null);
|
|
601
|
+
let l = null;
|
|
602
|
+
const d = (s) => {
|
|
603
|
+
let e = s.querySelector("div.chartjs-tooltip");
|
|
604
|
+
return e || (e = document.createElement("div"), e.className = "chartjs-tooltip", e.style.background = "#ffffff", e.style.borderRadius = "8px", e.style.boxShadow = "0 4px 12px rgba(0, 0, 0, 0.15)", e.style.color = "#323232", e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.transform = "translate(-50%, 0)", e.style.transition = "all .1s ease", e.style.padding = "8px 10px", e.style.font = "12px Open Sans, sans-serif", s.appendChild(e)), e;
|
|
605
|
+
}, c = (s) => {
|
|
606
|
+
const { chart: e, tooltip: r } = s, i = n.value;
|
|
607
|
+
if (!i) return;
|
|
608
|
+
const a = d(i);
|
|
609
|
+
if (r.opacity === 0) {
|
|
610
|
+
a.style.opacity = "0";
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
if (r.body) {
|
|
614
|
+
const _ = r.title || [], O = r.body.map((p) => p.lines);
|
|
615
|
+
if (a.innerHTML = "", _.length) {
|
|
616
|
+
const p = document.createElement("div");
|
|
617
|
+
p.style.fontWeight = "600", p.style.marginBottom = "4px", p.textContent = _.join(" "), a.appendChild(p);
|
|
618
|
+
}
|
|
619
|
+
O.forEach((p) => {
|
|
620
|
+
const w = document.createElement("div");
|
|
621
|
+
w.textContent = p.join(" "), a.appendChild(w);
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
const { offsetLeft: h, offsetTop: S } = e.canvas;
|
|
625
|
+
a.style.opacity = "1", a.style.left = `${h + r.caretX}px`, a.style.top = `${S + r.caretY}px`;
|
|
626
|
+
}, u = () => {
|
|
627
|
+
var a;
|
|
628
|
+
l && l.destroy();
|
|
629
|
+
const s = (a = o.value) == null ? void 0 : a.getContext("2d");
|
|
630
|
+
if (!s) return;
|
|
631
|
+
const e = t.type, r = {
|
|
632
|
+
labels: t.labels,
|
|
633
|
+
datasets: t.datasets.map((h) => ({
|
|
634
|
+
...h,
|
|
635
|
+
type: e,
|
|
636
|
+
// 关键:动态设置 ChartDataSet 的类型
|
|
637
|
+
borderWidth: h.borderWidth ?? 2
|
|
638
|
+
}))
|
|
639
|
+
}, i = {
|
|
640
|
+
responsive: !0,
|
|
641
|
+
maintainAspectRatio: !1,
|
|
642
|
+
plugins: {
|
|
643
|
+
legend: {
|
|
644
|
+
display: !0,
|
|
645
|
+
position: "bottom",
|
|
646
|
+
labels: {
|
|
647
|
+
color: "#969799",
|
|
648
|
+
pointStyle: "rect",
|
|
649
|
+
padding: 20,
|
|
650
|
+
usePointStyle: !0,
|
|
651
|
+
font: {
|
|
652
|
+
size: 11,
|
|
653
|
+
family: "Open Sans",
|
|
654
|
+
style: "normal",
|
|
655
|
+
lineHeight: 1
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
tooltip: {
|
|
660
|
+
enabled: !1,
|
|
661
|
+
external: c
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
interaction: { intersect: !1, mode: "index" }
|
|
665
|
+
};
|
|
666
|
+
l = new k(s, {
|
|
667
|
+
type: e,
|
|
668
|
+
data: r,
|
|
669
|
+
// 需要使用 'as any' 来避免 TypeScript 对不同 ChartOptions 类型的严格检查
|
|
670
|
+
options: i
|
|
671
|
+
});
|
|
672
|
+
};
|
|
673
|
+
return g(() => {
|
|
674
|
+
u();
|
|
675
|
+
}), m(
|
|
676
|
+
[() => t.labels, () => t.datasets, () => t.type],
|
|
677
|
+
() => {
|
|
678
|
+
u();
|
|
679
|
+
},
|
|
680
|
+
{ deep: !0 }
|
|
681
|
+
), {
|
|
682
|
+
chartCanvas: o,
|
|
683
|
+
chartContainer: n
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
}), j = {
|
|
687
|
+
ref: "chartContainer",
|
|
688
|
+
style: { position: "relative" }
|
|
689
|
+
};
|
|
690
|
+
function D(t, o, n, l, d, c) {
|
|
691
|
+
return v(), C("div", j, [
|
|
692
|
+
y("canvas", {
|
|
693
|
+
ref: "chartCanvas",
|
|
694
|
+
style: x([{ width: "100%" }, { height: t.height + "px" }])
|
|
695
|
+
}, null, 4)
|
|
696
|
+
], 512);
|
|
697
|
+
}
|
|
698
|
+
const F = /* @__PURE__ */ $(N, [["render", D]]), I = b({
|
|
699
|
+
name: "JChRadar",
|
|
700
|
+
props: {
|
|
701
|
+
labels: {
|
|
702
|
+
type: Array,
|
|
703
|
+
default: () => [],
|
|
704
|
+
required: !0
|
|
705
|
+
},
|
|
706
|
+
datasets: {
|
|
707
|
+
type: Array,
|
|
708
|
+
required: !0
|
|
709
|
+
},
|
|
710
|
+
height: {
|
|
711
|
+
type: Number,
|
|
712
|
+
default: 300
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
setup(t) {
|
|
716
|
+
const o = f(null);
|
|
717
|
+
let n = null;
|
|
718
|
+
const l = () => {
|
|
719
|
+
var s;
|
|
720
|
+
n && n.destroy();
|
|
721
|
+
const d = (s = o.value) == null ? void 0 : s.getContext("2d");
|
|
722
|
+
if (!d) return;
|
|
723
|
+
const c = {
|
|
724
|
+
labels: t.labels,
|
|
725
|
+
datasets: t.datasets.map((e) => ({
|
|
726
|
+
...e,
|
|
727
|
+
type: "radar",
|
|
728
|
+
fill: e.fill ?? !0,
|
|
729
|
+
backgroundColor: e.backgroundColor || "rgba(58,65,111,0.2)",
|
|
730
|
+
borderColor: e.borderColor || "rgba(58,65,111,1)",
|
|
731
|
+
borderWidth: e.borderWidth ?? 2
|
|
732
|
+
}))
|
|
733
|
+
}, u = {
|
|
734
|
+
responsive: !0,
|
|
735
|
+
maintainAspectRatio: !1,
|
|
736
|
+
plugins: {
|
|
737
|
+
legend: {
|
|
738
|
+
display: !0,
|
|
739
|
+
// 关键修改:显示 Legend,这对于雷达图非常重要
|
|
740
|
+
position: "bottom",
|
|
741
|
+
labels: {
|
|
742
|
+
color: "#969799",
|
|
743
|
+
pointStyle: "rect",
|
|
744
|
+
padding: 20,
|
|
745
|
+
usePointStyle: !0,
|
|
746
|
+
font: {
|
|
747
|
+
size: 11,
|
|
748
|
+
family: "Open Sans",
|
|
749
|
+
style: "normal",
|
|
750
|
+
lineHeight: 1
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
tooltip: {
|
|
755
|
+
borderWidth: 1,
|
|
756
|
+
backgroundColor: "white",
|
|
757
|
+
titleColor: "black",
|
|
758
|
+
bodyColor: "black",
|
|
759
|
+
borderColor: "#eeeeee",
|
|
760
|
+
padding: 12,
|
|
761
|
+
callbacks: {
|
|
762
|
+
label: (e) => `${e.dataset.label || ""}: ${e.formattedValue}`
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
interaction: { intersect: !1, mode: "index" },
|
|
767
|
+
scales: {
|
|
768
|
+
r: {
|
|
769
|
+
beginAtZero: !0,
|
|
770
|
+
angleLines: {
|
|
771
|
+
color: "#f5f6fa"
|
|
772
|
+
// 蜘蛛网线的颜色
|
|
773
|
+
},
|
|
774
|
+
grid: {
|
|
775
|
+
color: "#f5f6fa"
|
|
776
|
+
// 圆圈线的颜色
|
|
777
|
+
},
|
|
778
|
+
pointLabels: {
|
|
779
|
+
color: "#969799",
|
|
780
|
+
// 轴标签的颜色
|
|
781
|
+
font: { size: 11, family: "Open Sans" }
|
|
782
|
+
},
|
|
783
|
+
ticks: {
|
|
784
|
+
display: !1
|
|
785
|
+
// 隐藏刻度值
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
n = new k(d, {
|
|
791
|
+
type: "radar",
|
|
792
|
+
data: c,
|
|
793
|
+
options: u
|
|
794
|
+
});
|
|
795
|
+
};
|
|
796
|
+
return g(() => {
|
|
797
|
+
l();
|
|
798
|
+
}), m(
|
|
799
|
+
[() => t.labels, () => t.datasets, () => t.height],
|
|
800
|
+
() => {
|
|
801
|
+
l();
|
|
802
|
+
},
|
|
803
|
+
{ deep: !0 }
|
|
804
|
+
), {
|
|
805
|
+
radarChartCanvas: o
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
function P(t, o, n, l, d, c) {
|
|
810
|
+
return v(), C("div", null, [
|
|
811
|
+
y("canvas", {
|
|
812
|
+
ref: "radarChartCanvas",
|
|
813
|
+
style: x([{ width: "100%" }, { height: t.height + "px" }])
|
|
814
|
+
}, null, 4)
|
|
815
|
+
]);
|
|
816
|
+
}
|
|
817
|
+
const G = /* @__PURE__ */ $(I, [["render", P]]);
|
|
818
|
+
export {
|
|
819
|
+
$ as _,
|
|
820
|
+
Y as a,
|
|
821
|
+
Z as b,
|
|
822
|
+
M as c,
|
|
823
|
+
F as d,
|
|
824
|
+
G as e,
|
|
825
|
+
X as i
|
|
826
|
+
};
|