<#list data as saleData> <tr style="font-size: ${(saleData.team?contains('汇总'))?string('28px', '26px')}; color: ${(saleData.dailySalesAmount == 0)?string("#f3f3f3", '')}; background-color: ${(saleData.team?contains('汇总'))?string('', '#4472C4')} ${((saleData.dailySalesAmount > 0) && (saleData.dailySalesAmount < 10000))?string('#D9E1F2', '')} ${(saleData.saleArea=='CA部门' && saleData.dailySalesAmount>0 && saleData.dailySalesAmount<50000)?string('#D9E1F2', '')}; font-weight: bold"> <td>${(saleData.team)!""}</td> <td>${(saleData.name)!""}</td> <td>${(saleData.tenDailySalesAmount)!""}</td> <td>${(saleData.twelveDailySalesAmount)!""}</td> <td>${(saleData.fifteenDailySalesAmount)!""}</td> <td>${(saleData.dailySalesAmount)!""}</td> <td>${(saleData.orderCount!"")}</td> </tr> </#list> 加一个条件 当sale.team 包含 "汇总"的话,字体颜色为黑色
时间: 2024-03-27 22:38:57 浏览: 103
可以将代码修改如下:
```
<#list data as saleData>
<tr style="font-size: ${(saleData.team?contains('汇总'))?string('28px', '26px')};
color: ${(saleData.dailySalesAmount == 0)?string("#f3f3f3", '')};
${(saleData.team?contains('汇总'))?string('color: black;', '')}
background-color: ${(saleData.team?contains('汇总'))?string('', '#4472C4')}
${(saleData.dailySalesAmount > 0) && (saleData.dailySalesAmount < 10000))?string('background-color: #D9E1F2;', '')}
${(saleData.saleArea=='CA部门') && (saleData.dailySalesAmount>0) && (saleData.dailySalesAmount<50000))?string('background-color: #D9E1F2;', '')};
font-weight: bold">
<td>${(saleData.team)!""}</td>
<td>${(saleData.name)!""}</td>
<td>${(saleData.tenDailySalesAmount)!""}</td>
<td>${(saleData.twelveDailySalesAmount)!""}</td>
<td>${(saleData.fifteenDailySalesAmount)!""}</td>
<td>${(saleData.dailySalesAmount)!""}</td>
<td>${(saleData.orderCount!"")}</td>
</tr>
</#list>
```
在原有代码的基础上,增加了一个判断条件,当团队名称包含“汇总”时,设置字体颜色为黑色。
阅读全文