Commit c44edd19 by zhaochengxiang

服务用户

parent c8e1f138
......@@ -276,7 +276,8 @@ const ModelTable = (props) => {
const [ pagination, setPagination ] = useState( { pageNum: 1, pageSize: 20 } );
const [ currentItem, setCurrentItem ] = useState(null);
const { pageNum, pageSize } = pagination;
const [ users, setUsers ] = useState([]);
const [modal, contextHolder] = Modal.useModal();
const anchorId = getQueryParam(AnchorId, props.location?.search);
......@@ -285,8 +286,9 @@ const ModelTable = (props) => {
const shouldScrollRef = useRef(false);
useEffect(() => {
getUsers();
getAttrs();
if ((modelId||'') !== '') {
window?.addEventListener("storage", modelEventChange);
......@@ -474,14 +476,27 @@ const ModelTable = (props) => {
dataIndex: item.key,
ellipsis: true,
width: 120,
render: (_, record) => {
return record.basicInfo ? record.basicInfo[item.key] : '';
}
};
newCols.push(col);
if (item.key === 'name') {
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 '';
}
}
});
if (!modelId) {
......@@ -496,7 +511,7 @@ const ModelTable = (props) => {
}
return newCols;
}, [visibleColNames, attrs, indexCol, actionCol, modelId, detailItem])
}, [visibleColNames, attrs, indexCol, actionCol, modelId, detailItem, users])
const modelEventChange = (e) => {
if (e.key === 'modelChange') {
......@@ -519,6 +534,15 @@ const ModelTable = (props) => {
})
}
const getUsers = () => {
dispatch({
type: 'pds.getOwners',
callback: (data) => {
setUsers(data);
}
})
}
const getCheckoutDataModel = () => {
dispatch({
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