From 41fc3d69e920ca286591352f7f6d03ccaad1e794 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 26 九月 2025 15:42:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao

---
 admin/src/views/system/menu.vue |   47 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/admin/src/views/system/menu.vue b/admin/src/views/system/menu.vue
index 44e1bac..849b26e 100644
--- a/admin/src/views/system/menu.vue
+++ b/admin/src/views/system/menu.vue
@@ -11,7 +11,7 @@
     <!-- 琛ㄦ牸鍜屽垎椤� -->
     <template v-slot:table-wrap>
       <ul class="toolbar" v-permissions="['system:menu:create', 'system:menu:delete', 'system:menu:sort']">
-        <li><el-button type="primary" @click="$refs.operaMenuWindow.open(activeGroup==0?'鏂板缓涓�绾ц彍鍗�':'鏂板缓椤堕儴瀵艰埅鑿滃崟',null,null,activeGroup)" icon="el-icon-plus" v-permissions="['system:menu:create']">鏂板缓</el-button></li>
+        <li><el-button type="primary" @click="$refs.operaMenuWindow.open(activeType==0?'鏂板缓涓�绾ц彍鍗�':'鏂板缓椤堕儴瀵艰埅鑿滃崟',null,null,activeType)" icon="el-icon-plus" v-permissions="['system:menu:create']">鏂板缓</el-button></li>
         <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['system:menu:delete']">鍒犻櫎</el-button></li>
         <li><el-button @click="sort('top')" :loading="isWorking.sort" icon="el-icon-sort-up" v-permissions="['system:menu:sort']">涓婄Щ</el-button></li>
         <li><el-button @click="sort('bottom')" :loading="isWorking.sort" icon="el-icon-sort-down" v-permissions="['system:menu:sort']">涓嬬Щ</el-button></li>
@@ -35,9 +35,14 @@
             <template v-else>鏈缃�</template>
           </template>
         </el-table-column>
-        <el-table-column prop="path" label="璁块棶璺緞" show-tooltip-when-overflow min-width="220px"></el-table-column>
+        <el-table-column prop="path" label="璁块棶璺緞" show-tooltip-when-overflow min-width="200px"></el-table-column>
         <el-table-column prop="params" label="鍙傛暟" min-width="120px"></el-table-column>
-        <el-table-column prop="remark" label="澶囨敞" min-width="120px"></el-table-column>
+        <el-table-column prop="linkType" label="鑿滃崟绫诲瀷" min-width="80px">
+          <template slot-scope="{row}">
+            {{row.linkType == 1 ? '澶栭儴绯荤粺' : '鍐呴儴绯荤粺'}}
+          </template>
+        </el-table-column>
+        <el-table-column prop="remark" label="澶囨敞" min-width="150px" show-tooltip-when-overflow></el-table-column>
         <el-table-column prop="createUser" label="鍒涘缓浜�" min-width="100px">
           <template slot-scope="{row}">{{row.createUserInfo == null ? '' : row.createUserInfo.username}}</template>
         </el-table-column>
@@ -58,8 +63,8 @@
           fixed="right"
         >
           <template slot-scope="{row}">
-            <el-button type="text" icon="el-icon-edit" @click="$refs.operaMenuWindow.open('缂栬緫鑿滃崟', row,null,activeGroup)" v-permissions="['system:menu:update']">缂栬緫</el-button>
-            <el-button v-if="activeGroup !== 1" type="text" icon="el-icon-plus" @click="$refs.operaMenuWindow.open('鏂板缓瀛愯彍鍗�', null, row,activeGroup)" v-permissions="['system:menu:create']">鏂板缓瀛愯彍鍗�</el-button>
+            <el-button type="text" icon="el-icon-edit" @click="$refs.operaMenuWindow.open('缂栬緫鑿滃崟', row,null,activeType)" v-permissions="['system:menu:update']">缂栬緫</el-button>
+            <el-button v-if="activeGroup !== 1" type="text" icon="el-icon-plus" @click="$refs.operaMenuWindow.open('鏂板缓瀛愯彍鍗�', null, row,activeType)" v-permissions="['system:menu:create']">鏂板缓瀛愯彍鍗�</el-button>
             <el-button v-if="!row.fixed" type="text" icon="el-icon-delete" @click="deleteById(row)" v-permissions="['system:menu:delete']">鍒犻櫎</el-button>
           </template>
         </el-table-column>
@@ -82,8 +87,10 @@
   data () {
     return {
       // 鏄惁姝e湪澶勭悊涓�
-      activeGroup: 0,
-      groupList:[{id:0,name: "鏈嶅姟涓績鑿滃崟"},{id:1,name: "椤堕儴瀵艰埅閰嶇疆"}],
+      activeGroup: -1,
+      activeType: 1,
+      topMenuId:null,
+      groupList:[{id:-1,name: "椤堕儴瀵艰埅閰嶇疆",type:1},{id:-2,name: "绯荤粺宸︿晶鑿滃崟",type:0}],
       isWorking: {
         sort: false
       }
@@ -92,14 +99,36 @@
   methods: {
     groupClick(item){
       this.activeGroup = item.id
+      this.activeType = item.type
       this.handlePageChange();
     },
     // 鏌ヨ鏁版嵁
     handlePageChange () {
       this.isWorking.search = true
-      fetchTree({type: this.activeGroup})
+      fetchTree({type: this.activeType == 1?this.activeType:null})
         .then(records => {
-          this.tableData.list = records
+          if(this.activeType === 1){
+            this.tableData.list = records
+            this.groupList = [{id:-1,name: "椤堕儴瀵艰埅閰嶇疆",type:1}]
+            var tops = []
+            this.tableData.list.forEach(item=>{
+              if(item.linkType !== 1){
+                tops.push({id:item.id,name: item.name,type:0})
+              }
+            })
+            if(tops.length){
+              this.groupList.push(...tops)
+            }else {
+              this.groupList.push({id:0,name: "绯荤粺宸︿晶鑿滃崟",type:0})
+            }
+          }else{
+            //濡傛灉鏄唴閮ㄨ彍鍗�
+            records.forEach(item =>{
+              if(item.id === this.activeGroup){
+                this.tableData.list =item.children
+              }
+            })
+          }
         })
         .catch(e => {
           this.$tip.apiFailed(e)

--
Gitblit v1.9.3