Commit ff43a8d0 by zhaochengxiang

模型负责人

parent 6f19e169
...@@ -67,7 +67,7 @@ const FC = (props) => { ...@@ -67,7 +67,7 @@ const FC = (props) => {
const getUsers = () => { const getUsers = () => {
setLoadingUsers(true) setLoadingUsers(true)
dispatch({ dispatch({
type: 'user.getOAUsers', type: 'datamodel.getCooperationUsers',
callback: data => { callback: data => {
setLoadingUsers(false) setLoadingUsers(false)
setUsers(data) setUsers(data)
...@@ -124,12 +124,12 @@ const FC = (props) => { ...@@ -124,12 +124,12 @@ const FC = (props) => {
<Form form={form} {...formItemLayout} onValuesChange={onValuesChange}> <Form form={form} {...formItemLayout} onValuesChange={onValuesChange}>
<Row gutter={10}> <Row gutter={10}>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item label='技术负责人' name='technicalManagerId'> <Form.Item label='技术负责人' name='technicalManagerUser'>
<UsersItem loading={loadingUsers} users={users} /> <UsersItem loading={loadingUsers} users={users} />
</Form.Item> </Form.Item>
</Col> </Col>
<Col xs={24} sm={24} lg={12} xl={8}> <Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item label='业务负责人' name='businessManagerId'> <Form.Item label='业务负责人' name='businessManagerUser'>
<UsersItem loading={loadingUsers} users={users} /> <UsersItem loading={loadingUsers} users={users} />
</Form.Item> </Form.Item>
</Col> </Col>
...@@ -145,10 +145,10 @@ const FC = (props) => { ...@@ -145,10 +145,10 @@ const FC = (props) => {
) : ( ) : (
<Descriptions column={3}> <Descriptions column={3}>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >技术负责人</div>}> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >技术负责人</div>}>
{modelerData?.technicalManagerName} {modelerData?.technicalManagerUser?.name}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >业务负责人</div>}> <Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >业务负责人</div>}>
{modelerData?.businessManagerName} {modelerData?.businessManagerUser?.name}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >维护历史</div>} > <Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >维护历史</div>} >
<div style={{ maxHeight: 70, overflow: 'auto' }}> <div style={{ maxHeight: 70, overflow: 'auto' }}>
...@@ -177,10 +177,10 @@ const UsersItem = ({ loading, users, value, onChange }) => { ...@@ -177,10 +177,10 @@ const UsersItem = ({ loading, users, value, onChange }) => {
useDebounceEffect(() => { useDebounceEffect(() => {
setOptions( setOptions(
(users??[]) (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 => ({ .map(item => ({
label: item.realName, label: item.name,
value: `${item.id}`, value: item.name,
})) }))
) )
}, [searchValue, users], { wait: 300 }) }, [searchValue, users], { wait: 300 })
...@@ -188,7 +188,7 @@ const UsersItem = ({ loading, users, value, onChange }) => { ...@@ -188,7 +188,7 @@ const UsersItem = ({ loading, users, value, onChange }) => {
return ( return (
<Select loading={loading} allowClear showSearch <Select loading={loading} allowClear showSearch
placeholder='请选择用户' placeholder='请选择用户'
value={(options??[]).length>0?value:undefined} value={(options??[]).length>0?value?.name:undefined}
searchValue={searchValue} searchValue={searchValue}
onSearch={(val) => { onSearch={(val) => {
setSearchValue(val) setSearchValue(val)
...@@ -199,7 +199,14 @@ const UsersItem = ({ loading, users, value, onChange }) => { ...@@ -199,7 +199,14 @@ const UsersItem = ({ loading, users, value, onChange }) => {
filterOption={false} filterOption={false}
options={options} options={options}
onChange={(val) => { 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