zy-asrs-flow/src/pages/system/user/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zy-asrs-wcs/src/main/resources/mapper/system/UserMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
zy-asrs-flow/src/pages/system/user/index.jsx
@@ -7,7 +7,7 @@ ProTable, LightFilter, } from '@ant-design/pro-components'; import { PlusOutlined, ExportOutlined, DownOutlined } from '@ant-design/icons'; import { PlusOutlined, ExportOutlined, DownOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons'; import Http from '@/utils/http'; import Edit from './components/edit' import Pwd from './components/pwd' @@ -449,7 +449,7 @@ <Button type="link" danger key="batchRemove" key="remove" onClick={async () => { Modal.confirm({ title: '删除', @@ -493,7 +493,7 @@ blockNode defaultExpandAll // 异步加载失效 expandedKeys={deptExpandedKeys} onExpand={setDeptExpandedKeys} onExpand={setDeptExpandedKeys} treeData={deptTreeData} switcherIcon={<DownOutlined />} onSelect={(selectedKeys, info) => { @@ -539,6 +539,30 @@ actions: [ <Button type="primary" danger key="removeBatch" hidden={selectedRows?.length === 0} onClick={async () => { Modal.confirm({ title: '是否确认删除所选数据项?', icon: <ExclamationCircleOutlined />, content: '请谨慎操作', async onOk() { const success = await handleRemove(selectedRows); if (success) { setSelectedRows([]); actionRef.current.reload(); } }, onCancel() { }, }); }} > <DeleteOutlined /> 删除 </Button>, <Button type="primary" key="save" onClick={async () => { setModalVisible(true) @@ -567,6 +591,7 @@ } }) } tableAlertRender={false} rowSelection={{ onChange: (ids, rows) => { setSelectedRows(rows); @@ -583,38 +608,6 @@ }} /> </Col> {selectedRows?.length > 0 && ( <FooterToolbar extra={ <div> 已选择 <a style={{ fontWeight: 600 }}>{selectedRows.length}</a> 项 </div> } > <Button key="remove" danger onClick={async () => { Modal.confirm({ title: '删除', content: '确定删除该项吗?', onOk: async () => { const success = await handleRemove(selectedRows); if (success) { setSelectedRows([]); actionRef.current?.reloadAndRest?.(); } }, }); }} > 批量删除 </Button> </FooterToolbar> )} <Edit open={modalVisible} zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/system/controller/UserController.java
@@ -59,6 +59,18 @@ @OperationLog("添加用户") @PostMapping("/user/save") public R save(@RequestBody User user) { if (!Cools.isEmpty(user.getUsername()) && userService.count(new LambdaQueryWrapper<User>().eq(User::getUsername, user.getUsername())) > 0) { return R.error("登录账号已存在"); } if (!Cools.isEmpty(user.getNickname()) && userService.count(new LambdaQueryWrapper<User>().eq(User::getNickname, user.getNickname())) > 0) { return R.error("用户名称已存在"); } if (!Cools.isEmpty(user.getPhone()) && userService.count(new LambdaQueryWrapper<User>().eq(User::getPhone, user.getPhone())) > 0) { return R.error("手机号已存在"); } user.setPassword(userService.encodePassword(COMMON_PASSWORD)); @@ -77,6 +89,21 @@ @OperationLog("修改用户") @PostMapping("/user/update") public R update(@RequestBody User user) { if (!Cools.isEmpty(user.getUsername()) && userService.count(new LambdaQueryWrapper<User>() .eq(User::getUsername, user.getUsername()) .ne(User::getId, user.getId())) > 0) { return R.error("登录账号已存在"); } if (!Cools.isEmpty(user.getNickname()) && userService.count(new LambdaQueryWrapper<User>() .eq(User::getNickname, user.getNickname()) .ne(User::getId, user.getId())) > 0) { return R.error("用户名称已存在"); } if (!Cools.isEmpty(user.getPhone()) && userService.count(new LambdaQueryWrapper<User>() .eq(User::getPhone, user.getPhone()) .ne(User::getId, user.getId())) > 0) { return R.error("手机号已存在"); } if (!Cools.isEmpty(user.getPassword())) { user.setPassword(userService.encodePassword(user.getPassword())); zy-asrs-wcs/src/main/resources/mapper/system/UserMapper.xml
@@ -19,6 +19,7 @@ from sys_user su left join sys_dept sd on su.dept_id = sd.id where 1=1 and su.deleted = 0 <if test="param.deptId != null"> and (FIND_IN_SET(#{param.deptId}, sd.`path`) OR sd.`id` = #{param.deptId}) </if>