【调度系统】广东民航医疗快线调度系统源代码
克樊道人
2024-12-02 61ce8cc6883e5f94e6470141df3484167caf31ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
var apiPane = null;//开放API对象
var pageItems = [];//菜单集合
 
$(document).ready(function(){
    langInitByUrl();
    apiPane = new apiPage();
    loadReadyPage();
});
 
function loadReadyPage() {
    if (typeof lang == "undefined") {
        setTimeout(loadReadyPage, 50);
    } else {
        //加载语言
        loadLang();
        //获取服务器平台信息
        ajaxLoadInformation();
        initApiPageItems();
        loadPage();
    }
}
 
//加载语言
function loadLang() {
    $('#spanHome').text(lang.open_home);
    $('#spanWeb').text(lang.open_webApi);
    $('#spanPhone').text(lang.open_phoneApi);
    $('#spanWindows').text(lang.open_windowsApi);
    $('#H1Title').text(lang.open_phoneApiFile);
    $('#spanApiDesc').text(lang.open_phoneApiDesc);
    document.title = lang.open_phoneApiFile;
}
 
//加载页面
function loadPage() {
    if(!pageItems) {
        setTimeout(loadPage, 50);
    }else {
        loadMainPane();
    }
}
 
//加载主页面
function loadMainPane() {
    var leftContent = '<div class="span3 bs-docs-sidebar">';
    leftContent += '<div class="bs-docs-sidenav">';
    var rightContent = '<div class="span9">';
    for (var i = 0; i < pageItems.length; i++) {
        var pageItem = pageItems[i];
        var title = apiPane.getItemTitle(pageItem.id);
        leftContent += '<a href="#sec-'+ pageItem.name +'" class="nav-header menu-first" data-toggle="collapse" title="'+ title +'">'+ title +'</a>';
        rightContent += apiPane.initRightMainPane(pageItem.name, title);
        if(pageItem.privis && pageItem.privis.length > 0) {
            leftContent += '<ul class="nav nav-list in collapse" id="sec-'+ pageItem.name +'">';
            var privis = pageItem.privis;
            for (var j = 0; j < privis.length; j++) {
                var page = privis[j];
                var title_ = apiPane.getItemTitle(page.id);
                leftContent += '<li><a href="#sec-'+ page.name +'" title="'+ title_ +'"><i class="icon-chevron-right"></i>'+ title_ +'</a></li>';
                rightContent += apiPane.initRightPane(page.id, page.name, title_);
            }
            leftContent += '</ul>';
        }
    }
    leftContent += '</div>';
    leftContent += '</div>';
    rightContent += "</div>";
    $("#mainPane").append(leftContent + rightContent);
    
    
    //加载bootstrap js
    addBootstrapJs();
    
    $(".nav-header.menu-first").on('click',function(){
        var newIndex = $(this).index();
        if(newIndex && oldIndex  != newIndex){
            //关闭以及打开的栏目  其他走框架
            $(".nav.nav-list.in.collapse").each(function(){
                $(this).removeAttr("style");
                $(this).attr("class","nav nav-list collapse");
            });
            oldIndex = newIndex;
        }
    });
}
var oldIndex = 0;
//加载bootstrap js
function addBootstrapJs() {
    loadScript('../../bootstrap/js/bootstrap-v2.3.2.min.js', function() {
        //菜单添加滑动点击事件
        $('[data-spy="scroll"]').each(function () {
           $(this).scrollspy();
        });
        loadScript('../../bootstrap/js/holder.min.js', null);
        loadScript('../../bootstrap/js/application.js', null);
    });
}
 
//初始化页面菜单数组
function initApiPageItems() {
    //android api
    var android = initPriviInfo(6, "android-operate");
    android.privis = [];
    android.privis.push(initPriviInfo(61, "android-login"));//登陆
    pageItems.push(android);
    // ios api
    var ios = initPriviInfo(7, "ios-operate");
    ios.privis = [];
    ios.privis.push(initPriviInfo(71, "ios-login"));//登陆
    pageItems.push(ios);
}
 
//获取数组
function initPriviInfo(id, name) {
    return {id: id, name : name};
}
 
//获取服务器平台信息
function ajaxLoadInformation() {
    //向服务器发送ajax请求
    $.ajax({
        url: 'StandardLoginAction_information.action',
        type:"post",
        data: null,
        cache:false,/*禁用浏览器缓存*/
        dataType:"json",
        success:function(json){
            if(json.result == 0){
                document.title = lang.open_phoneApiFile;
                if (langIsChinese()) {
                    if (json.ChineseMainTitle != null)  {
                        document.title += '-'+ json.ChineseMainTitle;
                        $('#spanTitle').text(json.ChineseMainTitle);
                    }
                    if (json.ChineseCopyright != null) {
                        $("#spanCopyright").html(json.ChineseCopyright);
                    }
                } /*else if (langIsTW()){
                    if (json.TwMainTitle != null)  {
                        document.title += '-'+ json.TwMainTitle;
                        $('#spanTitle').text(json.TwMainTitle);
                    }
                    if (json.TwCopyright != null) {
                        $("#spanCopyright").html(json.TwCopyright);
                    }
                }*/ else {
                    if (json.EnglishMainTitle != null)  {
                        document.title += '-'+ json.EnglishMainTitle;
                        $('#spanTitle').text(json.EnglishMainTitle);
                    }
                    if (json.EnglishCopyright != null) {
                        $("#spanCopyright").html(json.EnglishCopyright);
                    }
                }
            } else {
            
                alert(lang.errException);
            }
        },error:function(XMLHttpRequest, textStatus, errorThrown){
            if (textStatus != "error") {
                //alert(parent.lang.errSendRequired + " errorThrown:" + errorThrown + ",textStatus:" + textStatus);
            }
            
            alert(lang.errException);
        }
    });
}