diff --git a/.env b/.env index 7fd9e5c..93da990 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -REACT_APP_WS_URL=192.168.1.201:8080/ws +REACT_APP_WS_URL=192.168.1.200:8080/ws diff --git a/package.json b/package.json index e0d4d7b..56424a1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "outline", "version": "0.1.0", "private": true, - "proxy": "http://192.168.1.201:8080", + "proxy": "http://192.168.1.200:8080", "dependencies": { "@babel/core": "^7.16.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3", diff --git a/src/index.tsx b/src/index.tsx index 4d971e7..ec73b91 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -9,7 +9,7 @@ import MeasureDetail from "./pages/measure/components/MeasureDetail"; import MeasureAction from "./pages/measure/components/MeasureAction"; import DetailInfo from "./pages/measure/components/Detail"; -import RailConfig from "./pages/rail/railConfig"; +import RailConfig from "./pages/rail/RailConfig"; import App from "./App"; import reportWebVitals from "./reportWebVitals"; @@ -37,15 +37,18 @@ const router = createBrowserRouter([ { path: "detail", element: , + children:[ + { + path: "detail/:id", + element: , + } + ] }, { path: "action", element: , }, - { - path: "detail/:id", - element: , - } + ], }, { diff --git a/src/pages/measure/components/MeasureDetail.tsx b/src/pages/measure/components/MeasureDetail.tsx index 13bfae6..886a5c4 100644 --- a/src/pages/measure/components/MeasureDetail.tsx +++ b/src/pages/measure/components/MeasureDetail.tsx @@ -171,7 +171,7 @@ export default function MeasureDetail() { let resData = await getDetail({id:item.id}) console.log('res==测量记录详情=', resData) if(resData){ - // navigate(`/measure/detail/${item.id}`) + navigate(`/measure/detail/${item.id}`) //@ts-ignore getRecordByUuid(resData.data.uuid) //@ts-ignore diff --git a/src/pages/rail/Upload.tsx b/src/pages/rail/Upload.tsx new file mode 100644 index 0000000..20551af --- /dev/null +++ b/src/pages/rail/Upload.tsx @@ -0,0 +1,62 @@ +import { Button, message, Upload, type UploadProps, Input, Form } from 'antd'; +import { UploadOutlined } from '@ant-design/icons'; +type ChildProps = { + cancel: () => void; +}; + +export default function UploadFile(props:ChildProps) { + + const uploadProps: UploadProps = { + name: 'file', + action: 'https://660d2bd96ddfa2943b33731c.mockapi.io/api/upload', + headers: { + authorization: 'authorization-text', + }, + onChange(info) { + if (info.file.status !== 'uploading') { + console.log(info.file, info.fileList); + } + if (info.file.status === 'done') { + message.success(`${info.file.name} file uploaded successfully`); + } else if (info.file.status === 'error') { + message.error(`${info.file.name} file upload failed.`); + } + }, + }; + + const layout = { + labelCol: { span: 8 }, + wrapperCol: { span: 16 }, + }; + const [form] = Form.useForm(); + const onFinish = (values: any) => { + console.log(values); + }; + + const onCancel = () => { + form.resetFields() + props.cancel(); + } + return (
+
+ + + + + + + + +
+ + +
+
+
) +} \ No newline at end of file diff --git a/src/pages/rail/railConfig.tsx b/src/pages/rail/railConfig.tsx index ff97eff..fd7f969 100644 --- a/src/pages/rail/railConfig.tsx +++ b/src/pages/rail/railConfig.tsx @@ -1,10 +1,13 @@ import "./rail.scss"; -import { Button, Pagination, Table, TableColumnsType } from 'antd' +import { Button, Modal, Pagination, Table, TableColumnsType } from 'antd' import {useState} from 'react' +import Upload from './Upload' export default function RailManage() { type RailItem = { - id: number; + id?: number; name: string; + createTime: string, + updateTime: string } let [loading, setLoading] = useState() @@ -39,7 +42,11 @@ export default function RailManage() { } let [total, setTotal] = useState() - let [tableData, setTableData] = useState([]) + let [tableData, setTableData] = useState([{ + name:'60形', + createTime:'2025-03-03', + updateTime:'' + }]) const columns: TableColumnsType = [{ title: '序号', dataIndex: 'seq', @@ -62,16 +69,25 @@ export default function RailManage() { dataIndex: 'op', render:(_, record)=>{ return
- +
} }] + + let [uploadVisible, setUploadVisible] = useState(false) + const onUploadFile = () => { + setUploadVisible(true) + } + + const onCancel = () =>{ + setUploadVisible(false) + } return (
- +
@@ -92,6 +108,9 @@ export default function RailManage() {
+ + + );