1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- {% 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="form-group-head">{{v['name']}}</div>
- <ul>
- {% for value in v['device'] %}
- {% if value['hardware_type'] == 5 %}
- <li class="form-input">
- <a href="javascript:;">
- <i class="ico ico-6"></i><span>{{value['name']}}</span><p>{% if value['value'] == '1' %}<span>连接</span>{% else %}<span class="error">断开</span>{% end %}</p>
- </a>
- </li>
- {% elif value['hardware_type'] == 4 %}
- {% if value['value'] %}
- {%set v = float(value['value']) %}
- {% else %}
- {%set v = 0 %}
- {%set value['value'] = 0 %}
- {% end %}
- <li class="form-input">
- <a href="/device/update_device?type={{data['input']['type']}}&id={{data['input']['id']}}&device_id={{value['id']}}">
- <i class="ico ico-7"></i><span>{{value['name']}}</span><p><span>{{value['value']}}{{value['unit']}}</span><i>></i></p>
- </a>
- </li>
- {% elif value['hardware_type'] == 2 %}
- {% if value['value'] %}
- {%set v = float(value['value']) %}
- {% else %}
- {%set v = 0 %}
- {%set value['value'] = 0 %}
- {% end %}
- <li class="form-input">
- <a href="/device/update_device?type={{data['input']['type']}}&id={{data['input']['id']}}&device_id={{value['id']}}">
- <span>{{value['name']}}<b class="txt-block">{{value['value']}}</b><u class="degree">{{value['unit']}}</u></span><p>{% if value['status'] == False %}<span class="disable">离线</span>{% elif value['max'] != None and value['max'] and v > value['max'] %}<span class="error">上限超标</span>{% elif value['min'] != None and value['min'] and v < value['min'] %}<span class="error">下限超标</span>{% else %}<span>正常</span>{% end %}<i>></i></p>
- </a>
- </li>
- {% elif value['hardware_type'] == 3 and value['unit'] == 'button' %}
- <li class="form-input buttons">
- {%set layer = '' %}
- {% if value['exp'] != '-1' and value['exp'] != '1' and value['exp'] != 'None' and value['exp'] %}
- {%set layer = value['exp'] %}
- {% end %}
- <label><span>{{value['name']}}</span>
- {% if value['status'] == False %}<span class="disable">离线</span>{% end %}
- <p>
- <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 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 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 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>
- </p>
- </label>
-
- </dt>
- </li>
- {% elif value['hardware_type'] == 3 %}
- <li class="form-input">
- {%set layer = '' %}
- {% if value['exp'] != '-1' and value['exp'] != '1' and value['exp'] != 'None' and value['exp'] %}
- {%set layer = value['exp'] %}
- {% end %}
- <label><span>{{value['name']}}</span>
- {% if value['status'] == False %}<span class="disable">离线</span>{% end %}
- <p><a 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--left hint--error hint--always {% end %} {% if value['exp'] != '-1' and value['exp'] != '1' %}data-layer{% end %} btn btn-switch {% if value['exp'] == '-1' %}loading{% end %} {% if value['value'] == '1' %}open{% end %} {% if value['status'] == False %}disabled{% end %}"><i></i></a></p></label>
- </li>
- {% end %}
- {% end %}
- </ul>
- {% end %}
- {% end %}
- {% end %}
|