Commit 59bff2cd by zhaochengxiang

模型增加负责人

parent eedc1dc1
...@@ -749,7 +749,7 @@ export function getModelMetadataCompareResult(payload) { ...@@ -749,7 +749,7 @@ export function getModelMetadataCompareResult(payload) {
} }
export function getModelBranchNotice(payload) { export function getModelBranchNotice(payload) {
return GetJSON("/shandatamodeler/easyDataModelerNotice/getModelBranchNotice", payload) return GetJSON("/datamodeler/easyDataModelerNotice/getModelBranchNotice", payload)
} }
export function getMetadataTable(payload) { export function getMetadataTable(payload) {
......
...@@ -676,6 +676,7 @@ const ImportAction = React.forwardRef((props, ref) => { ...@@ -676,6 +676,7 @@ const ImportAction = React.forwardRef((props, ref) => {
roughModelerData={roughModelerData} roughModelerData={roughModelerData}
editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'} editable={action!=='detail'&&action!=='flow'&&action!=='detail-version'&&action!=='edit-inherited'}
action={action} action={action}
onChange={onHeaderChange}
/> />
<ImportActionRelation <ImportActionRelation
modelerData={modelerData} action={action} modelerData={modelerData} action={action}
......
import React from 'react' import React from 'react'
import { Button, Form, Descriptions, Input, Row, Col, Space } from 'antd' import { Button, Form, Descriptions, Input, Row, Col, Space, Select } from 'antd'
import { DownOutlined, UpOutlined } from '@ant-design/icons' import { DownOutlined, UpOutlined } from '@ant-design/icons'
import { Subject } from 'rxjs'; import { Subject } from 'rxjs'
import { useDebounceEffect } from 'ahooks'
import { dispatch } from '../../../../model' import { dispatch } from '../../../../model'
import { importActionSubject } from './ImportAction'; import { importActionSubject } from './ImportAction'
import './ImportActionHeader.less'; import './ImportActionHeader.less';
export const ImportActionHeaderSubject = new Subject(); export const ImportActionHeaderSubject = new Subject();
const FC = (props) => { const FC = (props) => {
const { editable, form, modelerData, action } = props const { editable, form, modelerData, action, onChange } = props
const [isCollapse, setCollapse] = React.useState(true) const [isCollapse, setCollapse] = React.useState(true)
const [maintenanceRecords, setMaintenanceRecords] = React.useState() const [maintenanceRecords, setMaintenanceRecords] = React.useState()
const [loadingUsers, setLoadingUsers] = React.useState(false)
const [users, setUsers] = React.useState()
React.useEffect(() => { React.useEffect(() => {
const $importActionSubject = importActionSubject.subscribe((props) => { const $importActionSubject = importActionSubject.subscribe((props) => {
...@@ -28,6 +31,10 @@ const FC = (props) => { ...@@ -28,6 +31,10 @@ const FC = (props) => {
}, [action]) }, [action])
React.useEffect(() => { React.useEffect(() => {
getUsers()
}, [])
React.useEffect(() => {
if (modelerData?.id) { if (modelerData?.id) {
getMaintenanceRecords() getMaintenanceRecords()
} }
...@@ -57,6 +64,20 @@ const FC = (props) => { ...@@ -57,6 +64,20 @@ const FC = (props) => {
return '' return ''
}, [maintenanceRecords]) }, [maintenanceRecords])
const getUsers = () => {
setLoadingUsers(true)
dispatch({
type: 'user.getOAUsers',
callback: data => {
setLoadingUsers(false)
setUsers(data)
},
error: () => {
setLoadingUsers(false)
}
})
}
const getMaintenanceRecords = () => { const getMaintenanceRecords = () => {
dispatch({ dispatch({
type: 'datamodel.getMaintenanceRecords', type: 'datamodel.getMaintenanceRecords',
...@@ -69,6 +90,10 @@ const FC = (props) => { ...@@ -69,6 +90,10 @@ const FC = (props) => {
}) })
} }
const onValuesChange = (changedValues, allValues) => {
onChange?.(changedValues, allValues);
}
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
...@@ -96,9 +121,19 @@ const FC = (props) => { ...@@ -96,9 +121,19 @@ const FC = (props) => {
!isCollapse && <div className='mt-3'> !isCollapse && <div className='mt-3'>
{ {
editable ? ( editable ? (
<Form form={form} {...formItemLayout}> <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'>
<UsersItem loading={loadingUsers} users={users} />
</Form.Item>
</Col>
<Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item label='业务负责人' name='businessManagerId'>
<UsersItem loading={loadingUsers} users={users} />
</Form.Item>
</Col>
<Col xs={24} sm={24} lg={12} xl={8}>
<Form.Item <Form.Item
label="维护历史" label="维护历史"
> >
...@@ -109,6 +144,12 @@ const FC = (props) => { ...@@ -109,6 +144,12 @@ const FC = (props) => {
</Form> </Form>
) : ( ) : (
<Descriptions column={3}> <Descriptions column={3}>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >技术负责人</div>}>
{modelerData?.technicalManagerName}
</Descriptions.Item>
<Descriptions.Item label={<div style={{ textAlign: 'right', width: 106 }} >业务负责人</div>}>
{modelerData?.businessManagerName}
</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' }}>
{ {
...@@ -127,4 +168,39 @@ const FC = (props) => { ...@@ -127,4 +168,39 @@ const FC = (props) => {
) )
} }
export default FC export default FC
\ No newline at end of file
const UsersItem = ({ loading, users, value, onChange }) => {
const [searchValue, setSearchValue] = React.useState()
const [options, setOptions] = React.useState()
useDebounceEffect(() => {
setOptions(
(users??[])
.filter(item => !searchValue|| (item.loginName??'').indexOf(searchValue)!==-1 || (item.realName??'').indexOf(searchValue)!==-1)
.map(item => ({
label: item.realName,
value: `${item.id}`,
}))
)
}, [searchValue, users], { wait: 300 })
return (
<Select loading={loading} allowClear showSearch
placeholder='请选择用户'
value={(options??[]).length>0?value:undefined}
searchValue={searchValue}
onSearch={(val) => {
setSearchValue(val)
}}
onClear={() => {
setSearchValue()
}}
filterOption={false}
options={options}
onChange={(val) => {
onChange?.(val)
}}
/>
)
}
\ No newline at end of file
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