From cb6aca0642ac8dd5de877ade168066d85acb589c Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 17 十月 2025 15:54:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao

---
 admin/src/components/common/MenuSelect.vue |   49 +++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/admin/src/components/common/MenuSelect.vue b/admin/src/components/common/MenuSelect.vue
index ea5f26c..5373411 100644
--- a/admin/src/components/common/MenuSelect.vue
+++ b/admin/src/components/common/MenuSelect.vue
@@ -12,6 +12,7 @@
 
 <script>
 import TreeSelect from './TreeSelect'
+// import { fetchTree, fetchTree1 } from '@/api/system/menu'
 import { fetchTree } from '@/api/system/menu'
 export default {
   name: 'MenuSelect',
@@ -20,6 +21,9 @@
     value: {},
     inline: {
       default: true
+    },
+    type: {
+      default: '0'
     },
     placeholder: {
       default: '璇烽�夋嫨鑿滃崟'
@@ -32,7 +36,8 @@
       default: false
     },
     // 闇�琚帓闄ょ殑閮ㄩ棬ID
-    excludeId: {}
+    excludeId: {},
+    topMenuId: {}
   },
   data () {
     return {
@@ -42,24 +47,48 @@
   watch: {
     excludeId () {
       this.fetchData()
+    },
+    topMenuId () {
+      this.fetchData()
     }
   },
   methods: {
     // 鑾峰彇鎵�鏈夎彍鍗�
     fetchData () {
-      fetchTree()
-        .then(records => {
-          this.data = []
-          this.__fillData(this.data, records)
-        })
-        .catch(e => {
-          this.$tip.apiFailed(e)
-        })
+      if (this.type === '1') {
+        // fetchTree1()
+        //   .then(records => {
+        //     this.data = []
+        //     this.__fillData(this.data, records)
+        //   })
+        //   .catch(e => {
+        //     this.$tip.apiFailed(e)
+        //   })
+      } else {
+        fetchTree()
+          .then(records => {
+            this.data = []
+            var res = [];
+            if(this.topMenuId){
+              records.forEach(item => {
+                if(item.id == this.topMenuId){
+                  res = item.children
+                }
+              })
+            }else{
+              res = records
+            }
+            this.__fillData(this.data, res)
+          })
+          .catch(e => {
+            this.$tip.apiFailed(e)
+          })
+      }
     },
     // 濉厖鑿滃崟鏍�
     __fillData (list, pool) {
       for (const menu of pool) {
-        if (menu.id === this.excludeId) {
+        if (menu.id === this.excludeId || menu.linkType ===1) {
           continue
         }
         const menuNode = {

--
Gitblit v1.9.3