|
@@ -36,7 +36,7 @@
|
|
show-checkbox
|
|
show-checkbox
|
|
is-type
|
|
is-type
|
|
:is-color="false"
|
|
:is-color="false"
|
|
- check-strictly
|
|
|
|
|
|
+
|
|
:accordion="false"
|
|
:accordion="false"
|
|
:h-props="treeProps"
|
|
:h-props="treeProps"
|
|
@check="addTreeNodeCheckChange"
|
|
@check="addTreeNodeCheckChange"
|
|
@@ -156,10 +156,10 @@ const treeProps = ref({
|
|
label: 'title',
|
|
label: 'title',
|
|
children: 'children',
|
|
children: 'children',
|
|
isLeaf: (data) => !data.hasChildren,
|
|
isLeaf: (data) => !data.hasChildren,
|
|
- disabled: (data) => {
|
|
|
|
- // 当节点类型为6时才能选择
|
|
|
|
- return data.nodeType !== 6
|
|
|
|
- },
|
|
|
|
|
|
+ // disabled: (data) => {
|
|
|
|
+ // // 当节点类型为6时才能选择
|
|
|
|
+ // return data.nodeType !== 6
|
|
|
|
+ // },
|
|
})
|
|
})
|
|
const leftTreeProps = ref({
|
|
const leftTreeProps = ref({
|
|
label: 'title',
|
|
label: 'title',
|
|
@@ -190,31 +190,25 @@ props.firstTree,
|
|
const allSelectedList = ref([])
|
|
const allSelectedList = ref([])
|
|
const halfSelectedList = ref([])
|
|
const halfSelectedList = ref([])
|
|
const addTreeNodeCheckChange = (_, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) => {
|
|
const addTreeNodeCheckChange = (_, { checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys }) => {
|
|
- let NodesArr = [],
|
|
|
|
- halfArr = []
|
|
|
|
//全选数据
|
|
//全选数据
|
|
const keys = checkedNodes || []
|
|
const keys = checkedNodes || []
|
|
- console.log(keys, 'keys')
|
|
|
|
- for (let i = 0; i < keys.length; i++) {
|
|
|
|
- NodesArr.push({
|
|
|
|
- nodeName: keys[i].title,
|
|
|
|
- primaryKeyId: keys[i].primaryKeyId,
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ const NodesArr = keys
|
|
|
|
+ .filter(node => node.nodeType === 6)
|
|
|
|
+ .map(node => ({
|
|
|
|
+ nodeName: node.title,
|
|
|
|
+ primaryKeyId: node.primaryKeyId,
|
|
|
|
+ }))
|
|
allSelectedList.value = NodesArr
|
|
allSelectedList.value = NodesArr
|
|
- console.log(allSelectedList.value, ' allSelectedList.value')
|
|
|
|
|
|
+
|
|
//半选数据
|
|
//半选数据
|
|
const halfNodes = halfCheckedNodes || []
|
|
const halfNodes = halfCheckedNodes || []
|
|
- for (let i = 0; i < halfNodes.length; i++) {
|
|
|
|
- halfArr.push({
|
|
|
|
- nodeName: halfNodes[i].title,
|
|
|
|
- primaryKeyId: halfNodes[i].primaryKeyId,
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ const halfArr = halfNodes
|
|
|
|
+ .filter(node => node.nodeType === 6)
|
|
|
|
+ .map(node => ({
|
|
|
|
+ nodeName: node.title,
|
|
|
|
+ primaryKeyId: node.primaryKeyId,
|
|
|
|
+ }))
|
|
halfSelectedList.value = halfArr
|
|
halfSelectedList.value = halfArr
|
|
- console.log(halfSelectedList.value, ' halfSelectedList.value')
|
|
|
|
}
|
|
}
|
|
const sureLoading = ref(false)
|
|
const sureLoading = ref(false)
|
|
const sureClick = async (type) => {
|
|
const sureClick = async (type) => {
|
|
@@ -228,12 +222,12 @@ const sureClick = async (type) => {
|
|
const { error, code, msg } = await wbsApi.saveContractTreeNode({
|
|
const { error, code, msg } = await wbsApi.saveContractTreeNode({
|
|
projectId: projectId.value,
|
|
projectId: projectId.value,
|
|
contractId: contractId.value,
|
|
contractId: contractId.value,
|
|
- saveType: 2, //仅当前节点
|
|
|
|
|
|
+ saveType: 4, //仅当前节点
|
|
allSelectedList: allSelectedList.value,
|
|
allSelectedList: allSelectedList.value,
|
|
halfSelectedList: halfSelectedList.value,
|
|
halfSelectedList: halfSelectedList.value,
|
|
currentNodePrimaryKeyId: leftPid.value,
|
|
currentNodePrimaryKeyId: leftPid.value,
|
|
isImportTree: 1,
|
|
isImportTree: 1,
|
|
- type:4, //多对多
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
//判断状态
|
|
//判断状态
|
|
sureLoading.value = false
|
|
sureLoading.value = false
|