magtool 1.5.38 → 1.5.39
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/cpt/AiApp.js +117 -0
- package/dist/cpt/AiOrg.js +130 -0
- package/dist/cpt/AsaAdGroup.js +261 -0
- package/dist/cpt/AsaApp.js +126 -0
- package/dist/cpt/AsaCampaign.js +268 -0
- package/dist/cpt/AsaOrg.js +130 -0
- package/dist/cpt/Card.js +92 -0
- package/dist/cpt/Country.js +32 -0
- package/dist/cpt/CountryItem.js +56 -0
- package/dist/cpt/DatePicker.js +246 -0
- package/dist/cpt/EChart.js +271 -0
- package/dist/cpt/Form.js +75 -0
- package/dist/cpt/Header.js +786 -0
- package/dist/cpt/Icon.js +24 -0
- package/dist/cpt/Image.js +58 -0
- package/dist/cpt/Input.js +129 -0
- package/dist/cpt/Main.js +230 -0
- package/dist/cpt/MultipleSelect.js +143 -0
- package/dist/cpt/Nodata.js +39 -0
- package/dist/cpt/Org.js +99 -0
- package/dist/cpt/Page.js +74 -0
- package/dist/cpt/StatusItem.js +68 -0
- package/dist/cpt/StatusSelect.js +79 -0
- package/dist/cpt/Table.js +123 -0
- package/dist/cpt/Textarea.js +132 -0
- package/dist/cpt/Timezone.js +128 -0
- package/dist/cpt/chip.js +639 -0
- package/dist/cpt/component.js +21 -0
- package/dist/css/cpt/Card.css +1 -0
- package/dist/css/cpt/EChart.css +1 -0
- package/dist/css/cpt/Header.css +1 -0
- package/dist/css/cpt/Main.css +1 -0
- package/dist/css/cpt/MultipleSelect.css +1 -0
- package/dist/css/cpt/Nodata.css +1 -0
- package/dist/css/cpt/Page.css +1 -0
- package/dist/css/cpt/Table.css +1 -0
- package/dist/css/cpt/Textarea.css +1 -0
- package/dist/css/cpt/chip.css +1 -0
- package/dist/css/{magtool.css → css/scss.css} +1 -1
- package/dist/index.js +2 -2
- package/dist/util.js +5 -5
- package/dist/vendor.js +17 -14
- package/package.json +1 -1
- package/dist/component.js +0 -4427
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { defineComponent as E, reactive as O, onMounted as j, computed as n, watch as A, resolveComponent as z, createElementBlock as J, openBlock as P, createVNode as W, unref as o } from "vue";
|
|
2
|
+
import { dayjs as F } from "element-plus";
|
|
3
|
+
const I = { class: "SuperDatePicker" }, U = E({
|
|
4
|
+
name: "SuperDatePicker"
|
|
5
|
+
}), H = /* @__PURE__ */ Object.assign(U, {
|
|
6
|
+
props: {
|
|
7
|
+
source: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
},
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: [String, Array],
|
|
13
|
+
default: () => []
|
|
14
|
+
},
|
|
15
|
+
withToday: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
defaultDate: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => [-7, -1]
|
|
22
|
+
},
|
|
23
|
+
// 开始,结束的分割符号,也是v-model str时的分割符号
|
|
24
|
+
separator: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "~"
|
|
27
|
+
},
|
|
28
|
+
offset: {
|
|
29
|
+
type: [String, Number],
|
|
30
|
+
default: 0
|
|
31
|
+
},
|
|
32
|
+
range: {
|
|
33
|
+
type: [String, Number],
|
|
34
|
+
default: 180
|
|
35
|
+
},
|
|
36
|
+
limit: {
|
|
37
|
+
type: [String, Number],
|
|
38
|
+
default: 30
|
|
39
|
+
},
|
|
40
|
+
// today, yersterday, thisweek, last7days, thismonth, last30days, lastmonth
|
|
41
|
+
shortcuts: {
|
|
42
|
+
type: [Object, Boolean],
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
placement: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "bottom"
|
|
48
|
+
},
|
|
49
|
+
disabled: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "large"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
emits: ["change", "update:modelValue"],
|
|
59
|
+
setup(M, { expose: $, emit: g }) {
|
|
60
|
+
F.en.weekStart = 7;
|
|
61
|
+
const d = M, r = O({
|
|
62
|
+
type: "",
|
|
63
|
+
date: [],
|
|
64
|
+
shortBtn: [],
|
|
65
|
+
firstStamp: 0
|
|
66
|
+
});
|
|
67
|
+
j(() => {
|
|
68
|
+
if (!p.value.length) {
|
|
69
|
+
const e = d.defaultDate[0], t = d.defaultDate[1];
|
|
70
|
+
r.date = [
|
|
71
|
+
window.$m().add(e, "days").format("YYYY-MM-DD"),
|
|
72
|
+
window.$m().add(t, "days").format("YYYY-MM-DD")
|
|
73
|
+
], f(r.date);
|
|
74
|
+
}
|
|
75
|
+
v();
|
|
76
|
+
});
|
|
77
|
+
const m = g, S = (e) => {
|
|
78
|
+
let { limit: t, range: a } = d;
|
|
79
|
+
t = Number(t), a = Number(a);
|
|
80
|
+
const { firstStamp: s } = r, i = t * 864e5;
|
|
81
|
+
let u = +window.$m().add(-a, "d"), c = +window.$m();
|
|
82
|
+
if (d.source === "report" && !s)
|
|
83
|
+
return e > c;
|
|
84
|
+
if (s) {
|
|
85
|
+
if (d.source !== "report") {
|
|
86
|
+
let D = s - i;
|
|
87
|
+
D > u && (u = D);
|
|
88
|
+
} else
|
|
89
|
+
u = s - i;
|
|
90
|
+
let h = s + i;
|
|
91
|
+
h < c && (c = h);
|
|
92
|
+
}
|
|
93
|
+
return e < u || e > c;
|
|
94
|
+
}, b = (e) => {
|
|
95
|
+
e[1] === null ? r.firstStamp = +e[0] : r.firstStamp = 0;
|
|
96
|
+
}, f = (e) => {
|
|
97
|
+
const t = y(e);
|
|
98
|
+
m("change", t, "cpt");
|
|
99
|
+
}, v = () => {
|
|
100
|
+
const { shortcuts: e } = d;
|
|
101
|
+
let t = {};
|
|
102
|
+
if (e === !1)
|
|
103
|
+
r.shortBtn = [];
|
|
104
|
+
else {
|
|
105
|
+
e === !0 ? t = Y : t = {
|
|
106
|
+
...Y,
|
|
107
|
+
...e
|
|
108
|
+
};
|
|
109
|
+
const a = [];
|
|
110
|
+
t.today && a.push(k()), t.yesterday && a.push(C()), t.thisweek && a.push(T()), t.last7days && a.push(V()), t.todaylast7days && a.push(B()), t.thismonth && a.push(_()), t.last30days && a.push(x()), t.lastmonth && a.push(L()), r.shortBtn = a;
|
|
111
|
+
}
|
|
112
|
+
}, k = () => ({
|
|
113
|
+
text: window.$l("Today"),
|
|
114
|
+
value: () => {
|
|
115
|
+
const e = window.$m().format("YYYY-MM-DD");
|
|
116
|
+
return [e, e];
|
|
117
|
+
},
|
|
118
|
+
onClick: (e) => {
|
|
119
|
+
}
|
|
120
|
+
}), C = () => ({
|
|
121
|
+
text: window.$l("Yesterday"),
|
|
122
|
+
value: () => {
|
|
123
|
+
const e = window.$m().add(-1, "days").format("YYYY-MM-DD");
|
|
124
|
+
return [e, e];
|
|
125
|
+
},
|
|
126
|
+
onClick: (e) => {
|
|
127
|
+
}
|
|
128
|
+
}), T = () => ({
|
|
129
|
+
text: window.$l("This Week"),
|
|
130
|
+
value: () => {
|
|
131
|
+
let e = 0, t = window.$m().weekday(0), a = window.$m().add(e, "days");
|
|
132
|
+
return +t > +a && (t = t.format("YYYY-MM-DD"), a = t), [t, a];
|
|
133
|
+
},
|
|
134
|
+
onClick: (e) => {
|
|
135
|
+
}
|
|
136
|
+
}), V = () => ({
|
|
137
|
+
text: window.$l("Last 7 Days"),
|
|
138
|
+
value: () => {
|
|
139
|
+
let e = -7, t = -1;
|
|
140
|
+
return d.widthToday && (e += 1, t += 1), [
|
|
141
|
+
window.$m().add(e, "days").format("YYYY-MM-DD"),
|
|
142
|
+
window.$m().add(t, "days").format("YYYY-MM-DD")
|
|
143
|
+
];
|
|
144
|
+
},
|
|
145
|
+
onClick: (e) => {
|
|
146
|
+
}
|
|
147
|
+
}), B = () => ({
|
|
148
|
+
text: window.$l("Last 7 Days (with Today)"),
|
|
149
|
+
value: () => [
|
|
150
|
+
window.$m().add(-6, "days").format("YYYY-MM-DD"),
|
|
151
|
+
window.$m().add(0, "days").format("YYYY-MM-DD")
|
|
152
|
+
],
|
|
153
|
+
onClick: (e) => {
|
|
154
|
+
}
|
|
155
|
+
}), _ = () => ({
|
|
156
|
+
text: window.$l("This Month"),
|
|
157
|
+
value: () => {
|
|
158
|
+
let e = 0, t = window.$m().date(1), a = window.$m().add(e, "days");
|
|
159
|
+
return +t > +a && (t = t.format("YYYY-MM-DD"), a = t), [t, a];
|
|
160
|
+
},
|
|
161
|
+
onClick: (e) => {
|
|
162
|
+
}
|
|
163
|
+
}), x = () => ({
|
|
164
|
+
text: window.$l("Last 30 Days"),
|
|
165
|
+
value: () => {
|
|
166
|
+
let e = -30, t = -1;
|
|
167
|
+
return d.widthToday && (e += 1, t += 1), [
|
|
168
|
+
window.$m().add(e, "days").format("YYYY-MM-DD"),
|
|
169
|
+
window.$m().add(t, "days").format("YYYY-MM-DD")
|
|
170
|
+
];
|
|
171
|
+
},
|
|
172
|
+
onClick: (e) => {
|
|
173
|
+
}
|
|
174
|
+
}), L = () => ({
|
|
175
|
+
text: window.$l("Last Month"),
|
|
176
|
+
value: () => [
|
|
177
|
+
window.$m().date(1).add(-1, "days").date(1).format("YYYY-MM-DD"),
|
|
178
|
+
window.$m().date(1).add(-1, "days").format("YYYY-MM-DD")
|
|
179
|
+
],
|
|
180
|
+
onClick: (e) => {
|
|
181
|
+
}
|
|
182
|
+
}), y = (e, t = !1) => {
|
|
183
|
+
t && (r.date = e);
|
|
184
|
+
let a;
|
|
185
|
+
return l.value === "Array" ? a = e : l.value === "Object" ? a = {
|
|
186
|
+
startDate: e[0],
|
|
187
|
+
endDate: e[1]
|
|
188
|
+
} : a = e[0] + d.separator + e[1], m("update:modelValue", a), a;
|
|
189
|
+
}, N = n(() => window.$getLang()), l = n(() => window.$getType(d.modelValue)), p = n(() => l.value === "Array" ? d.modelValue : l.value === "Object" ? [d.modelValue.startDate, d.modelValue.endDate] : d.modelValue ? d.modelValue.split(d.separator) : []), w = n(() => ({
|
|
190
|
+
start: window.$l("Start Date"),
|
|
191
|
+
end: window.$l("End Date")
|
|
192
|
+
}));
|
|
193
|
+
n(() => {
|
|
194
|
+
let { disabledDate: e, offset: t } = d, a = 0;
|
|
195
|
+
t = Number(t) || 0;
|
|
196
|
+
const s = window.$getType(e);
|
|
197
|
+
return s !== "Function" && s !== "Array" && (a = parseInt(e) || 0, a > -1 && (a = -1), a > t && (a = t)), a;
|
|
198
|
+
});
|
|
199
|
+
const Y = {
|
|
200
|
+
today: !0,
|
|
201
|
+
yesterday: !0,
|
|
202
|
+
thisweek: !1,
|
|
203
|
+
last7days: !0,
|
|
204
|
+
todaylast7days: !1,
|
|
205
|
+
thismonth: !0,
|
|
206
|
+
last30days: !0,
|
|
207
|
+
lastmonth: !0
|
|
208
|
+
};
|
|
209
|
+
return A(
|
|
210
|
+
() => p.value,
|
|
211
|
+
(e, t) => {
|
|
212
|
+
e.length && JSON.stringify(e) !== JSON.stringify(r.date) && (r.date = e, f(e));
|
|
213
|
+
}
|
|
214
|
+
), $({
|
|
215
|
+
setDate: y
|
|
216
|
+
}), (e, t) => {
|
|
217
|
+
const a = z("el-date-picker");
|
|
218
|
+
return P(), J("div", I, [
|
|
219
|
+
W(a, {
|
|
220
|
+
modelValue: o(r).date,
|
|
221
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => o(r).date = s),
|
|
222
|
+
class: "wp100",
|
|
223
|
+
"popper-class": o(N),
|
|
224
|
+
type: "daterange",
|
|
225
|
+
"value-format": "YYYY-MM-DD",
|
|
226
|
+
editable: !1,
|
|
227
|
+
size: d.size,
|
|
228
|
+
clearable: !1,
|
|
229
|
+
"range-separator": d.separator,
|
|
230
|
+
shortcuts: o(r).shortBtn,
|
|
231
|
+
"end-placeholder": e.$l(o(w).end),
|
|
232
|
+
"start-placeholder": e.$l(o(w).start),
|
|
233
|
+
"disabled-date": S,
|
|
234
|
+
placement: d.placement,
|
|
235
|
+
disabled: d.disabled,
|
|
236
|
+
source: d.source,
|
|
237
|
+
onChange: f,
|
|
238
|
+
onCalendarChange: b
|
|
239
|
+
}, null, 8, ["modelValue", "popper-class", "size", "range-separator", "shortcuts", "end-placeholder", "start-placeholder", "placement", "disabled", "source"])
|
|
240
|
+
]);
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
export {
|
|
245
|
+
H as default
|
|
246
|
+
};
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { defineComponent as T, getCurrentInstance as v, inject as A, reactive as N, onBeforeMount as j, onMounted as B, markRaw as z, computed as h, watch as w, onBeforeUnmount as M, createElementBlock as W, openBlock as L, createElementVNode as P, unref as S, normalizeStyle as K, nextTick as F } from "vue";
|
|
2
|
+
import { _ as H } from "../vendor.js";
|
|
3
|
+
const R = { class: "EChart" }, U = ["id"], V = T({
|
|
4
|
+
name: "EChart"
|
|
5
|
+
}), q = /* @__PURE__ */ Object.assign(V, {
|
|
6
|
+
props: {
|
|
7
|
+
options: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: () => {
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
type: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
height: {
|
|
17
|
+
type: [String, Number],
|
|
18
|
+
default: "300"
|
|
19
|
+
},
|
|
20
|
+
width: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
minusWidth: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
theme: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "light"
|
|
31
|
+
}
|
|
32
|
+
// tool: {
|
|
33
|
+
// type: Boolean,
|
|
34
|
+
// default: false,
|
|
35
|
+
// },
|
|
36
|
+
},
|
|
37
|
+
setup(O, { expose: I, emit: _ }) {
|
|
38
|
+
const i = O, { proxy: g } = v();
|
|
39
|
+
A("store").launch();
|
|
40
|
+
const e = N({
|
|
41
|
+
chart: {},
|
|
42
|
+
chartID: "",
|
|
43
|
+
defaultOptions: {
|
|
44
|
+
grid: {
|
|
45
|
+
top: 20,
|
|
46
|
+
left: 50,
|
|
47
|
+
right: 20,
|
|
48
|
+
bottom: 72
|
|
49
|
+
},
|
|
50
|
+
legend: {
|
|
51
|
+
id: "bar",
|
|
52
|
+
itemWidth: 18,
|
|
53
|
+
bottom: 14,
|
|
54
|
+
textStyle: {
|
|
55
|
+
color: "#4d4d4d"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
color: window.global.config.color,
|
|
59
|
+
xAxis: {
|
|
60
|
+
animationEasing: "cubicInOut",
|
|
61
|
+
animationDuration: 300,
|
|
62
|
+
axisLine: {
|
|
63
|
+
show: !1
|
|
64
|
+
},
|
|
65
|
+
axisTick: {
|
|
66
|
+
show: !1
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
yAxis: {
|
|
70
|
+
animationEasing: "cubicInOut",
|
|
71
|
+
animationDuration: 300,
|
|
72
|
+
splitLine: {
|
|
73
|
+
lineStyle: {
|
|
74
|
+
type: "dotted"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
tooltip: {
|
|
79
|
+
show: !0,
|
|
80
|
+
trigger: "axis",
|
|
81
|
+
padding: [8, 16],
|
|
82
|
+
borderWidth: 0
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
mounted: !1,
|
|
86
|
+
options: {},
|
|
87
|
+
chartType: ""
|
|
88
|
+
});
|
|
89
|
+
j(() => {
|
|
90
|
+
e.chartID = `chart${+/* @__PURE__ */ new Date()}${parseInt(Math.random() * 1e4)}`;
|
|
91
|
+
}), B(() => {
|
|
92
|
+
var t;
|
|
93
|
+
e.mounted = !0, g.$refs.chart && (e.chart = z(
|
|
94
|
+
(t = window.$ecs) == null ? void 0 : t.init(g.$refs.chart, { renderer: "svg" })
|
|
95
|
+
));
|
|
96
|
+
});
|
|
97
|
+
const D = _, k = async () => {
|
|
98
|
+
f();
|
|
99
|
+
}, f = () => {
|
|
100
|
+
F(() => {
|
|
101
|
+
var o;
|
|
102
|
+
e.optioning = !0, e.chart.clear();
|
|
103
|
+
let t = window.$deepClone(i.options);
|
|
104
|
+
["pie", "radar", "scatter"].indexOf(i.type) > -1 ? (t = {
|
|
105
|
+
color: e.defaultOptions.color,
|
|
106
|
+
animationEasing: "cubicInOut",
|
|
107
|
+
animationDuration: 500,
|
|
108
|
+
textStyle: p.value,
|
|
109
|
+
...t
|
|
110
|
+
}, t.tooltip ? (t.tooltip = i.options.tooltip, t.tooltip = {
|
|
111
|
+
...t.tooltip,
|
|
112
|
+
...u[i.theme]
|
|
113
|
+
}) : t.tooltip = {
|
|
114
|
+
...u[i.theme]
|
|
115
|
+
}) : i.type === "map" ? t.textStyle = p.value : (i.tool === !0 && (e.defaultOptions.toolbox = {
|
|
116
|
+
show: !0,
|
|
117
|
+
right: 24,
|
|
118
|
+
emphasis: {
|
|
119
|
+
iconStyle: {
|
|
120
|
+
color: window.global.config.color[0]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}), e.defaultOptions.tooltip = {
|
|
124
|
+
...e.defaultOptions.tooltip,
|
|
125
|
+
...u[i.theme]
|
|
126
|
+
}, t = C(e.defaultOptions, t)), (o = t.series) == null || o.forEach((n) => {
|
|
127
|
+
n.animation = !0, n.animationDuration = 300, n.type === "line" ? (n.animationEasing = "cubicInOut", n.animationDelay = (s) => s * 100) : (n.animationEasing = "cubicInOut", n.animationDelay = (s) => s * 100);
|
|
128
|
+
}), e.chart.setOption(t), i.type === "wordcloud" && e.chart.on("click", (...n) => {
|
|
129
|
+
D("chart-click", n);
|
|
130
|
+
}), e.optioning = !1;
|
|
131
|
+
});
|
|
132
|
+
}, C = (t, a) => {
|
|
133
|
+
var m;
|
|
134
|
+
const { yAxis: o } = a, { yAxis: n } = t;
|
|
135
|
+
let s;
|
|
136
|
+
i.options.yAxis && (((m = window.$getType) == null ? void 0 : m.call(window, o)) === "Array" ? s = o.map((r) => ({
|
|
137
|
+
...n,
|
|
138
|
+
...r
|
|
139
|
+
})) : s = {
|
|
140
|
+
...n,
|
|
141
|
+
...o
|
|
142
|
+
});
|
|
143
|
+
const l = { ...a, ...t };
|
|
144
|
+
return Object.keys(l).forEach((r) => {
|
|
145
|
+
var x;
|
|
146
|
+
const b = (x = window.$getType) == null ? void 0 : x.call(window, l[r]);
|
|
147
|
+
if (b === "Array") {
|
|
148
|
+
const c = t[r] || [], d = a[r] || [];
|
|
149
|
+
l[r] = c.length && !d.length ? c : d;
|
|
150
|
+
} else if (b === "Object") {
|
|
151
|
+
const c = t[r] || {}, d = a[r] || {};
|
|
152
|
+
l[r] = { ...c, ...d };
|
|
153
|
+
}
|
|
154
|
+
}), s && (l.yAxis = s), l.textStyle = p.value, l;
|
|
155
|
+
}, $ = () => e.chart, p = h(() => ({
|
|
156
|
+
fontFamily: window.$getLang().includes("zh") ? "Alibaba PuHuiTi" : "euclid"
|
|
157
|
+
})), y = h(() => {
|
|
158
|
+
var t, a, o;
|
|
159
|
+
return ((o = (a = (t = window.global) == null ? void 0 : t.config) == null ? void 0 : a.options) == null ? void 0 : o.cardWidth) || 800;
|
|
160
|
+
}), E = h(() => {
|
|
161
|
+
var n;
|
|
162
|
+
const t = (n = window.$getType) == null ? void 0 : n.call(window, i.width), a = Number(i.height);
|
|
163
|
+
let o = i.width;
|
|
164
|
+
return o ? t === "String" && (o.indexOf("%") > -1 ? o = parseInt(parseInt(o) * y.value / 100) : o = Number(o)) : o = y.value, {
|
|
165
|
+
height: a + "px",
|
|
166
|
+
width: o + "px"
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
w(
|
|
170
|
+
() => [e.mounted, i.options],
|
|
171
|
+
(t) => {
|
|
172
|
+
var a;
|
|
173
|
+
t[0] && ((a = t[1]) != null && a.series) && f();
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
immediate: !0,
|
|
177
|
+
deep: !0
|
|
178
|
+
}
|
|
179
|
+
), w(
|
|
180
|
+
() => i.width,
|
|
181
|
+
(t) => {
|
|
182
|
+
t && e.chart && !e.optioning && e.chart.resize({
|
|
183
|
+
width: t,
|
|
184
|
+
height: i.height
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
), I({
|
|
188
|
+
getChart: $,
|
|
189
|
+
initChart: k
|
|
190
|
+
});
|
|
191
|
+
const u = {
|
|
192
|
+
dark: {
|
|
193
|
+
className: `echart-tooltip ${e.chartID}`,
|
|
194
|
+
extraCssText: "backdrop-filter: blur(8px)",
|
|
195
|
+
animation: !1,
|
|
196
|
+
appendToBody: !0,
|
|
197
|
+
hideDelay: 0,
|
|
198
|
+
transitionDuration: 0,
|
|
199
|
+
backgroundColor: "rgba(50, 50, 50, 0.9)",
|
|
200
|
+
textStyle: {
|
|
201
|
+
color: "rgba(255, 255, 255, 0.9)",
|
|
202
|
+
fontSize: 14
|
|
203
|
+
},
|
|
204
|
+
axisPointer: {
|
|
205
|
+
type: "shadow",
|
|
206
|
+
label: {
|
|
207
|
+
padding: [4, 8],
|
|
208
|
+
color: "rgba(46, 38, 61, 0.5)",
|
|
209
|
+
backgroundColor: "rgba(240, 240, 240, 0.9)"
|
|
210
|
+
},
|
|
211
|
+
lineStyle: {
|
|
212
|
+
color: "rgba(46, 38, 61, 0.2)"
|
|
213
|
+
},
|
|
214
|
+
crossStyle: {
|
|
215
|
+
color: "rgba(46, 38, 61, 0.2)"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
light: {
|
|
220
|
+
className: `echart-tooltip ${e.chartID}`,
|
|
221
|
+
extraCssText: "backdrop-filter: blur(8px)",
|
|
222
|
+
backgroundColor: "rgba(255, 255, 255, 0.9)",
|
|
223
|
+
animation: !1,
|
|
224
|
+
appendToBody: !0,
|
|
225
|
+
hideDelay: 0,
|
|
226
|
+
transitionDuration: 0,
|
|
227
|
+
textStyle: {
|
|
228
|
+
color: "rgba(46, 38, 61, 0.9)",
|
|
229
|
+
fontSize: 14
|
|
230
|
+
},
|
|
231
|
+
axisPointer: {
|
|
232
|
+
type: "shadow",
|
|
233
|
+
label: {
|
|
234
|
+
padding: [4, 8],
|
|
235
|
+
color: "rgba(46, 38, 61, 0.5)",
|
|
236
|
+
backgroundColor: "rgba(240, 240, 240, 0.9)"
|
|
237
|
+
},
|
|
238
|
+
lineStyle: {
|
|
239
|
+
color: "rgba(46, 38, 61, 0.2)"
|
|
240
|
+
},
|
|
241
|
+
crossStyle: {
|
|
242
|
+
color: "rgba(46, 38, 61, 0.2)"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// position: (pos, params, dom, rect, size) => {
|
|
246
|
+
// // 鼠标在左侧时 tooltip 显示到右侧,鼠标在右侧时 tooltip 显示到左侧。
|
|
247
|
+
// let left = pos[0] + 24;
|
|
248
|
+
// if (size.viewSize[0] < size.contentSize[0]) {
|
|
249
|
+
// left = size.contentSize[0];
|
|
250
|
+
// } else if (pos[0] > size.viewSize[0] - size.contentSize[0]) {
|
|
251
|
+
// left = pos[0] - size.contentSize[0];
|
|
252
|
+
// }
|
|
253
|
+
// // obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5;
|
|
254
|
+
// return [left, pos[1] + 24];
|
|
255
|
+
// },
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
return M(() => {
|
|
259
|
+
e.chart && (e.chart.dispose(), e.chart = null);
|
|
260
|
+
}), (t, a) => (L(), W("div", R, [
|
|
261
|
+
P("div", {
|
|
262
|
+
ref: "chart",
|
|
263
|
+
style: K(S(E)),
|
|
264
|
+
id: S(e).chartID
|
|
265
|
+
}, null, 12, U)
|
|
266
|
+
]));
|
|
267
|
+
}
|
|
268
|
+
}), Y = /* @__PURE__ */ H(q, [["__scopeId", "data-v-7f979230"]]);
|
|
269
|
+
export {
|
|
270
|
+
Y as default
|
|
271
|
+
};
|
package/dist/cpt/Form.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineComponent as y, reactive as O, getCurrentInstance as v, computed as b, watch as a, resolveComponent as S, createElementBlock as h, openBlock as j, createVNode as n, unref as l, withCtx as m, renderSlot as w } from "vue";
|
|
2
|
+
import { f as N } from "./chip.js";
|
|
3
|
+
const V = { class: "MvcForm" }, x = y({
|
|
4
|
+
name: "MvcForm"
|
|
5
|
+
}), F = /* @__PURE__ */ Object.assign(x, {
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: Object,
|
|
9
|
+
default: /* @__PURE__ */ Object.create(null)
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: /* @__PURE__ */ Object.create(null)
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "large"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(f, { expose: c, emit: u }) {
|
|
21
|
+
const r = f, o = O({
|
|
22
|
+
form: {}
|
|
23
|
+
}), { proxy: i } = v(), d = u, p = async () => await i.$refs.form.validate() ? _() : !1, _ = () => o.form, g = b(() => {
|
|
24
|
+
const e = {};
|
|
25
|
+
for (let s in r.rules)
|
|
26
|
+
e[s] = r.rules[s].map((t) => (t.message && (t.message = window.$l(t.message)), t));
|
|
27
|
+
return e;
|
|
28
|
+
});
|
|
29
|
+
return a(
|
|
30
|
+
() => o.form,
|
|
31
|
+
(e) => {
|
|
32
|
+
e && JSON.stringify(e) !== JSON.stringify(r.modelValue) && d("update:modelValue", e);
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
deep: !0
|
|
36
|
+
}
|
|
37
|
+
), a(
|
|
38
|
+
() => r.modelValue,
|
|
39
|
+
(e) => {
|
|
40
|
+
e && JSON.stringify(e) !== JSON.stringify(o.form) && (o.form = e);
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
immediate: !0,
|
|
44
|
+
deep: !0
|
|
45
|
+
}
|
|
46
|
+
), c({
|
|
47
|
+
validate: p
|
|
48
|
+
}), (e, s) => {
|
|
49
|
+
const t = S("el-form");
|
|
50
|
+
return j(), h("div", V, [
|
|
51
|
+
n(t, {
|
|
52
|
+
ref: "form",
|
|
53
|
+
model: l(o).form,
|
|
54
|
+
rules: l(g),
|
|
55
|
+
size: r.size,
|
|
56
|
+
"validate-on-rule-change": !1,
|
|
57
|
+
"label-position": "top"
|
|
58
|
+
}, {
|
|
59
|
+
default: m(() => [
|
|
60
|
+
n(l(N), null, {
|
|
61
|
+
default: m(() => [
|
|
62
|
+
w(e.$slots, "default")
|
|
63
|
+
]),
|
|
64
|
+
_: 3
|
|
65
|
+
})
|
|
66
|
+
]),
|
|
67
|
+
_: 3
|
|
68
|
+
}, 8, ["model", "rules", "size"])
|
|
69
|
+
]);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
F as default
|
|
75
|
+
};
|