fix: 导入文件上传样式与提示

This commit is contained in:
chenjianxing 2020-07-20 18:37:53 +08:00
parent 2860b91508
commit 98a04271cb
1 changed files with 16 additions and 8 deletions

View File

@ -47,8 +47,8 @@
<el-divider direction="vertical"/>
</el-col>
<el-col :span="12">
<el-form-item prop="file" class="api-upload">
<el-upload
class="api-upload"
drag
action=""
:http-request="upload"
@ -60,7 +60,6 @@
<div class="el-upload__text" v-html="$t('load_test.upload_tips')"></div>
<div class="el-upload__tip" slot="tip">{{$t('api_test.api_import.file_size_limit')}}</div>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -133,10 +132,7 @@
],
projectId: [
{required: true, message: this.$t('api_test.select_project'), trigger: 'blur'},
],
file: [
{required: true, message: this.$t('commons.please_upload'), trigger: 'blur'},
],
]
},
fileList: []
}
@ -208,6 +204,10 @@
Object.assign(param, this.formData);
param.platform = this.selectedPlatformValue;
param.useEnvironment = this.useEnvironment;
if (!param.file) {
this.$warning(this.$t('commons.please_upload'));
return ;
}
this.result = this.$fileUpload('/api/import', param.file, param,response => {
let res = response.data;
this.$success(this.$t('test_track.case.import.success'));
@ -240,7 +240,15 @@
.api-upload {
text-align: center;
display: inline-block;
margin: auto 0;
}
.api-upload >>> .el-upload {
width: 100%;
}
.api-upload >>> .el-upload-dragger {
width: 100%;
}
.el-radio-group {
@ -288,7 +296,7 @@
}
.name-input {
width: 195px;
max-width: 195px;
}
.dialog-footer {