zhou zhou
昨天 f21da8f3373d19045b05fe51a6eab3695dbe30f5
rsf-admin/src/page/taskPathTemplate/TaskTemplateFlowViewer.jsx
@@ -12,15 +12,21 @@
import StickyDataTable from "@/page/components/StickyDataTable";
const ViewTable = ({ title, resource, filter, onClick, selectedId, columns }) => {
    // 只有在有 filter 时才调用 useListController,避免不必要的请求
    const shouldLoadData = !!filter;
    const listContext = useListController({
        resource: resource,
        filter: filter,
        filter: filter || {},
        perPage: 100,
        sort: { field: 'id', order: 'ASC' },
        disableSyncWithLocation: true,
        queryOptions: {
            enabled: shouldLoadData, // 只有在 shouldLoadData 为 true 时才执行查询
        },
    });
    if (!filter) {
    if (!shouldLoadData) {
        return (
            <Card sx={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
                <Box p={1} borderBottom={1} borderColor="divider">
@@ -69,15 +75,7 @@
                        }}
                    // Manually handle selection style if needed, or rely on StickyDataTable support
                    >
                        {columns.map((col, index) => (
                            <DataTable.Col
                                key={col.props.source}
                                source={col.props.source}
                                label={col.props.label}
                            >
                                {col}
                            </DataTable.Col>
                        ))}
                        {columns.map((col, index) => col)}
                    </StickyDataTable>
                </Box>
                <Pagination rowsPerPageOptions={[10, 25, 50, 100]} />
@@ -147,7 +145,7 @@
                    <ViewTable
                        title={translate('menu.subsystemFlowTemplate')}
                        resource="subsystemFlowTemplate"
                        filter={selectedNode ? { systemCode: selectedNode.systemCode } : null}
                        filter={selectedNode ? { flowCode: selectedNode.nodeCode } : null}
                        onClick={handleFlowClick}
                        selectedId={selectedFlow?.id}
                        columns={flowColumns}