geekplus-digital-ui 0.1.18 → 0.1.20
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/components/icon/src/icon.css +1 -1
- package/components/icon/src/icon.vue.js +3 -3
- package/components/upload/index.d.ts +6 -8
- package/components/upload/src/upload.css +1 -1
- package/components/upload/src/upload.vue.d.ts +6 -8
- package/components/upload/src/upload.vue.js +189 -192
- package/package.json +31 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-icon[data-v-
|
|
1
|
+
.d-icon[data-v-29c845ca]{display:inline-flex}.d-icon[data-v-29c845ca] svg{box-sizing:content-box;display:inline-block;height:1em;overflow:visible;vertical-align:-.125em;width:1.25em}
|
|
@@ -5,12 +5,12 @@ const r = { class: "d-icon" }, s = /* @__PURE__ */ Object.assign({
|
|
|
5
5
|
name: "DIcon"
|
|
6
6
|
}, {
|
|
7
7
|
__name: "icon",
|
|
8
|
-
setup(
|
|
9
|
-
return (e,
|
|
8
|
+
setup(a) {
|
|
9
|
+
return (e, _) => (o(), t("i", r, [
|
|
10
10
|
c(e.$slots, "default", {}, void 0, !0)
|
|
11
11
|
]));
|
|
12
12
|
}
|
|
13
|
-
}), m = /* @__PURE__ */ n(s, [["__scopeId", "data-v-
|
|
13
|
+
}), m = /* @__PURE__ */ n(s, [["__scopeId", "data-v-29c845ca"]]);
|
|
14
14
|
export {
|
|
15
15
|
m as default
|
|
16
16
|
};
|
|
@@ -13,7 +13,6 @@ export const DUpload: import('vue').DefineComponent<{}, {
|
|
|
13
13
|
showTip: boolean;
|
|
14
14
|
pasteable: boolean;
|
|
15
15
|
showDownloadAll: boolean;
|
|
16
|
-
beforeUpload?: Function;
|
|
17
16
|
docType?: string;
|
|
18
17
|
scrollHeight?: string;
|
|
19
18
|
downloadAllMethod?: Function;
|
|
@@ -31,7 +30,6 @@ export const DUpload: import('vue').DefineComponent<{}, {
|
|
|
31
30
|
readonly showTip?: boolean;
|
|
32
31
|
readonly pasteable?: boolean;
|
|
33
32
|
readonly showDownloadAll?: boolean;
|
|
34
|
-
readonly beforeUpload?: Function;
|
|
35
33
|
readonly docType?: string;
|
|
36
34
|
readonly scrollHeight?: string;
|
|
37
35
|
readonly downloadAllMethod?: Function;
|
|
@@ -128,13 +126,13 @@ export const DUpload: import('vue').DefineComponent<{}, {
|
|
|
128
126
|
type: import('vue').PropType<boolean>;
|
|
129
127
|
default: undefined;
|
|
130
128
|
};
|
|
129
|
+
crossorigin: {
|
|
130
|
+
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
131
|
+
};
|
|
131
132
|
beforeUpload: {
|
|
132
133
|
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
133
134
|
default: () => void;
|
|
134
135
|
};
|
|
135
|
-
crossorigin: {
|
|
136
|
-
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
137
|
-
};
|
|
138
136
|
beforeRemove: {
|
|
139
137
|
type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
|
|
140
138
|
};
|
|
@@ -295,13 +293,13 @@ export const DUpload: import('vue').DefineComponent<{}, {
|
|
|
295
293
|
type: import('vue').PropType<boolean>;
|
|
296
294
|
default: undefined;
|
|
297
295
|
};
|
|
296
|
+
crossorigin: {
|
|
297
|
+
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
298
|
+
};
|
|
298
299
|
beforeUpload: {
|
|
299
300
|
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
300
301
|
default: () => void;
|
|
301
302
|
};
|
|
302
|
-
crossorigin: {
|
|
303
|
-
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
304
|
-
};
|
|
305
303
|
beforeRemove: {
|
|
306
304
|
type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
|
|
307
305
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.d-upload[data-v-
|
|
1
|
+
.d-upload[data-v-10f8e9fe]{line-height:normal}.d-upload.is-list[data-v-10f8e9fe],.d-upload.is-list .list[data-v-10f8e9fe]{display:flex;flex-direction:column;gap:8px}.d-upload.is-list .list .list-item .file-row[data-v-10f8e9fe]{position:relative;display:flex;align-items:center;gap:10px}.d-upload.is-list .list .list-item .file-row[data-v-10f8e9fe] .el-link{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d-upload.is-list .list .list-item .file-row[data-v-10f8e9fe] .el-link .el-link__inner{display:inline}.d-upload.is-list .list .list-item .file-row .remove-icon[data-v-10f8e9fe]{cursor:pointer;display:none;color:var(--el-text-color-secondary)}.d-upload.is-list .list .list-item .file-row:hover .remove-icon[data-v-10f8e9fe]{display:block}.d-upload.is-card[data-v-10f8e9fe],.d-upload.is-card .card[data-v-10f8e9fe]{display:flex;flex-wrap:wrap;gap:8px}.d-upload.is-card .card .card-item[data-v-10f8e9fe]{display:flex;justify-content:center;align-items:center;font-size:16px;border:1px solid var(--el-border-color);border-radius:4px;overflow:hidden;position:relative;cursor:pointer}.d-upload.is-card .card .card-item .card-cover[data-v-10f8e9fe]{display:flex;justify-content:center;align-items:center;gap:10px;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--el-overlay-color);opacity:0}.d-upload.is-card .card .card-item .card-cover .d-icon[data-v-10f8e9fe]{color:var(--el-color-white)}.d-upload.is-card .card .card-item .card-cover[data-v-10f8e9fe]:hover{opacity:1}.d-upload.is-card .card .el-image[data-v-10f8e9fe]{width:100%;height:100%}.d-upload .expand-toggle[data-v-10f8e9fe]{width:100%}.d-upload .expand-toggle[data-v-10f8e9fe] .el-link__inner{gap:5px}.d-upload .tip[data-v-10f8e9fe]{width:100%;font-size:12px;margin:0;color:var(--el-text-color-regular)}
|
|
@@ -13,7 +13,6 @@ declare const _default: import('vue').DefineComponent<{}, {
|
|
|
13
13
|
showTip: boolean;
|
|
14
14
|
pasteable: boolean;
|
|
15
15
|
showDownloadAll: boolean;
|
|
16
|
-
beforeUpload?: Function;
|
|
17
16
|
docType?: string;
|
|
18
17
|
scrollHeight?: string;
|
|
19
18
|
downloadAllMethod?: Function;
|
|
@@ -31,7 +30,6 @@ declare const _default: import('vue').DefineComponent<{}, {
|
|
|
31
30
|
readonly showTip?: boolean;
|
|
32
31
|
readonly pasteable?: boolean;
|
|
33
32
|
readonly showDownloadAll?: boolean;
|
|
34
|
-
readonly beforeUpload?: Function;
|
|
35
33
|
readonly docType?: string;
|
|
36
34
|
readonly scrollHeight?: string;
|
|
37
35
|
readonly downloadAllMethod?: Function;
|
|
@@ -128,13 +126,13 @@ declare const _default: import('vue').DefineComponent<{}, {
|
|
|
128
126
|
type: import('vue').PropType<boolean>;
|
|
129
127
|
default: undefined;
|
|
130
128
|
};
|
|
129
|
+
crossorigin: {
|
|
130
|
+
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
131
|
+
};
|
|
131
132
|
beforeUpload: {
|
|
132
133
|
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
133
134
|
default: () => void;
|
|
134
135
|
};
|
|
135
|
-
crossorigin: {
|
|
136
|
-
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
137
|
-
};
|
|
138
136
|
beforeRemove: {
|
|
139
137
|
type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
|
|
140
138
|
};
|
|
@@ -295,13 +293,13 @@ declare const _default: import('vue').DefineComponent<{}, {
|
|
|
295
293
|
type: import('vue').PropType<boolean>;
|
|
296
294
|
default: undefined;
|
|
297
295
|
};
|
|
296
|
+
crossorigin: {
|
|
297
|
+
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
298
|
+
};
|
|
298
299
|
beforeUpload: {
|
|
299
300
|
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
300
301
|
default: () => void;
|
|
301
302
|
};
|
|
302
|
-
crossorigin: {
|
|
303
|
-
type: import('vue').PropType<import('element-plus').Crossorigin>;
|
|
304
|
-
};
|
|
305
303
|
beforeRemove: {
|
|
306
304
|
type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
|
|
307
305
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useModel as
|
|
1
|
+
import { useModel as fe, ref as y, computed as m, reactive as Ve, watch as De, onMounted as Ee, onBeforeUnmount as Ie, openBlock as o, createElementBlock as f, normalizeClass as Ne, createVNode as d, unref as n, createBlock as c, createCommentVNode as p, withCtx as r, createElementVNode as C, createTextVNode as S, toDisplayString as k, normalizeStyle as M, Fragment as R, renderList as me, withModifiers as ve, mergeModels as ye } from "vue";
|
|
2
2
|
import "../../../hooks/index.js";
|
|
3
|
-
import { useFormItem as
|
|
3
|
+
import { useFormItem as Be, ElMessageBox as $e, ElMessage as H, ElUpload as je, ElImageViewer as Pe, ElDialog as Re, ElButton as F, ElImage as He, ElProgress as he, ElLink as q } from "element-plus";
|
|
4
4
|
import "../../index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isFunction as qe } from "lodash-es";
|
|
6
6
|
import { saveAs as Oe } from "file-saver";
|
|
7
7
|
import Ke from "../../icons/angle-down-light.vue.js";
|
|
8
8
|
import Xe from "../../icons/angle-up-light.vue.js";
|
|
@@ -29,7 +29,7 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
29
29
|
name: "DUpload"
|
|
30
30
|
}, {
|
|
31
31
|
__name: "upload",
|
|
32
|
-
props: /* @__PURE__ */
|
|
32
|
+
props: /* @__PURE__ */ ye({
|
|
33
33
|
domain: {
|
|
34
34
|
type: String,
|
|
35
35
|
required: !0
|
|
@@ -66,9 +66,6 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
66
66
|
type: String,
|
|
67
67
|
default: "card"
|
|
68
68
|
},
|
|
69
|
-
beforeUpload: {
|
|
70
|
-
type: Function
|
|
71
|
-
},
|
|
72
69
|
docType: {
|
|
73
70
|
type: String
|
|
74
71
|
},
|
|
@@ -106,199 +103,199 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
106
103
|
},
|
|
107
104
|
uploadingCountModifiers: {}
|
|
108
105
|
}),
|
|
109
|
-
emits: /* @__PURE__ */
|
|
110
|
-
setup(g, { emit:
|
|
111
|
-
const
|
|
112
|
-
width:
|
|
113
|
-
height:
|
|
114
|
-
})),
|
|
115
|
-
maxHeight:
|
|
106
|
+
emits: /* @__PURE__ */ ye(["change", "success"], ["update:modelValue", "update:uploadingCount"]),
|
|
107
|
+
setup(g, { emit: ge }) {
|
|
108
|
+
const a = g, O = ge, K = fe(g, "modelValue"), ke = fe(g, "uploadingCount"), X = ["jpg", "jpeg", "png", "gif"], we = ["mp4"], s = y([]), z = y(!1), w = y(!1), V = y(0), D = y([]), L = y(""), x = y(!1), G = y(null), J = y(null), { t: u } = lt(), xe = at(), { formItem: _e } = Be(), E = m(() => x.value ? s.value : s.value.slice(0, a.maxShow)), I = m(() => s.value.length > 0), N = m(() => !a.disabled && !Q.value), b = m(() => a.showType === "list"), Q = m(() => s.value.length >= a.maxNumber), Ce = m(() => b.value ? "is-list" : "is-card"), W = m(() => a.format.length ? a.format.map((t) => t.toUpperCase()) : []), Y = m(() => ({
|
|
109
|
+
width: a.size,
|
|
110
|
+
height: a.size
|
|
111
|
+
})), Se = m(() => a.format.map((t) => `.${t}`).join(",")), Z = m(() => ({
|
|
112
|
+
maxHeight: a.scrollHeight,
|
|
116
113
|
overflow: "auto"
|
|
117
|
-
})), Le =
|
|
118
|
-
const t =
|
|
119
|
-
return
|
|
120
|
-
}),
|
|
121
|
-
s.value.some((e) => e.
|
|
114
|
+
})), Le = m(() => {
|
|
115
|
+
const t = a.format.length && a.format.every((e) => X.includes(e)), l = [];
|
|
116
|
+
return a.maxSize && !t && l.push(u("d.upload.lessThan", { size: a.maxSize })), a.format.length && l.push(u("d.upload.format", { format: a.format.join("/") })), a.pasteable && l.push(u("d.upload.pasteable")), l.join(u("d.upload.comma"));
|
|
117
|
+
}), be = (t) => {
|
|
118
|
+
s.value.some((e) => e.status === "uploading") || (s.value = t?.map((e) => ({
|
|
122
119
|
id: e.id,
|
|
123
120
|
name: e.name || e.docName,
|
|
124
121
|
docName: e.name || e.docName,
|
|
125
122
|
url: e.url || e.docUrl,
|
|
126
123
|
docUrl: e.url || e.docUrl,
|
|
127
|
-
type:
|
|
128
|
-
docType:
|
|
129
|
-
|
|
130
|
-
})) || []);
|
|
131
|
-
},
|
|
124
|
+
type: a.docType || e.type || e.docType,
|
|
125
|
+
docType: a.docType || e.type || e.docType,
|
|
126
|
+
status: "success"
|
|
127
|
+
})) || [], A());
|
|
128
|
+
}, B = (t) => {
|
|
132
129
|
if (t) {
|
|
133
|
-
const
|
|
134
|
-
return
|
|
130
|
+
const l = t.split(".");
|
|
131
|
+
return l[l.length - 1].toLowerCase();
|
|
135
132
|
}
|
|
136
133
|
return "";
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
},
|
|
140
|
-
if (V.value = 0,
|
|
141
|
-
const
|
|
142
|
-
V.value =
|
|
134
|
+
}, _ = (t) => X.includes(B(t.name)), T = (t) => we.includes(B(t.name)), U = (t) => t?.status === "success", ee = (t) => !a.disabled && U(t), te = () => {
|
|
135
|
+
G.value?.$el.querySelector("input")?.click();
|
|
136
|
+
}, Te = (t) => {
|
|
137
|
+
if (V.value = 0, D.value = [], L.value = "", _(t)) {
|
|
138
|
+
const l = s.value.filter((e) => _(e));
|
|
139
|
+
V.value = l.findIndex((e) => e.url === t.url), D.value = l.map((e) => e.url), z.value = !0;
|
|
143
140
|
}
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
|
|
141
|
+
T(t) && (L.value = t.url, w.value = !0);
|
|
142
|
+
}, le = () => {
|
|
143
|
+
J.value?.pause(), w.value = !1;
|
|
144
|
+
}, ae = (t) => {
|
|
145
|
+
const l = () => {
|
|
146
|
+
const i = s.value.indexOf(t);
|
|
147
|
+
i !== -1 && (s.value.splice(i, 1), A(), oe(t));
|
|
151
148
|
}, e = async () => {
|
|
152
|
-
if (!
|
|
153
|
-
|
|
149
|
+
if (!U(t)) {
|
|
150
|
+
l();
|
|
154
151
|
return;
|
|
155
152
|
}
|
|
156
|
-
|
|
153
|
+
l();
|
|
157
154
|
};
|
|
158
|
-
|
|
155
|
+
$e.confirm(u("d.upload.deleteConfirm"), u("d.upload.tip"), {
|
|
159
156
|
type: "warning"
|
|
160
157
|
}).then(async () => {
|
|
161
158
|
await e();
|
|
162
159
|
}).catch(() => {
|
|
163
160
|
});
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}, Fe = (t, a) => {
|
|
169
|
-
const e = P(t.name);
|
|
161
|
+
}, Ue = (t, l) => {
|
|
162
|
+
H.success(u("d.upload.fileSuccess", { file: t.name })), O("success", t, l, s.value);
|
|
163
|
+
}, Ae = (t, l) => {
|
|
164
|
+
const e = B(t.name);
|
|
170
165
|
if (e) {
|
|
171
|
-
const
|
|
172
|
-
if (
|
|
173
|
-
return
|
|
166
|
+
const i = e.toUpperCase();
|
|
167
|
+
if (W.value.length && !W.value.includes(i))
|
|
168
|
+
return l || H.error(u("d.upload.fileFormat", { file: t.name, format: a.format.join("/") })), !1;
|
|
174
169
|
}
|
|
175
170
|
return !0;
|
|
176
|
-
}, Me = (t) => t.size >
|
|
177
|
-
if (!
|
|
171
|
+
}, Me = (t) => t.size > a.maxSize * 1024 * 1024 ? (H.error(u("d.upload.fileLessThan", { file: t.name, size: a.maxSize })), !1) : !0, Fe = (t, l) => {
|
|
172
|
+
if (!l)
|
|
178
173
|
return;
|
|
179
|
-
const { loaded: e = 0, total:
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
|
|
174
|
+
const { loaded: e = 0, total: i = 0 } = t || {};
|
|
175
|
+
i > 0 && (l.percentage = Math.floor(e / i * 100));
|
|
176
|
+
}, oe = (t) => {
|
|
177
|
+
K.value = s.value, O("change", t, s.value), _e?.validate("change");
|
|
178
|
+
}, A = () => {
|
|
179
|
+
ke.value = s.value.filter((t) => t.status === "uploading").length;
|
|
180
|
+
}, ne = (t, l) => (Ae(t, l) && Me(t) && ze(t), !1), ze = async (t) => {
|
|
181
|
+
if (Q.value)
|
|
183
182
|
return !1;
|
|
184
|
-
x.value ||
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const e =
|
|
188
|
-
|
|
183
|
+
x.value || $();
|
|
184
|
+
const l = new FormData();
|
|
185
|
+
l.append("file", t);
|
|
186
|
+
const e = Ve({
|
|
187
|
+
status: "uploading",
|
|
189
188
|
percentage: 0,
|
|
190
189
|
name: t.name
|
|
191
190
|
});
|
|
192
|
-
s.value.push(e);
|
|
193
|
-
const
|
|
194
|
-
X.value++;
|
|
195
|
-
const m = () => s.value.indexOf(e);
|
|
191
|
+
s.value.push(e), A();
|
|
192
|
+
const i = () => s.value.indexOf(e);
|
|
196
193
|
try {
|
|
197
|
-
const { data:
|
|
198
|
-
url:
|
|
194
|
+
const { data: v } = await a.axios({
|
|
195
|
+
url: a.url,
|
|
199
196
|
method: "post",
|
|
200
|
-
data:
|
|
201
|
-
onUploadProgress: (
|
|
202
|
-
}),
|
|
203
|
-
if (
|
|
197
|
+
data: l,
|
|
198
|
+
onUploadProgress: (P) => Fe(P, e)
|
|
199
|
+
}), j = v?.data || v;
|
|
200
|
+
if (j && i() !== -1) {
|
|
204
201
|
const {
|
|
205
|
-
id:
|
|
206
|
-
name:
|
|
207
|
-
url:
|
|
208
|
-
type:
|
|
209
|
-
} =
|
|
202
|
+
id: P,
|
|
203
|
+
name: de,
|
|
204
|
+
url: ce,
|
|
205
|
+
type: pe
|
|
206
|
+
} = j;
|
|
210
207
|
Object.assign(e, {
|
|
211
|
-
id:
|
|
212
|
-
name:
|
|
213
|
-
docName:
|
|
214
|
-
url:
|
|
215
|
-
docUrl:
|
|
216
|
-
type:
|
|
217
|
-
docType:
|
|
218
|
-
|
|
219
|
-
}),
|
|
220
|
-
} else
|
|
208
|
+
id: P,
|
|
209
|
+
name: de,
|
|
210
|
+
docName: de,
|
|
211
|
+
url: a.domain + ce,
|
|
212
|
+
docUrl: a.domain + ce,
|
|
213
|
+
type: a.docType || pe,
|
|
214
|
+
docType: a.docType || pe,
|
|
215
|
+
status: "success"
|
|
216
|
+
}), Ue(j, e);
|
|
217
|
+
} else i() !== -1 && s.value.splice(i(), 1);
|
|
221
218
|
} catch {
|
|
222
|
-
|
|
219
|
+
i() !== -1 && s.value.splice(i(), 1);
|
|
223
220
|
} finally {
|
|
224
|
-
|
|
221
|
+
A(), oe(e);
|
|
225
222
|
}
|
|
226
|
-
},
|
|
223
|
+
}, se = (t) => {
|
|
227
224
|
t?.url && Oe(t.url, t.name);
|
|
228
|
-
},
|
|
225
|
+
}, $ = () => {
|
|
229
226
|
x.value = !x.value;
|
|
230
|
-
},
|
|
231
|
-
if (!
|
|
227
|
+
}, ie = (t) => {
|
|
228
|
+
if (!a.pasteable || a.disabled || !xe.value)
|
|
232
229
|
return;
|
|
233
|
-
const
|
|
234
|
-
for (let e = 0; e <
|
|
235
|
-
const
|
|
236
|
-
|
|
230
|
+
const l = t.clipboardData?.items || [];
|
|
231
|
+
for (let e = 0; e < l.length; e++) {
|
|
232
|
+
const v = l[e].getAsFile();
|
|
233
|
+
v && ne(v, !0);
|
|
237
234
|
}
|
|
238
|
-
},
|
|
239
|
-
!
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
|
|
235
|
+
}, re = (t) => {
|
|
236
|
+
!I.value || !t?.url || (_(t) || T(t) ? Te(t) : se(t));
|
|
237
|
+
}, ue = () => {
|
|
238
|
+
qe(a.downloadAllMethod) ? a.downloadAllMethod(s.value) : s.value.forEach((t) => {
|
|
239
|
+
se(t);
|
|
243
240
|
});
|
|
244
241
|
};
|
|
245
|
-
return
|
|
246
|
-
|
|
242
|
+
return De(
|
|
243
|
+
K,
|
|
247
244
|
(t) => {
|
|
248
|
-
|
|
245
|
+
be(t);
|
|
249
246
|
},
|
|
250
247
|
{ immediate: !0 }
|
|
251
|
-
),
|
|
252
|
-
document.addEventListener("paste",
|
|
253
|
-
}),
|
|
254
|
-
document.removeEventListener("paste",
|
|
255
|
-
}), (t,
|
|
256
|
-
class:
|
|
248
|
+
), Ee(() => {
|
|
249
|
+
document.addEventListener("paste", ie);
|
|
250
|
+
}), Ie(() => {
|
|
251
|
+
document.removeEventListener("paste", ie);
|
|
252
|
+
}), (t, l) => (o(), f("div", {
|
|
253
|
+
class: Ne(["d-upload", Ce.value])
|
|
257
254
|
}, [
|
|
258
255
|
d(n(je), {
|
|
259
256
|
ref_key: "uploadRef",
|
|
260
|
-
ref:
|
|
257
|
+
ref: G,
|
|
261
258
|
style: { display: "none" },
|
|
262
259
|
"show-file-list": !1,
|
|
263
260
|
"file-list": s.value,
|
|
264
|
-
accept:
|
|
265
|
-
"before-upload":
|
|
261
|
+
accept: Se.value,
|
|
262
|
+
"before-upload": ne,
|
|
266
263
|
"with-credentials": "",
|
|
267
264
|
multiple: "",
|
|
268
265
|
action: "/"
|
|
269
266
|
}, null, 8, ["file-list", "accept"]),
|
|
270
|
-
|
|
267
|
+
z.value ? (o(), c(n(Pe), {
|
|
271
268
|
key: 0,
|
|
272
|
-
"url-list":
|
|
269
|
+
"url-list": D.value,
|
|
273
270
|
"initial-index": V.value,
|
|
274
271
|
"hide-on-click-modal": "",
|
|
275
272
|
teleported: "",
|
|
276
|
-
onClose:
|
|
273
|
+
onClose: l[0] || (l[0] = (e) => z.value = !1)
|
|
277
274
|
}, null, 8, ["url-list", "initial-index"])) : p("", !0),
|
|
278
|
-
w.value ? (o(), c(n(
|
|
275
|
+
w.value ? (o(), c(n(Re), {
|
|
279
276
|
key: 1,
|
|
280
277
|
modelValue: w.value,
|
|
281
|
-
"onUpdate:modelValue":
|
|
282
|
-
title: n(
|
|
278
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => w.value = e),
|
|
279
|
+
title: n(u)("d.upload.preview"),
|
|
283
280
|
width: "1200px",
|
|
284
281
|
"align-center": "",
|
|
285
|
-
"before-close":
|
|
282
|
+
"before-close": le,
|
|
286
283
|
"append-to-body": ""
|
|
287
284
|
}, {
|
|
288
|
-
footer:
|
|
289
|
-
d(n(
|
|
290
|
-
default:
|
|
291
|
-
|
|
285
|
+
footer: r(() => [
|
|
286
|
+
d(n(F), { onClick: le }, {
|
|
287
|
+
default: r(() => [
|
|
288
|
+
S(k(n(u)("d.upload.close")), 1)
|
|
292
289
|
]),
|
|
293
290
|
_: 1
|
|
294
291
|
})
|
|
295
292
|
]),
|
|
296
|
-
default:
|
|
297
|
-
|
|
293
|
+
default: r(() => [
|
|
294
|
+
C("div", ot, [
|
|
298
295
|
L.value ? (o(), f("video", {
|
|
299
296
|
key: 0,
|
|
300
297
|
ref_key: "videoRef",
|
|
301
|
-
ref:
|
|
298
|
+
ref: J,
|
|
302
299
|
src: L.value,
|
|
303
300
|
controls: "",
|
|
304
301
|
class: "preview-video"
|
|
@@ -307,90 +304,90 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
307
304
|
]),
|
|
308
305
|
_: 1
|
|
309
306
|
}, 8, ["modelValue", "title"])) : p("", !0),
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
b.value ? (o(), f("div", st, [
|
|
308
|
+
N.value ? (o(), c(n(F), {
|
|
312
309
|
key: 0,
|
|
313
|
-
onClick:
|
|
310
|
+
onClick: te
|
|
314
311
|
}, {
|
|
315
|
-
default:
|
|
316
|
-
|
|
312
|
+
default: r(() => [
|
|
313
|
+
S(k(n(u)("d.upload.upload")), 1)
|
|
317
314
|
]),
|
|
318
315
|
_: 1
|
|
319
316
|
})) : p("", !0),
|
|
320
|
-
g.showDownloadAll &&
|
|
317
|
+
g.showDownloadAll && I.value ? (o(), c(n(F), {
|
|
321
318
|
key: 1,
|
|
322
319
|
type: "primary",
|
|
323
320
|
link: "",
|
|
324
|
-
onClick:
|
|
321
|
+
onClick: ue
|
|
325
322
|
}, {
|
|
326
|
-
default:
|
|
327
|
-
|
|
323
|
+
default: r(() => [
|
|
324
|
+
S(k(n(u)("d.upload.downloadAll")), 1)
|
|
328
325
|
]),
|
|
329
326
|
_: 1
|
|
330
327
|
})) : p("", !0)
|
|
331
328
|
])) : p("", !0),
|
|
332
|
-
|
|
329
|
+
b.value ? p("", !0) : (o(), f("div", {
|
|
333
330
|
key: 3,
|
|
334
331
|
class: "card",
|
|
335
|
-
style:
|
|
332
|
+
style: M(Z.value)
|
|
336
333
|
}, [
|
|
337
|
-
g.showDownloadAll &&
|
|
338
|
-
d(n(
|
|
334
|
+
g.showDownloadAll && I.value ? (o(), f("div", it, [
|
|
335
|
+
d(n(F), {
|
|
339
336
|
type: "primary",
|
|
340
337
|
link: "",
|
|
341
|
-
onClick:
|
|
338
|
+
onClick: ue
|
|
342
339
|
}, {
|
|
343
|
-
default:
|
|
344
|
-
|
|
340
|
+
default: r(() => [
|
|
341
|
+
S(k(n(u)("d.upload.downloadAll")), 1)
|
|
345
342
|
]),
|
|
346
343
|
_: 1
|
|
347
344
|
})
|
|
348
345
|
])) : p("", !0),
|
|
349
|
-
(o(!0), f(
|
|
350
|
-
key: e.id || `${e.name}-${
|
|
346
|
+
(o(!0), f(R, null, me(E.value, (e, i) => (o(), f("div", {
|
|
347
|
+
key: e.id || `${e.name}-${i}`,
|
|
351
348
|
class: "card-item",
|
|
352
|
-
style:
|
|
353
|
-
onClick: (
|
|
349
|
+
style: M(Y.value),
|
|
350
|
+
onClick: (v) => re(e)
|
|
354
351
|
}, [
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
U(e) ? (o(), f(R, { key: 0 }, [
|
|
353
|
+
_(e) ? (o(), c(n(He), {
|
|
357
354
|
key: 0,
|
|
358
355
|
src: e.url,
|
|
359
356
|
fit: "cover"
|
|
360
|
-
}, null, 8, ["src"])) :
|
|
361
|
-
default:
|
|
357
|
+
}, null, 8, ["src"])) : T(e) ? (o(), c(n(h), { key: 1 }, {
|
|
358
|
+
default: r(() => [
|
|
362
359
|
d(Ge)
|
|
363
360
|
]),
|
|
364
361
|
_: 1
|
|
365
362
|
})) : (o(), c(n(h), { key: 2 }, {
|
|
366
|
-
default:
|
|
363
|
+
default: r(() => [
|
|
367
364
|
d(Ye)
|
|
368
365
|
]),
|
|
369
366
|
_: 1
|
|
370
367
|
})),
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
default:
|
|
368
|
+
C("div", ut, [
|
|
369
|
+
_(e) || T(e) ? (o(), c(n(h), { key: 0 }, {
|
|
370
|
+
default: r(() => [
|
|
374
371
|
d(We)
|
|
375
372
|
]),
|
|
376
373
|
_: 1
|
|
377
374
|
})) : (o(), c(n(h), { key: 1 }, {
|
|
378
|
-
default:
|
|
375
|
+
default: r(() => [
|
|
379
376
|
d(Qe)
|
|
380
377
|
]),
|
|
381
378
|
_: 1
|
|
382
379
|
})),
|
|
383
|
-
|
|
380
|
+
ee(e) ? (o(), c(n(h), {
|
|
384
381
|
key: 2,
|
|
385
|
-
onClick:
|
|
382
|
+
onClick: ve((v) => ae(e), ["stop"])
|
|
386
383
|
}, {
|
|
387
|
-
default:
|
|
384
|
+
default: r(() => [
|
|
388
385
|
d(et)
|
|
389
386
|
]),
|
|
390
387
|
_: 1
|
|
391
388
|
}, 8, ["onClick"])) : p("", !0)
|
|
392
389
|
])
|
|
393
|
-
], 64)) : (o(), c(n(
|
|
390
|
+
], 64)) : (o(), c(n(he), {
|
|
394
391
|
key: 1,
|
|
395
392
|
style: { width: "80%" },
|
|
396
393
|
percentage: e.percentage,
|
|
@@ -398,57 +395,57 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
398
395
|
"show-text": !1
|
|
399
396
|
}, null, 8, ["percentage"]))
|
|
400
397
|
], 12, rt))), 128)),
|
|
401
|
-
|
|
398
|
+
N.value ? (o(), f("div", {
|
|
402
399
|
key: 1,
|
|
403
400
|
class: "card-item",
|
|
404
|
-
style:
|
|
405
|
-
onClick:
|
|
401
|
+
style: M(Y.value),
|
|
402
|
+
onClick: te
|
|
406
403
|
}, [
|
|
407
404
|
d(n(h), null, {
|
|
408
|
-
default:
|
|
405
|
+
default: r(() => [
|
|
409
406
|
d(Ze)
|
|
410
407
|
]),
|
|
411
408
|
_: 1
|
|
412
409
|
})
|
|
413
410
|
], 4)) : p("", !0)
|
|
414
411
|
], 4)),
|
|
415
|
-
|
|
412
|
+
N.value && g.showTip ? (o(), f("p", {
|
|
416
413
|
key: 4,
|
|
417
414
|
class: "tip",
|
|
418
415
|
innerHTML: Le.value
|
|
419
416
|
}, null, 8, dt)) : p("", !0),
|
|
420
|
-
|
|
417
|
+
b.value && E.value.length ? (o(), f("div", {
|
|
421
418
|
key: 5,
|
|
422
|
-
style:
|
|
419
|
+
style: M(Z.value),
|
|
423
420
|
class: "list"
|
|
424
421
|
}, [
|
|
425
|
-
(o(!0), f(
|
|
426
|
-
key: e.id || `${e.name}-${
|
|
422
|
+
(o(!0), f(R, null, me(E.value, (e, i) => (o(), f("div", {
|
|
423
|
+
key: e.id || `${e.name}-${i}`,
|
|
427
424
|
class: "list-item"
|
|
428
425
|
}, [
|
|
429
|
-
|
|
430
|
-
d(n(
|
|
426
|
+
C("div", ct, [
|
|
427
|
+
d(n(q), {
|
|
431
428
|
type: "primary",
|
|
432
429
|
underline: "never",
|
|
433
|
-
onClick: (
|
|
430
|
+
onClick: (v) => re(e)
|
|
434
431
|
}, {
|
|
435
|
-
default:
|
|
436
|
-
|
|
432
|
+
default: r(() => [
|
|
433
|
+
S(k(e.name), 1)
|
|
437
434
|
]),
|
|
438
435
|
_: 2
|
|
439
436
|
}, 1032, ["onClick"]),
|
|
440
|
-
|
|
437
|
+
ee(e) ? (o(), c(n(h), {
|
|
441
438
|
key: 0,
|
|
442
439
|
class: "remove-icon",
|
|
443
|
-
onClick:
|
|
440
|
+
onClick: ve((v) => ae(e), ["stop"])
|
|
444
441
|
}, {
|
|
445
|
-
default:
|
|
442
|
+
default: r(() => [
|
|
446
443
|
d(Je)
|
|
447
444
|
]),
|
|
448
445
|
_: 1
|
|
449
446
|
}, 8, ["onClick"])) : p("", !0)
|
|
450
447
|
]),
|
|
451
|
-
|
|
448
|
+
U(e) ? p("", !0) : (o(), c(n(he), {
|
|
452
449
|
key: 0,
|
|
453
450
|
percentage: e.percentage,
|
|
454
451
|
"stroke-width": 8
|
|
@@ -456,32 +453,32 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
456
453
|
]))), 128))
|
|
457
454
|
], 4)) : p("", !0),
|
|
458
455
|
s.value.length > g.maxShow ? (o(), f("div", pt, [
|
|
459
|
-
x.value ? (o(), c(n(
|
|
456
|
+
x.value ? (o(), c(n(q), {
|
|
460
457
|
key: 0,
|
|
461
458
|
type: "primary",
|
|
462
459
|
underline: "never",
|
|
463
|
-
onClick:
|
|
460
|
+
onClick: $
|
|
464
461
|
}, {
|
|
465
|
-
default:
|
|
466
|
-
|
|
462
|
+
default: r(() => [
|
|
463
|
+
C("span", null, k(n(u)("d.upload.collapse")), 1),
|
|
467
464
|
d(n(h), null, {
|
|
468
|
-
default:
|
|
465
|
+
default: r(() => [
|
|
469
466
|
d(Xe)
|
|
470
467
|
]),
|
|
471
468
|
_: 1
|
|
472
469
|
})
|
|
473
470
|
]),
|
|
474
471
|
_: 1
|
|
475
|
-
})) : (o(), c(n(
|
|
472
|
+
})) : (o(), c(n(q), {
|
|
476
473
|
key: 1,
|
|
477
474
|
type: "primary",
|
|
478
475
|
underline: "never",
|
|
479
|
-
onClick:
|
|
476
|
+
onClick: $
|
|
480
477
|
}, {
|
|
481
|
-
default:
|
|
482
|
-
|
|
478
|
+
default: r(() => [
|
|
479
|
+
C("span", null, k(n(u)("d.upload.expand")), 1),
|
|
483
480
|
d(n(h), null, {
|
|
484
|
-
default:
|
|
481
|
+
default: r(() => [
|
|
485
482
|
d(Ke)
|
|
486
483
|
]),
|
|
487
484
|
_: 1
|
|
@@ -492,7 +489,7 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
|
|
|
492
489
|
])) : p("", !0)
|
|
493
490
|
], 2));
|
|
494
491
|
}
|
|
495
|
-
}),
|
|
492
|
+
}), Et = /* @__PURE__ */ tt(ft, [["__scopeId", "data-v-10f8e9fe"]]);
|
|
496
493
|
export {
|
|
497
|
-
|
|
494
|
+
Et as default
|
|
498
495
|
};
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "geekplus-digital-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"module": "index.js",
|
|
7
|
-
"types": "index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./index.d.ts",
|
|
11
|
-
"import": "./index.js"
|
|
12
|
-
},
|
|
13
|
-
"./*": {
|
|
14
|
-
"types": "./*.d.ts",
|
|
15
|
-
"import": "./*.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": [
|
|
19
|
-
"**/*.css"
|
|
20
|
-
],
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@vueuse/core": "^14.2.1",
|
|
23
|
-
"file-saver": "^2.0.5",
|
|
24
|
-
"lodash-es": "^4.17.23",
|
|
25
|
-
"vue-i18n": "^11.2.8"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"element-plus": "^2.13.2",
|
|
29
|
-
"vue": "^3.5.27"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "geekplus-digital-ui",
|
|
3
|
+
"version": "0.1.20",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"import": "./index.js"
|
|
12
|
+
},
|
|
13
|
+
"./*": {
|
|
14
|
+
"types": "./*.d.ts",
|
|
15
|
+
"import": "./*.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"**/*.css"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@vueuse/core": "^14.2.1",
|
|
23
|
+
"file-saver": "^2.0.5",
|
|
24
|
+
"lodash-es": "^4.17.23",
|
|
25
|
+
"vue-i18n": "^11.2.8"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"element-plus": "^2.13.2",
|
|
29
|
+
"vue": "^3.5.27"
|
|
30
|
+
}
|
|
31
|
+
}
|