Parcourir la source

还原复制树修改

duy il y a 7 mois
Parent
commit
080028fa2e
1 fichiers modifiés avec 33 ajouts et 33 suppressions
  1. 33 33
      src/views/project/debit/contract/components/unit/tree-form.vue

+ 33 - 33
src/views/project/debit/contract/components/unit/tree-form.vue

@@ -347,39 +347,39 @@ const defaultCheckedKeys = ref([])
 const defaultExpandAll = ref(true)
 
 const changeIsAdd = (val, row, index)=>{
-        const { isParent } = row
-        if (isParent && val === 0) {
-            let rowTreeData = leftTree.value.treeRef.getNode(row.id)
-            let delKeys = arrToId(rowTreeData.data.children).split(',')
-            nextTick(()=>{
-                delKeys.forEach((ele)=>{
-                    leftTree.value.treeRef.setChecked(ele, false, true)
-                    let checkKeys = leftTree.value.treeRef.getCheckedKeys()
-                    let arr = []
-                    tableData.value.forEach((ele)=>{
-                        checkKeys.forEach((ele1)=>{
-                            if (ele.id === ele1) {
-                                arr.push(ele)
-                            }
-                        })
-                    })
-                    tableData.value = arr
-                 if (checkKeys.length > 0) {
-                    tableData.value.unshift(
-                        { nodeName: parentData.value.nodeName,
-                        startStake: '',
-                        endStake: '',
-                        contractPicture: '',
-                        isAddChildNode:0,
-                        id:parentData.value.id,
-                        parentId:parentData.value.parentId,
-                        isParent:isTable.value ? false : true,
-                        },
-                    )
-                 }
-                })
-            })
-        } 
+        // const { isParent } = row
+        // if (isParent && val === 0) {
+        //     let rowTreeData = leftTree.value.treeRef.getNode(row.id)
+        //     let delKeys = arrToId(rowTreeData.data.children).split(',')
+        //     nextTick(()=>{
+        //         delKeys.forEach((ele)=>{
+        //             leftTree.value.treeRef.setChecked(ele, false, true)
+        //             let checkKeys = leftTree.value.treeRef.getCheckedKeys()
+        //             let arr = []
+        //             tableData.value.forEach((ele)=>{
+        //                 checkKeys.forEach((ele1)=>{
+        //                     if (ele.id === ele1) {
+        //                         arr.push(ele)
+        //                     }
+        //                 })
+        //             })
+        //             tableData.value = arr
+        //          if (checkKeys.length > 0) {
+        //             tableData.value.unshift(
+        //                 { nodeName: parentData.value.nodeName,
+        //                 startStake: '',
+        //                 endStake: '',
+        //                 contractPicture: '',
+        //                 isAddChildNode:0,
+        //                 id:parentData.value.id,
+        //                 parentId:parentData.value.parentId,
+        //                 isParent:isTable.value ? false : true,
+        //                 },
+        //             )
+        //          }
+        //         })
+        //     })
+        // } 
 }
 const leftTree = ref(null)
 </script>