Merge branch 'master' of http://10.0.41.100:3000/lishenfeng/tsg-web
commit
8578cfa4f8
|
|
@ -13,12 +13,12 @@ import { Rnd } from "react-rnd"
|
|||
|
||||
export default function Xmzlmb() {
|
||||
const typeName = {
|
||||
'大坝B0+130': '1',
|
||||
'大坝B0+132': '2',
|
||||
'大坝B0+250': '3',
|
||||
'大坝B0+252': '4',
|
||||
'大坝B0+370': '5',
|
||||
'大坝B0+372': '6',
|
||||
'ZB0+130': '1',
|
||||
'ZB0+132': '2',
|
||||
'ZB0+250': '3',
|
||||
'ZB0+252': '4',
|
||||
'ZB0+370': '5',
|
||||
'ZB0+372': '6',
|
||||
}
|
||||
const role = useSelector(state => state.auth.role);
|
||||
const [code, setCode] = useState([])
|
||||
|
|
@ -125,7 +125,9 @@ export default function Xmzlmb() {
|
|||
const getDmList = async () => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
|
||||
setDmList(res.data.map(s => ({ projNm: s.profileName, id: s.profileCode })));
|
||||
const newData = res.data.map(s => ({ projNm: s.profileName, id: s.profileCode }))
|
||||
const filterData = newData.filter(item => item?.projNm?.split('+')[0] == 'ZB0')
|
||||
setDmList(filterData);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -186,9 +188,9 @@ export default function Xmzlmb() {
|
|||
}
|
||||
if (dmList.length > 0 && code.length) {
|
||||
let name = dmList.find(s => s.id == code)?.projNm
|
||||
let type = (name == "大坝B0+130" || name == "大坝B0+132") ? "1" :
|
||||
(name == "大坝B0+250" || name == "大坝B0+252") ? "2" :
|
||||
(name == "大坝B0+370" || name == "大坝B0+372") ? "3" : '';
|
||||
let type = (name == "ZB0+130" || name == "ZB0+132") ? "1" :
|
||||
(name == "ZB0+250" || name == "ZB0+252") ? "2" :
|
||||
(name == "ZB0+370" || name == "ZB0+372") ? "3" : '';
|
||||
let type1 = typeName[name];
|
||||
setDbType(type)
|
||||
setDbType1(type1)
|
||||
|
|
|
|||
|
|
@ -84,9 +84,9 @@ const Page = () => {
|
|||
let newData = res.data?.map((s, i) => {
|
||||
newArr.push(s.list?.map((c, i) => ({
|
||||
[c.stationCode]: c.value || '-',
|
||||
[`X_${c.stationCode}`]:c.x || '-',
|
||||
[`Y_${c.stationCode}`]:c.y || '-',
|
||||
[`H_${c.stationCode}`]:c.h || '-',
|
||||
[`X_${c.stationCode}`]:c.x ,
|
||||
[`Y_${c.stationCode}`]:c.y ,
|
||||
[`H_${c.stationCode}`]:c.h ,
|
||||
tm: c.tm,
|
||||
})))
|
||||
return {
|
||||
|
|
@ -136,17 +136,18 @@ const Page = () => {
|
|||
const getTable2Data = async (params) => {
|
||||
try {
|
||||
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndwytjb.list1, params)
|
||||
const list = []
|
||||
for(let i=0; i<24*3; i++){
|
||||
list.push({
|
||||
maxValue:'',
|
||||
maxTm:'',
|
||||
minValue:'',
|
||||
minTm:'',
|
||||
diff:'',
|
||||
})
|
||||
}
|
||||
setTable2Data(list)
|
||||
setTable2Data(res.data)
|
||||
// const list = []
|
||||
// for(let i=0; i<24*3; i++){
|
||||
// list.push({
|
||||
// maxValue:'',
|
||||
// maxTm:'',
|
||||
// minValue:'',
|
||||
// minTm:'',
|
||||
// diff:'',
|
||||
// })
|
||||
// }
|
||||
// setTable2Data(list)
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -166,11 +167,11 @@ const Page = () => {
|
|||
if (trData && trData?.length > 0) {
|
||||
let params = {
|
||||
...searchVal,
|
||||
stationCodes:trData.map(s => s.stationCode),
|
||||
stationCodes:[trData.find(s => s.stationCode == wyObj.wy)?.stationCode],
|
||||
}
|
||||
getTable2Data(params)
|
||||
}
|
||||
}, [trData])
|
||||
}, [trData,wyObj])
|
||||
|
||||
useEffect(() => {
|
||||
getDmTree()
|
||||
|
|
|
|||
Loading…
Reference in New Issue