Prechádzať zdrojové kódy

目标管理拖拽限制逻辑

liubing 1 mesiac pred
rodič
commit
447d56d952

+ 61 - 1
src/views/xjc-integratedmachine/plan/aim/aim_management_interaction.vue

@@ -492,6 +492,9 @@ function steam(target, goalText) {
   console.log("短期目标:", shortTermGoals.value);
   console.log("小目标:", smallGoals.value);
 }
+let newArrtotalDeep2 = [];
+let newArrtotalDeep3 = [];
+let newArrtotalDeep4 = [];
 const handleDrop = (target, goalText, obj) => {
   console.log(target, goalText, obj, "mobile drop");
   if (!obj.isRight) {
@@ -518,6 +521,62 @@ const handleDrop = (target, goalText, obj) => {
     steam(target, goalText);
     //判断中期目标是否都已拖拽完毕
     if (!checkArray(midTermGoals.value)) {
+      let newArr = findNodeById(totalData.value, obj.id);
+      newArrtotalDeep2.push(...newArr.children);
+    } else {
+      let newArr = findNodeById(totalData.value, obj.id);
+      newArrtotalDeep2.push(...newArr.children);
+      console.log(newArrtotalDeep2, 88);
+      goalOptions.value = newArrtotalDeep2;
+    }
+  }
+  if (obj.deep == 3) {
+    //判断是否拖进中期目标
+    if (
+      !(
+        target == "shortTerm1" ||
+        target == "shortTerm2" ||
+        target == "shortTerm3" ||
+        target == "shortTerm4"
+      )
+    ) {
+      centerDialogVisible2.value = true;
+      return;
+    }
+    console.log(!checkArray(shortTermGoals.value), shortTermGoals, 777);
+    steam(target, goalText);
+    //判断短期目标是否都已拖拽完毕
+    if (!checkArray(shortTermGoals.value)) {
+      let newArr = findNodeById(totalData.value, obj.id);
+      newArrtotalDeep3.push(...newArr.children);
+    } else {
+      let newArr = findNodeById(totalData.value, obj.id);
+      newArrtotalDeep3.push(...newArr.children);
+      console.log(newArrtotalDeep3, 88);
+      goalOptions.value = newArrtotalDeep3;
+    }
+  }
+  if (obj.deep == 4) {
+    //判断是否拖进中期目标
+    if (
+      !(
+        target == "small1" ||
+        target == "small2" ||
+        target == "small3" ||
+        target == "small4" ||
+        target == "small5" ||
+        target == "small6" ||
+        target == "small7" ||
+        target == "small8"
+      )
+    ) {
+      centerDialogVisible2.value = true;
+      return;
+    }
+    console.log(!checkArray(smallGoals.value), smallGoals, 777);
+    steam(target, goalText);
+    //判断短期目标是否都已拖拽完毕
+    if (!checkArray(smallGoals.value)) {
     } else {
       let newArr = findNodeById(totalData.value, obj.id);
       console.log(newArr, 88);
@@ -1054,12 +1113,13 @@ body {
 .goal-btn {
   flex: 0 0 calc(33.33% - 13.33px); // 每行3个,减去gap平均值
   min-width: 200px; // 保持最小宽度
-  padding: 60px 25px;
+  padding: 10px 25px;
   border: 4px solid #95a5a6;
   border-radius: 40px;
   background: #fff;
   color: #95a5a6;
   font-size: 22px;
+  height: 80px;
   text-align: center;
   cursor: grab;
   box-sizing: border-box;