Skip to content

Commit

Permalink
misc: fix validate issue in klupload
Browse files Browse the repository at this point in the history
  • Loading branch information
hzwanghong committed Aug 2, 2017
1 parent e8efef3 commit 5b9f371
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/js/components/form/KLUpload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ const KLUpload = Component.extend({
const data = this.data;
const result = { success: true, message: '' };

if (data.fileList.length < data.numMin) {
function deletedFilter(file) {
return file.flag !== Config.flagMap.DELETED;
}

const filteredFileList = data.fileList.filter(deletedFilter);

if (filteredFileList.length < data.numMin) {
result.success = false;
result.message = this.$trans('PLEASE_UPLOAD_ATLEAST') + data.numMin + this.$trans('UNIT') + this.$trans('FILE');
this.data.state = 'error';
Expand Down

0 comments on commit 5b9f371

Please sign in to comment.