diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
index 5a0f44d6f4..255f24c0de 100644
--- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
+++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
@@ -283,12 +283,14 @@
:dialog-title="$t('test_track.case.batch_edit_case')"/>
-
-
+
+
@@ -314,6 +316,7 @@ import axios from "axios";
import {getGraphByCondition} from "@/network/graph";
import MsTableSearchBar from "@/business/components/common/components/MsTableSearchBar";
import MsTableAdvSearchBar from "@/business/components/common/components/search/MsTableAdvSearchBar";
+import ApiDeleteConfirm from "@/business/components/api/definition/components/list/ApiDeleteConfirm";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {};
@@ -321,6 +324,7 @@ const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComp
export default {
name: "MsApiScenarioList",
components: {
+ ApiDeleteConfirm,
MsTableAdvSearchBar,
MsTableSearchBar,
MsTable,
@@ -1126,30 +1130,42 @@ export default {
param.ids = [row.id];
this.$post('/api/automation/checkBeforeDelete/', param, response => {
let checkResult = response.data;
- let alertMsg = this.$t('load_test.delete_threadgroup_confirm') + " ?";
+ let alertMsg = this.$t('load_test.delete_threadgroup_confirm');
if (!checkResult.deleteFlag) {
alertMsg = "";
checkResult.checkMsg.forEach(item => {
alertMsg += item;
});
if (alertMsg === "") {
- alertMsg = this.$t('load_test.delete_threadgroup_confirm') + " ?";
+ alertMsg = this.$t('load_test.delete_threadgroup_confirm');
} else {
- alertMsg += this.$t('api_test.is_continue') + " ?";
+ alertMsg += this.$t('api_test.is_continue');
}
}
- this.$alert(alertMsg, '', {
- confirmButtonText: this.$t('commons.confirm'),
- cancelButtonText: this.$t('commons.cancel'),
- callback: (action) => {
- if (action === 'confirm') {
- this.$post('/api/automation/removeToGcByBatch/', param, () => {
- this.$success(this.$t('commons.delete_success'));
- this.search();
- });
- }
- }
- });
+ //
+ // 删除提供列表删除和全部版本删除
+ this.$refs.apiDeleteConfirm.open(row, alertMsg);
+ });
+ }
+ },
+ _handleDelete(api, deleteCurrentVersion) {
+ // 删除指定版本
+ if (deleteCurrentVersion) {
+ this.$get('/api/automation/delete/' + api.versionId + '/' + api.refId, () => {
+ this.$success(this.$t('commons.delete_success'));
+ this.$refs.apiDeleteConfirm.close();
+ this.search();
+ });
+ }
+ // 删除全部版本
+ else {
+ let param = {};
+ this.buildBatchParam(param);
+ param.ids = [api.id];
+ this.$post('/api/automation/removeToGcByBatch/', param, () => {
+ this.$success(this.$t('commons.delete_success'));
+ this.$refs.apiDeleteConfirm.close();
+ this.search();
});
}
},
diff --git a/frontend/src/business/components/api/definition/components/list/ApiDeleteConfirm.vue b/frontend/src/business/components/api/definition/components/list/ApiDeleteConfirm.vue
new file mode 100644
index 0000000000..57073d5739
--- /dev/null
+++ b/frontend/src/business/components/api/definition/components/list/ApiDeleteConfirm.vue
@@ -0,0 +1,55 @@
+
+
+
+ {{ $t('commons.delete_current_version') }}
+ {{ $t('commons.delete_all_version') }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue
index 4e98645846..ba648d0af5 100644
--- a/frontend/src/business/components/api/definition/components/list/ApiList.vue
+++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue
@@ -206,7 +206,8 @@
-
+
+
@@ -246,6 +247,7 @@ import {Body} from "@/business/components/api/definition/model/ApiTestModel";
import {editApiDefinitionOrder} from "@/network/api";
import {getProtocolFilter} from "@/business/components/api/definition/api-definition";
import {getGraphByCondition} from "@/network/graph";
+import ApiDeleteConfirm from "@/business/components/api/definition/components/list/ApiDeleteConfirm";
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComponent("./graph/RelationshipGraphDrawer.vue") : {};
@@ -254,6 +256,7 @@ const relationshipGraphDrawer = requireComponent.keys().length > 0 ? requireComp
export default {
name: "ApiList",
components: {
+ ApiDeleteConfirm,
HeaderLabelOperate,
CaseBatchMove,
ApiStatus,
@@ -812,20 +815,29 @@ export default {
});
return;
}
- this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + api.name + " ?", '', {
- confirmButtonText: this.$t('commons.confirm'),
- callback: (action) => {
- if (action === 'confirm') {
- let ids = [api.id];
- this.$post('/api/definition/removeToGc/', ids, () => {
- this.$success(this.$t('commons.delete_success'));
- // this.initTable();
- this.$emit("refreshTable");
- this.$refs.caseList.apiCaseClose();
- });
- }
- }
- });
+ // 删除提供列表删除和全部版本删除
+ this.$refs.apiDeleteConfirm.open(api, this.$t('api_test.definition.request.delete_confirm'));
+ },
+ _handleDelete(api, deleteCurrentVersion) {
+ // 删除指定版本
+ if (deleteCurrentVersion) {
+ this.$get('/api/definition/delete/' + api.versionId + '/' + api.refId, () => {
+ this.$success(this.$t('commons.delete_success'));
+ this.$refs.apiDeleteConfirm.close();
+ this.$emit("refreshTable");
+ });
+ }
+ // 删除全部版本
+ else {
+ let ids = [api.id];
+ this.$post('/api/definition/removeToGc/', ids, () => {
+ this.$success(this.$t('commons.delete_success'));
+ // this.initTable();
+ this.$refs.apiDeleteConfirm.close();
+ this.$emit("refreshTable");
+ this.$refs.caseList.apiCaseClose();
+ });
+ }
},
getColor(enable, method) {
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js
index b4474bef6f..4dd9145a6b 100644
--- a/frontend/src/i18n/en-US.js
+++ b/frontend/src/i18n/en-US.js
@@ -423,6 +423,8 @@ export default {
form_config: "Form config",
form_content: "Form content",
sync_other_info: "Sync other config",
+ delete_current_version: 'Current version',
+ delete_all_version: 'All versions',
},
login: {
normal_Login: "Normal Login",
diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js
index 3e1e9809aa..411d11cb91 100644
--- a/frontend/src/i18n/zh-CN.js
+++ b/frontend/src/i18n/zh-CN.js
@@ -425,6 +425,8 @@ export default {
form_config: "表单配置",
form_content: "表单内容",
sync_other_info: "同步以下信息到新版本",
+ delete_current_version: '列表版本',
+ delete_all_version: '全部版本',
},
login: {
normal_Login: "普通登录",
diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js
index 1a00f6de52..6f397d55d4 100644
--- a/frontend/src/i18n/zh-TW.js
+++ b/frontend/src/i18n/zh-TW.js
@@ -425,6 +425,8 @@ export default {
form_config: "表單配置",
form_content: "表單內容",
sync_other_info: "同步以下信息到新版本",
+ delete_current_version: '列表版本',
+ delete_all_version: '全部版本',
},
login: {
normal_Login: "普通登錄",