You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
6.1 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<title>AppKey管理</title>
<script type="text/javascript">
var _account_id = $.getSessionUser().account_id;
var _manage_unit_uuid = $.getSessionUser().manageunituuid;
//grid相关
var _gridcode = "platform.portal.saconsole.app_key_grid";
var _gridid = $.getUUID();
//初始化
$(function(){
//初始化grid
var dataParam = getGridQueryParam();
$.grid({
id : _gridid,
containerid : 'layout_grid',
gridcode : _gridcode,
checkbox : false,
checkOnSelect : false,
selectOnCheck : false,
idField:"app_uuid",
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
fitColumns:true, //是否自动填充满
nowrap:false, //自动换行
pagination:true,
formatter: {
command:'formatter_command'
}
,onLoaded:function(){
$.wait_close();
}
});
});
function removeBlank(e) {
if(e.keyCode == 32){
e.preventDefault();
}
}
//format 操作
function formatter_command(value,row,index) {
var str = '<i tilte="修改" class="fa fa-pencil-square-o grid-oper-icon" aria-hidden="true" onclick="btn_modify(\''+ row.app_uuid +'\')"></i>';
str += '<i tilte="删除" class="fa fa-trash-o grid-oper-icon" aria-hidden="true" onclick="btn_delete(\''+ row.app_uuid +'\')"></i>';
return str;
}
function formatter_status(value,row,index) {
return row.status == "0" ? "停用" : "启用";
}
//获取grid查询参数
function getGridQueryParam(){
//组织参数
var dataParam = {
_SRVNAME:'service.portal.appkey',
_SRVMETHOD:'queryAppkeyListByKeywords',
_DATA:$.json2str({
keywords : $("#search_bar").val(),
result_fields:'',
order_fields:'display_order'
}),
_RSTYPE:'grid',
_RSFIELD:'result',
_RSPARAM:$.json2str({pagequery:'1'})
};
return dataParam;
}
//查询
function btn_query(){
//组织参数
var dataParam = getGridQueryParam();
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
function btn_add(){
$.openWin({
id:$.getUUID(),
title:'AppKey-新增',
height:450,
width:750,
url:'platform/portal/saconsole/app_key_edit.jsp',
queryParams:{
actionflag:'add'
},
onClose:function(){
btn_query();
}
});
}
//修改 btn_modify Button
function btn_modify(app_uuid){
$.openWin({
id:$.getUUID(),
title:'AppKey-修改',
height:450,
width:750,
url:'platform/portal/saconsole/app_key_edit.jsp',
queryParams:{
actionflag:'update',
app_uuid : app_uuid
},
onClose:function(){
btn_query();
}
});
}
function btn_srv_add(){
var row = $.grid_getSelected({id : _gridid});
if (!row.app_uuid) {
alert('请选择需要授权的应用!');
return;
}
$.openWin({
id:$.getUUID(),
title:'应用服务授权',
height: 550,
width: 800,
url:'platform/portal/saconsole/app_key_srv.jsp',
queryParams:{
app_uuid : row.app_uuid
},
onClose:function(){
btn_query();
}
});
}
//删除
function btn_delete(app_uuid) {
confirmDialog("是否确认删除?",function(){
//打开旋转
$.wait_open();
//组织参数
var dataParam = {
_SRVNAME:'service.portal.appkey',
_SRVMETHOD:'deleteAppkey',
_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id,
app_uuid : app_uuid
})
};
//加载数据
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:dataParam,
success:function(result) {
//关闭旋转
$.wait_close();
var jres = $.str2json(result);
if (jres.code == "1") { //操作成功
alert(jres.desc);
//删除后重新请求
btn_query();
}else{
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
});
}
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="page-title" style="overflow:hidden">
<div class="page-toolbar" style="padding-bottom: 5px;">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="btn_add()" >新增</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-info-circle'" onclick="btn_srv_add()" >服务授权</a>
</div>
</div>
<div data-options="region:'center',border:false,collapsed:false" >
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'north',border:false,collapsed:false" class="row-1" style="padding:0 10px;overflow:hidden;" >
<form id="search_form" >
<div class="h_layout">
<div>
<div class="inputgroup">
<label>关键字</label>
<div>
<input class="easyui-validatebox" id="search_bar" name="search_bar" placeholder="请输入关键字进行检索"/>
</div>
</div>
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="btn_query()"><i class="fa fa-search" aria-hidden="true"></i><span><span>查询</span></span></a>
</div>
</div>
</form>
</div>
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="padding:0px 10px;" >
</div>
</div>
</div>
</div>
</body>
</html>