#
luxiaotao1123
2024-02-26 25d899c51835dbae2fa336b8b7d7a863a078b210
zy-asrs-framework/src/main/resources/templates/react/Index.txt
@@ -11,6 +11,10 @@
import Http from '@/utils/http';
import Edit from './components/edit'
import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
import { statusMap } from '@/utils/enum-util'
import { repairBug } from '@/utils/common-util';
const TABLE_KEY = 'pro-table-@{SIMPLEENTITYNAME}';
const handleSave = async (val) => {
    const hide = message.loading('正在添加');
@@ -106,66 +110,7 @@
            valueType: 'indexBorder',
            width: 48,
        },
        {
            title: '姓名',
            dataIndex: 'name',
            valueType: 'text',
            copyable: true,
            filterDropdown: (props) => <TextFilter
                name='name'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '标识',
            dataIndex: 'code',
            valueType: 'text',
            filterDropdown: (props) => <TextFilter
                name='code'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '机构',
            dataIndex: 'hostId$',
            valueType: 'text',
            filterDropdown: (props) => <LinkFilter
                name='hostId'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '状态',
            dataIndex: 'status$',
            valueType: 'text',
            filterDropdown: (props) => <SelectFilter
                name='status'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
                data={[
                    { label: '正常', value: 1 },
                    { label: '禁用', value: 0 },
                ]}
            />,
        },
        {
            title: '修改时间',
            dataIndex: 'updateTime$',
            valueType: 'text',
            filterDropdown: (props) => <DatetimeRangeFilter
                name='updateTime'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
@{TABLECOLUMNS}
        {
            title: '操作',
            dataIndex: 'option',
@@ -208,7 +153,11 @@
    ];
    return (
        <PageContainer>
        <PageContainer
            header={{
                breadcrumb: {},
            }}
        >
            <div style={{ width: '100%', float: 'right' }}>
                <ProTable
                    key="@{SIMPLEENTITYNAME}"
@@ -217,6 +166,7 @@
                    formRef={formTableRef}
                    columns={columns}
                    cardBordered
                    scroll={{ x: 1300 }}
                    dateFormatter="string"
                    pagination={{ pageSize: 20 }}
                    search={false}
@@ -274,9 +224,10 @@
                        }
                    }}
                    columnsState={{
                        persistenceKey: 'pro-table-@{SIMPLEENTITYNAME}',
                        persistenceKey: TABLE_KEY,
                        persistenceType: 'localStorage',
                        defaultValue: {
                            memo: { show: repairBug(TABLE_KEY, 'memo', false) },
                            option: { fixed: 'right', disable: true },
                        },
                        onChange(value) {
@@ -340,8 +291,7 @@
                            actionRef.current.reload();
                        }
                    }
                }
                }
                }}
            />
        </PageContainer>
    );