CODE 2 years ago
parent
commit
a4056a69bf
  1. 2
      api/app/lib/controllers/organization/user.js
  2. 16
      web/client/src/sections/organization/components/userModal.js

2
api/app/lib/controllers/organization/user.js

@ -226,6 +226,7 @@ async function creatUser (ctx, next) {
}
await models.User.create({
role: data.role,
name: data.name,
username: data.phone,
password: Hex.stringify(MD5(data.password)),
@ -268,6 +269,7 @@ async function updateUser (ctx, next) {
}
await models.User.update({
role: data.role,
name: data.name,
username: data.phone,
departmentId: data.departmentId,

16
web/client/src/sections/organization/components/userModal.js

@ -38,8 +38,9 @@ const UserModal = (props) => {
} :
{
contract: {
enable: true
}
enable: true,
role: '巡检人员'
},
}
}
>
@ -195,6 +196,17 @@ const UserModal = (props) => {
valuePropName="checked"
/>
</ProForm.Group>
<ProFormSelect
name={['contract', 'role']}
colProps={{ md: 12, xl: 12 }}
label="角色"
placeholder="请选择角色"
options={[{ label: '巡检人员', value: '巡检人员' }, { label: '管理人员', value: '管理人员' }]}
rules={[
{ required: true, message: '请选择角色' },
]}
/>
</ModalForm>
</Spin>
)

Loading…
Cancel
Save