detail.js 903 B

123456789101112131415161718192021222324252627282930313233343536
  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. useEffect(() => {
  11. const content = document.getElementById('container');
  12. window.ZwCloud2D.ZwEditor.ZwInit(content);
  13. ZwCloud2D.ZwDataProcessor.ZwSetConnectUrl(
  14. 'http://47.111.24.13:5121',
  15. 'ws://47.111.24.13:5121',
  16. 'http://47.111.24.13:5121',
  17. );
  18. ZwCloud2D.ZwDataProcessor.ZwSetLoadDwg(path);
  19. window.ZwCloud2D.ZwDataProcessor.ZwLoad();
  20. }, []);
  21. return (
  22. <PageContent>
  23. <div>CAD在线审批</div>
  24. <div
  25. id="container"
  26. style={{ width: '100%', height: '80vh' }}
  27. ref={cadRef}
  28. />
  29. </PageContent>
  30. );
  31. };
  32. export default CadDeTail;