condition.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <input type="hidden" name="id" id="id" value="{% if 'info' in data and data['info'] and 'id' in data['info'] and data['info']['id'] > 0 %}{{data['info']['id']}}{% end %}" />
  2. <input type="hidden" name="update_loop" id="update_loop" value="{% if 'info' in data and data['info'] and 'loop' in data['info'] and data['info']['loop'] %}{{data['info']['loop']}}{% end %}" />
  3. <div class="form">
  4. <label><span>设备条件:</span>
  5. <select id="update_gateway" onchange="device($(this))" name="update_gateway_id" class="w138">
  6. {% for v in data['gateway'] %}
  7. <option value="{{v['id']}}" {% if 'info' in data and data['info'] and 'gateway_id' in data['info'] and data['info']['gateway_id'] == v['id'] %}selected{% end %}>{{v['name']}}</option>
  8. {% end %}
  9. </select>
  10. <select id="update_device" name="update_device_id" class="w138">
  11. {% for v in data['device_list'] %}
  12. <option value="{{v['id']}}" {% if 'info' in data and data['info'] and 'device_id' in data['info'] and data['info']['device_id'] == v['id'] %}selected{% end %}>{{v['name']}}</option>
  13. {% end %}
  14. </select>
  15. </label>
  16. <div class="lavel"><span>条件判断:</span>
  17. <select id="update_condition" name="update_condition" class="w138">
  18. {% for v in data['condition'] %}
  19. <option value="{{v['id']}}" {% if 'info' in data and data['info'] and 'condition' in data['info'] and data['info']['condition'] == v['id'] %}selected{% end %}>{{v['name']}}</option>
  20. {% end %}
  21. </select>
  22. <input type="text" name="update_value" id="update_value" value="{% if 'info' in data and data['info'] and 'value' in data['info'] and data['info']['value'] %}{{data['info']['value']}}{% end %}" placeholder="判断条件的值" />
  23. </div>
  24. <label><span>执行结果:</span>
  25. <select id="update_oper" name="update_oper">
  26. {% for v in data['opers'] %}
  27. <option value="{{v['id']}}" {% if 'info' in data and data['info'] and 'oper' in data['info'] and data['info']['oper'] == v['id'] %}selected{% end %}>{{v['name']}}</option>
  28. {% end %}
  29. </select>
  30. </label>
  31. <label>
  32. <input type="checkbox" name="update_notice" id="update_notice" value="1" {% if 'info' in data and data['info'] and 'notice' in data['info'] and data['info']['notice'] == True %}checked{% end %} style="width:20px;" />报警提醒
  33. </label>
  34. {%include 'select.html'%}
  35. </div>