xianniu-ui 0.5.5 → 0.5.7
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/xianniu-ui.common.js +32 -32
- package/lib/xianniu-ui.umd.js +32 -32
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/packages/upload/main.vue +9 -9
package/package.json
CHANGED
package/packages/upload/main.vue
CHANGED
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
|
|
99
99
|
<script>
|
|
100
100
|
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
|
101
|
-
// import * as imageConversion from "image-conversion";
|
|
102
101
|
import axios from "axios";
|
|
103
102
|
import uploadPop from "./upload-pop.vue";
|
|
103
|
+
const MAX_WARNING = 1024 * 10 * 1024;
|
|
104
104
|
export default {
|
|
105
105
|
name: "XnUpload",
|
|
106
106
|
inheritAttrs: false,
|
|
@@ -140,7 +140,7 @@ export default {
|
|
|
140
140
|
},
|
|
141
141
|
maxSize: {
|
|
142
142
|
type: Number,
|
|
143
|
-
default: 1024 *
|
|
143
|
+
default: 1024 * 200 * 1024, // 最大限制 50M
|
|
144
144
|
},
|
|
145
145
|
compress: {
|
|
146
146
|
type: Number,
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
213
213
|
return false;
|
|
214
214
|
}
|
|
215
215
|
this.file = file;
|
|
216
|
-
if (file.size >
|
|
216
|
+
if (file.size > MAX_WARNING) {
|
|
217
217
|
this.bigFileWarning();
|
|
218
218
|
}
|
|
219
219
|
return this.onExceedSize(file.size);
|
|
@@ -234,8 +234,8 @@ export default {
|
|
|
234
234
|
const formData = new FormData();
|
|
235
235
|
const _file = file.file;
|
|
236
236
|
formData.append("file", _file);
|
|
237
|
-
this.$emit("on-uploading");
|
|
238
237
|
this.isUploading = true;
|
|
238
|
+
this.$emit("on-uploaded", false);
|
|
239
239
|
axios({
|
|
240
240
|
method: "post",
|
|
241
241
|
url: this.$XN.uploadUrl || "",
|
|
@@ -256,16 +256,16 @@ export default {
|
|
|
256
256
|
file.onSuccess();
|
|
257
257
|
this.$emit("update:fileList", this.successFiles);
|
|
258
258
|
this.$emit("on-success", this.successFiles);
|
|
259
|
-
this.$emit("on-uploaded");
|
|
259
|
+
this.$emit("on-uploaded", true);
|
|
260
260
|
this.isUploading = false;
|
|
261
|
-
if (this.file.size >
|
|
262
|
-
this.$notify.closeAll()
|
|
261
|
+
if (this.file.size > MAX_WARNING) {
|
|
262
|
+
this.$notify.closeAll();
|
|
263
263
|
this.bigFileSucces();
|
|
264
264
|
}
|
|
265
265
|
})
|
|
266
266
|
.catch((err) => {
|
|
267
267
|
console.log(err);
|
|
268
|
-
this.$notify.closeAll()
|
|
268
|
+
this.$notify.closeAll();
|
|
269
269
|
this.$emit("update:fileList", this.successFiles);
|
|
270
270
|
file.onError();
|
|
271
271
|
});
|
|
@@ -333,7 +333,7 @@ export default {
|
|
|
333
333
|
duration: 0,
|
|
334
334
|
dangerouslyUseHTMLString: true,
|
|
335
335
|
message: `
|
|
336
|
-
<p class="text-primary"
|
|
336
|
+
<p class="text-primary">当前文件体积过大,请您耐心等待,在此期间请勿刷新页面。</p>
|
|
337
337
|
<p>名称:${this.file.name}</p>
|
|
338
338
|
<p>体积:${this.fileSize}</p>
|
|
339
339
|
`,
|