瀏覽代碼

修改菜单管理

bihuisong 1 年之前
父節點
當前提交
5114c065e7

+ 33 - 0
sooka-modules/sooka-system/src/main/java/com/sooka/system/domain/SysMenu.java

@@ -98,6 +98,39 @@ public class SysMenu extends BaseEntity {
      */
      */
     private List<SysMenu> children = new ArrayList<SysMenu>();
     private List<SysMenu> children = new ArrayList<SysMenu>();
 
 
+    /**对应前端类型*/
+    private String frontType;
+
+    private String[] frontTypes;
+
+    public String[] getFrontTypes() {
+        return frontTypes;
+    }
+
+    public void setFrontTypes(String[] frontTypes) {
+        this.frontTypes = frontTypes;
+    }
+
+    /**用户id*/
+    private Long userId;
+
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getFrontType() {
+        return frontType;
+    }
+
+    public void setFrontType(String frontType) {
+        this.frontType = frontType;
+    }
+
     public Long getMenuId() {
     public Long getMenuId() {
         return menuId;
         return menuId;
     }
     }

+ 24 - 1
sooka-modules/sooka-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -25,6 +25,7 @@
         <result property="updateTime" column="update_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateBy" column="update_by"/>
         <result property="remark" column="remark"/>
         <result property="remark" column="remark"/>
+        <result property="frontType"         column="front_type"         />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectMenuVo">
     <sql id="selectMenuVo">
@@ -42,7 +43,8 @@
                status,
                status,
                ifnull(perms, '') as perms,
                ifnull(perms, '') as perms,
                icon,
                icon,
-               create_time
+               create_time,
+               front_type
         from sys_menu
         from sys_menu
     </sql>
     </sql>
 
 
@@ -58,6 +60,9 @@
             <if test="status != null and status != ''">
             <if test="status != null and status != ''">
                 AND status = #{status}
                 AND status = #{status}
             </if>
             </if>
+            <if test="frontType != null and frontType != ''">
+                AND front_type = #{frontType}
+            </if>
         </where>
         </where>
         order by parent_id, order_num
         order by parent_id, order_num
     </select>
     </select>
@@ -81,6 +86,12 @@
         from sys_menu m
         from sys_menu m
         where m.menu_type in ('M', 'C')
         where m.menu_type in ('M', 'C')
           and m.status = 0
           and m.status = 0
+        <if test="frontTypes != null">
+            and m.front_type
+            <foreach collection="frontTypes" item="frontType" index="index" open="in (" close=")" separator="," >
+                #{frontType}
+            </foreach>
+        </if>
         order by m.parent_id, m.order_num
         order by m.parent_id, m.order_num
     </select>
     </select>
 
 
@@ -101,6 +112,9 @@
         <if test="status != null and status != ''">
         <if test="status != null and status != ''">
             AND m.status = #{status}
             AND m.status = #{status}
         </if>
         </if>
+        <if test="frontType != null and frontType != ''">
+            AND m.front_type = #{frontType}
+        </if>
         order by m.parent_id, m.order_num
         order by m.parent_id, m.order_num
     </select>
     </select>
 
 
@@ -126,6 +140,12 @@
                  left join sys_role ro on ur.role_id = ro.role_id
                  left join sys_role ro on ur.role_id = ro.role_id
                  left join sys_user u on ur.user_id = u.user_id
                  left join sys_user u on ur.user_id = u.user_id
         where u.user_id = #{userId}
         where u.user_id = #{userId}
+        <if test="frontTypes != null">
+            and m.front_type
+            <foreach collection="frontTypes" item="frontType" index="index" open="in (" close=")" separator="," >
+                #{frontType}
+            </foreach>
+        </if>
           and m.menu_type in ('M', 'C')
           and m.menu_type in ('M', 'C')
           and m.status = 0
           and m.status = 0
           AND ro.status = 0
           AND ro.status = 0
@@ -204,6 +224,7 @@
             <if test="icon !=null and icon != ''">icon = #{icon},</if>
             <if test="icon !=null and icon != ''">icon = #{icon},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            <if test="frontType != null and frontType != ''">front_type = #{frontType},</if>
             update_time = sysdate()
             update_time = sysdate()
         </set>
         </set>
         where menu_id = #{menuId}
         where menu_id = #{menuId}
@@ -227,6 +248,7 @@
         <if test="icon != null and icon != ''">icon,</if>
         <if test="icon != null and icon != ''">icon,</if>
         <if test="remark != null and remark != ''">remark,</if>
         <if test="remark != null and remark != ''">remark,</if>
         <if test="createBy != null and createBy != ''">create_by,</if>
         <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="frontType != null and frontType != ''">front_type,</if>
         create_time
         create_time
         )values(
         )values(
         <if test="menuId != null and menuId != 0">#{menuId},</if>
         <if test="menuId != null and menuId != 0">#{menuId},</if>
@@ -245,6 +267,7 @@
         <if test="icon != null and icon != ''">#{icon},</if>
         <if test="icon != null and icon != ''">#{icon},</if>
         <if test="remark != null and remark != ''">#{remark},</if>
         <if test="remark != null and remark != ''">#{remark},</if>
         <if test="createBy != null and createBy != ''">#{createBy},</if>
         <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="frontType != null and frontType != ''">#{frontType},</if>
         sysdate()
         sysdate()
         )
         )
     </insert>
     </insert>

+ 18 - 1
sooka-ui/src/views/system/menu/index.vue

@@ -77,6 +77,11 @@
           <span>{{ parseTime(scope.row.createTime) }}</span>
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
+      <el-table-column label="前端类型" align="center" prop="frontType">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.front_type" :value="scope.row.frontType"/>
+        </template>
+      </el-table-column>
       <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
       <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button
           <el-button
@@ -158,6 +163,18 @@
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
           <el-col :span="12">
           <el-col :span="12">
+            <el-form-item label="前端类型" prop="menuName">
+              <el-select v-model="form.frontType" placeholder="前端类型">
+                <el-option
+                  v-for="dict in dict.type.front_type"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
             <el-form-item label="显示排序" prop="orderNum">
             <el-form-item label="显示排序" prop="orderNum">
               <el-input-number v-model="form.orderNum" :min="0" controls-position="right"/>
               <el-input-number v-model="form.orderNum" :min="0" controls-position="right"/>
             </el-form-item>
             </el-form-item>
@@ -289,7 +306,7 @@ import IconSelect from "@/components/IconSelect";
 
 
 export default {
 export default {
   name: "Menu",
   name: "Menu",
-  dicts: ['sys_show_hide', 'sys_normal_disable'],
+  dicts: ['sys_show_hide', 'sys_normal_disable','front_type'],
   components: {Treeselect, IconSelect},
   components: {Treeselect, IconSelect},
   data() {
   data() {
     return {
     return {