From baa1fe3c601db2ea107fda607b5fc063a7424c1d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 29 二月 2024 15:16:23 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/index.css | 9 +++++++--
zy-asrs-flow/src/pages/map/index.jsx | 49 +++++++++++++++----------------------------------
2 files changed, 22 insertions(+), 36 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/index.css b/zy-asrs-flow/src/pages/map/index.css
index 6cea147..bb6afbb 100644
--- a/zy-asrs-flow/src/pages/map/index.css
+++ b/zy-asrs-flow/src/pages/map/index.css
@@ -3,6 +3,11 @@
padding-inline: 15px;
}
-.ant-card .ant-card-body {
- padding: 15;
+.ant-pro-page-container-children-container-no-header {
+ padding-block-start: 0;
+ padding-inline: 0;
+}
+
+.ant-pro-page-container-children-container {
+ padding-block-end: 0;
}
\ No newline at end of file
diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index 3049c90..cd988ba 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -1,76 +1,57 @@
import * as React from 'react'
import * as PIXI from 'pixi.js';
-import * as TWEEDLE from 'tweedle.js';
-import { Button, message, Modal, Card } from 'antd';
import './index.css'
import {
- FooterToolbar,
PageContainer,
- ProTable,
- LightFilter,
} from '@ant-design/pro-components';
const Map = () => {
const mapRef = React.useRef();
- const [activeMap, setActiveMap] = React.useState('zone');
const [app, setApp] = React.useState(() => {
return new PIXI.Application({
- // width: window.innerWidth - 32,
- // height: window.innerHeight - 92,
- background: '#dcdde1',
+ background: '#f5f6fa',
antialias: true,
})
})
React.useEffect(() => {
+
+ // resize
const onResize = () => {
- console.log(1);
- const width = mapRef.current.offsetWidth + 2;
- const height = window.innerHeight - 92;
- console.log(width, height);
if (mapRef) {
+ const width = mapRef.current.offsetWidth;
+ const height = window.innerHeight - 92;
app.renderer.resize(width, height);
}
}
window.addEventListener('resize', onResize);
onResize();
+ // app init
app.stage.interactive = true;
app.stage.hitArea = app.screen;
globalThis.__PIXI_APP__ = app;
mapRef.current.appendChild(app.view);
- // return () => {
- // app.destroy(true, true);
- // window.removeEventListener('resize', onResize);
- // }
}, []);
return (
<>
- <Card
- style={{ width: '100%', height: 'calc(100vh - 90px)' }}
- // tabList={[
- // {
- // key: 'zone',
- // label: 'zone'
- // }
- // ]}
- // activeTabKey={activeMap}
- // tabBarExtraContent={<Button>鏇村璁剧疆</Button>}
- // onTabChange={(key) => {
- // setActiveMap(key);
- // }}
- // tabProps={{
- // size: 'middle',
- // }}
+ <PageContainer
+ header={{
+ title: false,
+ subTitle: false,
+ breadcrumb: {},
+ }}
+ style={{ height: '100%', padding: 0 }} // Here
+
>
<div
style={{ width: '100%', height: '100%' }}
ref={mapRef}
>
</div>
- </Card>
+ </PageContainer>
</>
)
}
--
Gitblit v1.9.1