From 2af534eea471f4adb104906c7a814bcc66d4d68d Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 13 九月 2021 13:03:58 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

---
 ruoyi-ui/src/views/system/menu/index.vue |   62 ++++++++++++++++++++++++-------
 1 files changed, 48 insertions(+), 14 deletions(-)

diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue
index e59d1a6..0f4296c 100644
--- a/ruoyi-ui/src/views/system/menu/index.vue
+++ b/ruoyi-ui/src/views/system/menu/index.vue
@@ -37,13 +37,24 @@
           v-hasPermi="['system:menu:add']"
         >鏂板</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-sort"
+          size="mini"
+          @click="toggleExpandAll"
+        >灞曞紑/鎶樺彔</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table
+      v-if="refreshTable"
       v-loading="loading"
       :data="menuList"
       row-key="menuId"
+      :default-expand-all="isExpandAll"
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
       <el-table-column prop="menuName" label="鑿滃崟鍚嶇О" :show-overflow-tooltip="true" width="160"></el-table-column>
@@ -195,6 +206,31 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
+            <el-form-item v-if="form.menuType == 'C'">
+              <el-input v-model="form.query" placeholder="璇疯緭鍏ヨ矾鐢卞弬鏁�" maxlength="255" />
+              <span slot="label">
+                <el-tooltip content='璁块棶璺敱鐨勯粯璁や紶閫掑弬鏁帮紝濡傦細`{"id": 1, "name": "ry"}`' placement="top">
+                <i class="el-icon-question"></i>
+                </el-tooltip>
+                璺敱鍙傛暟
+              </span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item v-if="form.menuType == 'C'">
+              <span slot="label">
+                <el-tooltip content="閫夋嫨鏄垯浼氳`keep-alive`缂撳瓨锛岄渶瑕佸尮閰嶇粍浠剁殑`name`鍜屽湴鍧�淇濇寔涓�鑷�" placement="top">
+                <i class="el-icon-question"></i>
+                </el-tooltip>
+                鏄惁缂撳瓨
+              </span>
+              <el-radio-group v-model="form.isCache">
+                <el-radio label="0">缂撳瓨</el-radio>
+                <el-radio label="1">涓嶇紦瀛�</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item v-if="form.menuType != 'F'">
               <span slot="label">
                 <el-tooltip content="閫夋嫨闅愯棌鍒欒矾鐢卞皢涓嶄細鍑虹幇鍦ㄤ晶杈规爮锛屼絾浠嶇劧鍙互璁块棶" placement="top">
@@ -225,20 +261,6 @@
                   :key="dict.dictValue"
                   :label="dict.dictValue"
                 >{{dict.dictLabel}}</el-radio>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item v-if="form.menuType == 'C'">
-              <span slot="label">
-                <el-tooltip content="閫夋嫨鏄垯浼氳`keep-alive`缂撳瓨锛岄渶瑕佸尮閰嶇粍浠剁殑`name`鍜屽湴鍧�淇濇寔涓�鑷�" placement="top">
-                <i class="el-icon-question"></i>
-                </el-tooltip>
-                鏄惁缂撳瓨
-              </span>
-              <el-radio-group v-model="form.isCache">
-                <el-radio label="0">缂撳瓨</el-radio>
-                <el-radio label="1">涓嶇紦瀛�</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>
@@ -275,6 +297,10 @@
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
+      // 鏄惁灞曞紑锛岄粯璁ゅ叏閮ㄦ姌鍙�
+      isExpandAll: false,
+      // 閲嶆柊娓叉煋琛ㄦ牸鐘舵��
+      refreshTable: true,
       // 鏄剧ず鐘舵�佹暟鎹瓧鍏�
       visibleOptions: [],
       // 鑿滃崟鐘舵�佹暟鎹瓧鍏�
@@ -384,6 +410,14 @@
       this.open = true;
       this.title = "娣诲姞鑿滃崟";
     },
+    /** 灞曞紑/鎶樺彔鎿嶄綔 */
+    toggleExpandAll() {
+      this.refreshTable = false;
+      this.isExpandAll = !this.isExpandAll;
+      this.$nextTick(() => {
+        this.refreshTable = true;
+      });
+    },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       this.reset();

--
Gitblit v1.9.3