Vue enter the page. After the user has recorded all the data, click OK (upload the data to the server), and the front end determines whether there is a null value. If any data is not submitted, it is highly automatically scrolled to the place where there is no input (not realized), and the color is highlighted (color highlighting has been realized). How can it be achieved?
Click to confirm the backfill if a null value scrolls to the corresponding height
the structure of the data is
let newList = [];
let aMap = {};
articleList.forEach(a => {
if (!(("" + a.deviceId) in aMap)){
aMap["" + a.deviceId] = newList.length
newList.push({
deviceId: a.deviceId,
deviceName:a.deviceName,
areaId:a.areaId,
xianshide:xianshide,
yanse:"red",
list: [{
deviceId:a.deviceId,
areaId:a.areaId,
areaName:a.areaName,
itemId:a.itemId,
itemName:a.itemName,
itemType:a.itemType,
measureUnit:a.measureUnit,
taskId:a.taskId,
taskName:a.taskName,
taskStatus:a.taskStatus,
unitId:a.unitId,
unitName:a.unitName,
value:null,
zheng:true,
yichang:false,
SeleteShow:false,//
shifoyichang:"",//
NotLost:false,//
HieghtDom:document.documentElement.scrollTop || document.body.scrollTop,//dom
}]
})
} else {
newList[aMap["" + a.deviceId]].list.push({
yanse:"red",
xianshide:xianshide,
deviceId:a.deviceId,
areaId:a.areaId,
areaName:a.areaName,
deviceName:a.deviceName,
itemId:a.itemId,
itemName:a.itemName,
itemType:a.itemType,
measureUnit:a.measureUnit,
taskId:a.taskId,
taskName:a.taskName,
taskStatus:a.taskStatus,
unitId:a.unitId,
unitName:a.unitName,
value:null,
zheng:true,
yichang:false,
SeleteShow:false,//
shifoyichang:"",//
NotLost:false,//
HieghtDom:document.documentElement.scrollTop || document.body.scrollTop,//dom
})
}
})
I want to get the height of each dom and page through the HieghtDom attribute and scroll directly, but each is 0 and there is no height
when you click OK
if(newList[i].list[j].value == null && shifoyichang == null){
newList[i].list[j].NotLost=true;
}
I changed the color of the box to a highlight, but what if I scroll to a height where there is no input value? Or is it realized by other methods?