#
luxiaotao1123
2024-04-07 d57cf3a04590c99d7a3208efc3ee12d8403e4d10
zy-asrs-flow/src/pages/map/drawer/shelf/view.jsx
@@ -61,11 +61,12 @@
    if (res?.data && shelfThree) {
        shelfThree.generateMesh((loader, addObject) => {
            const promises = [];
            const singleHeight = 123;
            for (const item of res.data) {
                const { lev } = Utils.parseLocNo(item.locNo);
                promises.push(new Promise((resolve) => {
                    loader.load('model/04.fbx', (mesh) => {
                        mesh.position.set(0, 123 * (lev - 1), 0);
                        mesh.position.set(0, singleHeight * (lev - 1), 0);
                        mesh.scale.set(5, 5, 5);
                        mesh.name = item.locNo;
                        mesh.traverse(function (child) {
@@ -95,6 +96,7 @@
            Promise.all(promises).then(() => {
                shelfThree.setNewSelectedMesh(locNo);
                shelfThree.rePerspective(singleHeight * res.data.length);
            }).catch(error => {
                console.error(error);
            });