<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <style>
            .layui-form-item {
                margin-bottom: 0;
            }
            .layui-form-text{
                line-height: 38px;
            }
        </style>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <button type="button" lay-submit="" lay-filter="refresh" class="layui-btn layui-btn-primary layui-btn-sm"
                                    style="display:block;margin:0 auto">
                                <i class="layui-icon layui-icon-refresh" style="font-size: 20px"></i>
                            </button>
                            <fieldset class="layui-elem-field">
                                <legend>iot设备详情</legend>
                                <div class="layui-field-box">
                                    <div class="layui-form-item">
                                        <input type="hidden" name="id" th:value="${iotDevice.id}" />
                                        <label class="layui-form-label"><span>设备sn号：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_id}"></span></div>
                                        <label class="layui-form-label"><span>设备名称：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_name}"></span></div>
                                        <label class="layui-form-label"><span>厂商名：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.manufacturer}"></span></div>
                                        <label class="layui-form-label"><span>设备类型：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_type}"></span></div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>电量(%)：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.electric_quantity}?${iotDevice.electric_quantity}:(${iotDevice.battery_value}?${iotDevice.battery_value}:'')"></span></div>
                                        <label class="layui-form-label"><span>心跳周期(小时/h)：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.heartbeat_time}?${iotDevice.heartbeat_time}:''"></span></div>
                                        <label class="layui-form-label"><span>信号强度：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.signal_intensity}?${iotDevice.signal_intensity}:(${iotDevice.signalPower}?${iotDevice.signalPower}:'')"></span></div>
                                        <label class="layui-form-label"><span>温度(℃)：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.temperature}?${iotDevice.temperature}:''"></span></div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>上线状态：</span></label>
                                        <div class="layui-input-inline" th:switch="${iotDevice.defense_status}">
                                            <span class="layui-badge layui-bg-green" style="margin-top: 10px;" th:case="1">已上线</span>
                                            <span class="layui-badge layui-bg-black" style="margin-top: 10px;" th:case="2">未上线</span>
                                            <span class="layui-form-text" th:case="*"></span>
                                        </div>
                                        <label class="layui-form-label"><span>设备名称：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_type}"></span></div>
                                        <label class="layui-form-label"><span>设备类型名称：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.type_name}"></span></div>
                                        <label class="layui-form-label"><span>设备状态：</span></label>
                                        <div class="layui-input-inline" th:switch="${iotDevice.status}">
                                            <span class="layui-badge layui-bg-green" style="margin-top: 10px;" th:case="1">正常</span>
                                            <span class="layui-badge layui-bg-orange" style="margin-top: 10px;" th:case="2">告警</span>
                                            <span class="layui-badge layui-bg-red" style="margin-top: 10px;" th:case="3">失联</span>
                                            <span class="layui-badge layui-bg-black" style="margin-top: 10px;" th:case="4">停用</span>
                                            <span class="layui-badge layui-bg-blue" style="margin-top: 10px;" th:case="5">待布防</span>
                                            <span class="layui-form-text" th:case="*"></span>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>经纬度：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.latitude_longitude}?${iotDevice.latitude_longitude}:''"></span></div>
                                        <label class="layui-form-label"><span>安装位置：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_install_address}?${iotDevice.device_install_address}:''"></span></div>
                                        <label class="layui-form-label"><span>区域位置：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.dist_locate}?${iotDevice.dist_locate}:''"></span></div>
                                        <label class="layui-form-label"><span>设备分组：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.tag}?${iotDevice.tag}:''"></span></div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>设备型号：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_specld}?${iotDevice.device_specld}:''"></span></div>
                                        <label class="layui-form-label"><span>设备型号名称：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.device_specname}?${iotDevice.device_specname}:''"></span></div>
                                        <label class="layui-form-label"><span>通信协议：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.protocol_type}?${iotDevice.protocol_type}:''"></span></div>
                                        <label class="layui-form-label"><span>人员ID：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.person_id}?${iotDevice.person_id}:''"></span></div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span>同步更新时间：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.lastSyncDate}?${#dates.format(iotDevice.lastSyncDate, 'yyyy-MM-dd HH:mm:ss')}:''"></span></div>
                                        <label class="layui-form-label"><span>心跳上报时间：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.lastHeartbeatDate}?${#dates.format(iotDevice.lastHeartbeatDate, 'yyyy-MM-dd HH:mm:ss')}:''"></span></div>
                                        <label class="layui-form-label"><span>设备状态变更上报时间：</span></label>
                                        <div class="layui-input-inline"><span class="layui-form-text" th:text="${iotDevice.lastStatusChangeDate}?${#dates.format(iotDevice.lastStatusChangeDate, 'yyyy-MM-dd HH:mm:ss')}:''"></span></div>
                                    </div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <!-- javascript -->
    <script type="text/javascript" th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
    <script type="text/javascript">
        layui.config({
            base: '/' //静态资源所在路径
        });
    </script>


</html>
