Browse Source

代码保存

ZL 2 tuần trước cách đây
mục cha
commit
83e3771c8f

+ 3 - 2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java

@@ -476,10 +476,11 @@ public class SysRoleController {
 		//------------------------------------------------------------------------------------------------
 		
 		// Step.1 组装查询条件
-		QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
+//		QueryWrapper<SysRole> queryWrapper = QueryGenerator.initQueryWrapper(sysRole, request.getParameterMap());
+		String ids = request.getParameter("ids");
 		//Step.2 AutoPoi 导出Excel
 		ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-		List<SysRole> pageList = sysRoleService.listExport(sysRole);
+		List<SysRole> pageList = sysRoleService.listExport(sysRole,ids);
 		//导出文件名称
 		mv.addObject(NormalExcelConstants.FILE_NAME,"角色列表");
 		mv.addObject(NormalExcelConstants.CLASS,SysRole.class);

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysRoleMapper.java

@@ -76,7 +76,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
     @Select("select count(*) from sys_role where id=#{id} and tenant_id=#{tenantId}")
     Long getRoleCountByTenantId(@Param("id") String id, @Param("tenantId") Integer tenantId);
 
-    List<SysRole> listExport(@Param("role") SysRole role);
+    List<SysRole> listExport(@Param("role") SysRole role, @Param("ids")String ids);
 
     List<String> listRoleIdsByAppId(@Param("appId") String appId);
 

+ 3 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysRoleMapper.xml

@@ -57,6 +57,9 @@
         INNER JOIN
         app_base_info sa ON r.app_id = sa.id
         WHERE 1=1
+          <if test="ids!=null">
+            AND r.id in (#{ids})
+        </if>
         <if test="role.appId!=null">
             AND r.app_id = #{role.appId}
         </if>

+ 1 - 1
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/ISysRoleService.java

@@ -80,5 +80,5 @@ public interface ISysRoleService extends IService<SysRole> {
      */
     void checkAdminRoleRejectDel(String ids);
 
-    List<SysRole> listExport(SysRole role);
+    List<SysRole> listExport(SysRole role,String ids);
 }

+ 2 - 2
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysRoleServiceImpl.java

@@ -135,7 +135,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
     }
 
     @Override
-    public List<SysRole> listExport(SysRole role) {
-        return sysRoleMapper.listExport(role);
+    public List<SysRole> listExport(SysRole role, String ids) {
+        return sysRoleMapper.listExport(role,ids);
     }
 }

+ 4 - 1
jeecgboot-vue3/src/views/system/role/index.vue

@@ -113,7 +113,10 @@ const { prefixCls, tableContext, onImportXls, onExportXls } = useListPage({
   },
   exportConfig: {
     name: '角色列表',
-    url: getExportUrl,
+    url: ()=>{
+      const ids = encodeURIComponent(JSON.stringify(selectedRowKeys))
+      return `${getExportUrl}?ids=${ids}`;
+    },
   },
   importConfig: {
     url: getImportUrl,