<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
<head>
    <script th:replace="common/head"></script>
    <!-- 省市区样式 -->
    <link rel="stylesheet" th:href="@{'/layui/lay/mymodules/region.css'}">
    <style>
        .layui-layer.alert_content .layui-layer-content {
            padding: 0;
        }

        .layui-layer.alert_content .layui-layer-btn {
            padding: 0 30px 12px;
        }

        .xm-toolbar .toolbar-tag {
            width: 100%;
            display: flex;
            justify-content: center;
            background-color: #1E9FFF !important;
            color: #fff !important;
        }
    </style>
</head>

<body style="position: absolute;top:0;bottom: 0;left:0;right: 0;">
<div class="layui-fluid">
    <div class="layui-card">
        <!-- 查询条件 -->
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding:0;">
            <div class="layui-form-item border-b">
                <div class="layui-inline">
                    <div class="layui-form-item">
                        <label class="layui-form-label">选择地区</label>
                        <div class="layui-input-block" id="region_body">
                            <input type="hidden"  name="regionProvince" />
                            <input type="hidden"  name="regionCity" />
                            <input type="hidden"  name="regionArea" />
                            <input type="text" id="region" readonly="readonly" placeholder="请选择" autocomplete="off" class="layui-input" />
                            <div th:replace="common/region"></div>
                        </div>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">小区名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">设备名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="device_name" placeholder="请输入设备名称" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">设备序列号</label>
                    <div class="layui-input-block">
                        <input type="text" name="serial_number" placeholder="请输入设备序列号" autocomplete="off"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">设备版本范围</label>
                    <div id="start_version" class="layui-input-inline" style="width: 175px;">
                        <input id="start_version_id" type="hidden"/>
                    </div>
                    <div class="layui-form-mid">-</div>
                    <div id="end_version" class="layui-input-inline" style="width: 175px;">
                        <input id="end_version_id" type="hidden" />
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">设备状态</label>
                    <div class="layui-input-block">
                        <select id="on_line_status">
                            <option value="" selected>全部</option>
                            <option value="1">在线</option>
                            <option value="0">离线</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline" style="margin-left: 38px;">
                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="query">查询</button>
                    <button class="layui-btn  layui-btn-primary" lay-submit lay-filter="reset">重置</button>
                </div>
            </div>

            <!-- 表格+头部按钮 -->
            <div class="layui-card-body" style="padding:0;">
                <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="update">更新</button>
                <table id="data_entity_table" lay-filter="data_table_event"></table>
                <input type="hidden" id="id" th:value="${id}" />
                <input type="hidden" id="deviceFactory" th:value="${deviceFactory}" />
                <input type="hidden" id="deviceModelNumber" th:value="${deviceModelNumber}" />
                <input type="hidden" id="version" th:value="${version}" />
            </div>
        </div>
    </div>
</div>
<!--/*@thymesVar id="onLineUser" type="com.sptg.permissions.api.entity.Account"*/-->
<input type="hidden" id="user_org_id" th:value="${onLineUser.orgId}"/>
</div>

<!-- javascript -->
<script type="text/javascript" th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
<script type="text/javascript">
    layui.config({
        base: '/' //静态资源所在路径
    });
</script>
<script type="text/javascript" th:src="@{'/js/device/device-app-package-upgrade.js'}" charset="utf-8"></script>

<!-- 设备类型 -->
<!--<script type="text/html" id="device_type">
    {{#  if(d.unitId!=null){ }}
    <span>单元机</span>
    {{# } else{ }}
    <span>小区机</span>
    {{#  } }}
</script>-->
<script type="text/html" id="device_type">
    {{#  if(d.unitId!=null){ }}
    <span>单元机</span>
    {{# }else{  }}
    <span>小区机</span>
    {{# } }}
</script>

<!-- 设备朝向 -->
<script type="text/html" id="device_is_out">
    {{#  if(d.isOut == 1){ }}
    <span>进</span>
    {{# } else if(d.isOut == 2){ }}
    <span>出</span>
    {{#  } }}
</script>

<!-- 是否支持人脸识别 -->
<script type="text/html" id="have_face">
    {{#  if(d.haveFace == 1){ }}
    <span class="layui-badge layui-bg-green">支持</span>
    {{# } else if(d.haveFace == 2){ }}
    <span class="layui-badge layui-bg-black">不支持</span>
    {{#  } }}
</script>

<!-- 流量卡卡号 -->
<script type="text/html" id="flowCard">
    {{#  if(d.flowCardId != null && d.flowCard){ }}
    <span class="layui-badge layui-bg-blue">{{d.flowCard.cardNum}}</span>
    {{# } else { }}
    <span class="layui-badge layui-bg-black">未绑定</span>
    {{#  } }}
</script>

</body>

</html>
