Commit c44edd19 by zhaochengxiang

服务用户

parent c8e1f138
...@@ -276,6 +276,7 @@ const ModelTable = (props) => { ...@@ -276,6 +276,7 @@ const ModelTable = (props) => {
const [ pagination, setPagination ] = useState( { pageNum: 1, pageSize: 20 } ); const [ pagination, setPagination ] = useState( { pageNum: 1, pageSize: 20 } );
const [ currentItem, setCurrentItem ] = useState(null); const [ currentItem, setCurrentItem ] = useState(null);
const { pageNum, pageSize } = pagination; const { pageNum, pageSize } = pagination;
const [ users, setUsers ] = useState([]);
const [modal, contextHolder] = Modal.useModal(); const [modal, contextHolder] = Modal.useModal();
...@@ -285,6 +286,7 @@ const ModelTable = (props) => { ...@@ -285,6 +286,7 @@ const ModelTable = (props) => {
const shouldScrollRef = useRef(false); const shouldScrollRef = useRef(false);
useEffect(() => { useEffect(() => {
getUsers();
getAttrs(); getAttrs();
if ((modelId||'') !== '') { if ((modelId||'') !== '') {
...@@ -474,12 +476,25 @@ const ModelTable = (props) => { ...@@ -474,12 +476,25 @@ const ModelTable = (props) => {
dataIndex: item.key, dataIndex: item.key,
ellipsis: true, ellipsis: true,
width: 120, width: 120,
render: (_, record) => {
return record.basicInfo ? record.basicInfo[item.key] : '';
}
}; };
newCols.push(col); newCols.push(col);
if (item.key === 'name') { if (item.key === 'name') {
col.render = (text, record, index) => { col.render = (text, record, index) => {
return (<ModelNameColumn text={text} record={record} detailItem={detailItem} />); return (<ModelNameColumn text={record.basicInfo?record.basicInfo[item.key]:''} record={record} detailItem={detailItem} />);
}
}
if (item.key === 'domain' || item.key === 'domainGroup') {
col.render = (_, record) => {
const user = users?.filter((user)=>(user.pernr===record.basicInfo[item.key]));
if (user && user.length > 0) {
return user[0].nachn?`${user[0].nachn}(${user[0].pernr})`:user[0].pernr;
}
return '';
} }
} }
}); });
...@@ -496,7 +511,7 @@ const ModelTable = (props) => { ...@@ -496,7 +511,7 @@ const ModelTable = (props) => {
} }
return newCols; return newCols;
}, [visibleColNames, attrs, indexCol, actionCol, modelId, detailItem]) }, [visibleColNames, attrs, indexCol, actionCol, modelId, detailItem, users])
const modelEventChange = (e) => { const modelEventChange = (e) => {
if (e.key === 'modelChange') { if (e.key === 'modelChange') {
...@@ -519,6 +534,15 @@ const ModelTable = (props) => { ...@@ -519,6 +534,15 @@ const ModelTable = (props) => {
}) })
} }
const getUsers = () => {
dispatch({
type: 'pds.getOwners',
callback: (data) => {
setUsers(data);
}
})
}
const getCheckoutDataModel = () => { const getCheckoutDataModel = () => {
dispatch({ dispatch({
type: 'pds.getCheckoutService', type: 'pds.getCheckoutService',
......
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