fix(接口测试): 修复当接口处于编辑状态时,列表点复制就会进入编辑页面的缺陷
--bug=1010559 --user=王孝刚 【接口测试】github#10887,当接口处于编辑状态时,列表点复制就会进入编辑页面 https://www.tapd.cn/55049933/s/1108640
This commit is contained in:
parent
581926eb90
commit
0a2aa4bada
|
@ -129,6 +129,7 @@
|
||||||
@refreshTree="refreshTree"
|
@refreshTree="refreshTree"
|
||||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||||
@editApi="editApi"
|
@editApi="editApi"
|
||||||
|
@copyApi="copyApi"
|
||||||
@handleCase="handleCase"
|
@handleCase="handleCase"
|
||||||
@showExecResult="showExecResult"
|
@showExecResult="showExecResult"
|
||||||
@refreshTable="refresh"
|
@refreshTable="refresh"
|
||||||
|
@ -699,8 +700,8 @@ export default {
|
||||||
if (!index) {
|
if (!index) {
|
||||||
let name = "";
|
let name = "";
|
||||||
if (row.isCopy) {
|
if (row.isCopy) {
|
||||||
name = "copy" + "-" + row.name;
|
name = "copy" + "_" + row.name;
|
||||||
row.name = "copy" + "-" + row.name;
|
row.name = "copy" + "_" + row.name;
|
||||||
} else {
|
} else {
|
||||||
if (row.name) {
|
if (row.name) {
|
||||||
name = this.$t('api_test.definition.request.edit_api') + "-" + row.name;
|
name = this.$t('api_test.definition.request.edit_api') + "-" + row.name;
|
||||||
|
@ -720,6 +721,21 @@ export default {
|
||||||
this.apiDefaultTab = index.name;
|
this.apiDefaultTab = index.name;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
copyApi(row) {
|
||||||
|
let name = "";
|
||||||
|
if (row.isCopy) {
|
||||||
|
name = "copy" + "_" + row.name;
|
||||||
|
row.name = "copy" + "_" + row.name;
|
||||||
|
}
|
||||||
|
this.activeTab = "api";
|
||||||
|
if (row != null && row.tags != 'null' && row.tags != '' && row.tags != undefined) {
|
||||||
|
if (Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object'
|
||||||
|
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||||
|
row.tags = JSON.parse(row.tags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.handleTabsEdit(name, "ADD", row);
|
||||||
|
},
|
||||||
handleCase(api) {
|
handleCase(api) {
|
||||||
this.currentApi = api;
|
this.currentApi = api;
|
||||||
this.showCasePage = false;
|
this.showCasePage = false;
|
||||||
|
|
|
@ -680,7 +680,7 @@ export default {
|
||||||
handleCopy(row) {
|
handleCopy(row) {
|
||||||
let obj = JSON.parse(JSON.stringify(row));
|
let obj = JSON.parse(JSON.stringify(row));
|
||||||
obj.isCopy = true;
|
obj.isCopy = true;
|
||||||
this.$emit('editApi', obj);
|
this.$emit('copyApi', obj);
|
||||||
},
|
},
|
||||||
runApi(row) {
|
runApi(row) {
|
||||||
let request = row ? JSON.parse(row.request) : {};
|
let request = row ? JSON.parse(row.request) : {};
|
||||||
|
|
Loading…
Reference in New Issue