#
Junjie
2024-05-18 a7d5e6c4a45ca1f7bb1560ef4e76f4c1680c41db
zy-asrs-flow/src/pages/device/shuttle/index.jsx
@@ -12,6 +12,7 @@
    const [ws, setWs] = useState(null);
    const [openOpera, setOpenOpera] = useState(false);
    const [currentData, setCurrentData] = useState(null);
    const [sourceLoc, setSourceLoc] = useState("");
    const [targetLoc, setTargetLoc] = useState("");
    const [xStart, setXStart] = useState(1);
    const [xTarget, setXTarget] = useState(1);
@@ -88,6 +89,10 @@
        setOpenOpera(false);
    };
    const sourceLocChange = (e) => {
        setSourceLoc(e.target.value)
    }
    const targetLocChange = (e) => {
        setTargetLoc(e.target.value)
    }
@@ -98,12 +103,23 @@
                message.warning('请输入目标位置');
                return;
            }
        }else if(type == 'takeMove') {
            if (targetLoc == '') {
                message.warning('请输入目标位置');
                return;
            }
            if (sourceLoc == '') {
                message.warning('请输入起始位置');
                return;
            }
        }
        try {
            const resp = await Http.doPost('api/basShuttle/operator/shuttle', {
                shuttleNo: currentData.shuttleNo,
                shuttleTaskMode: type,
                sourceLocNo: sourceLoc,
                targetLocNo: targetLoc
            });
            if (resp.code === 200) {
@@ -207,7 +223,7 @@
                    {
                        key: '6',
                        label: '错误码',
                        children: '0',
                        children: item.errorCode$,
                    },
                    {
                        key: '7',
@@ -265,11 +281,19 @@
                    <div style={{ marginBottom: '15px' }}>
                        <Card title="移动指令" style={{ width: 300 }}>
                            <p>
                                <Input addonBefore="起始位置" onChange={sourceLocChange} />
                            </p>
                            <p>
                                <Input addonBefore="目标位置" onChange={targetLocChange} />
                            </p>
                            <p>
                                <Button onClick={() => shuttleOperator('moveLoc')}>移动到目标位置</Button>
                            </p>
                            <p>
                            </p>
                            <div className="commandItem">
                                <Button onClick={() => shuttleOperator('moveLoc')}>移动到目标位置</Button>
                                <Button onClick={() => shuttleOperator('takeMove')}>取放货作业</Button>
                            </div>
                        </Card>
                    </div>