Browse Source

fix-bugs

tags/v1.22.11.2^2
chenshihai 3 years ago
parent
commit
85cd770442
3 changed files with 11 additions and 2 deletions
  1. +1
    -0
      web_src/vuepages/langs/config/en-US.js
  2. +1
    -0
      web_src/vuepages/langs/config/zh-CN.js
  3. +9
    -2
      web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-2.vue

+ 1
- 0
web_src/vuepages/langs/config/en-US.js View File

@@ -221,6 +221,7 @@ const en = {
uploadStatus: 'Upload status', uploadStatus: 'Upload status',
modelFileUploadDefaultTips: 'Click to add files or drag files here directly', modelFileUploadDefaultTips: 'Click to add files or drag files here directly',
modelFileUploadErrTips: 'Up to 10 files can be uploaded at a time, and the total file size of the model does not exceed {size}GB', modelFileUploadErrTips: 'Up to 10 files can be uploaded at a time, and the total file size of the model does not exceed {size}GB',
modelFileNameTips: 'The file name should not exceed 128 characters',
fileIstoBig: 'File is to big', fileIstoBig: 'File is to big',
removeFile: 'Rmove file', removeFile: 'Rmove file',
uploadSuccess: 'upload success', uploadSuccess: 'upload success',


+ 1
- 0
web_src/vuepages/langs/config/zh-CN.js View File

@@ -221,6 +221,7 @@ const zh = {
uploadStatus: '上传状态', uploadStatus: '上传状态',
modelFileUploadDefaultTips: '点击添加文件或直接拖拽文件到此处', modelFileUploadDefaultTips: '点击添加文件或直接拖拽文件到此处',
modelFileUploadErrTips: '单次最多上传10个文件,模型总文件大小不超过{size}G', modelFileUploadErrTips: '单次最多上传10个文件,模型总文件大小不超过{size}G',
modelFileNameTips: '文件名长度不超过128字符',
fileIstoBig: '文件太大', fileIstoBig: '文件太大',
removeFile: '移除文件', removeFile: '移除文件',
uploadSuccess: '上传成功', uploadSuccess: '上传成功',


+ 9
- 2
web_src/vuepages/pages/modelmanage/local/modelmanage-local-create-2.vue View File

@@ -198,6 +198,11 @@ export default {
this.showUploadErrInfo(true, this.getDefaultErrTxt()); this.showUploadErrInfo(true, this.getDefaultErrTxt());
return false; return false;
} }
if (file && file.name.length > 128) {
this.showUploadErrInfo(true, this.$t('modelManage.modelFileNameTips'));
this.uploadError(file, this.$t('modelManage.modelFileNameTips'));
return false;
}
this.showUploadErrInfo(false); this.showUploadErrInfo(false);
return true; return true;
}, },
@@ -466,7 +471,7 @@ export default {
}, },
uploadFinishCheck(file) { uploadFinishCheck(file) {
console.log('uploadFinishCheck', file, this.uploadLength, '/', this.uploadFiles.length); console.log('uploadFinishCheck', file, this.uploadLength, '/', this.uploadFiles.length);
if (this.uploadLength === this.uploadFiles.length) {
if (this.uploadLength === this.uploadFiles.length && this.uploadFiles.length != 0) {
console.log('All file has finish, success ' + this.uploadSuccessLength); console.log('All file has finish, success ' + this.uploadSuccessLength);
this.uploading = false; this.uploading = false;
if (this.uploadSuccessLength == this.uploadLength) { if (this.uploadSuccessLength == this.uploadLength) {
@@ -483,7 +488,9 @@ export default {
submit() { submit() {
const fileList = this.dropzoneHandler.getAcceptedFiles(); const fileList = this.dropzoneHandler.getAcceptedFiles();
if (!fileList.length) return; if (!fileList.length) return;
if (!this.checkFiles()) return;
for (let i = 0, iLen = fileList.length; i < iLen; i++) {
if (!this.checkFiles(fileList[i])) return;
}
this.resetFileStatus(); this.resetFileStatus();
this.uploadFiles = fileList; this.uploadFiles = fileList;
this.uploading = true; this.uploading = true;


Loading…
Cancel
Save