index.html 2.96 KB
<!DOCTYPE html>
<html>
<head>
    <title>调度系统营运数据接口</title>
    <meta charset="utf-8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="/simple_switch/simple.switch.three.css">
    <style>
        .table-wrap {
            height: 500px;
            overflow: auto;
        }

        #line2SysListTable .Switch_FlatRadius .SwitchLine:before {
            content: "老系统";
        }

        #line2SysListTable .Switch_FlatRadius .SwitchLine:after {
            content: "新系统";
        }

        #line2SysListTable .Switch_FlatRadius {
            width: 118px;
        }

        #line2SysListTable .Switch_FlatRadius .SwitchButton {
            width: 52px;
        }

        #line2SysListTable .Switch_FlatRadius .SwitchButton:before {
            left: 18px;
        }

        #line2SysListTable .Switch_FlatRadius .SwitchButton:after {
            left: 30px;
        }

        #line2SysListTable .Switch_FlatRadius.On .SwitchButton {
            left: 60px;
        }
    </style>
</head>

<body>

<script id="line2sys-table-list-temp" type="text/html">
    {{each list as obj i}}
    <tr data-id="{{obj.lineCode}}" data-name="{{obj.lineName}}" {{if obj.new}}class="warning" {{/if}} >
    <td>{{obj.lineCode}}</td>
    <td>{{obj.lineName}}</td>
    <td>
        <input type="checkbox" {{if obj.new}}checked{{/if}} />
    </td>
    </tr>
    {{/each}}
</script>

<script src="http://apps.bdimg.com/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="/assets/js/template.js"></script>
<script src="/simple_switch/simple.switch.min.js"></script>

<script>

    //线路清单
    !function () {
        var f = arguments.callee;
/*        $.get('/line2System/all', function (list) {
            list.sort(function (a, b) {
                return b.new - a.new;
            });
            var htmlStr = template('line2sys-table-list-temp', {list: list});
            $('#line2SysListTable tbody').html(htmlStr);

            $('input[type=checkbox]').simpleSwitch({
                "theme": "FlatRadius"
            });

            $('input[type=checkbox]').on('change', function () {
                var $tr = $(this).parents('tr');
                var data = {
                    lineCode: $tr.data('id'),
                    lineName: $tr.data('name'),
                    new: this.checked
                }

                $.post('/line2System/update', data, function (rs) {
                    var $tr = $('#line2SysListTable tr[data-id=' + rs.lineCode + ']');
                    $tr.attr('class', rs.new ? 'warning' : '');
                });
            });
        });*/
    }();

</script>
</body>
</html>