@extends('admin/site/side_layout')

@section('header_extend')

@endsection

@section('right')

    <body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">

                    <div class="table-responsive">
                        <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </body>
@endsection
@section('footer_extend')
    <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
    <script>
        var units = {
            openDetail: function (url) {
                window.open(url);
            },
            isHandle: function (taskId, type) {
                layer.confirm('确定?', {icon: 3, title: '是否处理'}, function (index, layero) {
                    layer.close(index);
                    tips.ajax({
                        url: '/admin/flow/isHandle/' + taskId,
                        type: 'post',
                        data: {type: type},
                        tableRefresh: '#table',
                    });
                });
            },
        };

        var config = {};
        config.url = '/admin/flow/notFound/{{$siteId}}';
        config.pageSize = 20;
        config.showColumns = true;
        config.columns = [ //字段
            {
                title: '序号', align: 'center', formatter: function (value, item, index) {
                    return index + 1;
                },
                width: '10px'
            },
            {title: '页面地址', field: 'url', align: 'center', width: '120px'},
            {title: '父级页面', field: 'father_path', align: 'center'},
            {title: 'http状态', field: 'status', align: 'center'},
            {title: '更新时间', field: 'create_time', align: 'center'},
            {
                title: '操作', field: 'id', align: 'center',
                formatter: function (value, row) {
                    var str = '';
                    if (row.is_handle === 1) {
                        str += '<button onclick="units.isHandle(' + row.id + ',0)" class="btn btn-md btn-success" style="background: #2a94e0 !important;border: none">已处理</button>&nbsp;';
                    } else {
                        str += '<button onclick="units.isHandle(' + row.id + ',1)" class="btn btn-md btn-danger" style="background: #f2003c !important;border: none">未处理</button>&nbsp;';
                    }
                    return str;
                }
            }
        ];
        tips.bootstrapTable(config);


    </script>
@endsection