<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>设备文件管理</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header">
                <span>设备文件管理</span>
                <div class="layui-btn-group">
                    <button class="layui-btn layui-btn-sm" id="uploadFile">
                        <i class="layui-icon">&#xe67c;</i>上传文件
                    </button>
                    <button class="layui-btn layui-btn-sm layui-btn-normal" id="uploadUpdate">
                        <i class="layui-icon">&#xe67c;</i>上传更新
                    </button>
                </div>
            </div>
            <div class="layui-card-body">
                <!-- 搜索表单 -->
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">设备型号</label>
                            <div class="layui-input-inline">
                                <select name="deviceModel" lay-search>
                                    <option value="">全部</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">文件类型</label>
                            <div class="layui-input-inline">
                                <select name="fileType">
                                    <option value="">全部</option>
                                    <option value="update">更新文件</option>
                                    <option value="normal">普通文件</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn" lay-submit lay-filter="search">
                                <i class="layui-icon">&#xe615;</i> 搜索
                            </button>
                        </div>
                    </div>
                </form>

                <!-- 文件列表 -->
                <table class="layui-table">
                    <thead>
                        <tr>
                            <th>文件名</th>
                            <th>设备型号</th>
                            <th>版本</th>
                            <th>类型</th>
                            <th>大小</th>
                            <th>下载次数</th>
                            <th>上传时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody id="fileList"></tbody>
                </table>
            </div>
        </div>
    </div>

    <!-- 上传表单模板 -->
    <script type="text/html" id="uploadFormTpl">
        <form class="layui-form" style="padding: 20px;">
            <div class="layui-form-item">
                <label class="layui-form-label">设备型号</label>
                <div class="layui-input-block">
                    <select name="deviceModel" lay-verify="required" lay-search>
                        <option value="">请选择设备型号</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文件版本</label>
                <div class="layui-input-block">
                    <input type="text" name="version" required lay-verify="required" 
                        placeholder="请输入文件版本" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文件描述</label>
                <div class="layui-input-block">
                    <textarea name="description" placeholder="请输入文件描述" 
                        class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item" id="updateOptions" style="display:none;">
                <label class="layui-form-label">更新选项</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="forceUpdate" title="强制更新">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选择文件</label>
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" id="selectFile">
                        <i class="layui-icon">&#xe67c;</i>选择文件
                    </button>
                    <div class="layui-inline layui-word-aux" id="selectedFile"></div>
                </div>
            </div>
        </form>
    </script>

    <script src="/static/layui/layui.js"></script>
    <script src="/static/js/upload.js"></script>
</body>
</html> 