#
Junjie
2024-10-17 d835d1b51f832889929cdf69010034a30ef44d02
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>