Commit ff43a8d0 by zhaochengxiang

模型负责人

parent 6f19e169
......@@ -67,7 +67,7 @@ const FC = (props) => {
const getUsers = () => {
setLoadingUsers(true)
dispatch({
type: 'user.getOAUsers',
type: 'datamodel.getCooperationUsers',
callback: data => {
setLoadingUsers(false)
setUsers(data)
......@@ -124,12 +124,12 @@ const FC = (props) => {
<Form form={form} {...formItemLayout} onValuesChange={onValuesChange}>
<Row gutter={10}>
<Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item label='技术负责人' name='technicalManagerId'>
<Form.Item label='技术负责人' name='technicalManagerUser'>
<UsersItem loading={loadingUsers} users={users} />
</Form.Item>
</Col>
<Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item label='业务负责人' name='businessManagerId'>
<Form.Item label='业务负责人' name='businessManagerUser'>
<UsersItem loading={loadingUsers} users={users} />
</Form.Item>
</Col>
......@@ -145,10 +145,10 @@ const FC = (props) => {
) : (
<Descriptions column={3}>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >技术负责人</div>}>
{modelerData?.technicalManagerName}
{modelerData?.technicalManagerUser?.name}
</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >业务负责人</div>}>
{modelerData?.businessManagerName}
{modelerData?.businessManagerUser?.name}
</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >维护历史</div>} >
<div style={{ maxHeight: 70, overflow: 'auto' }}>
......@@ -177,10 +177,10 @@ const UsersItem = ({ loading, users, value, onChange }) => {
useDebounceEffect(() => {
setOptions(
(users??[])
.filter(item => !searchValue|| (item.loginName??'').indexOf(searchValue)!==-1 || (item.realName??'').indexOf(searchValue)!==-1)
.filter(item => !searchValue|| (item.name??'').indexOf(searchValue)!==-1 || (item.dname??'').indexOf(searchValue)!==-1)
.map(item => ({
label: item.realName,
value: `${item.id}`,
label: item.name,
value: item.name,
}))
)
}, [searchValue, users], { wait: 300 })
......@@ -188,7 +188,7 @@ const UsersItem = ({ loading, users, value, onChange }) => {
return (
<Select loading={loading} allowClear showSearch
placeholder='请选择用户'
value={(options??[]).length>0?value:undefined}
value={(options??[]).length>0?value?.name:undefined}
searchValue={searchValue}
onSearch={(val) => {
setSearchValue(val)
......@@ -199,7 +199,14 @@ const UsersItem = ({ loading, users, value, onChange }) => {
filterOption={false}
options={options}
onChange={(val) => {
onChange?.(val)
if (val) {
const index = (users??[]).findIndex(item => item.name === val)
if (index !== -1) {
onChange?.(users[index])
}
} else {
onChange?.()
}
}}
/>
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment