From d835d1b51f832889929cdf69010034a30ef44d02 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 17 十月 2024 13:57:29 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/drawer/shuttle/view.jsx | 37 ++++++++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/drawer/shuttle/view.jsx b/zy-asrs-flow/src/pages/map/drawer/shuttle/view.jsx
index 8aea51c..7d5b0ff 100644
--- a/zy-asrs-flow/src/pages/map/drawer/shuttle/view.jsx
+++ b/zy-asrs-flow/src/pages/map/drawer/shuttle/view.jsx
@@ -5,6 +5,7 @@
import * as Utils from '../../utils'
import Http from '@/utils/http';
import BoolValueIcon from '@/components/BoolValueIcon';
+import ShuttleHandle from './handle';
const useStyles = createStyles(({ token, css }) => {
return {
@@ -29,7 +30,7 @@
})
const updateEnable = async (deviceNo, enable) => {
- const resp = await Http.doPost('api/dict/update', {val});
+ const resp = await Http.doPost('api/dict/update', { val });
if (resp.code === 200) {
message.success(intl.formatMessage({ id: 'page.update.success', defaultMessage: '鏇存柊鎴愬姛' }));
return true;
@@ -45,6 +46,7 @@
const { data } = props;
const [loading, setLoading] = React.useState(false);
+ const [childrenDrawer, setChildrenDrawer] = useState(false);
const [info, setInfo] = React.useState(null);
useEffect(() => {
@@ -57,11 +59,14 @@
setLoading(false);
}
fetchShuttleInfo(data.no);
- }, [data]);
- useEffect(() => {
- console.log(info);
- }, [info])
+ const timer = setInterval(() => {
+ fetchShuttleInfo(data.no);
+ }, 1000);
+ return () => {
+ clearInterval(timer);
+ }
+ }, [data]);
return (
<>
@@ -96,11 +101,11 @@
},
{
label: intl.formatMessage({ id: 'map.loc.no', defaultMessage: '搴撲綅鍙�' }),
- children: <Badge status="processing" text="Running" />,
+ children: info?.currentLocNo,
},
{
label: intl.formatMessage({ id: 'map.pallet.barcode', defaultMessage: '鎵樼洏鏉$爜' }),
- children: '80000010',
+ children: info?.zpallet,
},
{
label: intl.formatMessage({ id: 'map.origin.loc', defaultMessage: '璧峰搴撲綅' }),
@@ -110,7 +115,7 @@
label: intl.formatMessage({ id: 'map.dest.loc', defaultMessage: '鐩爣搴撲綅' }),
children: info?.destLocNo,
},
-
+
{
label: intl.formatMessage({ id: 'map.shuttle.batter.power', defaultMessage: '鐢垫睜鐢甸噺' }),
children: info?.batteryPower,
@@ -158,7 +163,13 @@
<Button className={styles.tableButton} size='default' disabled>
<FormattedMessage id='map.enable' defaultMessage='鍚敤' />
</Button>
- <Button className={styles.tableButton} size='default'>
+ <Button
+ className={styles.tableButton}
+ size='default'
+ onClick={() => {
+ setChildrenDrawer(true);
+ }}
+ >
<FormattedMessage id='map.handle' defaultMessage='鎵嬪姩鎿嶄綔' />
</Button>
</>
@@ -167,6 +178,14 @@
]
}
/>
+ <ShuttleHandle
+ open={childrenDrawer}
+ refCurr={props.refCurr}
+ shuttleNo={data.no}
+ onClose={() => {
+ setChildrenDrawer(false)
+ }}
+ />
</div>
)}
</div>
--
Gitblit v1.9.1