<tpl>


    <form class="layui-form " action="">
        <div class="layui-form-item">
            <label class="layui-form-label">输入框</label>
            <div class="layui-input-block">
                <input type="text" name="title"  placeholder="请输入标题" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码框</label>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="required" 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">选择框</label>
            <div class="layui-input-block">
                <select name="city" lay-verify="required">
                    <option value=""></option>
                    <option value="0">北京</option>
                    <option value="1">上海</option>
                    <option value="2">广州</option>
                    <option value="3">深圳</option>
                    <option value="4">杭州</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">复选框</label>
            <div class="layui-input-block">
                <input type="checkbox" name="like[write]" title="写作">
                <input type="checkbox" name="like[read]" title="阅读" checked>
                <input type="checkbox" name="like[dai]" title="发呆">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开关</label>
            <div class="layui-input-block">

                <input type="checkbox" name="admin_log" lay-skin="switch" lay-text="ON|OFF" lay-filter="admin_log" value="1" title="ON|OFF">

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">单选框</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="男" title="男">
                <input type="radio" name="sex" value="女" title="女" checked>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">文本域</label>
            <div class="layui-input-block">
                <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">上传图片</label>
            <div class="layui-input-block" id="imgboxheadimg">

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">上传图片</label>
            <div class="layui-input-block" id="imgboxheadimg2">

            </div>
        </div>



        <div class="layui-form-item">
            <button class="layui-btn" lay-submit lay-filter="demo2">确认</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>

    </form>


    <script>

        layui.use(['buildItems','form', 'laydate', 'util'], function(){
            /*解析顶部分组选项*/
            var str = [{
                "name": "{$data.name}",
                "title": "上传图片",
                "value": "/static/file/upload/image/20250422/68073d795d609.png",
                "type": "{$data.type}"
            }];
            layui.buildItems.build({
                bid: 'imgboxheadimg',
                url: '',
                map: layui.cache.maps + 'system.upload/',
                gid: 1,
                data:str
            });

            var str = [{
                "name": "{$data2.name}",
                "title": "上传图片",
                "value": "{$data2.value}",
                "type": "{$data2.type}"
            }];
            layui.buildItems.build({
                bid: 'imgboxheadimg2',
                url: '',
                map: layui.cache.maps + 'system.upload/',
                gid: 1,
                data:str
            });

            form=layui.form;
            form.render();
            // 指定开关事件
            form.on('switch(admin_log)', function(data){
                layer.msg('开关 checked：'+ (this.checked ? 'true' : 'false'), {
                    offset: '6px'
                });

            });
        });



    </script>

    <style>
        .layui-card-header.m {
            font-weight: bold;
            color: #aaa;
        }

        /*应用快捷块样式*/
        .console-app-group {
            display: block;
            padding: 16px;
            border-radius: 4px;
            text-align: center;
            background-color: #fff;
            cursor: pointer
        }

        .console-app-group .console-app-icon {
            width: 32px;
            height: 32px;
            line-height: 32px;
            margin-bottom: 6px;
            display: inline-block;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 32px;
            color: #69c0ff
        }

        /*最新动态时间线*/
        .layui-timeline-dynamic .layui-timeline-item {
            padding-bottom: 0
        }

        .layui-timeline-dynamic .layui-timeline-item:before {
            top: 16px
        }

        .layui-timeline-dynamic .layui-timeline-axis {
            width: 9px;
            height: 9px;
            left: 1px;
            top: 7px;
            background-color: #cbd0db
        }

        .layui-timeline-dynamic .layui-timeline-axis.active {
            background-color: #0c64eb;
            box-shadow: 0 0 0 2px rgba(12, 100, 235, .3)
        }

        .dynamic-card-body {
            box-sizing: border-box;
            overflow: hidden
        }

        .dynamic-card-body:hover {
            overflow-y: auto;
            padding-right: 9px
        }
    </style>
    <!-- 正文开始 -->
    <div class="layui-fluid">


        <div class="layui-row layui-col-space15">
            <div class="layui-col-xs12">
                <div class="layui-card">
                    <div class="layui-card-header m">快捷方式</div>
                    <div class="layui-card-body">
                        <div class="layui-row layui-col-space15">
                            <div class="layui-col-sm6" style="padding-bottom:0;">
                                <div class="layui-row layui-col-space15">
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/addon/index">
                                            <i class="console-app-icon layui-icon layui-icon-app"
                                               style="font-size:26px;padding-top:3px;margin-right:6px;"></i>
                                            <div class="console-app-name">插件管理</div>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.setting/build">
                                            <i class="console-app-icon layui-icon layui-icon-set"
                                               style="color:#95de64;"></i>
                                            <div class="console-app-name">设配置项</div>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.setting/index">
                                            <i class="console-app-icon layui-icon layui-icon-component"
                                               style="color:#ff9c6e;"></i>
                                            <div class="console-app-name">管理配置</div>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.menus/index">
                                            <i class="console-app-icon layui-icon layui-icon-list"
                                               style="color:#b37feb;font-size:36px;"></i>
                                            <div class="console-app-name">后台菜单</div>
                                        </a>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-sm6" style="padding-bottom:0;">
                                <div class="layui-row layui-col-space15">
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.roles/index">
                                            <i class="console-app-icon layui-icon layui-icon-group"
                                               style="color:#ffd666;font-size:30px;"></i>
                                            <div class="console-app-name">角色管理</div>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.manager/index">
                                            <i class="console-app-icon layui-icon layui-icon-user"
                                               style="color:#5cdbd3;font-size:30px;"></i>
                                            <div class="console-app-name">用户管理</div>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.database/index">
                                            <i class="console-app-icon layui-icon layui-icon-table"
                                               style="color:#ff85c0;font-size:36px;"></i>
                                            <div class="console-app-name">数据维护</div>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm3">
                                        <a class="console-app-group" href="#/system.filemanage/index">
                                            <i class="console-app-icon layui-icon layui-icon-picture"
                                               style="color:#ffc069;"></i>
                                            <div class="console-app-name">文件管理</div>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row layui-col-space15">
            <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header m">访问量<span
                            class="layui-badge layui-badge-green pull-right">日</span></div>
                    <div class="layui-card-body"><p class="lay-big-font">1028</p>
                        <p>总访问量<span class="pull-right">12008</span></p></div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header m">销售额<span
                            class="layui-badge layui-badge-blue pull-right">月</span></div>
                    <div class="layui-card-body">
                        <p class="lay-big-font"><span style="font-size:26px;line-height:1;"></span>1000</p>
                        <p>总销售额<span class="pull-right">60080</span></p>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header m">订单量<span
                            class="layui-badge layui-badge-red pull-right">周</span></div>
                    <div class="layui-card-body">
                        <p class="lay-big-font">180</p>
                        <p>转化率<span class="pull-right">70%</span></p>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-header m">新增用户<span class="icon-text pull-right" lay-tips="指标说明"
                                                                   lay-direction="4" lay-offset="5px,5px"><i
                            class="layui-icon layui-icon-tips"></i></span>
                    </div>
                    <div class="layui-card-body">
                        <p class="lay-big-font">1 <span style="font-size:24px;line-height:1;"></span></p>
                        <p>总用户<span class="pull-right">2人</span></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6 layui-col-sm6">
                <div class="layui-card">
                    <div class="layui-card-header m">版本信息</div>
                    <div class="layui-card-body">
                        <table class="layui-table layui-text">
                            <colgroup>
                                <col width="90">
                                <col>
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>软件版本</td>
                                <td>Veitool-v{{ layui.cache.version }}&emsp;<a href="https://www.veitool.com/download"
                                                                               target="_black">更新日志</a></td>
                            </tr>
                            <tr>
                                <td>基础框架</td>
                                <td>ThinkPHP-v{:\\think\\App::VERSION} + Layui-v{{ layui.v }}</td>
                            </tr>
                            <tr>
                                <td>开发官方</td>
                                <td><a href="https://www.veitool.com" target="_black">https://www.veitool.com</a></td>
                            </tr>
                            <tr>
                                <td>服务系统</td>
                                <td>{:PHP_OS}</td>
                            </tr>
                            <tr>
                                <td>服务环境</td>
                                <td>{:PHP_SAPI}</td>
                            </tr>
                            <tr>
                                <td>PHP版本</td>
                                <td>{:PHP_VERSION}</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6 layui-col-sm6">
                <div class="layui-card">
                    <div class="layui-card-header m">最近登录</div>
                    <div class="layui-card-body dynamic-card-body mini-bar" style="height:265px;">
                        <ul class="layui-timeline layui-timeline-dynamic">
                            <?php
                            $str = '';
                            $rs = \app\model\system\SystemLoginLog::order("logid desc")->
                            field("username,admin,loginip,logintime,message")->limit(10)->select()->toArray();
                            foreach($rs as $v){
                            $active = $v['admin'] ? '' :' active';
                            $str .= '
                            <li class="layui-timeline-item">';
                                $str .= '<i class="layui-icon layui-timeline-axis'.$active.'"></i>
                                <div class="layui-timeline-content layui-text">
                                    <div class="layui-timeline-title">'.$v['username'].' / '.$v['loginip'].' /
                                        '.$v['message'].'<span class="pull-right">'. date('Y-m-d H:i:s',$v['logintime']).' </span>
                                    </div>
                                </div>
                                ';
                                $str .= '
                            </li>
                            ';
                            }
                            echo $str;
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>