meixioacomponent 0.2.40 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/meixioacomponent.common.js +115 -107
- package/lib/meixioacomponent.umd.js +115 -107
- package/lib/meixioacomponent.umd.min.js +18 -18
- package/package.json +1 -1
- package/packages/components/base/upload/upload.vue +11 -9
- package/packages/components/base/upload/uploadItem.vue +1 -1
- package/packages/config/componentConfig.js +5 -0
- package/packages/config/uploadRequest.js +2 -1
package/package.json
CHANGED
|
@@ -93,20 +93,22 @@ export default {
|
|
|
93
93
|
this.isDown = !this.isDown;
|
|
94
94
|
},
|
|
95
95
|
async startUpload() {
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
let uploadArray = this.$props.uploadArray;
|
|
97
|
+
for (let i = 0; i < uploadArray.length; i++) {
|
|
98
|
+
let item = uploadArray[i];
|
|
98
99
|
this.createUpload(item);
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
|
|
102
103
|
appendUploadItem(list) {
|
|
104
|
+
let uploadArray = this.$props.uploadArray;
|
|
103
105
|
if (list instanceof Array) {
|
|
104
106
|
list.forEach((item) => {
|
|
105
|
-
|
|
107
|
+
uploadArray.push(item);
|
|
106
108
|
this.createUpload(item);
|
|
107
109
|
});
|
|
108
110
|
} else {
|
|
109
|
-
|
|
111
|
+
uploadArray.push(list);
|
|
110
112
|
}
|
|
111
113
|
},
|
|
112
114
|
createUpload(uploadItem) {
|
|
@@ -158,17 +160,17 @@ export default {
|
|
|
158
160
|
},
|
|
159
161
|
|
|
160
162
|
uploadEd() {
|
|
161
|
-
let
|
|
163
|
+
let uploadArray = this.$props.uploadArray;
|
|
164
|
+
let flag = uploadArray.every((item) => {
|
|
162
165
|
return !item.upload || item.upload.state != 0;
|
|
163
166
|
});
|
|
164
167
|
if (flag) {
|
|
165
168
|
if (this.$props.uploadEdEvent) {
|
|
166
|
-
|
|
169
|
+
uploadArray = uploadArray.filter((item) => {
|
|
167
170
|
return item.process == 100 || !item.upload;
|
|
168
171
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
this.$props.uploadEdEvent(list);
|
|
172
|
+
|
|
173
|
+
this.$props.uploadEdEvent(uploadArray);
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="item-wrap" :class="[type]">
|
|
3
3
|
<div class="item-type">
|
|
4
|
-
<svg
|
|
4
|
+
<base-svg class="svg" :icon-class="`${svgKey}`"></base-svg>
|
|
5
5
|
</div>
|
|
6
6
|
<div class="item-content">
|
|
7
7
|
<div class="item-info">
|
|
@@ -5,6 +5,7 @@ const componentConfig = {
|
|
|
5
5
|
store: null,
|
|
6
6
|
router: null,
|
|
7
7
|
dynamicId: 0,
|
|
8
|
+
uploadUrl: null,
|
|
8
9
|
eventBus: new Vue(),
|
|
9
10
|
selectStore: null,
|
|
10
11
|
|
|
@@ -12,6 +13,10 @@ const componentConfig = {
|
|
|
12
13
|
componentConfig.dynamicId += 1;
|
|
13
14
|
},
|
|
14
15
|
|
|
16
|
+
setUploadUrl: (url) => {
|
|
17
|
+
componentConfig.uploadUrl = url;
|
|
18
|
+
},
|
|
19
|
+
|
|
15
20
|
initConfig: (_store, _router) => {
|
|
16
21
|
// 注册element 组件
|
|
17
22
|
useElementComponent();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { GetToken } from "../utils/utils.js";
|
|
3
|
+
import componentConfig from "./componentConfig.js";
|
|
3
4
|
|
|
4
5
|
const ossInstance = (params, uploadProgressFn) => {
|
|
5
6
|
// 创建 axios 实例
|
|
6
7
|
const instance = axios.create({
|
|
7
8
|
// API 请求的默认前缀
|
|
8
|
-
baseURL:
|
|
9
|
+
baseURL: componentConfig.uploadUrl,
|
|
9
10
|
});
|
|
10
11
|
|
|
11
12
|
// 异常拦截处理器
|