|
@@ -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) {
|