<?php /*a:4:{s:70:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\tags\index.html";i:1715617489;s:74:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\common\default.html";i:1715617489;s:71:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\common\meta.html";i:1715617489;s:73:"E:\phpstudy_pro\WWW\data\hkcms\template\admin\adminlte\common\script.html";i:1715617489;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="csrf-token" content="<?php echo token(); ?>">

    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="never">
<meta name="renderer" content="webkit">
<title><?php echo $site['title']; ?> - <?php echo lang("Backstage panel"); ?></title>

<link rel="Shortcut Icon" href="<?php echo $site['favicon']; ?>?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>" type="image/x-icon" />

<!-- Font Awesome 5.13.0 字体图标库 -->
<link rel="stylesheet" href="/static/libs/fontawesome-free/css/all.min.css">
<!-- AdminLTE v3.2.0 | Bootstrap v4.6.0 CSS框架 -->
<link rel="stylesheet" href="/static/module/admin/adminlte/css/adminlte.css?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>">
<link rel="stylesheet" href="/static/module/admin/adminlte/css/common.css?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>">

<script type="text/javascript">
    window.Config = <?php echo json_encode($site); ?>;
    window.Lang = <?php echo json_encode($tempLang); ?>;
    window.Tpl = <?php echo json_encode($Tpl); ?>;
</script>

    <style>
        html,body,.wrapper {
            height: 100% !important;
        }
        .content {
            min-height: 100%;
            height: auto;
            padding-bottom: 20px;
            background-color: #f2f3f5;
        }
        .operatePage .card-footer {
            width: 100%;
            position: fixed;
            bottom: 0;
            z-index: 99;
        }
    </style>

    {__STYLE__}

</head>
<body class="sidebar-mini layout-top-nav overlayScrollbars" >

    <?php if(empty($popup)): ?>
    <!-- 子页 -->
    <div class="wrapper">
        <div class="content">
            <div class="container-fluid" style="padding-top: 16px">
                <div class="card card-tabs">
    <div class="card-header">
        <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
            <li class="nav-item">
                <a class="nav-link active" id="group-tab" data-toggle="pill" href="#pane-tab-1" role="tab" aria-selected="false"><?php echo lang('List'); ?></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" id="group-tab2" data-toggle="pill" href="#pane-tab-2" role="tab" aria-selected="false"><?php echo lang('Reinitialize'); ?></a>
            </li>
        </ul>
    </div>
    <div class="card-body">
        <div class="tab-content" id="custom-tabs-three-tabContent">
            <div class="tab-pane fade active show" id="pane-tab-1" role="tabpanel">
                <div class="filter-panel d-none">
                    <form action="" method="get" class="frm-filter">
                        <div class="row">
                            <div class="col-xl-3 col-lg-4 col-md-4 col-sm-6 col-xs-12">
                                <div class="form-group">
                                    <label class="row-form-label"><?php echo lang("Title"); ?></label>
                                    <input type="text" class="form-control" name="title" placeholder="<?php echo lang("Title"); ?>" data-op="like %...%">
                                </div>
                            </div>
                            <div class="col-xl-3 col-lg-4 col-md-4 col-sm-6 col-xs-12">
                                <div class="form-group">
                                    <input type="submit" class="btn btn-primary " value="<?php echo lang('Search'); ?>">
                                    <input type="reset" class="btn btn-default ml-2" value="<?php echo lang('Reset'); ?>">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <div id="toolbar" class="toolbar">
                    <?php echo build_toolbar('refresh,add,del'); ?>

                    <button type="button" class="btn btn-default" data-toggle="open" data-url="<?php echo url('/tags/config'); ?>" data-title="<?php echo __('TAG config'); ?>"><i class="fas fa-cog"></i> <?php echo __('TAG config'); ?></button>
                    <a target="_blank" class="btn btn-default" href="<?php echo url('index:/tags/index'); ?>"><i class="fa fa-external-link-alt"></i> <?php echo __('TAG Homepage'); ?></a>
                </div>
                <table id="table"
                       data-edit="<?php if(has_rule('edit')): ?><?php echo url('/tags/edit'); ?><?php endif; ?>"
                       data-del="<?php if(has_rule('del')): ?><?php echo url('/tags/del'); ?><?php endif; ?>"
                       data-batches="<?php if(has_rule('batches')): ?><?php echo url('/tags/batches'); ?><?php endif; ?>"
                ></table>
            </div>
            <div class="tab-pane fade" id="pane-tab-2" role="tabpanel">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-default-warning alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <h5><i class="icon fas fa-exclamation-triangle"></i> <?php echo lang('Warning'); ?>!</h5>
                            <?php echo lang('This operation will clear the original data and recreate it. This operation cannot be restored!'); ?>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group row">
                            <label for="frm-category_id" class="col-sm-2 col-12 col-form-label"><?php echo lang("Model list"); ?>：</label>
                            <div class="col-sm-8 col-12">
                                <select id="frm-category_id" class="form-control">
                                    <option value="0"><?php echo lang('All'); ?></option>
                                    <?php if(is_array($models) || $models instanceof \think\Collection || $models instanceof \think\Paginator): $i = 0; $__LIST__ = $models;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                                    <option value="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></option>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="row">
                            <label for="frm-category_id" class="col-sm-2 col-form-label">&nbsp;</label>
                            <div class="col-sm-8">
                                <button type="button" class="btn btn-primary btn-submit"><?php echo lang('Submit'); ?></button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{block:script}
<script>
    require(['admin','table'], function (admin,cmsTable) {
        $(function () {
            var table = cmsTable.init({
                url: "<?php echo url('/tags/index'); ?>",
                search: false,
                escape: false,
                sortName:'weigh',
                customFilter: true,
                contentLangSw: true,
                columns: [{
                    field: 'state',
                    checkbox: true,
                },{
                    field: 'weigh',
                    title: '<?php echo lang("Weigh"); ?>',
                    formatter: cmsTable.formatter.txtEditBtn,
                    events: cmsTable.events.txtEditBtn
                },{
                    field: 'id',
                    title: 'ID'
                },{
                    field: 'title',
                    title: '<?php echo lang("Title"); ?>',
                    formatter: function (value,row,index) {
                        return '<a href="'+row['url']+'" class="text-primary" target="_blank">'+value+'</a>';
                    }
                },{
                    field: 'seo_title',
                    title: '<?php echo lang("SEO title"); ?>',
                    formatter: cmsTable.formatter.textBox,
                    textLength: 10,
                    events: cmsTable.events.textBoxBtn,
                    visible: false
                },{
                    field: 'seo_keywords',
                    title: '<?php echo lang("SEO keywords"); ?>',
                    formatter: cmsTable.formatter.textBox,
                    textLength: 10,
                    events: cmsTable.events.textBoxBtn,
                    visible: false
                },{
                    field: 'seo_description',
                    title: '<?php echo lang("SEO description"); ?>',
                    formatter: cmsTable.formatter.textBox,
                    textLength: 10,
                    events: cmsTable.events.textBoxBtn,
                    visible: false
                },{
                    field: 'total',
                    title: '<?php echo lang("Total"); ?>',
                },{
                    field: 'views',
                    title: '<?php echo lang("View"); ?>',
                },{
                    field: 'autolink',
                    title: '<?php echo lang("Auto link"); ?>',
                    events: cmsTable.events.switchBtn,
                    formatter: cmsTable.formatter.switchBtn
                },{
                    field: 'create_time',
                    title: '<?php echo lang("Create time"); ?>',
                },{
                    field: 'update_time',
                    title: '<?php echo lang("Update time"); ?>',
                    visible: false
                },{
                    field: 'operate',
                    title: '<?php echo lang("Operate"); ?>',
                    formatter: cmsTable.formatter.operate,
                    events: cmsTable.events.operate
                }]});

            /**
             * 重置
             * @param id
             * @param page
             */
            function reset(id, page)
            {
                $.ajax({
                    url: '<?php echo url("/tags/reset"); ?>?id='+id+'&page='+page,
                    async: true,
                    success: function (e) {
                        if (e.code == 200) {
                            page = page+1;
                            if (page>e.data.last_page) {
                                layer.close(layerSt);
                                item = item + 1;
                                if ($('#frm-category_id').val()==0 && item<$('#frm-category_id option').length) {
                                    layerSt = layer.msg('正在重置: '+$('#frm-category_id option').eq(item).text(), {icon: 16,shade: 0.3,time: false});
                                    reset($('#frm-category_id option').eq(item).val(), 1);
                                    return true;
                                }
                                layer.msg(e.msg, {time: 1000}, function (e) {
                                    table.bootstrapTable('refresh');
                                });
                                return false;
                            }
                            reset(id, page);
                        } else {
                            layer.msg(e.msg, {time: 1000, icon: 2});
                        }
                    }
                })
            }

            var layerSt;
            var item = 0;
            $('.btn-submit').click(function (e) {
                var id = $('#frm-category_id').val();
                item = 1;
                if (id==0) {
                    layerSt = layer.msg('正在重置: '+$('#frm-category_id option').eq(item).text(), {icon: 16,shade: 0.3,time: false});
                }
                reset($('#frm-category_id option').eq(item).val(), 1);
            });
        })
    })
</script>
{/block:script}
            </div>
        </div>
    </div>

    <?php else: ?>
    <div class="operatePage">
        <div class="card card-tabs">
    <div class="card-header">
        <ul class="nav nav-tabs" id="custom-tabs-three-tab" role="tablist">
            <li class="nav-item">
                <a class="nav-link active" id="group-tab" data-toggle="pill" href="#pane-tab-1" role="tab" aria-selected="false"><?php echo lang('List'); ?></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" id="group-tab2" data-toggle="pill" href="#pane-tab-2" role="tab" aria-selected="false"><?php echo lang('Reinitialize'); ?></a>
            </li>
        </ul>
    </div>
    <div class="card-body">
        <div class="tab-content" id="custom-tabs-three-tabContent">
            <div class="tab-pane fade active show" id="pane-tab-1" role="tabpanel">
                <div class="filter-panel d-none">
                    <form action="" method="get" class="frm-filter">
                        <div class="row">
                            <div class="col-xl-3 col-lg-4 col-md-4 col-sm-6 col-xs-12">
                                <div class="form-group">
                                    <label class="row-form-label"><?php echo lang("Title"); ?></label>
                                    <input type="text" class="form-control" name="title" placeholder="<?php echo lang("Title"); ?>" data-op="like %...%">
                                </div>
                            </div>
                            <div class="col-xl-3 col-lg-4 col-md-4 col-sm-6 col-xs-12">
                                <div class="form-group">
                                    <input type="submit" class="btn btn-primary " value="<?php echo lang('Search'); ?>">
                                    <input type="reset" class="btn btn-default ml-2" value="<?php echo lang('Reset'); ?>">
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <div id="toolbar" class="toolbar">
                    <?php echo build_toolbar('refresh,add,del'); ?>

                    <button type="button" class="btn btn-default" data-toggle="open" data-url="<?php echo url('/tags/config'); ?>" data-title="<?php echo __('TAG config'); ?>"><i class="fas fa-cog"></i> <?php echo __('TAG config'); ?></button>
                    <a target="_blank" class="btn btn-default" href="<?php echo url('index:/tags/index'); ?>"><i class="fa fa-external-link-alt"></i> <?php echo __('TAG Homepage'); ?></a>
                </div>
                <table id="table"
                       data-edit="<?php if(has_rule('edit')): ?><?php echo url('/tags/edit'); ?><?php endif; ?>"
                       data-del="<?php if(has_rule('del')): ?><?php echo url('/tags/del'); ?><?php endif; ?>"
                       data-batches="<?php if(has_rule('batches')): ?><?php echo url('/tags/batches'); ?><?php endif; ?>"
                ></table>
            </div>
            <div class="tab-pane fade" id="pane-tab-2" role="tabpanel">
                <div class="row">
                    <div class="col-md-12">
                        <div class="alert alert-default-warning alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <h5><i class="icon fas fa-exclamation-triangle"></i> <?php echo lang('Warning'); ?>!</h5>
                            <?php echo lang('This operation will clear the original data and recreate it. This operation cannot be restored!'); ?>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group row">
                            <label for="frm-category_id" class="col-sm-2 col-12 col-form-label"><?php echo lang("Model list"); ?>：</label>
                            <div class="col-sm-8 col-12">
                                <select id="frm-category_id" class="form-control">
                                    <option value="0"><?php echo lang('All'); ?></option>
                                    <?php if(is_array($models) || $models instanceof \think\Collection || $models instanceof \think\Paginator): $i = 0; $__LIST__ = $models;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                                    <option value="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></option>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="row">
                            <label for="frm-category_id" class="col-sm-2 col-form-label">&nbsp;</label>
                            <div class="col-sm-8">
                                <button type="button" class="btn btn-primary btn-submit"><?php echo lang('Submit'); ?></button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{block:script}
<script>
    require(['admin','table'], function (admin,cmsTable) {
        $(function () {
            var table = cmsTable.init({
                url: "<?php echo url('/tags/index'); ?>",
                search: false,
                escape: false,
                sortName:'weigh',
                customFilter: true,
                contentLangSw: true,
                columns: [{
                    field: 'state',
                    checkbox: true,
                },{
                    field: 'weigh',
                    title: '<?php echo lang("Weigh"); ?>',
                    formatter: cmsTable.formatter.txtEditBtn,
                    events: cmsTable.events.txtEditBtn
                },{
                    field: 'id',
                    title: 'ID'
                },{
                    field: 'title',
                    title: '<?php echo lang("Title"); ?>',
                    formatter: function (value,row,index) {
                        return '<a href="'+row['url']+'" class="text-primary" target="_blank">'+value+'</a>';
                    }
                },{
                    field: 'seo_title',
                    title: '<?php echo lang("SEO title"); ?>',
                    formatter: cmsTable.formatter.textBox,
                    textLength: 10,
                    events: cmsTable.events.textBoxBtn,
                    visible: false
                },{
                    field: 'seo_keywords',
                    title: '<?php echo lang("SEO keywords"); ?>',
                    formatter: cmsTable.formatter.textBox,
                    textLength: 10,
                    events: cmsTable.events.textBoxBtn,
                    visible: false
                },{
                    field: 'seo_description',
                    title: '<?php echo lang("SEO description"); ?>',
                    formatter: cmsTable.formatter.textBox,
                    textLength: 10,
                    events: cmsTable.events.textBoxBtn,
                    visible: false
                },{
                    field: 'total',
                    title: '<?php echo lang("Total"); ?>',
                },{
                    field: 'views',
                    title: '<?php echo lang("View"); ?>',
                },{
                    field: 'autolink',
                    title: '<?php echo lang("Auto link"); ?>',
                    events: cmsTable.events.switchBtn,
                    formatter: cmsTable.formatter.switchBtn
                },{
                    field: 'create_time',
                    title: '<?php echo lang("Create time"); ?>',
                },{
                    field: 'update_time',
                    title: '<?php echo lang("Update time"); ?>',
                    visible: false
                },{
                    field: 'operate',
                    title: '<?php echo lang("Operate"); ?>',
                    formatter: cmsTable.formatter.operate,
                    events: cmsTable.events.operate
                }]});

            /**
             * 重置
             * @param id
             * @param page
             */
            function reset(id, page)
            {
                $.ajax({
                    url: '<?php echo url("/tags/reset"); ?>?id='+id+'&page='+page,
                    async: true,
                    success: function (e) {
                        if (e.code == 200) {
                            page = page+1;
                            if (page>e.data.last_page) {
                                layer.close(layerSt);
                                item = item + 1;
                                if ($('#frm-category_id').val()==0 && item<$('#frm-category_id option').length) {
                                    layerSt = layer.msg('正在重置: '+$('#frm-category_id option').eq(item).text(), {icon: 16,shade: 0.3,time: false});
                                    reset($('#frm-category_id option').eq(item).val(), 1);
                                    return true;
                                }
                                layer.msg(e.msg, {time: 1000}, function (e) {
                                    table.bootstrapTable('refresh');
                                });
                                return false;
                            }
                            reset(id, page);
                        } else {
                            layer.msg(e.msg, {time: 1000, icon: 2});
                        }
                    }
                })
            }

            var layerSt;
            var item = 0;
            $('.btn-submit').click(function (e) {
                var id = $('#frm-category_id').val();
                item = 1;
                if (id==0) {
                    layerSt = layer.msg('正在重置: '+$('#frm-category_id option').eq(item).text(), {icon: 16,shade: 0.3,time: false});
                }
                reset($('#frm-category_id option').eq(item).val(), 1);
            });
        })
    })
</script>
{/block:script}
    </div>
    <?php endif; ?>

    <script src="/static/libs/require/require.js"></script>
<script src="/static/module/admin/adminlte/js/main.js?v=<?php echo env('APP_DEBUG')?time():$site['version']; ?>"></script>

<!-- // 加载插件JS-->
<?php echo load_js(); ?>



    {__SCRIPT__}
    
</body>
</html>