#
luxiaotao1123
2024-10-16 9b254255cf7aaded5e236615ea5be48deb64b8ce
#
1个文件已修改
36 ■■■■■ 已修改文件
zy-acs-flow/src/map/insight/shelf/ShelfMain.jsx 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/insight/shelf/ShelfMain.jsx
@@ -40,30 +40,23 @@
                        mesh.position.set(0, singleHeight * (lev - 1), 0);
                        mesh.scale.set(5, 5, 5);
                        mesh.name = item.locNo;
                        mesh.traverse(function (child) {
                        mesh.traverse((child) => {
                            if (child.isMesh) {
                                if (child.name === '货架') {
                                switch (child.name) {
                                    case '货架':
                                    child.material.color.set(0x4680BF);
                                }
                                let palletVisible = true, cargoVisible = true;
                                switch (item.locStsEl) {
                                    case 'STOCK':
                                        cargoVisible = false;
                                        break;
                                    case 'IDLE':
                                        palletVisible = false;
                                        cargoVisible = false;
                                    case '托盘':
                                        child.visible = item.locStsEl === 'STOCK' || item.locStsEl === 'PAKOUT';
                                        child.material.color.set(0xBEBEBE);
                                        break;
                                    case '不规则':
                                        child.visible = item.locStsEl === 'STOCK' || item.locStsEl === 'PAKOUT';
                                        // child.visible = !['STOCK', 'IDLE'].includes(item.locStsEl);
                                        child.material.color.set(0xE8B67E);
                                        break;
                                    default:
                                        break;
                                }
                                if (child.name === '托盘') {
                                    child.visible = palletVisible;
                                    child.material.color.set(0xBEBEBE);
                                }
                                if (child.name === '不规则') {
                                    child.visible = cargoVisible;
                                    child.material.color.set(0xE8B67E);
                                }
                                child.name = item.locNo
                                child.castShadow = true;
@@ -83,7 +76,6 @@
            }).catch(error => {
                console.error(error);
            });
        })
    }
}
@@ -105,12 +97,9 @@
    }, [data]);
    useEffect(() => {
        console.log(curLocNo);
        if (info) {
            endThree();
            setLoading(true);
            setTimeout(() => {
                startThree(containerRef.current);
                shelfThree.handleClick = (objName) => {
@@ -118,11 +107,10 @@
                };
                renderThree(info, curLocNo);
                setLoading(false);
            }, 300)
            }, 200)
        }
        return endThree;
    }, [info]);
    return (
        <Box display="flex" height="500px">