#
Junjie
2024-07-13 5fd478fcee23bbdac0fe4fbe9becdd2a28d14c56
zy-asrs-flow/src/pages/device/lift/index.jsx
@@ -13,8 +13,11 @@
    const [ws, setWs] = useState(null);
    const [openOpera, setOpenOpera] = useState(false);
    const [currentData, setCurrentData] = useState(null);
    const [moveLocType, setMoveLocType] = useState(1);
    const [mapLev, setMapLev] = useState([]);
    const [targetLoc, setTargetLoc] = useState(1);
    const [originLoc, setOriginLoc] = useState(null);
    const [originSite, setOriginSite] = useState(null);
    const [targetSite, setTargetSite] = useState(null);
    useEffect(() => {
        connect();
@@ -91,7 +94,6 @@
    const showOpera = (data) => {
        setOpenOpera(true);
        console.log(data);
        setCurrentData(data);
    };
@@ -123,8 +125,20 @@
        }
    }
    const targetLocChange = (e) => {
        setTargetLoc(e.target.value)
    const targetLocChange = (value) => {
        setTargetLoc(value)
    }
    const originLocChange = (e) => {
        setOriginLoc(e.target.value)
    }
    const targetSiteChange = (e) => {
        setTargetSite(e.target.value)
    }
    const originSiteChange = (e) => {
        setOriginSite(e.target.value)
    }
    const liftOperator = async (type) => {
@@ -132,8 +146,10 @@
            const resp = await Http.doPost('api/basLift/operator/lift', {
                liftNo: currentData.liftNo,
                liftTaskMode: type,
                sourceStaNo: 0,
                staNo: moveLocType
                sourceStaNo: originSite,
                staNo: targetSite,
                sourceLev: originLoc,
                targetLev: targetLoc,
            });
            if (resp.code === 200) {
                message.success("请求成功");
@@ -146,10 +162,6 @@
            message.warning("请求失败");
            return false;
        }
    }
    const moveLocTypeChange = (e) => {
        setMoveLocType(e)
    }
    let codeContent = (<PageContainer
@@ -247,12 +259,23 @@
                            <p>
                                <Select
                                    defaultValue="1"
                                    onChange={moveLocTypeChange}
                                    onChange={targetLocChange}
                                    style={{ width: 120 }}
                                    options={mapLev}
                                />
                                <span><Button onClick={() => liftOperator('move')}>移动</Button></span>
                                <span><Button onClick={() => liftOperator('move')}>升降</Button></span>
                            </p>
                            <p>
                                <Input addonBefore="起始位置" onChange={originSiteChange} />
                            </p>
                            <p>
                                <Input addonBefore="目标位置" onChange={targetSiteChange} />
                            </p>
                            <p>
                            </p>
                            <div className="commandItem">
                                <Button onClick={() => liftOperator('movePallet')}>托盘出入</Button>
                            </div>
                        </Card>
                    </div>
@@ -261,6 +284,12 @@
                            <div className="commandItem">
                                <Button onClick={() => liftOperator('reset')}>复位</Button>
                            </div>
                            <div className="commandItem">
                                <Button onClick={() => liftOperator('lock')}>锁定</Button>
                            </div>
                            <div className="commandItem">
                                <Button onClick={() => liftOperator('unlock')}>解锁</Button>
                            </div>
                        </Card>
                    </div>
                </Drawer>