refactor(测试跟踪): 删除功能二次提醒弹框信息优化

--bug=1015400 --user=陈建星 【所有模块】删除功能二次提醒弹框信息优化 https://www.tapd.cn/55049933/s/1214477
This commit is contained in:
chenjianxing 2022-07-28 14:20:19 +08:00 committed by f2c-ci-robot[bot]
parent f2b6332636
commit e07bd91c7a
29 changed files with 111 additions and 342 deletions

View File

@ -250,31 +250,6 @@ export default {
this.resourcePools = response.data; this.resourcePools = response.data;
}); });
}, },
scheduleChange() {
let flag = this.schedule.enable;
let param = {};
param.taskID = this.schedule.id;
param.enable = flag;
let that = this;
if (flag == false) {
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning',
beforeClose(action, instance, done) {
if (action == 'cancel') { // messageBox switch
that.schedule.enable = param.enable = true;
}
done(); // done messageBox
},
}).then(() => {
this.updateTask(param);
}).catch(() => {
});
} else {
this.updateTask(param);
}
},
updateTask(param) { updateTask(param) {
this.result = this.$post('/api/schedule/updateEnableByPrimyKey', param, response => { this.result = this.$post('/api/schedule/updateEnableByPrimyKey', param, response => {
let paramTestId = ""; let paramTestId = "";

View File

@ -10,8 +10,6 @@
width="60" width="60"
:label="$t('api_test.home_page.running_task_list.table_coloum.index')" :label="$t('api_test.home_page.running_task_list.table_coloum.index')"
show-overflow-tooltip/> show-overflow-tooltip/>
<!-- <el-table-column prop="SwaggerUrlId">-->
<!-- </el-table-column>-->
<el-table-column <el-table-column
prop="swaggerUrl" prop="swaggerUrl"
:label="$t('swaggerUrl')" :label="$t('swaggerUrl')"
@ -53,7 +51,7 @@
</template> </template>
<script> <script>
import {getCurrentProjectID} from "../../../../../../common/js/utils"; import {getCurrentProjectID, operationConfirm} from "../../../../../../common/js/utils";
export default { export default {
name: "SwaggerTaskList", name: "SwaggerTaskList",
@ -82,23 +80,11 @@ export default {
this.$emit('rowClick', row); this.$emit('rowClick', row);
}, },
closeTaskConfirm(row) { closeTaskConfirm(row) {
let flag = row.enable; row.enable = !row.enable
row.enable = !flag; operationConfirm(this, this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => {
if (row.enable) {
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
row.enable = !row.enable
this.updateTask(row);
}).catch(() => {
});
} else {
row.enable = !row.enable row.enable = !row.enable
this.updateTask(row); this.updateTask(row);
} });
}, },
updateTask(taskRow) { updateTask(taskRow) {
let schedule = { let schedule = {

View File

@ -156,8 +156,8 @@ import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag
import MsCodeEdit from "@/business/components/api/definition/components/MsCodeEdit"; import MsCodeEdit from "@/business/components/api/definition/components/MsCodeEdit";
import MsApiVariableAdvance from "@/business/components/api/test/components/ApiVariableAdvance"; import MsApiVariableAdvance from "@/business/components/api/test/components/ApiVariableAdvance";
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {Scenario} from "@/business/components/api/test/model/ScenarioModel";
import {REQUEST_HEADERS} from "@/common/js/constants"; import {REQUEST_HEADERS} from "@/common/js/constants";
import {operationConfirm} from "@/common/js/utils";
export default { export default {
@ -221,11 +221,7 @@ export default {
}, },
removeExpect(row) { removeExpect(row) {
this.$confirm(this.$t('api_test.mock.delete_mock_expect'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('api_test.mock.delete_mock_expect'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
let mockInfoId = row.mockConfigId; let mockInfoId = row.mockConfigId;
let selectUrl = "/mockConfig/deleteMockExpectConfig/" + row.id; let selectUrl = "/mockConfig/deleteMockExpectConfig/" + row.id;
this.$get(selectUrl, response => { this.$get(selectUrl, response => {
@ -236,9 +232,7 @@ export default {
message: this.$t('commons.delete_success'), message: this.$t('commons.delete_success'),
}); });
}); });
}).catch(() => {
}); });
}, },
saveMockExpectConfig() { saveMockExpectConfig() {
let mockConfigId = this.mockConfigData.mockConfig.id; let mockConfigId = this.mockConfigData.mockConfig.id;

View File

@ -81,7 +81,7 @@
<script> <script>
import {getCurrentProjectID, hasLicense} from "@/common/js/utils"; import {getCurrentProjectID, hasLicense, operationConfirm} from "@/common/js/utils";
import MockEditDrawer from "@/business/components/api/definition/components/mock/MockEditDrawer"; import MockEditDrawer from "@/business/components/api/definition/components/mock/MockEditDrawer";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
@ -327,11 +327,7 @@ export default {
}); });
}, },
removeExpect(row) { removeExpect(row) {
this.$confirm(this.$t('api_test.mock.delete_mock_expect'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('api_test.mock.delete_mock_expect'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
let mockInfoId = row.mockConfigId; let mockInfoId = row.mockConfigId;
let selectUrl = "/mockConfig/deleteMockExpectConfig/" + row.id; let selectUrl = "/mockConfig/deleteMockExpectConfig/" + row.id;
this.$get(selectUrl, response => { this.$get(selectUrl, response => {
@ -341,7 +337,6 @@ export default {
message: this.$t('commons.delete_success'), message: this.$t('commons.delete_success'),
}); });
}); });
}).catch(() => {
}); });
}, },
refreshMockInfo(mockConfigId) { refreshMockInfo(mockConfigId) {

View File

@ -125,7 +125,7 @@ import MsApiVariableAdvance from "@/business/components/api/test/components/ApiV
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {REQUEST_HEADERS} from "@/common/js/constants"; import {REQUEST_HEADERS} from "@/common/js/constants";
import TcpParams from "@/business/components/api/definition/components/request/tcp/TcpParams"; import TcpParams from "@/business/components/api/definition/components/request/tcp/TcpParams";
import {getCurrentProjectID} from "@/common/js/utils"; import {operationConfirm} from "@/common/js/utils";
export default { export default {
@ -225,11 +225,7 @@ export default {
}); });
}, },
removeExpect(row) { removeExpect(row) {
this.$confirm(this.$t('api_test.mock.delete_mock_expect'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('api_test.mock.delete_mock_expect'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
let mockInfoId = row.mockConfigId; let mockInfoId = row.mockConfigId;
let selectUrl = "/mockConfig/deleteMockExpectConfig/" + row.id; let selectUrl = "/mockConfig/deleteMockExpectConfig/" + row.id;
this.$get(selectUrl, response => { this.$get(selectUrl, response => {
@ -240,9 +236,7 @@ export default {
message: this.$t('commons.delete_success'), message: this.$t('commons.delete_success'),
}); });
}); });
}).catch(() => {
}); });
}, },
saveMockExpectConfig() { saveMockExpectConfig() {
let mockConfigId = this.mockConfigData.mockConfig.id; let mockConfigId = this.mockConfigData.mockConfig.id;

View File

@ -68,7 +68,7 @@
<script> <script>
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
@ -135,13 +135,8 @@ export default {
closeTaskConfirm(row) { closeTaskConfirm(row) {
let flag = row.taskStatus; let flag = row.taskStatus;
row.taskStatus = !flag; //switch row.taskStatus = !flag; //switch
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.updateTask(row); this.updateTask(row);
}).catch(() => {
}); });
}, },

View File

@ -66,7 +66,7 @@
<script> <script>
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
export default { export default {
@ -134,13 +134,8 @@ export default {
closeTaskConfirm(row){ closeTaskConfirm(row){
let flag = row.taskStatus; let flag = row.taskStatus;
row.taskStatus = !flag; //switch row.taskStatus = !flag; //switch
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.updateTask(row); this.updateTask(row);
}).catch(() => {
}); });
}, },

View File

@ -169,7 +169,7 @@ import MsReportTestOverview from './components/TestOverview';
import MsContainer from "../../common/components/MsContainer"; import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer"; import MsMainContainer from "../../common/components/MsMainContainer";
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {exportPdf, getCurrentProjectID, hasPermission} from "@/common/js/utils"; import {exportPdf, getCurrentProjectID, hasPermission, operationConfirm} from "@/common/js/utils";
import html2canvas from 'html2canvas'; import html2canvas from 'html2canvas';
import MsPerformanceReportExport from "./PerformanceReportExport"; import MsPerformanceReportExport from "./PerformanceReportExport";
import {Message} from "element-ui"; import {Message} from "element-ui";
@ -336,17 +336,12 @@ export default {
this.dialogFormVisible = false; this.dialogFormVisible = false;
}, },
rerun(testId) { rerun(testId) {
this.$confirm(this.$t('report.test_rerun_confirm'), '', { operationConfirm(this, this.$t('report.test_rerun_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, (response) => { this.result = this.$post('/performance/run', {id: testId, triggerMode: 'MANUAL'}, (response) => {
this.reportId = response.data; this.reportId = response.data;
this.$router.push({path: '/performance/report/view/' + this.reportId}); this.$router.push({path: '/performance/report/view/' + this.reportId});
this.clearData(); this.clearData();
}); });
}).catch(() => {
}); });
}, },
onOpen() { onOpen() {

View File

@ -102,7 +102,7 @@
<script> <script>
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter"; import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import {findThreadGroup} from "@/business/components/performance/test/model/ThreadGroup"; import {findThreadGroup} from "@/business/components/performance/test/model/ThreadGroup";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import axios from "axios"; import axios from "axios";
@ -330,17 +330,11 @@ export default {
this.currentRow = row; this.currentRow = row;
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('project.file_delete_tip', [row.name]), '', { operationConfirm(this, this.$t('project.file_delete_tip', [row.name]), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/project/delete/file/' + row.id, response => { this.$get('/project/delete/file/' + row.id, response => {
Message.success(this.$t('commons.delete_success')); Message.success(this.$t('commons.delete_success'));
this.getProjectFiles(); this.getProjectFiles();
}); });
}).catch(() => {
}); });
}, },
handleExceed() { handleExceed() {

View File

@ -83,7 +83,7 @@
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter"; import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton"; import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
import {Message} from "element-ui"; import {Message} from "element-ui";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
@ -197,17 +197,11 @@ export default {
this.currentRow = row; this.currentRow = row;
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('project.file_delete_tip', [row.name]), '', { operationConfirm(this, this.$t('project.file_delete_tip', [row.name]), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/project/delete/file/' + row.id, response => { this.$get('/project/delete/file/' + row.id, response => {
Message.success(this.$t('commons.delete_success')); Message.success(this.$t('commons.delete_success'));
this.getProjectFiles(); this.getProjectFiles();
}); });
}).catch(() => {
}); });
} }
} }

View File

@ -87,7 +87,7 @@ import {
getCurrentUser, getCurrentUser,
getCurrentUserId, getCurrentUserId,
getCurrentWorkspaceId, getCurrentWorkspaceId,
listenGoBack, listenGoBack, operationConfirm,
removeGoBackListener removeGoBackListener
} from "@/common/js/utils"; } from "@/common/js/utils";
@ -288,11 +288,7 @@ export default {
this.$refs.deleteConfirm.open(project); this.$refs.deleteConfirm.open(project);
}, },
_handleDelete(project) { _handleDelete(project) {
this.$confirm(this.$t('project.delete_tip'), '', { operationConfirm(this, this.$t('project.delete_tip'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/project/delete/' + project.id, () => { this.$get('/project/delete/' + project.id, () => {
if (project.id === getCurrentProjectID()) { if (project.id === getCurrentProjectID()) {
localStorage.removeItem(PROJECT_ID); localStorage.removeItem(PROJECT_ID);
@ -301,11 +297,6 @@ export default {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.list(); this.list();
}); });
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('commons.delete_cancelled')
});
}); });
}, },
handleClose() { handleClose() {

View File

@ -128,7 +128,7 @@ import EnvironmentEdit from "@/business/components/api/test/components/environme
import MsAsideItem from "@/business/components/common/components/MsAsideItem"; import MsAsideItem from "@/business/components/common/components/MsAsideItem";
import MsAsideContainer from "@/business/components/common/components/MsAsideContainer"; import MsAsideContainer from "@/business/components/common/components/MsAsideContainer";
import ProjectSwitch from "@/business/components/common/head/ProjectSwitch"; import ProjectSwitch from "@/business/components/common/head/ProjectSwitch";
import {downloadFile, getCurrentProjectID} from "@/common/js/utils"; import {downloadFile, getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import EnvironmentImport from "@/business/components/project/menu/EnvironmentImport"; import EnvironmentImport from "@/business/components/project/menu/EnvironmentImport";
import MsMainContainer from "@/business/components/common/components/MsMainContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer";
import MsContainer from "@/business/components/common/components/MsContainer"; import MsContainer from "@/business/components/common/components/MsContainer";
@ -295,18 +295,12 @@ export default {
}, },
deleteEnv(environment) { deleteEnv(environment) {
if (environment.id) { if (environment.id) {
this.$confirm(this.$t('commons.confirm_delete') + environment.name, { operationConfirm(this, this.$t('commons.confirm_delete') + environment.name, () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: "warning"
}).then(() => {
this.result = this.$get('/api/environment/delete/' + environment.id, () => { this.result = this.$get('/api/environment/delete/' + environment.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.list(); this.list();
}); });
}).catch(() => { });
this.$info(this.$t('commons.delete_cancelled'));
})
} }
}, },
getNoRepeatName(name) { getNoRepeatName(name) {

View File

@ -91,7 +91,7 @@ import MsTableHeaderSelectPopover from "@/business/components/common/components/
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn"; import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import EditMember from "@/business/components/project/menu/EditMember"; import EditMember from "@/business/components/project/menu/EditMember";
import {GROUP_PROJECT} from "@/common/js/constants"; import {GROUP_PROJECT} from "@/common/js/constants";
import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId, operationConfirm} from "@/common/js/utils";
import MsContainer from "@/business/components/common/components/MsContainer"; import MsContainer from "@/business/components/common/components/MsContainer";
import MsMainContainer from "@/business/components/common/components/MsMainContainer"; import MsMainContainer from "@/business/components/common/components/MsMainContainer";
@ -164,11 +164,7 @@ export default {
this.$set(this.form, 'groupIds', groupIds); this.$set(this.form, 'groupIds', groupIds);
}, },
del(row) { del(row) {
this.$confirm(this.$t('member.remove_member'), '', { operationConfirm(this, this.$t('member.remove_member'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
if (row.id === getCurrentUserId()) { if (row.id === getCurrentUserId()) {
this.$warning(this.$t('group.unable_to_remove_current_member')); this.$warning(this.$t('group.unable_to_remove_current_member'));
return; return;
@ -177,8 +173,6 @@ export default {
this.$success(this.$t('commons.remove_success')); this.$success(this.$t('commons.remove_success'));
this.initTableData(); this.initTableData();
}); });
}).catch(() => {
this.$info(this.$t('commons.remove_cancel'));
}); });
}, },
handleClose() { handleClose() {

View File

@ -81,7 +81,7 @@
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTableButton from "@/business/components/common/components/MsTableButton";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter"; import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton"; import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
import {Message} from "element-ui"; import {Message} from "element-ui";
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
@ -204,17 +204,11 @@ export default {
this.currentRow = row; this.currentRow = row;
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm(this.$t('project.file_delete_tip', [row.name]), '', { operationConfirm(this, this.$t('project.file_delete_tip', [row.name]), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/project/delete/file/' + row.id, response => { this.$get('/project/delete/file/' + row.id, response => {
Message.success(this.$t('commons.delete_success')); Message.success(this.$t('commons.delete_success'));
this.getProjectFiles(); this.getProjectFiles();
}); });
}).catch(() => {
}); });
} }
} }

View File

@ -71,7 +71,7 @@
<script> <script>
import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsDialogFooter from "../../common/components/MsDialogFooter";
import {getCurrentUser} from "@/common/js/utils"; import {getCurrentUser, operationConfirm} from "@/common/js/utils";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
@ -109,19 +109,12 @@ export default {
) )
}, },
deleteApiKey(row) { deleteApiKey(row) {
this.$confirm(this.$t('user.apikey_delete_confirm'), '', { operationConfirm(this, this.$t('user.apikey_delete_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get("/user/key/delete/" + row.id, response => { this.result = this.$get("/user/key/delete/" + row.id, response => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.search(); this.search();
}) })
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'));
}); });
}, },
createApiKey() { createApiKey() {

View File

@ -70,6 +70,7 @@ import MsTableOperatorButton from "../../common/components/MsTableOperatorButton
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsJarConfig from "./JarConfig"; import MsJarConfig from "./JarConfig";
import MsScriptView from "./ScriptView"; import MsScriptView from "./ScriptView";
import {operationConfirm} from "@/common/js/utils";
export default { export default {
name: "PluginConfig", name: "PluginConfig",
@ -128,20 +129,11 @@ export default {
this.$refs.scriptView.open(row.scriptId); this.$refs.scriptView.open(row.scriptId);
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm(this.$t('api_test.jar_config.delete_tip'), '', { operationConfirm(this, this.$t('api_test.jar_config.delete_tip'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get("/plugin/delete/" + id, () => { this.result = this.$get("/plugin/delete/" + id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.initPlugins(); this.initPlugins();
}); });
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('commons.delete_cancelled')
});
}); });
}, },
} }

View File

@ -161,7 +161,7 @@ import MsTableOperatorButton from "../../common/components/MsTableOperatorButton
import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsDialogFooter from "../../common/components/MsDialogFooter";
import { import {
getCurrentWorkspaceId, hasPermission, getCurrentWorkspaceId, hasPermission,
listenGoBack, listenGoBack, operationConfirm,
removeGoBackListener removeGoBackListener
} from "@/common/js/utils"; } from "@/common/js/utils";
import {GROUP_WORKSPACE} from "@/common/js/constants"; import {GROUP_WORKSPACE} from "@/common/js/constants";
@ -345,34 +345,19 @@ export default {
this.$refs.deleteConfirm.open(workspace); this.$refs.deleteConfirm.open(workspace);
}, },
_handleDelete(workspace) { _handleDelete(workspace) {
this.$confirm(this.$t('workspace.delete_confirm'), '', { operationConfirm(this, this.$t('workspace.delete_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/workspace/special/delete/' + workspace.id, () => { this.$get('/workspace/special/delete/' + workspace.id, () => {
Message.success(this.$t('commons.delete_success')); Message.success(this.$t('commons.delete_success'));
this.list(); this.list();
}); });
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('commons.delete_cancelled')
});
}); });
}, },
delMember(row) { delMember(row) {
this.$confirm(this.$t('member.remove_member'), '', { operationConfirm(this, this.$t('member.remove_member'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get('/user/special/ws/member/delete/' + this.currentWorkspaceRow.id + '/' + encodeURIComponent(row.id), () => { this.result = this.$get('/user/special/ws/member/delete/' + this.currentWorkspaceRow.id + '/' + encodeURIComponent(row.id), () => {
this.$success(this.$t('commons.remove_success')); this.$success(this.$t('commons.remove_success'));
this.cellClick(this.currentWorkspaceRow); this.cellClick(this.currentWorkspaceRow);
}); });
}).catch(() => {
this.$info(this.$t('commons.remove_cancel'));
}); });
}, },
updateWorkspaceMember(formName) { updateWorkspaceMember(formName) {

View File

@ -281,7 +281,7 @@ import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator"; import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsDialogFooter from "../../common/components/MsDialogFooter";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {listenGoBack, operationConfirm, removeGoBackListener} from "@/common/js/utils";
import BatchAddResource from "@/business/components/settings/system/components/BatchAddResource"; import BatchAddResource from "@/business/components/settings/system/components/BatchAddResource";
import {getYaml} from "@/business/components/settings/system/test-resource-pool"; import {getYaml} from "@/business/components/settings/system/test-resource-pool";
@ -465,17 +465,11 @@ export default {
this.infoList = resources; this.infoList = resources;
}, },
del(row) { del(row) {
this.$confirm(this.$t('test_resource_pool.delete_prompt'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('test_resource_pool.delete_prompt'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get(`/testresourcepool/delete/${row.id}`, () => { this.result = this.$get(`/testresourcepool/delete/${row.id}`, () => {
this.initTableData(); this.initTableData();
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
}); });
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'));
}); });
}, },
createTestResourcePool() { createTestResourcePool() {
@ -555,16 +549,11 @@ export default {
if (row.status === 'INVALID') { if (row.status === 'INVALID') {
this.checkHaveTestUsePool(row).then(() => { this.checkHaveTestUsePool(row).then(() => {
if (this.updatePool && this.updatePool.haveTestUsePool) { if (this.updatePool && this.updatePool.haveTestUsePool) {
this.$confirm(this.$t('test_resource_pool.update_prompt', [this.updatePool.testName]), this.$t('commons.prompt'), { operationConfirm(this, this.$t('test_resource_pool.update_prompt', [this.updatePool.testName]), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.updatePoolStatus(row); this.updatePoolStatus(row);
}).catch(() => { }, () => {
row.status = 'VALID'; row.status = 'VALID';
this.result.loading = false; this.result.loading = false;
this.$info(this.$t('commons.cancel'));
}); });
} else { } else {
this.updatePoolStatus(row); this.updatePoolStatus(row);

View File

@ -114,7 +114,13 @@ import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator"; import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter"; import MsDialogFooter from "../../common/components/MsDialogFooter";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import {getCurrentProjectID, getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils"; import {
getCurrentProjectID,
getCurrentUser,
listenGoBack,
operationConfirm,
removeGoBackListener
} from "@/common/js/utils";
import MsRolesTag from "../../common/components/MsRolesTag"; import MsRolesTag from "../../common/components/MsRolesTag";
import {PHONE_REGEX} from "@/common/js/regex"; import {PHONE_REGEX} from "@/common/js/regex";
import UserImport from "@/business/components/settings/system/components/UserImport"; import UserImport from "@/business/components/settings/system/components/UserImport";
@ -134,6 +140,7 @@ import GroupCascader from "@/business/components/settings/system/components/Grou
import {logout} from "@/network/user"; import {logout} from "@/network/user";
import WorkspaceCascader from "@/business/components/settings/system/components/WorkspaceCascader"; import WorkspaceCascader from "@/business/components/settings/system/components/WorkspaceCascader";
import BatchToProjectGroupCascader from "@/business/components/settings/system/components/BatchToProjectGroupCascader"; import BatchToProjectGroupCascader from "@/business/components/settings/system/components/BatchToProjectGroupCascader";
import {Message} from "element-ui";
export default { export default {
name: "MsUser", name: "MsUser",
@ -296,17 +303,11 @@ export default {
listenGoBack(this.handleClose); listenGoBack(this.handleClose);
}, },
del(row) { del(row) {
this.$confirm(this.$t('user.delete_confirm'), '', { operationConfirm(this, this.$t('user.delete_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get(this.deletePath + encodeURIComponent(row.id), () => { this.result = this.$get(this.deletePath + encodeURIComponent(row.id), () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.search(); this.search();
}); });
}).catch(() => {
this.$info(this.$t('commons.delete_cancel'));
}); });
}, },
createUser(createUserForm) { createUser(createUserForm) {

View File

@ -100,7 +100,7 @@ import MsTablePagination from "@/business/components/common/pagination/TablePagi
import {GROUP_PROJECT, GROUP_SYSTEM, GROUP_WORKSPACE} from "@/common/js/constants"; import {GROUP_PROJECT, GROUP_SYSTEM, GROUP_WORKSPACE} from "@/common/js/constants";
import MsTableOperator from "@/business/components/common/components/MsTableOperator"; import MsTableOperator from "@/business/components/common/components/MsTableOperator";
import UserOptionItem from "@/business/components/settings/common/UserOptionItem"; import UserOptionItem from "@/business/components/settings/common/UserOptionItem";
import {getCurrentProjectID, getCurrentUserId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentUserId, operationConfirm} from "@/common/js/utils";
export default { export default {
name: "GroupMember", name: "GroupMember",
@ -230,11 +230,7 @@ export default {
}); });
}, },
removeMember(row) { removeMember(row) {
this.$confirm(this.$t('member.remove_member').toString(), '', { operationConfirm(this, this.$t('member.remove_member'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
if (this.initUserUrl === 'user/ws/current/member/list') { if (this.initUserUrl === 'user/ws/current/member/list') {
if (row.id === getCurrentUserId()) { if (row.id === getCurrentUserId()) {
this.$warning(this.$t('group.unable_to_remove_current_member')); this.$warning(this.$t('group.unable_to_remove_current_member'));
@ -245,8 +241,6 @@ export default {
this.$success(this.$t('commons.remove_success')); this.$success(this.$t('commons.remove_success'));
this.init(); this.init();
}); });
}).catch(() => {
this.$info(this.$t('commons.remove_cancel'));
}); });
}, },
getGroupSource(row) { getGroupSource(row) {

View File

@ -196,7 +196,7 @@ import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUser,
getCurrentUserId, getCurrentUserId,
getCurrentWorkspaceId, getCurrentWorkspaceId, operationConfirm,
removeGoBackListener removeGoBackListener
} from "@/common/js/utils"; } from "@/common/js/utils";
import MsContainer from "../../common/components/MsContainer"; import MsContainer from "../../common/components/MsContainer";
@ -350,11 +350,7 @@ export default {
this.$refs.deleteConfirm.open(project); this.$refs.deleteConfirm.open(project);
}, },
_handleDelete(project) { _handleDelete(project) {
this.$confirm(this.$t('project.delete_tip'), '', { operationConfirm(this, this.$t('project.delete_tip'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$get('/project/delete/' + project.id, () => { this.$get('/project/delete/' + project.id, () => {
if (project.id === getCurrentProjectID()) { if (project.id === getCurrentProjectID()) {
localStorage.removeItem(PROJECT_ID); localStorage.removeItem(PROJECT_ID);
@ -363,11 +359,6 @@ export default {
Message.success(this.$t('commons.delete_success')); Message.success(this.$t('commons.delete_success'));
this.list(); this.list();
}); });
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('commons.delete_cancelled')
});
}); });
}, },
handleClose() { handleClose() {
@ -471,17 +462,11 @@ export default {
this.$set(this.form, 'groupIds', groupIds); this.$set(this.form, 'groupIds', groupIds);
}, },
delMember(row) { delMember(row) {
this.$confirm(this.$t('member.remove_member'), '', { operationConfirm(this, this.$t('member.remove_member'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get('/user/project/member/delete/' + this.currentProjectId + '/' + encodeURIComponent(row.id), () => { this.result = this.$get('/user/project/member/delete/' + this.currentProjectId + '/' + encodeURIComponent(row.id), () => {
this.$success(this.$t('commons.remove_success')); this.$success(this.$t('commons.remove_success'));
this.dialogSearch(); this.dialogSearch();
}); });
}).catch(() => {
this.$info(this.$t('commons.remove_cancel'));
}); });
}, },
close: function () { close: function () {

View File

@ -103,7 +103,7 @@ import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUser,
getCurrentWorkspaceId, hasPermission, getCurrentWorkspaceId, hasPermission,
listenGoBack, listenGoBack, operationConfirm,
removeGoBackListener removeGoBackListener
} from "@/common/js/utils"; } from "@/common/js/utils";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover"; import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
@ -236,17 +236,11 @@ export default {
removeGoBackListener(this.handleClose); removeGoBackListener(this.handleClose);
}, },
del(row) { del(row) {
this.$confirm(this.$t('member.remove_member'), '', { operationConfirm(this, this.$t('member.remove_member'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.result = this.$get('/user/ws/member/delete/' + getCurrentWorkspaceId() + '/' + encodeURIComponent(row.id), () => { this.result = this.$get('/user/ws/member/delete/' + getCurrentWorkspaceId() + '/' + encodeURIComponent(row.id), () => {
this.$success(this.$t('commons.remove_success')); this.$success(this.$t('commons.remove_success'));
this.initTableData(); this.initTableData();
}); });
}).catch(() => {
this.$info(this.$t('commons.remove_cancel'));
}); });
}, },
edit(row) { edit(row) {

View File

@ -143,7 +143,7 @@ import EnvironmentEdit from "@/business/components/api/test/components/environme
import MsAsideItem from "@/business/components/common/components/MsAsideItem"; import MsAsideItem from "@/business/components/common/components/MsAsideItem";
import MsAsideContainer from "@/business/components/common/components/MsAsideContainer"; import MsAsideContainer from "@/business/components/common/components/MsAsideContainer";
import ProjectSwitch from "@/business/components/common/head/ProjectSwitch"; import ProjectSwitch from "@/business/components/common/head/ProjectSwitch";
import {downloadFile, strMapToObj} from "@/common/js/utils"; import {downloadFile, operationConfirm, strMapToObj} from "@/common/js/utils";
import EnvironmentImport from "@/business/components/project/menu/EnvironmentImport"; import EnvironmentImport from "@/business/components/project/menu/EnvironmentImport";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn"; import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import {_handleSelect, _handleSelectAll, getSelectDataCounts, setUnSelectIds} from "@/common/js/tableUtils"; import {_handleSelect, _handleSelectAll, getSelectDataCounts, setUnSelectIds} from "@/common/js/tableUtils";
@ -341,17 +341,11 @@ export default {
}, },
deleteEnv(environment) { deleteEnv(environment) {
if (environment.id) { if (environment.id) {
this.$confirm(this.$t('commons.confirm_delete') + environment.name, { operationConfirm(this, this.$t('commons.confirm_delete') + environment.name, () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: "warning"
}).then(() => {
this.result = this.$get('/api/environment/delete/' + environment.id, () => { this.result = this.$get('/api/environment/delete/' + environment.id, () => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.list(); this.list();
}); });
}).catch(() => {
this.$info(this.$t('commons.delete_cancelled'));
}); });
} }
}, },

View File

@ -262,7 +262,7 @@ import {
getCurrentUserId, getCurrentUserId,
getCurrentWorkspaceId, getCurrentWorkspaceId,
getUUID, getUUID,
hasLicense, hasLicense, operationConfirm,
parseTag parseTag
} from "@/common/js/utils"; } from "@/common/js/utils";
import {getTestTemplate} from "@/network/custom-field-template"; import {getTestTemplate} from "@/network/custom-field-template";
@ -920,13 +920,8 @@ export default {
}); });
}, },
handleDelete(testCase) { handleDelete(testCase) {
this.$alert(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'' + "", '', { operationConfirm(this, this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => {
confirmButtonText: this.$t('commons.confirm'), this._handleDelete(testCase);
callback: (action) => {
if (action === 'confirm') {
this._handleDelete(testCase);
}
}
}); });
}, },
reduction(testCase) { reduction(testCase) {
@ -945,13 +940,8 @@ export default {
// //
this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm')); this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm'));
} else { } else {
this.$alert(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'' + "", '', { operationConfirm(this, this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => {
confirmButtonText: this.$t('commons.confirm'), this._handleDeleteVersion(testCase, false);
callback: (action) => {
if (action === 'confirm') {
this._handleDeleteVersion(testCase, false);
}
}
}); });
} }
}); });
@ -965,19 +955,14 @@ export default {
}); });
}, },
handleDeleteBatch() { handleDeleteBatch() {
this.$alert(this.$t('test_track.case.delete_confirm') + "", '', { operationConfirm(this, this.$t('test_track.case.delete_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'), let param = buildBatchParam(this, this.$refs.table.selectIds);
callback: (action) => { this.$post('/test/case/batch/delete', param, () => {
if (action === 'confirm') { this.$refs.table.clear();
let param = buildBatchParam(this, this.$refs.table.selectIds); this.$emit("refresh");
this.$post('/test/case/batch/delete', param, () => { this.initTableData();
this.$refs.table.clear(); this.$success(this.$t('commons.delete_success'));
this.$emit("refresh"); });
this.initTableData();
this.$success(this.$t('commons.delete_success'));
});
}
}
}); });
}, },
generateGraph() { generateGraph() {
@ -991,18 +976,13 @@ export default {
}); });
}, },
handleDeleteBatchToGc() { handleDeleteBatchToGc() {
this.$alert(this.$t('test_track.case.delete_confirm') + "", '', { operationConfirm(this, this.$t('test_track.case.delete_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'), let param = buildBatchParam(this, this.$refs.table.selectIds);
callback: (action) => { this.$post('/test/case/batch/deleteToGc', param, () => {
if (action === 'confirm') { this.$refs.table.clear();
let param = buildBatchParam(this, this.$refs.table.selectIds); this.$emit("refresh");
this.$post('/test/case/batch/deleteToGc', param, () => { this.$success(this.$t('commons.delete_success'));
this.$refs.table.clear(); });
this.$emit("refresh");
this.$success(this.$t('commons.delete_success'));
});
}
}
}); });
}, },
_handleDelete(testCase) { _handleDelete(testCase) {
@ -1170,18 +1150,13 @@ export default {
}); });
}, },
handleDeleteBatchToPublic() { handleDeleteBatchToPublic() {
this.$alert(this.$t('test_track.case.delete_confirm') + "", '', { operationConfirm(this, this.$t('test_track.case.delete_confirm'), () => {
confirmButtonText: this.$t('commons.confirm'), let param = buildBatchParam(this, this.$refs.table.selectIds);
callback: (action) => { this.$post('/test/case/batch/movePublic/deleteToGc', param, () => {
if (action === 'confirm') { this.$refs.table.clear();
let param = buildBatchParam(this, this.$refs.table.selectIds); this.$emit("refreshPublic");
this.$post('/test/case/batch/movePublic/deleteToGc', param, () => { this.$success(this.$t('commons.delete_success'));
this.$refs.table.clear(); });
this.$emit("refreshPublic");
this.$success(this.$t('commons.delete_success'));
});
}
}
}); });
}, },
handleBatchMove() { handleBatchMove() {

View File

@ -66,7 +66,7 @@
<script> <script>
import MsTag from "@/business/components/common/components/MsTag"; import MsTag from "@/business/components/common/components/MsTag";
import {getCurrentProjectID} from "@/common/js/utils"; import {getCurrentProjectID, operationConfirm} from "@/common/js/utils";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn"; import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
export default { export default {
@ -132,13 +132,8 @@ export default {
closeTaskConfirm(row){ closeTaskConfirm(row){
let flag = row.taskStatus; let flag = row.taskStatus;
row.taskStatus = !flag; //switch row.taskStatus = !flag; //switch
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), { operationConfirm(this, this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.updateTask(row); this.updateTask(row);
}).catch(() => {
}); });
}, },

View File

@ -323,31 +323,6 @@ export default {
} }
return true; return true;
}, },
scheduleChange() {
let flag = this.schedule.enable;
let param = {};
param.taskID = this.schedule.id;
param.enable = flag;
let that = this;
if (flag === false) {
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning',
beforeClose(action, instance, done) {
if (action === 'cancel') { // messageBox switch
that.schedule.enable = param.enable = true;
}
done(); // done messageBox
},
}).then(() => {
this.updateTask(param);
}).catch(() => {
});
} else {
this.updateTask(param);
}
},
updateTask(param) { updateTask(param) {
this.result = this.$post('/test/plan/schedule/updateEnableByPrimyKey', param, response => { this.result = this.$post('/test/plan/schedule/updateEnableByPrimyKey', param, response => {
let paramTestId = ""; let paramTestId = "";

View File

@ -361,7 +361,7 @@ import {
getCurrentProjectID, getCurrentProjectID,
getCurrentUser, getCurrentUser,
getCurrentUserId, getCurrentUserId,
hasPermission hasPermission, operationConfirm
} from "@/common/js/utils"; } from "@/common/js/utils";
import PlanRunModeWithEnv from "@/business/components/track/plan/common/PlanRunModeWithEnv"; import PlanRunModeWithEnv from "@/business/components/track/plan/common/PlanRunModeWithEnv";
import TestPlanReportReview from "@/business/components/track/report/components/TestPlanReportReview"; import TestPlanReportReview from "@/business/components/track/report/components/TestPlanReportReview";
@ -690,11 +690,8 @@ export default {
if (row.scheduleOpen) { if (row.scheduleOpen) {
message = this.$t('api_test.home_page.running_task_list.confirm.open_title'); message = this.$t('api_test.home_page.running_task_list.confirm.open_title');
} }
this.$confirm(message, this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'), operationConfirm(this, message, () => {
cancelButtonText: this.$t('commons.cancel'),
type: 'warning',
}).then(() => {
this.result = this.$post('/test/plan/update/scheduleByEnable', param, response => { this.result = this.$post('/test/plan/update/scheduleByEnable', param, response => {
if (row.scheduleOpen) { if (row.scheduleOpen) {
row.scheduleStatus = 'OPEN' row.scheduleStatus = 'OPEN'
@ -705,8 +702,8 @@ export default {
} }
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
}); });
}).catch(() => { }, () => {
row.scheduleOpen = param.enable = !param.enable; row.scheduleOpen = !row.scheduleOpen;
}); });
}, },
handleDelete(testPlan) { handleDelete(testPlan) {

View File

@ -391,15 +391,6 @@ export default {
}); });
this.dialogFormVisible = false; this.dialogFormVisible = false;
}, },
rerun(testId) {
this.$confirm(this.$t('report.test_rerun_confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
}).catch(() => {
});
},
onOpen() { onOpen() {
}, },
onError(e) { onError(e) {

View File

@ -600,5 +600,24 @@ export function getTypeByFileName(filename) {
return type.toUpperCase(); return type.toUpperCase();
} }
export function operationConfirm(v, tip, success, cancel) {
if (tip[tip.length - 1] !== '?' && tip[tip.length - 1] !== '') {
tip += '?';
}
return v.$confirm(tip, '', {
confirmButtonText: v.$t('commons.confirm'),
cancelButtonText: v.$t('commons.cancel'),
type: 'warning'
}).then(() => {
if (success) {
success();
}
}).catch(() => {
if (cancel) {
cancel();
}
});
}