Browse Source

(*)角色列表获取数据范围值

master
zmh 1 year ago
parent
commit
99141724fd
  1. 7
      api/app/lib/controllers/roleResource/index.js
  2. 5
      web/client/src/sections/humanAffairs/containers/employeeAuth.jsx

7
api/app/lib/controllers/roleResource/index.js

@ -8,7 +8,12 @@ async function get(ctx) {
const { id } = ctx.request.query
let roleResourceList = await models.RoleResource.findAndCountAll({
order: [['id', 'desc']],
where: { roleId: id }
where: { roleId: id },
include: [{
model: models.Role,
attributes: ['id', 'dataRange'],
}],
distinct: true
});
ctx.status = 200
ctx.body = roleResourceList;

5
web/client/src/sections/humanAffairs/containers/employeeAuth.jsx

@ -295,6 +295,10 @@ const EmployeeAuth = (props) => {
dispatch(actions.humanAffairs.delRole(data)).then(e => {
if (e.success) {
getRoleList()
setAllChecked(false);
setTwo({})
setCheckedList([]);
setDataRange(1);
}
})
}
@ -315,6 +319,7 @@ const EmployeeAuth = (props) => {
two[e.resId] = true
return e.resId
})
setDataRange(res.payload.data.rows[0].role.dataRange || 1);
setCheckedList(checkList)
setTwo(two)
const resourceIdAll = getResourceIdAll();

Loading…
Cancel
Save