Commit 1f6444a7 by zhaochengxiang

bug修改

parent 72dbb3b3
......@@ -109,6 +109,10 @@ export function* getOwners() {
return yield call(pds.getOwners)
}
export function* getDepartments() {
return yield call(pds.getDepartments)
}
export function* saveOwner(payload) {
return yield call(pds.saveOwner, payload)
}
......
......@@ -108,6 +108,10 @@ export function getOwners() {
return GetJSON("/informationmanagement/userData/findAll")
}
export function getDepartments() {
return GetJSON("/informationmanagement/userData/getAllDepartment")
}
export function saveOwner(payload) {
return GetJSON("/informationmanagement/userData/getUserDataAndInsert", payload);
}
......
......@@ -13,6 +13,7 @@ import { AnchorId, AnchorDirId } from '../../../../util/constant';
import IndexCode from './IndexCode';
import { CancelSvg, EditSvg, SaveSvg, FullScreenSvg, CancelFullScreenSvg } from './AssetSvg';
import SelectUser from '../../Model/Component/SelectUsers';
const AssetAction = (props) => {
const { id, dirId, action, terms, onChange, readOnly = false, form, onMetadataChange, onElementsChange } = props;
......@@ -31,15 +32,20 @@ const AssetAction = (props) => {
const [ selectTag, setSelectTag ] = useState({});
const [ systems, setSystems] = useState([]);
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);
useEffect(() => {
if (action === 'add') {
getSystems();
getUsers();
getDepartments();
if (action === 'add') {
getElements();
} else {
getSystems();
setCurrentAction('detail');
if ((id||'')!=='') {
getAssetPaths();
......@@ -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 = () => {
dispatch({
type: 'assetmanage.getResourceRelations',
......@@ -419,6 +453,30 @@ const AssetAction = (props) => {
)
}
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==='否'}
>
{
departments?.map((department, index) => {
return <Select.Option key={index} value={department}>
{department}
</Select.Option>
})
}
</Select>
}
if (element.selectMode==='单选') {
return (
<Select
......@@ -625,7 +683,7 @@ const AssetAction = (props) => {
});
return (
<Form {...formItemLayout} form={form}>
<Form {...formItemLayout} form={form} labelWrap>
{
(sameAttributeElements||[]).map((element, _index) => {
return (
......
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';
......@@ -255,7 +255,9 @@ const UpdateTaskModal = (props) => {
return <></>;
})
}
<Divider>过滤信息</Divider>
<Divider>
{(taskSettings?.target?.type==='AtlasTarget'||taskSettings?.target?.type==='SapbwTarget')?'代理配置':'过滤信息'}
</Divider>
<Form {...formItemLayout} form={form}>
{
taskSettings && (taskSettings.targetConfParameters||[]).map((param, index) => {
......@@ -269,7 +271,13 @@ const UpdateTaskModal = (props) => {
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>
)
......
......@@ -6,7 +6,7 @@ const {Option} = Select
const SelectUser:React.FC=(props)=>{
const {value,onChange,users,type,} = props
const {value,onChange,users,type,loading} = props
const [searchValue, setSearchValue] = useState(undefined)
......@@ -35,6 +35,7 @@ const SelectUser:React.FC=(props)=>{
showSearch
value={value}
onChange={change}
loading={loading}
allowClear
filterOption={false}
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