等于 select 控制的灰尘助手

Dust helper equal for select control

我有这个模板,我需要 select 正确的 selected 选项,如何将它与灰尘助手进行比较? 对我不起作用

{#data.PRODUCT_TURNOVER_DATA}
<tr>
    <td><input name="ID_TYPE_TURN" value='{.ID_TYPE_TURN}'></td>
    <td>

                        <div class="form-group">
                            <select class="form-control" name="ID_TYPE_TURN">
                            {#data.SPR_TYPE_TURN_DATA}
                                <option value="{.ID_TYPE_TURN}" selected='?'>{.NAME_TYPE_TURN}</option>
                            {/data.SPR_TYPE_TURN_DATA}
                            </select>
                        </div>
    </td>
</tr>
{/data.PRODUCT_TURNOVER_DATA}

数据:

"data": {
      "PRODUCT_TURNOVER_DATA": [
        {
          "ID_PRODUCT_TURNOVER": 4,
          "DATE_TURN": "2015-12-29T21:00:00.000Z",
          "ID_TYPE_TURN": 2,

        }
      ],
     "SPR_TYPE_TURN_DATA": [
        {
          "ID_TYPE_TURN": 1,
          "NAME_TYPE_TURN": "Передано в составе УТАС",
          "ACC_OPT": 1
        },
        {
          "ID_TYPE_TURN": 2,
          "NAME_TYPE_TURN": "Получено от контрагента для ревизии",
          "ACC_OPT": -1
        }]

平等标准

PRODUCT_TURNOVER_DATA.ID_TYPE_TURN == SPR_TYPE_TURN_DATA.ID_TYPE_TURN 

您可以使用 {@eq} 助手来比较这两个值。

<option value="{.ID_TYPE_TURN}" {@eq key=PRODUCT_TURNOVER_DATA[0].ID_TYPE_TURN value=.ID_TYPE_TURN}selected='selected'{/eq}>{.NAME_TYPE_TURN}</option>