Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web
commit
11550d4654
|
|
@ -56,12 +56,19 @@ const Page = () => {
|
||||||
}, [dmName,trData])
|
}, [dmName,trData])
|
||||||
|
|
||||||
const getTableData = async (params) => {
|
const getTableData = async (params) => {
|
||||||
setLoading(true)
|
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndsytjb.page, params)
|
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndsytjb.page, params)
|
||||||
setLoading(false)
|
const { code, data } = res
|
||||||
|
if(code!==200 || data.length>10000){
|
||||||
|
setDataSource([])
|
||||||
|
setLoading(false)
|
||||||
|
console.log('请求失败或者数组超长,data长度'+data?.length||0);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log('开始计算-------');
|
||||||
let newArr = [];
|
let newArr = [];
|
||||||
let newData = res.data?.map((s, i) => {
|
let newData = data?.map((s, i) => {
|
||||||
newArr.push(s.list?.map(c => ({
|
newArr.push(s.list?.map(c => ({
|
||||||
[c.stationCode]: c.value || '-',
|
[c.stationCode]: c.value || '-',
|
||||||
tm:c.tm
|
tm:c.tm
|
||||||
|
|
@ -89,7 +96,9 @@ const Page = () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
setDataSource(result)
|
setDataSource(result)
|
||||||
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setLoading(false)
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +119,12 @@ const Page = () => {
|
||||||
const getTable2Data = async (params) => {
|
const getTable2Data = async (params) => {
|
||||||
try {
|
try {
|
||||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndsytjb.list1, params)
|
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndsytjb.list1, params)
|
||||||
setTable2Data(res.data)
|
const { code, data } = res
|
||||||
|
if(code!==200){
|
||||||
|
setTable2Data([])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
setTable2Data(data||[])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue