fix(接口定义): 修复case添加后置脚本,多次保存,内容还是上一次的缺陷
--bug=1022091 --user=王孝刚 【接口测试】github#21425,接口定义case,后置操作添加脚本,修改信息后仍是以前的结果 https://www.tapd.cn/55049933/s/1329383
This commit is contained in:
parent
a2a2bd0571
commit
b04b7703b8
|
@ -436,7 +436,9 @@ export default {
|
||||||
close() {
|
close() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.form.cronValue = '';
|
this.form.cronValue = '';
|
||||||
this.$refs['from'].resetFields();
|
if (this.$refs['from']) {
|
||||||
|
this.$refs['from'].resetFields();
|
||||||
|
}
|
||||||
if (!this.schedule.value) {
|
if (!this.schedule.value) {
|
||||||
this.$refs.crontabResult.resultList = [];
|
this.$refs.crontabResult.resultList = [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,6 +281,7 @@ import { TYPE_TO_C } from '@/business/automation/scenario/Setting';
|
||||||
import ApiCaseHeader from './ApiCaseHeader';
|
import ApiCaseHeader from './ApiCaseHeader';
|
||||||
import { deepClone } from 'metersphere-frontend/src/utils/tableUtils';
|
import { deepClone } from 'metersphere-frontend/src/utils/tableUtils';
|
||||||
import { useApiStore } from '@/store';
|
import { useApiStore } from '@/store';
|
||||||
|
import {TokenKey} from "metersphere-frontend/src/utils/constants";
|
||||||
|
|
||||||
const store = useApiStore();
|
const store = useApiStore();
|
||||||
export default {
|
export default {
|
||||||
|
@ -700,6 +701,8 @@ export default {
|
||||||
row.createTime = data.createTime;
|
row.createTime = data.createTime;
|
||||||
row.updateTime = data.updateTime;
|
row.updateTime = data.updateTime;
|
||||||
this.compare = [];
|
this.compare = [];
|
||||||
|
let user = JSON.parse(localStorage.getItem(TokenKey));
|
||||||
|
row.updateUser = user.name;
|
||||||
row.type = null;
|
row.type = null;
|
||||||
this.$success(this.$t('commons.save_success'));
|
this.$success(this.$t('commons.save_success'));
|
||||||
this.tagCount = 0;
|
this.tagCount = 0;
|
||||||
|
@ -713,7 +716,6 @@ export default {
|
||||||
if (!hideAlert) {
|
if (!hideAlert) {
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
}
|
}
|
||||||
this.$emit('refreshCaseList',row.id);
|
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
this.isSave = false;
|
this.isSave = false;
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
<api-case-item
|
<api-case-item
|
||||||
:loading="(singleLoading && singleRunId === item.id) || batchLoadingIds.indexOf(item.id) > -1"
|
:loading="(singleLoading && singleRunId === item.id) || batchLoadingIds.indexOf(item.id) > -1"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
@refreshCaseList="refreshCaseList"
|
|
||||||
@singleRun="singleRun"
|
@singleRun="singleRun"
|
||||||
@stop="stop"
|
@stop="stop"
|
||||||
@refreshModule="refreshModule"
|
@refreshModule="refreshModule"
|
||||||
|
@ -442,21 +441,6 @@ export default {
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$emit('refresh');
|
this.$emit('refresh');
|
||||||
},
|
},
|
||||||
refreshCaseList(id) {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
let commonUseEnvironment = store.useEnvironment;
|
|
||||||
this.environment = commonUseEnvironment ? commonUseEnvironment : '';
|
|
||||||
getCaseById(id).then((response) => {
|
|
||||||
let apiCase = response.data;
|
|
||||||
if (apiCase) {
|
|
||||||
this.formatCase(apiCase);
|
|
||||||
apiCase.active = true;
|
|
||||||
this.apiCaseList = [apiCase];
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
reLoadCase() {
|
reLoadCase() {
|
||||||
this.$emit('reLoadCase');
|
this.$emit('reLoadCase');
|
||||||
},
|
},
|
||||||
|
|
|
@ -463,7 +463,9 @@ export default {
|
||||||
setParameter() {
|
setParameter() {
|
||||||
this.request.path = this.httpForm.path;
|
this.request.path = this.httpForm.path;
|
||||||
this.request.method = this.httpForm.method;
|
this.request.method = this.httpForm.method;
|
||||||
this.httpForm.request.useEnvironment = undefined;
|
if (this.httpForm && this.httpForm.request) {
|
||||||
|
this.httpForm.request.useEnvironment = undefined;
|
||||||
|
}
|
||||||
if (this.httpForm.tags instanceof Array) {
|
if (this.httpForm.tags instanceof Array) {
|
||||||
this.httpForm.tags = JSON.stringify(this.httpForm.tags);
|
this.httpForm.tags = JSON.stringify(this.httpForm.tags);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue