#
Junjie
2024-10-12 39a729e911ca4e5fb1c629fabf71cc3cf02dade8
zy-asrs-flow/src/pages/task/task/index.jsx
@@ -11,6 +11,7 @@
import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
import Http from '@/utils/http';
import Edit from './components/edit'
import ShuttleCommand from './components/shuttleCommand'
import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
import { statusMap } from '@/utils/enum-util'
import { repairBug } from '@/utils/common-util';
@@ -131,13 +132,13 @@
    }
};
const Main = () => {
    const intl = useIntl();
    const formTableRef = useRef();
    const actionRef = useRef();
    const [selectedRows, setSelectedRows] = useState([]);
    const [modalVisible, setModalVisible] = useState(false);
    const [shuttleCommandModalVisible, setShuttleCommandModalVisible] = useState(false);
    const [currentRow, setCurrentRow] = useState();
    const [searchParam, setSearchParam] = useState({});
@@ -525,7 +526,7 @@
        {
            title: '操作',
            dataIndex: 'option',
            width: 240,
            width: 300,
            valueType: 'option',
            render: (_, record) => [
                <Button
@@ -537,6 +538,16 @@
                    }}
                >
                    <FormattedMessage id='page.edit' defaultMessage='编辑' />
                </Button>,
                <Button
                    type="link"
                    key="shuttleCommand"
                    onClick={() => {
                        setShuttleCommandModalVisible(true);
                        setCurrentRow(record);
                    }}
                >
                    <FormattedMessage id='page.shuttleCommand' defaultMessage='穿梭车指令' />
                </Button>,
                // <Button
                //     type="link"
@@ -743,6 +754,33 @@
                    }
                }}
            />
            <ShuttleCommand
                open={shuttleCommandModalVisible}
                values={currentRow || {}}
                onCancel={
                    () => {
                        setShuttleCommandModalVisible(false);
                        setCurrentRow(undefined);
                    }
                }
                onSubmit={async (values) => {
                    let ok = false;
                    if (values.id) {
                        ok = await handleUpdate({ ...values }, intl)
                    } else {
                        ok = await handleSave({ ...values }, intl)
                    }
                    if (ok) {
                        setShuttleCommandModalVisible(false);
                        setCurrentRow(undefined);
                        if (actionRef.current) {
                            actionRef.current.reload();
                        }
                    }
                }}
            />
        </PageContainer>
    );
};