jeecg数据权限问题
在controller层方法添加注解如下,pageComponent 后面为组件路径
@PermissionData(pageComponent = "expenditure/ExpenditureApprovalBatchList")
在service层写以下代码
public IPage<ExpenditurePlanVo> queryPageList(Page<ExpenditurePlanVo> page, ExpenditurePlanVo expenditurePlanVo) {
expenditurePlanVo.setPermissionSql(QueryGenerator.installAuthJdbcCustom(ExpenditurePlan.class,"a"))
}
规则名称:查询归口科室
规则字段:centralizedDeptId(需要权限的相对应的字段,使用实体类的字段名(驼峰))
条件规则:选择模糊
规则值:#{sys_dept_id}(填写上下文变量,使用账号所属部门进行匹配值)
条件查询--后端
使用vo接收条件参数,如mapper方法
public IPage<ExpenditurePlanVo> queryPageList(Page<ExpenditurePlanVo> page, @Param("map")ExpenditurePlanVo expenditurePlanVo);
mapper.xml文件编写循环条件参数,vo添加centralizedDeptId、centDeptIdList两个参数,centDeptIdList为List<String>类型,centralizedDeptId为String类型
<if test="map.centralizedDeptId != null and map.centralizedDeptId != ''">
and
<foreach collection="map.centDeptIdList" item="item" index="index" open="(" separator="or" close=")">
b.centralized_dept_id = ${item}
</foreach>
</if>
前端组件增加滚动条
可以在组件外面包一层div,使用css样式的overflow-y
<template>
<div class="list">
<a-form :form="form">
</a-form>
</div>
</template>
<style scoped>
.list{
width: 100%;
height: 400px;
overflow-y: auto;
}
</style>