|
@ -26,15 +26,16 @@ const DataDetail = (props) => { |
|
|
const [sensorList,setSensorList]=useState([])//设备列表 |
|
|
const [sensorList,setSensorList]=useState([])//设备列表 |
|
|
const [sensorId,setSensorId]=useState([])//设备数组id |
|
|
const [sensorId,setSensorId]=useState([])//设备数组id |
|
|
const [project,setProject]=useState(null)//project(eg:{projcet:'nbjj'}) |
|
|
const [project,setProject]=useState(null)//project(eg:{projcet:'nbjj'}) |
|
|
const form = useRef(); |
|
|
const [dateRange,setDateRange]=useState([moment().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')]) |
|
|
|
|
|
const form = useRef() |
|
|
//初始化 |
|
|
//初始化 |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if(factorId&&project){ |
|
|
if(factorId&&project){ |
|
|
let query={ |
|
|
let query={ |
|
|
factorId, |
|
|
factorId, |
|
|
sensorId:sensorId&&sensorId.length>0?sensorId.map(item=>`${project}-${item}`).join(','):[-11], |
|
|
sensorId:sensorId&&sensorId.length>0?sensorId.map(item=>`${project}-${item}`).join(','):[-11], |
|
|
startTime:form.current.getValue('createTimes')[0], |
|
|
startTime:moment(dateRange[0]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
endTime:form.current.getValue('createTimes')[1], |
|
|
endTime:moment(dateRange[1]).format('YYYY-MM-DD HH:mm:ss'), |
|
|
limit:queryPage.limit, |
|
|
limit:queryPage.limit, |
|
|
page:queryPage.page |
|
|
page:queryPage.page |
|
|
} |
|
|
} |
|
@ -153,6 +154,10 @@ const DataDetail = (props) => { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
//日期变化函数 |
|
|
|
|
|
const dateChange=(e)=>{ |
|
|
|
|
|
setDateRange(e) |
|
|
|
|
|
} |
|
|
const searchHandler=(values) => { |
|
|
const searchHandler=(values) => { |
|
|
form.current.validate().then(rs=>{ |
|
|
form.current.validate().then(rs=>{ |
|
|
let query={ |
|
|
let query={ |
|
@ -238,7 +243,7 @@ const DataDetail = (props) => { |
|
|
label="查询时间" |
|
|
label="查询时间" |
|
|
initValue={[moment().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')]} |
|
|
initValue={[moment().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')]} |
|
|
// style={{ width: 268 }} |
|
|
// style={{ width: 268 }} |
|
|
type="dateTimeRange" density="compact" |
|
|
type="dateTimeRange" density="compact" onChange={dateChange} |
|
|
/> |
|
|
/> |
|
|
<Col span={6}> |
|
|
<Col span={6}> |
|
|
<Button theme='solid' type="primary" htmlType="submit" onClick={searchHandler}> |
|
|
<Button theme='solid' type="primary" htmlType="submit" onClick={searchHandler}> |
|
|