refactor(接口定义): 优化批量生成依赖关系数据量大时的友好提示
--bug=1014704 --user=王孝刚 【接口测试】github#15559,接口自动化批量生成依赖关系图时,当选择所有数据时,生成失败并报错 https://www.tapd.cn/55049933/s/1201691
This commit is contained in:
parent
6aab3c9883
commit
ec618b68db
|
@ -326,7 +326,8 @@ import {
|
||||||
buildBatchParam,
|
buildBatchParam,
|
||||||
getCustomTableHeader,
|
getCustomTableHeader,
|
||||||
getCustomTableWidth,
|
getCustomTableWidth,
|
||||||
getLastTableSortField
|
getLastTableSortField,
|
||||||
|
getSelectDataCounts
|
||||||
} from "@/common/js/tableUtils";
|
} from "@/common/js/tableUtils";
|
||||||
import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
|
import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
|
||||||
import MsTable from "@/business/components/common/components/table/MsTable";
|
import MsTable from "@/business/components/common/components/table/MsTable";
|
||||||
|
@ -688,6 +689,10 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
generateGraph() {
|
generateGraph() {
|
||||||
|
if (getSelectDataCounts(this.condition, this.total, this.selectRows) > 100) {
|
||||||
|
this.$warning(this.$t('test_track.case.generate_dependencies_warning'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
getGraphByCondition('API_SCENARIO', buildBatchParam(this, this.$refs.scenarioTable.selectIds), (data) => {
|
getGraphByCondition('API_SCENARIO', buildBatchParam(this, this.$refs.scenarioTable.selectIds), (data) => {
|
||||||
this.graphData = data;
|
this.graphData = data;
|
||||||
this.$refs.relationshipGraph.open();
|
this.$refs.relationshipGraph.open();
|
||||||
|
|
|
@ -249,6 +249,7 @@ import {
|
||||||
getCustomTableHeader,
|
getCustomTableHeader,
|
||||||
getCustomTableWidth,
|
getCustomTableWidth,
|
||||||
getLastTableSortField,
|
getLastTableSortField,
|
||||||
|
getSelectDataCounts,
|
||||||
initCondition
|
initCondition
|
||||||
} from "@/common/js/tableUtils";
|
} from "@/common/js/tableUtils";
|
||||||
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
|
||||||
|
@ -581,6 +582,10 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
generateGraph() {
|
generateGraph() {
|
||||||
|
if (getSelectDataCounts(this.condition, this.total, this.selectRows) > 100) {
|
||||||
|
this.$warning(this.$t('test_track.case.generate_dependencies_warning'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
getGraphByCondition('API', buildBatchParam(this, this.$refs.table.selectIds), (data) => {
|
getGraphByCondition('API', buildBatchParam(this, this.$refs.table.selectIds), (data) => {
|
||||||
this.graphData = data;
|
this.graphData = data;
|
||||||
this.$refs.relationshipGraph.open();
|
this.$refs.relationshipGraph.open();
|
||||||
|
|
|
@ -238,12 +238,14 @@ import ApiStatus from "@/business/components/api/definition/components/list/ApiS
|
||||||
import {
|
import {
|
||||||
buildBatchParam,
|
buildBatchParam,
|
||||||
deepClone,
|
deepClone,
|
||||||
getCustomFieldBatchEditOption, getCustomFieldFilter,
|
getCustomFieldBatchEditOption,
|
||||||
|
getCustomFieldFilter,
|
||||||
getCustomFieldValue,
|
getCustomFieldValue,
|
||||||
getCustomTableHeader,
|
getCustomTableHeader,
|
||||||
getCustomTableWidth,
|
getCustomTableWidth,
|
||||||
getLastTableSortField,
|
getLastTableSortField,
|
||||||
getPageInfo,
|
getPageInfo,
|
||||||
|
getSelectDataCounts,
|
||||||
getTableHeaderWithCustomFields,
|
getTableHeaderWithCustomFields,
|
||||||
initCondition,
|
initCondition,
|
||||||
parseCustomFilesForList,
|
parseCustomFilesForList,
|
||||||
|
@ -967,6 +969,10 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
generateGraph() {
|
generateGraph() {
|
||||||
|
if (getSelectDataCounts(this.condition, this.total, this.selectRows) > 100) {
|
||||||
|
this.$warning(this.$t('test_track.case.generate_dependencies_warning'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
getGraphByCondition('TEST_CASE', buildBatchParam(this, this.$refs.table.selectIds), (data) => {
|
getGraphByCondition('TEST_CASE', buildBatchParam(this, this.$refs.table.selectIds), (data) => {
|
||||||
this.graphData = data;
|
this.graphData = data;
|
||||||
this.$refs.relationshipGraph.open();
|
this.$refs.relationshipGraph.open();
|
||||||
|
|
|
@ -2133,6 +2133,7 @@ export default {
|
||||||
batch_add_public: 'Batch add public',
|
batch_add_public: 'Batch add public',
|
||||||
public_warning: 'The public library configuration is not enabled',
|
public_warning: 'The public library configuration is not enabled',
|
||||||
generate_dependencies: 'Generate dependencies',
|
generate_dependencies: 'Generate dependencies',
|
||||||
|
generate_dependencies_warning: 'For a better experience, it is recommended to check the data below 100',
|
||||||
batch_delete_case: 'Batch delete',
|
batch_delete_case: 'Batch delete',
|
||||||
batch_unlink: 'Batch Unlink',
|
batch_unlink: 'Batch Unlink',
|
||||||
unlink: 'Unlink',
|
unlink: 'Unlink',
|
||||||
|
|
|
@ -2133,6 +2133,7 @@ export default {
|
||||||
batch_add_public: '批量添加到公共用例库',
|
batch_add_public: '批量添加到公共用例库',
|
||||||
public_warning: '未开启公共库用例配置',
|
public_warning: '未开启公共库用例配置',
|
||||||
generate_dependencies: '生成依赖关系',
|
generate_dependencies: '生成依赖关系',
|
||||||
|
generate_dependencies_warning: '为了更好的体验,建议勾选一百条以下的数据',
|
||||||
batch_unlink: '批量取消关联',
|
batch_unlink: '批量取消关联',
|
||||||
unlink: '取消关联',
|
unlink: '取消关联',
|
||||||
project_name: '所属项目',
|
project_name: '所属项目',
|
||||||
|
|
|
@ -2128,6 +2128,7 @@ export default {
|
||||||
batch_add_public: '批量添加到公共用例庫',
|
batch_add_public: '批量添加到公共用例庫',
|
||||||
public_warning: '未開啟公共庫用例配置',
|
public_warning: '未開啟公共庫用例配置',
|
||||||
generate_dependencies: '生成依賴關系',
|
generate_dependencies: '生成依賴關系',
|
||||||
|
generate_dependencies_warning: '為了更好的體驗,建議勾選一百條以下的數據',
|
||||||
batch_unlink: '批量取消關聯',
|
batch_unlink: '批量取消關聯',
|
||||||
unlink: '取消關聯',
|
unlink: '取消關聯',
|
||||||
project_name: '所屬項目',
|
project_name: '所屬項目',
|
||||||
|
|
Loading…
Reference in New Issue