bm-admin-ui 1.0.82-alpha → 1.0.84-alpha
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/es/components/attachment/index.js +273 -0
- package/es/components/breadcrumb/index.js +158 -0
- package/es/components/button/index.js +49 -0
- package/es/components/edit-form/index.js +1186 -0
- package/es/components/editor/index.js +12554 -0
- package/es/components/feedback/index.js +295 -0
- package/es/components/float-table/index.js +3511 -0
- package/es/components/flow-designer/index.js +1317 -0
- package/es/components/form-create/index.js +20978 -0
- package/es/components/form-designer/index.js +4514 -0
- package/es/components/index.js +19 -0
- package/es/components/input-tags-display/index.js +226 -0
- package/es/components/over-tooltips/index.js +133 -0
- package/es/components/search-filter/index.js +449 -0
- package/es/components/select-all/index.js +172 -0
- package/es/components/shops-filter/index.js +453 -0
- package/es/components/staffs-selector/index.js +728 -0
- package/es/components/timeline/index.js +168 -0
- package/es/components/upload/index.js +909 -0
- package/es/components/videoView/index.js +100 -0
- package/lib/components/attachment/index.js +278 -0
- package/lib/components/breadcrumb/index.js +168 -0
- package/lib/components/button/index.js +58 -0
- package/lib/components/edit-form/index.js +1195 -0
- package/lib/components/editor/index.js +12559 -0
- package/lib/components/feedback/index.js +309 -0
- package/lib/components/float-table/index.js +3516 -0
- package/lib/components/flow-designer/index.js +1329 -0
- package/lib/components/form-create/index.js +20990 -0
- package/lib/components/form-designer/index.js +4525 -0
- package/lib/components/index.js +140 -0
- package/lib/components/input-tags-display/index.js +237 -0
- package/lib/components/over-tooltips/index.js +138 -0
- package/lib/components/search-filter/index.js +459 -0
- package/lib/components/select-all/index.js +181 -0
- package/lib/components/shops-filter/index.js +465 -0
- package/lib/components/staffs-selector/index.js +733 -0
- package/lib/components/timeline/index.js +174 -0
- package/lib/components/upload/index.js +914 -0
- package/lib/components/videoView/index.js +105 -0
- package/package.json +1 -1
|
@@ -0,0 +1,909 @@
|
|
|
1
|
+
import { withInstall } from 'bm-admin-ui/es/utils/with-install';
|
|
2
|
+
import { reactive, onBeforeUnmount, ref, watch, nextTick, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createElementVNode, normalizeStyle, normalizeClass, createTextVNode, toDisplayString, computed, createElementBlock, Fragment, createCommentVNode, renderList, createVNode, resolveDynamicComponent, mergeProps } from 'vue';
|
|
3
|
+
import { PlusOutlined, UploadOutlined, LoadingOutlined, InboxOutlined } from '@ant-design/icons-vue';
|
|
4
|
+
|
|
5
|
+
var _export_sfc = (sfc, props) => {
|
|
6
|
+
const target = sfc.__vccOpts || sfc;
|
|
7
|
+
for (const [key, val] of props) {
|
|
8
|
+
target[key] = val;
|
|
9
|
+
}
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const _sfc_main$1 = {
|
|
14
|
+
name: "BmOverTooltips",
|
|
15
|
+
props: {
|
|
16
|
+
title: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
labelTitle: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
line: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 1
|
|
27
|
+
},
|
|
28
|
+
width: {
|
|
29
|
+
type: [Number, String],
|
|
30
|
+
default: 0
|
|
31
|
+
},
|
|
32
|
+
showAlways: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
setup(props, context) {
|
|
38
|
+
const state = reactive({
|
|
39
|
+
mSlots: {},
|
|
40
|
+
isShow: false,
|
|
41
|
+
openShow: false
|
|
42
|
+
});
|
|
43
|
+
const observer = new IntersectionObserver(
|
|
44
|
+
(entries) => {
|
|
45
|
+
entries.forEach((item) => {
|
|
46
|
+
if (item.intersectionRatio > 0.3) {
|
|
47
|
+
observerDom();
|
|
48
|
+
observer.disconnect();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
threshold: 0.3
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
function observerDom() {
|
|
57
|
+
if (props.line === 1) {
|
|
58
|
+
if (mySelf.value.scrollWidth > mySelf.value.clientWidth) {
|
|
59
|
+
state.openShow = true;
|
|
60
|
+
}
|
|
61
|
+
} else if (props.line > 1) {
|
|
62
|
+
if (mySelf.value.scrollHeight > mySelf.value.clientHeight) {
|
|
63
|
+
state.openShow = true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
onBeforeUnmount(function() {
|
|
68
|
+
observer.disconnect();
|
|
69
|
+
});
|
|
70
|
+
let mySelf = ref();
|
|
71
|
+
watch(
|
|
72
|
+
() => props.showAlways,
|
|
73
|
+
function(showAlways) {
|
|
74
|
+
if (showAlways)
|
|
75
|
+
state.openShow = showAlways;
|
|
76
|
+
mySelf.value && observer.unobserve(mySelf.value);
|
|
77
|
+
nextTick(function() {
|
|
78
|
+
mySelf.value && observer.observe(mySelf.value);
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
immediate: true
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
const handleVisibleChange = (val) => {
|
|
86
|
+
state.isShow = !state.openShow ? false : val;
|
|
87
|
+
};
|
|
88
|
+
const getPopupContainer = () => {
|
|
89
|
+
return document.body;
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
...toRefs(state),
|
|
93
|
+
mySelf,
|
|
94
|
+
handleVisibleChange,
|
|
95
|
+
getPopupContainer
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
100
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
101
|
+
return openBlock(), createBlock(_component_a_tooltip, {
|
|
102
|
+
visible: _ctx.isShow,
|
|
103
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => _ctx.isShow = $event),
|
|
104
|
+
title: $props.labelTitle || $props.title,
|
|
105
|
+
"get-popup-container": $setup.getPopupContainer,
|
|
106
|
+
onVisibleChange: $setup.handleVisibleChange
|
|
107
|
+
}, {
|
|
108
|
+
title: withCtx(() => [
|
|
109
|
+
renderSlot(_ctx.$slots, "title")
|
|
110
|
+
]),
|
|
111
|
+
default: withCtx(() => [
|
|
112
|
+
createElementVNode("div", {
|
|
113
|
+
ref: "mySelf",
|
|
114
|
+
style: normalizeStyle({
|
|
115
|
+
width: $props.width ? $props.width + "px" : "100%",
|
|
116
|
+
WebkitLineClamp: $props.line
|
|
117
|
+
}),
|
|
118
|
+
class: normalizeClass($props.line === 1 ? `bm-over-tooltip` : `bm-over-tooltip-multi`)
|
|
119
|
+
}, [
|
|
120
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
121
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
122
|
+
createTextVNode(toDisplayString($props.title), 1)
|
|
123
|
+
])
|
|
124
|
+
])
|
|
125
|
+
], 6)
|
|
126
|
+
]),
|
|
127
|
+
_: 3
|
|
128
|
+
}, 8, ["visible", "title", "get-popup-container", "onVisibleChange"]);
|
|
129
|
+
}
|
|
130
|
+
var OverTooltips$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "over-tooltips.vue"]]);
|
|
131
|
+
|
|
132
|
+
const BmOverTooltips = withInstall(OverTooltips$1);
|
|
133
|
+
var OverTooltips = BmOverTooltips;
|
|
134
|
+
|
|
135
|
+
function getuid() {
|
|
136
|
+
const s = [];
|
|
137
|
+
const hexDigits = '0123456789abcdef';
|
|
138
|
+
for (let i = 0; i < 36; i++) {
|
|
139
|
+
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
|
140
|
+
}
|
|
141
|
+
s[14] = '4';
|
|
142
|
+
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
|
|
143
|
+
s[8] = s[13] = s[18] = s[23] = '-';
|
|
144
|
+
const uuid = s.join('');
|
|
145
|
+
return uuid;
|
|
146
|
+
}
|
|
147
|
+
function wait(ms) {
|
|
148
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
149
|
+
}
|
|
150
|
+
var utils = {
|
|
151
|
+
getuid,
|
|
152
|
+
wait,
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const pdf = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAABmdJREFUeAHtWgtsU1UY/u6j62vdGxA35CEo8cE0qCOIMiIYBREBMU6CIKBRkZcYojwCQQRfU8FgAiohERxGMBE1kWjMEgWBgIiAIs8NBmOwdWNrt7b33l7POWWXlQ3Xdt1pO3aS23ve//995/zn8d8KIKFqXF6OV214V4CQr+t6d5qXKME+/rmi1Clzn4lUX5GBVxoOQEdBooGnoOVuOQWXNnz4ZcQE0JEnjTMi7SAe2rWFBJFO+3gA0VYdIiVBTMRpfy2yIiFBvFZniZofLgkdjgA6cOGQ0CEJCIeEDktAqCR0aAJCIaHDE9AaCdcFAf9HQsIT4K93UXwhhZZ2h4QnQD1bEhL4xkpXk5DwBHh2/gzd62nEF9K7KQnCudED9JBaxXElwe6AZfBwyNm9INqSQ9ZUrSgr4k6AmJKO1LnLkXTLndD9GhqKf4Br4xoyig0hKx7NinI0Owulr7R5K2C+e7BRNXnMJEhpWagpfN3I4xnhugZI3bIN8HWb18J35ADDaup3G0/MQbK4EiD3vtUQ7v72C2jOCyyte2Iz/alwrgQI8hWL0911ZMFyMAL89W72jsUPVwKuBij37MuytHOlVxdxS3MlQFd8BjCp642Q0rNYWik9ZuTzjnAlQD111MBnHTrSiKulx4047whXArQL56BdcjKMlvxRBla15DqZARSxcuwwA27q0Ye9ldMn4K+tZvFY/HCdARSg7689QTh9+38PSvNOcCfAs+OnIIze/TuD0rwT3AnQLpZDubwY6poG76G9vDEHyeNOgGC2Quqew5QQJAmWgQ8EKcQ7wZ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sxmry5HzLy/Ai7U+I4IQBuMWRrAOHVklgagDcYsDWCcOjJLA9AGY5YGME4dmaUBaIMxSwMYp47M0gC0wZilAYxTR2ZpANpgzNIAxqkjszQAbTBmaQDj1JFZGoA2GLM0gHHqyCwNQBuMWRrAOHVklgagDcYsDWCcOjJLA9AGY9YNiBaM4HvmaGGuwJRXgJrGSdLJtYAVoYSVYY+L4uEjSbo3+iqUHNfBXPmoNMyG/RuvFms2+co7XAAAAABJRU5ErkJggg==`;
|
|
160
|
+
var icons = {
|
|
161
|
+
pdf,
|
|
162
|
+
ppt,
|
|
163
|
+
excel,
|
|
164
|
+
doc,
|
|
165
|
+
others,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const CLOUND_PRE = "/cloudStorage/read";
|
|
169
|
+
const _sfc_main = {
|
|
170
|
+
name: "BmUpload",
|
|
171
|
+
components: {
|
|
172
|
+
PlusOutlined,
|
|
173
|
+
OverTooltips,
|
|
174
|
+
UploadOutlined,
|
|
175
|
+
LoadingOutlined,
|
|
176
|
+
InboxOutlined
|
|
177
|
+
},
|
|
178
|
+
props: {
|
|
179
|
+
uploadProps: {
|
|
180
|
+
type: Object,
|
|
181
|
+
default: () => {
|
|
182
|
+
return {};
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
extraProps: {
|
|
186
|
+
type: Object,
|
|
187
|
+
default: () => {
|
|
188
|
+
return {};
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
defaultList: {
|
|
192
|
+
type: Array,
|
|
193
|
+
default: () => []
|
|
194
|
+
},
|
|
195
|
+
uploadRequest: {
|
|
196
|
+
type: Function,
|
|
197
|
+
default() {
|
|
198
|
+
return () => {
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
cloudReadUrl: {
|
|
203
|
+
type: String,
|
|
204
|
+
default: ""
|
|
205
|
+
},
|
|
206
|
+
holdProgress: {
|
|
207
|
+
type: Number,
|
|
208
|
+
default: 0
|
|
209
|
+
},
|
|
210
|
+
customErrors: {
|
|
211
|
+
type: Object,
|
|
212
|
+
default() {
|
|
213
|
+
return void 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
emits: [
|
|
218
|
+
"success",
|
|
219
|
+
"delete",
|
|
220
|
+
"update",
|
|
221
|
+
"previewFile",
|
|
222
|
+
"successFile",
|
|
223
|
+
"deleteFile",
|
|
224
|
+
"error",
|
|
225
|
+
"updateDisabledStatus",
|
|
226
|
+
"updateIsUploadingStatus"
|
|
227
|
+
],
|
|
228
|
+
setup(props, { emit, expose }) {
|
|
229
|
+
let acceptList = [
|
|
230
|
+
".xlsx",
|
|
231
|
+
".XLSX",
|
|
232
|
+
".pdf",
|
|
233
|
+
".PDF",
|
|
234
|
+
".doc",
|
|
235
|
+
".DOC",
|
|
236
|
+
".docx",
|
|
237
|
+
".DOCX",
|
|
238
|
+
".jpg",
|
|
239
|
+
".JPG",
|
|
240
|
+
".jpeg",
|
|
241
|
+
".JPEG",
|
|
242
|
+
".png",
|
|
243
|
+
".PNG",
|
|
244
|
+
".gif",
|
|
245
|
+
".GIF",
|
|
246
|
+
".rar",
|
|
247
|
+
".RAR",
|
|
248
|
+
".zip",
|
|
249
|
+
".ZIP",
|
|
250
|
+
".ppt",
|
|
251
|
+
".PPT",
|
|
252
|
+
".pptx",
|
|
253
|
+
".PPTX",
|
|
254
|
+
".mp4",
|
|
255
|
+
".MP4"
|
|
256
|
+
];
|
|
257
|
+
const state = reactive({
|
|
258
|
+
uploadBarColor: "#4DA0FF",
|
|
259
|
+
uploadedList: [],
|
|
260
|
+
fileList: {},
|
|
261
|
+
onepViewImageHover: {},
|
|
262
|
+
previewVisible: false,
|
|
263
|
+
onepViewImage: {},
|
|
264
|
+
extraConfigs: {
|
|
265
|
+
maxSize: 5,
|
|
266
|
+
maxCount: 5,
|
|
267
|
+
isAllowDownloadFieldProps: false,
|
|
268
|
+
hideDisabledBtn: true,
|
|
269
|
+
tips: "",
|
|
270
|
+
showTips: true,
|
|
271
|
+
btnClass: "",
|
|
272
|
+
picClass: "",
|
|
273
|
+
alignCenter: false,
|
|
274
|
+
canNotViewAccept: ".rar,.zip",
|
|
275
|
+
myBtn: false,
|
|
276
|
+
showFileName: false,
|
|
277
|
+
drag: false
|
|
278
|
+
},
|
|
279
|
+
uploadConfigs: {
|
|
280
|
+
multiple: false,
|
|
281
|
+
showUploadList: false,
|
|
282
|
+
showSlotList: false,
|
|
283
|
+
listType: "text",
|
|
284
|
+
text: "",
|
|
285
|
+
accept: acceptList.join(","),
|
|
286
|
+
data: {},
|
|
287
|
+
name: "file",
|
|
288
|
+
disabled: false,
|
|
289
|
+
async customRequest({ file, fileField, data }) {
|
|
290
|
+
if (file.size > state.extraConfigs.maxSize * 1024 * 1024) {
|
|
291
|
+
return methods.uploadError(
|
|
292
|
+
new Error(
|
|
293
|
+
props.customErrors?.maxSize || `\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`
|
|
294
|
+
)
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
if (Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
|
|
298
|
+
return methods.uploadError(
|
|
299
|
+
new Error(
|
|
300
|
+
props.customErrors?.maxCount || `\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`
|
|
301
|
+
)
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
let name = file.name;
|
|
305
|
+
let fileFormat = name.split(".").pop();
|
|
306
|
+
if (!state.uploadConfigs.accept.includes(`.${fileFormat}`)) {
|
|
307
|
+
return methods.uploadError(
|
|
308
|
+
new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`)
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
state.fileList[file.uid] = {
|
|
312
|
+
uid: file.uid,
|
|
313
|
+
name: file.name,
|
|
314
|
+
type: fileFormat,
|
|
315
|
+
progress: 0,
|
|
316
|
+
file,
|
|
317
|
+
isDoneDeloy: false,
|
|
318
|
+
status: ""
|
|
319
|
+
};
|
|
320
|
+
setTimeout(function() {
|
|
321
|
+
if (methods.fileIsDelete(file)) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
state.fileList[file.uid].isDoneDeloy = true;
|
|
325
|
+
}, 1e3);
|
|
326
|
+
methods.customUploadRequest(file);
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
pictureFileTypes: [
|
|
330
|
+
"img",
|
|
331
|
+
"image",
|
|
332
|
+
"png",
|
|
333
|
+
"PNG",
|
|
334
|
+
"image/png",
|
|
335
|
+
"jpg",
|
|
336
|
+
"JPG",
|
|
337
|
+
"jpeg",
|
|
338
|
+
"JPEG",
|
|
339
|
+
"image/jpeg",
|
|
340
|
+
"gif",
|
|
341
|
+
"GIF",
|
|
342
|
+
"image/gif"
|
|
343
|
+
]
|
|
344
|
+
});
|
|
345
|
+
const methods = {
|
|
346
|
+
updateUploadProgress(file, progress) {
|
|
347
|
+
if (methods.fileIsDelete(file)) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
state.fileList[file.uid] = {
|
|
351
|
+
...state.fileList[file.uid],
|
|
352
|
+
progress
|
|
353
|
+
};
|
|
354
|
+
},
|
|
355
|
+
customUploadRequest(file) {
|
|
356
|
+
props.uploadRequest?.(file, {
|
|
357
|
+
onUploadProgress: (e) => {
|
|
358
|
+
let progress = Math.round(e.loaded / e.total * 100);
|
|
359
|
+
if (props.holdProgress) {
|
|
360
|
+
progress = progress > props.holdProgress ? props.holdProgress : progress;
|
|
361
|
+
}
|
|
362
|
+
methods.updateUploadProgress(file, progress);
|
|
363
|
+
}
|
|
364
|
+
}).then(function(data) {
|
|
365
|
+
methods.updateUploadProgress(file, 100);
|
|
366
|
+
methods.uploadSuccess(data, file);
|
|
367
|
+
}).catch(function(error) {
|
|
368
|
+
console.error(error);
|
|
369
|
+
if (state.uploadConfigs.listType === "text") {
|
|
370
|
+
state.fileList[file.uid].progress = 100;
|
|
371
|
+
}
|
|
372
|
+
methods.uploadError(error, file);
|
|
373
|
+
});
|
|
374
|
+
},
|
|
375
|
+
fileIsDelete(file) {
|
|
376
|
+
return !state.fileList[file.uid];
|
|
377
|
+
},
|
|
378
|
+
uploadSuccess(data, file) {
|
|
379
|
+
if (methods.fileIsDelete(file)) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
state.fileList[file.uid].status = "success";
|
|
383
|
+
let uri = data?.url;
|
|
384
|
+
let item = {
|
|
385
|
+
name: file.name,
|
|
386
|
+
size: file.size,
|
|
387
|
+
type: file.type,
|
|
388
|
+
uid: file.uid,
|
|
389
|
+
url: uri
|
|
390
|
+
};
|
|
391
|
+
state.uploadedList.push(item);
|
|
392
|
+
state.fileList[file.uid].url = uri;
|
|
393
|
+
emit("successFile", data);
|
|
394
|
+
emit("success", state.uploadedList);
|
|
395
|
+
emit("update", state.uploadedList);
|
|
396
|
+
},
|
|
397
|
+
uploadError(error, file) {
|
|
398
|
+
if (file) {
|
|
399
|
+
if (methods.fileIsDelete(file)) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
state.fileList[file.uid].status = "error";
|
|
403
|
+
}
|
|
404
|
+
emit("error", error);
|
|
405
|
+
},
|
|
406
|
+
async deleteFile(uid) {
|
|
407
|
+
let targetFile = state.fileList[uid];
|
|
408
|
+
delete state.fileList[uid];
|
|
409
|
+
const index = state.uploadedList.findIndex(
|
|
410
|
+
(ele) => ele.url === targetFile.url
|
|
411
|
+
);
|
|
412
|
+
if (index !== -1) {
|
|
413
|
+
state.uploadedList.splice(index, 1);
|
|
414
|
+
}
|
|
415
|
+
emit("deleteFile", targetFile);
|
|
416
|
+
emit("delete", state.uploadedList);
|
|
417
|
+
emit("update", state.uploadedList);
|
|
418
|
+
},
|
|
419
|
+
pictureHoverEnter(uid) {
|
|
420
|
+
state.onepViewImageHover[uid] = true;
|
|
421
|
+
},
|
|
422
|
+
pictureHoverLeave(uid) {
|
|
423
|
+
state.onepViewImageHover[uid] = false;
|
|
424
|
+
},
|
|
425
|
+
viewOnePicture(item) {
|
|
426
|
+
if (state.pictureFileTypes.includes(item.type.toLowerCase())) {
|
|
427
|
+
state.previewVisible = true;
|
|
428
|
+
state.onepViewImage = item;
|
|
429
|
+
}
|
|
430
|
+
emit("previewFile", item);
|
|
431
|
+
},
|
|
432
|
+
handleClosePictureView() {
|
|
433
|
+
state.previewVisible = false;
|
|
434
|
+
},
|
|
435
|
+
reUpload(e, uid) {
|
|
436
|
+
e.stopPropagation();
|
|
437
|
+
let file = state.fileList[uid].file;
|
|
438
|
+
state.onepViewImageHover[uid] = false;
|
|
439
|
+
delete state.fileList[uid];
|
|
440
|
+
state.uploadConfigs.customRequest({
|
|
441
|
+
file,
|
|
442
|
+
fileField: state.uploadConfigs.name,
|
|
443
|
+
data: state.uploadConfigs.data
|
|
444
|
+
});
|
|
445
|
+
},
|
|
446
|
+
paste(event) {
|
|
447
|
+
if (uploadDisabled.value) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
const items = event?.clipboardData?.items;
|
|
451
|
+
let file = null;
|
|
452
|
+
if (items && items.length) {
|
|
453
|
+
for (var i = 0; i < items.length; i++) {
|
|
454
|
+
if (items[i].type.match("^image/")) {
|
|
455
|
+
file = items[i].getAsFile();
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
if (file) {
|
|
461
|
+
let uid = utils.getuid();
|
|
462
|
+
let filename = file.name;
|
|
463
|
+
let fileInfo = filename?.split(".");
|
|
464
|
+
if (fileInfo && fileInfo.length > 1) {
|
|
465
|
+
fileInfo[fileInfo.length - 2] = uid;
|
|
466
|
+
filename = fileInfo.join(".");
|
|
467
|
+
} else {
|
|
468
|
+
filename = uid + ".png";
|
|
469
|
+
}
|
|
470
|
+
file = new File([file], filename, { type: file.type });
|
|
471
|
+
file["uid"] = uid;
|
|
472
|
+
state.uploadConfigs.customRequest({
|
|
473
|
+
file,
|
|
474
|
+
fileField: state.uploadConfigs.name,
|
|
475
|
+
data: state.uploadConfigs.data
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
handleReject(e) {
|
|
480
|
+
return methods.uploadError(
|
|
481
|
+
new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`)
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
watch(
|
|
486
|
+
() => props.defaultList,
|
|
487
|
+
function(list) {
|
|
488
|
+
if (list?.length) {
|
|
489
|
+
list.forEach((item) => {
|
|
490
|
+
if (!item.uid) {
|
|
491
|
+
item.uid = utils.getuid();
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
list.forEach(function(item) {
|
|
495
|
+
let uid = item.uid || utils.getuid();
|
|
496
|
+
if (!item.url.includes("http") && !item.url.includes(CLOUND_PRE))
|
|
497
|
+
item.url = props.cloudReadUrl + item.url;
|
|
498
|
+
state.fileList[uid] = {
|
|
499
|
+
uid,
|
|
500
|
+
name: item.name,
|
|
501
|
+
url: item.url,
|
|
502
|
+
type: item.type || "png",
|
|
503
|
+
progress: 100,
|
|
504
|
+
isDoneDeloy: true
|
|
505
|
+
};
|
|
506
|
+
if (!state.uploadedList.find((item2) => item2.uid === uid)) {
|
|
507
|
+
state.uploadedList.push(item);
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
} else {
|
|
511
|
+
state.fileList = {};
|
|
512
|
+
state.uploadedList = [];
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
immediate: true
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
watch(
|
|
520
|
+
[() => props.uploadProps, () => props.extraProps],
|
|
521
|
+
function([config, extra]) {
|
|
522
|
+
state.uploadConfigs = {
|
|
523
|
+
...state.uploadConfigs,
|
|
524
|
+
...config,
|
|
525
|
+
showUploadList: false
|
|
526
|
+
};
|
|
527
|
+
state.extraConfigs = {
|
|
528
|
+
...state.extraConfigs,
|
|
529
|
+
...extra
|
|
530
|
+
};
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
immediate: true,
|
|
534
|
+
deep: true
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
const uploadDisabled = computed(() => {
|
|
538
|
+
if (props.uploadProps.disabled || Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
|
|
539
|
+
return true;
|
|
540
|
+
}
|
|
541
|
+
return false;
|
|
542
|
+
});
|
|
543
|
+
watch(
|
|
544
|
+
() => uploadDisabled.value,
|
|
545
|
+
(value) => {
|
|
546
|
+
emit("updateDisabledStatus", value);
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
immediate: true
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
const isUploading = computed(() => {
|
|
553
|
+
let ret = false;
|
|
554
|
+
let fileList = state.fileList || {};
|
|
555
|
+
Object.keys(fileList).forEach((uid) => {
|
|
556
|
+
if (fileList[uid]?.progress && fileList[uid].progress < 100) {
|
|
557
|
+
ret = true;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
return ret;
|
|
561
|
+
});
|
|
562
|
+
watch(
|
|
563
|
+
() => isUploading.value,
|
|
564
|
+
(value) => {
|
|
565
|
+
emit("updateIsUploadingStatus", value);
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
immediate: true
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
expose({ state, methods, paste: methods.paste });
|
|
572
|
+
return {
|
|
573
|
+
...toRefs(state),
|
|
574
|
+
icons,
|
|
575
|
+
...methods,
|
|
576
|
+
uploadDisabled
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
const _hoisted_1 = {
|
|
581
|
+
key: 0,
|
|
582
|
+
class: "bm-upload__picture-progress"
|
|
583
|
+
};
|
|
584
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("div", { class: "bm-upload__picture-progress__text" }, "\u56FE\u7247\u4E0A\u4F20\u4E2D", -1);
|
|
585
|
+
const _hoisted_3 = ["onMouseenter", "onMouseleave"];
|
|
586
|
+
const _hoisted_4 = ["src"];
|
|
587
|
+
const _hoisted_5 = ["src"];
|
|
588
|
+
const _hoisted_6 = ["src"];
|
|
589
|
+
const _hoisted_7 = ["src"];
|
|
590
|
+
const _hoisted_8 = ["src"];
|
|
591
|
+
const _hoisted_9 = ["onClick"];
|
|
592
|
+
const _hoisted_10 = ["onClick"];
|
|
593
|
+
const _hoisted_11 = ["onMouseenter", "onMouseleave"];
|
|
594
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "bm-upload__picture-error__image" }, null, -1);
|
|
595
|
+
const _hoisted_13 = /* @__PURE__ */ createElementVNode("div", null, "\u4E0A\u4F20\u9519\u8BEF", -1);
|
|
596
|
+
const _hoisted_14 = {
|
|
597
|
+
key: 0,
|
|
598
|
+
class: "bm-upload__picture-result__cover"
|
|
599
|
+
};
|
|
600
|
+
const _hoisted_15 = ["onClick"];
|
|
601
|
+
const _hoisted_16 = ["onClick"];
|
|
602
|
+
const _hoisted_17 = {
|
|
603
|
+
key: 0,
|
|
604
|
+
class: "bm-upload__picture__name"
|
|
605
|
+
};
|
|
606
|
+
const _hoisted_18 = {
|
|
607
|
+
key: 1,
|
|
608
|
+
class: "bm-upload__button__wrapper"
|
|
609
|
+
};
|
|
610
|
+
const _hoisted_19 = { key: 0 };
|
|
611
|
+
const _hoisted_20 = { class: "ant-upload-text bm-upload__text" };
|
|
612
|
+
const _hoisted_21 = {
|
|
613
|
+
key: 0,
|
|
614
|
+
class: "bm-upload__tips"
|
|
615
|
+
};
|
|
616
|
+
const _hoisted_22 = {
|
|
617
|
+
key: 1,
|
|
618
|
+
style: { "font-size": "24px", "color": "#9393a3" }
|
|
619
|
+
};
|
|
620
|
+
const _hoisted_23 = { class: "ant-upload-text bm-upload__text" };
|
|
621
|
+
const _hoisted_24 = {
|
|
622
|
+
key: 0,
|
|
623
|
+
class: "bm-upload__tips"
|
|
624
|
+
};
|
|
625
|
+
const _hoisted_25 = { key: 2 };
|
|
626
|
+
const _hoisted_26 = {
|
|
627
|
+
key: 0,
|
|
628
|
+
class: "bm-upload__tips"
|
|
629
|
+
};
|
|
630
|
+
const _hoisted_27 = {
|
|
631
|
+
key: 2,
|
|
632
|
+
class: "bm-upload__file-list"
|
|
633
|
+
};
|
|
634
|
+
const _hoisted_28 = { class: "bm-upload__file__detail" };
|
|
635
|
+
const _hoisted_29 = /* @__PURE__ */ createElementVNode("div", { class: "bm-upload__file__icon" }, [
|
|
636
|
+
/* @__PURE__ */ createElementVNode("div", { class: "bm-upload__attachment" })
|
|
637
|
+
], -1);
|
|
638
|
+
const _hoisted_30 = { class: "bm-upload__file__name" };
|
|
639
|
+
const _hoisted_31 = { class: "bm-upload__file__progress-tools" };
|
|
640
|
+
const _hoisted_32 = ["onClick"];
|
|
641
|
+
const _hoisted_33 = ["onClick"];
|
|
642
|
+
const _hoisted_34 = {
|
|
643
|
+
key: 0,
|
|
644
|
+
class: "bm-upload__progress"
|
|
645
|
+
};
|
|
646
|
+
const _hoisted_35 = { style: { "padding-top": "20px" } };
|
|
647
|
+
const _hoisted_36 = ["src"];
|
|
648
|
+
const _hoisted_37 = ["title", "src"];
|
|
649
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
650
|
+
const _component_a_progress = resolveComponent("a-progress");
|
|
651
|
+
const _component_a_image = resolveComponent("a-image");
|
|
652
|
+
const _component_LoadingOutlined = resolveComponent("LoadingOutlined");
|
|
653
|
+
const _component_OverTooltips = resolveComponent("OverTooltips");
|
|
654
|
+
const _component_InboxOutlined = resolveComponent("InboxOutlined");
|
|
655
|
+
const _component_PlusOutlined = resolveComponent("PlusOutlined");
|
|
656
|
+
const _component_UploadOutlined = resolveComponent("UploadOutlined");
|
|
657
|
+
const _component_a_button = resolveComponent("a-button");
|
|
658
|
+
const _component_a_modal = resolveComponent("a-modal");
|
|
659
|
+
return openBlock(), createElementBlock("div", {
|
|
660
|
+
class: normalizeClass(["bm-upload", {
|
|
661
|
+
"bm-upload--text": _ctx.uploadConfigs.listType === "text",
|
|
662
|
+
"bm-upload--drag": _ctx.extraConfigs.drag,
|
|
663
|
+
"bm-upload--picture-card": _ctx.uploadConfigs.listType === "picture-card",
|
|
664
|
+
"bm-upload--picture-card--has-tips": !($setup.uploadDisabled && _ctx.extraConfigs?.hideDisabledBtn) && !_ctx.extraConfigs.myBtn && _ctx.uploadConfigs.listType === "picture-card" && _ctx.extraConfigs.tips && _ctx.extraConfigs.showTips
|
|
665
|
+
}])
|
|
666
|
+
}, [
|
|
667
|
+
_ctx.uploadConfigs.listType === "picture-card" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
668
|
+
createCommentVNode(" \u4E0D\u8981\u4F7F\u7528 a-image-preview-group \u5305\u88F9\uFF0C\u4E0D\u7136\u4F1A\u51FA\u73B0\u91CD\u590D\u56FE\u7247\u548C\u7A7A\u767D\u56FE\u7247 "),
|
|
669
|
+
createCommentVNode(" <a-image-preview-group> "),
|
|
670
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fileList, (item) => {
|
|
671
|
+
return openBlock(), createElementBlock("div", {
|
|
672
|
+
key: item,
|
|
673
|
+
class: "bm-upload__picture_wrapper"
|
|
674
|
+
}, [
|
|
675
|
+
createElementVNode("div", {
|
|
676
|
+
class: normalizeClass(["bm-upload__picture", { "bm-upload__picture--error": item.status === "error" }])
|
|
677
|
+
}, [
|
|
678
|
+
createCommentVNode(" \u4E0A\u4F20\u4E2D "),
|
|
679
|
+
item.progress < 100 && item.status !== "error" ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
680
|
+
_hoisted_2,
|
|
681
|
+
createVNode(_component_a_progress, {
|
|
682
|
+
type: "line",
|
|
683
|
+
"stroke-width": 2,
|
|
684
|
+
"show-info": false,
|
|
685
|
+
"stroke-color": _ctx.uploadBarColor,
|
|
686
|
+
percent: item.uid?.progress
|
|
687
|
+
}, null, 8, ["stroke-color", "percent"])
|
|
688
|
+
])) : createCommentVNode("v-if", true),
|
|
689
|
+
createCommentVNode(" \u56FE\u7247\u5C55\u793A "),
|
|
690
|
+
item.progress >= 100 && item.status !== "error" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
691
|
+
!_ctx.uploadConfigs.showSlotList ? (openBlock(), createElementBlock("div", {
|
|
692
|
+
key: 0,
|
|
693
|
+
class: "bm-upload__picture-result",
|
|
694
|
+
onMouseenter: ($event) => _ctx.pictureHoverEnter(item.uid),
|
|
695
|
+
onMouseleave: ($event) => _ctx.pictureHoverLeave(item.uid),
|
|
696
|
+
onClick: _cache[0] || (_cache[0] = (e) => e.stopPropagation())
|
|
697
|
+
}, [
|
|
698
|
+
["pdf", "PDF", "application/pdf"].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
699
|
+
key: 0,
|
|
700
|
+
class: "bm-upload__picture-result__image",
|
|
701
|
+
src: $setup.icons.pdf,
|
|
702
|
+
alt: "\u56FE\u7247"
|
|
703
|
+
}, null, 8, _hoisted_4)) : [
|
|
704
|
+
"xlsx",
|
|
705
|
+
"XLSX",
|
|
706
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
707
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
708
|
+
key: 1,
|
|
709
|
+
class: "bm-upload__picture-result__image",
|
|
710
|
+
src: $setup.icons.excel,
|
|
711
|
+
alt: "\u56FE\u7247"
|
|
712
|
+
}, null, 8, _hoisted_5)) : [
|
|
713
|
+
"ppt",
|
|
714
|
+
"PPT",
|
|
715
|
+
"application/vnd.ms-powerpoint",
|
|
716
|
+
"pptx",
|
|
717
|
+
"PPTX",
|
|
718
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
719
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
720
|
+
key: 2,
|
|
721
|
+
class: "bm-upload__picture-result__image",
|
|
722
|
+
src: $setup.icons.ppt,
|
|
723
|
+
alt: "\u56FE\u7247"
|
|
724
|
+
}, null, 8, _hoisted_6)) : [
|
|
725
|
+
"doc",
|
|
726
|
+
"DOC",
|
|
727
|
+
"application/msword",
|
|
728
|
+
"docx",
|
|
729
|
+
"DOCX",
|
|
730
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
731
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
732
|
+
key: 3,
|
|
733
|
+
class: "bm-upload__picture-result__image",
|
|
734
|
+
src: $setup.icons.doc,
|
|
735
|
+
alt: "\u56FE\u7247"
|
|
736
|
+
}, null, 8, _hoisted_7)) : _ctx.pictureFileTypes.includes(item.type) ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
737
|
+
item.url ? (openBlock(), createBlock(_component_a_image, {
|
|
738
|
+
key: 0,
|
|
739
|
+
class: "bm-upload__picture-result__image",
|
|
740
|
+
src: item.url,
|
|
741
|
+
alt: "\u56FE\u7247"
|
|
742
|
+
}, null, 8, ["src"])) : (openBlock(), createBlock(_component_LoadingOutlined, { key: 1 }))
|
|
743
|
+
], 64)) : (openBlock(), createElementBlock("img", {
|
|
744
|
+
key: 5,
|
|
745
|
+
class: "bm-upload__picture-result__image",
|
|
746
|
+
src: $setup.icons.others,
|
|
747
|
+
alt: "\u56FE\u7247"
|
|
748
|
+
}, null, 8, _hoisted_8)),
|
|
749
|
+
_ctx.onepViewImageHover[item.uid] ? (openBlock(), createElementBlock("div", {
|
|
750
|
+
key: 6,
|
|
751
|
+
class: normalizeClass(["bm-upload__picture-result__cover", {
|
|
752
|
+
isPicture: _ctx.pictureFileTypes.includes(item.type)
|
|
753
|
+
}])
|
|
754
|
+
}, [
|
|
755
|
+
!_ctx.extraConfigs.canNotViewAccept?.includes(item?.type) ? (openBlock(), createElementBlock("div", {
|
|
756
|
+
key: 0,
|
|
757
|
+
class: "bm-upload__picture-result__icon bm-upload__picture-result__icon--view",
|
|
758
|
+
onClick: ($event) => _ctx.viewOnePicture(item)
|
|
759
|
+
}, null, 8, _hoisted_9)) : createCommentVNode("v-if", true),
|
|
760
|
+
!(_ctx.extraConfigs.hidenDelBtn ?? _ctx.extraConfigs.hideDelBtn ?? false) ? (openBlock(), createElementBlock("div", {
|
|
761
|
+
key: 1,
|
|
762
|
+
class: "bm-upload__picture-result__icon bm-upload__picture-result__icon--delete",
|
|
763
|
+
onClick: ($event) => _ctx.deleteFile(item.uid)
|
|
764
|
+
}, null, 8, _hoisted_10)) : createCommentVNode("v-if", true)
|
|
765
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
766
|
+
], 40, _hoisted_3)) : renderSlot(_ctx.$slots, "file", {
|
|
767
|
+
key: 1,
|
|
768
|
+
file: item
|
|
769
|
+
})
|
|
770
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
771
|
+
createCommentVNode(" \u56FE\u7247\u9519\u8BEF\u5C55\u793A "),
|
|
772
|
+
item.status === "error" ? (openBlock(), createElementBlock("div", {
|
|
773
|
+
key: 2,
|
|
774
|
+
class: "bm-upload__picture-error",
|
|
775
|
+
onMouseenter: ($event) => _ctx.pictureHoverEnter(item.uid),
|
|
776
|
+
onMouseleave: ($event) => _ctx.pictureHoverLeave(item.uid),
|
|
777
|
+
onClick: _cache[1] || (_cache[1] = (e) => e.stopPropagation())
|
|
778
|
+
}, [
|
|
779
|
+
_hoisted_12,
|
|
780
|
+
_hoisted_13,
|
|
781
|
+
_ctx.onepViewImageHover[item.uid] ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
782
|
+
createElementVNode("div", {
|
|
783
|
+
class: "bm-upload__picture-result__icon bm-upload__picture-result__icon--retry",
|
|
784
|
+
onClick: (e) => _ctx.reUpload(e, item.uid)
|
|
785
|
+
}, null, 8, _hoisted_15),
|
|
786
|
+
createElementVNode("div", {
|
|
787
|
+
class: "bm-upload__picture-result__icon bm-upload__picture-result__icon--delete",
|
|
788
|
+
onClick: ($event) => _ctx.deleteFile(item.uid)
|
|
789
|
+
}, null, 8, _hoisted_16)
|
|
790
|
+
])) : createCommentVNode("v-if", true)
|
|
791
|
+
], 40, _hoisted_11)) : createCommentVNode("v-if", true)
|
|
792
|
+
], 2),
|
|
793
|
+
createCommentVNode(" \u6587\u4EF6\u540D "),
|
|
794
|
+
_ctx.extraConfigs.showFileName && item.name ? (openBlock(), createElementBlock("div", _hoisted_17, [
|
|
795
|
+
createVNode(_component_OverTooltips, {
|
|
796
|
+
title: item.name
|
|
797
|
+
}, null, 8, ["title"])
|
|
798
|
+
])) : createCommentVNode("v-if", true)
|
|
799
|
+
]);
|
|
800
|
+
}), 128)),
|
|
801
|
+
createCommentVNode(" </a-image-preview-group> ")
|
|
802
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
803
|
+
!($setup.uploadDisabled && _ctx.extraConfigs?.hideDisabledBtn) ? (openBlock(), createElementBlock("div", _hoisted_18, [
|
|
804
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.extraConfigs.drag ? "a-upload-dragger" : "a-upload"), mergeProps(_ctx.uploadConfigs, {
|
|
805
|
+
disabled: $setup.uploadDisabled,
|
|
806
|
+
class: { "bm--upload__custom-button": _ctx.extraConfigs.myBtn },
|
|
807
|
+
onReject: _ctx.handleReject
|
|
808
|
+
}), {
|
|
809
|
+
default: withCtx(() => [
|
|
810
|
+
_ctx.extraConfigs.myBtn ? renderSlot(_ctx.$slots, "myBtn", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
811
|
+
_ctx.extraConfigs.drag ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
812
|
+
createVNode(_component_InboxOutlined, { class: "bm-upload__drag-icon" }),
|
|
813
|
+
createElementVNode("div", _hoisted_20, toDisplayString(_ctx.uploadConfigs.text || "\u70B9\u51FB\u4E0A\u4F20/\u62D6\u62FD\u4E0A\u4F20"), 1),
|
|
814
|
+
_ctx.extraConfigs.tips && _ctx.extraConfigs.showTips ? (openBlock(), createElementBlock("div", _hoisted_21, toDisplayString(_ctx.extraConfigs.tips), 1)) : createCommentVNode("v-if", true)
|
|
815
|
+
])) : _ctx.uploadConfigs.listType === "picture-card" ? (openBlock(), createElementBlock("div", _hoisted_22, [
|
|
816
|
+
createVNode(_component_PlusOutlined),
|
|
817
|
+
createElementVNode("div", _hoisted_23, toDisplayString(_ctx.uploadConfigs.text || "\u4E0A\u4F20\u56FE\u7247"), 1),
|
|
818
|
+
_ctx.extraConfigs.tips && _ctx.extraConfigs.showTips ? (openBlock(), createElementBlock("div", _hoisted_24, toDisplayString(_ctx.extraConfigs.tips), 1)) : createCommentVNode("v-if", true)
|
|
819
|
+
])) : _ctx.uploadConfigs.listType === "text" ? (openBlock(), createElementBlock("div", _hoisted_25, [
|
|
820
|
+
createVNode(_component_a_button, {
|
|
821
|
+
class: normalizeClass(_ctx.extraConfigs.btnClass),
|
|
822
|
+
disabled: $setup.uploadDisabled
|
|
823
|
+
}, {
|
|
824
|
+
default: withCtx(() => [
|
|
825
|
+
createVNode(_component_UploadOutlined),
|
|
826
|
+
createTextVNode(" " + toDisplayString(_ctx.uploadConfigs.text || "\u4E0A\u4F20\u6587\u4EF6"), 1)
|
|
827
|
+
]),
|
|
828
|
+
_: 1
|
|
829
|
+
}, 8, ["class", "disabled"]),
|
|
830
|
+
_ctx.extraConfigs.tips && _ctx.extraConfigs.showTips ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(_ctx.extraConfigs.tips), 1)) : createCommentVNode("v-if", true)
|
|
831
|
+
])) : createCommentVNode("v-if", true)
|
|
832
|
+
], 64))
|
|
833
|
+
]),
|
|
834
|
+
_: 3
|
|
835
|
+
}, 16, ["disabled", "class", "onReject"]))
|
|
836
|
+
])) : createCommentVNode("v-if", true),
|
|
837
|
+
_ctx.uploadConfigs.listType === "text" && !_ctx.uploadConfigs.showSlotList ? (openBlock(), createElementBlock("div", _hoisted_27, [
|
|
838
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fileList, (item) => {
|
|
839
|
+
return openBlock(), createElementBlock("div", {
|
|
840
|
+
key: item,
|
|
841
|
+
class: "bm-upload__file"
|
|
842
|
+
}, [
|
|
843
|
+
!_ctx.uploadConfigs.showSlotList ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
844
|
+
createElementVNode("div", _hoisted_28, [
|
|
845
|
+
_hoisted_29,
|
|
846
|
+
createElementVNode("div", _hoisted_30, [
|
|
847
|
+
createVNode(_component_OverTooltips, {
|
|
848
|
+
title: item.name
|
|
849
|
+
}, null, 8, ["title"])
|
|
850
|
+
]),
|
|
851
|
+
createElementVNode("div", _hoisted_31, [
|
|
852
|
+
item.status === "error" ? (openBlock(), createElementBlock("div", {
|
|
853
|
+
key: 0,
|
|
854
|
+
class: "bm-upload__error-reload",
|
|
855
|
+
onClick: (e) => _ctx.reUpload(e, item.uid)
|
|
856
|
+
}, null, 8, _hoisted_32)) : createCommentVNode("v-if", true),
|
|
857
|
+
!(_ctx.extraConfigs.hidenDelBtn ?? _ctx.extraConfigs.hideDelBtn ?? false) ? (openBlock(), createElementBlock("div", {
|
|
858
|
+
key: 1,
|
|
859
|
+
class: "bm-upload__trash",
|
|
860
|
+
onClick: ($event) => _ctx.deleteFile(item.uid)
|
|
861
|
+
}, null, 8, _hoisted_33)) : createCommentVNode("v-if", true)
|
|
862
|
+
])
|
|
863
|
+
]),
|
|
864
|
+
!item.isDoneDeloy || item.progress < 100 || item.status === "error" ? (openBlock(), createElementBlock("div", _hoisted_34, [
|
|
865
|
+
createVNode(_component_a_progress, {
|
|
866
|
+
type: "line",
|
|
867
|
+
"stroke-width": 2,
|
|
868
|
+
"show-info": false,
|
|
869
|
+
"stroke-color": item.status !== "error" ? _ctx.uploadBarColor : "#E64C2E",
|
|
870
|
+
percent: item.progress
|
|
871
|
+
}, null, 8, ["stroke-color", "percent"])
|
|
872
|
+
])) : createCommentVNode("v-if", true)
|
|
873
|
+
], 64)) : renderSlot(_ctx.$slots, "file", {
|
|
874
|
+
key: 1,
|
|
875
|
+
file: item
|
|
876
|
+
})
|
|
877
|
+
]);
|
|
878
|
+
}), 128))
|
|
879
|
+
])) : createCommentVNode("v-if", true),
|
|
880
|
+
createVNode(_component_a_modal, {
|
|
881
|
+
visible: _ctx.previewVisible,
|
|
882
|
+
width: _ctx.onepViewImage.type === "pdf" ? "1200px" : "600px",
|
|
883
|
+
footer: null,
|
|
884
|
+
onCancel: _ctx.handleClosePictureView
|
|
885
|
+
}, {
|
|
886
|
+
default: withCtx(() => [
|
|
887
|
+
createElementVNode("div", _hoisted_35, [
|
|
888
|
+
_ctx.pictureFileTypes.includes(_ctx.onepViewImage.type) ? (openBlock(), createElementBlock("img", {
|
|
889
|
+
key: 0,
|
|
890
|
+
style: { "width": "100%" },
|
|
891
|
+
src: _ctx.onepViewImage.url,
|
|
892
|
+
alt: ""
|
|
893
|
+
}, null, 8, _hoisted_36)) : (openBlock(), createElementBlock("iframe", {
|
|
894
|
+
key: 1,
|
|
895
|
+
title: _ctx.onepViewImage.type,
|
|
896
|
+
style: { "width": "100%", "min-height": "600px" },
|
|
897
|
+
src: _ctx.onepViewImage.url
|
|
898
|
+
}, null, 8, _hoisted_37))
|
|
899
|
+
])
|
|
900
|
+
]),
|
|
901
|
+
_: 1
|
|
902
|
+
}, 8, ["visible", "width", "onCancel"])
|
|
903
|
+
], 2);
|
|
904
|
+
}
|
|
905
|
+
var Upload = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "upload.vue"]]);
|
|
906
|
+
|
|
907
|
+
const BmUpload = withInstall(Upload);
|
|
908
|
+
|
|
909
|
+
export { BmUpload, BmUpload as default };
|