103 lines
2.3 KiB
TypeScript
103 lines
2.3 KiB
TypeScript
import {
|
|
EditOutlined, DeleteOutlined
|
|
} from '@ant-design/icons';
|
|
import {Tooltip, Input, Button, Card, Space, Table, Modal, Select, Divider, Popconfirm,Breadcrumb, Row} from 'antd';
|
|
import { ColumnsType } from 'antd/lib/table';
|
|
import React, {useCallback, useEffect, useMemo, useState} from 'react';
|
|
import { CrudContext } from '../../../../components/crud/useCrud';
|
|
import { SearchOption } from "../../../../service/def";
|
|
// import ToolBar from './ToolBar';
|
|
import moment from "moment";
|
|
// import Dialog from './Dialog'
|
|
import { Pagination } from 'antd';
|
|
|
|
let MyImg= require ('../../../../assets/icons/搜索.png')
|
|
|
|
|
|
const { Option } = Select;
|
|
const handleChange = (value: string) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
type IProps = {
|
|
pagerCtx: any;
|
|
crudCtx: CrudContext;
|
|
}
|
|
|
|
|
|
|
|
|
|
const DataTable: React.FC<IProps> = ({ pagerCtx, crudCtx }) => {
|
|
|
|
const columns1: ColumnsType<any> = [
|
|
{
|
|
title: '',
|
|
width: 140,
|
|
dataIndex: 'adnm',
|
|
key: 'name',
|
|
fixed: 'left',
|
|
// className:'tablecolor',
|
|
},
|
|
{
|
|
title: '',
|
|
width: 150,
|
|
dataIndex: 'adcd',
|
|
key: 'age',
|
|
|
|
},
|
|
{
|
|
title: '',
|
|
dataIndex: 'landArea',
|
|
key: '1',
|
|
width: 150,
|
|
},
|
|
{
|
|
title: '',
|
|
dataIndex: 'prevtpnm',
|
|
key: '2',
|
|
width: 150,
|
|
},
|
|
|
|
];
|
|
|
|
const width1 = useMemo(() => columns1.reduce((total: number, cur) => total + (cur.width as number), 0), [columns1]);
|
|
|
|
|
|
|
|
|
|
// 初始接收默认查询参数
|
|
const options1 = {
|
|
search: {
|
|
deptNames: null,
|
|
stm: moment().subtract(0, 'day').format("YYYY-MM-DD"),
|
|
etm: moment().format("YYYY-MM-DD"),
|
|
}};
|
|
|
|
const doSearch = (params:any) => {
|
|
const searchParams: SearchOption = {
|
|
search: {
|
|
...params
|
|
}
|
|
};
|
|
pagerCtx.search(searchParams);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<div className='gap-tabel1'>
|
|
|
|
|
|
{/*<div className="card-h-margin" />*/}
|
|
<Card className='nonebox2'>
|
|
<Table rowKey="id" columns={columns1} {...pagerCtx.tableProps} scroll={{ x: 20, y: 300 }} pagination={false}/>
|
|
</Card>
|
|
|
|
|
|
</div>
|
|
|
|
</>
|
|
)
|
|
};
|
|
|
|
export default DataTable
|
|
|