index.html 6.48 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>

<div class="row" style="margin: 15px;">
    <div class="col-md-12 well">
        <h4>Available SOAP services: <a href="/webservice" target="_blank">/webservice</a></h4>
        <h4>WSDL: <a href="/webservice/CompanyService?wsdl" target="_blank">/webservice/CompanyService?wsdl</a></h4>
    </div>

    <div class="col-lg-4 col-md-6 col-sm-12">
        <div class="bs-example" data-example-id="panel-without-body-with-table">
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">线路清单</div>
                <div class="panel-body">
                    <p style="color: #ff2727;">
                        屏蔽新老系统的底层数据差异,对外提供统一的数据输出
                    </p>
                    <p>
                        1、使用员工号查询数据时,系统将参考 “线路人员配置” 以确定人员所在线路。
                    </p>
                    <p>
                        2、使用公司编码查询数据时,系统将参考 “线路基础信息” 里的公司编码。
                    </p>
                </div>
                <div class="table-wrap">
                    <table class="table" id="line2SysListTable">
                        <thead>
                        <tr>
                            <th>线路编码</th>
                            <th>线路名称</th>
                            <th>数据来源</th>
                        </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="col-lg-8 col-md-6 col-sm-12">
        <div class="bs-example">
            <div class="panel panel-default">
                <div class="panel-heading">接口调试工具</div>
                <div style="padding: 15px;margin-top: 15px;">
                    <form class="form-inline">
                        <div class="form-group">
                            <label>函数</label>
                            <select class="form-control">
                                <option value="returnCCInfo">returnCCInfo(获取出场班次信息)</option>
                                <option value="returnJCInfo">returnJCInfo(获取进场班次信息)</option>
                            </select>
                        </div>
                        &nbsp;
                        <div class="form-group">
                            <label>公司编码</label>
                            <select class="form-control">
                                <option value="55">55(上南)</option>
                                <option value="22">22(金高)</option>
                                <option value="05">05(杨高)</option>
                                <option value="26">26(南汇)</option>
                            </select>
                        </div>
                        &nbsp;
                        <div class="form-group">
                            <label>日期</label>
                            <input type="date" class="form-control" style="width: 150px;" required>
                        </div>
                        <button type="submit" class="btn btn-primary">获取数据</button>

                        <textarea class="form-control" rows="25" style="width: 100%;margin-top: 25px;"></textarea>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>

<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>