Ver código fonte

新增排序

林旭祥 1 mês atrás
pai
commit
21556db661
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7 3
      src/components/OptionWindow/index.vue

+ 7 - 3
src/components/OptionWindow/index.vue

@@ -322,10 +322,14 @@ const getChooseArea = (data: any) => {
     //不存在就点选
     if (['skiprope', 'heartbeat'].includes(project.value.key)) {
       chooseArea.value = [];
-      chooseArea.value.push(id);
-    } else {
-      chooseArea.value.push(id);
     }
+    chooseArea.value.push(id);
+    //排序
+    chooseArea.value = areaList.value.filter((item: any) => {
+      return chooseArea.value.includes(item.key);
+    }).map((item: any)=>{
+      return item.key;
+    });
   }
   if (chooseArea.value.length > 10) {
     optionForm.value.gesture = false;