效果如下:
是否盘点为否时,字体颜色为红色;
是否盘点为是时,字体颜色为蓝色。
实现如下:
$load(function() {
setTimeout(function() {
const rows = document.querySelectorAll('.wev-table-view .wev-table-view-row');
rows.forEach(row => {
const secondContainer = row.querySelector('.wev-flex.wev-vertical-layout.wev-flex-1');
if (secondContainer) {
const rows1 = secondContainer.querySelectorAll('.wev-flex.wev-grid-row');
rows1.forEach(row1 => {
const checkCell = row1.querySelectorAll('.wev-flex.wev-grid-cell')[3];
if (checkCell) {
const cellText = checkCell.innerText.trim();
console.log('Cell Text:', cellText);
if (cellText === '是') {
checkCell.style.setProperty('color', 'blue', 'important');
}
else if (cellText === '否') {
checkCell.style.setProperty('color', 'red', 'important');
}
}
});
}
});
}, 500);
});
标签:flex,const,checkCell,列表,cellText,E9,wev,泛微,row
From: https://www.cnblogs.com/oeuvres/p/18687928