refactor(缺陷管理): 删除增加二次提醒

This commit is contained in:
shiziyuan9527 2022-03-02 17:17:28 +08:00 committed by 刘瑞斌
parent 60055f9587
commit 54e1dbaa20
2 changed files with 8 additions and 45 deletions

View File

@ -1,40 +0,0 @@
<template>
<el-dialog
title=""
:visible.sync="dialogVisible"
width="25%">
<span>{{ $t('test_track.issue.delete_tip') }}{{issue.title}} ?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false" size="medium">{{$t('commons.cancel')}}</el-button>
<el-button type="primary" @click="confirm" size="medium">{{$t('commons.confirm')}}</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
name: "IssueDeleteConfirm",
data() {
return {
dialogVisible: false,
issue: {
title: ""
}
}
},
methods: {
open(issue) {
this.issue = issue;
this.dialogVisible = true;
},
confirm() {
this.$emit('delete', this.issue);
this.dialogVisible = false;
}
}
}
</script>
<style scoped>
</style>

View File

@ -149,8 +149,6 @@
:total="page.total"/> :total="page.total"/>
<issue-edit @refresh="getIssues" ref="issueEdit"/> <issue-edit @refresh="getIssues" ref="issueEdit"/>
<issue-delete-confirm @delete="_handleDelete" ref="issueDeleteConfirm"/>
</el-card> </el-card>
</ms-main-container> </ms-main-container>
</ms-container> </ms-container>
@ -181,12 +179,10 @@ import MsMainContainer from "@/business/components/common/components/MsMainConta
import {getCurrentProjectID, getCurrentWorkspaceId} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentWorkspaceId} from "@/common/js/utils";
import {getProjectMember} from "@/network/user"; import {getProjectMember} from "@/network/user";
import {LOCAL} from "@/common/js/constants"; import {LOCAL} from "@/common/js/constants";
import IssueDeleteConfirm from "@/business/components/track/issue/IssueDeleteConfirm";
export default { export default {
name: "IssueList", name: "IssueList",
components: { components: {
IssueDeleteConfirm,
MsMainContainer, MsMainContainer,
MsContainer, MsContainer,
IssueEdit, IssueEdit,
@ -315,7 +311,14 @@ export default {
this.$refs.issueEdit.open(copyData, 'copy'); this.$refs.issueEdit.open(copyData, 'copy');
}, },
handleDelete(data) { handleDelete(data) {
this.$refs.issueDeleteConfirm.open(data); this.$alert(this.$t('test_track.issue.delete_tip') + ' ' + data.title + " ", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this._handleDelete(data);
}
}
});
}, },
_handleDelete(data) { _handleDelete(data) {
this.page.result = this.$get('issues/delete/' + data.id, () => { this.page.result = this.$get('issues/delete/' + data.id, () => {