detail.js 948 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { useRef, useEffect } from 'react';
  2. import PageContent from '@/components/PageContent';
  3. import { useLocation, useNavigate } from '@umijs/max';
  4. const CadDeTail = () => {
  5. const cadRef = useRef();
  6. const location = useLocation();
  7. const {
  8. state: { path },
  9. } = location;
  10. console.log('-----path-------', path);
  11. useEffect(() => {
  12. const content = document.getElementById('container');
  13. ZwCloud2D.ZwEditor.ZwInit(content);
  14. ZwCloud2D.ZwDataProcessor.ZwSetConnectUrl(
  15. 'https://cad.greentech.com.cn',
  16. 'wss://cad.greentech.com.cn:5121',
  17. 'https://cad.greentech.com.cn',
  18. );
  19. ZwCloud2D.ZwDataProcessor.ZwSetLoadDwg(path);
  20. ZwCloud2D.ZwDataProcessor.ZwLoad();
  21. }, []);
  22. return (
  23. <PageContent>
  24. <div>CAD在线审批</div>
  25. <div
  26. id="container"
  27. style={{ width: '100%', height: '80vh' }}
  28. ref={cadRef}
  29. />
  30. </PageContent>
  31. );
  32. };
  33. export default CadDeTail;