system-copyright-react/src/route/CopyrightGgoods/CopyrightGgoods.tsx

200 lines
6.0 KiB
TypeScript
Raw Normal View History

2024-05-31 09:19:30 +08:00
import './copyrightG-goods.css'
2024-06-04 16:02:06 +08:00
import {
Select, DatePicker, Button, Table,
2024-05-31 09:19:30 +08:00
// message,
2024-06-04 16:02:06 +08:00
Space, Input, Empty
} from 'antd';
2024-05-31 09:19:30 +08:00
// import type { TableColumnsType } from 'antd';
2024-06-04 16:02:06 +08:00
import { SearchOutlined,ClearOutlined } from '@ant-design/icons';
2024-05-31 09:19:30 +08:00
import type { DatePickerProps } from 'antd';
import locale from 'antd/es/date-picker/locale/zh_CN';
const { Column } = Table;
2024-05-21 11:21:34 +08:00
export default function CopyrightGgoods() {
2024-05-31 09:19:30 +08:00
// const [messageApi, contextHolder] = message.useMessage();
const dateFormat = 'YYYY年MM月DD日';
const belongTypeChange = (value: string) => {
console.log(`selected ${value}`);
}
const onChange: DatePickerProps['onChange'] = (date, dateString) => {
console.log(date, dateString);
};
const height = window.innerHeight - 180;
interface DataType {
name: string
short: string
number: string
price: string
version: string
time: string
language: string
}
const data: DataType[] = [
{
name: '智能管理系统',
short: '简称',
2024-06-07 09:59:01 +08:00
number: '31234567891234561789',
2024-05-31 09:19:30 +08:00
price: '5.00',
version: '1-1-1',
time: '2020-04-19 1542:21',
language: 'java'
},
{
name: '商城管理系统',
short: '简称',
2024-06-07 09:59:01 +08:00
number: '1123456789123456789',
2024-05-31 09:19:30 +08:00
price: '5.00',
version: '1-1-1',
time: '2020-04-19 1542:21',
language: 'java'
},
{
name: 'xx系统',
short: '简称',
2024-06-07 09:59:01 +08:00
number: '2123456789123456789',
2024-05-31 09:19:30 +08:00
price: '5.00',
version: '1-1-1',
time: '2020-04-19 1542:21',
language: 'java'
},
];
2024-05-21 11:21:34 +08:00
return (
2024-05-31 09:19:30 +08:00
<div className='copyrightG-goods' style={{ height: `${height}px`, overflow: 'auto' }}>
{/* {contextHolder} */}
<div className='copyrightG-goods-search'>
<Input placeholder="最低价格" type="number" min={0}
style={{ width: 198, height: 36, marginRight: 12 }} />
<Input placeholder="最高价格" type="number" min={0} style={{ width: 198, height: 36, marginRight: 12, marginLeft: 12 }} />
<DatePicker placeholder="软著获取时间"
style={{ width: 198, height: 36, marginRight: 12 }}
format={dateFormat}
locale={locale}
onChange={onChange}
/>
<Select
// defaultValue="lucy"
placeholder='价格排序'
style={{ width: 198, height: 36, marginRight: 12 }}
onChange={belongTypeChange}
options={[
{ value: 'person', label: '升序' },
{ value: 'lucy', label: '降序' },
]}
/>
<Select
// defaultValue="lucy"
placeholder='选择开发语言'
style={{ width: 198, height: 36, marginRight: 12 }}
onChange={belongTypeChange}
options={[
{ value: 'person', label: 'java' },
{ value: 'lucy', label: 'php' },
]}
/>
<Select
// defaultValue="lucy"
placeholder='选择软著类型'
style={{ width: 198, height: 36, marginRight: 12 }}
onChange={belongTypeChange}
options={[
{ value: 'person', label: '111' },
{ value: 'lucy', label: '222' },
]}
/>
<Button type="primary"
2024-06-04 16:02:06 +08:00
style={{
height: 36,
// backgroundColor: '#FF9F08'
}}
2024-05-31 09:19:30 +08:00
icon={<SearchOutlined />}>
</Button>
2024-06-04 16:02:06 +08:00
<Button
style={{
height: 36,
marginLeft: 10,
// backgroundColor: '#FF9F08'
}}
icon={<ClearOutlined />}>
</Button>
2024-05-31 09:19:30 +08:00
</div>
<div className='copyrightG-goods-table'>
{/* 表格 */}
{data.length == 0 ? (
<div className='nodata' style={{ height: `${height - 93}px` }}>
<Empty
description={
'暂无数据'
} />
2024-06-07 09:59:01 +08:00
</div>) : (
<Table
2024-05-31 09:19:30 +08:00
rowSelection={{
type: 'checkbox',
// selectedRowKeys: belongselectedKeys // 设置默认选中的行
}}
dataSource={data}
// pagination={{
// defaultPageSize: 10, // 设置默认一页显示 5 条数据
// }}
pagination={false} // 不显示分页
style={{ textAlign: 'center' }} // 设置表格内容居中显示
2024-06-07 09:59:01 +08:00
rowKey="number" // 指定数据项的唯一标识符
2024-05-31 09:19:30 +08:00
>
<Column title="序号" render={(_text, _record, index: number) => (
index + 1
)} align="center" />
<Column
title="软著名称"
dataIndex="name"
align="center"
render={(text) => (
<span style={{ color: '#1B8BD2', fontSize: '16px', fontWeight: '700' }}>{text}</span>
)}
/>
<Column
title="软著简称"
dataIndex="short"
align="center"
/>
<Column
title="软著证号"
dataIndex="number"
align="center"
/>
<Column title="售价" dataIndex="price" align="center"
render={(text) => (
<span style={{ color: '#FF5D15', fontSize: '24px', fontWeight: '700' }}>{text}</span>
)} />
<Column title="软著版本" dataIndex="version" align="center" />
<Column title="软著取得时间" dataIndex="time" align="center" />
<Column title="软著开发语言" dataIndex="language" align="center" />
{/* <Column title="实名认证状态" dataIndex="address" key="key" /> */}
<Column
align="center"
title="软著电子版"
render={(_text, record: any) => (
<Space size="middle">
<span className='copyrightG-goods-table-btn' onClick={() => {
2024-06-07 09:59:01 +08:00
console.log(record.number);
2024-05-31 09:19:30 +08:00
}}></span>
</Space>
)}
/>
</Table>)}
</div>
2024-05-21 11:21:34 +08:00
</div>
)
}