【泛微E9】移动应用列表字体颜色更改

效果如下:
是否盘点为否时,字体颜色为红色;
是否盘点为是时,字体颜色为蓝色。

实现如下:


$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);  
});
posted @ 2025-01-23 15:54  K89  阅读(54)  评论(0)    收藏  举报