|
@@ -51,7 +51,7 @@
|
|
<script setup>
|
|
<script setup>
|
|
import { nextTick, onMounted, ref, watch } from 'vue'
|
|
import { nextTick, onMounted, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
-import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
|
|
|
+import { deepClone, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
import mainApi from '~api/project/project'
|
|
import mainApi from '~api/project/project'
|
|
import treeApi from '~api/wbs/tree'
|
|
import treeApi from '~api/wbs/tree'
|
|
|
|
|
|
@@ -116,6 +116,7 @@ const getWbsTreeList = async () => {
|
|
isLoading.value = false
|
|
isLoading.value = false
|
|
await getLeftTreeData()
|
|
await getLeftTreeData()
|
|
await getRightTreeApi()
|
|
await getRightTreeApi()
|
|
|
|
+ setRightTree()
|
|
}
|
|
}
|
|
|
|
|
|
//左边树
|
|
//左边树
|
|
@@ -136,7 +137,7 @@ const getLeftTreeData = async () => {
|
|
|
|
|
|
//切换wbs树
|
|
//切换wbs树
|
|
const isDisabled = ref(false)
|
|
const isDisabled = ref(false)
|
|
-const wbsChange = (val) => {
|
|
|
|
|
|
+const wbsChange = () => {
|
|
getLeftTreeData()
|
|
getLeftTreeData()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -187,7 +188,7 @@ const checkRightTreeChange = () => {
|
|
|
|
|
|
//左边树新增到右边
|
|
//左边树新增到右边
|
|
const addTreeClick = () => {
|
|
const addTreeClick = () => {
|
|
- /*const left = leftTreeRef.value, right = rightTreeRef.value
|
|
|
|
|
|
+ const left = leftTreeRef.value, right = rightTreeRef.value
|
|
if (rightTreeData.value.length < 1) {
|
|
if (rightTreeData.value.length < 1) {
|
|
//直接把左边勾选的树复制到右侧
|
|
//直接把左边勾选的树复制到右侧
|
|
let allTree = deepClone(leftTreeData.value)
|
|
let allTree = deepClone(leftTreeData.value)
|
|
@@ -231,7 +232,7 @@ const addTreeClick = () => {
|
|
myright.forEach((data) => {
|
|
myright.forEach((data) => {
|
|
right.append(data, data.parentId)
|
|
right.append(data, data.parentId)
|
|
})
|
|
})
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//获取右边树
|
|
//获取右边树
|
|
@@ -283,7 +284,7 @@ const delTreeClick = () => {
|
|
}
|
|
}
|
|
|
|
|
|
const setRightTree = () => {
|
|
const setRightTree = () => {
|
|
- /*let ids = []
|
|
|
|
|
|
+ let ids = []
|
|
const data = rightTreeData.value
|
|
const data = rightTreeData.value
|
|
for (let i = 0; i < data.length; i++) {
|
|
for (let i = 0; i < data.length; i++) {
|
|
getLeafIds(ids, data[i])
|
|
getLeafIds(ids, data[i])
|
|
@@ -292,7 +293,7 @@ const setRightTree = () => {
|
|
const e = leftTreeRef.value
|
|
const e = leftTreeRef.value
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
e.setCheckedKeys(ids, true)
|
|
e.setCheckedKeys(ids, true)
|
|
- })*/
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
const getLeafIds = (ids, data) => {
|
|
const getLeafIds = (ids, data) => {
|
|
@@ -333,7 +334,7 @@ const getIds = async (ids, data) => {
|
|
|
|
|
|
//格式化wbsid
|
|
//格式化wbsid
|
|
const formatWbsId = (rid) => {
|
|
const formatWbsId = (rid) => {
|
|
- let refId = rid
|
|
|
|
|
|
+ /*let refId = rid
|
|
if (isNullES(refId)) {
|
|
if (isNullES(refId)) {
|
|
return refId
|
|
return refId
|
|
}
|
|
}
|
|
@@ -350,16 +351,16 @@ const formatWbsId = (rid) => {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
return refId
|
|
return refId
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
const rightObj = ref({})
|
|
const rightObj = ref({})
|
|
const setCheckTreeChange = () => {
|
|
const setCheckTreeChange = () => {
|
|
- let recordId = formatWbsId(wbsId.value)
|
|
|
|
|
|
+ /*let recordId = formatWbsId(wbsId.value)
|
|
rightObj.value = {
|
|
rightObj.value = {
|
|
wbsId: recordId,
|
|
wbsId: recordId,
|
|
data: rightTreeData.value,
|
|
data: rightTreeData.value,
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
const getTreeObj = async () => {
|
|
const getTreeObj = async () => {
|
|
@@ -369,7 +370,7 @@ const getTreeObj = async () => {
|
|
let obj = {
|
|
let obj = {
|
|
wbsId: wbs_id,
|
|
wbsId: wbs_id,
|
|
projectId: form.id,
|
|
projectId: form.id,
|
|
- wbsType: templateType.value,
|
|
|
|
|
|
+ //wbsType: templateType.value,
|
|
wbsTreeIds: ids,
|
|
wbsTreeIds: ids,
|
|
}
|
|
}
|
|
if (wbs_id.toString().indexOf(',') >= 0) {
|
|
if (wbs_id.toString().indexOf(',') >= 0) {
|
|
@@ -383,8 +384,8 @@ const getTreeObj = async () => {
|
|
//公有库
|
|
//公有库
|
|
obj.referenceType = 'public'
|
|
obj.referenceType = 'public'
|
|
obj.wbsId = wbs_id
|
|
obj.wbsId = wbs_id
|
|
- }
|
|
|
|
- return obj*/
|
|
|
|
|
|
+ }*/
|
|
|
|
+ //return obj
|
|
}
|
|
}
|
|
|
|
|
|
defineExpose({
|
|
defineExpose({
|