Commit 1f6444a7 by zhaochengxiang

bug修改

parent 72dbb3b3
...@@ -109,6 +109,10 @@ export function* getOwners() { ...@@ -109,6 +109,10 @@ export function* getOwners() {
return yield call(pds.getOwners) return yield call(pds.getOwners)
} }
export function* getDepartments() {
return yield call(pds.getDepartments)
}
export function* saveOwner(payload) { export function* saveOwner(payload) {
return yield call(pds.saveOwner, payload) return yield call(pds.saveOwner, payload)
} }
......
...@@ -108,6 +108,10 @@ export function getOwners() { ...@@ -108,6 +108,10 @@ export function getOwners() {
return GetJSON("/informationmanagement/userData/findAll") return GetJSON("/informationmanagement/userData/findAll")
} }
export function getDepartments() {
return GetJSON("/informationmanagement/userData/getAllDepartment")
}
export function saveOwner(payload) { export function saveOwner(payload) {
return GetJSON("/informationmanagement/userData/getUserDataAndInsert", payload); return GetJSON("/informationmanagement/userData/getUserDataAndInsert", payload);
} }
......
...@@ -13,6 +13,7 @@ import { AnchorId, AnchorDirId } from '../../../../util/constant'; ...@@ -13,6 +13,7 @@ import { AnchorId, AnchorDirId } from '../../../../util/constant';
import IndexCode from './IndexCode'; import IndexCode from './IndexCode';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg'; import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import SelectUser from '../../Model/Component/SelectUsers';
const AssetAction = (props) => { const AssetAction = (props) => {
const { id, dirId, action, terms, onChange, readOnly = false, form, onMetadataChange, onElementsChange } = props; const { id, dirId, action, terms, onChange, readOnly = false, form, onMetadataChange, onElementsChange } = props;
...@@ -31,15 +32,20 @@ const AssetAction = (props) => { ...@@ -31,15 +32,20 @@ const AssetAction = (props) => {
const [ selectTag, setSelectTag ] = useState({}); const [ selectTag, setSelectTag ] = useState({});
const [ systems, setSystems] = useState([]); const [ systems, setSystems] = useState([]);
const [ loadingSystems, setLoadingSystems ] = useState(false); const [ loadingSystems, setLoadingSystems ] = useState(false);
const [ users, setUsers ] = useState([]);
const [ loadingUsers, setLoadingUsers ] = useState(false);
const [ departments, setDepartments ] = useState([]);
const [ loadingDepartments, setLoadingDepartments ] = useState(false);
const app = useContext(AppContext); const app = useContext(AppContext);
useEffect(() => { useEffect(() => {
getSystems();
getUsers();
getDepartments();
if (action === 'add') { if (action === 'add') {
getSystems();
getElements(); getElements();
} else { } else {
getSystems();
setCurrentAction('detail'); setCurrentAction('detail');
if ((id||'')!=='') { if ((id||'')!=='') {
getAssetPaths(); getAssetPaths();
...@@ -89,6 +95,34 @@ const AssetAction = (props) => { ...@@ -89,6 +95,34 @@ const AssetAction = (props) => {
}); });
} }
const getUsers = () => {
setLoadingUsers(true);
dispatch({
type: 'pds.getOwners',
callback: (data) => {
setLoadingUsers(false);
setUsers(data);
},
error: () => {
setLoadingUsers(false);
}
})
}
const getDepartments = () => {
setLoadingDepartments(true);
dispatch({
type: 'pds.getDepartments',
callback: (data) => {
setLoadingDepartments(false);
setDepartments(data);
},
error: () => {
setLoadingDepartments(false);
}
})
}
const getResourceRelations = () => { const getResourceRelations = () => {
dispatch({ dispatch({
type: 'assetmanage.getResourceRelations', type: 'assetmanage.getResourceRelations',
...@@ -407,16 +441,40 @@ const AssetAction = (props) => { ...@@ -407,16 +441,40 @@ const AssetAction = (props) => {
allowClear allowClear
loading={loadingSystems} loading={loadingSystems}
disabled={element.manualMaintain==='否'} disabled={element.manualMaintain==='否'}
>
{
systems?.map((system, index) => {
return <Select.Option key={index} value={system.scopeName}>
{system.scopeName}
</Select.Option>
})
}
</Select>
)
}
if (element.name==='数据关键用户' || element.name==='业务部门负责人' || element.name==='it责任人') {
return <SelectUser
type='edit'
loading={loadingUsers}
users={users}
/>
}
if (element.name==='业务责任部门' || element.name==='it责任部门') {
return <Select
allowClear
loading={loadingDepartments}
disabled={element.manualMaintain==='否'}
> >
{ {
systems?.map((system, index) => { departments?.map((department, index) => {
return <Select.Option key={index} value={system.scopeName}> return <Select.Option key={index} value={department}>
{system.scopeName} {department}
</Select.Option> </Select.Option>
}) })
} }
</Select> </Select>
)
} }
if (element.selectMode==='单选') { if (element.selectMode==='单选') {
...@@ -625,7 +683,7 @@ const AssetAction = (props) => { ...@@ -625,7 +683,7 @@ const AssetAction = (props) => {
}); });
return ( return (
<Form {...formItemLayout} form={form}> <Form {...formItemLayout} form={form} labelWrap>
{ {
(sameAttributeElements||[]).map((element, _index) => { (sameAttributeElements||[]).map((element, _index) => {
return ( return (
......
import React, { useEffect, useMemo, useState } from 'react'; import React, { useEffect, useMemo, useState } from 'react';
import { Modal, Checkbox, Row, Col, Divider, Input, Typography, Form, Switch } from 'antd'; import { Modal, Checkbox, Row, Col, Divider, Input, Typography, Form, Switch, Select } from 'antd';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
...@@ -255,7 +255,9 @@ const UpdateTaskModal = (props) => { ...@@ -255,7 +255,9 @@ const UpdateTaskModal = (props) => {
return <></>; return <></>;
}) })
} }
<Divider>过滤信息</Divider> <Divider>
{(taskSettings?.target?.type==='AtlasTarget'||taskSettings?.target?.type==='SapbwTarget')?'代理配置':'过滤信息'}
</Divider>
<Form {...formItemLayout} form={form}> <Form {...formItemLayout} form={form}>
{ {
taskSettings && (taskSettings.targetConfParameters||[]).map((param, index) => { taskSettings && (taskSettings.targetConfParameters||[]).map((param, index) => {
...@@ -268,8 +270,14 @@ const UpdateTaskModal = (props) => { ...@@ -268,8 +270,14 @@ const UpdateTaskModal = (props) => {
key={index} key={index}
rules={[{ required: param.required, message: '必填项'}]} rules={[{ required: param.required, message: '必填项'}]}
> >
{ {
( param.show ? <Input placeholder={param.explain||''} /> : <Input.Password placeholder={param.explain||''} visibilityToggle={false} /> ) (param.selectMode==='singleSelect') ? <Select >
{
(param.selectItem||[]).map((item,index) => {
return <Select.Option key={index} value={item||''} >{item||''}</Select.Option>
})
}
</Select> : ( param.show ? <Input placeholder={param.explain||''} /> : <Input.Password placeholder={param.explain||''} visibilityToggle={false} /> )
} }
</Form.Item> </Form.Item>
) )
......
...@@ -6,7 +6,7 @@ const {Option} = Select ...@@ -6,7 +6,7 @@ const {Option} = Select
const SelectUser:React.FC=(props)=>{ const SelectUser:React.FC=(props)=>{
const {value,onChange,users,type,} = props const {value,onChange,users,type,loading} = props
const [searchValue, setSearchValue] = useState(undefined) const [searchValue, setSearchValue] = useState(undefined)
...@@ -35,6 +35,7 @@ const SelectUser:React.FC=(props)=>{ ...@@ -35,6 +35,7 @@ const SelectUser:React.FC=(props)=>{
showSearch showSearch
value={value} value={value}
onChange={change} onChange={change}
loading={loading}
allowClear allowClear
filterOption={false} filterOption={false}
onSearch={debounceFetcher} onSearch={debounceFetcher}
......
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