bm-admin-ui 1.0.16-alpha → 1.0.19-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/staffs-selector/index.js +1 -1
- package/es/components/timeline/index.d.ts +20 -6
- package/es/components/timeline/index.js +2 -2
- package/es/components/timeline/src/props.d.ts +6 -2
- package/es/components/timeline/src/timeline-item.vue.d.ts +20 -6
- package/es/components/upload/index.d.ts +9 -0
- package/es/components/upload/index.js +101 -17
- package/es/components/upload/src/upload.vue.d.ts +9 -0
- package/index.esm.js +104 -20
- package/index.js +104 -20
- package/lib/components/staffs-selector/index.js +1 -1
- package/lib/components/timeline/index.d.ts +20 -6
- package/lib/components/timeline/index.js +2 -2
- package/lib/components/timeline/src/props.d.ts +6 -2
- package/lib/components/timeline/src/timeline-item.vue.d.ts +20 -6
- package/lib/components/upload/index.d.ts +9 -0
- package/lib/components/upload/index.js +101 -17
- package/lib/components/upload/src/upload.vue.d.ts +9 -0
- package/package.json +1 -1
- package/theme-chalk/feedback.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/types/components/timeline/index.d.ts +20 -6
- package/types/components/timeline/src/props.d.ts +6 -2
- package/types/components/timeline/src/timeline-item.vue.d.ts +20 -6
- package/types/components/upload/index.d.ts +9 -0
- package/types/components/upload/src/upload.vue.d.ts +9 -0
|
@@ -1625,7 +1625,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
1625
1625
|
});
|
|
1626
1626
|
},
|
|
1627
1627
|
getSelectName(key) {
|
|
1628
|
-
let data = props.dataMap.get(
|
|
1628
|
+
let data = props.dataMap.get(key) || null;
|
|
1629
1629
|
return data ? data.title : "\u672A\u77E5";
|
|
1630
1630
|
}
|
|
1631
1631
|
};
|
|
@@ -44,8 +44,12 @@ declare const BmTimelineItem: import("bm-admin-ui/es/utils/with-install").SFCWit
|
|
|
44
44
|
color: import("vue-types").VueTypeDef<string> & {
|
|
45
45
|
default: string;
|
|
46
46
|
};
|
|
47
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
48
|
-
|
|
47
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
48
|
+
default: any;
|
|
49
|
+
};
|
|
50
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
51
|
+
default: any;
|
|
52
|
+
};
|
|
49
53
|
}, {
|
|
50
54
|
slots: Readonly<{
|
|
51
55
|
[name: string]: import("vue").Slot | undefined;
|
|
@@ -54,8 +58,12 @@ declare const BmTimelineItem: import("bm-admin-ui/es/utils/with-install").SFCWit
|
|
|
54
58
|
color: import("vue-types").VueTypeDef<string> & {
|
|
55
59
|
default: string;
|
|
56
60
|
};
|
|
57
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
58
|
-
|
|
61
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
62
|
+
default: any;
|
|
63
|
+
};
|
|
64
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
65
|
+
default: any;
|
|
66
|
+
};
|
|
59
67
|
}>> & {
|
|
60
68
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
61
69
|
}>>;
|
|
@@ -84,10 +92,16 @@ declare const BmTimelineItem: import("bm-admin-ui/es/utils/with-install").SFCWit
|
|
|
84
92
|
color: import("vue-types").VueTypeDef<string> & {
|
|
85
93
|
default: string;
|
|
86
94
|
};
|
|
87
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
88
|
-
|
|
95
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
96
|
+
default: any;
|
|
97
|
+
};
|
|
98
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
99
|
+
default: any;
|
|
100
|
+
};
|
|
89
101
|
}>>, {
|
|
90
102
|
color: string;
|
|
103
|
+
label: any;
|
|
104
|
+
dot: any;
|
|
91
105
|
}>>;
|
|
92
106
|
export { BmTimeline, BmTimelineItem };
|
|
93
107
|
export default BmTimeline;
|
|
@@ -42,8 +42,8 @@ const timelineProps = () => ({
|
|
|
42
42
|
});
|
|
43
43
|
const timelineItemProps = () => ({
|
|
44
44
|
color: z.oneOf(['blue', 'red', 'green', 'gray']).def('blue'),
|
|
45
|
-
dot: z.any,
|
|
46
|
-
label: z.any,
|
|
45
|
+
dot: z.any.def(''),
|
|
46
|
+
label: z.any.def(''),
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
var _export_sfc = (sfc, props) => {
|
|
@@ -14,7 +14,11 @@ export declare const timelineItemProps: () => {
|
|
|
14
14
|
color: import("vue-types").VueTypeDef<string> & {
|
|
15
15
|
default: string;
|
|
16
16
|
};
|
|
17
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
18
|
-
|
|
17
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
18
|
+
default: any;
|
|
19
|
+
};
|
|
20
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
21
|
+
default: any;
|
|
22
|
+
};
|
|
19
23
|
};
|
|
20
24
|
export declare type TimelineItemProps = Partial<ExtractPropTypes<ReturnType<typeof timelineItemProps>>>;
|
|
@@ -3,8 +3,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3
3
|
color: import("vue-types").VueTypeDef<string> & {
|
|
4
4
|
default: string;
|
|
5
5
|
};
|
|
6
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
7
|
-
|
|
6
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
7
|
+
default: any;
|
|
8
|
+
};
|
|
9
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
10
|
+
default: any;
|
|
11
|
+
};
|
|
8
12
|
}, {
|
|
9
13
|
slots: Readonly<{
|
|
10
14
|
[name: string]: import("vue").Slot | undefined;
|
|
@@ -13,8 +17,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
17
|
color: import("vue-types").VueTypeDef<string> & {
|
|
14
18
|
default: string;
|
|
15
19
|
};
|
|
16
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
17
|
-
|
|
20
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
21
|
+
default: any;
|
|
22
|
+
};
|
|
23
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
24
|
+
default: any;
|
|
25
|
+
};
|
|
18
26
|
}>> & {
|
|
19
27
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
20
28
|
}>>;
|
|
@@ -43,9 +51,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
51
|
color: import("vue-types").VueTypeDef<string> & {
|
|
44
52
|
default: string;
|
|
45
53
|
};
|
|
46
|
-
dot: import("vue-types").VueTypeValidableDef<any
|
|
47
|
-
|
|
54
|
+
dot: import("vue-types").VueTypeValidableDef<any> & {
|
|
55
|
+
default: any;
|
|
56
|
+
};
|
|
57
|
+
label: import("vue-types").VueTypeValidableDef<any> & {
|
|
58
|
+
default: any;
|
|
59
|
+
};
|
|
48
60
|
}>>, {
|
|
49
61
|
color: string;
|
|
62
|
+
label: any;
|
|
63
|
+
dot: any;
|
|
50
64
|
}>;
|
|
51
65
|
export default _default;
|
|
@@ -61,6 +61,14 @@ declare const BmUpload: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
|
|
|
61
61
|
type: StringConstructor;
|
|
62
62
|
default: string;
|
|
63
63
|
};
|
|
64
|
+
holdProgress: {
|
|
65
|
+
type: NumberConstructor;
|
|
66
|
+
default: number;
|
|
67
|
+
};
|
|
68
|
+
customErrors: {
|
|
69
|
+
type: ObjectConstructor;
|
|
70
|
+
default(): undefined;
|
|
71
|
+
};
|
|
64
72
|
};
|
|
65
73
|
emits: string[];
|
|
66
74
|
setup(props: any, { emit }: {
|
|
@@ -68,6 +76,7 @@ declare const BmUpload: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
|
|
|
68
76
|
}): {
|
|
69
77
|
uploadDisabled: import("vue").ComputedRef<boolean>;
|
|
70
78
|
customUploadRequest(file: any): void;
|
|
79
|
+
fileIsDelete(file: any): boolean;
|
|
71
80
|
uploadSuccess(data: any, file: any): void;
|
|
72
81
|
uploadError(error: any, file?: any): void;
|
|
73
82
|
deleteFile(uid: any): Promise<void>;
|
|
@@ -1333,6 +1333,16 @@ const _sfc_main = {
|
|
|
1333
1333
|
cloudReadUrl: {
|
|
1334
1334
|
type: String,
|
|
1335
1335
|
default: ""
|
|
1336
|
+
},
|
|
1337
|
+
holdProgress: {
|
|
1338
|
+
type: Number,
|
|
1339
|
+
default: 0
|
|
1340
|
+
},
|
|
1341
|
+
customErrors: {
|
|
1342
|
+
type: Object,
|
|
1343
|
+
default() {
|
|
1344
|
+
return void 0;
|
|
1345
|
+
}
|
|
1336
1346
|
}
|
|
1337
1347
|
},
|
|
1338
1348
|
emits: [
|
|
@@ -1342,7 +1352,9 @@ const _sfc_main = {
|
|
|
1342
1352
|
"previewFile",
|
|
1343
1353
|
"successFile",
|
|
1344
1354
|
"deleteFile",
|
|
1345
|
-
"error"
|
|
1355
|
+
"error",
|
|
1356
|
+
"updateDisabledStatus",
|
|
1357
|
+
"updateIsUploadingStatus"
|
|
1346
1358
|
],
|
|
1347
1359
|
setup(props, { emit }) {
|
|
1348
1360
|
let acceptList = [
|
|
@@ -1394,15 +1406,15 @@ const _sfc_main = {
|
|
|
1394
1406
|
disabled: false,
|
|
1395
1407
|
async customRequest({ file, fileField, data }) {
|
|
1396
1408
|
if (file.size > state.extraConfigs.maxSize * 1024 * 1024) {
|
|
1397
|
-
return methods.uploadError(new Error(`\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`));
|
|
1409
|
+
return methods.uploadError(new Error(props.customErrors?.maxSize || `\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`));
|
|
1398
1410
|
}
|
|
1399
1411
|
if (Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
|
|
1400
|
-
return methods.uploadError(new Error(`\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`));
|
|
1412
|
+
return methods.uploadError(new Error(props.customErrors?.maxCount || `\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`));
|
|
1401
1413
|
}
|
|
1402
1414
|
let name = file.name;
|
|
1403
1415
|
let fileFormat = name.split(".").pop();
|
|
1404
1416
|
if (!state.uploadConfigs.accept.includes(`.${fileFormat}`)) {
|
|
1405
|
-
return methods.uploadError(new Error(`\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`));
|
|
1417
|
+
return methods.uploadError(new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`));
|
|
1406
1418
|
}
|
|
1407
1419
|
state.fileList[file.uid] = {
|
|
1408
1420
|
uid: file.uid,
|
|
@@ -1422,16 +1434,25 @@ const _sfc_main = {
|
|
|
1422
1434
|
});
|
|
1423
1435
|
const methods = {
|
|
1424
1436
|
customUploadRequest(file) {
|
|
1437
|
+
const updateUploadProgress = (progress) => {
|
|
1438
|
+
if (methods.fileIsDelete(file)) {
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
state.fileList[file.uid] = {
|
|
1442
|
+
...state.fileList[file.uid],
|
|
1443
|
+
progress
|
|
1444
|
+
};
|
|
1445
|
+
};
|
|
1425
1446
|
props.uploadRequest?.(file, {
|
|
1426
1447
|
onUploadProgress: (e) => {
|
|
1427
1448
|
let progress = Math.round(e.loaded / e.total * 100);
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1449
|
+
if (props.holdProgress) {
|
|
1450
|
+
progress = progress > props.holdProgress ? props.holdProgress : progress;
|
|
1451
|
+
}
|
|
1452
|
+
updateUploadProgress(progress);
|
|
1432
1453
|
}
|
|
1433
1454
|
}).then(function(data) {
|
|
1434
|
-
|
|
1455
|
+
updateUploadProgress(100);
|
|
1435
1456
|
methods.uploadSuccess(data, file);
|
|
1436
1457
|
}).catch(function(error) {
|
|
1437
1458
|
console.error(error);
|
|
@@ -1441,13 +1462,20 @@ const _sfc_main = {
|
|
|
1441
1462
|
methods.uploadError(error, file);
|
|
1442
1463
|
});
|
|
1443
1464
|
},
|
|
1465
|
+
fileIsDelete(file) {
|
|
1466
|
+
return !state.fileList[file.uid];
|
|
1467
|
+
},
|
|
1444
1468
|
uploadSuccess(data, file) {
|
|
1469
|
+
if (methods.fileIsDelete(file)) {
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1445
1472
|
emit("successFile", data);
|
|
1446
1473
|
let uri = data?.url;
|
|
1447
1474
|
let item = state.extraConfigs.fileDetail ? {
|
|
1448
1475
|
name: file.name,
|
|
1449
1476
|
size: file.size,
|
|
1450
1477
|
type: file.type,
|
|
1478
|
+
uid: file.uid,
|
|
1451
1479
|
url: uri
|
|
1452
1480
|
} : uri;
|
|
1453
1481
|
state.uploadedList.push(item);
|
|
@@ -1456,6 +1484,9 @@ const _sfc_main = {
|
|
|
1456
1484
|
emit("update", state.uploadedList);
|
|
1457
1485
|
},
|
|
1458
1486
|
uploadError(error, file = {}) {
|
|
1487
|
+
if (methods.fileIsDelete(file)) {
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1459
1490
|
if (file.uid && state.fileList[file.uid]) {
|
|
1460
1491
|
state.fileList[file.uid].status = "error";
|
|
1461
1492
|
}
|
|
@@ -1529,9 +1560,14 @@ const _sfc_main = {
|
|
|
1529
1560
|
}
|
|
1530
1561
|
};
|
|
1531
1562
|
watch(() => props.defaultList, function(list) {
|
|
1532
|
-
if (list
|
|
1563
|
+
if (list?.length) {
|
|
1564
|
+
list.forEach((item) => {
|
|
1565
|
+
if (!item.uid) {
|
|
1566
|
+
item.uid = utils.getuid();
|
|
1567
|
+
}
|
|
1568
|
+
});
|
|
1533
1569
|
list.forEach(function(item) {
|
|
1534
|
-
let uid = utils.getuid();
|
|
1570
|
+
let uid = item.uid || utils.getuid();
|
|
1535
1571
|
if (!item.url.includes("http") && !item.url.includes(CLOUND_PRE))
|
|
1536
1572
|
item.url = props.cloudReadUrl + item.url;
|
|
1537
1573
|
state.fileList[uid] = {
|
|
@@ -1542,8 +1578,13 @@ const _sfc_main = {
|
|
|
1542
1578
|
progress: 100,
|
|
1543
1579
|
isDoneDeloy: true
|
|
1544
1580
|
};
|
|
1545
|
-
state.uploadedList.
|
|
1581
|
+
if (!state.uploadedList.find((item2) => item2.uid === uid)) {
|
|
1582
|
+
state.uploadedList.push(item);
|
|
1583
|
+
}
|
|
1546
1584
|
});
|
|
1585
|
+
} else {
|
|
1586
|
+
state.fileList = {};
|
|
1587
|
+
state.uploadedList = [];
|
|
1547
1588
|
}
|
|
1548
1589
|
}, {
|
|
1549
1590
|
immediate: true
|
|
@@ -1571,6 +1612,26 @@ const _sfc_main = {
|
|
|
1571
1612
|
watchEffect(() => {
|
|
1572
1613
|
state.uploadConfigs.disabled = uploadDisabled.value;
|
|
1573
1614
|
});
|
|
1615
|
+
watch(() => uploadDisabled.value, (value) => {
|
|
1616
|
+
emit("updateDisabledStatus", value);
|
|
1617
|
+
}, {
|
|
1618
|
+
immediate: true
|
|
1619
|
+
});
|
|
1620
|
+
const isUploading = computed(() => {
|
|
1621
|
+
let ret = false;
|
|
1622
|
+
let fileList = state.fileList || {};
|
|
1623
|
+
Object.keys(fileList).forEach((uid) => {
|
|
1624
|
+
if (fileList[uid]?.progress && fileList[uid].progress < 100) {
|
|
1625
|
+
ret = true;
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
return ret;
|
|
1629
|
+
});
|
|
1630
|
+
watch(() => isUploading.value, (value) => {
|
|
1631
|
+
emit("updateIsUploadingStatus", value);
|
|
1632
|
+
}, {
|
|
1633
|
+
immediate: true
|
|
1634
|
+
});
|
|
1574
1635
|
return {
|
|
1575
1636
|
...toRefs(state),
|
|
1576
1637
|
icons,
|
|
@@ -1677,27 +1738,50 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1677
1738
|
onMouseleave: ($event) => _ctx.pictureHoverLeave(item.uid),
|
|
1678
1739
|
onClick: _cache[0] || (_cache[0] = (e) => e.stopPropagation())
|
|
1679
1740
|
}, [
|
|
1680
|
-
|
|
1741
|
+
["pdf", "application/pdf"].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
1681
1742
|
key: 0,
|
|
1682
1743
|
class: "bm-upload__picture-result__image",
|
|
1683
1744
|
src: $setup.icons.pdf,
|
|
1684
1745
|
alt: "avatar"
|
|
1685
|
-
}, null, 8, _hoisted_4)) :
|
|
1746
|
+
}, null, 8, _hoisted_4)) : [
|
|
1747
|
+
"xlsx",
|
|
1748
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1749
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
1686
1750
|
key: 1,
|
|
1687
1751
|
class: "bm-upload__picture-result__image",
|
|
1688
1752
|
src: $setup.icons.excel,
|
|
1689
1753
|
alt: "avatar"
|
|
1690
|
-
}, null, 8, _hoisted_5)) :
|
|
1754
|
+
}, null, 8, _hoisted_5)) : [
|
|
1755
|
+
"ppt",
|
|
1756
|
+
"application/vnd.ms-powerpoint",
|
|
1757
|
+
"pptx",
|
|
1758
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1759
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
1691
1760
|
key: 2,
|
|
1692
1761
|
class: "bm-upload__picture-result__image",
|
|
1693
1762
|
src: $setup.icons.ppt,
|
|
1694
1763
|
alt: "avatar"
|
|
1695
|
-
}, null, 8, _hoisted_6)) : [
|
|
1764
|
+
}, null, 8, _hoisted_6)) : [
|
|
1765
|
+
"doc",
|
|
1766
|
+
"application/msword",
|
|
1767
|
+
"docx",
|
|
1768
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
1769
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
1696
1770
|
key: 3,
|
|
1697
1771
|
class: "bm-upload__picture-result__image",
|
|
1698
1772
|
src: $setup.icons.doc,
|
|
1699
1773
|
alt: "avatar"
|
|
1700
|
-
}, null, 8, _hoisted_7)) : [
|
|
1774
|
+
}, null, 8, _hoisted_7)) : [
|
|
1775
|
+
"img",
|
|
1776
|
+
"image",
|
|
1777
|
+
"png",
|
|
1778
|
+
"image/png",
|
|
1779
|
+
"jpg",
|
|
1780
|
+
"jpeg",
|
|
1781
|
+
"image/jpeg",
|
|
1782
|
+
"gif",
|
|
1783
|
+
"image/gif"
|
|
1784
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
1701
1785
|
key: 4,
|
|
1702
1786
|
class: "bm-upload__picture-result__image",
|
|
1703
1787
|
src: item.url,
|
|
@@ -61,6 +61,14 @@ declare const _default: {
|
|
|
61
61
|
type: StringConstructor;
|
|
62
62
|
default: string;
|
|
63
63
|
};
|
|
64
|
+
holdProgress: {
|
|
65
|
+
type: NumberConstructor;
|
|
66
|
+
default: number;
|
|
67
|
+
};
|
|
68
|
+
customErrors: {
|
|
69
|
+
type: ObjectConstructor;
|
|
70
|
+
default(): undefined;
|
|
71
|
+
};
|
|
64
72
|
};
|
|
65
73
|
emits: string[];
|
|
66
74
|
setup(props: any, { emit }: {
|
|
@@ -68,6 +76,7 @@ declare const _default: {
|
|
|
68
76
|
}): {
|
|
69
77
|
uploadDisabled: import("vue").ComputedRef<boolean>;
|
|
70
78
|
customUploadRequest(file: any): void;
|
|
79
|
+
fileIsDelete(file: any): boolean;
|
|
71
80
|
uploadSuccess(data: any, file: any): void;
|
|
72
81
|
uploadError(error: any, file?: any): void;
|
|
73
82
|
deleteFile(uid: any): Promise<void>;
|
package/index.esm.js
CHANGED
|
@@ -45035,7 +45035,7 @@ const _sfc_main$7 = defineComponent({
|
|
|
45035
45035
|
});
|
|
45036
45036
|
},
|
|
45037
45037
|
getSelectName(key) {
|
|
45038
|
-
let data = props.dataMap.get(
|
|
45038
|
+
let data = props.dataMap.get(key) || null;
|
|
45039
45039
|
return data ? data.title : "\u672A\u77E5";
|
|
45040
45040
|
}
|
|
45041
45041
|
};
|
|
@@ -46048,6 +46048,16 @@ const _sfc_main$3 = {
|
|
|
46048
46048
|
cloudReadUrl: {
|
|
46049
46049
|
type: String,
|
|
46050
46050
|
default: ""
|
|
46051
|
+
},
|
|
46052
|
+
holdProgress: {
|
|
46053
|
+
type: Number,
|
|
46054
|
+
default: 0
|
|
46055
|
+
},
|
|
46056
|
+
customErrors: {
|
|
46057
|
+
type: Object,
|
|
46058
|
+
default() {
|
|
46059
|
+
return void 0;
|
|
46060
|
+
}
|
|
46051
46061
|
}
|
|
46052
46062
|
},
|
|
46053
46063
|
emits: [
|
|
@@ -46057,7 +46067,9 @@ const _sfc_main$3 = {
|
|
|
46057
46067
|
"previewFile",
|
|
46058
46068
|
"successFile",
|
|
46059
46069
|
"deleteFile",
|
|
46060
|
-
"error"
|
|
46070
|
+
"error",
|
|
46071
|
+
"updateDisabledStatus",
|
|
46072
|
+
"updateIsUploadingStatus"
|
|
46061
46073
|
],
|
|
46062
46074
|
setup(props, { emit }) {
|
|
46063
46075
|
let acceptList = [
|
|
@@ -46109,15 +46121,15 @@ const _sfc_main$3 = {
|
|
|
46109
46121
|
disabled: false,
|
|
46110
46122
|
async customRequest({ file, fileField, data }) {
|
|
46111
46123
|
if (file.size > state.extraConfigs.maxSize * 1024 * 1024) {
|
|
46112
|
-
return methods.uploadError(new Error(`\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`));
|
|
46124
|
+
return methods.uploadError(new Error(props.customErrors?.maxSize || `\u4E0D\u80FD\u4E0A\u4F20\u5927\u4E8E${state.extraConfigs.maxSize}M\u7684\u6587\u4EF6`));
|
|
46113
46125
|
}
|
|
46114
46126
|
if (Object.keys(state.fileList).length >= state.extraConfigs.maxCount) {
|
|
46115
|
-
return methods.uploadError(new Error(`\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`));
|
|
46127
|
+
return methods.uploadError(new Error(props.customErrors?.maxCount || `\u4E0D\u80FD\u4E0A\u4F20\u591A\u4E8E${state.extraConfigs.maxCount}\u4E2A\u6587\u4EF6`));
|
|
46116
46128
|
}
|
|
46117
46129
|
let name = file.name;
|
|
46118
46130
|
let fileFormat = name.split(".").pop();
|
|
46119
46131
|
if (!state.uploadConfigs.accept.includes(`.${fileFormat}`)) {
|
|
46120
|
-
return methods.uploadError(new Error(`\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`));
|
|
46132
|
+
return methods.uploadError(new Error(props.customErrors?.format || `\u4E0D\u80FD\u4E0A\u4F20\u8BE5\u7C7B\u578B\u6587\u4EF6`));
|
|
46121
46133
|
}
|
|
46122
46134
|
state.fileList[file.uid] = {
|
|
46123
46135
|
uid: file.uid,
|
|
@@ -46137,16 +46149,25 @@ const _sfc_main$3 = {
|
|
|
46137
46149
|
});
|
|
46138
46150
|
const methods = {
|
|
46139
46151
|
customUploadRequest(file) {
|
|
46152
|
+
const updateUploadProgress = (progress) => {
|
|
46153
|
+
if (methods.fileIsDelete(file)) {
|
|
46154
|
+
return;
|
|
46155
|
+
}
|
|
46156
|
+
state.fileList[file.uid] = {
|
|
46157
|
+
...state.fileList[file.uid],
|
|
46158
|
+
progress
|
|
46159
|
+
};
|
|
46160
|
+
};
|
|
46140
46161
|
props.uploadRequest?.(file, {
|
|
46141
46162
|
onUploadProgress: (e) => {
|
|
46142
46163
|
let progress = Math.round(e.loaded / e.total * 100);
|
|
46143
|
-
|
|
46144
|
-
|
|
46145
|
-
|
|
46146
|
-
|
|
46164
|
+
if (props.holdProgress) {
|
|
46165
|
+
progress = progress > props.holdProgress ? props.holdProgress : progress;
|
|
46166
|
+
}
|
|
46167
|
+
updateUploadProgress(progress);
|
|
46147
46168
|
}
|
|
46148
46169
|
}).then(function(data) {
|
|
46149
|
-
|
|
46170
|
+
updateUploadProgress(100);
|
|
46150
46171
|
methods.uploadSuccess(data, file);
|
|
46151
46172
|
}).catch(function(error) {
|
|
46152
46173
|
console.error(error);
|
|
@@ -46156,13 +46177,20 @@ const _sfc_main$3 = {
|
|
|
46156
46177
|
methods.uploadError(error, file);
|
|
46157
46178
|
});
|
|
46158
46179
|
},
|
|
46180
|
+
fileIsDelete(file) {
|
|
46181
|
+
return !state.fileList[file.uid];
|
|
46182
|
+
},
|
|
46159
46183
|
uploadSuccess(data, file) {
|
|
46184
|
+
if (methods.fileIsDelete(file)) {
|
|
46185
|
+
return;
|
|
46186
|
+
}
|
|
46160
46187
|
emit("successFile", data);
|
|
46161
46188
|
let uri = data?.url;
|
|
46162
46189
|
let item = state.extraConfigs.fileDetail ? {
|
|
46163
46190
|
name: file.name,
|
|
46164
46191
|
size: file.size,
|
|
46165
46192
|
type: file.type,
|
|
46193
|
+
uid: file.uid,
|
|
46166
46194
|
url: uri
|
|
46167
46195
|
} : uri;
|
|
46168
46196
|
state.uploadedList.push(item);
|
|
@@ -46171,6 +46199,9 @@ const _sfc_main$3 = {
|
|
|
46171
46199
|
emit("update", state.uploadedList);
|
|
46172
46200
|
},
|
|
46173
46201
|
uploadError(error, file = {}) {
|
|
46202
|
+
if (methods.fileIsDelete(file)) {
|
|
46203
|
+
return;
|
|
46204
|
+
}
|
|
46174
46205
|
if (file.uid && state.fileList[file.uid]) {
|
|
46175
46206
|
state.fileList[file.uid].status = "error";
|
|
46176
46207
|
}
|
|
@@ -46244,9 +46275,14 @@ const _sfc_main$3 = {
|
|
|
46244
46275
|
}
|
|
46245
46276
|
};
|
|
46246
46277
|
watch(() => props.defaultList, function(list) {
|
|
46247
|
-
if (list
|
|
46278
|
+
if (list?.length) {
|
|
46279
|
+
list.forEach((item) => {
|
|
46280
|
+
if (!item.uid) {
|
|
46281
|
+
item.uid = utils.getuid();
|
|
46282
|
+
}
|
|
46283
|
+
});
|
|
46248
46284
|
list.forEach(function(item) {
|
|
46249
|
-
let uid = utils.getuid();
|
|
46285
|
+
let uid = item.uid || utils.getuid();
|
|
46250
46286
|
if (!item.url.includes("http") && !item.url.includes(CLOUND_PRE))
|
|
46251
46287
|
item.url = props.cloudReadUrl + item.url;
|
|
46252
46288
|
state.fileList[uid] = {
|
|
@@ -46257,8 +46293,13 @@ const _sfc_main$3 = {
|
|
|
46257
46293
|
progress: 100,
|
|
46258
46294
|
isDoneDeloy: true
|
|
46259
46295
|
};
|
|
46260
|
-
state.uploadedList.
|
|
46296
|
+
if (!state.uploadedList.find((item2) => item2.uid === uid)) {
|
|
46297
|
+
state.uploadedList.push(item);
|
|
46298
|
+
}
|
|
46261
46299
|
});
|
|
46300
|
+
} else {
|
|
46301
|
+
state.fileList = {};
|
|
46302
|
+
state.uploadedList = [];
|
|
46262
46303
|
}
|
|
46263
46304
|
}, {
|
|
46264
46305
|
immediate: true
|
|
@@ -46286,6 +46327,26 @@ const _sfc_main$3 = {
|
|
|
46286
46327
|
watchEffect(() => {
|
|
46287
46328
|
state.uploadConfigs.disabled = uploadDisabled.value;
|
|
46288
46329
|
});
|
|
46330
|
+
watch(() => uploadDisabled.value, (value) => {
|
|
46331
|
+
emit("updateDisabledStatus", value);
|
|
46332
|
+
}, {
|
|
46333
|
+
immediate: true
|
|
46334
|
+
});
|
|
46335
|
+
const isUploading = computed(() => {
|
|
46336
|
+
let ret = false;
|
|
46337
|
+
let fileList = state.fileList || {};
|
|
46338
|
+
Object.keys(fileList).forEach((uid) => {
|
|
46339
|
+
if (fileList[uid]?.progress && fileList[uid].progress < 100) {
|
|
46340
|
+
ret = true;
|
|
46341
|
+
}
|
|
46342
|
+
});
|
|
46343
|
+
return ret;
|
|
46344
|
+
});
|
|
46345
|
+
watch(() => isUploading.value, (value) => {
|
|
46346
|
+
emit("updateIsUploadingStatus", value);
|
|
46347
|
+
}, {
|
|
46348
|
+
immediate: true
|
|
46349
|
+
});
|
|
46289
46350
|
return {
|
|
46290
46351
|
...toRefs(state),
|
|
46291
46352
|
icons,
|
|
@@ -46392,27 +46453,50 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
46392
46453
|
onMouseleave: ($event) => _ctx.pictureHoverLeave(item.uid),
|
|
46393
46454
|
onClick: _cache[0] || (_cache[0] = (e) => e.stopPropagation())
|
|
46394
46455
|
}, [
|
|
46395
|
-
|
|
46456
|
+
["pdf", "application/pdf"].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
46396
46457
|
key: 0,
|
|
46397
46458
|
class: "bm-upload__picture-result__image",
|
|
46398
46459
|
src: $setup.icons.pdf,
|
|
46399
46460
|
alt: "avatar"
|
|
46400
|
-
}, null, 8, _hoisted_4$1)) :
|
|
46461
|
+
}, null, 8, _hoisted_4$1)) : [
|
|
46462
|
+
"xlsx",
|
|
46463
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
46464
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
46401
46465
|
key: 1,
|
|
46402
46466
|
class: "bm-upload__picture-result__image",
|
|
46403
46467
|
src: $setup.icons.excel,
|
|
46404
46468
|
alt: "avatar"
|
|
46405
|
-
}, null, 8, _hoisted_5$1)) :
|
|
46469
|
+
}, null, 8, _hoisted_5$1)) : [
|
|
46470
|
+
"ppt",
|
|
46471
|
+
"application/vnd.ms-powerpoint",
|
|
46472
|
+
"pptx",
|
|
46473
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
46474
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
46406
46475
|
key: 2,
|
|
46407
46476
|
class: "bm-upload__picture-result__image",
|
|
46408
46477
|
src: $setup.icons.ppt,
|
|
46409
46478
|
alt: "avatar"
|
|
46410
|
-
}, null, 8, _hoisted_6$1)) : [
|
|
46479
|
+
}, null, 8, _hoisted_6$1)) : [
|
|
46480
|
+
"doc",
|
|
46481
|
+
"application/msword",
|
|
46482
|
+
"docx",
|
|
46483
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
46484
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
46411
46485
|
key: 3,
|
|
46412
46486
|
class: "bm-upload__picture-result__image",
|
|
46413
46487
|
src: $setup.icons.doc,
|
|
46414
46488
|
alt: "avatar"
|
|
46415
|
-
}, null, 8, _hoisted_7$1)) : [
|
|
46489
|
+
}, null, 8, _hoisted_7$1)) : [
|
|
46490
|
+
"img",
|
|
46491
|
+
"image",
|
|
46492
|
+
"png",
|
|
46493
|
+
"image/png",
|
|
46494
|
+
"jpg",
|
|
46495
|
+
"jpeg",
|
|
46496
|
+
"image/jpeg",
|
|
46497
|
+
"gif",
|
|
46498
|
+
"image/gif"
|
|
46499
|
+
].includes(item.type) ? (openBlock(), createElementBlock("img", {
|
|
46416
46500
|
key: 4,
|
|
46417
46501
|
class: "bm-upload__picture-result__image",
|
|
46418
46502
|
src: item.url,
|
|
@@ -46601,8 +46685,8 @@ const timelineProps = () => ({
|
|
|
46601
46685
|
});
|
|
46602
46686
|
const timelineItemProps = () => ({
|
|
46603
46687
|
color: z.oneOf(['blue', 'red', 'green', 'gray']).def('blue'),
|
|
46604
|
-
dot: z.any,
|
|
46605
|
-
label: z.any,
|
|
46688
|
+
dot: z.any.def(''),
|
|
46689
|
+
label: z.any.def(''),
|
|
46606
46690
|
});
|
|
46607
46691
|
|
|
46608
46692
|
const __default__$1 = {
|