Compare commits

..

No commits in common. "c5f6edd9eaee5787f194aed09b043055303ffe1c" and "74062c8022ae39e4cfdd5434b012aea6095fdacf" have entirely different histories.

2 changed files with 26 additions and 29 deletions

View File

@ -13,12 +13,12 @@ import { Rnd } from "react-rnd"
export default function Xmzlmb() {
const typeName = {
'ZB0+130': '1',
'ZB0+132': '2',
'ZB0+250': '3',
'ZB0+252': '4',
'ZB0+370': '5',
'ZB0+372': '6',
'大坝B0+130': '1',
'大坝B0+132': '2',
'大坝B0+250': '3',
'大坝B0+252': '4',
'大坝B0+370': '5',
'大坝B0+372': '6',
}
const role = useSelector(state => state.auth.role);
const [code, setCode] = useState([])
@ -125,9 +125,7 @@ export default function Xmzlmb() {
const getDmList = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.sycx.list)
const newData = res.data.map(s => ({ projNm: s.profileName, id: s.profileCode }))
const filterData = newData.filter(item => item?.projNm?.split('+')[0] == 'ZB0')
setDmList(filterData);
setDmList(res.data.map(s => ({ projNm: s.profileName, id: s.profileCode })));
} catch (error) {
console.log(error);
}
@ -188,9 +186,9 @@ export default function Xmzlmb() {
}
if (dmList.length > 0 && code.length) {
let name = dmList.find(s => s.id == code)?.projNm
let type = (name == "ZB0+130" || name == "ZB0+132") ? "1" :
(name == "ZB0+250" || name == "ZB0+252") ? "2" :
(name == "ZB0+370" || name == "ZB0+372") ? "3" : '';
let type = (name == "大坝B0+130" || name == "大坝B0+132") ? "1" :
(name == "大坝B0+250" || name == "大坝B0+252") ? "2" :
(name == "大坝B0+370" || name == "大坝B0+372") ? "3" : '';
let type1 = typeName[name];
setDbType(type)
setDbType1(type1)

View File

@ -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,18 +136,17 @@ const Page = () => {
const getTable2Data = async (params) => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.ndwytjb.list1, params)
setTable2Data(res.data)
// const list = []
// for(let i=0; i<24*3; i++){
// list.push({
// maxValue:'',
// maxTm:'',
// minValue:'',
// minTm:'',
// diff:'',
// })
// }
// setTable2Data(list)
const list = []
for(let i=0; i<24*3; i++){
list.push({
maxValue:'',
maxTm:'',
minValue:'',
minTm:'',
diff:'',
})
}
setTable2Data(list)
} catch (error) {
console.log(error);
}
@ -167,11 +166,11 @@ const Page = () => {
if (trData && trData?.length > 0) {
let params = {
...searchVal,
stationCodes:[trData.find(s => s.stationCode == wyObj.wy)?.stationCode],
stationCodes:trData.map(s => s.stationCode),
}
getTable2Data(params)
}
}, [trData,wyObj])
}, [trData])
useEffect(() => {
getDmTree()