#
luxiaotao1123
2024-04-12 5259c8d163b1d20659364e9b240f77c975a7067b
zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx
@@ -7,6 +7,7 @@
import * as Utils from '../../utils'
import Http from '@/utils/http';
import ShelfThree from './shelfThree'
import BoolValueIcon from '@/components/BoolValueIcon';
const useStyles = createStyles(({ token, css }) => {
    return {
@@ -56,8 +57,8 @@
    }
}
const fetchShelfInfo = async (locNo) => {
    const res = await Http.doGet('/api/map/shelf/info', { locNo: locNo });
const fetchShelfGroup = async (locNo) => {
    const res = await Http.doGet('/api/map/shelf/group', { locNo: locNo });
    if (res?.data && shelfThree) {
        shelfThree.generateMesh((loader, addObject) => {
            const promises = [];
@@ -122,6 +123,7 @@
    const { data, curFloor, curLocNo, setCurLocNo } = props;
    const [loading, setLoading] = React.useState(false);
    const [info, setInfo] = React.useState(null);
    useEffect(() => {
        // init curLocNo
@@ -136,12 +138,25 @@
            shelfThree.handleClick = (objName) => {
                setCurLocNo(objName);
            };
            fetchShelfInfo(originLocNo);
            fetchShelfGroup(originLocNo);
            setLoading(false);
        }, 300)
        return endThree;
    }, [data]);
    useEffect(() => {
        if (!curLocNo) {
            return;
        }
        const fetchShelfInfo = async (locNo) => {
            const res = await Http.doGet('/api/map/shelf/info', { locNo: locNo });
            if (res?.data) {
                setInfo(res.data);
            }
        }
        fetchShelfInfo(curLocNo);
    }, [curLocNo])
    return (
        <>
@@ -164,22 +179,22 @@
                        items={
                            [
                                {
                                    key: '1',
                                    label: intl.formatMessage({ id: 'map.loc.no', defaultMessage: '库位号' }),
                                    children: curLocNo,
                                },
                                {
                                    key: '2',
                                    label: intl.formatMessage({ id: 'map.loc.sts', defaultMessage: '库位状态' }),
                                    children: info?.locSts,
                                },
                                {
                                    label: intl.formatMessage({ id: 'map.pallet.barcode', defaultMessage: '托盘条码' }),
                                    children: '80000010',
                                    children: info?.zpallet,
                                },
                                {
                                    key: '3',
                                    label: intl.formatMessage({ id: 'map.is.enable', defaultMessage: '是否启用' }),
                                    children: 'Disabled',
                                    children: <BoolValueIcon value={info?.enable} />,
                                },
                                {
                                    key: '4',
                                    label: intl.formatMessage({ id: 'map.loc.operation', defaultMessage: '库位操作' }),
                                    children: (
                                        <>