<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
    </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   type="text" lay-verify="required" placeholder="请上传" autocomplete="off" class="layui-input" id="fileName" />
                                    </div>
                                    <div class="layui-input-inline layui-btn-container" style="width: auto;">
                                        <button type="button" class="layui-btn layui-btn-primary" id="fileUploadButton">
                                            <i class="layui-icon"></i>上传文件
                                        </button>
                                        <input name="downLoadUrl" type="hidden" id="downloadUrl" />
                                        <input name="packageMd5" type="hidden" id="packageMd5" />
                                        <a  download="1" id="downloadButton" style="display: none;" target="_blank">
                                        <button class="layui-btn layui-btn-primary"  layadmin-event="avartatPreview" >下载文件</button>
                                        </a>
                                    </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 name="packageName" type="text" lay-verify="required" 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">
                                        <div class="layui-input-inline">
                                            <input name="version" type="text" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" />
                                        </div>
                                    </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="factory"></div>

                                        <!--<select name="deviceFactory" lay-filter="deviceFactory" lay-verify="required">
                                            <option value="">请选择</option>
                                            <option value="dh" th:checked="true">乐主1</option>
                                            <option value="qst">乐主2</option>
                                            <option value="JVT">乐主3</option>
                                        </select>-->
                                    </div>
                                </div>
<!--                                        <div class="layui-input-inline">-->
<!--                                            <input name="deviceFactory" type="text" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" />-->
<!--                                        </div>-->
<!--                                    </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>
                                    </div>
                                </div>
<!--                                <div class="layui-form-item">-->
<!--                                    <label class="layui-form-label">-->
<!--                                        <span class="must">*</span>-->
<!--                                        <span>设备型号:</span>-->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">
                                        <span>版本说明:</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <div class="layui-input-inline">
                                            <textarea name="description" placeholder="请输入" class="layui-textarea w500"></textarea>
                                        </div>
                                    </div>
                                </div>
                                <input id="fastDfsServer" type="hidden" th:value="${fastDfsServer}">
                                <input name="packageType" type="hidden" value="1">
                                <input name="deviceType" type="hidden" value="2">
                                <input name="isForceUpdate" type="hidden" value="1">
                                <input name="isEnable" type="hidden" value="2">
                                <!-- 按钮 -->
                                <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>
                            </div>
                        </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>
    <script type="text/javascript" th:src="@{'/js/device/device-app-package-add.js'}" charset="utf-8"></script>
</html>