|
@@ -395,7 +395,7 @@ import HcTreeData from './components/division/HcTreeData.vue'
|
|
|
import HcTreeData1 from './components/division/HcTreeData1.vue'
|
|
|
import DivisionTree from './components/division/DivisionTree.vue'
|
|
|
import HcTreeNode from './components/HcTreeNode.vue'
|
|
|
-import { arrIndex, arrToId, deepClone, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
+import { arrDelKey, arrIndex, arrToId, deepClone, formValidate, getArrValue, getObjValue } from 'js-fast-way'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import { getDictionary } from '~api/other'
|
|
|
import wbsApi from '~api/data-fill/wbs'
|
|
@@ -707,8 +707,18 @@ const loadMenu = ({ node, item, level }, resolve)=>{
|
|
|
let iscan = false
|
|
|
iscan = childNodes.some(obj => obj.data.isCustom !== 1)
|
|
|
console.log(iscan, 'iscan')
|
|
|
+
|
|
|
+ //自定义节点类型下如果有自定义节点,就不允许新增节点
|
|
|
+ let iscan1 = false
|
|
|
+ iscan1 = childNodes.some(obj => obj.data.isCustom === 1)
|
|
|
+
|
|
|
const { isCustom } = item
|
|
|
- if (isCustom === 1 && !iscan) {
|
|
|
+ if (isCustom === 1 && iscan1 && !iscan) {
|
|
|
+ menusArr.unshift( { icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
|
|
|
+ let menusArr1 = arrDelKey(menusArr, 'label', '新增节点') // [{id:1}]
|
|
|
+ console.log(menusArr1, 'menusArr')
|
|
|
+ resolve(menusArr1)
|
|
|
+ } else if (isCustom === 1 && !iscan) {
|
|
|
menusArr.unshift( { icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
|
|
|
resolve(menusArr)
|
|
|
} else if (level === 1) {
|
|
@@ -824,6 +834,31 @@ const copyNodeElTreeClick = ({ data, node }) => {
|
|
|
} else {
|
|
|
window?.$message?.warning('该节点已存在上报数据,不允许复制')
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (data['id'] !== formCopyNodeModel.value.id) {//不能复制到本身节点下
|
|
|
+ //只能往上一级点击,不能跨层级点击
|
|
|
+ //如果选择的是父级节点,那不能复制到子级节点
|
|
|
+ if (type === 6 && (data['type'] === 4 || data['type'] === 5 || data['type'] == 6)) {
|
|
|
+ setCopyNodeTable(data, title)
|
|
|
+ }
|
|
|
+ if (type === 5 && data['type'] === 4) {
|
|
|
+ setCopyNodeTable(data, title, partitionCode)
|
|
|
+ }
|
|
|
+ if (type === 4 && (data['type'] === 2 || data['type'] === 3)) {
|
|
|
+ setCopyNodeTable(data, title, partitionCode)
|
|
|
+ }
|
|
|
+ if (type === 3 && data['type'] === 2) {
|
|
|
+ setCopyNodeTable(data, title, partitionCode)
|
|
|
+ }
|
|
|
+ if (type === 2 && data['type'] === 1) {
|
|
|
+ setCopyNodeTable(data, title, partitionCode)
|
|
|
+ }
|
|
|
+ if (type === 1 && data['type'] === 1) {
|
|
|
+ setCopyNodeTable(data, title, partitionCode)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|