[update] 修改UAT问题:标准化活动增加删除节点功能

This commit is contained in:
lideqin
2024-09-14 15:02:14 +08:00
parent ebd074f442
commit 72548127a8
4 changed files with 31 additions and 2 deletions
@@ -17,6 +17,9 @@
</a-button>
<!--编辑-->
<a-button type="primary" ghost icon="edit" @click="handleEdit" v-has="'standardActivity:edit'">{{ $t('edit') }}</a-button>
<!--删除-->
<!-- v-has="'standardActivity:delete'"-->
<a-button type="primary" ghost icon="delete" @click="handleDelete">{{ $t('delete') }}</a-button>
<!--查看-->
<a-button type="primary" ghost icon="eye" @click="handleDetail" v-has="'standardActivity:view'">{{ $t('view') }}</a-button>
<!--会议统计列表-->
@@ -80,7 +83,7 @@
<script>
import MindMap from '../../../components/MindMap.vue'
import InternalDetailPage from '../../../components/InternalDetailPage'
import { queryTreeList } from '../../../api/businessSupport'
import { deleteNode, queryTreeList } from '../../../api/businessSupport'
import StandardizationActivityDrawer from './modules/StandardizationActivityDrawer'
import StatisticalListDrawer from './modules/StatisticalListDrawer'
@@ -235,6 +238,27 @@ export default {
}
this.$refs.modalForm.edit(this.selectedNodeId)
},
// 删除节点
handleDelete () {
if (this.selectedNode.level === 0) {
this.$message.warning(this.$t('businessSupport.standardizationActivity.rootNodeNoDelete'))
return
}
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
deleteNode({ id: this.selectedNodeId }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
},
handleDetail () {
// 需要先选中一个节点
if (!this.selectedNodeId) {