| | |
| | | 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 { |
| | |
| | | } |
| | | } |
| | | |
| | | 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 = []; |
| | |
| | | |
| | | const { data, curFloor, curLocNo, setCurLocNo } = props; |
| | | const [loading, setLoading] = React.useState(false); |
| | | const [info, setInfo] = React.useState(null); |
| | | |
| | | useEffect(() => { |
| | | // init curLocNo |
| | |
| | | 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 ( |
| | | <> |
| | |
| | | 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: ( |
| | | <> |