dlzn-ui 1.87.0 → 1.88.0
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/package.json +4 -2
- package/plugins/captcha/index.d.ts +1 -0
- package/plugins/captcha/index.mjs +0 -0
- package/plugins/captcha/src/captcha.d.ts +2 -0
- package/plugins/captcha/src/captcha.mjs +153 -0
- package/plugins/captcha/src/captcha.vue.d.ts +8 -0
- package/plugins/{others/directive.mjs → directive/index.mjs} +1 -1
- package/plugins/echarts/index.d.ts +11 -0
- package/plugins/echarts/index.mjs +26574 -0
- package/plugins/initialize/index.d.ts +0 -0
- package/plugins/initialize/index.mjs +26 -0
- package/plugins/initialize/webUpdateNotify.d.ts +1 -0
- package/plugins/initialize/webUpdateNotify.mjs +30 -0
- /package/plugins/{others/directive.d.ts → directive/index.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -71,12 +71,14 @@
|
|
|
71
71
|
"cron-parser": "^5.10.0",
|
|
72
72
|
"cronstrue": "^3.24.0",
|
|
73
73
|
"crypto-js": "^4.2.0",
|
|
74
|
+
"echarts": "^6.1.0",
|
|
74
75
|
"element-plus": "^2.14.5",
|
|
75
76
|
"file-saver": "^2.0.5",
|
|
76
77
|
"path-browserify": "^1.0.1",
|
|
77
78
|
"pinia": "^4.0.3",
|
|
78
79
|
"pinia-plugin-persistedstate": "^4.7.1",
|
|
79
|
-
"quartzcron": "^0.1.2"
|
|
80
|
+
"quartzcron": "^0.1.2",
|
|
81
|
+
"vue-echarts": "^8.3.0"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
84
|
"@types/crypto-js": "^4.2.2",
|
|
@@ -87,5 +89,5 @@
|
|
|
87
89
|
"> 1%",
|
|
88
90
|
"not dead"
|
|
89
91
|
],
|
|
90
|
-
"version": "1.
|
|
92
|
+
"version": "1.88.0"
|
|
91
93
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/captcha';
|
|
File without changes
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { i as e } from "../../../chunks/user-DsSzsUIW.mjs";
|
|
2
|
+
import { aesEncrypt as t } from "../../../utils/tool.mjs";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, onMounted as d, openBlock as f, ref as p, resolveComponent as m, resolveDirective as h, toDisplayString as g, unref as _, useTemplateRef as v, vShow as y, withCtx as b, withDirectives as x } from "vue";
|
|
4
|
+
import { useDraggable as S, useElementSize as C } from "@vueuse/core";
|
|
5
|
+
import { useRequest as w } from "alova/client";
|
|
6
|
+
//#region ../../packages/dlzn-ui/plugins/captcha/src/captcha.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var T = ["src"], E = ["src"], D = 155, O = /* @__PURE__ */ c({
|
|
8
|
+
__name: "captcha",
|
|
9
|
+
emits: ["success"],
|
|
10
|
+
setup(c, { emit: O }) {
|
|
11
|
+
let k = O, A = {
|
|
12
|
+
barHeight: 40,
|
|
13
|
+
imgHeight: D,
|
|
14
|
+
imgWidth: 310
|
|
15
|
+
}, j = new URL("./default.jpg", "" + import.meta.url).href, M = p(""), N = p(""), P = p(""), F = v("barArea"), I = p("default"), L = n(() => I.value === "default" ? {
|
|
16
|
+
bgColor: "inherit",
|
|
17
|
+
color: "var(--td-text-color-secondary)",
|
|
18
|
+
icon: "icon-right"
|
|
19
|
+
} : I.value === "doing" ? {
|
|
20
|
+
bgColor: "var(--td-brand-color-active)",
|
|
21
|
+
color: "#fff",
|
|
22
|
+
icon: "icon-right"
|
|
23
|
+
} : I.value === "success" ? {
|
|
24
|
+
bgColor: "var(--td-success-color)",
|
|
25
|
+
color: "#fff",
|
|
26
|
+
icon: "icon-check"
|
|
27
|
+
} : {
|
|
28
|
+
bgColor: "#d9534f",
|
|
29
|
+
color: "#fff",
|
|
30
|
+
icon: "icon-close"
|
|
31
|
+
}), R = p(0), z = p(""), B = p(""), V = v("dragBlock"), { width: H } = C(F, void 0, { box: "border-box" }), { x: U } = S(V, {
|
|
32
|
+
axis: "x",
|
|
33
|
+
containerElement: F,
|
|
34
|
+
onEnd: async ({ x: n }) => {
|
|
35
|
+
let r = Date.now();
|
|
36
|
+
(await e.Post("captcha/check", {
|
|
37
|
+
pointJson: await t(JSON.stringify({
|
|
38
|
+
x: n,
|
|
39
|
+
y: 5
|
|
40
|
+
}), B.value),
|
|
41
|
+
token: z.value
|
|
42
|
+
}, { meta: {
|
|
43
|
+
useLoading: !1,
|
|
44
|
+
useToken: !1
|
|
45
|
+
} })).repCode === "0000" ? (I.value = "success", P.value = `${((r - R.value) / 1e3).toFixed(2)}s验证成功`, setTimeout(async () => {
|
|
46
|
+
k("success", await t(`${z.value}---${JSON.stringify({
|
|
47
|
+
x: n,
|
|
48
|
+
y: 5
|
|
49
|
+
})}`, B.value));
|
|
50
|
+
}, 500)) : (I.value = "fail", P.value = "验证失败", setTimeout(() => {
|
|
51
|
+
J();
|
|
52
|
+
}, 1e3));
|
|
53
|
+
},
|
|
54
|
+
onStart: () => {
|
|
55
|
+
if (B.value === "") return !1;
|
|
56
|
+
R.value = Date.now(), I.value = "doing";
|
|
57
|
+
},
|
|
58
|
+
preventDefault: !0,
|
|
59
|
+
stopPropagation: !0
|
|
60
|
+
}), W = n(() => Math.min(U.value, H.value - A.barHeight)), { loading: G, send: K } = w(e.Post("captcha/get", {}, { meta: {
|
|
61
|
+
useLoading: !1,
|
|
62
|
+
useToken: !1
|
|
63
|
+
} }), { immediate: !1 });
|
|
64
|
+
async function q() {
|
|
65
|
+
let e = await K();
|
|
66
|
+
e.repCode === "0000" ? (M.value = e.repData.originalImageBase64, N.value = e.repData.jigsawImageBase64, z.value = e.repData.token, B.value = e.repData.secretKey) : (P.value = e.repMsg, M.value = null, N.value = null, z.value = "", B.value = "");
|
|
67
|
+
}
|
|
68
|
+
d(() => {
|
|
69
|
+
q();
|
|
70
|
+
});
|
|
71
|
+
function J() {
|
|
72
|
+
P.value = "", U.value = 0, I.value = "default", B.value = "", q();
|
|
73
|
+
}
|
|
74
|
+
return (e, t) => {
|
|
75
|
+
let n = m("TIcon"), c = m("TButton"), d = h("loading");
|
|
76
|
+
return x((f(), a("div", {
|
|
77
|
+
class: "relative overflow-hidden",
|
|
78
|
+
style: u({ width: `${A.imgWidth}px` }),
|
|
79
|
+
onSelectstart: () => !1
|
|
80
|
+
}, [o("div", {
|
|
81
|
+
class: "relative",
|
|
82
|
+
style: u({ height: `${A.imgHeight}px` })
|
|
83
|
+
}, [
|
|
84
|
+
o("img", {
|
|
85
|
+
class: "block h-full w-full",
|
|
86
|
+
src: M.value ? `data:image/png;base64,${M.value}` : _(j)
|
|
87
|
+
}, null, 8, T),
|
|
88
|
+
s(c, {
|
|
89
|
+
class: "absolute! top-0 right-0",
|
|
90
|
+
shape: "square",
|
|
91
|
+
variant: "text",
|
|
92
|
+
onClick: J
|
|
93
|
+
}, {
|
|
94
|
+
icon: b(() => [s(n, { icon: "material-symbols-light:refresh" })]),
|
|
95
|
+
_: 1
|
|
96
|
+
}),
|
|
97
|
+
P.value ? (f(), a("span", {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: l(["text-white absolute bottom-0 left-0 w-full p-1", I.value === "success" ? "bg-green-300/50" : "bg-red-300/50"])
|
|
100
|
+
}, g(P.value), 3)) : i("v-if", !0)
|
|
101
|
+
], 4), o("div", {
|
|
102
|
+
ref: "barArea",
|
|
103
|
+
class: "border-gray-300 relative mt-[4px] flex items-center justify-center border text-center",
|
|
104
|
+
style: u({ height: `${A.barHeight}px` })
|
|
105
|
+
}, [x(o("span", null, "向右滑动完成验证", 512), [[y, I.value === "default"]]), o("div", {
|
|
106
|
+
class: "absolute top-0 left-0 -translate-x-px -translate-y-px border bg-[#f0fff0]",
|
|
107
|
+
style: u({
|
|
108
|
+
width: W.value === 0 ? `${A.barHeight}px` : `${W.value + 1}px`,
|
|
109
|
+
height: `${A.barHeight}px`,
|
|
110
|
+
"border-color": L.value.bgColor
|
|
111
|
+
})
|
|
112
|
+
}, [o("div", {
|
|
113
|
+
ref: "dragBlock",
|
|
114
|
+
class: "hover:text-white absolute top-0 left-0 flex -translate-x-px -translate-y-px cursor-pointer touch-none items-center justify-center border border-transparent bg-clip-content hover:bg-(--td-brand-color)",
|
|
115
|
+
style: u({
|
|
116
|
+
width: `${A.barHeight}px`,
|
|
117
|
+
height: `${A.barHeight}px`,
|
|
118
|
+
"background-color": L.value.bgColor,
|
|
119
|
+
left: `${W.value}px`
|
|
120
|
+
})
|
|
121
|
+
}, [
|
|
122
|
+
L.value.icon === "icon-check" ? (f(), r(n, {
|
|
123
|
+
key: 0,
|
|
124
|
+
icon: "mdi:check",
|
|
125
|
+
style: u({ color: L.value.color })
|
|
126
|
+
}, null, 8, ["style"])) : i("v-if", !0),
|
|
127
|
+
L.value.icon === "icon-right" ? (f(), r(n, {
|
|
128
|
+
key: 1,
|
|
129
|
+
icon: "mdi:chevron-right",
|
|
130
|
+
style: u({ color: L.value.color })
|
|
131
|
+
}, null, 8, ["style"])) : i("v-if", !0),
|
|
132
|
+
L.value.icon === "icon-close" ? (f(), r(n, {
|
|
133
|
+
key: 2,
|
|
134
|
+
icon: "mdi:close",
|
|
135
|
+
style: u({ color: L.value.color })
|
|
136
|
+
}, null, 8, ["style"])) : i("v-if", !0)
|
|
137
|
+
], 4), o("div", {
|
|
138
|
+
class: "absolute left-0",
|
|
139
|
+
style: u({
|
|
140
|
+
width: `${A.imgWidth * 47 / 310}px`,
|
|
141
|
+
height: `${A.imgHeight}px`,
|
|
142
|
+
top: `-${A.imgHeight + 4}px`,
|
|
143
|
+
left: `${W.value}px`
|
|
144
|
+
})
|
|
145
|
+
}, [o("img", {
|
|
146
|
+
class: "block h-full w-full",
|
|
147
|
+
src: `data:image/png;base64,${N.value}`
|
|
148
|
+
}, null, 8, E)], 4)], 4)], 4)], 36)), [[d, _(G)]]);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
//#endregion
|
|
153
|
+
export { O as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const __VLS_export: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
3
|
+
success: (captchaVerification: string) => any;
|
|
4
|
+
}, string, PublicProps, Readonly<{}> & Readonly<{
|
|
5
|
+
onSuccess?: ((captchaVerification: string) => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../autoImport/$msg/index.mjs";
|
|
2
2
|
import { isFalsy as t } from "../../utils/boolean.mjs";
|
|
3
3
|
import { useClipboard as n } from "@vueuse/core";
|
|
4
|
-
//#region ../../packages/dlzn-ui/plugins/
|
|
4
|
+
//#region ../../packages/dlzn-ui/plugins/directive/index.ts
|
|
5
5
|
var r = { install(r) {
|
|
6
6
|
r.directive("copy", {
|
|
7
7
|
mounted(r, { value: i }) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BarSeriesOption, LineSeriesOption, MapSeriesOption, PieSeriesOption, ScatterSeriesOption } from 'echarts/charts';
|
|
2
|
+
import { DataZoomComponentOption, GraphicComponentOption, GridComponentOption, LegendComponentOption, MarkPointComponentOption, TitleComponentOption, TooltipComponentOption, VisualMapComponentOption } from 'echarts/components';
|
|
3
|
+
import { ComposeOption } from 'echarts/core';
|
|
4
|
+
import { default as VChart } from 'vue-echarts';
|
|
5
|
+
export type OptionType = ComposeOption<BarSeriesOption | DataZoomComponentOption | GraphicComponentOption | GridComponentOption | LegendComponentOption | LineSeriesOption | MapSeriesOption | MarkPointComponentOption | PieSeriesOption | ScatterSeriesOption | TitleComponentOption | TooltipComponentOption | VisualMapComponentOption>;
|
|
6
|
+
export declare const mapFeaturesArr: Array<{
|
|
7
|
+
adcode: number;
|
|
8
|
+
center: [number, number];
|
|
9
|
+
name: string;
|
|
10
|
+
}>;
|
|
11
|
+
export default VChart;
|