Explorar o código

Merge branch 'master' of http://221.182.8.141:11666/sujunlin/xld-gis-admin

XiaXxxxxx hai 1 ano
pai
achega
a4c8253355
Modificáronse 2 ficheiros con 16 adicións e 4 borrados
  1. 2 2
      src/api/sys/menu.ts
  2. 14 2
      src/views/resource/plat/index.vue

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
src/api/sys/menu.ts


+ 14 - 2
src/views/resource/plat/index.vue

@@ -92,7 +92,8 @@ export default defineComponent({
       });
       platList().then((r) => {
         if (r) {
-          achieveList.value = r
+          achieveList.value = r;
+          updateAction()
           console.log(achieveList.value)
         }
       });
@@ -116,11 +117,14 @@ export default defineComponent({
                 }
                 return i;
               })
+              updateAction()
             } else {
               achieveList.value = list.map(i => { if (i && i.type == type) { i.items = r, i.count = 0; } return i; });
+              updateAction()
             }
           } else {
             achieveList.value = r;
+            updateAction()
           }
         }
       });
@@ -130,7 +134,15 @@ export default defineComponent({
       let params = {
         id: currentTreeNodeKeys.value.length ? currentTreeNodeKeys.value[0] : null
       }
-      platList(params).then((r) => { if (r) achieveList.value = r });
+      platList(params).then((r) => { if (r) { achieveList.value = r, updateAction() } });
+    }
+
+    function updateAction() {
+      var type = true;
+      var r = achieveList.value;
+      r.forEach((i) => { if (i.type == 'MR' && i.count) { type = false; activeKey.value = 'MR' } });
+      if (type) r.forEach((i) => { if (i.type == 'ER' && i.count) { type = false; activeKey.value = 'ER' } });
+      if (type) r.forEach((i) => { if (i.type == 'DR' && i.count) { type = false; activeKey.value = 'DR' } });
     }
 
     return {