| | |
| | | @RequestMapping(value = "/user/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(userService.getById(String.valueOf(id))); |
| | | User user = userService.getById(String.valueOf(id)); |
| | | sanitizeUser(user); |
| | | return R.ok(user); |
| | | } |
| | | |
| | | @RequestMapping(value = "/user/list/auth") |
| | |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy(true, false, "id"); |
| | | Page<User> page; |
| | | if (9527 == getUserId()) { |
| | | return R.ok(userService.page(new Page<>(curr, limit), wrapper)); |
| | | page = userService.page(new Page<>(curr, limit), wrapper); |
| | | sanitizeUsers(page.getRecords()); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | Long roleId = getUser().getRoleId(); |
| | |
| | | wrapper.notIn("role_id", leaderIds); |
| | | } |
| | | |
| | | return R.ok(userService.page(new Page<>(curr, limit), wrapper)); |
| | | page = userService.page(new Page<>(curr, limit), wrapper); |
| | | sanitizeUsers(page.getRecords()); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | |
| | | wrapper.set("role_id", user.getRoleId()); |
| | | needUpdate = true; |
| | | } |
| | | if (user.getStatus() != null) { |
| | | wrapper.set("status", user.getStatus()); |
| | | needUpdate = true; |
| | | } |
| | | if (user.getMfaAllow() != null) { |
| | | int mfaAllow = normalizeMfaAllow(user.getMfaAllow()); |
| | | wrapper.set("mfa_allow", mfaAllow); |
| | |
| | | .eq("id", user.getId()) |
| | | .set("password", password)); |
| | | userLoginService.remove(new QueryWrapper<UserLogin>().eq("user_id", user.getId()).eq("system_type", "WCS")); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/user/resetPassword/auth") |
| | | @ManagerAuth(memo = "系统用户重置密码") |
| | | public R resetPassword(Long id, String password) { |
| | | if (id == null || Cools.isEmpty(password)) { |
| | | return R.error(); |
| | | } |
| | | User user = userService.getById(id); |
| | | if (Cools.isEmpty(user)) { |
| | | return new R(10001, i18nMessageService.getMessage("response.user.notFound")); |
| | | } |
| | | userService.update(new UpdateWrapper<User>() |
| | | .eq("id", id) |
| | | .set("password", password)); |
| | | userLoginService.remove(new QueryWrapper<UserLogin>().eq("user_id", id).eq("system_type", "WCS")); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return Integer.valueOf(1).equals(mfaAllow) ? 1 : 0; |
| | | } |
| | | |
| | | private void sanitizeUsers(List<User> users) { |
| | | if (users == null) { |
| | | return; |
| | | } |
| | | for (User user : users) { |
| | | sanitizeUser(user); |
| | | } |
| | | } |
| | | |
| | | private void sanitizeUser(User user) { |
| | | if (user == null) { |
| | | return; |
| | | } |
| | | user.setPassword(null); |
| | | user.setMfaSecret(null); |
| | | } |
| | | |
| | | } |
| | |
| | | (function () { |
| | | var simpleEntityName = 'user'; |
| | | var entityName = 'User'; |
| | | var primaryKeyField = 'id'; |
| | | var fieldMeta = dedupeFieldMeta([ |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: 'I D', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '账 号', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: true, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '昵 称', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '头 像', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'code', |
| | | columnName: 'code', |
| | | label: '工 号', |
| | | tableProp: 'code', |
| | | exportField: 'code', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性 别', |
| | | tableProp: 'sex$', |
| | | exportField: 'sex$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '未知' }, { rawValue: '1', label: '男' }, { rawValue: '2', label: '女' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'phone', |
| | | columnName: 'phone', |
| | | label: '手 机 号', |
| | | tableProp: 'phone', |
| | | exportField: 'phone', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 116, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮 箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'emailVerified', |
| | | columnName: 'email_verified', |
| | | label: '邮箱验证', |
| | | tableProp: 'emailVerified$', |
| | | exportField: 'emailVerified$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '否' }, { rawValue: '1', label: '是' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '所属部门', |
| | | tableProp: 'deptId$', |
| | | exportField: 'deptId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'dept', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'realName', |
| | | columnName: 'real_name', |
| | | label: '真实姓名', |
| | | tableProp: 'realName', |
| | | exportField: 'realName', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'idCard', |
| | | columnName: 'id_card', |
| | | label: '身份证号', |
| | | tableProp: 'idCard', |
| | | exportField: 'idCard', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'birthday', |
| | | columnName: 'birthday', |
| | | label: '出生日期', |
| | | tableProp: 'birthday', |
| | | exportField: 'birthday', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'introduction', |
| | | columnName: 'introduction', |
| | | label: '个人简介', |
| | | tableProp: 'introduction', |
| | | exportField: 'introduction', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '所属机构', |
| | | tableProp: 'hostId$', |
| | | exportField: 'hostId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'host', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状 态', |
| | | tableProp: 'status$', |
| | | exportField: 'status$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '正常' }, { rawValue: '0', label: '禁用' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deleted', |
| | | columnName: 'deleted', |
| | | label: '是否删除', |
| | | tableProp: 'deleted$', |
| | | exportField: 'deleted$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '是' }, { rawValue: '0', label: '否' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '添加时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'createBy', |
| | | columnName: 'create_by', |
| | | label: '添加人员', |
| | | tableProp: 'createBy$', |
| | | exportField: 'createBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'updateTime', |
| | | columnName: 'update_time', |
| | | label: '修改时间', |
| | | tableProp: 'updateTime$', |
| | | exportField: 'updateTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'updateBy', |
| | | columnName: 'update_by', |
| | | label: '修改人员', |
| | | tableProp: 'updateBy$', |
| | | exportField: 'updateBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'memo', |
| | | columnName: 'memo', |
| | | label: '备 注', |
| | | tableProp: 'memo', |
| | | exportField: 'memo', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: true, |
| | | minWidth: 180, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: '*编 号', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '*授权商户', |
| | | tableProp: 'hostId', |
| | | exportField: 'hostId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '', |
| | | tableProp: 'deptId', |
| | | exportField: 'deptId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'roleId', |
| | | columnName: 'role_id', |
| | | label: '*角 色', |
| | | tableProp: 'roleId', |
| | | exportField: 'roleId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '登录账户', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '用户名', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'mobile', |
| | | columnName: 'mobile', |
| | | label: '手机号', |
| | | tableProp: 'mobile', |
| | | exportField: 'mobile', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性别', |
| | | tableProp: 'sex', |
| | | exportField: 'sex', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '注册时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状态', |
| | | tableProp: 'status', |
| | | exportField: 'status', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: '*编 号', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '*授权商户', |
| | | tableProp: 'hostId', |
| | | exportField: 'hostId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '', |
| | | tableProp: 'deptId', |
| | | exportField: 'deptId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'roleId', |
| | | columnName: 'role_id', |
| | | label: '*角 色', |
| | | tableProp: 'roleId', |
| | | exportField: 'roleId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '登录账户', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '用户名', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'mobile', |
| | | columnName: 'mobile', |
| | | label: '手机号', |
| | | tableProp: 'mobile', |
| | | exportField: 'mobile', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性别', |
| | | tableProp: 'sex', |
| | | exportField: 'sex', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '注册时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状态', |
| | | tableProp: 'status', |
| | | exportField: 'status', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: 'I D', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '账 号', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: true, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '昵 称', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '头 像', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'code', |
| | | columnName: 'code', |
| | | label: '工 号', |
| | | tableProp: 'code', |
| | | exportField: 'code', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性 别', |
| | | tableProp: 'sex$', |
| | | exportField: 'sex$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '未知' }, { rawValue: '1', label: '男' }, { rawValue: '2', label: '女' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'phone', |
| | | columnName: 'phone', |
| | | label: '手 机 号', |
| | | tableProp: 'phone', |
| | | exportField: 'phone', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 116, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮 箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'emailVerified', |
| | | columnName: 'email_verified', |
| | | label: '邮箱验证', |
| | | tableProp: 'emailVerified$', |
| | | exportField: 'emailVerified$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '否' }, { rawValue: '1', label: '是' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '所属部门', |
| | | tableProp: 'deptId$', |
| | | exportField: 'deptId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'dept', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'realName', |
| | | columnName: 'real_name', |
| | | label: '真实姓名', |
| | | tableProp: 'realName', |
| | | exportField: 'realName', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'idCard', |
| | | columnName: 'id_card', |
| | | label: '身份证号', |
| | | tableProp: 'idCard', |
| | | exportField: 'idCard', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'birthday', |
| | | columnName: 'birthday', |
| | | label: '出生日期', |
| | | tableProp: 'birthday', |
| | | exportField: 'birthday', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'introduction', |
| | | columnName: 'introduction', |
| | | label: '个人简介', |
| | | tableProp: 'introduction', |
| | | exportField: 'introduction', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'tenantId', |
| | | columnName: 'tenant_id', |
| | | label: '所属机构', |
| | | tableProp: 'tenantId$', |
| | | exportField: 'tenantId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'host', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状 态', |
| | | tableProp: 'status$', |
| | | exportField: 'status$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '正常' }, { rawValue: '0', label: '禁用' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deleted', |
| | | columnName: 'deleted', |
| | | label: '是否删除', |
| | | tableProp: 'deleted$', |
| | | exportField: 'deleted$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '是' }, { rawValue: '0', label: '否' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '添加时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'createBy', |
| | | columnName: 'create_by', |
| | | label: '添加人员', |
| | | tableProp: 'createBy$', |
| | | exportField: 'createBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'updateTime', |
| | | columnName: 'update_time', |
| | | label: '修改时间', |
| | | tableProp: 'updateTime$', |
| | | exportField: 'updateTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'updateBy', |
| | | columnName: 'update_by', |
| | | label: '修改人员', |
| | | tableProp: 'updateBy$', |
| | | exportField: 'updateBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'memo', |
| | | columnName: 'memo', |
| | | label: '备 注', |
| | | tableProp: 'memo', |
| | | exportField: 'memo', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: true, |
| | | minWidth: 180, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: '*编 号', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '*授权商户', |
| | | tableProp: 'hostId', |
| | | exportField: 'hostId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '', |
| | | tableProp: 'deptId', |
| | | exportField: 'deptId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'roleId', |
| | | columnName: 'role_id', |
| | | label: '*角 色', |
| | | tableProp: 'roleId', |
| | | exportField: 'roleId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '登录账户', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '用户名', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'mobile', |
| | | columnName: 'mobile', |
| | | label: '手机号', |
| | | tableProp: 'mobile', |
| | | exportField: 'mobile', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性别', |
| | | tableProp: 'sex', |
| | | exportField: 'sex', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '注册时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状态', |
| | | tableProp: 'status', |
| | | exportField: 'status', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: '*编 号', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '*授权商户', |
| | | tableProp: 'hostId', |
| | | exportField: 'hostId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '', |
| | | tableProp: 'deptId', |
| | | exportField: 'deptId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'roleId', |
| | | columnName: 'role_id', |
| | | label: '*角 色', |
| | | tableProp: 'roleId', |
| | | exportField: 'roleId', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '登录账户', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '用户名', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'mobile', |
| | | columnName: 'mobile', |
| | | label: '手机号', |
| | | tableProp: 'mobile', |
| | | exportField: 'mobile', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性别', |
| | | tableProp: 'sex', |
| | | exportField: 'sex', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '注册时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状态', |
| | | tableProp: 'status', |
| | | exportField: 'status', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: 'I D', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '账 号', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: true, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '昵 称', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '头 像', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'code', |
| | | columnName: 'code', |
| | | label: '工 号', |
| | | tableProp: 'code', |
| | | exportField: 'code', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性 别', |
| | | tableProp: 'sex$', |
| | | exportField: 'sex$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '未知' }, { rawValue: '1', label: '男' }, { rawValue: '2', label: '女' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'phone', |
| | | columnName: 'phone', |
| | | label: '手 机 号', |
| | | tableProp: 'phone', |
| | | exportField: 'phone', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 116, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮 箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'emailVerified', |
| | | columnName: 'email_verified', |
| | | label: '邮箱验证', |
| | | tableProp: 'emailVerified$', |
| | | exportField: 'emailVerified$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '否' }, { rawValue: '1', label: '是' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '所属部门', |
| | | tableProp: 'deptId$', |
| | | exportField: 'deptId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'dept', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'realName', |
| | | columnName: 'real_name', |
| | | label: '真实姓名', |
| | | tableProp: 'realName', |
| | | exportField: 'realName', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'idCard', |
| | | columnName: 'id_card', |
| | | label: '身份证号', |
| | | tableProp: 'idCard', |
| | | exportField: 'idCard', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'birthday', |
| | | columnName: 'birthday', |
| | | label: '出生日期', |
| | | tableProp: 'birthday', |
| | | exportField: 'birthday', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'introduction', |
| | | columnName: 'introduction', |
| | | label: '个人简介', |
| | | tableProp: 'introduction', |
| | | exportField: 'introduction', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '所属机构', |
| | | tableProp: 'hostId$', |
| | | exportField: 'hostId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'host', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状 态', |
| | | tableProp: 'status$', |
| | | exportField: 'status$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '正常' }, { rawValue: '0', label: '禁用' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deleted', |
| | | columnName: 'deleted', |
| | | label: '是否删除', |
| | | tableProp: 'deleted$', |
| | | exportField: 'deleted$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '是' }, { rawValue: '0', label: '否' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '添加时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'createBy', |
| | | columnName: 'create_by', |
| | | label: '添加人员', |
| | | tableProp: 'createBy$', |
| | | exportField: 'createBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'updateTime', |
| | | columnName: 'update_time', |
| | | label: '修改时间', |
| | | tableProp: 'updateTime$', |
| | | exportField: 'updateTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'updateBy', |
| | | columnName: 'update_by', |
| | | label: '修改人员', |
| | | tableProp: 'updateBy$', |
| | | exportField: 'updateBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'memo', |
| | | columnName: 'memo', |
| | | label: '备 注', |
| | | tableProp: 'memo', |
| | | exportField: 'memo', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: true, |
| | | minWidth: 180, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'id', |
| | | columnName: 'id', |
| | | label: 'I D', |
| | | tableProp: 'id', |
| | | exportField: 'id', |
| | | kind: 'text', |
| | | valueType: 'number', |
| | | required: true, |
| | | primaryKey: true, |
| | | sortable: true, |
| | | textarea: false, |
| | | minWidth: 90, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | columnName: 'username', |
| | | label: '账 号', |
| | | tableProp: 'username', |
| | | exportField: 'username', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: true, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'password', |
| | | columnName: 'password', |
| | | label: '密 码', |
| | | tableProp: 'password', |
| | | exportField: 'password', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'nickname', |
| | | columnName: 'nickname', |
| | | label: '昵 称', |
| | | tableProp: 'nickname', |
| | | exportField: 'nickname', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'avatar', |
| | | columnName: 'avatar', |
| | | label: '头 像', |
| | | tableProp: 'avatar', |
| | | exportField: 'avatar', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'code', |
| | | columnName: 'code', |
| | | label: '工 号', |
| | | tableProp: 'code', |
| | | exportField: 'code', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'sex', |
| | | columnName: 'sex', |
| | | label: '性 别', |
| | | tableProp: 'sex$', |
| | | exportField: 'sex$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '未知' }, { rawValue: '1', label: '男' }, { rawValue: '2', label: '女' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'phone', |
| | | columnName: 'phone', |
| | | label: '手 机 号', |
| | | tableProp: 'phone', |
| | | exportField: 'phone', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 116, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'email', |
| | | columnName: 'email', |
| | | label: '邮 箱', |
| | | tableProp: 'email', |
| | | exportField: 'email', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'emailVerified', |
| | | columnName: 'email_verified', |
| | | label: '邮箱验证', |
| | | tableProp: 'emailVerified$', |
| | | exportField: 'emailVerified$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '0', label: '否' }, { rawValue: '1', label: '是' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | columnName: 'dept_id', |
| | | label: '所属部门', |
| | | tableProp: 'deptId$', |
| | | exportField: 'deptId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'dept', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'realName', |
| | | columnName: 'real_name', |
| | | label: '真实姓名', |
| | | tableProp: 'realName', |
| | | exportField: 'realName', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'idCard', |
| | | columnName: 'id_card', |
| | | label: '身份证号', |
| | | tableProp: 'idCard', |
| | | exportField: 'idCard', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'birthday', |
| | | columnName: 'birthday', |
| | | label: '出生日期', |
| | | tableProp: 'birthday', |
| | | exportField: 'birthday', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'introduction', |
| | | columnName: 'introduction', |
| | | label: '个人简介', |
| | | tableProp: 'introduction', |
| | | exportField: 'introduction', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'hostId', |
| | | columnName: 'host_id', |
| | | label: '所属机构', |
| | | tableProp: 'hostId$', |
| | | exportField: 'hostId$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'host', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'status', |
| | | columnName: 'status', |
| | | label: '状 态', |
| | | tableProp: 'status$', |
| | | exportField: 'status$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '正常' }, { rawValue: '0', label: '禁用' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'deleted', |
| | | columnName: 'deleted', |
| | | label: '是否删除', |
| | | tableProp: 'deleted$', |
| | | exportField: 'deleted$', |
| | | kind: 'enum', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 120, |
| | | enumOptions: [{ rawValue: '1', label: '是' }, { rawValue: '0', label: '否' }], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | columnName: 'create_time', |
| | | label: '添加时间', |
| | | tableProp: 'createTime$', |
| | | exportField: 'createTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'createBy', |
| | | columnName: 'create_by', |
| | | label: '添加人员', |
| | | tableProp: 'createBy$', |
| | | exportField: 'createBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'updateTime', |
| | | columnName: 'update_time', |
| | | label: '修改时间', |
| | | tableProp: 'updateTime$', |
| | | exportField: 'updateTime$', |
| | | kind: 'date', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | }, |
| | | { |
| | | field: 'updateBy', |
| | | columnName: 'update_by', |
| | | label: '修改人员', |
| | | tableProp: 'updateBy$', |
| | | exportField: 'updateBy$', |
| | | kind: 'foreign', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: 'user', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0' |
| | | }, |
| | | { |
| | | field: 'memo', |
| | | columnName: 'memo', |
| | | label: '备 注', |
| | | tableProp: 'memo', |
| | | exportField: 'memo', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: true, |
| | | minWidth: 180, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N' |
| | | } |
| | | |
| | | ]); |
| | | fieldMeta.push({ |
| | | field: 'mfaAllow', |
| | | columnName: 'mfa_allow', |
| | | label: 'MFA授权', |
| | | tableProp: 'mfaAllow', |
| | | exportField: 'mfaAllow$', |
| | | kind: 'checkbox', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0', |
| | | searchable: false |
| | | }); |
| | | fieldMeta.push({ |
| | | field: 'mfaEnabled', |
| | | columnName: 'mfa_enabled', |
| | | label: 'MFA启用', |
| | | tableProp: 'mfaEnabled', |
| | | exportField: 'mfaEnabled$', |
| | | kind: 'checkbox', |
| | | valueType: 'number', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 110, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: '1', |
| | | checkboxInactiveRaw: '0', |
| | | searchable: false, |
| | | editable: false |
| | | }); |
| | | fieldMeta.push({ |
| | | field: 'mfaBoundTime', |
| | | columnName: 'mfa_bound_time', |
| | | label: 'MFA绑定时间', |
| | | tableProp: 'mfaBoundTime$', |
| | | exportField: 'mfaBoundTime$', |
| | | kind: 'text', |
| | | valueType: 'string', |
| | | required: false, |
| | | primaryKey: false, |
| | | sortable: false, |
| | | textarea: false, |
| | | minWidth: 168, |
| | | enumOptions: [], |
| | | foreignQuery: '', |
| | | checkboxActiveRaw: 'Y', |
| | | checkboxInactiveRaw: 'N', |
| | | searchable: false, |
| | | editable: false |
| | | }); |
| | | |
| | | function formatFieldLabel(field) { |
| | | var raw = field && field.label ? String(field.label).trim() : ''; |
| | | if (raw) { |
| | | return raw; |
| | | } |
| | | raw = field && field.columnName ? field.columnName : (field && field.field ? field.field : ''); |
| | | if (!raw) { |
| | | return ''; |
| | | } |
| | | raw = String(raw) |
| | | .replace(/\$/g, '') |
| | | .replace(/([a-z0-9])([A-Z])/g, '$1_$2') |
| | | .replace(/_/g, ' ') |
| | | .replace(/\s+/g, ' ') |
| | | .trim(); |
| | | return raw.replace(/\b[a-z]/g, function (letter) { |
| | | return letter.toUpperCase(); |
| | | }); |
| | | } |
| | | |
| | | function dedupeFieldMeta(list) { |
| | | var result = []; |
| | | var seen = {}; |
| | | (list || []).forEach(function (field) { |
| | | if (!field || !field.field || seen[field.field]) { |
| | | return; |
| | | } |
| | | field.label = formatFieldLabel(field); |
| | | seen[field.field] = true; |
| | | result.push(field); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | function isEmptyValue(value) { |
| | | return value === null || value === undefined || value === ''; |
| | | } |
| | | |
| | | function stringValue(value) { |
| | | return isEmptyValue(value) ? '' : String(value); |
| | | } |
| | | |
| | | function valueOrDash(value) { |
| | | return isEmptyValue(value) ? '--' : value; |
| | | } |
| | | |
| | | function normalizeOptionValue(field, rawValue) { |
| | | if (rawValue === null || rawValue === undefined) { |
| | | return null; |
| | | } |
| | | if (rawValue === '') { |
| | | return ''; |
| | | } |
| | | if (field && field.valueType === 'number') { |
| | | var numberVal = Number(rawValue); |
| | | return isNaN(numberVal) ? rawValue : numberVal; |
| | | } |
| | | return String(rawValue); |
| | | } |
| | | |
| | | function isSearchableField(field) { |
| | | return !!field && field.kind !== 'image' && !field.textarea && field.searchable !== false; |
| | | } |
| | | |
| | | function isSortableField(field) { |
| | | if (!field) { |
| | | return false; |
| | | } |
| | | if (field.primaryKey) { |
| | | return true; |
| | | } |
| | | return field.kind !== 'image' && !field.textarea && field.kind !== 'foreign'; |
| | | } |
| | | |
| | | function defaultFieldValue(field) { |
| | | if (field.primaryKey) { |
| | | return null; |
| | | } |
| | | if (field.kind === 'checkbox') { |
| | | return normalizeOptionValue(field, field.checkboxInactiveRaw); |
| | | } |
| | | return ''; |
| | | } |
| | | |
| | | function defaultSearchFieldValue(field) { |
| | | if (field.kind === 'date') { |
| | | return []; |
| | | } |
| | | if (field.kind === 'enum' || field.kind === 'checkbox') { |
| | | return null; |
| | | } |
| | | return ''; |
| | | } |
| | | |
| | | function createSearchDefaults() { |
| | | var result = { |
| | | condition: '' |
| | | }; |
| | | fieldMeta.forEach(function (field) { |
| | | if (!isSearchableField(field)) { |
| | | return; |
| | | } |
| | | result[field.field] = defaultSearchFieldValue(field); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | function createSearchDisplayDefaults() { |
| | | var result = {}; |
| | | fieldMeta.forEach(function (field) { |
| | | if (field.kind === 'foreign' && isSearchableField(field)) { |
| | | result[field.field] = ''; |
| | | } |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | function createDefaultVisibleColumnKeys() { |
| | | return fieldMeta.filter(function (field) { |
| | | return field.visible !== false; |
| | | }).map(function (field) { |
| | | return field.field; |
| | | }); |
| | | } |
| | | |
| | | function createFormDefaults() { |
| | | var result = {}; |
| | | fieldMeta.forEach(function (field) { |
| | | result[field.field] = defaultFieldValue(field); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | function createDisplayDefaults() { |
| | | var result = {}; |
| | | fieldMeta.forEach(function (field) { |
| | | if (field.kind === 'foreign') { |
| | | result[field.field] = ''; |
| | | } |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | function createFormRules() { |
| | | var rules = {}; |
| | | fieldMeta.forEach(function (field) { |
| | | if (field.primaryKey || !field.required) { |
| | | return; |
| | | } |
| | | rules[field.field] = [{ |
| | | required: true, |
| | | message: (field.kind === 'date' || field.kind === 'enum' ? '请选择' : '请输入') + field.label, |
| | | trigger: (field.kind === 'date' || field.kind === 'enum') ? 'change' : 'blur' |
| | | }]; |
| | | }); |
| | | return rules; |
| | | } |
| | | |
| | | function getTableValue(row, field) { |
| | | var prop = field.tableProp || field.field; |
| | | if (row && !isEmptyValue(row[prop])) { |
| | | return row[prop]; |
| | | } |
| | | return row ? row[field.field] : ''; |
| | | } |
| | | |
| | | function isCheckboxChecked(row, field) { |
| | | var value = row ? row[field.field] : null; |
| | | var activeValue = normalizeOptionValue(field, field.checkboxActiveRaw); |
| | | return String(value) === String(activeValue); |
| | | } |
| | | |
| | | function exportCell(value) { |
| | | return stringValue(value).replace(/\t/g, ' ').replace(/\r?\n/g, ' '); |
| | | } |
| | | |
| | | function escapeHtml(value) { |
| | | return exportCell(value) |
| | | .replace(/&/g, '&') |
| | | .replace(/</g, '<') |
| | | .replace(/>/g, '>') |
| | | .replace(/"/g, '"') |
| | | .replace(/'/g, '''); |
| | | } |
| | | |
| | | function buildPayload(form) { |
| | | var payload = {}; |
| | | fieldMeta.forEach(function (field) { |
| | | var value = form[field.field]; |
| | | if (field.primaryKey) { |
| | | if (!isEmptyValue(value)) { |
| | | payload[field.field] = value; |
| | | } |
| | | return; |
| | | } |
| | | if (field.kind === 'foreign' && isEmptyValue(value)) { |
| | | value = null; |
| | | } |
| | | if (field.kind === 'enum' && value === '') { |
| | | value = null; |
| | | } |
| | | if (field.kind === 'checkbox' && isEmptyValue(value)) { |
| | | value = normalizeOptionValue(field, field.checkboxInactiveRaw); |
| | | } |
| | | if (field.valueType === 'number' && !isEmptyValue(value)) { |
| | | value = Number(value); |
| | | } |
| | | if (field.valueType === 'number' && value === '') { |
| | | value = null; |
| | | } |
| | | payload[field.field] = value; |
| | | }); |
| | | return payload; |
| | | } |
| | | |
| | | function fillFormFromRow(row, form, display) { |
| | | fieldMeta.forEach(function (field) { |
| | | if (field.primaryKey) { |
| | | form[field.field] = row[field.field]; |
| | | return; |
| | | } |
| | | if (field.kind === 'date') { |
| | | form[field.field] = row[field.tableProp] || row[field.field] || ''; |
| | | return; |
| | | } |
| | | if (field.kind === 'foreign') { |
| | | form[field.field] = isEmptyValue(row[field.field]) ? '' : normalizeOptionValue(field, row[field.field]); |
| | | if (display) { |
| | | display[field.field] = row[field.tableProp] || (isEmptyValue(row[field.field]) ? '' : String(row[field.field])); |
| | | } |
| | | return; |
| | | } |
| | | if (field.kind === 'enum') { |
| | | form[field.field] = isEmptyValue(row[field.field]) ? '' : normalizeOptionValue(field, row[field.field]); |
| | | return; |
| | | } |
| | | if (field.kind === 'checkbox') { |
| | | form[field.field] = isEmptyValue(row[field.field]) |
| | | ? normalizeOptionValue(field, field.checkboxInactiveRaw) |
| | | : normalizeOptionValue(field, row[field.field]); |
| | | return; |
| | | } |
| | | form[field.field] = isEmptyValue(row[field.field]) |
| | | ? '' |
| | | : (field.valueType === 'number' ? String(row[field.field]) : row[field.field]); |
| | | }); |
| | | } |
| | | |
| | | function resolveSearchParam(field) { |
| | | if (field.kind === 'date' && field.columnName) { |
| | | return field.columnName; |
| | | } |
| | | return field.field; |
| | | } |
| | | |
| | | function createDownloadFile(filename, titles, rows) { |
| | | var html = [ |
| | | '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">', |
| | | '<head><meta charset="UTF-8"></head><body><table border="1"><thead><tr>', |
| | | titles.map(function (title) { |
| | | return '<th>' + escapeHtml(title) + '</th>'; |
| | | }).join(''), |
| | | '</tr></thead><tbody>', |
| | | (rows || []).map(function (row) { |
| | | return '<tr>' + (row || []).map(function (value) { |
| | | return '<td style="mso-number-format:\\@;">' + escapeHtml(value) + '</td>'; |
| | | }).join('') + '</tr>'; |
| | | }).join(''), |
| | | '</tbody></table></body></html>' |
| | | ].join(''); |
| | | var blob = new Blob(['\ufeff' + html], { |
| | | type: 'application/vnd.ms-excel;charset=utf-8;' |
| | | }); |
| | | var anchor = document.createElement('a'); |
| | | anchor.href = URL.createObjectURL(blob); |
| | | anchor.download = filename; |
| | | document.body.appendChild(anchor); |
| | | anchor.click(); |
| | | setTimeout(function () { |
| | | URL.revokeObjectURL(anchor.href); |
| | | document.body.removeChild(anchor); |
| | | }, 0); |
| | | } |
| | | |
| | | function buildTimestamp() { |
| | | var now = new Date(); |
| | | var pad = function (num) { |
| | | return num < 10 ? '0' + num : String(num); |
| | | }; |
| | | return now.getFullYear() |
| | | + pad(now.getMonth() + 1) |
| | | + pad(now.getDate()) |
| | | + '_' |
| | | + pad(now.getHours()) |
| | | + pad(now.getMinutes()) |
| | | + pad(now.getSeconds()); |
| | | } |
| | | |
| | | function authHeaders() { |
| | | return { |
| | | token: localStorage.getItem('token') |
| | | }; |
| | | } |
| | | |
| | | function handleForbidden(res) { |
| | | if (res && res.code === 403) { |
| | | top.location.href = baseUrl + '/'; |
| | | if (res && Number(res.code) === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | var sharedMethods = { |
| | | authHeaders: authHeaders, |
| | | handleForbidden: handleForbidden, |
| | | valueOrDash: valueOrDash, |
| | | stringValue: stringValue, |
| | | getTableValue: getTableValue, |
| | | isCheckboxChecked: isCheckboxChecked, |
| | | normalizeOptionValue: normalizeOptionValue, |
| | | isSortableField: isSortableField, |
| | | getSuggestionFetcher: function (field) { |
| | | var self = this; |
| | | return function (queryString, callback) { |
| | | self.fetchForeignSuggestions(field, queryString, callback); |
| | | new Vue({ |
| | | el: "#app", |
| | | data: function () { |
| | | return { |
| | | loading: false, |
| | | dialogSubmitting: false, |
| | | resetSubmitting: false, |
| | | searchForm: { |
| | | username: "", |
| | | mobile: "" |
| | | }, |
| | | tableData: [], |
| | | selection: [], |
| | | roles: [], |
| | | page: { |
| | | curr: 1, |
| | | limit: 15, |
| | | total: 0 |
| | | }, |
| | | dialog: { |
| | | visible: false, |
| | | mode: "create" |
| | | }, |
| | | dialogForm: { |
| | | id: null, |
| | | username: "", |
| | | mobile: "", |
| | | password: "", |
| | | roleId: null, |
| | | status: 1, |
| | | mfaAllow: 0 |
| | | }, |
| | | resetDialog: { |
| | | visible: false, |
| | | userId: null, |
| | | username: "", |
| | | password: "" |
| | | }, |
| | | dialogRules: { |
| | | username: [ |
| | | { required: true, message: "请输入登录账户", trigger: "blur" } |
| | | ], |
| | | mobile: [ |
| | | { required: true, message: "请输入账号", trigger: "blur" } |
| | | ], |
| | | roleId: [ |
| | | { required: true, message: "请选择角色", trigger: "change" } |
| | | ], |
| | | password: [ |
| | | { |
| | | validator: function (rule, value, callback) { |
| | | if (this.dialog.mode !== "create") { |
| | | callback(); |
| | | return; |
| | | } |
| | | if (!value) { |
| | | callback(new Error("请输入初始密码")); |
| | | return; |
| | | } |
| | | if (String(value).length < 4) { |
| | | callback(new Error("初始密码不能少于4位")); |
| | | return; |
| | | } |
| | | callback(); |
| | | }.bind(this), |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | resetRules: { |
| | | password: [ |
| | | { required: true, message: "请输入新密码", trigger: "blur" }, |
| | | { |
| | | validator: function (rule, value, callback) { |
| | | if (String(value || "").length < 4) { |
| | | callback(new Error("新密码不能少于4位")); |
| | | return; |
| | | } |
| | | callback(); |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | fetchForeignSuggestions: function (field, queryString, callback) { |
| | | if (!field.foreignQuery || !queryString) { |
| | | callback([]); |
| | | return; |
| | | } |
| | | var self = this; |
| | | $.ajax({ |
| | | url: baseUrl + '/' + field.foreignQuery + 'Query/auth', |
| | | method: 'GET', |
| | | headers: self.authHeaders(), |
| | | data: { condition: queryString }, |
| | | success: function (res) { |
| | | if (self.handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (!res || res.code !== 200 || !Array.isArray(res.data)) { |
| | | callback([]); |
| | | return; |
| | | } |
| | | callback(res.data.map(function (item) { |
| | | return { |
| | | id: item.id, |
| | | value: item.value |
| | | }; |
| | | })); |
| | | }, |
| | | error: function () { |
| | | callback([]); |
| | | } |
| | | }); |
| | | created: function () { |
| | | this.loadRoles(); |
| | | this.loadTable(); |
| | | }, |
| | | handleForeignSelect: function (field, item) { |
| | | this.$set(this.displayTarget, field.field, item && item.value ? item.value : ''); |
| | | this.$set(this.formTarget, field.field, item && item.id !== undefined ? normalizeOptionValue(field, item.id) : ''); |
| | | }, |
| | | handleForeignInput: function (field) { |
| | | if (!this.displayTarget || !this.formTarget) { |
| | | return; |
| | | } |
| | | if (this.displayTarget[field.field]) { |
| | | return; |
| | | } |
| | | this.$set(this.formTarget, field.field, ''); |
| | | } |
| | | }; |
| | | |
| | | if (document.getElementById('app')) { |
| | | new Vue({ |
| | | el: '#app', |
| | | data: function () { |
| | | return { |
| | | fieldMeta: fieldMeta, |
| | | primaryKeyField: primaryKeyField, |
| | | loading: false, |
| | | exporting: false, |
| | | tableData: [], |
| | | selection: [], |
| | | advancedFiltersVisible: false, |
| | | allColumns: fieldMeta.slice(), |
| | | visibleColumnKeys: createDefaultVisibleColumnKeys(), |
| | | searchForm: createSearchDefaults(), |
| | | searchDisplay: createSearchDisplayDefaults(), |
| | | page: { |
| | | curr: 1, |
| | | limit: 15, |
| | | total: 0 |
| | | }, |
| | | sortState: { |
| | | prop: '', |
| | | order: '' |
| | | }, |
| | | dialog: { |
| | | visible: false, |
| | | mode: 'create', |
| | | submitting: false |
| | | }, |
| | | layoutTimer: null, |
| | | tableResizeHandler: null, |
| | | dialogForm: createFormDefaults(), |
| | | dialogDisplay: createDisplayDefaults(), |
| | | dialogRules: createFormRules() |
| | | }; |
| | | methods: { |
| | | authHeaders: function () { |
| | | return { token: localStorage.getItem("token") }; |
| | | }, |
| | | computed: { |
| | | searchableFields: function () { |
| | | return this.fieldMeta.filter(function (field) { |
| | | return isSearchableField(field); |
| | | }); |
| | | }, |
| | | quickSearchableFields: function () { |
| | | var result = []; |
| | | this.searchableFields.forEach(function (field) { |
| | | if (result.length >= 3 || field.kind === 'date') { |
| | | loadRoles: function () { |
| | | var vm = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/role/list/auth", |
| | | method: "GET", |
| | | headers: vm.authHeaders(), |
| | | data: { |
| | | curr: 1, |
| | | limit: 500 |
| | | }, |
| | | success: function (res) { |
| | | if (handleForbidden(res)) { |
| | | return; |
| | | } |
| | | result.push(field); |
| | | }); |
| | | return result; |
| | | }, |
| | | advancedSearchableFields: function () { |
| | | var quickKeys = this.quickSearchableFields.map(function (field) { |
| | | return field.field; |
| | | }); |
| | | return this.searchableFields.filter(function (field) { |
| | | return quickKeys.indexOf(field.field) === -1; |
| | | }); |
| | | }, |
| | | hasAdvancedFilters: function () { |
| | | return this.advancedSearchableFields.length > 0; |
| | | }, |
| | | visibleColumns: function () { |
| | | var keys = this.visibleColumnKeys; |
| | | return this.allColumns.filter(function (field) { |
| | | return keys.indexOf(field.field) !== -1; |
| | | }); |
| | | }, |
| | | editableFields: function () { |
| | | return this.fieldMeta.filter(function (field) { |
| | | return !field.primaryKey && field.editable !== false; |
| | | }); |
| | | }, |
| | | exportColumns: function () { |
| | | return this.visibleColumns.map(function (field) { |
| | | return { |
| | | field: field.exportField || field.tableProp || field.field, |
| | | label: field.label |
| | | }; |
| | | }); |
| | | }, |
| | | tableHeight: function () { |
| | | return this.advancedFiltersVisible && this.hasAdvancedFilters |
| | | ? 'calc(100vh - 390px)' |
| | | : 'calc(100vh - 300px)'; |
| | | }, |
| | | formTarget: function () { |
| | | return this.dialogForm; |
| | | }, |
| | | displayTarget: function () { |
| | | return this.dialogDisplay; |
| | | } |
| | | if (Number(res.code) !== 200) { |
| | | vm.$message.error(res.msg || "角色加载失败"); |
| | | return; |
| | | } |
| | | var payload = res.data || {}; |
| | | vm.roles = Array.isArray(payload.records) ? payload.records : []; |
| | | }, |
| | | error: function () { |
| | | vm.$message.error("角色加载失败"); |
| | | } |
| | | }); |
| | | }, |
| | | created: function () { |
| | | loadTable: function () { |
| | | var vm = this; |
| | | vm.loading = true; |
| | | $.ajax({ |
| | | url: baseUrl + "/user/list/auth", |
| | | method: "GET", |
| | | headers: vm.authHeaders(), |
| | | data: { |
| | | curr: vm.page.curr, |
| | | limit: vm.page.limit, |
| | | username: vm.searchForm.username, |
| | | mobile: vm.searchForm.mobile |
| | | }, |
| | | success: function (res) { |
| | | if (handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (Number(res.code) !== 200) { |
| | | vm.$message.error(res.msg || "加载失败"); |
| | | return; |
| | | } |
| | | var payload = res.data || {}; |
| | | vm.tableData = Array.isArray(payload.records) ? payload.records : []; |
| | | vm.page.total = Number(payload.total || 0); |
| | | }, |
| | | error: function () { |
| | | vm.$message.error("加载失败"); |
| | | }, |
| | | complete: function () { |
| | | vm.loading = false; |
| | | } |
| | | }); |
| | | }, |
| | | handleSearch: function () { |
| | | this.page.curr = 1; |
| | | this.loadTable(); |
| | | }, |
| | | mounted: function () { |
| | | var self = this; |
| | | self.requestTableLayout(80); |
| | | self.tableResizeHandler = function () { |
| | | self.requestTableLayout(80); |
| | | handleResetSearch: function () { |
| | | this.searchForm = { |
| | | username: "", |
| | | mobile: "" |
| | | }; |
| | | window.addEventListener('resize', self.tableResizeHandler); |
| | | this.page.curr = 1; |
| | | this.loadTable(); |
| | | }, |
| | | beforeDestroy: function () { |
| | | if (this.layoutTimer) { |
| | | clearTimeout(this.layoutTimer); |
| | | this.layoutTimer = null; |
| | | } |
| | | if (this.tableResizeHandler) { |
| | | window.removeEventListener('resize', this.tableResizeHandler); |
| | | this.tableResizeHandler = null; |
| | | } |
| | | handleSelectionChange: function (rows) { |
| | | this.selection = rows || []; |
| | | }, |
| | | methods: $.extend({}, sharedMethods, { |
| | | requestTableLayout: function (delay) { |
| | | var self = this; |
| | | if (self.layoutTimer) { |
| | | clearTimeout(self.layoutTimer); |
| | | handleCurrentChange: function (curr) { |
| | | this.page.curr = curr; |
| | | this.loadTable(); |
| | | }, |
| | | handleSizeChange: function (limit) { |
| | | this.page.limit = limit; |
| | | this.page.curr = 1; |
| | | this.loadTable(); |
| | | }, |
| | | openCreateDialog: function () { |
| | | this.dialog.mode = "create"; |
| | | this.dialog.visible = true; |
| | | this.dialogForm = { |
| | | id: null, |
| | | username: "", |
| | | mobile: "", |
| | | password: "", |
| | | roleId: null, |
| | | status: 1, |
| | | mfaAllow: 0 |
| | | }; |
| | | this.clearDialogValidate(); |
| | | }, |
| | | openEditDialog: function (row) { |
| | | this.dialog.mode = "edit"; |
| | | this.dialog.visible = true; |
| | | this.dialogForm = { |
| | | id: row.id, |
| | | username: row.username || "", |
| | | mobile: row.mobile || "", |
| | | password: "", |
| | | roleId: row.roleId == null ? null : Number(row.roleId), |
| | | status: row.status == null ? 1 : Number(row.status), |
| | | mfaAllow: row.mfaAllow == null ? 0 : Number(row.mfaAllow) |
| | | }; |
| | | this.clearDialogValidate(); |
| | | }, |
| | | clearDialogValidate: function () { |
| | | var vm = this; |
| | | vm.$nextTick(function () { |
| | | if (vm.$refs.dialogForm) { |
| | | vm.$refs.dialogForm.clearValidate(); |
| | | } |
| | | self.$nextTick(function () { |
| | | self.layoutTimer = setTimeout(function () { |
| | | var table = self.$refs.dataTable; |
| | | if (table && typeof table.doLayout === 'function') { |
| | | table.doLayout(); |
| | | }); |
| | | }, |
| | | closeDialog: function () { |
| | | this.dialog.visible = false; |
| | | }, |
| | | submitDialog: function () { |
| | | var vm = this; |
| | | if (!vm.$refs.dialogForm) { |
| | | return; |
| | | } |
| | | vm.$refs.dialogForm.validate(function (valid) { |
| | | if (!valid) { |
| | | return false; |
| | | } |
| | | vm.dialogSubmitting = true; |
| | | $.ajax({ |
| | | url: baseUrl + "/user/" + (vm.dialog.mode === "create" ? "add" : "update") + "/auth", |
| | | method: "POST", |
| | | headers: vm.authHeaders(), |
| | | data: vm.buildDialogPayload(), |
| | | success: function (res) { |
| | | if (handleForbidden(res)) { |
| | | return; |
| | | } |
| | | }, delay || 40); |
| | | }); |
| | | }, |
| | | isColumnVisible: function (fieldName) { |
| | | return this.visibleColumnKeys.indexOf(fieldName) !== -1; |
| | | }, |
| | | toggleColumn: function (fieldName, visible) { |
| | | if (visible) { |
| | | if (this.visibleColumnKeys.indexOf(fieldName) === -1) { |
| | | this.visibleColumnKeys.push(fieldName); |
| | | if (Number(res.code) !== 200) { |
| | | vm.$message.error(res.msg || "保存失败"); |
| | | return; |
| | | } |
| | | vm.$message.success(res.msg || "保存成功"); |
| | | vm.dialog.visible = false; |
| | | vm.loadTable(); |
| | | }, |
| | | error: function () { |
| | | vm.$message.error("保存失败"); |
| | | }, |
| | | complete: function () { |
| | | vm.dialogSubmitting = false; |
| | | } |
| | | this.requestTableLayout(80); |
| | | return; |
| | | } |
| | | if (this.visibleColumnKeys.length === 1) { |
| | | this.$message.warning('至少保留一列'); |
| | | return; |
| | | } |
| | | this.visibleColumnKeys = this.visibleColumnKeys.filter(function (item) { |
| | | return item !== fieldName; |
| | | }); |
| | | this.requestTableLayout(80); |
| | | }, |
| | | selectAllColumns: function () { |
| | | this.visibleColumnKeys = createDefaultVisibleColumnKeys(); |
| | | this.requestTableLayout(80); |
| | | }, |
| | | resetColumns: function () { |
| | | this.visibleColumnKeys = createDefaultVisibleColumnKeys(); |
| | | this.requestTableLayout(80); |
| | | }, |
| | | toggleAdvancedFilters: function () { |
| | | this.advancedFiltersVisible = !this.advancedFiltersVisible; |
| | | this.requestTableLayout(260); |
| | | }, |
| | | handleSearchForeignSelect: function (field, item) { |
| | | this.$set(this.searchDisplay, field.field, item && item.value ? item.value : ''); |
| | | this.$set(this.searchForm, field.field, item && item.id !== undefined ? normalizeOptionValue(field, item.id) : ''); |
| | | }, |
| | | handleSearchForeignInput: function (field) { |
| | | if (this.searchDisplay[field.field]) { |
| | | return; |
| | | return true; |
| | | }); |
| | | }, |
| | | buildDialogPayload: function () { |
| | | var payload = { |
| | | username: this.dialogForm.username, |
| | | mobile: this.dialogForm.mobile, |
| | | roleId: this.dialogForm.roleId, |
| | | status: this.dialogForm.status, |
| | | mfaAllow: this.dialogForm.mfaAllow |
| | | }; |
| | | if (this.dialog.mode === "edit") { |
| | | payload.id = this.dialogForm.id; |
| | | } else { |
| | | payload.password = hex_md5(this.dialogForm.password); |
| | | } |
| | | return payload; |
| | | }, |
| | | openResetPasswordDialog: function (row) { |
| | | this.resetDialog = { |
| | | visible: true, |
| | | userId: row.id, |
| | | username: row.username || "", |
| | | password: "" |
| | | }; |
| | | var vm = this; |
| | | vm.$nextTick(function () { |
| | | if (vm.$refs.resetForm) { |
| | | vm.$refs.resetForm.clearValidate(); |
| | | } |
| | | this.$set(this.searchForm, field.field, ''); |
| | | }, |
| | | buildQueryParams: function () { |
| | | var self = this; |
| | | var params = { |
| | | curr: self.page.curr, |
| | | limit: self.page.limit |
| | | }; |
| | | if (self.searchForm.condition) { |
| | | params.condition = self.searchForm.condition; |
| | | }); |
| | | }, |
| | | closeResetDialog: function () { |
| | | this.resetDialog.visible = false; |
| | | }, |
| | | submitResetPassword: function () { |
| | | var vm = this; |
| | | if (!vm.$refs.resetForm) { |
| | | return; |
| | | } |
| | | vm.$refs.resetForm.validate(function (valid) { |
| | | if (!valid) { |
| | | return false; |
| | | } |
| | | self.searchableFields.forEach(function (field) { |
| | | var value = self.searchForm[field.field]; |
| | | if (field.kind === 'date') { |
| | | if (value && value.length === 2) { |
| | | params[resolveSearchParam(field)] = value[0] + ' - ' + value[1]; |
| | | vm.resetSubmitting = true; |
| | | $.ajax({ |
| | | url: baseUrl + "/user/resetPassword/auth", |
| | | method: "POST", |
| | | headers: vm.authHeaders(), |
| | | data: { |
| | | id: vm.resetDialog.userId, |
| | | password: hex_md5(vm.resetDialog.password) |
| | | }, |
| | | success: function (res) { |
| | | if (handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (Number(res.code) !== 200) { |
| | | vm.$message.error(res.msg || "重置密码失败"); |
| | | return; |
| | | } |
| | | vm.$message.success("重置密码成功"); |
| | | vm.resetDialog.visible = false; |
| | | }, |
| | | error: function () { |
| | | vm.$message.error("重置密码失败"); |
| | | }, |
| | | complete: function () { |
| | | vm.resetSubmitting = false; |
| | | } |
| | | }); |
| | | return true; |
| | | }); |
| | | }, |
| | | toggleStatus: function (row) { |
| | | var vm = this; |
| | | var currentStatus = Number(row.status) === 1 ? 1 : 0; |
| | | $.ajax({ |
| | | url: baseUrl + "/user/edit/auth", |
| | | method: "POST", |
| | | headers: vm.authHeaders(), |
| | | data: { |
| | | id: row.id, |
| | | status: currentStatus |
| | | }, |
| | | success: function (res) { |
| | | if (handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (!isEmptyValue(value)) { |
| | | params[resolveSearchParam(field)] = value; |
| | | if (Number(res.code) !== 200) { |
| | | row.status = currentStatus === 1 ? 0 : 1; |
| | | vm.$message.error(res.msg || "状态更新失败"); |
| | | return; |
| | | } |
| | | }); |
| | | if (self.sortState.prop && self.sortState.order) { |
| | | params.orderByField = self.sortState.prop; |
| | | params.orderByType = self.sortState.order === 'ascending' ? 'asc' : 'desc'; |
| | | row.status$ = currentStatus === 1 ? "正常" : "禁用"; |
| | | vm.$message.success("状态已更新"); |
| | | }, |
| | | error: function () { |
| | | row.status = currentStatus === 1 ? 0 : 1; |
| | | vm.$message.error("状态更新失败"); |
| | | } |
| | | return params; |
| | | }, |
| | | loadTable: function () { |
| | | var self = this; |
| | | self.loading = true; |
| | | $.ajax({ |
| | | url: baseUrl + '/' + simpleEntityName + '/list/auth', |
| | | method: 'GET', |
| | | headers: self.authHeaders(), |
| | | data: self.buildQueryParams(), |
| | | success: function (res) { |
| | | self.loading = false; |
| | | if (self.handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (!res || res.code !== 200) { |
| | | self.$message.error((res && res.msg) ? res.msg : '加载失败'); |
| | | return; |
| | | } |
| | | var payload = res.data || {}; |
| | | self.tableData = Array.isArray(payload.records) ? payload.records : []; |
| | | self.page.total = payload.total || 0; |
| | | self.requestTableLayout(80); |
| | | }, |
| | | error: function () { |
| | | self.loading = false; |
| | | self.requestTableLayout(80); |
| | | self.$message.error('加载失败'); |
| | | } |
| | | }); |
| | | }, |
| | | handleSearch: function () { |
| | | this.page.curr = 1; |
| | | this.loadTable(); |
| | | }, |
| | | handleReset: function () { |
| | | this.searchForm = createSearchDefaults(); |
| | | this.searchDisplay = createSearchDisplayDefaults(); |
| | | this.advancedFiltersVisible = false; |
| | | this.page.curr = 1; |
| | | this.sortState = { |
| | | prop: '', |
| | | order: '' |
| | | }; |
| | | this.loadTable(); |
| | | }, |
| | | handleSelectionChange: function (rows) { |
| | | this.selection = rows || []; |
| | | }, |
| | | handleSortChange: function (payload) { |
| | | this.sortState = { |
| | | prop: payload && payload.prop ? payload.prop : '', |
| | | order: payload && payload.order ? payload.order : '' |
| | | }; |
| | | this.page.curr = 1; |
| | | this.loadTable(); |
| | | }, |
| | | handleCurrentChange: function (curr) { |
| | | this.page.curr = curr; |
| | | this.loadTable(); |
| | | }, |
| | | handleSizeChange: function (limit) { |
| | | this.page.limit = limit; |
| | | this.page.curr = 1; |
| | | this.loadTable(); |
| | | }, |
| | | resetDialogState: function () { |
| | | this.dialogForm = createFormDefaults(); |
| | | this.dialogDisplay = createDisplayDefaults(); |
| | | if (this.$refs.dialogForm) { |
| | | this.$refs.dialogForm.clearValidate(); |
| | | } |
| | | }, |
| | | openCreateDialog: function () { |
| | | this.dialog.mode = 'create'; |
| | | this.dialog.visible = true; |
| | | this.$nextTick(this.resetDialogState); |
| | | }, |
| | | openEditDialog: function (row) { |
| | | var self = this; |
| | | self.dialog.mode = 'edit'; |
| | | self.dialog.visible = true; |
| | | self.$nextTick(function () { |
| | | self.resetDialogState(); |
| | | fillFormFromRow(row, self.dialogForm, self.dialogDisplay); |
| | | if (self.$refs.dialogForm) { |
| | | self.$refs.dialogForm.clearValidate(); |
| | | } |
| | | }); |
| | | }, |
| | | submitDialog: function () { |
| | | var self = this; |
| | | if (!self.$refs.dialogForm) { |
| | | return; |
| | | } |
| | | self.$refs.dialogForm.validate(function (valid) { |
| | | if (!valid) { |
| | | return false; |
| | | } |
| | | self.dialog.submitting = true; |
| | | $.ajax({ |
| | | url: baseUrl + '/' + simpleEntityName + '/' + (self.dialog.mode === 'create' ? 'add' : 'update') + '/auth', |
| | | method: 'POST', |
| | | headers: self.authHeaders(), |
| | | data: buildPayload(self.dialogForm), |
| | | success: function (res) { |
| | | self.dialog.submitting = false; |
| | | if (self.handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (!res || res.code !== 200) { |
| | | self.$message.error((res && res.msg) ? res.msg : '保存失败'); |
| | | return; |
| | | } |
| | | self.$message.success(res.msg || '保存成功'); |
| | | self.dialog.visible = false; |
| | | self.loadTable(); |
| | | }, |
| | | error: function () { |
| | | self.dialog.submitting = false; |
| | | self.$message.error('保存失败'); |
| | | } |
| | | }); |
| | | return true; |
| | | }); |
| | | }, |
| | | removeSelection: function () { |
| | | var self = this; |
| | | var ids = self.selection.map(function (row) { |
| | | return row[self.primaryKeyField]; |
| | | }); |
| | | self.removeRows(ids); |
| | | }, |
| | | removeRows: function (ids) { |
| | | var self = this; |
| | | if (!ids || ids.length === 0) { |
| | | self.$message.warning('请选择要删除的数据'); |
| | | return; |
| | | } |
| | | self.$confirm('确定删除选中的记录吗?', '提示', { type: 'warning' }).then(function () { |
| | | $.ajax({ |
| | | url: baseUrl + '/' + simpleEntityName + '/delete/auth', |
| | | method: 'POST', |
| | | headers: self.authHeaders(), |
| | | traditional: true, |
| | | data: { 'ids[]': ids }, |
| | | success: function (res) { |
| | | if (self.handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (!res || res.code !== 200) { |
| | | self.$message.error((res && res.msg) ? res.msg : '删除失败'); |
| | | return; |
| | | } |
| | | self.$message.success(res.msg || '删除成功'); |
| | | self.selection = []; |
| | | if (self.tableData.length === ids.length && self.page.curr > 1) { |
| | | self.page.curr = self.page.curr - 1; |
| | | } |
| | | self.loadTable(); |
| | | }, |
| | | error: function () { |
| | | self.$message.error('删除失败'); |
| | | } |
| | | }); |
| | | }).catch(function () {}); |
| | | }, |
| | | exportRows: function () { |
| | | var self = this; |
| | | self.exporting = true; |
| | | var requestBody = { |
| | | fields: self.exportColumns.map(function (item) { |
| | | return item.field; |
| | | }) |
| | | }; |
| | | requestBody[simpleEntityName] = self.buildQueryParams(); |
| | | $.ajax({ |
| | | url: baseUrl + '/' + simpleEntityName + '/export/auth', |
| | | method: 'POST', |
| | | headers: $.extend({ 'Content-Type': 'application/json;charset=UTF-8' }, self.authHeaders()), |
| | | data: JSON.stringify(requestBody), |
| | | success: function (res) { |
| | | self.exporting = false; |
| | | if (self.handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (!res || res.code !== 200) { |
| | | self.$message.error((res && res.msg) ? res.msg : '导出失败'); |
| | | return; |
| | | } |
| | | createDownloadFile( |
| | | simpleEntityName + '_' + buildTimestamp() + '.xls', |
| | | self.exportColumns.map(function (item) { |
| | | return item.label; |
| | | }), |
| | | Array.isArray(res.data) ? res.data : [] |
| | | ); |
| | | self.$message.success('导出成功'); |
| | | }, |
| | | error: function () { |
| | | self.exporting = false; |
| | | self.$message.error('导出失败'); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | removeSelection: function () { |
| | | var ids = this.selection.map(function (item) { |
| | | return item.id; |
| | | }); |
| | | this.removeRows(ids); |
| | | }, |
| | | removeRows: function (ids) { |
| | | var vm = this; |
| | | if (!ids || ids.length === 0) { |
| | | vm.$message.warning("请选择要删除的数据"); |
| | | return; |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | vm.$confirm("确定删除选中的记录吗?", "提示", { |
| | | type: "warning", |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消" |
| | | }).then(function () { |
| | | $.ajax({ |
| | | url: baseUrl + "/user/delete/auth", |
| | | method: "POST", |
| | | headers: vm.authHeaders(), |
| | | traditional: true, |
| | | data: { "ids[]": ids }, |
| | | success: function (res) { |
| | | if (handleForbidden(res)) { |
| | | return; |
| | | } |
| | | if (Number(res.code) !== 200) { |
| | | vm.$message.error(res.msg || "删除失败"); |
| | | return; |
| | | } |
| | | vm.$message.success("删除成功"); |
| | | vm.loadTable(); |
| | | }, |
| | | error: function () { |
| | | vm.$message.error("删除失败"); |
| | | } |
| | | }); |
| | | }).catch(function () { |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | })(); |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh-CN"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>User 管理</title> |
| | | <meta charset="UTF-8"> |
| | | <title>系统用户</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | |
| | | <link rel="stylesheet" href="../../static/css/cool.css"> |
| | | <style> |
| | | :root { |
| | | --card-bg: rgba(255, 255, 255, 0.94); |
| | | --card-border: rgba(216, 226, 238, 0.95); |
| | | --card-bg: rgba(255, 255, 255, 0.96); |
| | | --card-border: rgba(217, 227, 238, 0.96); |
| | | --text-main: #243447; |
| | | --text-sub: #6d7f90; |
| | | } |
| | | |
| | | [v-cloak] { |
| | |
| | | color: var(--text-main); |
| | | font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif; |
| | | background: |
| | | radial-gradient(1000px 420px at 0% -10%, rgba(44, 107, 193, 0.12), transparent 56%), |
| | | radial-gradient(900px 400px at 100% 0%, rgba(28, 150, 126, 0.10), transparent 58%), |
| | | linear-gradient(180deg, #f2f6fb 0%, #f8fafc 100%); |
| | | radial-gradient(920px 360px at 0% 0%, rgba(48, 112, 196, 0.10), transparent 58%), |
| | | radial-gradient(760px 280px at 100% 10%, rgba(25, 160, 138, 0.08), transparent 60%), |
| | | linear-gradient(180deg, #f3f7fb 0%, #f8fafc 100%); |
| | | } |
| | | |
| | | .page-shell { |
| | | max-width: 1700px; |
| | | margin: 0 auto; |
| | | padding: 14px; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .card-shell { |
| | | position: relative; |
| | | border-radius: 24px; |
| | | max-width: 1600px; |
| | | margin: 0 auto; |
| | | border-radius: 22px; |
| | | border: 1px solid var(--card-border); |
| | | background: |
| | | radial-gradient(760px 220px at -8% 0%, rgba(43, 117, 196, 0.05), transparent 55%), |
| | | radial-gradient(680px 200px at 108% 10%, rgba(24, 150, 129, 0.05), transparent 58%), |
| | | radial-gradient(780px 220px at -8% 0%, rgba(45, 118, 196, 0.05), transparent 58%), |
| | | radial-gradient(640px 180px at 106% 16%, rgba(24, 150, 129, 0.05), transparent 56%), |
| | | var(--card-bg); |
| | | box-shadow: 0 16px 32px rgba(44, 67, 96, 0.08); |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .card-body { |
| | | position: relative; |
| | | z-index: 1; |
| | | .card-head { |
| | | padding: 16px 18px 14px; |
| | | border-bottom: 1px solid rgba(223, 231, 240, 0.92); |
| | | } |
| | | |
| | | .list-toolbar { |
| | | padding: 12px 16px 10px; |
| | | border-bottom: 1px solid rgba(222, 230, 239, 0.92); |
| | | } |
| | | |
| | | .toolbar-main { |
| | | .head-top { |
| | | display: flex; |
| | | align-items: flex-start; |
| | | justify-content: space-between; |
| | | gap: 8px; |
| | | gap: 16px; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .head-title { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 6px; |
| | | } |
| | | |
| | | .head-title h1 { |
| | | margin: 0; |
| | | font-size: 20px; |
| | | line-height: 1.2; |
| | | } |
| | | |
| | | .head-title p { |
| | | margin: 0; |
| | | font-size: 13px; |
| | | line-height: 1.6; |
| | | color: var(--text-sub); |
| | | } |
| | | |
| | | .head-actions { |
| | | display: flex; |
| | | gap: 10px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .toolbar-left { |
| | | flex: 1 1 960px; |
| | | .head-actions .el-button { |
| | | min-width: 96px; |
| | | } |
| | | |
| | | .search-form { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 8px; |
| | | gap: 8px 12px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .toolbar-search { |
| | | flex: 1 1 auto; |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 8px; |
| | | flex-wrap: wrap; |
| | | .search-form .el-form-item { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .toolbar-search-item { |
| | | flex: 0 0 152px; |
| | | min-width: 152px; |
| | | .search-form .el-form-item__label { |
| | | font-weight: 600; |
| | | color: #55697d; |
| | | } |
| | | |
| | | .toolbar-search-item.keyword { |
| | | flex: 0 0 220px; |
| | | min-width: 220px; |
| | | } |
| | | |
| | | .toolbar-query-actions, |
| | | .toolbar-ops { |
| | | display: flex; |
| | | gap: 8px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | .toolbar-ops { |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | .list-toolbar .el-input__inner, |
| | | .list-toolbar .el-range-editor.el-input__inner, |
| | | .advanced-panel .el-input__inner, |
| | | .advanced-panel .el-range-editor.el-input__inner { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | |
| | | .list-toolbar .el-range-editor.el-input__inner, |
| | | .advanced-panel .el-range-editor.el-input__inner { |
| | | align-items: center; |
| | | } |
| | | |
| | | .list-toolbar .el-input__icon, |
| | | .advanced-panel .el-input__icon { |
| | | line-height: 32px; |
| | | } |
| | | |
| | | .list-toolbar .el-range-editor .el-range__icon, |
| | | .list-toolbar .el-range-editor .el-range-separator, |
| | | .list-toolbar .el-range-editor .el-range__close-icon, |
| | | .advanced-panel .el-range-editor .el-range__icon, |
| | | .advanced-panel .el-range-editor .el-range-separator, |
| | | .advanced-panel .el-range-editor .el-range__close-icon { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | height: 100%; |
| | | line-height: 1; |
| | | } |
| | | |
| | | .list-toolbar .el-button, |
| | | .advanced-panel .el-button { |
| | | padding: 8px 12px; |
| | | border-radius: 8px; |
| | | } |
| | | |
| | | .advanced-panel { |
| | | padding: 10px 16px 12px; |
| | | border-bottom: 1px solid rgba(222, 230, 239, 0.92); |
| | | background: rgba(248, 251, 254, 0.78); |
| | | } |
| | | |
| | | .advanced-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(6, minmax(0, 1fr)); |
| | | gap: 8px; |
| | | } |
| | | |
| | | .advanced-item { |
| | | min-width: 0; |
| | | } |
| | | |
| | | .advanced-item.span-2 { |
| | | grid-column: span 2; |
| | | .search-form .el-input__inner, |
| | | .search-form .el-button { |
| | | height: 34px; |
| | | line-height: 34px; |
| | | } |
| | | |
| | | .table-wrap { |
| | | padding: 10px 16px; |
| | | padding: 12px 18px 16px; |
| | | } |
| | | |
| | | .table-shell { |
| | | border-radius: 20px; |
| | | border-radius: 18px; |
| | | overflow: hidden; |
| | | border: 1px solid rgba(217, 227, 238, 0.98); |
| | | background: rgba(255, 255, 255, 0.95); |
| | | } |
| | | |
| | | .table-shell .el-table { |
| | | border-radius: 20px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .table-shell .el-table th { |
| | |
| | | font-weight: 700; |
| | | } |
| | | |
| | | .payload-cell { |
| | | display: inline-block; |
| | | max-width: 280px; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | .table-shell .el-table td, |
| | | .table-shell .el-table th { |
| | | padding: 10px 0; |
| | | } |
| | | |
| | | .mono { |
| | | font-family: Menlo, Monaco, Consolas, "Liberation Mono", monospace; |
| | | .status-switch { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .pager-bar { |
| | | padding: 0 16px 16px; |
| | | padding: 16px 0 0; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | .column-popover { |
| | | max-width: 320px; |
| | | } |
| | | |
| | | .column-popover-head { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | gap: 12px; |
| | | margin-bottom: 10px; |
| | | font-size: 13px; |
| | | font-weight: 700; |
| | | color: var(--text-main); |
| | | } |
| | | |
| | | .column-list { |
| | | display: grid; |
| | | grid-template-columns: repeat(2, minmax(0, 1fr)); |
| | | gap: 8px 10px; |
| | | max-height: 280px; |
| | | overflow: auto; |
| | | padding-right: 4px; |
| | | } |
| | | |
| | | .dialog-panel .el-dialog { |
| | | border-radius: 24px; |
| | | border-radius: 22px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .dialog-panel .el-dialog__header { |
| | | padding: 22px 24px 12px; |
| | | padding: 20px 22px 12px; |
| | | background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%); |
| | | border-bottom: 1px solid rgba(224, 232, 241, 0.92); |
| | | } |
| | |
| | | } |
| | | |
| | | .dialog-panel .el-dialog__body { |
| | | padding: 18px 24px 8px; |
| | | padding: 20px 22px 8px; |
| | | } |
| | | |
| | | .dialog-form .el-form-item { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .dialog-form .el-form-item__label { |
| | | font-weight: 600; |
| | | color: #5b6f83; |
| | | } |
| | | |
| | | .dialog-form .el-input__inner, |
| | | .dialog-form .el-select .el-input__inner { |
| | | height: 36px; |
| | | line-height: 36px; |
| | | } |
| | | |
| | | .dialog-tip { |
| | | margin: 4px 0 2px; |
| | | padding: 10px 12px; |
| | | border-radius: 12px; |
| | | font-size: 12px; |
| | | line-height: 1.6; |
| | | color: #748497; |
| | | background: rgba(248, 251, 255, 0.92); |
| | | border: 1px solid rgba(226, 233, 242, 0.96); |
| | | } |
| | | |
| | | .dialog-footer { |
| | |
| | | gap: 10px; |
| | | } |
| | | |
| | | @media (max-width: 1520px) { |
| | | .advanced-grid { |
| | | grid-template-columns: repeat(5, minmax(0, 1fr)); |
| | | } |
| | | .reset-user { |
| | | margin-bottom: 16px; |
| | | padding: 12px 14px; |
| | | border-radius: 12px; |
| | | background: rgba(248, 251, 255, 0.92); |
| | | border: 1px solid rgba(226, 233, 242, 0.96); |
| | | color: var(--text-sub); |
| | | font-size: 13px; |
| | | } |
| | | |
| | | @media (max-width: 1280px) { |
| | | .advanced-grid { |
| | | grid-template-columns: repeat(4, minmax(0, 1fr)); |
| | | } |
| | | .table-action-danger { |
| | | color: #f56c6c; |
| | | } |
| | | |
| | | @media (max-width: 960px) { |
| | | .toolbar-left { |
| | | flex-basis: 100%; |
| | | } |
| | | |
| | | .advanced-grid { |
| | | grid-template-columns: repeat(3, minmax(0, 1fr)); |
| | | } |
| | | |
| | | .advanced-item.span-2 { |
| | | grid-column: span 2; |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 720px) { |
| | | @media (max-width: 768px) { |
| | | .page-shell { |
| | | padding: 12px; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .toolbar-search-item, |
| | | .toolbar-search-item.keyword { |
| | | min-width: 100%; |
| | | flex-basis: 100%; |
| | | .card-head, |
| | | .table-wrap { |
| | | padding-left: 12px; |
| | | padding-right: 12px; |
| | | } |
| | | |
| | | .toolbar-query-actions, |
| | | .toolbar-ops { |
| | | width: 100%; |
| | | } |
| | | |
| | | .advanced-grid { |
| | | grid-template-columns: repeat(2, minmax(0, 1fr)); |
| | | } |
| | | |
| | | .advanced-item.span-2 { |
| | | grid-column: span 2; |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 560px) { |
| | | .advanced-grid { |
| | | grid-template-columns: 1fr; |
| | | } |
| | | |
| | | .advanced-item.span-2 { |
| | | grid-column: auto; |
| | | } |
| | | |
| | | .list-toolbar, |
| | | .advanced-panel, |
| | | .table-wrap, |
| | | .pager-bar { |
| | | padding-left: 14px; |
| | | padding-right: 14px; |
| | | } |
| | | |
| | | .column-list { |
| | | grid-template-columns: 1fr; |
| | | .dialog-panel .el-dialog { |
| | | width: calc(100% - 24px) !important; |
| | | } |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="app" class="page-shell" v-cloak> |
| | | <section class="card-shell list-card"> |
| | | <div class="card-body"> |
| | | <div class="list-toolbar"> |
| | | <div class="toolbar-main"> |
| | | <div class="toolbar-left"> |
| | | <div class="toolbar-search"> |
| | | <div class="toolbar-search-item keyword"> |
| | | <el-input |
| | | v-model.trim="searchForm.condition" |
| | | size="small" |
| | | clearable |
| | | placeholder="请输入" |
| | | @keyup.enter.native="handleSearch"> |
| | | </el-input> |
| | | </div> |
| | | <div |
| | | v-for="field in quickSearchableFields" |
| | | :key="'quick-' + field.field" |
| | | class="toolbar-search-item"> |
| | | <el-select |
| | | v-if="field.kind === 'enum'" |
| | | v-model="searchForm[field.field]" |
| | | size="small" |
| | | clearable |
| | | :placeholder="field.label" |
| | | style="width: 100%;"> |
| | | <el-option |
| | | v-for="option in field.enumOptions" |
| | | :key="'quick-' + field.field + '-' + option.rawValue" |
| | | :label="option.label" |
| | | :value="normalizeOptionValue(field, option.rawValue)"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-autocomplete |
| | | v-else-if="field.kind === 'foreign'" |
| | | v-model="searchDisplay[field.field]" |
| | | size="small" |
| | | :fetch-suggestions="getSuggestionFetcher(field)" |
| | | :placeholder="field.label" |
| | | style="width: 100%;" |
| | | @select="handleSearchForeignSelect(field, $event)" |
| | | @input="handleSearchForeignInput(field)"> |
| | | <template slot-scope="{ item }"> |
| | | <div class="mono">{{ item.value }}</div> |
| | | <div style="font-size:12px;color:#8a98ac;">ID: {{ item.id }}</div> |
| | | </template> |
| | | </el-autocomplete> |
| | | <el-select |
| | | v-else-if="field.kind === 'checkbox'" |
| | | v-model="searchForm[field.field]" |
| | | size="small" |
| | | clearable |
| | | :placeholder="field.label" |
| | | style="width: 100%;"> |
| | | <el-option label="是" :value="normalizeOptionValue(field, field.checkboxActiveRaw)"></el-option> |
| | | <el-option label="否" :value="normalizeOptionValue(field, field.checkboxInactiveRaw)"></el-option> |
| | | </el-select> |
| | | <el-input |
| | | v-else |
| | | v-model.trim="searchForm[field.field]" |
| | | size="small" |
| | | clearable |
| | | :placeholder="field.label" |
| | | @keyup.enter.native="handleSearch"> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | <div class="toolbar-query-actions"> |
| | | <el-button size="small" type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button> |
| | | <el-button size="small" icon="el-icon-refresh-left" @click="handleReset">重置</el-button> |
| | | <el-button |
| | | v-if="hasAdvancedFilters" |
| | | size="small" |
| | | plain |
| | | :icon="advancedFiltersVisible ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" |
| | | @click="toggleAdvancedFilters"> |
| | | {{ advancedFiltersVisible ? '收起' : '筛选' }} |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <div class="toolbar-ops"> |
| | | <el-button size="small" type="primary" plain icon="el-icon-plus" @click="openCreateDialog">新增</el-button> |
| | | <el-button size="small" type="danger" plain icon="el-icon-delete" :disabled="selection.length === 0" @click="removeSelection">删除</el-button> |
| | | <el-popover |
| | | placement="bottom" |
| | | width="320" |
| | | trigger="click" |
| | | popper-class="column-popover"> |
| | | <div class="column-popover-head"> |
| | | <span>列设置</span> |
| | | <div> |
| | | <el-button type="text" @click="selectAllColumns">全选</el-button> |
| | | <el-button type="text" @click="resetColumns">重置</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="column-list"> |
| | | <el-checkbox |
| | | v-for="field in allColumns" |
| | | :key="'column-' + field.field" |
| | | :value="isColumnVisible(field.field)" |
| | | @change="toggleColumn(field.field, $event)"> |
| | | {{ field.label }} |
| | | </el-checkbox> |
| | | </div> |
| | | <el-button slot="reference" size="small" plain icon="el-icon-setting">列设置</el-button> |
| | | </el-popover> |
| | | <el-button size="small" plain icon="el-icon-download" :loading="exporting" @click="exportRows">导出</el-button> |
| | | </div> |
| | | <div id="app" v-cloak class="page-shell"> |
| | | <div class="card-shell"> |
| | | <div class="card-head"> |
| | | <div class="head-top"> |
| | | <div class="head-title"> |
| | | <h1>系统用户</h1> |
| | | <p>修改界面不再显示密码,密码调整统一通过“重置密码”完成;角色、状态等字段恢复为选择控件。</p> |
| | | </div> |
| | | <div class="head-actions"> |
| | | <el-button type="primary" icon="el-icon-plus" @click="openCreateDialog">新增用户</el-button> |
| | | <el-button type="danger" icon="el-icon-delete" :disabled="selection.length === 0" @click="removeSelection">删除所选</el-button> |
| | | </div> |
| | | </div> |
| | | <el-form :inline="true" :model="searchForm" class="search-form" @submit.native.prevent> |
| | | <el-form-item label="登录账户"> |
| | | <el-input v-model.trim="searchForm.username" clearable placeholder="请输入登录账户" @keyup.enter.native="handleSearch"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="账号"> |
| | | <el-input v-model.trim="searchForm.mobile" clearable placeholder="请输入账号" @keyup.enter.native="handleSearch"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button> |
| | | <el-button icon="el-icon-refresh-left" @click="handleResetSearch">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <el-collapse-transition> |
| | | <div v-show="advancedFiltersVisible && hasAdvancedFilters" class="advanced-panel"> |
| | | <div class="advanced-grid"> |
| | | <div |
| | | v-for="field in advancedSearchableFields" |
| | | :key="'advanced-' + field.field" |
| | | :class="['advanced-item', field.kind === 'date' ? 'span-2' : '']"> |
| | | <el-date-picker |
| | | v-if="field.kind === 'date'" |
| | | v-model="searchForm[field.field]" |
| | | size="small" |
| | | type="datetimerange" |
| | | unlink-panels |
| | | range-separator="至" |
| | | :start-placeholder="field.label + '开始'" |
| | | :end-placeholder="field.label + '结束'" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | style="width: 100%;"> |
| | | </el-date-picker> |
| | | <el-select |
| | | v-else-if="field.kind === 'enum'" |
| | | v-model="searchForm[field.field]" |
| | | size="small" |
| | | clearable |
| | | :placeholder="field.label" |
| | | style="width: 100%;"> |
| | | <el-option |
| | | v-for="option in field.enumOptions" |
| | | :key="'advanced-' + field.field + '-' + option.rawValue" |
| | | :label="option.label" |
| | | :value="normalizeOptionValue(field, option.rawValue)"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-autocomplete |
| | | v-else-if="field.kind === 'foreign'" |
| | | v-model="searchDisplay[field.field]" |
| | | size="small" |
| | | :fetch-suggestions="getSuggestionFetcher(field)" |
| | | :placeholder="field.label" |
| | | style="width: 100%;" |
| | | @select="handleSearchForeignSelect(field, $event)" |
| | | @input="handleSearchForeignInput(field)"> |
| | | <template slot-scope="{ item }"> |
| | | <div class="mono">{{ item.value }}</div> |
| | | <div style="font-size:12px;color:#8a98ac;">ID: {{ item.id }}</div> |
| | | </template> |
| | | </el-autocomplete> |
| | | <el-select |
| | | v-else-if="field.kind === 'checkbox'" |
| | | v-model="searchForm[field.field]" |
| | | size="small" |
| | | clearable |
| | | :placeholder="field.label" |
| | | style="width: 100%;"> |
| | | <el-option label="是" :value="normalizeOptionValue(field, field.checkboxActiveRaw)"></el-option> |
| | | <el-option label="否" :value="normalizeOptionValue(field, field.checkboxInactiveRaw)"></el-option> |
| | | </el-select> |
| | | <el-input |
| | | v-else |
| | | v-model.trim="searchForm[field.field]" |
| | | size="small" |
| | | clearable |
| | | :placeholder="field.label" |
| | | @keyup.enter.native="handleSearch"> |
| | | </el-input> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-collapse-transition> |
| | | |
| | | <div class="table-wrap"> |
| | | <div class="table-shell"> |
| | | <el-table |
| | | ref="dataTable" |
| | | :key="'table-' + visibleColumnKeys.join('|')" |
| | | v-loading="loading" |
| | | :data="tableData" |
| | | border |
| | | stripe |
| | | :height="tableHeight" |
| | | @selection-change="handleSelectionChange" |
| | | @sort-change="handleSortChange"> |
| | | <el-table-column type="selection" width="52" align="center"></el-table-column> |
| | | <el-table-column |
| | | v-for="field in visibleColumns" |
| | | :key="field.field" |
| | | :prop="field.field" |
| | | :label="field.label" |
| | | :width="field.primaryKey ? 90 : null" |
| | | :min-width="field.primaryKey ? null : field.minWidth" |
| | | :sortable="isSortableField(field) ? 'custom' : false" |
| | | :show-overflow-tooltip="field.kind !== 'image'" |
| | | align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-image |
| | | v-if="field.kind === 'image' && getTableValue(scope.row, field)" |
| | | :src="getTableValue(scope.row, field)" |
| | | fit="cover" |
| | | style="width: 48px; height: 48px; border-radius: 10px;"> |
| | | </el-image> |
| | | <el-tag v-else-if="field.kind === 'enum'" size="mini" type="success"> |
| | | {{ valueOrDash(getTableValue(scope.row, field)) }} |
| | | </el-tag> |
| | | <el-tag v-else-if="field.kind === 'checkbox'" size="mini" :type="isCheckboxChecked(scope.row, field) ? 'success' : 'info'"> |
| | | {{ isCheckboxChecked(scope.row, field) ? '是' : '否' }} |
| | | </el-tag> |
| | | <span v-else-if="field.textarea" class="payload-cell mono" :title="stringValue(getTableValue(scope.row, field))"> |
| | | {{ valueOrDash(getTableValue(scope.row, field)) }} |
| | | </span> |
| | | <span v-else>{{ valueOrDash(getTableValue(scope.row, field)) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="160" fixed="right" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="openEditDialog(scope.row)">修改</el-button> |
| | | <el-button type="text" style="color:#f56c6c;" @click="removeRows([scope.row[primaryKeyField]])">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="table-wrap"> |
| | | <div class="table-shell" v-loading="loading"> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | stripe |
| | | height="calc(100vh - 245px)" |
| | | @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="48" align="center"></el-table-column> |
| | | <el-table-column prop="username" label="登录账户" min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="mobile" label="账号" min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="roleName" label="角色" min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="MFA授权" width="110" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="mini" :type="Number(scope.row.mfaAllow) === 1 ? 'success' : 'info'"> |
| | | {{ Number(scope.row.mfaAllow) === 1 ? '已授权' : '未授权' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="MFA状态" width="110" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-tag size="mini" :type="Number(scope.row.mfaEnabled) === 1 ? 'success' : 'warning'"> |
| | | {{ Number(scope.row.mfaEnabled) === 1 ? '已启用' : '未启用' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" width="130" align="center"> |
| | | <template slot-scope="scope"> |
| | | <div class="status-switch"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | active-text="正常" |
| | | inactive-text="禁用" |
| | | @change="toggleStatus(scope.row)"> |
| | | </el-switch> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="220" fixed="right" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button type="text" @click="openEditDialog(scope.row)">编辑</el-button> |
| | | <el-button type="text" @click="openResetPasswordDialog(scope.row)">重置密码</el-button> |
| | | <el-button type="text" class="table-action-danger" @click="removeRows([scope.row.id])">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div class="pager-bar"> |
| | | <el-pagination |
| | | small |
| | | background |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :current-page="page.curr" |
| | | :page-size="page.limit" |
| | | :page-sizes="[15, 30, 50, 100, 200, 500]" |
| | | :total="page.total" |
| | | @current-change="handleCurrentChange" |
| | | @size-change="handleSizeChange"> |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </section> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | class="dialog-panel" |
| | | :title="dialog.mode === 'create' ? '新增 User' : '修改 User'" |
| | | :title="dialog.mode === 'create' ? '新增用户' : '修改用户'" |
| | | :visible.sync="dialog.visible" |
| | | width="760px" |
| | | :close-on-click-modal="false"> |
| | | width="620px" |
| | | :close-on-click-modal="false" |
| | | append-to-body> |
| | | <el-form |
| | | ref="dialogForm" |
| | | :model="dialogForm" |
| | | :rules="dialogRules" |
| | | label-width="110px" |
| | | size="small"> |
| | | <el-row :gutter="16"> |
| | | <el-col |
| | | v-for="field in editableFields" |
| | | :key="'dialog-' + field.field" |
| | | :span="field.textarea || field.kind === 'image' ? 24 : 12"> |
| | | <el-form-item :label="field.label" :prop="field.field"> |
| | | <el-date-picker |
| | | v-if="field.kind === 'date'" |
| | | v-model="dialogForm[field.field]" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | :placeholder="'请选择' + field.label" |
| | | style="width: 100%;"> |
| | | </el-date-picker> |
| | | <el-select |
| | | v-else-if="field.kind === 'enum'" |
| | | v-model="dialogForm[field.field]" |
| | | clearable |
| | | :placeholder="'请选择' + field.label" |
| | | style="width: 100%;"> |
| | | label-width="88px" |
| | | class="dialog-form" |
| | | @submit.native.prevent> |
| | | <el-row :gutter="18"> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="登录账户" prop="username"> |
| | | <el-input v-model.trim="dialogForm.username" maxlength="32" placeholder="请输入登录账户"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="账号" prop="mobile"> |
| | | <el-input v-model.trim="dialogForm.mobile" maxlength="32" placeholder="请输入账号"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="角色" prop="roleId"> |
| | | <el-select v-model="dialogForm.roleId" placeholder="请选择角色" style="width: 100%;"> |
| | | <el-option |
| | | v-for="option in field.enumOptions" |
| | | :key="'dialog-' + field.field + '-' + option.rawValue" |
| | | :label="option.label" |
| | | :value="normalizeOptionValue(field, option.rawValue)"> |
| | | v-for="role in roles" |
| | | :key="role.id" |
| | | :label="role.name" |
| | | :value="Number(role.id)"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-autocomplete |
| | | v-else-if="field.kind === 'foreign'" |
| | | v-model="dialogDisplay[field.field]" |
| | | :fetch-suggestions="getSuggestionFetcher(field)" |
| | | :placeholder="'请输入' + field.label" |
| | | style="width: 100%;" |
| | | @select="handleForeignSelect(field, $event)" |
| | | @input="handleForeignInput(field)"> |
| | | <template slot-scope="{ item }"> |
| | | <div class="mono">{{ item.value }}</div> |
| | | <div style="font-size:12px;color:#8a98ac;">ID: {{ item.id }}</div> |
| | | </template> |
| | | </el-autocomplete> |
| | | <el-switch |
| | | v-else-if="field.kind === 'checkbox'" |
| | | v-model="dialogForm[field.field]" |
| | | :active-value="normalizeOptionValue(field, field.checkboxActiveRaw)" |
| | | :inactive-value="normalizeOptionValue(field, field.checkboxInactiveRaw)" |
| | | active-color="#13ce66" |
| | | inactive-color="#c0c4cc"> |
| | | </el-switch> |
| | | <el-input |
| | | v-else-if="field.textarea" |
| | | v-model.trim="dialogForm[field.field]" |
| | | type="textarea" |
| | | :rows="3" |
| | | :placeholder="'请输入' + field.label"> |
| | | </el-input> |
| | | <el-input |
| | | v-else |
| | | v-model.trim="dialogForm[field.field]" |
| | | :placeholder="'请输入' + field.label"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="状态"> |
| | | <el-select v-model="dialogForm.status" placeholder="请选择状态" style="width: 100%;"> |
| | | <el-option label="正常" :value="1"></el-option> |
| | | <el-option label="禁用" :value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12"> |
| | | <el-form-item label="MFA授权"> |
| | | <el-select v-model="dialogForm.mfaAllow" placeholder="请选择" style="width: 100%;"> |
| | | <el-option label="不允许" :value="0"></el-option> |
| | | <el-option label="允许" :value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="dialog.mode === 'create'" :xs="24" :sm="12"> |
| | | <el-form-item label="初始密码" prop="password"> |
| | | <el-input v-model.trim="dialogForm.password" show-password maxlength="32" placeholder="请输入初始密码"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div v-if="dialog.mode === 'edit'" class="dialog-tip"> |
| | | 修改界面不显示密码。如需调整密码,请关闭当前窗口后使用列表里的“重置密码”。 |
| | | </div> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialog.visible = false">取消</el-button> |
| | | <el-button type="primary" :loading="dialog.submitting" @click="submitDialog">保存</el-button> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeDialog">取消</el-button> |
| | | <el-button type="primary" :loading="dialogSubmitting" @click="submitDialog">保存</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | class="dialog-panel" |
| | | title="重置密码" |
| | | :visible.sync="resetDialog.visible" |
| | | width="420px" |
| | | :close-on-click-modal="false" |
| | | append-to-body> |
| | | <div class="reset-user">当前用户:{{ resetDialog.username || '--' }}</div> |
| | | <el-form |
| | | ref="resetForm" |
| | | :model="resetDialog" |
| | | :rules="resetRules" |
| | | label-width="72px" |
| | | class="dialog-form" |
| | | @submit.native.prevent> |
| | | <el-form-item label="新密码" prop="password"> |
| | | <el-input v-model.trim="resetDialog.password" show-password maxlength="32" placeholder="请输入新密码"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="closeResetDialog">取消</el-button> |
| | | <el-button type="primary" :loading="resetSubmitting" @click="submitResetPassword">确定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/user/user.js?v=20260311_mfa" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../../static/js/user/user.js?v=20260311_user_restore1" charset="utf-8"></script> |
| | | </body> |
| | | </html> |