#
luxiaotao1123
2024-02-23 16dc3116794c57231768552f999040df4ca3c0f8
zy-asrs-flow/src/pages/system/dept/index.jsx
@@ -12,17 +12,7 @@
import Edit from './components/edit'
import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
import { transformTreeData } from '@/utils/tree-util'
const statusMap = {
    1: {
        color: 'green',
        text: '正常',
    },
    0: {
        color: 'red',
        text: '禁用',
    },
};
import { statusMap } from '@/utils/enum-util'
const handleSave = async (val) => {
    const hide = message.loading('正在添加');
@@ -115,27 +105,20 @@
    const columns = [
        {
            title: 'No',
            dataIndex: 'index',
            valueType: 'indexBorder',
            width: 48,
        },
        {
            title: '部门名称',
            dataIndex: 'name',
            valueType: 'text',
            hidden: false,
            width: 140,
            copyable: true,
            filterDropdown: (props) => <TextFilter
                name='name'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
            width: 240,
            // filterDropdown: (props) => <TextFilter
            //     name='name'
            //     {...props}
            //     actionRef={actionRef}
            //     setSearchParam={setSearchParam}
            // />,
        },
        {
            title: '上级部门名',
            title: '上级部门',
            dataIndex: 'parentName',
            valueType: 'text',
            hidden: true,
@@ -205,12 +188,12 @@
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='leader'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
            // filterDropdown: (props) => <TextFilter
            //     name='leader'
            //     {...props}
            //     actionRef={actionRef}
            //     setSearchParam={setSearchParam}
            // />,
        },
        {
            title: '数量',
@@ -231,12 +214,12 @@
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='sort'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
            // filterDropdown: (props) => <TextFilter
            //     name='sort'
            //     {...props}
            //     actionRef={actionRef}
            //     setSearchParam={setSearchParam}
            // />,
            render: (_, record) => {
                return <span style={{ fontWeight: "bold" }}>{_}</span>
            }
@@ -247,16 +230,16 @@
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <SelectFilter
                name='status'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
                data={[
                    { label: '正常', value: 1 },
                    { label: '禁用', value: 0 },
                ]}
            />,
            // filterDropdown: (props) => <SelectFilter
            //     name='status'
            //     {...props}
            //     actionRef={actionRef}
            //     setSearchParam={setSearchParam}
            //     data={[
            //         { label: '正常', value: 1 },
            //         { label: '禁用', value: 0 },
            //     ]}
            // />,
            render: (_, record) => {
                const status = statusMap[record.status]
                return <Tag color={status.color}>{status.text}</Tag>
@@ -268,12 +251,12 @@
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <DatetimeRangeFilter
                name='updateTime'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
            // filterDropdown: (props) => <DatetimeRangeFilter
            //     name='updateTime'
            //     {...props}
            //     actionRef={actionRef}
            //     setSearchParam={setSearchParam}
            // />,
        },
        {
            title: '修改人员',
@@ -281,13 +264,13 @@
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <LinkFilter
                name='updateBy'
                major='user'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
            // filterDropdown: (props) => <LinkFilter
            //     name='updateBy'
            //     major='user'
            //     {...props}
            //     actionRef={actionRef}
            //     setSearchParam={setSearchParam}
            // />,
        },
        {
            title: '备注',
@@ -345,7 +328,11 @@
    ];
    return (
        <PageContainer>
        <PageContainer
            header={{
                breadcrumb: {},
            }}
        >
            <div style={{ width: '100%', float: 'right' }}>
                <ProTable
                    key="dept"
@@ -356,7 +343,7 @@
                    cardBordered
                    scroll={{ x: 1300 }}
                    dateFormatter="string"
                    pagination={{ pageSize: 20 }}
                    pagination={{ pageSize: 100 }}
                    search={false}
                    toolbar={{
                        search: {