fix(场景自动化): 修复场景描述不能编辑问题,修复CSV 预览问题

This commit is contained in:
fit2-zhao 2021-01-22 12:55:07 +08:00
parent b01c6930cb
commit 1157a1c422
2 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,6 @@
package io.metersphere.api.dto.automation; package io.metersphere.api.dto.automation;
import io.metersphere.base.domain.ApiScenario; import io.metersphere.base.domain.ApiScenarioWithBLOBs;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -8,7 +8,7 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
public class ApiScenarioDTO extends ApiScenario { public class ApiScenarioDTO extends ApiScenarioWithBLOBs {
private String projectName; private String projectName;
private String userName; private String userName;

View File

@ -84,6 +84,7 @@
editFlag: false, editFlag: false,
previewData: [], previewData: [],
columns: [], columns: [],
allDatas: [],
rule: { rule: {
name: [ name: [
{required: true, message: this.$t('api_test.variable_name'), trigger: 'blur'}, {required: true, message: this.$t('api_test.variable_name'), trigger: 'blur'},
@ -97,14 +98,20 @@
this.$error(results.errors); this.$error(results.errors);
return; return;
} }
if (results.data) { if (this.allDatas) {
this.columns = results.data[0]; this.columns = this.allDatas[0];
this.previewData = results.data; this.allDatas.splice(0, 1);
this.previewData = this.allDatas;
} }
this.loading = false; this.loading = false;
}, },
step(results, parser) {
this.allDatas.push(results.data);
},
handleClick() { handleClick() {
let config = {complete: this.complete}; let config = {complete: this.complete, step: this.step};
this.allDatas = [];
// //
if (this.editData.files && this.editData.files.length > 0 && this.editData.files[0].file) { if (this.editData.files && this.editData.files.length > 0 && this.editData.files[0].file) {
this.loading = true; this.loading = true;