import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react'; import BasicCrudModal from '../../../../components/crud/BasicCrudModal'; import { Table, Card,Modal,Form,Input,Button,Row,Col,message } from 'antd'; import { useSelector } from 'react-redux'; import ToolBar from './toolbar'; import apiurl from '../../../../service/apiurl'; import usePageTable from '../../../../components/crud/usePageTable2'; import { createCrudService } from '../../../../components/crud/_'; import { httppost2 } from '../../../../utils/request'; import "./index.less" const Page = () => { const role = useSelector(state => state.auth.role); const refModal = useRef(); const [searchVal, setSearchVal] = useState(false) const columns = [ { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" }, { title: '所属断面', key: 'ch', dataIndex: 'ch', width: 200, ellipsis: true, align:"center" }, { title: '测点编号', key: 'cdnm', dataIndex: 'cdnm', width: 200, align:"center"}, { title: 'x方向变形值(mm)', key: 'de', dataIndex: 'de', width: 200, align:"center", }, { title: 'y方向变形值(mm)', key: 'dn', dataIndex: 'dn', width: 200, ellipsis: true,align:"center", }, { title: 'h方向变形值(mm)', key: 'du', dataIndex: 'du', width: 200, ellipsis: true, align: "center", }, { title: '站点高程', key: 'alt', dataIndex: 'alt', width: 200, align:"center"}, { title: '监测时间', key: 'tm', dataIndex: 'tm', width: 200, align:"center"}, { title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, align:"center"}, ]; const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]); const command = (type) => (params) => { if (type === 'save') { refModal.current.showSave(); } else if (type === 'edit') { refModal.current.showEdit({ ...params }); } else if (type === 'view') { refModal.current.showView(params); } else if (type === 'del') { refModal.current.onDeleteGet(apiurl.gcaqjc.gcaqyj.yhyj.delete + `/${params.goodsId}`); } } const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gcaqjc.sjtjcx.wycx.page).find_noCode); useEffect(()=>{ const params = { search: { ...searchVal, } }; search(params) }, [searchVal]) return ( <>
); } export default Page;