|
@@ -209,22 +209,24 @@ module.exports = app => {
|
|
|
throw '没有访问权限';
|
|
|
}
|
|
|
|
|
|
+ let keyword = '';
|
|
|
+ if (ctx.query.keyword) {
|
|
|
+ keyword = ctx.query.keyword;
|
|
|
+ }
|
|
|
+
|
|
|
// 获取数据规则
|
|
|
- // const rule = ctx.service.projectAccount.rule('updateUser');
|
|
|
- // const frontRule = ctx.helper.validateConvert(rule);
|
|
|
const page = ctx.page;
|
|
|
const pageSize = ctx.pageSize;
|
|
|
+ const columns = ['id', 'account', 'name', 'company', 'role', 'mobile', 'auth_mobile', 'telephone', 'enable', 'is_admin', 'bind', 'account_group', 'permission', 'cooperation'];
|
|
|
+ // 过滤数据
|
|
|
+ ctx.service.projectAccount.searchFilter(ctx.request.query, projectId, columns);
|
|
|
ctx.sort = ['id', 'desc'];
|
|
|
- const total = await ctx.service.projectAccount.count({ project_id: projectId });
|
|
|
- // 获取项目用户列表
|
|
|
- // const accountData = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
- // where: { project_id: projectId },
|
|
|
- // columns: ['id', 'account', 'name', 'company', 'role', 'is_admin', 'account_group', 'permission', 'cooperation'],
|
|
|
- // });
|
|
|
+ const total = await ctx.service.projectAccount.getCountWithBuilder();
|
|
|
|
|
|
- const columns = ['id', 'account', 'name', 'company', 'role', 'is_admin', 'account_group', 'permission', 'cooperation'];
|
|
|
+ const accountData = await ctx.service.projectAccount.getListWithBuilder();
|
|
|
|
|
|
- const accountData = await ctx.service.projectAccount.getListByProjectId(columns, projectId);
|
|
|
+ // 获取账号个数
|
|
|
+ const user_total = await ctx.service.projectAccount.count({ project_id: projectId });
|
|
|
|
|
|
// 分页相关
|
|
|
const pageInfo = {
|
|
@@ -241,9 +243,10 @@ module.exports = app => {
|
|
|
accountData,
|
|
|
accountGroup,
|
|
|
permission,
|
|
|
+ keyword,
|
|
|
permissionStr: JSON.stringify(permission),
|
|
|
pageInfo,
|
|
|
- user_total: total,
|
|
|
+ user_total,
|
|
|
// rule: JSON.stringify(frontRule),
|
|
|
};
|
|
|
await this.layout('setting/user_permission.ejs', renderData, 'setting/user_permission_modal.ejs');
|