#
Junjie
2024-04-09 1739d0c61e3a781a38cab29543575b15c4cd48b2
#
1个文件已修改
64 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/device/shuttle/index.jsx 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/device/shuttle/index.jsx
@@ -13,6 +13,11 @@
    const [openOpera, setOpenOpera] = useState(false);
    const [currentData, setCurrentData] = useState(null);
    const [targetLoc, setTargetLoc] = useState("");
    const [xStart, setXStart] = useState(1);
    const [xTarget, setXTarget] = useState(1);
    const [yStart, setYStart] = useState(1);
    const [yTarget, setYTarget] = useState(1);
    const [moveLocType, setMoveLocType] = useState(1);
    useEffect(() => {
        var newWs = new WebSocket("ws://127.0.0.1:9090/wcs/ws/shuttle/websocket");
@@ -112,6 +117,54 @@
            message.warning("请求失败");
            return false;
        }
    }
    const shuttleMoveLoc = async () => {
        if (xStart == '' || xTarget == '' || yStart == '' || yTarget == '') {
            message.warning('请输入参数');
            return;
        }
        try {
            const resp = await Http.doPost('api/basShuttle/moveLoc', {
                shuttleNo: currentData.shuttleNo,
                moveType: moveLocType,
                startX: xStart,
                targetX: xTarget,
                startY: yStart,
                targetY: yTarget,
            });
            if (resp.code === 200) {
                message.success("请求成功");
                return true;
            } else {
                message.warning(resp.msg);
                return false;
            }
        } catch (error) {
            message.warning("请求失败");
            return false;
        }
    }
    const xStartChange = (e) => {
        setXStart(e.target.value)
    }
    const xTargetChange = (e) => {
        setXTarget(e.target.value)
    }
    const yStartChange = (e) => {
        setYStart(e.target.value)
    }
    const yTargetChange = (e) => {
        setYTarget(e.target.value)
    }
    const moveLocTypeChange = (e) => {
        setMoveLocType(e)
    }
    let codeContent = (<PageContainer
@@ -230,18 +283,19 @@
                    <div style={{ marginBottom: '15px' }}>
                        <Card title="跑库系统" style={{ width: 300 }}>
                            <div className="commandItem">
                                <div><Input addonBefore="X起点" defaultValue="1" /></div>
                                <div><Input addonBefore="X终点" defaultValue="1" /></div>
                                <div><Input addonBefore="Y起点" defaultValue="1" /></div>
                                <div><Input addonBefore="Y终点" defaultValue="1" /></div>
                                <div><Input addonBefore="X起点" defaultValue="1" onChange={xStartChange} /></div>
                                <div><Input addonBefore="X终点" defaultValue="1" onChange={xTargetChange} /></div>
                                <div><Input addonBefore="Y起点" defaultValue="1" onChange={yStartChange} /></div>
                                <div><Input addonBefore="Y终点" defaultValue="1" onChange={yTargetChange} /></div>
                                <div>
                                    <Select
                                        defaultValue="0"
                                        onChange={moveLocTypeChange}
                                        style={{ width: 120 }}
                                        options={[{ value: '0', label: '跑轨道' }, { value: '1', label: '跑库位' }, { value: '2', label: '母轨道循环跑' }, { value: '3', label: '子轨道循环跑' }]}
                                    />
                                </div>
                                <Button>跑库</Button>
                                <Button onClick={() => shuttleMoveLoc()}>跑库</Button>
                            </div>
                        </Card>
                    </div>