detail.js 934 B

12345678910111213141516171819202122232425262728293031323334353637
  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. console.log(window);
  12. const content = document.getElementById('container');
  13. window.ZwCloud2D.ZwEditor.ZwInit(content);
  14. ZwCloud2D.ZwDataProcessor.ZwSetConnectUrl(
  15. 'http://222.130.26.205:9080',
  16. 'http://222.130.26.205:5121',
  17. 'ws://222.130.26.205:5121',
  18. );
  19. ZwCloud2D.ZwDataProcessor.ZwSetLoadDwg(path);
  20. window.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;