|
@@ -175,9 +175,18 @@ const wbsChange = async (val) => {
|
|
|
//左边树
|
|
|
const leftLoading = ref(false)
|
|
|
const leftTreeData = ref([])
|
|
|
+const nowref = ref({})
|
|
|
+const finalWbsid = ref('')
|
|
|
|
|
|
-//获取右边数据
|
|
|
+//右边树
|
|
|
const rightLoading = ref(false)
|
|
|
+const rightTreeData = ref([])
|
|
|
+const rightObj1 = ref({})
|
|
|
+const rightObj2 = ref({})
|
|
|
+const rightObj3 = ref({})
|
|
|
+const rightObj4 = ref({})
|
|
|
+
|
|
|
+//获取右边数据
|
|
|
const getRightTreeApi = async () => {
|
|
|
rightLoading.value = true
|
|
|
isDisabled.value = true
|
|
@@ -191,24 +200,62 @@ const getRightTreeApi = async () => {
|
|
|
return
|
|
|
}
|
|
|
let newWbsId = ''
|
|
|
- if (form.referenceWbsTemplateType === 'private' && refId.toString().length > 0 && type === 1) {
|
|
|
- refId = setRefId(refId)
|
|
|
- }
|
|
|
- if (form.referenceWbsTemplateTypeTrial === 'private' && refId.toString().length > 0 && type === 2) {
|
|
|
- refId = setRefId(refId)
|
|
|
- }
|
|
|
- if (form.referenceWbsTemplateTypeMeter === 'private' && refId.toString().length > 0 && type === 3) {
|
|
|
- refId = setRefId(refId)
|
|
|
- }
|
|
|
- if (form.referenceWbsTemplateTypeLar === 'private' && refId.toString().length > 0 && type === 5) {
|
|
|
+ if (refId.toString().length > 0 && ifPrivateType()) {
|
|
|
refId = setRefId(refId)
|
|
|
}
|
|
|
//引用被删会出现 wbsType -1
|
|
|
if (refId && refId > 0) {
|
|
|
let priv = {}
|
|
|
-
|
|
|
+ if (ifPrivateType()) {
|
|
|
+ //私有
|
|
|
+ let list = wbsTreeList.value[1].data
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].pkeyId == refId) {
|
|
|
+ refId = list[i].wbsId + ',' + list[i].projectId
|
|
|
+ priv.wbsId = list[i].wbsId
|
|
|
+ priv.projectId = list[i].projectId
|
|
|
+ priv.value = list[i].value
|
|
|
+ priv.pkeyId = list[i].pkeyId
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //公有
|
|
|
+ newWbsId = refId
|
|
|
+ }
|
|
|
+ const now = getObjValue(nowref.value)
|
|
|
+ if (now.key === refId) {
|
|
|
+ newWbsId = now.id
|
|
|
+ } else {
|
|
|
+ if (refId.toString().length > 0 && ifPrivateType()) {
|
|
|
+ newWbsId = priv.pkeyId
|
|
|
+ } else {
|
|
|
+ newWbsId = type === 1 ? form.referenceWbsTemplateId : form.referenceWbsTemplateIdTrial
|
|
|
+ if (type === 5) {
|
|
|
+ newWbsId = form.referenceWbsTemplateIdLar
|
|
|
+ }
|
|
|
+ if (type === 3) {
|
|
|
+ newWbsId = form.referenceWbsTemplateIdMeter
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- console.log('refId', refId)
|
|
|
+ finalWbsid.value = newWbsId
|
|
|
+ const { data } = await mainApi.findProjectTree({
|
|
|
+ projectId: form.id,
|
|
|
+ wbsId: newWbsId,
|
|
|
+ })
|
|
|
+ console.log(data)
|
|
|
+ rightLoading.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//判断是否为私有
|
|
|
+const ifPrivateType = () => {
|
|
|
+ const type = templateType.value, form = getObjValue(formModel.value)
|
|
|
+ return form.referenceWbsTemplateType === 'private' && type === 1
|
|
|
+ || form.referenceWbsTemplateTypeTrial === 'private' && type === 2
|
|
|
+ || form.referenceWbsTemplateTypeMeter === 'private' && type === 3
|
|
|
+ || form.referenceWbsTemplateTypeLar === 'private' && type === 5
|
|
|
}
|
|
|
|
|
|
const setRefId = (refId) => {
|
|
@@ -221,7 +268,6 @@ const setRefId = (refId) => {
|
|
|
return refId
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const allChecked = ref(false)
|
|
|
</script>
|
|
|
|