浏览代码

指标目录移动规则修改:目录移动需保证其层级不变

jwyu 1 年之前
父节点
当前提交
ef9e415626
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/views/dataEDB/components/EDBClassify.vue

+ 7 - 1
src/views/dataEDB/components/EDBClassify.vue

@@ -281,15 +281,21 @@ const classifyMoveState=reactive({
     selectValue:'',
     options:[],
     classifyId:0,//要移动的分类id
+    tabIndex:0,
 })
 function handleSelectMoveClassifyChange({value,selectedOptions,tabIndex}){
-    // classifyMoveState.tabIndex=tabIndex
+    classifyMoveState.tabIndex=tabIndex
 }
 function handleConfirmMove(){
     if(!classifyMoveState.selectValue){
         showToast('请选择要移动至的目录')
         return
     }
+    // 目录移动需保证其层级不变(二级目录只能移动到其他的一级目录下)
+    if(classifyMoveState.tabIndex+1<showParentClassifyData.value.length){
+        showToast('不可移动至该目录下')
+        return
+    }
     
     // 只会将目录移动到某个目录里面所有下面有很多都是0
     apiDataEDB.edbCatalogMove({