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: 'rscd', dataIndex: 'rscd', width: 200, ellipsis: true, align:"center" }, // { title: '水工建筑物编号', key: 'hycncd', dataIndex: 'hycncd', width: 200, align:"center"}, { title: '测点编号', key: 'dvcd', dataIndex: 'dvcd', width: 200, align:"center"}, { title: '测量时间', key: 'mstm', dataIndex: 'mstm', width: 200, align:"center"}, // { title: '温度(°C)', key: 'tm', dataIndex: 'tm', width: 250, ellipsis: true,align:"center", }, { title: '渗流量(L/s)', key: 'spqn', dataIndex: 'spqn', width: 250, ellipsis: true,align:"center", }, // { // title: '标准水温渗流量(l/s)', key: 'stspqn', dataIndex: 'stspqn', width: 200, align:"center", // }, // { title: '创建时间', key: 'createTime', dataIndex: 'createTime', width: 200, ellipsis: true,align:"center" }, // { title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, ellipsis: true,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.slcx.page).find_noCode); useEffect(()=>{ const params = { search: { ...searchVal, } }; search(params) }, [searchVal]) return ( <>