|
@@ -8,10 +8,24 @@
|
|
|
<div class="hc-project-icon-box">
|
|
|
<HcIcon name="stack" />
|
|
|
</div>
|
|
|
- <div class="project-name-box ml-2">
|
|
|
+ <div class="project-name-box flex justify-between">
|
|
|
<div class="project-name">
|
|
|
{{ projectInfo.projectName }}
|
|
|
</div>
|
|
|
+
|
|
|
+ <hc-tooltip keys="data-division-batch-btn">
|
|
|
+ <el-button
|
|
|
+
|
|
|
+ :loading="batchDelLoading"
|
|
|
+ hc-btn
|
|
|
+ type="danger"
|
|
|
+ :disabled="leftPid === ''"
|
|
|
+ @click="batchDelClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="delete" />
|
|
|
+ <span>删除</span>
|
|
|
+ </el-button>
|
|
|
+ </hc-tooltip>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
@@ -21,6 +35,7 @@
|
|
|
>
|
|
|
<el-scrollbar>
|
|
|
<HcLazyTree
|
|
|
+ show-checkbox
|
|
|
:auto-expand-keys="treeAutoExpandKeys"
|
|
|
is-counts
|
|
|
is-type
|
|
@@ -32,6 +47,7 @@
|
|
|
@node-loading="treeNodeLoading"
|
|
|
@node-tap="wbsElTreeClick"
|
|
|
@load-menu="loadMenu"
|
|
|
+ @check="leftCheckChange"
|
|
|
/>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -2116,18 +2132,19 @@ const addNodeClickData = async () => {
|
|
|
//删除节点
|
|
|
const delModalClick = () => {
|
|
|
HcDelMsg(async (resolve) => {
|
|
|
- await removeContractTreeNode()
|
|
|
+ await removeContractTreeNode(false)
|
|
|
resolve() //关闭弹窗的回调
|
|
|
})
|
|
|
}
|
|
|
-const removeContractTreeNode = async () => {
|
|
|
+const removeContractTreeNode = async (isBatch) => {
|
|
|
const loadingInstance = window.$loading.service({
|
|
|
fullscreen: true,
|
|
|
text: '删除节点中,请耐心等待...',
|
|
|
background: 'rgba(0, 0, 0, 0.7)',
|
|
|
})
|
|
|
const { error, code, msg } = await wbsApi.removeContractTreeNode({
|
|
|
- ids: treeItemInfo.value?.primaryKeyId || '',
|
|
|
+ // ids: treeItemInfo.value?.primaryKeyId || '',
|
|
|
+ ids: isBatch ? leftPid.value : treeItemInfo.value?.primaryKeyId || '',
|
|
|
})
|
|
|
loadingInstance.close()
|
|
|
if (!error && code === 200) {
|
|
@@ -2138,6 +2155,26 @@ const removeContractTreeNode = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//批量删除
|
|
|
+const batchDelLoading = ref(false)
|
|
|
+const batchDelClick = ()=>{
|
|
|
+ console.log('删除')
|
|
|
+ HcDelMsg(async (resolve) => {
|
|
|
+ await removeContractTreeNode(true)
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+const leftPid = ref('')
|
|
|
+const leftCheckChange = (_, { checkedNodes }) => {
|
|
|
+ if (checkedNodes && checkedNodes.length > 0) {
|
|
|
+ // 获取所有选中节点的 primaryKeyId 并用逗号拼接
|
|
|
+ leftPid.value = checkedNodes.map(node => node.primaryKeyId).filter(Boolean).join(',')
|
|
|
+ } else {
|
|
|
+ leftPid.value = ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//调整排序
|
|
|
const sortNodeModal = ref(false)
|
|
|
const sortNodeLoading = ref(false)
|