123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- {% for v in data['list'] %}
- {% if 'device' in v and v['device'] %}
- {%set num=0 %}
- {% for value in v['device'] %}
- {% if value['hardware_type'] not in (6,7) %}
- {%set num=num+1 %}
- {% end %}
- {% end %}
- {% if num > 0 %}
- <div class="pannel">
- <h2>{{v['name']}}</h2>
- <div class="ul3 clearfix">
- {% for value in v['device'] %}
- {% if value['hardware_type'] == 5 %}
- <dl>
- {% if 'noset' not in data %}
- <dd class="controller"></dd>
- {% end %}
- {% if value['value'] == '1' %}
- <dt>连接</dt>
- {% else %}
- <dt>断开</dt>
- {% end %}
- <dd class="tit">{{value['name']}}</dd>
- </dl>
- {% elif value['hardware_type'] == 2 or value['hardware_type'] == 4 %}
- {%set v = float(value['value']) %}
- <dl>
- {% if 'noset' not in data %}
- <dd class="controller">{% if value['status'] == False %}<em class="error">离线</em>{% elif value['max'] != None and v > value['max'] %}<em class="error">上限超标</em>{% elif value['min'] != None and v < value['min'] %}<em class="error">下限超标</em>{% else %}<em>正常</em>{% end %}<a href="javascript:;" onclick="Farm.Page('{{value['typeName']}}限制设置', '/device/update_device?id={{value['id']}}')" class="icons ico-setting"></a>
- </dd>
- {% end %}
- <dt>{{value['value']}}</dt>
- <dd class="tit" {% if 'stat' in data and data['stat'] %}style="cursor: pointer;" onclick="Farm.ShowChart('{{loadUrl}}&device={{value['id']}}')"{% end %}>{{value['name']}}({{value['unit']}})</dd>
- </dl>
- {% elif value['hardware_type'] == 3 and value['unit'] == 'button' %}
- <dl class="button">
- {% if 'noset' not in data %}
- <dd class="controller">{% if value['status'] == False %}<em class="error">离线</em>{% end %}</dd>
- {% end %}
- {%set layer = '' %}
- {% if value['exp'] != '-1' and value['exp'] != '1' and value['exp'] != 'None' and value['exp'] %}
- {%set layer = value['exp'] %}
- {% end %}
- <dt>
- <button {% if layer %}data-hint="{{layer}}"{% end %} onclick="Farm.Button(this, '/device/update', '{{value['id']}}', 1, '#button_down_{{value['id']}}')" id="button_up_{{value['id']}}" class="btn-switch {% if layer and value['cxnum'] in (1,4) %}hint--top hint--error hint--always {% end %} {% if value['exp'] == '-1' and value['cxnum'] in (1,4) %}loading{% end %} {% if value['value'] in ('2','3') %}disabled{% end %} {% if value['value'] in ('1','4') %}open{% end %} {% if value['status'] == False %}disabled{% end %}">升</button>
- <button {% if layer %}data-hint="{{layer}}"{% end %} onclick="Farm.Button(this, '/device/update', '{{value['id']}}', 5)" id="button_stop_{{value['id']}}" class="btn-switch {% if layer and value['cxnum'] == 5 %}hint--top hint--error hint--always {% end %} {% if value['exp'] == '-1' and value['cxnum'] == 5 %}loading{% end %} {% if value['value'] == '5' %}open{% end %} {% if value['status'] == False %}disabled{% end %}">停</button>
- <button {% if layer %}data-hint="{{layer}}"{% end %} onclick="Farm.Button(this, '/device/update', '{{value['id']}}', 2, '#button_up_{{value['id']}}')" id="button_down_{{value['id']}}" class="btn-switch {% if layer and value['cxnum'] in (2,3) %}hint--top hint--error hint--always {% end %} {% if value['exp'] == '-1' and value['cxnum'] in (2,3) %}loading{% end %} {% if value['value'] in ('1','4') %}disabled{% end %} {% if value['value'] in ('2','3') %}open{% end %} {% if value['status'] == False %}disabled{% end %}">降</button>
- </dt>
- <dd class="tit">{{value['name']}}</dd>
- </dl>
- {% elif value['hardware_type'] == 3 %}
- <dl>
- {% if 'noset' not in data %}
- <dd class="controller">{% if value['status'] == False %}<em class="error">离线</em>{% end %}</dd>
- {% end %}
- {%set layer = '' %}
- {% if value['exp'] != '-1' and value['exp'] != '1' and value['exp'] != 'None' and value['exp'] %}
- {%set layer = value['exp'] %}
- {% end %}
- <dt>
- <p href="javascript:;" {% if layer %}data-hint="{{layer}}"{% end %} data-status="{% if value['value'] == '1' %}2{% else %}1{% end %}" onclick="Farm.Switch(this, '/device/update', '{{value['id']}}')" class="{% if layer %}hint--top hint--error hint--always {% end %} {% if value['exp'] != '-1' and value['exp'] != '1' %}data-layer{% end %} btn-switch {% if value['exp'] == '-1' %}loading{% end %} {% if value['value'] == '1' %}open{% end %} {% if value['status'] == False %}disabled{% end %}"><i></i></p>
- </dt>
- <dd class="tit">{{value['name']}}</dd>
- </dl>
- {% end %}
- {% end %}
- </div>
- </div>
- {% end %}
- {% end %}
- {% end %}
|