<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
        <!-- 样式 -->
        <link rel="stylesheet" th:href="@{'/css/permission/community-add.css'}" media="all">
        <style>
            .xm-toolbar .toolbar-tag {
                border-width: 1px;
                border-style: solid;
                border-radius: 2px;
                box-shadow: 0 2px 5px 0 rgba(0,0,0,.1);

                background-color: #f2f2f2;

                position: relative;
                left: 0;
                height: 40px;
                white-space: nowrap;
                transition: all .2s;
                -webkit-transition: all .2s;

                margin: 10px -1px;

                display: inline-block;
                vertical-align: middle;
                font-size: 14px;
                line-height: 40px;
                min-width: 65px;
                padding: 0 15px;
                text-align: center;
                cursor: pointer;
            }
        </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">
                            <div class="layui-form">
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span><span>设备别名:</span></label>
                                    <div class="layui-input-inline">
                                        <input name="alias" th:value="${device.alias}" type="text" lay-verify="required|specialCharacters|length" placeholder="请输入设备别名" autocomplete="off" class="layui-input" />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span><span>设备序列号:</span>
                                    </label>
                                    <!-- 设备序列号 -->
                                    <div class="layui-input-inline">
                                        <input readonly name="serialNumber" th:value="${device.serialNumber}" type="text" lay-verify="required|uniqueSerialNumber|letterAndNumber" placeholder="请输入设备序列号" autocomplete="off" class="layui-input" />
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">提示：只能输入英文字母、数字、-和_</div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">
                                        <span class="must">*</span>
                                        <span>设备厂商:</span>
                                    </label>
                                    <!-- 设备厂商 -->
                                    <div class="layui-input-inline">
                                        <select name="deviceFactory" lay-filter="deviceFactory" lay-verify="required" disabled >
                                            <option value="JVT" th:selected="${device.deviceFactory} == 'JVT'">巨龙</option>
                                            <option value="qinlin" th:selected="${device.deviceFactory} == 'qinlin'">亲邻</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <!-- 设备型号 -->
                                    <label class="layui-form-label"><span class="must">*</span><span>设备型号:</span></label>
                                    <div class="layui-input-inline">
<!--										<div id="device_model_number"></div>-->
                                        <input name="deviceModelNumber" type="text" lay-verify="required" autocomplete="off"
                                               class="layui-input textAlign" th:value="${device.deviceModelNumber}" disabled />
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label"><span class="must">*</span><span>安装位置:</span></label>
                                    <!-- 小区 -->
                                    <div class="layui-input-inline">
                                        <div id="residential_id"></div>
                                        <input name="xqName" type="hidden" />
                                    </div>
                                    <!-- 单元 -->
                                    <div class="layui-input-inline">
                                        <div id="unit_id"></div>
                                        <input name="unitName" type="hidden" />
                                    </div>
                                    <!-- 具体位置 -->
                                    <div class="layui-input-inline">
                                        <div id="install_path_id"></div>
                                        <input name="installPath" type="hidden" />
                                    </div>
                                </div>

                                <!-- 是否启用时间策略 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">
                                        <span>启用策略:</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <input type="radio" name="timeStrategyIsEnable" value="1" title="是" checked>
                                        <input type="radio" name="timeStrategyIsEnable" value="2" title="否">
                                    </div>
                                    <label class="layui-form-label">
                                        <span>设备朝向:</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <input type="radio" name="isOut" value="1" title="进" checked>
                                        <input type="radio" name="isOut" value="2" title="出">
                                    </div>
                                </div>
                                <!-- 备注 -->
                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">备注:</label>
                                    <div class="layui-input-block">
                                        <textarea name="remark" placeholder="请输入内容" class="layui-textarea w500"></textarea>
                                    </div>
                                </div>

                                <!-- 按钮 -->
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-submit lay-filter="entity_submit_event">提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">取消</button>
                                    </div>
                                </div>

                                <input type="hidden" th:value="${device.id}" name="id" />
                                <input type="hidden" th:value="${device.typeNumber}" name="typeNumber" />
                                <input type="hidden" th:value="${device.mqId}" name="mqId" />
                                <input type="hidden" th:value="${device.versionNumber}" name="versionNumber" />
                                <input type="hidden" th:value="${device.haveFace}" name="haveFace" />
                                <input type="hidden" th:value="${device.haveCall}" name="haveCall" />
                                <input type="hidden" th:value="${device.reboot}" name="reboot" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </body>
    <!-- javascript -->
    <!--去掉input type="number"后面的箭头-->
    <style type="text/css">
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
        }
        input[type="number"] {
            -moz-appearance: textfield;
        }
    </style>

    <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-relate.js'}" charset="utf-8"></script>
</html>
