修改监测点及其相关页面
parent
11bfad5dc5
commit
77a3dd1b50
|
|
@ -259,6 +259,7 @@ const apiurl = {
|
|||
page:service_fxdd + '/osmoticFlowR/page'
|
||||
},
|
||||
wycx: {
|
||||
wydm: service_fxdd + '/osmoticShiftDevice/list/dm',//位移断面list
|
||||
page: service_fxdd + '/osmoticShiftR/page',
|
||||
list: service_fxdd + "/osmoticShiftDevice/list",
|
||||
slList:service_fxdd + "/osmoticFlowDevice/list"
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export default function Page({isHome}) {
|
|||
]
|
||||
|
||||
const columnsWy = [
|
||||
{ title: '监测点', key: 'cd', dataIndex: 'cd',align: "center",width: 80, ellipsis: true },
|
||||
{ title: '监测点', key: 'cdnm', dataIndex: 'cdnm',align: "center",width: 150, ellipsis: true },
|
||||
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 80, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}><div>{v?.slice(5,10)}</div><div>{v?.slice(11,16)}</div></div> },
|
||||
{ title: <div><div>e方向</div><div>(mm)</div></div>, key: 'de', dataIndex: 'de',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.xstatus===1?'red':'#3B4859'}}>{v}</div> },
|
||||
{ title: <div><div>n方向</div><div>(mm)</div></div>, key: 'dn', dataIndex: 'dn',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.ystatus===1?'red':'#3B4859'}}>{v}</div> },
|
||||
|
|
@ -82,7 +82,8 @@ export default function Page({isHome}) {
|
|||
if(code!==200){
|
||||
return
|
||||
}
|
||||
setWyList(data||[])
|
||||
const list = data?.map((item)=>({...item,stationCode:item.cd}))
|
||||
setWyList(list||[])
|
||||
}
|
||||
|
||||
const getDmData = async()=>{
|
||||
|
|
@ -197,7 +198,7 @@ export default function Page({isHome}) {
|
|||
columns={columnsWy}
|
||||
// pagination={false}
|
||||
dataSource={wyList}
|
||||
pagination={{
|
||||
pagination={{
|
||||
pageSize: 100,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: [ '100', '200'],
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: 10px;
|
||||
color: #00c188;
|
||||
cursor: pointer;
|
||||
left: 0;
|
||||
|
|
@ -143,7 +144,7 @@
|
|||
transform: scaleX(0.8);
|
||||
letter-spacing: -0.8px;
|
||||
font-weight: 700;
|
||||
font-size: 6px;
|
||||
font-size: 7px;
|
||||
margin-bottom: 1px;
|
||||
text-shadow:
|
||||
0.3px 0.3px 0.3px white, /* 白色内描边 */
|
||||
|
|
@ -151,7 +152,7 @@
|
|||
0px 0px 1px white; /* 黑色外描边 */
|
||||
}
|
||||
img{
|
||||
transform: scale(0.8);
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
[class*="gcaqjc_bzt_dm"]{
|
||||
|
|
@ -300,6 +301,39 @@
|
|||
|
||||
|
||||
|
||||
//ZB0+370
|
||||
.gcaqjc_bzt_wy_06{
|
||||
left: 1063px;
|
||||
top: 436px;
|
||||
}
|
||||
//ZB0+310
|
||||
.gcaqjc_bzt_wy_05{
|
||||
left: 1070px;
|
||||
top: 536px;
|
||||
}
|
||||
//ZB0+250
|
||||
.gcaqjc_bzt_wy_04{
|
||||
left: 1075px;
|
||||
top: 664px;
|
||||
}
|
||||
//ZB0+190
|
||||
.gcaqjc_bzt_wy_10{
|
||||
left: 1069px;
|
||||
top: 773px;
|
||||
}
|
||||
//ZB0+130
|
||||
.gcaqjc_bzt_wy_02{
|
||||
left: 1060px;
|
||||
top: 885px;
|
||||
}
|
||||
//ZB0+60
|
||||
.gcaqjc_bzt_wy_08{
|
||||
left: 1051px;
|
||||
top: 1010px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.gcaqjc_bzt_wy_WY-01{
|
||||
left: 961px;
|
||||
top: 1003px;
|
||||
|
|
|
|||
|
|
@ -88,10 +88,10 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
|
|||
|
||||
console.log("record",record);
|
||||
const [form] = Form.useForm();
|
||||
const [staCodeList, setStaCodeList] = useState([])
|
||||
const [staCodeList, setStaCodeList] = useState([])//渗压
|
||||
const [Condition, setCondition] = useState("")
|
||||
const [types, setTypes] = useState('')
|
||||
const [slStacodeList, setSlStacodeList] = useState([])
|
||||
const [slStacodeList, setSlStacodeList] = useState([])//渗流
|
||||
const onFinish = (values) => {
|
||||
values.valueOne = values.valueOne ? Number(values.valueOne) : ''
|
||||
values.valueTwo = values.valueTwo ? Number(values.valueTwo) : ''
|
||||
|
|
@ -106,12 +106,12 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
|
|||
|
||||
}
|
||||
|
||||
const [codeList, setCodeList] = useState([])
|
||||
const [codeList, setCodeList] = useState([])//位移
|
||||
|
||||
const getwYCode = async () => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.list)
|
||||
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
|
||||
setCodeList(res.data.map(s=>({stationCode:s.cd,label:s.cdNm,value:s.cd})));//
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
|
|||
const getSlCode = async () => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.slList)
|
||||
setSlStacodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
|
||||
setSlStacodeList(res.data.map(s=>({stationCode:s.dvcd,label:s.dvcd,value:s.dvcd})));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -128,7 +128,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
|
|||
const getStationCode = async () => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
|
||||
setStaCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
|
||||
setStaCodeList(res.data.map(s=>({stationCode:s.dvcd,label:s.dvcd,value:s.dvcd})));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -143,9 +143,9 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
|
|||
}, [record, mode])
|
||||
|
||||
useEffect(() => {
|
||||
getwYCode()
|
||||
getStationCode()
|
||||
getSlCode()
|
||||
getwYCode()//位移
|
||||
getStationCode()//渗压
|
||||
getSlCode()//渗流
|
||||
}, [])
|
||||
useEffect(() => {
|
||||
if (mode == "save") {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ const Page = () => {
|
|||
const [dmName, setDmName] = useState("")
|
||||
const [trData, setTrData] = useState()
|
||||
const [table2Data, setTable2Data] = useState([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const columns1 = [
|
||||
{
|
||||
title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center",
|
||||
|
|
@ -37,15 +37,6 @@ const Page = () => {
|
|||
render: (rec, record) => <span>{ record?.drp ?? "-"}</span>
|
||||
},
|
||||
];
|
||||
const getDmTree = async() => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.czcx.tree)
|
||||
let filterData = res.data.filter(s => s.profileName == dmName)
|
||||
setTrData(filterData[0])
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
const newCols = useMemo(() => {
|
||||
if (dmName && trData) {
|
||||
let dm = {
|
||||
|
|
@ -131,20 +122,6 @@ const Page = () => {
|
|||
stationCodes: trData?.children,
|
||||
};
|
||||
getTableData(params)
|
||||
|
||||
}
|
||||
}, [searchVal,trData])
|
||||
|
||||
useEffect(() => {
|
||||
getDmTree()
|
||||
}, [dmName])
|
||||
|
||||
useEffect(() => {
|
||||
if (trData && trData?.children) {
|
||||
let params = {
|
||||
stationCodes: trData?.children,
|
||||
...searchVal
|
||||
}
|
||||
getTable2Data(params)
|
||||
}
|
||||
}, [trData,searchVal])
|
||||
|
|
@ -158,6 +135,7 @@ const Page = () => {
|
|||
<ToolBar
|
||||
setSearchVal={setSearchVal}
|
||||
setDmName={setDmName}
|
||||
setTrData={setTrData}
|
||||
exportFile={exportExcel}
|
||||
role={role}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -7,11 +7,12 @@ import { config } from '../../../../config';
|
|||
import moment from 'moment';
|
||||
import { httppost2 } from '../../../../utils/request';
|
||||
import apiurl from '../../../../service/apiurl';
|
||||
const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
||||
const ToolBar = ({ setSearchVal, setDmName, setTrData, exportFile,role }) => {
|
||||
const exportBtn = role?.rule?.find(item => item.menuName == "导出")||true;
|
||||
const searchBtn = role?.rule?.find(item => item.menuName == "查询")||true;
|
||||
const [form] = Form.useForm();
|
||||
const [dmList, setDmList] = useState([])
|
||||
const [dmTree, setDmTree] = useState([])
|
||||
const getDmList = async () => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
|
||||
|
|
@ -20,6 +21,14 @@ const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
|||
console.log(error);
|
||||
}
|
||||
}
|
||||
const getDmTree = async() => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.czcx.tree)
|
||||
setDmTree(res.data)
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const onFinish = (values) => {
|
||||
let dateSo;
|
||||
|
|
@ -28,31 +37,39 @@ const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
|||
}
|
||||
delete values.tm
|
||||
setSearchVal({ ...values, year: dateSo });
|
||||
setDmName(dmList.find(item => item.value == values.profileCode).label)
|
||||
const dmName = dmList.find(item => item.value == values.profileCode).label
|
||||
setDmName(dmName)
|
||||
|
||||
let filterData = dmTree.filter(s => s.profileName == dmName)
|
||||
setTrData(filterData[0])
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
getDmList()
|
||||
getDmTree()
|
||||
}, [])
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
let time = moment()
|
||||
if (dmList.length > 0) {
|
||||
if (dmList.length > 0 && dmTree.length>0) {
|
||||
form.setFieldValue("tm", time)
|
||||
form.setFieldValue("profileCode",dmList[0].value)
|
||||
setSearchVal({ year: moment().format("YYYY"), profileCode: dmList[0].value })
|
||||
setDmName(dmList[0].label)
|
||||
const dmName = dmList[0].label
|
||||
setDmName(dmName)
|
||||
let filterData = dmTree.filter(s => s.profileName == dmName)
|
||||
setTrData(filterData[0])
|
||||
}
|
||||
}, [dmList])
|
||||
}, [dmList,dmTree])
|
||||
return (
|
||||
<>
|
||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||
<Form.Item label="上报时间" name="tm">
|
||||
<DatePicker
|
||||
allowClear
|
||||
allowClear={false}
|
||||
picker="year"
|
||||
style={{ width: "200px" }}
|
||||
format={'YYYY'}
|
||||
|
|
@ -60,7 +77,7 @@ const ToolBar = ({ setSearchVal, setDmName, exportFile,role }) => {
|
|||
</Form.Item>
|
||||
<Form.Item label="监测断面" name="profileCode">
|
||||
<NormalSelect
|
||||
allowClear
|
||||
allowClear={false}
|
||||
style={{ width: "150px" }}
|
||||
options={dmList}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -160,19 +160,10 @@ const Page = () => {
|
|||
stationCodes: [wy],
|
||||
};
|
||||
getTableData(params)
|
||||
|
||||
getTable2Data(params)
|
||||
}
|
||||
}, [searchVal,trData])
|
||||
|
||||
useEffect(() => {
|
||||
if (trData && trData?.length > 0) {
|
||||
let params = {
|
||||
...searchVal,
|
||||
stationCodes:[trData.find(s => s.cd == wyObj.wy)?.cd],
|
||||
}
|
||||
getTable2Data(params)
|
||||
}
|
||||
}, [trData,wyObj,searchVal])
|
||||
|
||||
useEffect(() => {
|
||||
getDmTree()
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ const ToolBar = ({ setSearchVal, setDmName, exportFile, role,list,setWyObj }) =>
|
|||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="位移" name="wy">
|
||||
<NormalSelect options={source} style={{ width: '180px' }} />
|
||||
<NormalSelect options={source} style={{ width: '180px' }} allowClear={false}/>
|
||||
</Form.Item>
|
||||
{searchBtn ? <Form.Item>
|
||||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
|
|
|
|||
|
|
@ -44,12 +44,15 @@ const Page = () => {
|
|||
|
||||
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gcaqjc.sjtjcx.sycx.page).find_noCode);
|
||||
useEffect(()=>{
|
||||
const params = {
|
||||
search: {
|
||||
...searchVal,
|
||||
}
|
||||
};
|
||||
search(params)
|
||||
const { dm, dvcd } = searchVal
|
||||
if(dm&&dvcd){
|
||||
const params = {
|
||||
search: {
|
||||
...searchVal,
|
||||
}
|
||||
};
|
||||
search(params)
|
||||
}
|
||||
}, [searchVal])
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,20 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
const getStationCode = async () => {
|
||||
try {
|
||||
const res = await httpget2(apiurl.gcaqjc.sjtjcx.sycx.list1)
|
||||
setCodeList(res.data.map(s=>({label:s,value:s,profileCode:s})));
|
||||
const list = []
|
||||
res?.data?.map((item)=>{
|
||||
const { dvcd, dm } = item
|
||||
if(dvcd?.length>0){
|
||||
dvcd?.map((item2)=>{
|
||||
list.push({
|
||||
label:item2,
|
||||
value:item2,
|
||||
profileCode:dm,
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
setCodeList(list);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -86,6 +99,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
}
|
||||
}
|
||||
delete values.tm
|
||||
if(values.dvcd && !values.dm){
|
||||
const {profileCode} = codeList.filter(o=>o.value===values.dvcd)?.[0]||{}
|
||||
values.dm = profileCode
|
||||
}
|
||||
setSearchVal({...values, dateTimeRangeSo:dateSo});
|
||||
}
|
||||
|
||||
|
|
@ -95,14 +112,24 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
let time = [moment().subtract(1,"weeks"),moment()]
|
||||
let dateSo = {
|
||||
start:moment(time[0]).format('YYYY-MM-DD 00:00:00'),
|
||||
end:moment(time[1]).format('YYYY-MM-DD 23:59:59'),
|
||||
}
|
||||
form.setFieldValue("tm",time)
|
||||
setSearchVal({dateTimeRangeSo:dateSo})
|
||||
}, [])
|
||||
if(dmList.length>0&&codeList.length>0){
|
||||
let time = [moment().subtract(1,"weeks"),moment()]
|
||||
let dateSo = {
|
||||
start:moment(time[0]).format('YYYY-MM-DD 00:00:00'),
|
||||
end:moment(time[1]).format('YYYY-MM-DD 23:59:59'),
|
||||
}
|
||||
const dvcd = codeList[0].value
|
||||
const dm = codeList.filter(o=>o.value===dvcd)?.[0]?.profileCode
|
||||
form.setFieldValue("tm",time)
|
||||
// form.setFieldValue("dm",dm)//不要
|
||||
form.setFieldValue("dvcd",dvcd)
|
||||
setSearchVal({
|
||||
dateTimeRangeSo:dateSo,
|
||||
dm:dm,
|
||||
dvcd:dvcd
|
||||
})
|
||||
}
|
||||
}, [dmList,codeList])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -132,14 +159,15 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
style={{ width: "150px" }}
|
||||
options={dmList}
|
||||
onChange={(v)=>{
|
||||
form.setFieldValue('dvcd',null)
|
||||
const dvcd = codeList.filter(o=>dmCode?o.profileCode===dmCode:true)?.[0]?.value
|
||||
form.setFieldValue('dvcd',dvcd)
|
||||
setDmCode(v)
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="测点名称" name="dvcd">
|
||||
<NormalSelect
|
||||
allowClear
|
||||
allowClear = {false}
|
||||
style={{ width: "150px" }}
|
||||
options={codeList.filter(o=>dmCode?o.profileCode===dmCode:true)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -14,14 +14,14 @@ const Page = () => {
|
|||
const [searchVal, setSearchVal] = useState(false)
|
||||
const columns = [
|
||||
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
|
||||
{ title: '水库编码设备编码', key: 'resCd', dataIndex: 'resCd', width: 200, ellipsis: true, align:"center" },
|
||||
{ title: '测点编号', key: 'cd', dataIndex: 'cd', width: 200, align:"center"},
|
||||
{ title: '所属断面', key: 'ch', dataIndex: 'ch', width: 200, ellipsis: true, align:"center" },
|
||||
{ title: '测点编号', key: 'cdnm', dataIndex: 'cdnm', width: 200, align:"center"},
|
||||
{
|
||||
title: 'e方向变形值(mm)', key: 'de', dataIndex: 'de', width: 200, align:"center",
|
||||
title: 'x方向变形值(mm)', key: 'de', dataIndex: 'de', width: 200, align:"center",
|
||||
},
|
||||
{ title: 'n方向变形值(mm)', key: 'dn', dataIndex: 'dn', width: 200, ellipsis: true,align:"center", },
|
||||
{ title: 'y方向变形值(mm)', key: 'dn', dataIndex: 'dn', width: 200, ellipsis: true,align:"center", },
|
||||
|
||||
{ title: 'u方向变形值(mm)', key: 'du', dataIndex: 'du', 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"},
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import AdcdFuzzyTreeSelect from '../../../../components/Form/AdcdFuzzyTreeSelect
|
|||
import NormalSelect from '../../../../components/Form/NormalSelect';
|
||||
import { config } from '../../../../config';
|
||||
import moment from 'moment';
|
||||
import { httppost2 } from '../../../../utils/request';
|
||||
import { httpget2, httppost2 } from '../../../../utils/request';
|
||||
import apiurl from '../../../../service/apiurl';
|
||||
const { RangePicker } = DatePicker;
|
||||
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
||||
|
|
@ -36,6 +36,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
const [form] = Form.useForm();
|
||||
|
||||
const [codeList, setCodeList] = useState([])
|
||||
const [dmList, setDmList] = useState([])
|
||||
|
||||
const getStationCode = async () => {
|
||||
try {
|
||||
|
|
@ -45,6 +46,16 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const getDmList = async () => {
|
||||
try {
|
||||
const res = await httpget2(apiurl.gcaqjc.sjtjcx.wycx.wydm)
|
||||
setDmList(res.data.map(s=>({label:s,value:s})));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const onValuesChange = (e) => {
|
||||
switch (e.ranger) {
|
||||
case 1:
|
||||
|
|
@ -80,7 +91,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
}
|
||||
|
||||
useEffect(() => {
|
||||
getStationCode()
|
||||
// getStationCode()
|
||||
getDmList()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -113,12 +125,19 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
|
|||
options={optionsType}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="测点编号" name="cd">
|
||||
{/* <Form.Item label="测点编号" name="cd">
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: "150px" }}
|
||||
options={codeList}
|
||||
/>
|
||||
</Form.Item> */}
|
||||
<Form.Item label="监测断面" name="ch">
|
||||
<NormalSelect
|
||||
allowClear
|
||||
style={{ width: "150px" }}
|
||||
options={dmList}
|
||||
/>
|
||||
</Form.Item>
|
||||
{searchBtn ? <Form.Item>
|
||||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
|
|
|
|||
|
|
@ -11,12 +11,16 @@ import { createCrudService } from '../../../../components/crud/_';
|
|||
import { httppost2 } from '../../../../utils/request';
|
||||
import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
|
||||
import './index.less';
|
||||
import moment from 'moment';
|
||||
const url = "http://223.75.53.141:9100/gs-tsg"
|
||||
const Page = () => {
|
||||
const role = useSelector(state => state.auth.role);
|
||||
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
|
||||
const viewBtn = role?.rule?.find(item => item.menuName == "查看")|| true;
|
||||
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
|
||||
const initData = {
|
||||
obDate: moment().format('YYYY-MM-DD')
|
||||
}
|
||||
|
||||
const [stats, setStats] = useState({
|
||||
total: 400,
|
||||
|
|
@ -40,7 +44,7 @@ const Page = () => {
|
|||
1: "有危害",
|
||||
}
|
||||
const refModal = useRef();
|
||||
const [searchVal, setSearchVal] = useState({})
|
||||
const [searchVal, setSearchVal] = useState({...initData})
|
||||
const [count, setCount] = useState({})
|
||||
// const columns = [
|
||||
// { title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
|
||||
|
|
@ -157,18 +161,14 @@ const Page = () => {
|
|||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
search: {
|
||||
...searchVal,
|
||||
}
|
||||
};
|
||||
search(params)
|
||||
getCount();
|
||||
}, [searchVal])
|
||||
useEffect(() => {
|
||||
if (searchVal) {
|
||||
const params = {
|
||||
search: {
|
||||
...searchVal,
|
||||
}
|
||||
};
|
||||
search(params)
|
||||
}
|
||||
}, [searchVal])
|
||||
|
||||
|
||||
return (
|
||||
|
|
@ -216,6 +216,7 @@ const Page = () => {
|
|||
<Card className='nonebox'>
|
||||
<ToolBar
|
||||
setSearchVal={setSearchVal}
|
||||
initData={initData}
|
||||
// onSave={command('save')}
|
||||
// role={role}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
|
|||
import moment from 'moment';
|
||||
import NormalSelect from '../../../../components/Form/NormalSelect';
|
||||
const { RangePicker } = DatePicker;
|
||||
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
||||
const ToolBar = ({ setSearchVal, onSave, storeData, role, initData }) => {
|
||||
// const addBtn = role?.rule?.find(item => item.menuName == "新增")|| true;
|
||||
// const searchBtn = role?.rule?.find(item => item.menuName == "查询")|| true;
|
||||
const [form] = Form.useForm();
|
||||
|
|
@ -30,10 +30,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
|
|||
return (
|
||||
<>
|
||||
<div style={{display:'flex',justifyContent:'space-between'}}>
|
||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
|
||||
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish} initialValues={{year:moment(initData.obDate)}}>
|
||||
<Form.Item label="监测日期" name="year">
|
||||
<DatePicker
|
||||
allowClear
|
||||
allowClear={false}
|
||||
style={{ width: "240px" }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue