| | |
| | | AGV: "AGV", |
| | | }) |
| | | |
| | | export const SHELF_TYPE = Object.freeze({ |
| | | STORE: 0, |
| | | TRACK: 3, |
| | | DISABLE: 1, |
| | | }) |
| | | |
| | | export const getRealPosition = (x, y, mapContainer) => { |
| | | const rect = app.view.getBoundingClientRect(); |
| | | return { |
| | |
| | | copiedSprite.rotation = sprite.rotation; |
| | | copiedSprite.data = deepCopy(sprite.data); |
| | | copiedSprite.data.uuid = generateID(); |
| | | showSheflType(copiedSprite); |
| | | return copiedSprite; |
| | | } |
| | | |
| | |
| | | // dynamical data |
| | | Object.assign(sprite.data, item.property); |
| | | |
| | | showSheflType(sprite); |
| | | // graph |
| | | sprite.position.set(item.positionX, item.positionY); |
| | | sprite.scale.set(item.scaleX, item.scaleY); |
| | | sprite.rotation = rotationParseNum(item.rotation); |
| | | |
| | | // sprite.tint = '#000'; |
| | | mapContainer.addChild(sprite); |
| | | } |
| | | }) |
| | |
| | | onClick: () => { } |
| | | }); |
| | | } |
| | | |
| | | export const showSheflType = (sprite) => { |
| | | let showColor; |
| | | switch (sprite.data.shelfType) { |
| | | case SHELF_TYPE.STORE: |
| | | break; |
| | | case SHELF_TYPE.TRACK: |
| | | showColor = '#faf6e9'; |
| | | break; |
| | | case SHELF_TYPE.DISABLE: |
| | | showColor = '#ffc8c8'; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | if (showColor) { |
| | | sprite.tint = showColor; |
| | | } |
| | | return showColor; |
| | | } |