mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 22:20:27 +08:00
Merge branch 'master' of https://e.coding.net/shancool/cool-admin/front-next
This commit is contained in:
commit
7ec24c7702
@ -34,7 +34,7 @@
|
|||||||
:on-preview="_onPreview"
|
:on-preview="_onPreview"
|
||||||
:on-progress="onProgress"
|
:on-progress="onProgress"
|
||||||
:on-change="onChange"
|
:on-change="onChange"
|
||||||
:on-exceed="onExceed"
|
:on-exceed="_onExceed"
|
||||||
:before-upload="_beforeUpload"
|
:before-upload="_beforeUpload"
|
||||||
:before-remove="beforeRemove"
|
:before-remove="beforeRemove"
|
||||||
:style="_style"
|
:style="_style"
|
||||||
@ -110,7 +110,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { cloneDeep, last, isArray, isNumber, isBoolean } from "cl-admin/utils";
|
import { cloneDeep, last, isArray, isNumber, isBoolean, isEmpty } from "cl-admin/utils";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -222,7 +222,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_text() {
|
_text() {
|
||||||
return this.text || this.conf.text || "选择文件";
|
return isEmpty(this.text) ? this.conf.text : this.text;
|
||||||
},
|
},
|
||||||
|
|
||||||
_accept() {
|
_accept() {
|
||||||
@ -407,6 +407,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 超出个数限制提示
|
||||||
|
_onExceed(file, fileList) {
|
||||||
|
if (this.onExceed) {
|
||||||
|
this.onExceed(file, fileList);
|
||||||
|
} else {
|
||||||
|
this.$message.warning(`当前限制选择 ${this.limit} 个文件`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 上传前
|
// 上传前
|
||||||
_beforeUpload(file) {
|
_beforeUpload(file) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@ -505,9 +514,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$service.common
|
this.$service.common
|
||||||
.upload()
|
.upload()
|
||||||
.then(res => {
|
.then(next)
|
||||||
next(res);
|
|
||||||
})
|
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user