Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
//直接计算字段变量
{{ 销售额/10000 }} 万元
{{ ( (销售额-去年销售额) / 去年销售额 ) * 100 }}

//遍历dataRow时,计算字段列,必须对字段使用括号
{{ ( ( (item["销售额"])-(item["去年销售额"])) / (item["去年销售额"]) ) * 100 }}

 

3.

...

控制语句

Code Block
languagejs
titleif ... else
{% if (销售额 > 300) %}
<div>销售额大于300了!</div>
{% elseif (销售额 > 100) %}
<div>销售额在100与300之间!</div> 
{% else %}
<div>销售额不足100!</div> 
{% endif %}
Code Block
title遍历List
{% for item in dataRow %}
<tr style="height: 12px;">
<td style="width: 70.1167px; height: 12px;">{{item["日期"]}}</td>
<td style="width: 188.883px; height: 12px;">{{item["门店名称"]}}</td>
<td style="width: 70.1167px; height: 12px;">{{item["款名"]}}</td>
<td style="width: 97px; height: 12px;">{{item["金额"]}}</td>
</tr>
{% endfor %}

 

4. 内置函数

 

函数描述示例
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

...