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