@lingshugroup/web-plus 1.0.16 → 1.0.18
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/README.md +1 -1
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/core/echarts/index.js +1 -1
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/core/echarts/index.js.br +0 -0
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/core/echarts/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/data/helper/sourceHelper/index.js +3 -3
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/data/helper/sourceHelper/index.js.br +0 -0
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/data/helper/sourceHelper/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/util/model/index.js +7 -7
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/util/model/index.js.br +0 -0
- package/lib/node_modules/.pnpm/echarts@5.5.1/node_modules/echarts/lib/util/model/index.js.gz +0 -0
- package/lib/node_modules/.pnpm/zrender@5.6.0/node_modules/zrender/lib/graphic/Displayable/index.cjs +1 -1
- package/lib/node_modules/.pnpm/zrender@5.6.0/node_modules/zrender/lib/graphic/Displayable/index.js +29 -28
- package/lib/node_modules/.pnpm/zrender@5.6.0/node_modules/zrender/lib/graphic/Displayable/index.js.br +0 -0
- package/lib/node_modules/.pnpm/zrender@5.6.0/node_modules/zrender/lib/graphic/Displayable/index.js.gz +0 -0
- package/lib/packages/ls-components/components/chart/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/chart/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/chart/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/chart/Index.vue/index2.js +41 -41
- package/lib/packages/ls-components/components/chart/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/chart/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/chart/config/template/bar/index.cjs +1 -1
- package/lib/packages/ls-components/components/chart/config/template/bar/index.js +66 -66
- package/lib/packages/ls-components/components/chart/config/template/bar/index.js.br +0 -0
- package/lib/packages/ls-components/components/chart/config/template/bar/index.js.gz +0 -0
- package/lib/packages/ls-components/components/chart/config/template/line/index.cjs +1 -1
- package/lib/packages/ls-components/components/chart/config/template/line/index.js +76 -73
- package/lib/packages/ls-components/components/chart/config/template/line/index.js.br +0 -0
- package/lib/packages/ls-components/components/chart/config/template/line/index.js.gz +0 -0
- package/lib/packages/ls-components/components/chart/config/template/pie/index.cjs +1 -1
- package/lib/packages/ls-components/components/chart/config/template/pie/index.js +25 -24
- package/lib/packages/ls-components/components/chart/config/template/pie/index.js.br +0 -0
- package/lib/packages/ls-components/components/chart/config/template/pie/index.js.gz +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js +28 -26
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index.js +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index2.js +66 -64
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js +257 -201
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/types/index.js +6 -2
- package/lib/packages/ls-components/components/form/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/form/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 +240 -233
- 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/package.json +1 -1
|
@@ -1,464 +1,471 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ee = Object.defineProperty;
|
|
2
|
+
var s = (F, j) => Ee(F, "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
|
|
12
|
-
import
|
|
7
|
+
import { defineComponent as Te, useSlots as $e, useAttrs as Me, ref as ne, reactive as le, watch as J, computed as r, resolveComponent as Re, openBlock as c, createElementBlock as p, normalizeClass as D, unref as o, createVNode as Q, mergeProps as ze, createSlots as Be, withCtx as w, Fragment as S, createBlock as y, createElementVNode as W, toDisplayString as N, createTextVNode as R, createCommentVNode as q, renderSlot as O, toRefs as ae, pushScopeId as Ie, popScopeId as Ve } from "vue";
|
|
8
|
+
import { lsUploadProps as De, UPLOAD_TYPE_MAP as Ne, fileTypeMap as qe, UPLOAD_STATUS_MAP as Oe, IMG_SUFFIX_LIST as We } from "../types/index.js";
|
|
9
|
+
import { getVariable as je } from "../../_utils/config/index.js";
|
|
10
|
+
import { useNamespace as Ge } from "../../_hooks/useNamespace/index.js";
|
|
11
|
+
import x from "../../button/Button.vue/index.js";
|
|
12
|
+
import se from "../../icon/Index.vue/index.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
|
-
import
|
|
16
|
-
import { ElMessage as
|
|
17
|
-
import { ElAvatar as
|
|
18
|
-
import { ElUpload as
|
|
19
|
-
const
|
|
15
|
+
import He from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
16
|
+
import { ElMessage as z } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
|
|
17
|
+
import { ElAvatar as Ke } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_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.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/upload/index/index.js";
|
|
19
|
+
const Ye = /* @__PURE__ */ s((F) => (Ie("data-v-52217f7f"), F = F(), Ve(), F), "_withScopeId"), Je = { class: "ls-drag" }, Qe = { class: "drag-txt ls-color-brand6" }, Ze = /* @__PURE__ */ Ye(() => /* @__PURE__ */ W("div", { class: "drag-txt ls-color-text2" }, "拖拽到此区域", -1)), et = {
|
|
20
20
|
key: 0,
|
|
21
21
|
class: "btn-picture-card"
|
|
22
|
-
},
|
|
22
|
+
}, tt = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "ls-tip"
|
|
25
|
-
},
|
|
25
|
+
}, Ft = /* @__PURE__ */ Te({
|
|
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(F, { expose:
|
|
32
|
-
const
|
|
31
|
+
setup(F, { expose: j, emit: re }) {
|
|
32
|
+
const B = $e(), b = Me(), ue = Ge("upload").b(), v = ne(), d = ne(!1), P = le({
|
|
33
33
|
isCover: !0,
|
|
34
34
|
accept: "",
|
|
35
|
-
disabled:
|
|
36
|
-
}),
|
|
35
|
+
disabled: !1
|
|
36
|
+
}), l = le({
|
|
37
37
|
uploadFileList: [],
|
|
38
38
|
initUploadStatus: !0,
|
|
39
39
|
showPreview: !1,
|
|
40
40
|
typePreview: "",
|
|
41
41
|
sourcePreview: "",
|
|
42
|
-
iconColor:
|
|
43
|
-
}), i = F,
|
|
44
|
-
|
|
45
|
-
() =>
|
|
42
|
+
iconColor: je("colorText1")
|
|
43
|
+
}), i = F, I = re;
|
|
44
|
+
J(
|
|
45
|
+
() => b["file-list"],
|
|
46
46
|
(e) => {
|
|
47
|
-
|
|
47
|
+
l.uploadFileList = e || [];
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
immediate: !0,
|
|
51
51
|
deep: !0
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
const
|
|
54
|
+
const U = r(() => {
|
|
55
55
|
var e, t;
|
|
56
56
|
return (((e = i == null ? void 0 : i.item) == null ? void 0 : e.isToast) || typeof ((t = i == null ? void 0 : i.item) == null ? void 0 : t.isToast)) === "undefined";
|
|
57
|
-
}), g =
|
|
57
|
+
}), g = r(() => {
|
|
58
58
|
var t;
|
|
59
59
|
const e = (t = i == null ? void 0 : i.item) == null ? void 0 : t.isCover;
|
|
60
60
|
return typeof e > "u" ? !0 : e;
|
|
61
|
-
}), C =
|
|
62
|
-
const e =
|
|
61
|
+
}), C = r(() => b.multiple), L = r(() => {
|
|
62
|
+
const e = b["auto-upload"];
|
|
63
63
|
return typeof e > "u" ? !0 : e;
|
|
64
|
-
}),
|
|
64
|
+
}), ce = r(() => {
|
|
65
65
|
var e;
|
|
66
66
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.emptyFileMsg) || "";
|
|
67
|
-
}),
|
|
67
|
+
}), G = r(() => b["list-type"]), k = r(() => G.value === Ne.picCard), de = r(() => !G.value || G.value == "text"), A = r(() => {
|
|
68
68
|
var e;
|
|
69
69
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFile) || [];
|
|
70
|
-
}),
|
|
70
|
+
}), fe = r(() => {
|
|
71
71
|
var e;
|
|
72
72
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitFileMsg) || "";
|
|
73
|
-
}),
|
|
73
|
+
}), E = r(() => {
|
|
74
74
|
var e;
|
|
75
75
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSize) || 2;
|
|
76
|
-
}),
|
|
76
|
+
}), me = r(() => {
|
|
77
77
|
var e;
|
|
78
78
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitSizeMsg) || "";
|
|
79
|
-
}),
|
|
79
|
+
}), H = r(() => {
|
|
80
80
|
var e;
|
|
81
81
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitUnit) || "MB";
|
|
82
|
-
}),
|
|
82
|
+
}), ve = r(() => {
|
|
83
83
|
var e;
|
|
84
84
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.limitNumMsg) || "";
|
|
85
|
-
}),
|
|
85
|
+
}), Z = r(() => {
|
|
86
86
|
var e;
|
|
87
87
|
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.profile) || !1;
|
|
88
|
-
}),
|
|
88
|
+
}), T = r(() => b.drag), pe = r(() => {
|
|
89
89
|
var e;
|
|
90
|
-
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) && g.value &&
|
|
91
|
-
}),
|
|
92
|
-
const e =
|
|
90
|
+
return ((e = i == null ? void 0 : i.item) == null ? void 0 : e.hideCoverBtn) && g.value && l.uploadFileList.length > 0;
|
|
91
|
+
}), _ = r(() => b.disabled), K = r(() => {
|
|
92
|
+
const e = k.value ? "图片" : "文件";
|
|
93
93
|
let t = `选择${e}`;
|
|
94
|
-
return d.value ? t = "正在上传..." : g.value && !C.value ? L.value ?
|
|
95
|
-
}),
|
|
94
|
+
return d.value ? t = "正在上传..." : g.value && !C.value ? L.value ? l.initUploadStatus ? t = "点击上传" : t = "重新上传" : l.initUploadStatus ? t = `选择${e}` : t = "重新上传" : L.value && (t = "点击上传"), t;
|
|
95
|
+
}), ge = r(() => {
|
|
96
96
|
let e = "不限制上传格式,";
|
|
97
|
-
return
|
|
98
|
-
}),
|
|
97
|
+
return k.value && (e = "文件须为图片格式,"), `${e}文件大小不超过${E.value}${H.value}`;
|
|
98
|
+
}), X = r(() => {
|
|
99
99
|
var e;
|
|
100
100
|
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.httpRequestFunc;
|
|
101
|
-
}),
|
|
101
|
+
}), $ = r(() => {
|
|
102
102
|
var e;
|
|
103
103
|
return (e = i == null ? void 0 : i.item) == null ? void 0 : e.textPreview;
|
|
104
104
|
});
|
|
105
|
-
|
|
106
|
-
[g,
|
|
105
|
+
J(
|
|
106
|
+
[g, X],
|
|
107
107
|
([e, t]) => {
|
|
108
|
-
P.isCover = e, t && t instanceof Function && (P["http-request"] =
|
|
108
|
+
P.isCover = e, t && t instanceof Function && (P["http-request"] = Ce);
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
immediate: !0,
|
|
112
112
|
deep: !0
|
|
113
113
|
}
|
|
114
|
-
),
|
|
115
|
-
() =>
|
|
114
|
+
), J(
|
|
115
|
+
() => A.value,
|
|
116
116
|
(e) => {
|
|
117
|
-
e && e.length > 0 &&
|
|
117
|
+
e && e.length > 0 && he(e);
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
immediate: !0,
|
|
121
121
|
deep: !0
|
|
122
122
|
}
|
|
123
123
|
);
|
|
124
|
-
function
|
|
124
|
+
function he(e) {
|
|
125
125
|
P.accept = "", e.forEach((t) => {
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const n = qe[t] || "";
|
|
127
|
+
n && (P.accept && (P.accept += ","), P.accept += n);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
function
|
|
132
|
-
const { formRuleFunc: t, formValidateFunc:
|
|
133
|
-
if (t && t.value instanceof Function &&
|
|
134
|
-
const
|
|
135
|
-
|
|
130
|
+
s(he, "updateFileAccept");
|
|
131
|
+
function M(e) {
|
|
132
|
+
const { formRuleFunc: t, formValidateFunc: n } = ae(i == null ? void 0 : i.item);
|
|
133
|
+
if (t && t.value instanceof Function && n && n.value instanceof Function) {
|
|
134
|
+
const a = t.value(), { message: u } = a;
|
|
135
|
+
a.message = e, n.value(), a.message = u;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
I("uploadErrorFunc", e);
|
|
138
138
|
}
|
|
139
|
-
|
|
140
|
-
function
|
|
139
|
+
s(M, "validateForm");
|
|
140
|
+
function we(e, t) {
|
|
141
141
|
if (d.value = !1, i.onExceed)
|
|
142
142
|
return i.onExceed(e, t);
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}, 200) :
|
|
143
|
+
const n = `当前限制选择 ${b.limit} 个文件,本次选择了 ${e.length} 个文件,共选择了 ${e.length + t.length} 个文件` || ve.value;
|
|
144
|
+
U.value ? setTimeout(() => {
|
|
145
|
+
z.warning(n);
|
|
146
|
+
}, 200) : M(n);
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
function
|
|
148
|
+
s(we, "onExceedAction");
|
|
149
|
+
function ye(e) {
|
|
150
150
|
if (i.beforeUpload) {
|
|
151
|
-
const
|
|
152
|
-
return
|
|
151
|
+
const n = i.beforeUpload(e);
|
|
152
|
+
return n && g.value && !C.value && V(), n;
|
|
153
153
|
}
|
|
154
|
-
const t =
|
|
155
|
-
return t && L.value && g.value && !C.value &&
|
|
154
|
+
const t = Y(e, !0);
|
|
155
|
+
return t && L.value && g.value && !C.value && V(), t;
|
|
156
156
|
}
|
|
157
|
-
|
|
158
|
-
function
|
|
159
|
-
let
|
|
160
|
-
const { size:
|
|
157
|
+
s(ye, "beforeUploadAction");
|
|
158
|
+
function Y(e, t) {
|
|
159
|
+
let n = !0;
|
|
160
|
+
const { size: a, name: u } = e, f = A.value.length > 0 && !ee(u);
|
|
161
161
|
let m = !1;
|
|
162
|
-
switch (
|
|
162
|
+
switch (H.value) {
|
|
163
163
|
case "KB":
|
|
164
|
-
m =
|
|
164
|
+
m = a / 1024 > E.value;
|
|
165
165
|
break;
|
|
166
166
|
case "MB":
|
|
167
|
-
m =
|
|
167
|
+
m = a / 1024 / 1024 > E.value;
|
|
168
168
|
break;
|
|
169
169
|
default:
|
|
170
|
-
m =
|
|
170
|
+
m = a / 1024 / 1024 / 1024 > E.value;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
if (f) {
|
|
174
|
-
const h =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}, 200) :
|
|
174
|
+
const h = fe.value || `上传文件 ${e.name} 只能是 ${A.value.filter((Ae) => Ae).join(",").toLocaleLowerCase()} 格式!`;
|
|
175
|
+
U.value && t ? setTimeout(() => {
|
|
176
|
+
z.error(h);
|
|
177
|
+
}, 200) : M(h), n = !1;
|
|
178
178
|
}
|
|
179
179
|
if (m) {
|
|
180
|
-
const h =
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}, 200) :
|
|
180
|
+
const h = me.value || `上传文件 ${e.name} 大小不能超过 ${E.value}${H.value}!`;
|
|
181
|
+
U.value && t ? setTimeout(() => {
|
|
182
|
+
z.error(h);
|
|
183
|
+
}, 200) : M(h), n = !1;
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (k.value && !ee(u, We)) {
|
|
186
186
|
const h = `上传文件 ${e.name} 不是图片格式的文件!`;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}, 200) :
|
|
187
|
+
U.value && t ? setTimeout(() => {
|
|
188
|
+
z.error(h);
|
|
189
|
+
}, 200) : M(h), n = !1;
|
|
190
190
|
}
|
|
191
|
-
return
|
|
191
|
+
return n;
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
function
|
|
195
|
-
let
|
|
196
|
-
if (
|
|
193
|
+
s(Y, "validateUploadFile");
|
|
194
|
+
function ee(e, t) {
|
|
195
|
+
let n = [];
|
|
196
|
+
if (A.value.length > 0 ? n = A.value : t && (n = t), n.length <= 0)
|
|
197
197
|
return !0;
|
|
198
|
-
for (let
|
|
199
|
-
const
|
|
200
|
-
if (e.toLowerCase().endsWith(
|
|
198
|
+
for (let a = 0; a < n.length; a++) {
|
|
199
|
+
const u = (n[a] || "").toLowerCase();
|
|
200
|
+
if (e.toLowerCase().endsWith(u))
|
|
201
201
|
return !0;
|
|
202
202
|
}
|
|
203
203
|
return !1;
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
function
|
|
207
|
-
|
|
205
|
+
s(ee, "fileTypeMatch");
|
|
206
|
+
function V(e, t) {
|
|
207
|
+
l.uploadFileList.splice(e || 0, t || l.uploadFileList.length - 1);
|
|
208
208
|
}
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
209
|
+
s(V, "updateCoverFileList");
|
|
210
|
+
function Fe(e, t) {
|
|
211
|
+
l.uploadFileList = t;
|
|
212
|
+
const n = e.raw && Y(e.raw, !L.value);
|
|
213
|
+
if (n && g.value && !C.value && V(), i.onChange)
|
|
214
214
|
return i.onChange(e, t);
|
|
215
|
-
const { size:
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
|
|
215
|
+
const { size: a } = e;
|
|
216
|
+
if (a <= 0) {
|
|
217
|
+
te();
|
|
218
|
+
const u = ce.value || "禁止上传空文件,请检查后重新上传!";
|
|
219
|
+
U.value ? z.error(u) : M(u);
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
|
-
e.raw && (!L.value && !
|
|
222
|
+
e.raw && (!L.value && !n ? te() : (e.blob = URL.createObjectURL(e.raw) || "", I("onChangeFunc", e)));
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
function
|
|
224
|
+
s(Fe, "onChangeAction");
|
|
225
|
+
function te() {
|
|
226
226
|
let e = 0;
|
|
227
|
-
|
|
227
|
+
l.uploadFileList.length > 1 && (e = l.uploadFileList.length - 1), V(e, 1), I("onChangeFunc", {});
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
function
|
|
231
|
-
d.value = !1,
|
|
232
|
-
const { formRuleFunc:
|
|
233
|
-
if (
|
|
234
|
-
return i.onSuccess(e, t,
|
|
229
|
+
s(te, "setChangeRes");
|
|
230
|
+
function be(e, t, n) {
|
|
231
|
+
d.value = !1, l.initUploadStatus = !1;
|
|
232
|
+
const { formRuleFunc: a, formValidateFunc: u } = ae(i == null ? void 0 : i.item);
|
|
233
|
+
if (a && a.value instanceof Function && u && u.value instanceof Function && u.value(), i.onSuccess)
|
|
234
|
+
return i.onSuccess(e, t, n);
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
function Pe(e, t,
|
|
236
|
+
s(be, "onSuccessAction");
|
|
237
|
+
function Pe(e, t, n) {
|
|
238
238
|
if (d.value = !1, i.onError)
|
|
239
|
-
return i.onError(e, t,
|
|
239
|
+
return i.onError(e, t, n);
|
|
240
240
|
}
|
|
241
|
-
|
|
242
|
-
function
|
|
243
|
-
if (
|
|
241
|
+
s(Pe, "onErrorAction");
|
|
242
|
+
function ke(e, t) {
|
|
243
|
+
if (l.initUploadStatus = !t.length, l.uploadFileList = l.uploadFileList.filter((n) => n.uid === e.uid || n.name === e.name ? null : n), i.onRemove)
|
|
244
244
|
return i.onRemove(e, t);
|
|
245
245
|
}
|
|
246
|
-
|
|
247
|
-
function
|
|
246
|
+
s(ke, "onRemoveAction");
|
|
247
|
+
function Se(e) {
|
|
248
248
|
if (i.onPreview)
|
|
249
249
|
return i.onPreview(e);
|
|
250
|
-
const { raw: t, url:
|
|
251
|
-
t ?
|
|
252
|
-
|
|
253
|
-
})) :
|
|
254
|
-
|
|
255
|
-
})) :
|
|
250
|
+
const { raw: t, url: n, blob: a, name: u } = e, { type: f } = t || {};
|
|
251
|
+
t ? $.value && $.value.length > 0 ? f != null && f.startsWith("image") ? (l.typePreview = "image", l.sourcePreview = k.value ? [n] : [a], l.showPreview = !0) : $.value.includes("pdf") && f == "application/pdf" ? (l.typePreview = "pdf", l.sourcePreview = a, l.showPreview = !0) : $.value.includes("xlsx") && ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"].includes(f) ? (l.typePreview = "xlsx", fetch(a).then((m) => m.blob()).then((m) => {
|
|
252
|
+
l.sourcePreview = new File([m], u, { type: f }), l.showPreview = !0;
|
|
253
|
+
})) : $.value.includes("docx") && f == "application/vnd.openxmlformats-officedocument.wordprocessingml.document" && (l.typePreview = "docx", fetch(a).then((m) => m.blob()).then((m) => m.arrayBuffer()).then((m) => {
|
|
254
|
+
l.sourcePreview = m, l.showPreview = !0;
|
|
255
|
+
})) : k.value && f != null && f.startsWith("image") && (l.typePreview = "image", l.sourcePreview = [n], l.showPreview = !0) : k.value && (l.typePreview = "image", l.sourcePreview = [n], l.showPreview = !0);
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
async function
|
|
257
|
+
s(Se, "onPreviewAction");
|
|
258
|
+
async function Ce(e) {
|
|
259
259
|
const { file: t } = e;
|
|
260
260
|
if (!t)
|
|
261
261
|
return;
|
|
262
|
-
const { size:
|
|
263
|
-
if (
|
|
262
|
+
const { size: n } = t;
|
|
263
|
+
if (n <= 0 || !Y(t, !1))
|
|
264
264
|
return;
|
|
265
265
|
if (i.httpRequest)
|
|
266
266
|
return i.httpRequest(e);
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
267
|
+
const a = new FormData();
|
|
268
|
+
if (a.append("file", t), X.value instanceof Function) {
|
|
269
269
|
d.value = !0;
|
|
270
|
-
let
|
|
270
|
+
let u = {};
|
|
271
271
|
try {
|
|
272
|
-
|
|
272
|
+
u = await X.value(a);
|
|
273
273
|
} catch (f) {
|
|
274
|
-
|
|
274
|
+
u = f;
|
|
275
275
|
} finally {
|
|
276
|
-
d.value = !1,
|
|
276
|
+
d.value = !1, I("httpResponseFunc", u);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
|
|
281
|
-
function
|
|
280
|
+
s(Ce, "httpRequestAction");
|
|
281
|
+
function ie() {
|
|
282
282
|
let e = !1;
|
|
283
|
-
for (let t = 0; t <
|
|
284
|
-
if (
|
|
283
|
+
for (let t = 0; t < l.uploadFileList.length; t++)
|
|
284
|
+
if (l.uploadFileList[t].status === Oe.ready) {
|
|
285
285
|
e = !0;
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
return e;
|
|
289
289
|
}
|
|
290
|
-
|
|
291
|
-
function
|
|
290
|
+
s(ie, "hasReadyFile");
|
|
291
|
+
function oe() {
|
|
292
292
|
var e;
|
|
293
293
|
(e = v == null ? void 0 : v.value) == null || e.submit();
|
|
294
294
|
}
|
|
295
|
-
|
|
296
|
-
function
|
|
295
|
+
s(oe, "comfirmUpload");
|
|
296
|
+
function Le(e) {
|
|
297
297
|
v == null || v.value.handleRemove(e);
|
|
298
298
|
}
|
|
299
|
-
|
|
300
|
-
function
|
|
301
|
-
|
|
299
|
+
s(Le, "removeFile");
|
|
300
|
+
function _e() {
|
|
301
|
+
l.uploadFileList.forEach((e) => {
|
|
302
302
|
var t;
|
|
303
303
|
if (e)
|
|
304
304
|
try {
|
|
305
|
-
(t = v == null ? void 0 : v.value) == null || t.abort(e),
|
|
305
|
+
(t = v == null ? void 0 : v.value) == null || t.abort(e), Le(e);
|
|
306
306
|
} catch {
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
|
|
311
|
-
function
|
|
310
|
+
s(_e, "cancelUpload");
|
|
311
|
+
function xe() {
|
|
312
312
|
d.value = !0;
|
|
313
313
|
}
|
|
314
|
-
|
|
315
|
-
function
|
|
316
|
-
|
|
314
|
+
s(xe, "onProgressAction");
|
|
315
|
+
function Ue() {
|
|
316
|
+
l.showPreview = !1, l.sourcePreview = "";
|
|
317
317
|
}
|
|
318
|
-
return
|
|
318
|
+
return s(Ue, "closePreview"), j({
|
|
319
319
|
uploadRef: v
|
|
320
320
|
}), (e, t) => {
|
|
321
|
-
const
|
|
321
|
+
const n = Ke, a = Xe, u = Re("LSPreview");
|
|
322
322
|
return c(), p("div", {
|
|
323
|
-
class:
|
|
323
|
+
class: D([o(ue), o(T) ? "ls-upload-drag" : "", o(Z) ? "ls-profile" : "", o(pe) ? "hide-cover-btn" : ""])
|
|
324
324
|
}, [
|
|
325
|
-
|
|
325
|
+
Q(a, ze({
|
|
326
326
|
ref_key: "uploadRef",
|
|
327
327
|
ref: v
|
|
328
|
-
},
|
|
329
|
-
"on-exceed":
|
|
330
|
-
"before-upload":
|
|
331
|
-
"on-change":
|
|
332
|
-
"on-success":
|
|
328
|
+
}, o(He)(o(P), e.$attrs), {
|
|
329
|
+
"on-exceed": we,
|
|
330
|
+
"before-upload": ye,
|
|
331
|
+
"on-change": Fe,
|
|
332
|
+
"on-success": be,
|
|
333
333
|
"on-error": Pe,
|
|
334
|
-
"on-remove":
|
|
335
|
-
"on-preview":
|
|
336
|
-
"on-progress":
|
|
337
|
-
}),
|
|
334
|
+
"on-remove": ke,
|
|
335
|
+
"on-preview": Se,
|
|
336
|
+
"on-progress": xe
|
|
337
|
+
}), Be({
|
|
338
338
|
trigger: w(() => [
|
|
339
|
-
|
|
339
|
+
o(Z) ? e.item.defProfile && o(l).uploadFileList.length < 1 ? (c(), y(n, {
|
|
340
340
|
key: 1,
|
|
341
341
|
size: 60,
|
|
342
342
|
src: e.item.defProfile,
|
|
343
343
|
fit: "contain"
|
|
344
|
-
}, null, 8, ["src"])) :
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
344
|
+
}, null, 8, ["src"])) : q("", !0) : (c(), p(S, { key: 0 }, [
|
|
345
|
+
o(B).trigger ? O(e.$slots, "trigger", { key: 1 }, void 0, !0) : (c(), p(S, { key: 0 }, [
|
|
346
|
+
o(T) ? (c(), p(S, { key: 0 }, [
|
|
347
|
+
o(d) ? (c(), y(x, {
|
|
348
348
|
key: 0,
|
|
349
349
|
text: "",
|
|
350
|
-
loading:
|
|
351
|
-
|
|
350
|
+
loading: o(d),
|
|
351
|
+
disabled: o(_)
|
|
352
|
+
}, null, 8, ["loading", "disabled"])) : (c(), y(se, {
|
|
352
353
|
key: 1,
|
|
353
354
|
class: "upload-icon",
|
|
354
355
|
name: "UploadFilled",
|
|
355
356
|
size: "56",
|
|
356
357
|
color: "#E7E7E7"
|
|
357
358
|
})),
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
W("div", Je, [
|
|
360
|
+
W("div", Qe, N(o(K)), 1),
|
|
361
|
+
o(d) ? q("", !0) : (c(), p(S, { key: 0 }, [
|
|
362
|
+
R(" / "),
|
|
363
|
+
Ze
|
|
363
364
|
], 64))
|
|
364
365
|
])
|
|
365
|
-
], 64)) : (c(), p(
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
], 64)) : (c(), p(S, { key: 1 }, [
|
|
367
|
+
o(k) ? (c(), p("div", et, [
|
|
368
|
+
o(d) ? (c(), y(x, {
|
|
368
369
|
key: 0,
|
|
369
370
|
text: "",
|
|
370
|
-
loading:
|
|
371
|
-
|
|
371
|
+
loading: o(d),
|
|
372
|
+
disabled: o(_)
|
|
373
|
+
}, null, 8, ["loading", "disabled"])) : (c(), y(se, {
|
|
372
374
|
key: 1,
|
|
373
375
|
class: "upload-btn-plus",
|
|
374
376
|
name: "Plus",
|
|
375
377
|
size: 28,
|
|
376
|
-
color: l
|
|
378
|
+
color: o(l).iconColor
|
|
377
379
|
}, null, 8, ["color"])),
|
|
378
|
-
|
|
379
|
-
])) : (c(), y(
|
|
380
|
+
W("div", null, N(o(K)), 1)
|
|
381
|
+
])) : (c(), y(x, {
|
|
380
382
|
key: 1,
|
|
381
383
|
plain: "",
|
|
382
384
|
icon: "upload",
|
|
383
|
-
loading:
|
|
385
|
+
loading: o(d),
|
|
386
|
+
disabled: o(_)
|
|
384
387
|
}, {
|
|
385
388
|
default: w(() => [
|
|
386
|
-
|
|
389
|
+
R(N(o(K)), 1)
|
|
387
390
|
]),
|
|
388
391
|
_: 1
|
|
389
|
-
}, 8, ["loading"]))
|
|
392
|
+
}, 8, ["loading", "disabled"]))
|
|
390
393
|
], 64))
|
|
391
394
|
], 64))
|
|
392
395
|
], 64))
|
|
393
396
|
]),
|
|
394
397
|
default: w(() => [
|
|
395
|
-
|
|
396
|
-
!
|
|
398
|
+
o(B).default ? O(e.$slots, "default", { key: 1 }, void 0, !0) : (c(), p(S, { key: 0 }, [
|
|
399
|
+
!o(L) && (o(de) || o(T)) ? (c(), p("div", {
|
|
397
400
|
key: 0,
|
|
398
|
-
class:
|
|
401
|
+
class: D(["upload-btn-handle", [o(T) ? "drag-css" : "nor-css", !o(g) || o(C) ? "multi-css" : ""]])
|
|
399
402
|
}, [
|
|
400
|
-
|
|
401
|
-
!
|
|
403
|
+
o(T) ? (c(), p(S, { key: 1 }, [
|
|
404
|
+
!o(g) || o(C) ? (c(), y(x, {
|
|
402
405
|
key: 0,
|
|
403
406
|
type: "primary",
|
|
404
|
-
|
|
407
|
+
loading: o(d),
|
|
408
|
+
disabled: o(_),
|
|
409
|
+
onClick: _e,
|
|
405
410
|
class: "ls-upload-btn-com ls-upload-btn-cancel"
|
|
406
411
|
}, {
|
|
407
412
|
default: w(() => [
|
|
408
|
-
|
|
413
|
+
R("取消上传")
|
|
409
414
|
]),
|
|
410
415
|
_: 1
|
|
411
|
-
})) :
|
|
412
|
-
|
|
413
|
-
class:
|
|
416
|
+
}, 8, ["loading", "disabled"])) : q("", !0),
|
|
417
|
+
Q(x, {
|
|
418
|
+
class: D(["start-upload ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
|
|
414
419
|
type: "primary",
|
|
415
|
-
loading:
|
|
416
|
-
|
|
420
|
+
loading: o(d),
|
|
421
|
+
disabled: o(_),
|
|
422
|
+
onClick: oe
|
|
417
423
|
}, {
|
|
418
424
|
default: w(() => [
|
|
419
|
-
|
|
425
|
+
R("开始上传")
|
|
420
426
|
]),
|
|
421
427
|
_: 1
|
|
422
|
-
}, 8, ["class", "loading"])
|
|
423
|
-
], 64)) : (c(), y(
|
|
428
|
+
}, 8, ["class", "loading", "disabled"])
|
|
429
|
+
], 64)) : (c(), y(x, {
|
|
424
430
|
key: 0,
|
|
425
431
|
type: "primary",
|
|
426
|
-
class:
|
|
427
|
-
loading:
|
|
428
|
-
|
|
432
|
+
class: D(["ls-upload-btn-com ls-upload-btn-comfirm", { "is-ready": ie() }]),
|
|
433
|
+
loading: o(d),
|
|
434
|
+
disabled: o(_),
|
|
435
|
+
onClick: oe
|
|
429
436
|
}, {
|
|
430
437
|
default: w(() => [
|
|
431
|
-
|
|
438
|
+
R("开始上传 ")
|
|
432
439
|
]),
|
|
433
440
|
_: 1
|
|
434
|
-
}, 8, ["class", "loading"]))
|
|
435
|
-
], 2)) :
|
|
441
|
+
}, 8, ["class", "loading", "disabled"]))
|
|
442
|
+
], 2)) : q("", !0)
|
|
436
443
|
], 64))
|
|
437
444
|
]),
|
|
438
445
|
tip: w(() => [
|
|
439
|
-
|
|
446
|
+
o(B).tip ? O(e.$slots, "tip", { key: 1 }, void 0, !0) : (c(), p("div", tt, N(o(ge)), 1))
|
|
440
447
|
]),
|
|
441
448
|
_: 2
|
|
442
449
|
}, [
|
|
443
|
-
|
|
450
|
+
o(B).file ? {
|
|
444
451
|
name: "file",
|
|
445
452
|
fn: w(() => [
|
|
446
|
-
|
|
453
|
+
O(e.$slots, "file", {}, void 0, !0)
|
|
447
454
|
]),
|
|
448
455
|
key: "0"
|
|
449
456
|
} : void 0
|
|
450
457
|
]), 1040),
|
|
451
|
-
|
|
452
|
-
modelValue: l
|
|
453
|
-
"onUpdate:modelValue": t[0] || (t[0] = (f) => l
|
|
454
|
-
"on-close":
|
|
455
|
-
type: l
|
|
456
|
-
source: l
|
|
458
|
+
Q(u, {
|
|
459
|
+
modelValue: o(l).showPreview,
|
|
460
|
+
"onUpdate:modelValue": t[0] || (t[0] = (f) => o(l).showPreview = f),
|
|
461
|
+
"on-close": Ue,
|
|
462
|
+
type: o(l).typePreview,
|
|
463
|
+
source: o(l).sourcePreview
|
|
457
464
|
}, null, 8, ["modelValue", "type", "source"])
|
|
458
465
|
], 2);
|
|
459
466
|
};
|
|
460
467
|
}
|
|
461
468
|
});
|
|
462
469
|
export {
|
|
463
|
-
|
|
470
|
+
Ft as default
|
|
464
471
|
};
|