|
@@ -91,21 +91,37 @@ module.exports = app => {
|
|
|
throw '没有访问权限';
|
|
|
}
|
|
|
|
|
|
+ const page = ctx.page;
|
|
|
+
|
|
|
// 获取数据规则
|
|
|
// const rule = ctx.service.projectAccount.rule('updateUser');
|
|
|
// const frontRule = ctx.helper.validateConvert(rule);
|
|
|
|
|
|
+ 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', 'mobile', 'auth_mobile', 'telephone', 'enable', 'is_admin', 'account_group'],
|
|
|
- });
|
|
|
+ // const accountData = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
+ // where: { project_id: projectId },
|
|
|
+ // columns: ['id', 'account', 'name', 'company', 'role', 'mobile', 'auth_mobile', 'telephone', 'enable', 'is_admin', 'account_group'],
|
|
|
+ // limit: (app.config.pageSize * (page - 1)),
|
|
|
+ // offset: app.config.pageSize,
|
|
|
+ // });
|
|
|
+ const columns = ['id', 'account', 'name', 'company', 'role', 'mobile', 'auth_mobile', 'telephone', 'enable', 'is_admin', 'account_group'];
|
|
|
+ const accountData = await ctx.service.projectAccount.getListByProjectId(columns, projectId);
|
|
|
+
|
|
|
+ // 分页相关
|
|
|
+ const pageInfo = {
|
|
|
+ page,
|
|
|
+ total: Math.ceil(total / app.config.pageSize),
|
|
|
+ queryData: JSON.stringify(ctx.urlInfo.query),
|
|
|
+ };
|
|
|
|
|
|
const renderData = {
|
|
|
projectData,
|
|
|
accountData,
|
|
|
accountGroup,
|
|
|
permission,
|
|
|
+ pageInfo,
|
|
|
// rule: JSON.stringify(frontRule),
|
|
|
};
|
|
|
await this.layout('setting/user.ejs', renderData, 'setting/user_modal.ejs');
|
|
@@ -135,12 +151,24 @@ module.exports = app => {
|
|
|
// 获取数据规则
|
|
|
// const rule = ctx.service.projectAccount.rule('updateUser');
|
|
|
// const frontRule = ctx.helper.validateConvert(rule);
|
|
|
-
|
|
|
+ const page = ctx.page;
|
|
|
+ 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 accountData = await ctx.service.projectAccount.getAllDataByCondition({
|
|
|
+ // where: { project_id: projectId },
|
|
|
+ // columns: ['id', 'account', 'name', 'company', 'role', 'is_admin', 'account_group', 'permission', 'cooperation'],
|
|
|
+ // });
|
|
|
+
|
|
|
+ const columns = ['id', 'account', 'name', 'company', 'role', 'is_admin', 'account_group', 'permission', 'cooperation'];
|
|
|
+
|
|
|
+ const accountData = await ctx.service.projectAccount.getListByProjectId(columns, projectId);
|
|
|
+
|
|
|
+ // 分页相关
|
|
|
+ const pageInfo = {
|
|
|
+ page,
|
|
|
+ total: Math.ceil(total / app.config.pageSize),
|
|
|
+ queryData: JSON.stringify(ctx.urlInfo.query),
|
|
|
+ };
|
|
|
|
|
|
const renderData = {
|
|
|
projectData,
|
|
@@ -148,6 +176,7 @@ module.exports = app => {
|
|
|
accountGroup,
|
|
|
permission,
|
|
|
permissionStr: JSON.stringify(permission),
|
|
|
+ pageInfo,
|
|
|
// rule: JSON.stringify(frontRule),
|
|
|
};
|
|
|
await this.layout('setting/user_permission.ejs', renderData, 'setting/user_permission_modal.ejs');
|