1
13693261870
2022-09-16 762f2fb45db004618ba099aa3c0bd89dba1eb843
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
$(function () {
    $("#jqGrid").jqGrid({
        url: restServerBaseURL + 'sys/systeminfo/list',
        datatype: "json",
        colModel: [
            {
                label: '系统名称', name: 'appfullname', index: 'APPFULLNAME', width: 40, align: 'left',
                formatter: function (value, grid, rows, state) {
                    var name = "";
                    var status = rows.sysstatus;
                    var sysaddress = rows.sysaddress;
                    if (rows.version != null) {
                        var appfullname = rows.appfullname;
                        var version = rows.version;
                        name = appfullname + "[" + version + "]";
                    }
                    else {
                        var appfullname = rows.appfullname;
                        name = appfullname;
                    }
                    if (status == 1) {
                        return "<span style='font-size: 14px;cursor:pointer;' onclick='openUrl(\"" + sysaddress + "\")' class=\"label label-success\">" + name + "</span>";
                    } else {
                        return "<span style='font-size: 14px;cursor:pointer;' onclick='openUrl(\"" + sysaddress + "\")' class=\"label label-danger\">" + name + "</span>";
                    }
                }
            },
            {label: '系统地址', name: 'sysaddress', index: 'SYSADDRESS', width: 50, align: 'left'},
            {label: '系统编号', name: 'appid', index: 'APPID', width: 0, key: true, hidden: true},
            {label: '系统分类', name: 'systype', index: 'SYSTYPE', width: 15, align: 'center'},
            {label: '浏览器推荐', name: 'browser', index: 'BROWSER', width: 20, align: 'center'},
            {
                label: '待批复/通过/不通过',name: 'apply', index: 'APPLY', width: 26, sortable: false, align: 'center', formatter: function (value, grid, rows) {
                    // var html ="<div style='width: 36px;height: 24px;float: left;text-align: center;'>"
                    //     +"<a data-toggle=\"modal\" title='申请待批复' data-target=\"#applyModal\" onclick='ShowApplyList(0," + rows.appid + ")' style='cursor: pointer;color: black;line-height: 38px;text-decoration: underline;'>" + rows.applycount + "</a>"
                    //     +"</div><div style='height: 24px;float: left;line-height: 38px;'>/</div>"
                    //     +"<div style='width: 41px;float: left;height: 24px;line-height: 38px;text-align: center;'>"
                    //     +"<a data-toggle=\"modal\" title='批复通过' data-target=\"#applyModal\" onclick='ShowApplyList(1," + rows.appid + ")' style='cursor: pointer;color: black;line-height: 38px;text-decoration: underline;'>" + rows.audityescount + "</a>"
                    //     +"</div><div style='height: 24px;float: left;line-height: 38px;'>/</div>"
                    //     +"<div style='width: 53px;float: left;height: 24px;line-height: 38px;text-align: center;'>"
                    //     +"<a data-toggle=\"modal\" title='批复不通过' data-target=\"#applyModal\" onclick='ShowApplyList(2," + rows.appid + ")' style='cursor: pointer;color: black;line-height: 38px;text-decoration: underline;'>" + rows.auditnocount + "</a>"
                    //     +"</div>";
                    // return html;
                    var html =""
                        +"<a data-toggle=\"modal\" title='申请待批复' data-target=\"#applyModal\" onclick='ShowApplyList(0," + rows.appid + ")' style='cursor: pointer;color: black;text-decoration: underline;'>" + rows.applycount + "</a>"
                        +" / "
                        +"<a data-toggle=\"modal\" title='批复通过' data-target=\"#applyModal\" onclick='ShowApplyList(1," + rows.appid + ")' style='cursor: pointer;color: black;text-decoration: underline;'>" + rows.audityescount + "</a>"
                        +" / "
                        +"<a data-toggle=\"modal\" title='批复不通过' data-target=\"#applyModal\" onclick='ShowApplyList(2," + rows.appid + ")' style='cursor: pointer;color: black;text-decoration: underline;'>" + rows.auditnocount + "</a>"
                        +"";
                    return html;
                }
            },
            {
                label: '操作',
                width: 30,
                sortable: false,
                align: 'center',
                formatter: function (value, grid, rows, state) {
                    var appid = rows.appid, html = "";
                    if (hasPermission('sys:systeminfo:edit')) {
                        html += '<input type="button" id="ziyuan" class="btn btn-primary" value="资源" style="margin-right:5px;padding:3px 6px;" onclick="vm.showZiYuans(' +
                            appid + ')">';
                        html += '<input type="button" id="action"  class="btn btn-warning" value="编辑" style="margin-right:5px;padding:3px 6px;" onclick=vm.update("' + appid + '")>';
                        html += '<input type="button" id="del"  class="btn btn-danger" value="删除" style="padding:3px 6px;" onclick="vm.del(\'' + appid + '\')">';
                    }
                    return html;
                }
            }
        ],
        height: "auto",
        viewrecords: true,
        rowNum: 10,
        //rowList : [10,30,50],
        rownumbers: true,
        rownumWidth: 50,
        autowidth: true,
        multiselect: false,
        pager: "#jqGridPager",
        jsonReader: {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames: {
            page: "page",
            rows: "limit",
            order: "order"
        },
        gridComplete: function () {
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
            //$("#jqGrid").jqGrid('setGridWidth', $("#rapp").width()-0.1);
            // $("#jqGrid_apply").css("width", "182px");//固定列宽
            // $(".jqgfirstrow td:nth-child(7)").css("width", "182px");
        },
        onSortCol: function (index, colindex, sortorder) {
            jQuery("#jqGrid").jqGrid('setGridParam', {
                page: $(".ui-pg-input").val()
            });
        }
    });
    $("#jqGrid").jqGrid('setLabel', 'rn', '序号', {'text-align': 'left'}, '');
    initSelete();
});
 
function action(appid) {
    window.location.href = baseURL + "/admin/modules/sys/resource.html?appid=" + appid;
}
 
function openUrl(url) {
    window.open(url, "_blank");
}
 
var vm = new Vue({
    el: '#rapp',
    data: {
        showList: true,
        title: null,
        systeminfo: {}
    },
    methods: {
        query: function () {
            vm.systeminfo.appfullName = $("#appfullName").val();
            vm.systeminfo.version = $("#version").val();
            vm.systeminfo.systype = $("#systype").val();
            vm.systeminfo.iscaslogin = $("#iscaslogin").val();
            vm.reload();
        },
        add: function () {
            vm.title = "新增";
            vm.systeminfo = {};
            window.open(baseURL + "admin/modules/sys/systeminfo_edit.html?Id=", "_blank");
        },
        admissionadd: function(){
            layer.open({
                type: 2,
                title: "应用系统用户访问授权",
                shadeClose: true,
                area: ["700px", "350px"],
                content: baseURL+"admin/modules/sys/systeminfo_admissionapply.html",
                btn: ['确定 ', '退出'],
                btnAlign: 'c',
                yes: function (index,layero) {
                    var obj = layero.find("iframe")[0].contentWindow;
                    debugger
                    var  sysid=obj.$("#appidName").val();;
                     var applyusername=obj.$("#applyusername").val();
                    if(sysid == ""|| applyusername=="") {
                       alert("应用程序ID或用户id为空!");
                    } else {
                        $.ajax({
                            type: "GET",
                            url: restServerBaseURL + "sys/systeminfoapply/applySystemPermissionForAdmin?appid=" + sysid + "&username=" + applyusername,
                            contentType: "application/json;charset=utf-8",
                            success: function (result) {
                                
                               layer.msg(result.result);
                                debugger;
                                layer.closeAll();
                                vm.query();
                            }
                        });
                    }
                },
                cancel: function () {
                    layer.closeAll();
                }
            });
        },
        update: function (appid) {
            vm.title = "修改";
            window.open(baseURL + "admin/modules/sys/systeminfo_edit.html?Id=" + appid, "_blank");
        },
        saveOrUpdate: function () {
            var url = vm.systeminfo.appid == null ? "sys/systeminfo/save" : "sys/systeminfo/update";
            $.ajax({
                type: "POST",
                url: restServerBaseURL + url,
                contentType: "application/json",
                data: JSON.stringify(vm.systeminfo),
                success: function (r) {
                    if (r.code === 0) {
                        alert('操作成功', function () {
                            vm.reload();
                        });
                    } else {
                        alert(r.msg);
                    }
                }
            });
        },
        del: function (appids) {
            confirm('确定要删除选中的记录?', function () {
                $.ajax({
                    type: "POST",
                    url: restServerBaseURL + "sys/systeminfo/delete",
                    contentType: "application/json",
                    data: "[" + appids + "]",
                    success: function (r) {
                        if (r.code == 0) {
                            alert('操作成功', function () {
                                vm.reload();
                            });
                        } else {
                            alert(r.msg);
                        }
                    }
                });
            });
        },
        getInfo: function (appid) {
            $.get(restServerBaseURL + "sys/systeminfo/info/" + appid, function (r) {
                vm.systeminfo = r.systeminfo;
            });
        },
        reload: function () {
            vm.showList = true;
            var page = $("#jqGrid").jqGrid('getGridParam', 'page');
            //点击查询时,当前页设置为第一页
            $("#jqGrid").jqGrid('setGridParam', {
                postData: {
                    'appfullName': vm.systeminfo.appfullName,
                    'systype': vm.systeminfo.systype,
                    'version': vm.systeminfo.version,
                    'iscaslogin': vm.systeminfo.iscaslogin
                }, page: 1
            }).trigger("reloadGrid");
        },
        refresh: function () {
            vm.showList = true;
            window.location.reload();
        },
        showZiYuans: function (appid) {
            var url = LanCatalogBaseURL + "res/manage/applyrecommend/indexbysystem?appid=" + appid;
            window.open(url, "_blank");
        }
    }
});
 
function initSelete() {
    $.ajax({
        type: "GET",
        url: restServerBaseURL + "sys/fieldvalue/queryListByKey?key=SystemType",
        contentType: "application/json",
        success: function (msg) {
            var sysFieldList = msg.sysFieldList;
            jQuery("#systype").append("<option value='' >全部</option>");
            jQuery.each(sysFieldList, function (i, item) {
                jQuery("#systype").append("<option value=" + item.vcode + ">" + item.vtext + "</option>");
            });
        }
    });
}
 
//排序列表
function ShowOrderList() {
    $.ajax({
        type: "GET",
        url: restServerBaseURL + "sys/systeminfo/queryAllList",
        contentType: "application/json",
        success: function (msg) {
            jQuery("#systeminfo_order").empty();
            var systeminfoList = msg.systeminfoList;
            jQuery.each(systeminfoList, function (i, item) {
                jQuery("#systeminfo_order").append("<option rorder=" + item.orderid + " value=" + item.appid + ">" + item.appfullname + "</option>");
            });
            $("#systeminfo_order").attr("size", 15);
        }
    });
}
 
function UpdateOrder(type) {
    if ($("#systeminfo_order option:selected").length == 0) {
        alert("请选择节点!");
        return false;
    }
    if ($("#systeminfo_order option:selected").length > 1) {
        alert("请选择一个节点!");
        return false;
    }
    if (type == 'up') {//升序
        if ($("#systeminfo_order option:selected").prev().length == 0) {
            alert("已经是最上了!");
            return false;
        } else {
            $('#systeminfo_order option:selected').insertBefore($('#systeminfo_order option:selected').prev());
        }
    } else if (type == 'down') {//降序
        if ($("#systeminfo_order option:selected").next().length == 0) {
            alert("已经是最下了!");
            return false;
        } else {
            $('#systeminfo_order option:selected').insertAfter($('#systeminfo_order option:selected').next());
        }
    }
    else if (type == 'allup') {
        if ($("#systeminfo_order option:selected").prev().length == 0) {
            alert("已经是最上了!");
            return false;
        } else {
            $('#systeminfo_order option:selected').insertBefore($('#systeminfo_order option').first());
        }
    }
    else if (type == 'alldown') {
        if ($("#systeminfo_order option:selected").next().length == 0) {
            alert("已经是最下了!");
            return false;
        } else {
            $('#systeminfo_order option:selected').insertAfter($('#systeminfo_order option').last());
        }
    }
 
}
 
function submitOrder() {
    var appids = "";
    $("#systeminfo_order option").each(function () {
        if (appids != "") appids += ",";
        appids += $(this).attr("value");
    });
    $.ajax({
        type: "POST",
        url: restServerBaseURL + "sys/systeminfo/updateRorder",
        contentType: "application/json",
        data: JSON.stringify({appids: appids}),
        success: function (r) {
            if (r.code === 0) {
                alert('保存成功!');
                ShowOrderList();
                vm.reload();
            }
            else {
                alert(r.msg);
            }
        }
    });
}
 
function ShowApplyList(auditresult, appid) {
    if(auditresult == 0) {
        $("#applyTitle").text("申请列表");
    } else if(auditresult == 1) {
        $("#applyTitle").text("批复通过列表");
    }else {
        $("#applyTitle").text("批复不通过列表");
    }
    $("#applyModal iframe").attr("src", "systeminfo_apply_list.html?auditresult=" + auditresult + "&appid=" + appid);
}
 
function ShowAppAction() {
    layer.open({
        type: 2,
        title: "资源调用情况",
        shadeClose: true,
        area: ["700px", "470px"],
        content: LanCatalogBaseURL + 'res/manage/actionrecord/apptotalcount'
    });
}