|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="h-full">
|
|
|
- <div v-if="wbsTypeTabKey === 'tree'" class="hc-layout-box">
|
|
|
+ <div v-if="wbsTypeTabKey === 'tree'" v-loading="nodeSaveLoading" class="hc-layout-box" element-loading-text="批量保存数据中...">
|
|
|
<div
|
|
|
id="wbs-left-tree" :class="[isWbsTreeShow ? 'show' : '', isMouseTree ? 'on-transition' : '']"
|
|
|
:style="`width:${isWbsTreeShow ? leftWidth : 0}px;`"
|
|
@@ -62,10 +62,13 @@
|
|
|
:menus="ElTreeMenu"
|
|
|
is-counts
|
|
|
is-type
|
|
|
+ show-checkbox
|
|
|
+ check-strictly
|
|
|
@load="treeLoadNode"
|
|
|
@menuTap="ElTreeMenuClick"
|
|
|
@nodeLoading="ElTreeNodeLoading"
|
|
|
@nodeTap="wbsElTreeClick"
|
|
|
+ @check="ElTreeNodeCheck"
|
|
|
/>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -142,6 +145,11 @@
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
+ <el-button :loading="nodeSaveLoading" hc-btn type="primary" @click="NodeSaveClick">
|
|
|
+ <HcIcon name="save" />
|
|
|
+ <span>批量保存</span>
|
|
|
+ </el-button>
|
|
|
+
|
|
|
<HcTooltip v-if="NodeStatus !== '3'" keys="wbs_save">
|
|
|
<el-button
|
|
|
:disabled="NodeStatus === '3' || ListItemDatas.length <= 0"
|
|
@@ -1814,7 +1822,7 @@ const tableFormSaveClick = async () => {
|
|
|
FormData = await ListItemsRef.value?.getFormData()
|
|
|
FormRegExpJson = await ListItemsRef.value?.getFormRegExpJson()
|
|
|
} else {
|
|
|
-
|
|
|
+
|
|
|
FormData = await ListItemRef.value?.getFormData()
|
|
|
FormRegExpJson = await ListItemRef.value?.getFormRegExpJson()
|
|
|
}
|
|
@@ -2074,6 +2082,35 @@ const uploadChange = async ({ type }) => {
|
|
|
getBussFileList(primaryKeyId.value)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//树节点被选中
|
|
|
+const treeSelectNode = ref([])
|
|
|
+const ElTreeNodeCheck = (_, { checkedKeys }) => {
|
|
|
+ treeSelectNode.value = getArrValue(checkedKeys)
|
|
|
+}
|
|
|
+
|
|
|
+//批量保存
|
|
|
+const nodeSaveLoading = ref(false)
|
|
|
+const NodeSaveClick = async () => {
|
|
|
+ const keys = treeSelectNode.value
|
|
|
+ if (keys.length <= 0) {
|
|
|
+ window?.$message?.warning('请先在左侧项目树选择节点')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //发起请求
|
|
|
+ nodeSaveLoading.value = true
|
|
|
+ const { error, code } = await wbsApi.save_nodeId({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ classify: classType.value,
|
|
|
+ nodeIds: keys.join(),
|
|
|
+ }, false)
|
|
|
+ nodeSaveLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window?.$message?.success('批量保存成功')
|
|
|
+ window?.location?.reload() //刷新页面
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -2130,6 +2167,21 @@ html.theme-dark {
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+.hc-tree-box .el-tree-node {
|
|
|
+ .el-checkbox {
|
|
|
+ margin-right: 0;
|
|
|
+ .el-checkbox__inner {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .is-leaf + .el-checkbox {
|
|
|
+ margin-right: 8px;
|
|
|
+ .el-checkbox__inner {
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.data-fill-wbs-content {
|
|
|
position: relative;
|
|
|
height: 100%;
|