|
@@ -514,6 +514,7 @@ const linksRelateModalClick = ()=>{
|
|
TreeAutoExpandKeys.value = processDataList.value[0]?.autoExpandKeys || []
|
|
TreeAutoExpandKeys.value = processDataList.value[0]?.autoExpandKeys || []
|
|
linksRelateModal.value = true
|
|
linksRelateModal.value = true
|
|
isSearchTree.value = false
|
|
isSearchTree.value = false
|
|
|
|
+ newPushArr.value = []
|
|
|
|
|
|
defaultChecked.value = arrToKey(processDataList.value, 'primaryKeyId', ',').split(',')
|
|
defaultChecked.value = arrToKey(processDataList.value, 'primaryKeyId', ',').split(',')
|
|
}
|
|
}
|
|
@@ -521,68 +522,101 @@ const linksRelateModalClose = ()=>{
|
|
linksRelateModal.value = false
|
|
linksRelateModal.value = false
|
|
}
|
|
}
|
|
const processDataList = ref([])
|
|
const processDataList = ref([])
|
|
|
|
+// const linksRelateModalSave = ()=>{
|
|
|
|
+// console.log('baocun', processDataList.value )
|
|
|
|
+// console.log(defaultChecked.value, 'defaultChecked.value')
|
|
|
|
+// const keys = processElTree.value.treeRef.getCheckedKeys()
|
|
|
|
+// // const keys = defaultChecked.value
|
|
|
|
+// console.log(keys, 'keys')
|
|
|
|
+// let linkTabIds = processDataList.value
|
|
|
|
+// if (keys.length === 0) {
|
|
|
|
+// linkTabIds = []
|
|
|
|
+// }
|
|
|
|
+// //去出掉取消勾选的
|
|
|
|
+// for (let index = 0; index < keys.length; index++) {
|
|
|
|
+// linkTabIds = linkTabIds.filter((ele)=>{
|
|
|
|
+// if (ele.primaryKeyId === keys[index]) {
|
|
|
|
+// return ele
|
|
|
|
+// }
|
|
|
|
+// })
|
|
|
|
+// }
|
|
|
|
+// for (let index = 0; index < keys.length; index++) {
|
|
|
|
+// console.log(keys[index], 'keys[index]')
|
|
|
|
+// let node = processElTree.value.treeRef.getNode(keys[index])
|
|
|
|
+// console.log(node, 'NODE')
|
|
|
|
+// let pathArr = []
|
|
|
|
+// getKeys(node, pathArr)
|
|
|
|
+// TreeAutoExpandKeys.value = pathArr
|
|
|
|
+// linkTabIds.push({
|
|
|
|
+// inspectProject: node.data.title,
|
|
|
|
+// primaryKeyId: keys[index],
|
|
|
|
+// autoExpandKeys:TreeAutoExpandKeys.value,
|
|
|
|
+// isShowImage:0,
|
|
|
|
+// contractId:contractId.value,
|
|
|
|
+
|
|
|
|
+// })
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+// //去除掉重复的
|
|
|
|
+// getNorepeatArr(linkTabIds)
|
|
|
|
+// console.log(linkTabIds, 'linkTabIds')
|
|
|
|
+// console.log(processDataList.value, 'processDataList.value')
|
|
|
|
+// linkTabIds.forEach((ele)=>{
|
|
|
|
+// processDataList.value.forEach((ele1)=>{
|
|
|
|
+// if (ele.primaryKeyId === ele1.primaryKeyId) {
|
|
|
|
+// ele.isShowImage = ele1.isShowImage
|
|
|
|
+// ele.inspectContent = ele1.inspectContent
|
|
|
|
+// ele.deductionStandard = ele1.deductionStandard
|
|
|
|
+// ele.inspectUserName = ele1.inspectUserName
|
|
|
|
+// ele.inspectPdfUrl = ele1.inspectPdfUrl
|
|
|
|
+// ele.autoExpandKeys = ele1.autoExpandKeys
|
|
|
|
+// ele.contractId = ele1.contractId
|
|
|
|
+
|
|
|
|
+// }
|
|
|
|
+// })
|
|
|
|
+// })
|
|
|
|
+// console.log(linkTabIds, 'linkTabIds1111')
|
|
|
|
+// processDataList.value = linkTabIds
|
|
|
|
+// linksRelateModal.value = false
|
|
|
|
+// addForm.value.list = linkTabIds
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ //获取展开节点
|
|
const linksRelateModalSave = ()=>{
|
|
const linksRelateModalSave = ()=>{
|
|
- console.log('baocun', processDataList.value )
|
|
|
|
- console.log(defaultChecked.value, 'defaultChecked.value')
|
|
|
|
- const keys = processElTree.value.treeRef.getCheckedKeys()
|
|
|
|
- // const keys = defaultChecked.value
|
|
|
|
- console.log(keys, 'keys')
|
|
|
|
- let linkTabIds = processDataList.value
|
|
|
|
- if (keys.length === 0) {
|
|
|
|
- linkTabIds = []
|
|
|
|
- }
|
|
|
|
- //去出掉取消勾选的
|
|
|
|
- for (let index = 0; index < keys.length; index++) {
|
|
|
|
- linkTabIds = linkTabIds.filter((ele)=>{
|
|
|
|
- if (ele.primaryKeyId === keys[index]) {
|
|
|
|
- return ele
|
|
|
|
|
|
+ let arr = []//当前选中的节点
|
|
|
|
+ processDataList.value.forEach((ele)=>{
|
|
|
|
+ defaultChecked.value.forEach((ele1)=>{
|
|
|
|
+ if (ele.primaryKeyId === ele1) {
|
|
|
|
+ arr.push(ele)
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
- for (let index = 0; index < keys.length; index++) {
|
|
|
|
- console.log(keys[index], 'keys[index]')
|
|
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ const keys = processElTree.value.treeRef.getCheckedKeys()
|
|
|
|
+ for (let index = 0; index < keys.length; index++) {
|
|
let node = processElTree.value.treeRef.getNode(keys[index])
|
|
let node = processElTree.value.treeRef.getNode(keys[index])
|
|
- console.log(node, 'NODE')
|
|
|
|
|
|
+
|
|
let pathArr = []
|
|
let pathArr = []
|
|
getKeys(node, pathArr)
|
|
getKeys(node, pathArr)
|
|
TreeAutoExpandKeys.value = pathArr
|
|
TreeAutoExpandKeys.value = pathArr
|
|
- linkTabIds.push({
|
|
|
|
- inspectProject: node.data.title,
|
|
|
|
- primaryKeyId: keys[index],
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ newPushArr.value.forEach((ele)=>{
|
|
|
|
+ arr.push({
|
|
|
|
+ inspectProject:ele.title,
|
|
|
|
+ primaryKeyId: ele.primaryKeyId,
|
|
autoExpandKeys:TreeAutoExpandKeys.value,
|
|
autoExpandKeys:TreeAutoExpandKeys.value,
|
|
isShowImage:0,
|
|
isShowImage:0,
|
|
contractId:contractId.value,
|
|
contractId:contractId.value,
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //去除掉重复的
|
|
|
|
- getNorepeatArr(linkTabIds)
|
|
|
|
- console.log(linkTabIds, 'linkTabIds')
|
|
|
|
- console.log(processDataList.value, 'processDataList.value')
|
|
|
|
- linkTabIds.forEach((ele)=>{
|
|
|
|
- processDataList.value.forEach((ele1)=>{
|
|
|
|
- if (ele.primaryKeyId === ele1.primaryKeyId) {
|
|
|
|
- ele.isShowImage = ele1.isShowImage
|
|
|
|
- ele.inspectContent = ele1.inspectContent
|
|
|
|
- ele.deductionStandard = ele1.deductionStandard
|
|
|
|
- ele.inspectUserName = ele1.inspectUserName
|
|
|
|
- ele.inspectPdfUrl = ele1.inspectPdfUrl
|
|
|
|
- ele.autoExpandKeys = ele1.autoExpandKeys
|
|
|
|
- ele.contractId = ele1.contractId
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- console.log(linkTabIds, 'linkTabIds1111')
|
|
|
|
- processDataList.value = linkTabIds
|
|
|
|
|
|
+ processDataList.value = arr
|
|
|
|
+ addForm.value.list = arr
|
|
linksRelateModal.value = false
|
|
linksRelateModal.value = false
|
|
- addForm.value.list = linkTabIds
|
|
|
|
-
|
|
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- //获取展开节点
|
|
|
|
const getKeys = (node, pathArr) => {
|
|
const getKeys = (node, pathArr) => {
|
|
if (node.parent) {
|
|
if (node.parent) {
|
|
pathArr.unshift(node.data?.primaryKeyId.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
|
|
pathArr.unshift(node.data?.primaryKeyId.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
|
|
@@ -683,15 +717,19 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
|
|
}
|
|
}
|
|
|
|
|
|
const divisionTreeCheck = (data, { checkedNodes, checkedKeys }) => {
|
|
const divisionTreeCheck = (data, { checkedNodes, checkedKeys }) => {
|
|
- // console.log(data, 'data')
|
|
|
|
- // console.log(checkedNodes, 'checkedNodes')
|
|
|
|
- // console.log(checkedKeys, 'checkedKeys')
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+const newPushArr = ref([])
|
|
const divisionTreeCheckChange = (data, ischeck, data1)=>{
|
|
const divisionTreeCheckChange = (data, ischeck, data1)=>{
|
|
- console.log(data)
|
|
|
|
- console.log(ischeck)
|
|
|
|
- console.log(data1)
|
|
|
|
|
|
+ if (!ischeck) {
|
|
|
|
+ defaultChecked.value.forEach((ele, index)=>{
|
|
|
|
+ if (ele === data.primaryKeyId) {
|
|
|
|
+ defaultChecked.value.splice(index, 1)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ defaultChecked.value.push(data.primaryKeyId)
|
|
|
|
+ newPushArr.value.push(data)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|