| | |
| | | import { useIntl, FormattedMessage } from '@umijs/max'; |
| | | import { Button, message, Modal } from 'antd'; |
| | | import { |
| | | FooterToolbar, PageContainer, ProTable, LightFilter, |
| | | ProFormDatePicker, |
| | | FooterToolbar, |
| | | PageContainer, |
| | | ProTable, |
| | | LightFilter, |
| | | } from '@ant-design/pro-components'; |
| | | import { PlusOutlined, ExportOutlined } from '@ant-design/icons'; |
| | | import Http from '@/utils/http'; |
| | | import Edit from './components/edit' |
| | | import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch' |
| | | |
| | | const handleSave = async (val) => { |
| | | const hide = message.loading('正在添加'); |
| | |
| | | } |
| | | }; |
| | | |
| | | |
| | | const Main = () => { |
| | | const formTableRef = useRef(); |
| | | const actionRef = useRef(); |
| | |
| | | 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} |
| | | />, |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | }, |
| | | }, |
| | | filter: ( |
| | | <LightFilter> |
| | | <ProFormDatePicker name="startdate" label="响应日期" /> |
| | | <LightFilter |
| | | onValuesChange={(val) => { |
| | | }} |
| | | > |
| | | </LightFilter> |
| | | ), |
| | | actions: [ |
| | |
| | | </Button>, |
| | | ], |
| | | }} |
| | | // toolBarRender={() => [ |
| | | // <Button |
| | | // type="primary" |
| | | // key="save" |
| | | // onClick={async () => { |
| | | // setModalVisible(true) |
| | | // }} |
| | | // > |
| | | // <PlusOutlined /> |
| | | // 添加 |
| | | // </Button>, |
| | | // <Button |
| | | // key="export" |
| | | // onClick={async () => { |
| | | // handleExport(); |
| | | // }} |
| | | // > |
| | | // <ExportOutlined /> |
| | | // 导出 |
| | | // </Button>, |
| | | // ]} |
| | | request={(params, sorter, filter) => |
| | | Http.doPostPromise('/api/role/page', { ...params, ...searchParam }, (res) => { |
| | | return { |