Commit d5afe82b authored by 熊成伟's avatar 熊成伟

debug

parent 7936efea
Pipeline #15383 passed with stages
in 57 seconds
import React from 'react';
import './index.less'
const ChildAddress = props => {
const {data} = props;
return (
<div className="address-item-box">
{data && data.length > 0 && data.map((item, index) => (
<div className="address-item" key={index}>
<div>
{item.XM || ''}
</div>
<div className="address-user">
<img alt="" className='smallIco mr-5' src='/img/tel.png' />
<a className="address-phone" href={item.YDDH ? `tel:${item.YDDH}` : null}>{item.YDDH || '无'}</a>
</div>
</div>
))}
</div>
)
};
export default ChildAddress;
import React from 'react';
import './index.less'
const ParentAddress = (props) => {
const {data, onClick} = props;
console.log(data)
return (
<div className="address-box">
{data && data.length > 0 && data.map((item, index) => (
<div key={index}>
<div onClick={() => onClick(item.ID, item.HASUSER)} className="address-item address-title">
{item.NAME || ''}
<img src="/img/rarrow.png" alt="" className={`icon18 ${item.checked ? 'icon-checked' : 'icon-unchecked'}`}/>
</div>
</div>
))}
</div>
);
};
export default ParentAddress;
import React, {useState, useEffect} from 'react';
import Document from 'react-document-title'
import ParentAddress from '../../components/AddressList/ParentAddress';
import axiosRequest from '../../utils/request';
import Skeleton from '../../components/Skeleton'
import './index.less'
import Empty from '../Empty'
const AddressBook = (props) => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
useEffect(() => {
setLoading(true);
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/oApp/getChildDeptList',
}).then(res => {
setLoading(false);
setData(res)
});
}, []);
const moveParent = (pId, HASUSER) => {
props.history.push(`/bord/address/${pId}/${HASUSER}`)
}
return (
<Document title="通讯录">
<div>
<div className='adMainBox'>
{loading ? <Skeleton/> : ( data.length > 0 ? (
<ParentAddress data={data} onClick={moveParent}/>
): <Empty/>)}
</div>
</div>
</Document>
);
};
export default AddressBook;
import React, {useState, useEffect} from 'react';
import Document from 'react-document-title'
import ParentAddress from '../../components/AddressList/ParentAddress';
import ChildAddress from '../../components/AddressList/ChildAddress';
import axiosRequest from '../../utils/request';
import Skeleton from '../../components/Skeleton'
import './index.less'
import Empty from '../Empty'
const NewPage = (props) => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const {pId, HASUSER} = props.match.params;
useEffect(() => {
setLoading(true);
console.log(HASUSER)
axiosRequest({
method: 'post',
url: HASUSER === 'true' ? `/idtAppServiceV6/oApp/getDeptUserList?deptId=${pId}` :`/idtAppServiceV6/oApp/getChildDeptList?pId=${pId}`,
}).then(res => {
setLoading(false);
setData(res)
});
}, [pId]);
const moveParent = (pId, HASUSER) => {
props.history.push(`/bord/address/${pId}/${HASUSER}`)
};
return (
<Document title="通讯录">
<div>
<div className='adMainBox'>
{loading ? <Skeleton/> : ( data.length > 0 ? (
HASUSER === 'true' ? <ChildAddress data={data}/> :<ParentAddress data={data} onClick={moveParent}/>
): <Empty/>)}
</div>
</div>
</Document>
);
};
export default NewPage;
......@@ -7,7 +7,9 @@ import Backlog from './pages/Backlog/Backlog'
import Work from './pages/Work/Work'
import WorkDetail from './pages/Work/WorkDetail'
import Notice from './pages/Notice/Notice'
import AddressBook from './pages/Communicate/AddressBook';
// import AddressBook from './pages/Communicate/AddressBook';
import NewAddress from './pages/Communicate/NewAddress';
import NewPage from './pages/Communicate/NewPage';
import Process from './pages/EventProcessing/Process'
import SubmitDetail from './pages/EventProcessing/SubmitDetail'
......@@ -25,7 +27,9 @@ const ReactRouter = () => {
<CommonLayout>
<Route path="/bord/backlog" component={Backlog}/>
<Route path="/bord/work" component={Work}/>
<Route path="/bord/addressList" component={AddressBook}/>
<Route path="/bord/addressList" component={NewAddress}/>
<Route path="/bord/address/:pId/:HASUSER" component={NewPage}/>
{/*<Route path="/bord/addressList" component={AddressBook}/>*/}
<Route path="/bord/notice" component={Notice}/>
</CommonLayout>
}/>
......
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