$(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'
|
});
|
}
|