Browse Source

feat:查询接口报错

dev
zhaobing’ 1 year ago
parent
commit
e473b94dd1
  1. 13
      web/client/src/sections/data/containers/dataDetail.jsx
  2. 6
      web/client/src/sections/data/containers/dataQuery.jsx
  3. 2
      web/client/src/sections/data/nav-item.jsx
  4. 2
      web/client/src/utils/webapi.js

13
web/client/src/sections/data/containers/dataDetail.jsx

@ -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}>

6
web/client/src/sections/data/containers/dataQuery.jsx

@ -33,7 +33,7 @@ const DataQuery = (props) => {
]) ])
} }
const downloadWord = (html = '', name = '数据监测 ' + moment().format('YYYY-MM-DD HH:mm:ss')) => { const downloadWord = (html = '', name = '监测报表 ' + moment().format('YYYY-MM-DD HH:mm:ss')) => {
exportWord({ exportWord({
mhtml: html, mhtml: html,
filename: name, filename: name,
@ -73,9 +73,9 @@ const DataQuery = (props) => {
/> />
<Form.Select <Form.Select
pure pure
label="数据监测类型" label="监测报表类型"
field="typeNo" field="typeNo"
placeholder="数据监测类型" placeholder="监测报表类型"
style={{ width: 260, marginLeft: 12, marginRight: 12 }} style={{ width: 260, marginLeft: 12, marginRight: 12 }}
showClear showClear
> >

2
web/client/src/sections/data/nav-item.jsx

@ -16,7 +16,7 @@ export function getNavItem (user, dispatch) {
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconsjjiankong"></iconpark-icon>, icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconsjjiankong"></iconpark-icon>,
to: '/data/dataMonitoring/dataQuery', to: '/data/dataMonitoring/dataQuery',
items: [{ items: [{
itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '数据监测' itemKey: 'dataQuery', to: '/data/dataMonitoring/dataQuery', text: '监测报表'
},{ },{
itemKey: 'dataDetail', to: '/data/dataMonitoring/dataDetail', text: '数据详情' itemKey: 'dataDetail', to: '/data/dataMonitoring/dataDetail', text: '数据详情'
}] }]

2
web/client/src/utils/webapi.js

@ -64,7 +64,7 @@ export const ApiTable = {
getVcmpAuth: 'vcmp/auth', // 获取视频平台应用鉴权token getVcmpAuth: 'vcmp/auth', // 获取视频平台应用鉴权token
getAlarmVideoExceptionType: 'alarm/video/exceptionType', //查询视频设备类型 getAlarmVideoExceptionType: 'alarm/video/exceptionType', //查询视频设备类型
// 数据监测 // 监测报表
getDataContinuityType: 'data/continuity/type_list', getDataContinuityType: 'data/continuity/type_list',
getDataContinuity: 'data/continuity', getDataContinuity: 'data/continuity',
getDataContinuityDetail: 'data/continuity/{continuityId}/detail', getDataContinuityDetail: 'data/continuity/{continuityId}/detail',

Loading…
Cancel
Save