@lingshugroup/web-plus 1.7.0 → 1.7.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/hooks/index.cjs +1 -1
- package/lib/hooks/index.js +6 -8
- 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/_hooks/useOptionHook/index.cjs +1 -1
- package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js +37 -32
- package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js.br +0 -0
- package/lib/packages/ls-components/components/_hooks/useOptionHook/index.js.gz +0 -0
- package/lib/packages/ls-components/components/button/Button.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/button/Button.vue/index.js +2 -2
- package/lib/packages/ls-components/components/button/Button.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/button/Button.vue/index2.js +14 -14
- package/lib/packages/ls-components/components/button/Button.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/button/Button.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/button/ButtonGroup.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/button/ButtonGroup.vue/index.js +2 -2
- package/lib/packages/ls-components/components/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +3 -5
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/editor/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/editor/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/editor/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/editor/Index.vue/index2.js +75 -58
- package/lib/packages/ls-components/components/editor/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/editor/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/editor/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/editor/types/index.js +19 -4
- package/lib/packages/ls-components/components/editor/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/editor/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/menu/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js +37 -35
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js +10 -10
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview_image/Image.vue/index.js +1 -1
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js +3 -3
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.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 +172 -162
- 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/types/components/_hooks/index.d.ts +1 -2
- package/lib/types/components/_hooks/useOptionHook.d.ts +3 -3
- package/lib/types/components/dialog/Index.vue.d.ts +1 -1
- package/lib/types/components/editor/Index.vue.d.ts +9 -0
- package/lib/types/components/editor/index.d.ts +18 -0
- package/lib/types/components/editor/types.d.ts +3 -0
- package/lib/types/components/form/FormItem.vue.d.ts +23 -23
- package/lib/types/components/form/index.d.ts +23 -23
- package/lib/types/components/form/types.d.ts +1 -1
- package/lib/types/components/menu/types.d.ts +1 -1
- package/lib/types/components/upload/types.d.ts +1 -0
- package/package.json +1 -1
- package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.cjs +0 -1
- package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js +0 -222
- package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js.br +0 -0
- package/lib/node_modules/.pnpm/colorthief@2.4.0/node_modules/colorthief/dist/color-thief/index.js.gz +0 -0
- package/lib/packages/ls-components/components/_hooks/useColorthiefHook/index.cjs +0 -1
- package/lib/packages/ls-components/components/_hooks/useColorthiefHook/index.js +0 -23
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var u = (
|
|
1
|
+
var Re = Object.defineProperty;
|
|
2
|
+
var u = (O, j) => Re(O, "name", { value: j, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
import { lsUploadProps as
|
|
9
|
-
import { getVariable as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import
|
|
7
|
+
import { defineComponent as _e, useSlots as ze, useAttrs as Ne, ref as ne, reactive as le, watch as J, computed as s, openBlock as c, createElementBlock as f, normalizeClass as B, unref as n, createVNode as Q, mergeProps as Be, createSlots as Ve, withCtx as F, Fragment as k, createBlock as h, createElementVNode as V, toDisplayString as D, createTextVNode as $, createCommentVNode as I, renderSlot as q, toRefs as oe } from "vue";
|
|
8
|
+
import { lsUploadProps as De, UPLOAD_TYPE_MAP as Ie, fileTypeMap as qe, UPLOAD_STATUS_MAP as Oe, IMG_SUFFIX_LIST as je } from "../types/index.js";
|
|
9
|
+
import { getVariable as He } from "../../_utils/config/index.js";
|
|
10
|
+
import { useNamespace as Ge } from "../../_hooks/useNamespace/index.js";
|
|
11
|
+
import C from "../../button/Button.vue/index.js";
|
|
12
12
|
import ae from "../../icon/Index.vue/index.js";
|
|
13
|
-
import
|
|
13
|
+
import Ke from "../../../../../preview_image/index.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
import { ElMessage as x } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
|
|
17
|
-
import { ElAvatar as
|
|
18
|
-
import { ElUpload as
|
|
19
|
-
const
|
|
17
|
+
import { ElAvatar as We } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/avatar/index/index.js";
|
|
18
|
+
import { ElUpload as Xe } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/upload/index/index.js";
|
|
19
|
+
const Ye = { class: "ls-drag" }, Je = { class: "drag-txt ls-color-brand6" }, Qe = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "btn-picture-card"
|
|
22
|
-
},
|
|
22
|
+
}, Ze = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "ls-tip"
|
|
25
|
-
},
|
|
25
|
+
}, ht = /* @__PURE__ */ _e({
|
|
26
26
|
name: "LSUpload",
|
|
27
27
|
inheritAttrs: !1,
|
|
28
28
|
__name: "Index",
|
|
29
|
-
props:
|
|
29
|
+
props: De,
|
|
30
30
|
emits: ["uploadErrorFunc", "onChangeFunc", "httpResponseFunc"],
|
|
31
|
-
setup(
|
|
32
|
-
const M =
|
|
31
|
+
setup(O, { expose: j, emit: se }) {
|
|
32
|
+
const M = ze(), v = Ne(), re = Ge("upload").b(), m = ne(), d = ne(!1), y = le({
|
|
33
33
|
isCover: !0,
|
|
34
34
|
accept: "",
|
|
35
35
|
disabled: !1
|
|
@@ -38,10 +38,10 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
38
38
|
initUploadStatus: !0,
|
|
39
39
|
showPreview: !1,
|
|
40
40
|
sourcePreview: "",
|
|
41
|
-
iconColor:
|
|
42
|
-
}), i =
|
|
41
|
+
iconColor: He("colorText1")
|
|
42
|
+
}), i = O, R = se;
|
|
43
43
|
J(
|
|
44
|
-
() =>
|
|
44
|
+
() => v["file-list"],
|
|
45
45
|
(e) => {
|
|
46
46
|
o.uploadFileList = e || [];
|
|
47
47
|
},
|
|
@@ -50,20 +50,20 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
50
50
|
deep: !0
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
const
|
|
53
|
+
const S = s(() => {
|
|
54
54
|
var e, t;
|
|
55
55
|
return !!((e = i == null ? void 0 : i.item) != null && e.isToast || typeof ((t = i == null ? void 0 : i.item) == null ? void 0 : t.isToast) > "u");
|
|
56
|
-
}),
|
|
56
|
+
}), g = s(() => {
|
|
57
57
|
var t;
|
|
58
58
|
const e = (t = i == null ? void 0 : i.item) == null ? void 0 : t.isCover;
|
|
59
59
|
return typeof e > "u" ? !0 : e;
|
|
60
|
-
}),
|
|
61
|
-
const e =
|
|
60
|
+
}), L = s(() => v.multiple), b = s(() => {
|
|
61
|
+
const e = v["auto-upload"];
|
|
62
62
|
return typeof e > "u" ? !0 : e;
|
|
63
63
|
}), ue = s(() => {
|
|
64
64
|
var e;
|
|
65
65
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.emptyFileMsg) || "";
|
|
66
|
-
}),
|
|
66
|
+
}), H = s(() => v["list-type"]), P = s(() => H.value === Ie.picCard), ce = s(() => !H.value || H.value == "text"), U = s(() => {
|
|
67
67
|
var e;
|
|
68
68
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFile) || [];
|
|
69
69
|
}), de = s(() => {
|
|
@@ -72,13 +72,13 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
72
72
|
}), A = s(() => {
|
|
73
73
|
var e;
|
|
74
74
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSize) || 2;
|
|
75
|
-
}),
|
|
75
|
+
}), me = s(() => {
|
|
76
76
|
var e;
|
|
77
77
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSizeMsg) || "";
|
|
78
|
-
}),
|
|
78
|
+
}), G = s(() => {
|
|
79
79
|
var e;
|
|
80
80
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitUnit) || "MB";
|
|
81
|
-
}),
|
|
81
|
+
}), fe = s(() => {
|
|
82
82
|
var e;
|
|
83
83
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitNumMsg) || "";
|
|
84
84
|
}), ve = s(() => {
|
|
@@ -87,27 +87,31 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
87
87
|
}), Z = s(() => {
|
|
88
88
|
var e;
|
|
89
89
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.profile) || !1;
|
|
90
|
-
}), E = s(() =>
|
|
90
|
+
}), E = s(() => v.drag), ge = s(() => {
|
|
91
91
|
var e;
|
|
92
|
-
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) &&
|
|
93
|
-
}),
|
|
92
|
+
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) && g.value && o.uploadFileList.length > 0;
|
|
93
|
+
}), w = s(() => v.disabled), K = s(() => {
|
|
94
94
|
const e = P.value ? "图片" : "文件";
|
|
95
95
|
let t = `选择${e}`;
|
|
96
|
-
return d.value ? t = "正在上传..." :
|
|
96
|
+
return d.value ? t = "正在上传..." : g.value && !L.value ? b.value ? o.initUploadStatus ? t = "点击上传" : t = "重新上传" : o.initUploadStatus ? t = `选择${e}` : t = "重新上传" : b.value && (t = "点击上传"), t;
|
|
97
97
|
}), pe = s(() => {
|
|
98
98
|
let e = "不限制上传格式,";
|
|
99
|
-
return P.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${A.value}${
|
|
99
|
+
return P.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${A.value}${G.value}`;
|
|
100
100
|
}), Fe = s(() => {
|
|
101
101
|
var e;
|
|
102
102
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.tipContent) || "";
|
|
103
|
-
}),
|
|
103
|
+
}), W = s(() => {
|
|
104
104
|
var e;
|
|
105
105
|
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.httpRequestFunc;
|
|
106
|
+
}), he = s(() => {
|
|
107
|
+
var t;
|
|
108
|
+
const e = Number(v.limit || 0);
|
|
109
|
+
return e ? ((t = i == null ? void 0 : i.item) == null ? void 0 : t.hideBtnReachLimit) && o.uploadFileList.length >= e : !1;
|
|
106
110
|
});
|
|
107
111
|
J(
|
|
108
|
-
[
|
|
112
|
+
[g, W],
|
|
109
113
|
([e, t]) => {
|
|
110
|
-
|
|
114
|
+
y.isCover = e, t && t instanceof Function && (y["http-request"] = Pe);
|
|
111
115
|
},
|
|
112
116
|
{
|
|
113
117
|
immediate: !0,
|
|
@@ -124,9 +128,9 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
124
128
|
}
|
|
125
129
|
);
|
|
126
130
|
function ye(e) {
|
|
127
|
-
|
|
128
|
-
const l =
|
|
129
|
-
l && (
|
|
131
|
+
y.accept = "", e.forEach((t) => {
|
|
132
|
+
const l = qe[t] || "";
|
|
133
|
+
l && (y.accept && (y.accept += ","), y.accept += l);
|
|
130
134
|
});
|
|
131
135
|
}
|
|
132
136
|
u(ye, "updateFileAccept");
|
|
@@ -142,60 +146,60 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
142
146
|
async function be(e, t) {
|
|
143
147
|
if (d.value = !1, i.onExceed)
|
|
144
148
|
return i.onExceed(e, t);
|
|
145
|
-
const l = Number(
|
|
149
|
+
const l = Number(v.limit || 0);
|
|
146
150
|
let a = 0;
|
|
147
|
-
ve.value || (a = l - o.uploadFileList.length, a > 0 && (
|
|
148
|
-
const r =
|
|
149
|
-
|
|
151
|
+
ve.value || (a = l - o.uploadFileList.length, a > 0 && (Ue(e.slice(0, a)), b.value && Y()));
|
|
152
|
+
const r = fe.value || `当前限制选择 ${l} 个文件,本次选择了 ${e.length} 个文件,已成功上传 ${a} 个文件`;
|
|
153
|
+
S.value ? setTimeout(() => {
|
|
150
154
|
x.warning(r);
|
|
151
155
|
}, 200) : T(r);
|
|
152
156
|
}
|
|
153
157
|
u(be, "onExceedAction");
|
|
154
|
-
function
|
|
158
|
+
function ke(e) {
|
|
155
159
|
if (i.beforeUpload) {
|
|
156
160
|
const l = i.beforeUpload(e);
|
|
157
|
-
return l &&
|
|
161
|
+
return l && g.value && !L.value && _(), l;
|
|
158
162
|
}
|
|
159
|
-
const t =
|
|
160
|
-
return t &&
|
|
163
|
+
const t = X(e, !0);
|
|
164
|
+
return t && b.value && g.value && !L.value && _(), t;
|
|
161
165
|
}
|
|
162
|
-
u(
|
|
163
|
-
function
|
|
166
|
+
u(ke, "beforeUploadAction");
|
|
167
|
+
function X(e, t) {
|
|
164
168
|
let l = !0;
|
|
165
|
-
const { size: a, name: r } = e,
|
|
166
|
-
let
|
|
167
|
-
switch (
|
|
169
|
+
const { size: a, name: r } = e, z = U.value.length > 0 && !ee(r);
|
|
170
|
+
let N = !1;
|
|
171
|
+
switch (G.value) {
|
|
168
172
|
case "KB":
|
|
169
|
-
|
|
173
|
+
N = a / 1024 > A.value;
|
|
170
174
|
break;
|
|
171
175
|
case "MB":
|
|
172
|
-
|
|
176
|
+
N = a / 1024 / 1024 > A.value;
|
|
173
177
|
break;
|
|
174
178
|
default:
|
|
175
|
-
|
|
179
|
+
N = a / 1024 / 1024 / 1024 > A.value;
|
|
176
180
|
break;
|
|
177
181
|
}
|
|
178
|
-
if (Y) {
|
|
179
|
-
const g = de.value || `上传文件 ${e.name} 只能是 ${U.value.filter((xe) => xe).join(",").toLocaleLowerCase()} 格式!`;
|
|
180
|
-
L.value && t ? setTimeout(() => {
|
|
181
|
-
x.error(g);
|
|
182
|
-
}, 200) : T(g), l = !1;
|
|
183
|
-
}
|
|
184
182
|
if (z) {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
x.error(
|
|
188
|
-
}, 200) : T(
|
|
183
|
+
const p = de.value || `上传文件 ${e.name} 只能是 ${U.value.filter((Me) => Me).join(",").toLocaleLowerCase()} 格式!`;
|
|
184
|
+
S.value && t ? setTimeout(() => {
|
|
185
|
+
x.error(p);
|
|
186
|
+
}, 200) : T(p), l = !1;
|
|
187
|
+
}
|
|
188
|
+
if (N) {
|
|
189
|
+
const p = me.value || `上传文件 ${e.name} 大小不能超过 ${A.value}${G.value}!`;
|
|
190
|
+
S.value && t ? setTimeout(() => {
|
|
191
|
+
x.error(p);
|
|
192
|
+
}, 200) : T(p), l = !1;
|
|
189
193
|
}
|
|
190
|
-
if (P.value && !ee(r,
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
x.error(
|
|
194
|
-
}, 200) : T(
|
|
194
|
+
if (!z && P.value && !ee(r, je)) {
|
|
195
|
+
const p = `上传文件 ${e.name} 不是图片格式的文件!`;
|
|
196
|
+
S.value && t ? setTimeout(() => {
|
|
197
|
+
x.error(p);
|
|
198
|
+
}, 200) : T(p), l = !1;
|
|
195
199
|
}
|
|
196
200
|
return l;
|
|
197
201
|
}
|
|
198
|
-
u(
|
|
202
|
+
u(X, "validateUploadFile");
|
|
199
203
|
function ee(e, t) {
|
|
200
204
|
let l = [];
|
|
201
205
|
if (U.value.length > 0 ? l = U.value : t && (l = t), l.length <= 0)
|
|
@@ -212,21 +216,21 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
212
216
|
o.uploadFileList.splice(e || 0, t || o.uploadFileList.length - 1);
|
|
213
217
|
}
|
|
214
218
|
u(_, "updateCoverFileList");
|
|
215
|
-
function
|
|
219
|
+
function Le(e, t) {
|
|
216
220
|
o.uploadFileList = t;
|
|
217
|
-
const l = e.raw &&
|
|
218
|
-
if (l &&
|
|
221
|
+
const l = e.raw && X(e.raw, !b.value);
|
|
222
|
+
if (l && g.value && !L.value && _(), i.onChange)
|
|
219
223
|
return i.onChange(e, t);
|
|
220
224
|
const { size: a = 0 } = e;
|
|
221
225
|
if (a <= 0) {
|
|
222
226
|
te();
|
|
223
227
|
const r = ue.value || "禁止上传空文件,请检查后重新上传!";
|
|
224
|
-
|
|
228
|
+
S.value ? x.error(r) : T(r);
|
|
225
229
|
return;
|
|
226
230
|
}
|
|
227
|
-
e.raw && (!
|
|
231
|
+
e.raw && (!b.value && !l ? te() : (e.blob = URL.createObjectURL(e.raw) || "", R("onChangeFunc", e)));
|
|
228
232
|
}
|
|
229
|
-
u(
|
|
233
|
+
u(Le, "onChangeAction");
|
|
230
234
|
function te() {
|
|
231
235
|
let e = 0;
|
|
232
236
|
o.uploadFileList.length > 1 && (e = o.uploadFileList.length - 1), _(e, 1), R("onChangeFunc", {});
|
|
@@ -249,72 +253,72 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
249
253
|
return i.onRemove(e, t);
|
|
250
254
|
}
|
|
251
255
|
u(Se, "onRemoveAction");
|
|
252
|
-
async function
|
|
256
|
+
async function Pe(e) {
|
|
253
257
|
const { file: t } = e;
|
|
254
258
|
if (!t)
|
|
255
259
|
return;
|
|
256
260
|
const { size: l } = t;
|
|
257
|
-
if (l <= 0 || !
|
|
261
|
+
if (l <= 0 || !X(t, !1))
|
|
258
262
|
return;
|
|
259
263
|
if (i.httpRequest)
|
|
260
264
|
return i.httpRequest(e);
|
|
261
265
|
const a = new FormData();
|
|
262
|
-
if (a.append("file", t),
|
|
266
|
+
if (a.append("file", t), W.value instanceof Function) {
|
|
263
267
|
d.value = !0;
|
|
264
268
|
let r = {};
|
|
265
269
|
try {
|
|
266
|
-
r = await
|
|
267
|
-
} catch (
|
|
268
|
-
r =
|
|
270
|
+
r = await W.value(a);
|
|
271
|
+
} catch (z) {
|
|
272
|
+
r = z;
|
|
269
273
|
} finally {
|
|
270
274
|
d.value = !1, R("httpResponseFunc", r);
|
|
271
275
|
}
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
|
-
u(
|
|
278
|
+
u(Pe, "httpRequestAction");
|
|
275
279
|
function ie() {
|
|
276
280
|
let e = !1;
|
|
277
281
|
for (let t = 0; t < o.uploadFileList.length; t++)
|
|
278
|
-
if (o.uploadFileList[t].status ===
|
|
282
|
+
if (o.uploadFileList[t].status === Oe.ready) {
|
|
279
283
|
e = !0;
|
|
280
284
|
break;
|
|
281
285
|
}
|
|
282
286
|
return e;
|
|
283
287
|
}
|
|
284
288
|
u(ie, "hasReadyFile");
|
|
285
|
-
function
|
|
289
|
+
function Y() {
|
|
286
290
|
var e;
|
|
287
|
-
(e =
|
|
291
|
+
(e = m == null ? void 0 : m.value) == null || e.submit();
|
|
288
292
|
}
|
|
289
|
-
u(
|
|
290
|
-
function
|
|
293
|
+
u(Y, "comfirmUpload");
|
|
294
|
+
function Ue(e) {
|
|
291
295
|
(e || []).forEach((t) => {
|
|
292
296
|
var l;
|
|
293
|
-
(l =
|
|
297
|
+
(l = m == null ? void 0 : m.value) == null || l.handleStart(t);
|
|
294
298
|
});
|
|
295
299
|
}
|
|
296
|
-
u(
|
|
297
|
-
function
|
|
298
|
-
|
|
300
|
+
u(Ue, "comHandleStart");
|
|
301
|
+
function Ae(e) {
|
|
302
|
+
m == null || m.value.handleRemove(e);
|
|
299
303
|
}
|
|
300
|
-
u(
|
|
301
|
-
function
|
|
304
|
+
u(Ae, "removeFile");
|
|
305
|
+
function Ee() {
|
|
302
306
|
o.uploadFileList.forEach((e) => {
|
|
303
307
|
var t;
|
|
304
308
|
if (e)
|
|
305
309
|
try {
|
|
306
|
-
(t =
|
|
310
|
+
(t = m == null ? void 0 : m.value) == null || t.abort(e), Ae(e);
|
|
307
311
|
} catch {
|
|
308
312
|
}
|
|
309
313
|
});
|
|
310
314
|
}
|
|
311
|
-
u(
|
|
312
|
-
function
|
|
315
|
+
u(Ee, "cancelUpload");
|
|
316
|
+
function Te(e, t, l) {
|
|
313
317
|
if (d.value = !0, i.onProgress)
|
|
314
318
|
return i.onProgress(e, t, l);
|
|
315
319
|
}
|
|
316
|
-
u(
|
|
317
|
-
function
|
|
320
|
+
u(Te, "onProgressAction");
|
|
321
|
+
function $e(e) {
|
|
318
322
|
if (i.onPreview)
|
|
319
323
|
return i.onPreview(e);
|
|
320
324
|
if (P.value) {
|
|
@@ -322,82 +326,88 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
322
326
|
o.sourcePreview = t, o.showPreview = !0;
|
|
323
327
|
}
|
|
324
328
|
}
|
|
325
|
-
u(
|
|
326
|
-
function
|
|
329
|
+
u($e, "onPreviewAction");
|
|
330
|
+
function xe() {
|
|
327
331
|
o.showPreview = !1, o.sourcePreview = "";
|
|
328
332
|
}
|
|
329
|
-
return u(
|
|
330
|
-
uploadRef:
|
|
333
|
+
return u(xe, "closePreview"), j({
|
|
334
|
+
uploadRef: m
|
|
331
335
|
}), (e, t) => {
|
|
332
|
-
const l =
|
|
333
|
-
return c(),
|
|
334
|
-
class:
|
|
336
|
+
const l = We, a = Xe;
|
|
337
|
+
return c(), f("div", {
|
|
338
|
+
class: B([
|
|
339
|
+
n(re),
|
|
340
|
+
n(E) ? "ls-upload-drag" : "",
|
|
341
|
+
n(Z) ? "ls-profile" : "",
|
|
342
|
+
n(ge) ? "hide-cover-btn" : "",
|
|
343
|
+
n(he) ? "hide-btn" : ""
|
|
344
|
+
])
|
|
335
345
|
}, [
|
|
336
|
-
Q(a,
|
|
346
|
+
Q(a, Be({
|
|
337
347
|
ref_key: "uploadRef",
|
|
338
|
-
ref:
|
|
339
|
-
}, Object.assign(n(
|
|
348
|
+
ref: m
|
|
349
|
+
}, Object.assign(n(y), e.$attrs), {
|
|
340
350
|
"on-exceed": be,
|
|
341
|
-
"before-upload":
|
|
342
|
-
"on-change":
|
|
351
|
+
"before-upload": ke,
|
|
352
|
+
"on-change": Le,
|
|
343
353
|
"on-success": we,
|
|
344
354
|
"on-error": Ce,
|
|
345
355
|
"on-remove": Se,
|
|
346
|
-
"on-progress":
|
|
347
|
-
"on-preview":
|
|
356
|
+
"on-progress": Te,
|
|
357
|
+
"on-preview": $e
|
|
348
358
|
}), Ve({
|
|
349
|
-
trigger:
|
|
350
|
-
n(Z) ? e.item.defProfile && n(o).uploadFileList.length < 1 ? (c(),
|
|
359
|
+
trigger: F(() => [
|
|
360
|
+
n(Z) ? e.item.defProfile && n(o).uploadFileList.length < 1 ? (c(), h(l, {
|
|
351
361
|
key: 1,
|
|
352
362
|
size: 60,
|
|
353
363
|
src: e.item.defProfile,
|
|
354
364
|
fit: "contain"
|
|
355
|
-
}, null, 8, ["src"])) :
|
|
356
|
-
n(M).trigger ?
|
|
357
|
-
n(E) ? (c(),
|
|
358
|
-
n(d) ? (c(),
|
|
365
|
+
}, null, 8, ["src"])) : I("", !0) : (c(), f(k, { key: 0 }, [
|
|
366
|
+
n(M).trigger ? q(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(), f(k, { key: 0 }, [
|
|
367
|
+
n(E) ? (c(), f(k, { key: 0 }, [
|
|
368
|
+
n(d) ? (c(), h(C, {
|
|
359
369
|
key: 0,
|
|
360
370
|
text: "",
|
|
361
371
|
loading: n(d),
|
|
362
|
-
disabled: n(
|
|
363
|
-
}, null, 8, ["loading", "disabled"])) : (c(),
|
|
372
|
+
disabled: n(w)
|
|
373
|
+
}, null, 8, ["loading", "disabled"])) : (c(), h(ae, {
|
|
364
374
|
key: 1,
|
|
365
375
|
class: "upload-icon",
|
|
366
376
|
name: "UploadFilled",
|
|
367
377
|
size: "56",
|
|
368
378
|
color: "#E7E7E7"
|
|
369
379
|
})),
|
|
370
|
-
V("div",
|
|
371
|
-
V("div",
|
|
372
|
-
n(d) ?
|
|
380
|
+
V("div", Ye, [
|
|
381
|
+
V("div", Je, D(n(K)), 1),
|
|
382
|
+
n(d) ? I("", !0) : (c(), f(k, { key: 0 }, [
|
|
373
383
|
t[1] || (t[1] = $(" / ")),
|
|
374
384
|
t[2] || (t[2] = V("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1))
|
|
375
385
|
], 64))
|
|
376
386
|
])
|
|
377
|
-
], 64)) : (c(),
|
|
378
|
-
n(P) ? (c(),
|
|
379
|
-
n(d) ? (c(),
|
|
387
|
+
], 64)) : (c(), f(k, { key: 1 }, [
|
|
388
|
+
n(P) ? (c(), f("div", Qe, [
|
|
389
|
+
n(d) ? (c(), h(C, {
|
|
380
390
|
key: 0,
|
|
381
391
|
text: "",
|
|
382
392
|
loading: n(d),
|
|
383
|
-
disabled: n(
|
|
384
|
-
}, null, 8, ["loading", "disabled"])) : (c(),
|
|
393
|
+
disabled: n(w)
|
|
394
|
+
}, null, 8, ["loading", "disabled"])) : (c(), h(ae, {
|
|
385
395
|
key: 1,
|
|
386
396
|
class: "upload-btn-plus",
|
|
387
397
|
name: "Plus",
|
|
388
398
|
size: 28,
|
|
389
399
|
color: n(o).iconColor
|
|
390
400
|
}, null, 8, ["color"])),
|
|
391
|
-
V("div", null,
|
|
392
|
-
])) : (c(),
|
|
401
|
+
V("div", null, D(n(K)), 1)
|
|
402
|
+
])) : (c(), h(C, {
|
|
393
403
|
key: 1,
|
|
394
404
|
plain: "",
|
|
395
405
|
icon: "upload",
|
|
396
406
|
loading: n(d),
|
|
397
|
-
disabled: n(
|
|
407
|
+
disabled: n(w)
|
|
398
408
|
}, {
|
|
399
|
-
default:
|
|
400
|
-
$(
|
|
409
|
+
default: F(() => [
|
|
410
|
+
$(D(n(K)), 1)
|
|
401
411
|
]),
|
|
402
412
|
_: 1
|
|
403
413
|
}, 8, ["loading", "disabled"]))
|
|
@@ -405,77 +415,77 @@ const Xe = { class: "ls-drag" }, Ye = { class: "drag-txt ls-color-brand6" }, Je
|
|
|
405
415
|
], 64))
|
|
406
416
|
], 64))
|
|
407
417
|
]),
|
|
408
|
-
default:
|
|
409
|
-
n(M).default ?
|
|
410
|
-
!n(
|
|
418
|
+
default: F(() => [
|
|
419
|
+
n(M).default ? q(e.$slots, "default", { key: 1 }, void 0, !0) : (c(), f(k, { key: 0 }, [
|
|
420
|
+
!n(b) && (n(ce) || n(E)) ? (c(), f("div", {
|
|
411
421
|
key: 0,
|
|
412
|
-
class:
|
|
422
|
+
class: B(["upload-btn-handle", [n(E) ? "drag-css" : "nor-css", !n(g) || n(L) ? "multi-css" : ""]])
|
|
413
423
|
}, [
|
|
414
|
-
n(E) ? (c(),
|
|
415
|
-
!n(
|
|
424
|
+
n(E) ? (c(), f(k, { key: 1 }, [
|
|
425
|
+
!n(g) || n(L) ? (c(), h(C, {
|
|
416
426
|
key: 0,
|
|
417
427
|
type: "primary",
|
|
418
428
|
loading: n(d),
|
|
419
|
-
disabled: n(
|
|
420
|
-
onClick:
|
|
429
|
+
disabled: n(w),
|
|
430
|
+
onClick: Ee,
|
|
421
431
|
class: "ls-upload-btn-com ls-upload-btn-cancel"
|
|
422
432
|
}, {
|
|
423
|
-
default:
|
|
433
|
+
default: F(() => t[4] || (t[4] = [
|
|
424
434
|
$("取消上传")
|
|
425
435
|
])),
|
|
426
436
|
_: 1
|
|
427
|
-
}, 8, ["loading", "disabled"])) :
|
|
428
|
-
Q(
|
|
429
|
-
class:
|
|
437
|
+
}, 8, ["loading", "disabled"])) : I("", !0),
|
|
438
|
+
Q(C, {
|
|
439
|
+
class: B(["start-upload ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
|
|
430
440
|
type: "primary",
|
|
431
441
|
loading: n(d),
|
|
432
|
-
disabled: n(
|
|
433
|
-
onClick:
|
|
442
|
+
disabled: n(w),
|
|
443
|
+
onClick: Y
|
|
434
444
|
}, {
|
|
435
|
-
default:
|
|
445
|
+
default: F(() => t[5] || (t[5] = [
|
|
436
446
|
$("开始上传")
|
|
437
447
|
])),
|
|
438
448
|
_: 1
|
|
439
449
|
}, 8, ["class", "loading", "disabled"])
|
|
440
|
-
], 64)) : (c(),
|
|
450
|
+
], 64)) : (c(), h(C, {
|
|
441
451
|
key: 0,
|
|
442
452
|
type: "primary",
|
|
443
|
-
class:
|
|
453
|
+
class: B(["ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
|
|
444
454
|
loading: n(d),
|
|
445
|
-
disabled: n(
|
|
446
|
-
onClick:
|
|
455
|
+
disabled: n(w),
|
|
456
|
+
onClick: Y
|
|
447
457
|
}, {
|
|
448
|
-
default:
|
|
458
|
+
default: F(() => t[3] || (t[3] = [
|
|
449
459
|
$("开始上传 ")
|
|
450
460
|
])),
|
|
451
461
|
_: 1
|
|
452
462
|
}, 8, ["class", "loading", "disabled"]))
|
|
453
|
-
], 2)) :
|
|
463
|
+
], 2)) : I("", !0)
|
|
454
464
|
], 64))
|
|
455
465
|
]),
|
|
456
|
-
tip:
|
|
457
|
-
n(M).tip ?
|
|
466
|
+
tip: F(() => [
|
|
467
|
+
n(M).tip ? q(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), f("div", Ze, D(n(Fe) || n(pe)), 1))
|
|
458
468
|
]),
|
|
459
469
|
_: 2
|
|
460
470
|
}, [
|
|
461
471
|
n(M).file ? {
|
|
462
472
|
name: "file",
|
|
463
|
-
fn:
|
|
464
|
-
|
|
473
|
+
fn: F(() => [
|
|
474
|
+
q(e.$slots, "file", {}, void 0, !0)
|
|
465
475
|
]),
|
|
466
476
|
key: "0"
|
|
467
477
|
} : void 0
|
|
468
478
|
]), 1040),
|
|
469
|
-
Q(n(
|
|
479
|
+
Q(n(Ke), {
|
|
470
480
|
modelValue: n(o).showPreview,
|
|
471
481
|
"onUpdate:modelValue": t[0] || (t[0] = (r) => n(o).showPreview = r),
|
|
472
482
|
source: n(o).sourcePreview,
|
|
473
|
-
"on-close":
|
|
483
|
+
"on-close": xe
|
|
474
484
|
}, null, 8, ["modelValue", "source"])
|
|
475
485
|
], 2);
|
|
476
486
|
};
|
|
477
487
|
}
|
|
478
488
|
});
|
|
479
489
|
export {
|
|
480
|
-
|
|
490
|
+
ht as default
|
|
481
491
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as useRouterHook } from './useRouterHook';
|
|
2
|
-
import { default as useColorthiefHook } from './useColorthiefHook';
|
|
3
2
|
import { default as useWSHook } from './useWSHook';
|
|
4
3
|
import { default as useOptionHook } from './useOptionHook';
|
|
5
4
|
import { default as useTableListHook } from './useTableListHook';
|
|
6
|
-
export { useRouterHook,
|
|
5
|
+
export { useRouterHook, useWSHook, useOptionHook, useTableListHook };
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* 获取select、radio标签使用的option
|
|
3
3
|
* apiFunc 请求接口
|
|
4
4
|
* params: {
|
|
5
|
-
* labelKey,
|
|
6
|
-
* valueKey,
|
|
7
5
|
* 分页参数, 注意分页接口返回之需用records作为数组字段
|
|
8
6
|
* }
|
|
7
|
+
* labelKey: 标签字段
|
|
8
|
+
* valueKey: 值字段
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
11
|
export default function (): {
|
|
12
|
-
getSelOption: (apiFunc: any, params?: any, all?: Array<OptionType>) => Promise<any>;
|
|
12
|
+
getSelOption: (apiFunc: any, labelKey?: Array<string>, valueKey?: Array<string>, params?: any, all?: Array<OptionType>) => Promise<any>;
|
|
13
13
|
remoteSearchSelOption: (apiFunc: Promise<any>, params: any, selId: string, selVal: string, keyword: string | undefined) => Promise<any>;
|
|
14
14
|
};
|
|
@@ -85,7 +85,7 @@ declare function __VLS_template(): {
|
|
|
85
85
|
$root: ComponentPublicInstance | null;
|
|
86
86
|
$parent: ComponentPublicInstance | null;
|
|
87
87
|
$host: Element | null;
|
|
88
|
-
$emit: ((event: "
|
|
88
|
+
$emit: ((event: "open") => void) & ((event: "close") => void) & ((event: "closed") => void) & ((event: "update:modelValue", value: boolean) => void) & ((event: "opened") => void) & ((event: "openAutoFocus") => void) & ((event: "closeAutoFocus") => void);
|
|
89
89
|
$el: any;
|
|
90
90
|
$options: ComponentOptionsBase<Readonly<globalThis.ExtractPropTypes<{
|
|
91
91
|
readonly appendToBody: BooleanConstructor;
|