#
luxiaotao1123
2024-03-13 d0fb2d77c9070d7a55551f13d9cbd83d61a819e0
zy-asrs-flow/src/pages/map/components/mapCopySettings.jsx
@@ -14,8 +14,10 @@
    const { styles } = useStyles();
    const { curSprite } = props;
    const [form] = Form.useForm();
    const [autoIncrement, setAutoIncrement] = useState(false);
    useEffect(() => {
        setAutoIncrement(false);
        form.resetFields();
        if (curSprite && props) {
            form.setFieldsValue({
@@ -33,12 +35,12 @@
    }
    const handleFinish = (values) => {
        console.log(values); return
        props.submit({ ...values, ...props.values })
    }
    const formValuesChange = (value) => {
        console.log(value);
        props.submit({
            ...values
            , ...props.values
            , autoIncrement: autoIncrement
            , type: curSprite?.data?.type
        })
    }
    return (
@@ -64,7 +66,6 @@
            >
                <Form
                    form={form}
                    onFieldsChange={formValuesChange}
                    initialValues={{
                        copyGap: 0,
                        autoIncrement: false,
@@ -117,17 +118,17 @@
                            </Form.Item>
                        </Col>
                        {/* switch auto increment  */}
                        <Col span={24}>
                            <Form.Item
                                name='autoIncrement'
                                label={intl.formatMessage({ id: 'map.settings.sub.copy.shelf.auto-increment', defaultMessage: '自增长' })}
                                labelCol={{ span: 8 }}
                            >
                                <Switch />
                                <Switch value={autoIncrement} onChange={setAutoIncrement} />
                            </Form.Item>
                        </Col>
                        {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
                        {autoIncrement && curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
                            <>
                                <Col span={24}>
                                    <Form.Item
@@ -146,7 +147,7 @@
                            </>
                        )}
                        {form.getFieldValue('autoIncrement') === true && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
                        {autoIncrement && curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
                            <>
                                <Col span={24}>
                                    <Form.Item
@@ -182,11 +183,11 @@
                                            options={[
                                                {
                                                    label: intl.formatMessage({ id: 'map.settings.sub.copy.ascend', defaultMessage: '升序' }),
                                                    value: 'Ascending'
                                                    value: 'ascending'
                                                },
                                                {
                                                    label: intl.formatMessage({ id: 'map.settings.sub.copy.descend', defaultMessage: '降序' }),
                                                    value: 'Descending'
                                                    value: 'descending'
                                                },
                                            ]}
                                            onChange={(value) => {