#
luxiaotao1123
2024-03-29 2dcddd30632d46f85b09171c6e989cbe94e271fa
#
3个文件已修改
23 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/utils.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/drawer/shelf/shelfThree.js
@@ -66,7 +66,7 @@
    initCamera = () => {
        const camera = new THREE.PerspectiveCamera(70, this.getFullWidth() / this.getFullHeight(), 1, 60000);
        camera.position.set(-300, 300, 300);
        camera.position.set(-300, 800, 300);
        this.scene.add(camera);
        return camera;
    }
@@ -213,7 +213,7 @@
    scene.add(ambientLight);
    const spotLight = new THREE.SpotLight(0xffffff, 8);
    spotLight.position.set(-300, 300, 0);
    spotLight.position.set(-300, 1000, 0);
    spotLight.angle = Math.PI / 4;  // 角度
    spotLight.distance = 800;  // 距离
    spotLight.decay = 0;    // 光衰
zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx
@@ -75,19 +75,20 @@
            if (res?.data && shelfThree) {
                shelfThree.generateMesh((scene) => {
                    for (const item of res.data) {
                        console.log(item);
                        const { row, bay, lev } = Utils.parseLocNo(item.locNo);
                        console.log(row, bay, lev);
                        // shelf
                        const shelfMesh = new THREE.Mesh(new THREE.BoxGeometry(100, 40, 100), new THREE.MeshStandardMaterial({
                            color: '#222f3e',
                        }));
                        shelfMesh.position.set(0, 20, 0);
                        shelfMesh.position.set(0, 20 + 100 * (lev - 1), 0);
                        scene.add(shelfMesh)
                        // pallet
                        const palletMesh = new THREE.Mesh(new THREE.BoxGeometry(100, 60, 100), new THREE.MeshStandardMaterial({
                            color: '#b33939',
                        }));
                        palletMesh.position.set(0, 70, 0);
                        palletMesh.position.set(0, 70 + 100 * (lev - 1), 0);
                        scene.add(palletMesh)
                    }
                });
zy-asrs-flow/src/pages/map/utils.js
@@ -566,4 +566,16 @@
    } else {
        return false;
    }
}
export const parseLocNo = (locNo) => {
    if (!locNo || typeof locNo !== 'string') {
        return null;
    }
    const locParseArr = locNo.split('-');
    return {
        row: locParseArr?.[0],
        bay: locParseArr?.[1],
        lev: locParseArr?.[2],
    }
}