diff --git a/src/pages/rail/RailConfig.tsx b/src/pages/rail/RailConfig.tsx new file mode 100644 index 0000000..c7087a3 --- /dev/null +++ b/src/pages/rail/RailConfig.tsx @@ -0,0 +1,119 @@ +import "./rail.scss"; +import { Button, Modal, Pagination, Table, TableColumnsType } from 'antd' +import {useState} from 'react' +import Upload from './Upload' +export default function RailManage() { + type RailItem = { + id?: number; + name: string; + createName: string; + createTime: string, + updateTime: string + } + let [loading, setLoading] = useState() + + const [selectionType, setSelectionType] = useState<'checkbox'>('checkbox'); + const [selectRows, setSelectedRow] = useState([]) + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const rowSelection = { + selectedRowKeys, + onChange: (selectedRowKeys: React.Key[], selectedRows: RailItem[]) => { + console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); + setSelectedRow(selectedRows) + setSelectedRowKeys(selectedRowKeys) + }, + getCheckboxProps: (record:RailItem) => ({ + name: record.name, + }), + }; + + const [pageNum, setPageNum] = useState(1) + const [pageSize, setPageSize] = useState(5) + const onPageChange = (pageNumValue:number, pageSizeValue:number) => { + setPageNum(pageNumValue) + setPageSize(pageSizeValue) + let params = { + pageSize:pageSizeValue, + pageNum:pageNumValue, + } + } + + const onShowDetail = (recordData:RailItem) => { + + } + + let [total, setTotal] = useState() + let [tableData, setTableData] = useState([{ + name:'60形', + createName:'张三', + createTime:'2025-03-03', + updateTime:'' + }]) + const columns: TableColumnsType = [{ + title: '序号', + dataIndex: 'seq', + render:(_, record, index)=>{ + return index + 1 + } + }, + { + title: '轨型名称', + dataIndex: 'name', + }, + { + title: '创建者', + dataIndex: 'createName', + },{ + title: '时间', + dataIndex: 'createtTime', + },{ + title: '操作', + dataIndex: 'op', + render:(_, record)=>{ + return
+ +
+ } + }] + + let [uploadVisible, setUploadVisible] = useState(false) + const onUploadFile = () => { + setUploadVisible(true) + } + + const onCancel = () =>{ + setUploadVisible(false) + } + return ( +
+
+
+ + +
+ +
+ ({ ...item, key: item.name }))} + pagination={false} + scroll={{ y: 500 }} + + /> +
+ +
+ + + + + + + ); +}