@lingshugroup/web-plus 2.6.0 → 2.6.2
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/lib/captchaVerify/index.cjs +1 -0
- package/lib/captchaVerify/index.js +12 -0
- package/lib/index/index.cjs +1 -1
- package/lib/index/index.js +58 -54
- package/lib/index/index.js.br +0 -0
- package/lib/index/index.js.gz +0 -0
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/captchaVerify/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/captchaVerify/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/captchaVerify/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/captchaVerify/Index.vue/index2.js +239 -0
- package/lib/packages/ls-components/components/captchaVerify/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/captchaVerify/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/captchaVerify/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/captchaVerify/types/index.js +37 -0
- package/lib/packages/ls-components/components/index/index.cjs +1 -1
- package/lib/packages/ls-components/components/index/index.js +52 -48
- package/lib/packages/ls-components/components/index/index.js.br +0 -0
- package/lib/packages/ls-components/components/index/index.js.gz +0 -0
- package/lib/packages/ls-components/components/sliceUpload/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/sliceUpload/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/sliceUpload/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/sliceUpload/Index.vue/index2.js +181 -0
- package/lib/packages/ls-components/components/sliceUpload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/sliceUpload/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/sliceUpload/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/sliceUpload/types/index.js +57 -0
- package/lib/packages/ls-components/components/sliceUpload/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/sliceUpload/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +145 -145
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
- package/lib/sliceUpload/index.cjs +1 -0
- package/lib/sliceUpload/index.js +12 -0
- package/package.json +23 -15
package/lib/index.css.br
CHANGED
|
Binary file
|
package/lib/index.css.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-ec7d7969"]]);exports.default=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var W=Object.defineProperty;var l=(v,V)=>W(v,"name",{value:V,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),j=require("../../../../../dialog/index.cjs"),G=require("../types/index.cjs"),Z={key:0,class:"captcha-loading-mask","aria-live":"polite"},J={key:0,class:"captcha-overlay"},K={class:"captcha-overlay-icon"},O={class:"captcha-overlay-text"},Q={class:"captcha-prompt"},Y=["aria-valuenow","aria-disabled"],ee={key:0,class:"captcha-slider-hint"},te={class:"captcha-actions"},ae=["disabled"],ne={class:"captcha-serial-text"},oe=e.defineComponent({name:"LSCaptchaVerify"}),le=e.defineComponent({...oe,name:"LSCaptchaVerify",inheritAttrs:!1,props:e.mergeModels(G.lsCaptchaVerifyProps,{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:e.mergeModels(["refresh","select"],["update:modelValue"]),setup(v,{emit:V}){const o=v,S=V,h=e.useModel(v,"modelValue"),g=60,D=.06,p=e.ref(),k=e.ref(),r=e.ref(!1),s=e.ref(0),f=e.ref(0),b=e.ref(0),i=e.ref([]),w=e.ref(!1);let n=null;const E=e.computed(()=>o.sceneSeed||Date.now()),x=[{bg:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",piece:"rgba(102,126,234,0.7)"},{bg:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",piece:"rgba(245,87,108,0.7)"},{bg:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)",piece:"rgba(79,172,254,0.7)"},{bg:"linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)",piece:"rgba(67,233,123,0.7)"},{bg:"linear-gradient(135deg, #fa709a 0%, #fee140 100%)",piece:"rgba(250,112,154,0.7)"},{bg:"linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%)",piece:"rgba(161,140,209,0.7)"},{bg:"linear-gradient(135deg, #fccb90 0%, #d57eeb 100%)",piece:"rgba(213,126,235,0.7)"},{bg:"linear-gradient(135deg, #96fbc4 0%, #f9f586 100%)",piece:"rgba(150,251,196,0.7)"}],N=["6px","50%","12px 4px","20px 6px 20px 6px","4px 16px","50% 4px 50% 4px","16px 4px 4px 16px","30% 70% 70% 30% / 30% 30% 70% 70%"],C=e.computed(()=>E.value%x.length),P=e.computed(()=>Math.floor(E.value/7)%N.length),B=e.computed(()=>E.value%4*90),$=e.computed(()=>30+E.value%40),z=e.computed(()=>({background:x[C.value].bg})),M=e.computed(()=>Math.max(.15,Math.min(.85,o.targetPercent))),d=e.computed(()=>f.value?Math.min(1,Math.max(0,s.value/f.value)):0),I=e.computed(()=>({left:`${M.value*100}%`,top:`${$.value}%`,width:`${g}px`,height:`${g}px`,borderRadius:N[P.value],transform:`translate(-50%, -50%) rotate(${B.value}deg)`})),F=e.computed(()=>({left:`${d.value*100}%`,top:`${$.value}%`,width:`${g}px`,height:`${g}px`,borderRadius:N[P.value],background:x[C.value].piece,transform:`translate(-50%, -50%) rotate(${B.value}deg)`})),X=e.computed(()=>({transform:`translateX(${s.value}px)`})),q=e.computed(()=>({width:`${s.value+40}px`}));function m(){const t=p.value;t&&(f.value=Math.max(0,t.clientWidth-40))}l(m,"updateMaxDrag");function L(){window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}l(L,"detachWindowPointerListeners");function A(t){const a=k.value;if(a!=null&&a.hasPointerCapture(t.pointerId))try{a.releasePointerCapture(t.pointerId)}catch{}}l(A,"releaseThumbCapture");function c(){L(),r.value=!1,w.value=!1,s.value=0,b.value=0,i.value=[]}l(c,"resetDrag");function H(t){if(o.loading||o.status==="success"||t.button!==0)return;m(),r.value=!0,w.value=!1,s.value=0,b.value=performance.now(),i.value=[{x:0,t:0}],t.currentTarget.setPointerCapture(t.pointerId),window.addEventListener("pointermove",R),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y)}l(H,"onPointerDown");function R(t){if(!r.value||!p.value)return;const a=p.value.getBoundingClientRect(),u=t.clientX-a.left-20;s.value=Math.min(Math.max(0,u),f.value);const T=Math.round(performance.now()-b.value),_=i.value[i.value.length-1];(!_||T-_.t>=16)&&i.value.push({x:Number(d.value.toFixed(4)),t:T})}l(R,"onPointerMove");function y(t){if(L(),A(t),!r.value)return;if(r.value=!1,Math.abs(d.value-M.value)>D){w.value=!0,setTimeout(c,300);return}s.value=M.value*f.value;const u=Math.max(1,Math.round(performance.now()-b.value));i.value.push({x:Number(d.value.toFixed(4)),t:u}),S("select",{dragPercent:Number(d.value.toFixed(4)),durationMs:u,trace:i.value.slice(-300)})}l(y,"onPointerEnd");function U(){c(),S("refresh")}return l(U,"onRefresh"),e.watch(()=>[o.status,o.loading],([t,a])=>{(t==="error"||t==="idle"&&!a)&&c()}),e.watch(()=>[o.serialNo,o.sceneSeed],()=>{h.value&&c()}),e.watch(h,t=>{t?e.nextTick(()=>{m();const a=p.value;a&&typeof ResizeObserver<"u"&&(n==null||n.disconnect(),n=new ResizeObserver(()=>m()),n.observe(a))}):(n==null||n.disconnect(),n=null,c())}),e.onMounted(()=>{window.addEventListener("resize",m)}),e.onBeforeUnmount(()=>{n==null||n.disconnect(),n=null,window.removeEventListener("resize",m),c()}),(t,a)=>(e.openBlock(),e.createBlock(e.unref(j.default),e.mergeProps({modelValue:h.value,"onUpdate:modelValue":a[0]||(a[0]=u=>h.value=u),title:"安全验证",width:"420px","has-footer":!1,"destroy-on-close":""},t.$attrs),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["captcha-wrap",{"is-slider-dragging":e.unref(r)}])},[t.loading?(e.openBlock(),e.createElementBlock("div",Z,a[1]||(a[1]=[e.createElementVNode("span",{class:"captcha-loading-dot"},null,-1),e.createElementVNode("span",null,"验证中…",-1)]))):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["captcha-scene",`is-${t.status}`]),style:e.normalizeStyle(e.unref(z))},[e.createElementVNode("div",{class:"captcha-hole",style:e.normalizeStyle(e.unref(I))},null,4),e.createElementVNode("div",{class:"captcha-piece",style:e.normalizeStyle(e.unref(F))},null,4),t.status!=="idle"?(e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("span",K,e.toDisplayString(t.status==="success"?"✓":"✗"),1),e.createElementVNode("span",O,e.toDisplayString(t.status==="success"?"验证通过":t.status==="error"?"不通过":"验证失败,请重试"),1)])):e.createCommentVNode("",!0)],6),e.createElementVNode("div",Q,e.toDisplayString(o.prompt),1),e.createElementVNode("div",{ref_key:"sliderRef",ref:p,class:e.normalizeClass(["captcha-slider",{"is-dragging":e.unref(r),"is-fail":e.unref(w),"is-loading":t.loading,"is-success":t.status==="success","is-error":t.status==="error"}]),role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.unref(d)*100),"aria-disabled":t.loading||t.status==="success"},[e.createElementVNode("div",{class:"captcha-slider-fill",style:e.normalizeStyle(e.unref(q))},null,4),e.createElementVNode("div",{ref_key:"thumbRef",ref:k,class:"captcha-slider-thumb",style:e.normalizeStyle(e.unref(X)),onPointerdown:e.withModifiers(H,["prevent"])},a[2]||(a[2]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2.5"},[e.createElementVNode("path",{d:"M9 18l6-6-6-6"}),e.createElementVNode("path",{d:"M4 18l6-6-6-6"})],-1)]),36),!e.unref(r)&&t.status==="idle"&&e.unref(s)===0?(e.openBlock(),e.createElementBlock("span",ee," 向右拖动滑块完成拼图 ")):e.createCommentVNode("",!0)],10,Y),e.createElementVNode("div",te,[e.createElementVNode("button",{type:"button",class:"captcha-action-btn",disabled:t.loading,onClick:U},a[3]||(a[3]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M1 4v6h6"}),e.createElementVNode("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})],-1),e.createTextVNode(" 换一张 ",-1)]),8,ae),e.createElementVNode("span",ne,e.toDisplayString(t.serialNo),1)])],2)]),_:1},16,["modelValue"]))}});exports.default=le;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
var ne = Object.defineProperty;
|
|
2
|
+
var i = (w, L) => ne(w, "name", { value: L, configurable: !0 });
|
|
3
|
+
import { defineComponent as j, mergeModels as Z, useModel as se, ref as d, computed as s, watch as B, nextTick as oe, onMounted as le, onBeforeUnmount as ie, createBlock as re, openBlock as S, unref as o, mergeProps as ce, withCtx as de, createElementVNode as a, normalizeClass as N, createElementBlock as T, createCommentVNode as _, normalizeStyle as b, toDisplayString as P, withModifiers as ue, createTextVNode as pe } from "vue";
|
|
4
|
+
import ve from "../../../../../dialog/index.js";
|
|
5
|
+
import { lsCaptchaVerifyProps as fe } from "../types/index.js";
|
|
6
|
+
const he = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "captcha-loading-mask",
|
|
9
|
+
"aria-live": "polite"
|
|
10
|
+
}, ge = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "captcha-overlay"
|
|
13
|
+
}, me = { class: "captcha-overlay-icon" }, be = { class: "captcha-overlay-text" }, we = { class: "captcha-prompt" }, xe = ["aria-valuenow", "aria-disabled"], ye = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "captcha-slider-hint"
|
|
16
|
+
}, Me = { class: "captcha-actions" }, Ee = ["disabled"], ke = { class: "captcha-serial-text" }, Ce = j({
|
|
17
|
+
name: "LSCaptchaVerify"
|
|
18
|
+
}), Re = /* @__PURE__ */ j({
|
|
19
|
+
...Ce,
|
|
20
|
+
name: "LSCaptchaVerify",
|
|
21
|
+
inheritAttrs: !1,
|
|
22
|
+
props: /* @__PURE__ */ Z(fe, {
|
|
23
|
+
modelValue: { type: Boolean, default: !1 },
|
|
24
|
+
modelModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: /* @__PURE__ */ Z(["refresh", "select"], ["update:modelValue"]),
|
|
27
|
+
setup(w, { emit: L }) {
|
|
28
|
+
const l = w, D = L, x = se(w, "modelValue"), y = 60, q = 0.06, h = d(), I = d(), r = d(!1), c = d(0), g = d(0), M = d(0), u = d([]), E = d(!1);
|
|
29
|
+
let n = null;
|
|
30
|
+
const k = s(() => l.sceneSeed || Date.now()), $ = [
|
|
31
|
+
{ bg: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)", piece: "rgba(102,126,234,0.7)" },
|
|
32
|
+
{ bg: "linear-gradient(135deg, #f093fb 0%, #f5576c 100%)", piece: "rgba(245,87,108,0.7)" },
|
|
33
|
+
{ bg: "linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)", piece: "rgba(79,172,254,0.7)" },
|
|
34
|
+
{ bg: "linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)", piece: "rgba(67,233,123,0.7)" },
|
|
35
|
+
{ bg: "linear-gradient(135deg, #fa709a 0%, #fee140 100%)", piece: "rgba(250,112,154,0.7)" },
|
|
36
|
+
{ bg: "linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%)", piece: "rgba(161,140,209,0.7)" },
|
|
37
|
+
{ bg: "linear-gradient(135deg, #fccb90 0%, #d57eeb 100%)", piece: "rgba(213,126,235,0.7)" },
|
|
38
|
+
{ bg: "linear-gradient(135deg, #96fbc4 0%, #f9f586 100%)", piece: "rgba(150,251,196,0.7)" }
|
|
39
|
+
], R = [
|
|
40
|
+
"6px",
|
|
41
|
+
"50%",
|
|
42
|
+
"12px 4px",
|
|
43
|
+
"20px 6px 20px 6px",
|
|
44
|
+
"4px 16px",
|
|
45
|
+
"50% 4px 50% 4px",
|
|
46
|
+
"16px 4px 4px 16px",
|
|
47
|
+
"30% 70% 70% 30% / 30% 30% 70% 70%"
|
|
48
|
+
], F = s(() => k.value % $.length), X = s(() => Math.floor(k.value / 7) % R.length), A = s(() => k.value % 4 * 90), H = s(() => 30 + k.value % 40), J = s(() => ({
|
|
49
|
+
background: $[F.value].bg
|
|
50
|
+
})), V = s(() => Math.max(0.15, Math.min(0.85, l.targetPercent))), v = s(() => g.value ? Math.min(1, Math.max(0, c.value / g.value)) : 0), K = s(() => ({
|
|
51
|
+
left: `${V.value * 100}%`,
|
|
52
|
+
top: `${H.value}%`,
|
|
53
|
+
width: `${y}px`,
|
|
54
|
+
height: `${y}px`,
|
|
55
|
+
borderRadius: R[X.value],
|
|
56
|
+
transform: `translate(-50%, -50%) rotate(${A.value}deg)`
|
|
57
|
+
})), Q = s(() => ({
|
|
58
|
+
left: `${v.value * 100}%`,
|
|
59
|
+
top: `${H.value}%`,
|
|
60
|
+
width: `${y}px`,
|
|
61
|
+
height: `${y}px`,
|
|
62
|
+
borderRadius: R[X.value],
|
|
63
|
+
background: $[F.value].piece,
|
|
64
|
+
transform: `translate(-50%, -50%) rotate(${A.value}deg)`
|
|
65
|
+
})), Y = s(() => ({
|
|
66
|
+
transform: `translateX(${c.value}px)`
|
|
67
|
+
})), O = s(() => ({
|
|
68
|
+
width: `${c.value + 40}px`
|
|
69
|
+
}));
|
|
70
|
+
function m() {
|
|
71
|
+
const e = h.value;
|
|
72
|
+
e && (g.value = Math.max(0, e.clientWidth - 40));
|
|
73
|
+
}
|
|
74
|
+
i(m, "updateMaxDrag");
|
|
75
|
+
function U() {
|
|
76
|
+
window.removeEventListener("pointermove", W), window.removeEventListener("pointerup", C), window.removeEventListener("pointercancel", C);
|
|
77
|
+
}
|
|
78
|
+
i(U, "detachWindowPointerListeners");
|
|
79
|
+
function ee(e) {
|
|
80
|
+
const t = I.value;
|
|
81
|
+
if (t != null && t.hasPointerCapture(e.pointerId))
|
|
82
|
+
try {
|
|
83
|
+
t.releasePointerCapture(e.pointerId);
|
|
84
|
+
} catch {
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
i(ee, "releaseThumbCapture");
|
|
88
|
+
function p() {
|
|
89
|
+
U(), r.value = !1, E.value = !1, c.value = 0, M.value = 0, u.value = [];
|
|
90
|
+
}
|
|
91
|
+
i(p, "resetDrag");
|
|
92
|
+
function te(e) {
|
|
93
|
+
if (l.loading || l.status === "success" || e.button !== 0)
|
|
94
|
+
return;
|
|
95
|
+
m(), r.value = !0, E.value = !1, c.value = 0, M.value = performance.now(), u.value = [{ x: 0, t: 0 }], e.currentTarget.setPointerCapture(e.pointerId), window.addEventListener("pointermove", W), window.addEventListener("pointerup", C), window.addEventListener("pointercancel", C);
|
|
96
|
+
}
|
|
97
|
+
i(te, "onPointerDown");
|
|
98
|
+
function W(e) {
|
|
99
|
+
if (!r.value || !h.value)
|
|
100
|
+
return;
|
|
101
|
+
const t = h.value.getBoundingClientRect(), f = e.clientX - t.left - 20;
|
|
102
|
+
c.value = Math.min(Math.max(0, f), g.value);
|
|
103
|
+
const z = Math.round(performance.now() - M.value), G = u.value[u.value.length - 1];
|
|
104
|
+
(!G || z - G.t >= 16) && u.value.push({ x: Number(v.value.toFixed(4)), t: z });
|
|
105
|
+
}
|
|
106
|
+
i(W, "onPointerMove");
|
|
107
|
+
function C(e) {
|
|
108
|
+
if (U(), ee(e), !r.value)
|
|
109
|
+
return;
|
|
110
|
+
if (r.value = !1, Math.abs(v.value - V.value) > q) {
|
|
111
|
+
E.value = !0, setTimeout(p, 300);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
c.value = V.value * g.value;
|
|
115
|
+
const f = Math.max(1, Math.round(performance.now() - M.value));
|
|
116
|
+
u.value.push({ x: Number(v.value.toFixed(4)), t: f }), D("select", {
|
|
117
|
+
dragPercent: Number(v.value.toFixed(4)),
|
|
118
|
+
durationMs: f,
|
|
119
|
+
trace: u.value.slice(-300)
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
i(C, "onPointerEnd");
|
|
123
|
+
function ae() {
|
|
124
|
+
p(), D("refresh");
|
|
125
|
+
}
|
|
126
|
+
return i(ae, "onRefresh"), B(() => [l.status, l.loading], ([e, t]) => {
|
|
127
|
+
(e === "error" || e === "idle" && !t) && p();
|
|
128
|
+
}), B(() => [l.serialNo, l.sceneSeed], () => {
|
|
129
|
+
x.value && p();
|
|
130
|
+
}), B(x, (e) => {
|
|
131
|
+
e ? oe(() => {
|
|
132
|
+
m();
|
|
133
|
+
const t = h.value;
|
|
134
|
+
t && typeof ResizeObserver < "u" && (n == null || n.disconnect(), n = new ResizeObserver(() => m()), n.observe(t));
|
|
135
|
+
}) : (n == null || n.disconnect(), n = null, p());
|
|
136
|
+
}), le(() => {
|
|
137
|
+
window.addEventListener("resize", m);
|
|
138
|
+
}), ie(() => {
|
|
139
|
+
n == null || n.disconnect(), n = null, window.removeEventListener("resize", m), p();
|
|
140
|
+
}), (e, t) => (S(), re(o(ve), ce({
|
|
141
|
+
modelValue: x.value,
|
|
142
|
+
"onUpdate:modelValue": t[0] || (t[0] = (f) => x.value = f),
|
|
143
|
+
title: "安全验证",
|
|
144
|
+
width: "420px",
|
|
145
|
+
"has-footer": !1,
|
|
146
|
+
"destroy-on-close": ""
|
|
147
|
+
}, e.$attrs), {
|
|
148
|
+
default: de(() => [
|
|
149
|
+
a("div", {
|
|
150
|
+
class: N(["captcha-wrap", { "is-slider-dragging": o(r) }])
|
|
151
|
+
}, [
|
|
152
|
+
e.loading ? (S(), T("div", he, t[1] || (t[1] = [
|
|
153
|
+
a("span", { class: "captcha-loading-dot" }, null, -1),
|
|
154
|
+
a("span", null, "验证中…", -1)
|
|
155
|
+
]))) : _("", !0),
|
|
156
|
+
a("div", {
|
|
157
|
+
class: N(["captcha-scene", `is-${e.status}`]),
|
|
158
|
+
style: b(o(J))
|
|
159
|
+
}, [
|
|
160
|
+
a("div", {
|
|
161
|
+
class: "captcha-hole",
|
|
162
|
+
style: b(o(K))
|
|
163
|
+
}, null, 4),
|
|
164
|
+
a("div", {
|
|
165
|
+
class: "captcha-piece",
|
|
166
|
+
style: b(o(Q))
|
|
167
|
+
}, null, 4),
|
|
168
|
+
e.status !== "idle" ? (S(), T("div", ge, [
|
|
169
|
+
a("span", me, P(e.status === "success" ? "✓" : "✗"), 1),
|
|
170
|
+
a("span", be, P(e.status === "success" ? "验证通过" : e.status === "error" ? "不通过" : "验证失败,请重试"), 1)
|
|
171
|
+
])) : _("", !0)
|
|
172
|
+
], 6),
|
|
173
|
+
a("div", we, P(l.prompt), 1),
|
|
174
|
+
a("div", {
|
|
175
|
+
ref_key: "sliderRef",
|
|
176
|
+
ref: h,
|
|
177
|
+
class: N(["captcha-slider", { "is-dragging": o(r), "is-fail": o(E), "is-loading": e.loading, "is-success": e.status === "success", "is-error": e.status === "error" }]),
|
|
178
|
+
role: "slider",
|
|
179
|
+
"aria-valuemin": 0,
|
|
180
|
+
"aria-valuemax": 100,
|
|
181
|
+
"aria-valuenow": Math.round(o(v) * 100),
|
|
182
|
+
"aria-disabled": e.loading || e.status === "success"
|
|
183
|
+
}, [
|
|
184
|
+
a("div", {
|
|
185
|
+
class: "captcha-slider-fill",
|
|
186
|
+
style: b(o(O))
|
|
187
|
+
}, null, 4),
|
|
188
|
+
a("div", {
|
|
189
|
+
ref_key: "thumbRef",
|
|
190
|
+
ref: I,
|
|
191
|
+
class: "captcha-slider-thumb",
|
|
192
|
+
style: b(o(Y)),
|
|
193
|
+
onPointerdown: ue(te, ["prevent"])
|
|
194
|
+
}, t[2] || (t[2] = [
|
|
195
|
+
a("svg", {
|
|
196
|
+
viewBox: "0 0 24 24",
|
|
197
|
+
width: "20",
|
|
198
|
+
height: "20",
|
|
199
|
+
fill: "none",
|
|
200
|
+
stroke: "currentColor",
|
|
201
|
+
"stroke-width": "2.5"
|
|
202
|
+
}, [
|
|
203
|
+
a("path", { d: "M9 18l6-6-6-6" }),
|
|
204
|
+
a("path", { d: "M4 18l6-6-6-6" })
|
|
205
|
+
], -1)
|
|
206
|
+
]), 36),
|
|
207
|
+
!o(r) && e.status === "idle" && o(c) === 0 ? (S(), T("span", ye, " 向右拖动滑块完成拼图 ")) : _("", !0)
|
|
208
|
+
], 10, xe),
|
|
209
|
+
a("div", Me, [
|
|
210
|
+
a("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
class: "captcha-action-btn",
|
|
213
|
+
disabled: e.loading,
|
|
214
|
+
onClick: ae
|
|
215
|
+
}, t[3] || (t[3] = [
|
|
216
|
+
a("svg", {
|
|
217
|
+
viewBox: "0 0 24 24",
|
|
218
|
+
width: "16",
|
|
219
|
+
height: "16",
|
|
220
|
+
fill: "none",
|
|
221
|
+
stroke: "currentColor",
|
|
222
|
+
"stroke-width": "2"
|
|
223
|
+
}, [
|
|
224
|
+
a("path", { d: "M1 4v6h6" }),
|
|
225
|
+
a("path", { d: "M3.51 15a9 9 0 1 0 2.13-9.36L1 10" })
|
|
226
|
+
], -1),
|
|
227
|
+
pe(" 换一张 ", -1)
|
|
228
|
+
]), 8, Ee),
|
|
229
|
+
a("span", ke, P(e.serialNo), 1)
|
|
230
|
+
])
|
|
231
|
+
], 2)
|
|
232
|
+
]),
|
|
233
|
+
_: 1
|
|
234
|
+
}, 16, ["modelValue"]));
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
export {
|
|
238
|
+
Re as default
|
|
239
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../_utils/runtime/index.cjs"),t=e.buildProps({loading:{type:Boolean,default:!1},prompt:{type:String,default:"按住滑块拖动拼图到缺口处"},targetPercent:{type:Number,default:.5},status:{type:String,values:["idle","error","success"],default:"idle"},sceneSeed:{type:Number,default:0},serialNo:{type:String,default:""}});exports.lsCaptchaVerifyProps=t;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { buildProps as e } from "../../_utils/runtime/index.js";
|
|
2
|
+
const r = e({
|
|
3
|
+
/** 验证中 loading 状态 */
|
|
4
|
+
loading: {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
default: !1
|
|
7
|
+
},
|
|
8
|
+
/** 提示文案 */
|
|
9
|
+
prompt: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "按住滑块拖动拼图到缺口处"
|
|
12
|
+
},
|
|
13
|
+
/** 缺口目标位置百分比(0-1) */
|
|
14
|
+
targetPercent: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 0.5
|
|
17
|
+
},
|
|
18
|
+
/** 验证状态 */
|
|
19
|
+
status: {
|
|
20
|
+
type: String,
|
|
21
|
+
values: ["idle", "error", "success"],
|
|
22
|
+
default: "idle"
|
|
23
|
+
},
|
|
24
|
+
/** 场景种子,用于生成不同主题和形状 */
|
|
25
|
+
sceneSeed: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 0
|
|
28
|
+
},
|
|
29
|
+
/** 验证码序列号 */
|
|
30
|
+
serialNo: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
r as lsCaptchaVerifyProps
|
|
37
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var o=(t,r)=>l(t,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@element-plus/icons-vue"),s=require("../../../../backTop/index.cjs"),d=require("../../../../bellMessage/index.cjs"),f=require("../../../../breadcrumb/index.cjs"),i=require("../../../../button/index.cjs"),S=require("../../../../
|
|
1
|
+
"use strict";var l=Object.defineProperty;var o=(t,r)=>l(t,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@element-plus/icons-vue"),s=require("../../../../backTop/index.cjs"),d=require("../../../../bellMessage/index.cjs"),f=require("../../../../breadcrumb/index.cjs"),i=require("../../../../button/index.cjs"),S=require("../../../../captchaVerify/index.cjs"),L=require("../../../../chart/index.cjs"),p=require("../../../../confirm/index.cjs"),q=require("../../../../containerBox/index.cjs"),m=require("../../../../cropper/index.cjs"),b=require("../../../../descriptions/index.cjs"),g=require("../../../../dialog/index.cjs"),v=require("../../../../downloadFile/index.cjs"),P=require("../../../../editor/index.cjs"),c=require("../../../../form/index.cjs"),w=require("../../../../icon/index.cjs"),y=require("../../../../layout/index.cjs"),B=require("../../../../list/index.cjs"),_=require("../../../../live/index.cjs"),O=require("../../../../map/index.cjs"),j=require("../../../../menu/index.cjs"),x=require("../../../../preview_docx/index.cjs"),M=require("../../../../preview_image/index.cjs"),T=require("../../../../preview_pdf/index.cjs"),k=require("../../../../preview_xlsx/index.cjs"),D=require("../../../../print/index.cjs"),F=require("../../../../sliceUpload/index.cjs"),I=require("../../../../table/index.cjs"),C=require("../../../../tooltip/index.cjs"),h=require("../../../../tree/index.cjs"),V=require("../../../../upload/index.cjs");function E(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:o(()=>t[e],"get")})}}return r.default=t,Object.freeze(r)}o(E,"_interopNamespaceDefault");const U=E(a),u={LSButtonGroup:i.LSButtonGroup,LSButton:i.LSButton,LSDescriptions:b.default,LSUpload:V.default,LSForm:c.LSForm,LSFormItem:c.LSFormItem,LSTable:I.default,LSMenu:j.default,LSIcon:w.default,LSConfirm:p.default,LSChart:L.default,LSBreadcrumb:f.default,LSBellMessage:d.default,LSLive:_.default,LSTree:h.default,LSPrint:D.default,LSContainerBox:q.default,LSBackTop:s.default,LSMap:O.default,LSEditor:P.default,LSDialog:g.default,LSLayout:y.default,LSList:B.default,LSPreviewImage:M.default,LSPreviewDocx:x.default,LSPreviewPdf:T.default,LSPreviewXlsx:k.default,LSDownloadFile:v.default,LSSliceUpload:F.default,LSTooltip:C.default,LSCropper:m.default,LSCaptchaVerify:S.default};function G(t){for(const[r,e]of Object.entries(U))t.component(r,e);for(const r of Object.keys(u)){const e=u[r];t.component(e==null?void 0:e.name,e)}}o(G,"install");const z={...u,install:G};exports.default=z;
|
|
@@ -5,63 +5,67 @@ import f from "../../../../backTop/index.js";
|
|
|
5
5
|
import L from "../../../../bellMessage/index.js";
|
|
6
6
|
import S from "../../../../breadcrumb/index.js";
|
|
7
7
|
import { LSButton as n, LSButtonGroup as s } from "../../../../button/index.js";
|
|
8
|
+
import a from "../../../../captchaVerify/index.js";
|
|
8
9
|
import c from "../../../../chart/index.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { LSFormItem as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
10
|
+
import l from "../../../../confirm/index.js";
|
|
11
|
+
import u from "../../../../containerBox/index.js";
|
|
12
|
+
import P from "../../../../cropper/index.js";
|
|
13
|
+
import d from "../../../../descriptions/index.js";
|
|
14
|
+
import B from "../../../../dialog/index.js";
|
|
15
|
+
import b from "../../../../downloadFile/index.js";
|
|
16
|
+
import v from "../../../../editor/index.js";
|
|
17
|
+
import { LSFormItem as w, LSForm as y } from "../../../../form/index.js";
|
|
18
|
+
import C from "../../../../icon/index.js";
|
|
19
|
+
import k from "../../../../layout/index.js";
|
|
20
|
+
import x from "../../../../list/index.js";
|
|
21
|
+
import D from "../../../../live/index.js";
|
|
22
|
+
import I from "../../../../map/index.js";
|
|
23
|
+
import T from "../../../../menu/index.js";
|
|
24
|
+
import g from "../../../../preview_docx/index.js";
|
|
25
|
+
import F from "../../../../preview_image/index.js";
|
|
26
|
+
import M from "../../../../preview_pdf/index.js";
|
|
27
|
+
import h from "../../../../preview_xlsx/index.js";
|
|
27
28
|
import j from "../../../../print/index.js";
|
|
28
|
-
import E from "../../../../
|
|
29
|
-
import O from "../../../../
|
|
30
|
-
import
|
|
29
|
+
import E from "../../../../sliceUpload/index.js";
|
|
30
|
+
import O from "../../../../table/index.js";
|
|
31
|
+
import U from "../../../../tooltip/index.js";
|
|
32
|
+
import V from "../../../../tree/index.js";
|
|
31
33
|
import G from "../../../../upload/index.js";
|
|
32
34
|
const t = {
|
|
33
35
|
LSButtonGroup: s,
|
|
34
36
|
LSButton: n,
|
|
35
|
-
LSDescriptions:
|
|
37
|
+
LSDescriptions: d,
|
|
36
38
|
LSUpload: G,
|
|
37
|
-
LSForm:
|
|
38
|
-
LSFormItem:
|
|
39
|
-
LSTable:
|
|
40
|
-
LSMenu:
|
|
41
|
-
LSIcon:
|
|
42
|
-
LSConfirm:
|
|
39
|
+
LSForm: y,
|
|
40
|
+
LSFormItem: w,
|
|
41
|
+
LSTable: O,
|
|
42
|
+
LSMenu: T,
|
|
43
|
+
LSIcon: C,
|
|
44
|
+
LSConfirm: l,
|
|
43
45
|
LSChart: c,
|
|
44
46
|
LSBreadcrumb: S,
|
|
45
47
|
LSBellMessage: L,
|
|
46
|
-
LSLive:
|
|
47
|
-
LSTree:
|
|
48
|
+
LSLive: D,
|
|
49
|
+
LSTree: V,
|
|
48
50
|
LSPrint: j,
|
|
49
|
-
LSContainerBox:
|
|
51
|
+
LSContainerBox: u,
|
|
50
52
|
LSBackTop: f,
|
|
51
|
-
LSMap:
|
|
52
|
-
LSEditor:
|
|
53
|
-
LSDialog:
|
|
54
|
-
LSLayout:
|
|
55
|
-
LSList:
|
|
56
|
-
LSPreviewImage:
|
|
57
|
-
LSPreviewDocx:
|
|
58
|
-
LSPreviewPdf:
|
|
59
|
-
LSPreviewXlsx:
|
|
60
|
-
LSDownloadFile:
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
LSMap: I,
|
|
54
|
+
LSEditor: v,
|
|
55
|
+
LSDialog: B,
|
|
56
|
+
LSLayout: k,
|
|
57
|
+
LSList: x,
|
|
58
|
+
LSPreviewImage: F,
|
|
59
|
+
LSPreviewDocx: g,
|
|
60
|
+
LSPreviewPdf: M,
|
|
61
|
+
LSPreviewXlsx: h,
|
|
62
|
+
LSDownloadFile: b,
|
|
63
|
+
LSSliceUpload: E,
|
|
64
|
+
LSTooltip: U,
|
|
65
|
+
LSCropper: P,
|
|
66
|
+
LSCaptchaVerify: a
|
|
63
67
|
};
|
|
64
|
-
function
|
|
68
|
+
function W(m) {
|
|
65
69
|
for (const [r, o] of Object.entries(p))
|
|
66
70
|
m.component(r, o);
|
|
67
71
|
for (const r of Object.keys(t)) {
|
|
@@ -69,11 +73,11 @@ function U(m) {
|
|
|
69
73
|
m.component(o == null ? void 0 : o.name, o);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
|
-
i(
|
|
73
|
-
const
|
|
76
|
+
i(W, "install");
|
|
77
|
+
const Bo = {
|
|
74
78
|
...t,
|
|
75
|
-
install:
|
|
79
|
+
install: W
|
|
76
80
|
};
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
Bo as default
|
|
79
83
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=/* empty css */u=t.default(e.default,[["__scopeId","data-v-d0c4aaaa"]]);exports.default=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var G=Object.defineProperty;var f=(y,z)=>G(y,"name",{value:z,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const J=;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),K=/* empty css */Q=/* empty css */$=/* empty css */X={key:0,class:"slice-progress-wrap"},Y={class:"slice-progress-label"},Z=e.defineComponent({name:"LSSliceUpload"}),x=e.defineComponent({...Z,props:$.lsSliceUploadProps,emits:$.emitNames,setup(y,{expose:z,emit:M}){const l=y,h=M,g=e.useSlots(),T=K.useNamespace("slice-upload").b(),E=e.ref(),r=e.ref({strokeWidth:15,striped:!0,stripedFlow:!0,percentage:0,duration:10}),v=e.ref([]),c=e.ref([]),o=e.ref([]),U=e.ref([]),k=e.ref(0),u=e.ref(0),s=e.ref(""),_=e.ref(0),p=e.ref(new Set),R=e.ref(null),d=e.ref(!1),S=e.computed(()=>l.maxErrorNum<=_.value),D=e.computed(()=>c.value.length===u.value&&u.value>0);function b(){c.value=[],o.value=[],U.value=[],r.value.status="",r.value.percentage=0,k.value=0,u.value=0,s.value="",_.value=0,v.value=[],p.value.clear(),R.value=null,d.value=!1}f(b,"reset");function B(){return u.value===0?0:Math.ceil(c.value.length/u.value*100)}f(B,"setPercentage");async function F(n){const{file:a}=n;if(a)return R.value=a,b(),u.value=Math.ceil(a.size/l.chunkSize),s.value=`${a.name}-${a.size}-${a.lastModified}`,d.value=!0,new Promise((q,C)=>{const w=Math.min(l.initRequestNum,u.value);let m=!1;function O(){if(!m){if(S.value||k.value===0&&o.value.length>0){m=!0,r.value.status="exception",d.value=!1,h("onUploadError",{errChunk:o.value,fileHash:s.value}),C(new Error("分片上传失败")),l.cancelUploadInLimit&&v.value.forEach(t=>t==null?void 0:t.abort());return}if(D.value)if(m=!0,r.value.status="success",d.value=!1,l.mergeRequest&&typeof l.mergeRequest=="function")l.mergeRequest({fileHash:s.value,fileName:a.name,chunkTotal:u.value,...l.mergeRequestParams}).then(t=>{h("onUploadSuccess",t),q(t)}).catch(t=>{h("onUploadError",{error:t,fileHash:s.value}),C(t)});else{const t={fileHash:s.value,fileName:a.name,chunkTotal:u.value,chunkDatas:U.value};h("onUploadSuccess",t),q(t)}}}f(O,"checkDone");async function P(t){if(c.value.includes(t)||p.value.has(t)||S.value||m)return;k.value++,p.value.add(t);const H=t*l.chunkSize,j=Math.min(H+l.chunkSize,a.size),A=a.slice(H,j);v.value[t]=new AbortController;const L=v.value[t].signal,i=new FormData;i.append("file",A),i.append("chunk",String(t+1)),i.append("chunkTotal",String(u.value)),i.append("fileHash",s.value),i.append("fileName",a.name),i.append("fileSize",String(a.size));const W=l.chunkUploadRequestParams?Object.assign({},l.chunkUploadRequestParams,{chunk:t+1,chunkTotal:u.value,fileHash:s.value,fileName:a.name,fileSize:a.size,formData:i}):{chunk:t+1,chunkTotal:u.value,fileHash:s.value,fileName:a.name,fileSize:a.size,formData:i};try{const N=await l.chunkUploadRequest(Object.assign(W),l.chunkUploadRequestConfig||{signal:L});U.value[t]=N,c.value.includes(t)||c.value.push(t)}catch{_.value++,o.value.includes(t)||o.value.push(t)}finally{if(k.value--,p.value.delete(t),r.value.percentage=B(),O(),!m&&!S.value){const N=V();N!==-1&&P(N)}}}f(P,"doUploadChunk");function V(){for(let t=0;t<u.value;t++)if(!c.value.includes(t)&&!o.value.includes(t)&&!p.value.has(t))return t;return o.value.length>0&&!S.value?o.value.shift():-1}f(V,"findNextChunk");for(let t=0;t<w;t++)P(t)})}return f(F,"sliceHttpRequest"),e.onUnmounted(()=>{v.value.forEach(n=>n==null?void 0:n.abort())}),z({uploadRef:E,reset:b}),(n,a)=>{const q=J.ElProgress;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(T))},[e.createVNode(Q.default,e.mergeProps({ref_key:"uploadRef",ref:E},n.$attrs,{action:l.action,"http-request":F}),e.createSlots({_:2},[e.unref(g).trigger?{name:"trigger",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"trigger",{},void 0,!0)]),key:"0"}:void 0,e.unref(g).default?{name:"default",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),key:"1"}:void 0,e.unref(g).tip?{name:"tip",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"tip",{},void 0,!0)]),key:"2"}:void 0,e.unref(g).file?{name:"file",fn:e.withCtx(({file:C,index:w})=>[e.renderSlot(n.$slots,"file",{file:C,index:w},void 0,!0)]),key:"3"}:void 0]),1040,["action"]),e.unref(d)||e.unref(r).percentage>0?(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",Y," 分片上传进度:"+e.toDisplayString(e.unref(r).percentage)+"% ",1),e.createVNode(q,e.normalizeProps(e.guardReactiveProps(Object.assign(e.unref(r),n.$attrs))),null,16)])):e.createCommentVNode("",!0)],2)}}});exports.default=x;
|