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.
 
 
 
 
 
 

279 lines
7.5 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="org.wdk.WDKConstant"%>
<%@ page import="org.wdk.WDKCore"%>
<%@ page import="org.wdk.WDK"%>
<%@ page import="com.noblelift.imp.platform.module.portal.source.SessionUser"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String WDK_ROOT = WDKCore.WDK_ROOT;
SessionUser su = (SessionUser)WDK.getSessionUser(request, response);
WDK.writeSessionUser(out, su);
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<base href="<%=basePath%>" target="_self">
<title>应用云平台-应用注册</title>
<style type="text/css">
</style>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
<script type="text/javascript">
<% if(null==su){%>
$.timeout();
<%}%>
</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">
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus'" onclick="opt_add()">新增</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-copy'" onclick="copyApp()">复制</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'fa fa-gear'" onclick="appFunction()">功能</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 id="conditions" type="text" class="easyui-validatebox" placeholder="" aria-describedby="basic-addon1">
</div>
</div>
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="opt_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>
<script>
var _gridcode = "platform.portal.saconsole.appreggrid";
var _gridid = $.getUUID();
//页面初始化
$(function() {
//初始化查询条件
//查询grid数据
var dataParam = getGridQueryParam();
var gridid = $.grid({
id : _gridid,
containerid : 'layout_grid',
gridcode : _gridcode,
checkbox : false,
checkOnSelect : false,
selectOnCheck : false,
//url:'wdk?action=portal.app&method=query&ajaxparam='+new Date().getTime(),
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
idField:"app_uuid",
commandField:"command",
fitColumns:true, //是否自动填充满
nowrap:false, //自动换行
pagination:true,
formatter:{
app_name:'formatter_app_name',
is_active:'formatter_active',
command:'formatter_command'
}
});
//注册用户添加成功的监听
$.addListener("app_reg_edit","opt_query");
});
//获取grid查询参数
function getGridQueryParam(){
var account_name = $('#account_name').val();
var dataParam = {
_SRVNAME:'service.portal.app'
,_SRVMETHOD:'pagequeryAppListByKeywords'
,_DATA:$.json2str({
keywords : $("#conditions").val(),
app_info:{is_active : '1'},
result_fields:'',
order_fields:'display_order,app_code'
})
,_RSTYPE:'grid'
,_RSFIELD:'app_info'
,_RSPARAM:$.json2str({pagequery:'1'})
};
return dataParam;
}
function formatter_app_name(value,row,index){
return "<a href='javascript:void(0);' onclick=opt_view('"+row.app_uuid+"')>"+row.app_name+"</a>";
}
function formatter_active(value,row,index){
return (value == '1') ? "是" : "否";
}
function formatter_command(value,row,index) {
var str = '<i tilte="修改" class="fa fa-pencil-square-o grid-oper-icon" aria-hidden="true" onclick="modifyApp(\''+ row.app_uuid +'\')"></i>';
str += '<i tilte="删除" class="fa fa-trash-o grid-oper-icon" aria-hidden="true" onclick="deleteApp(\''+ row.app_uuid +'\')"></i>';
return str;
}
//查询
function opt_query() {
//组织参数
var dataParam = getGridQueryParam();
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
$("#conditions").on("keydown", function (e) {
if (e.which === 13) {
opt_query();
}
});
//新增
function opt_add(){
var _url = "platform/portal/saconsole/appreg_edit.jsp?ajaxparam="+new Date().getTime();
$.openInTab({
id: $.getUUID(),
title: '应用注册-新增',
height: 400,
width: 700,
url: _url,
queryParams:{
actionflag:'add',
app_uuid:''
}/* ,
onClose:function(){
opt_query();
} */
});
}
//修改
function modifyApp(app_uuid){
var _url = "platform/portal/saconsole/appreg_edit.jsp?ajaxparam="+new Date().getTime();
$.openInTab({
id:$.getUUID(),
title:'应用注册-修改',
type:'url',
url:_url,
queryParams:{
actionflag:'mdf',
app_uuid:app_uuid
}
/* ,onClose:function (){
opt_query();
} */
});
}
//复制
function copyApp(){
var row = $.grid_getSelected({
id : _gridid
});
if (!row.app_uuid) {
alert('请选择要复制的记录!');
return;
}
var app_uuid = row.app_uuid;
var _url = "platform/portal/saconsole/appreg_copy.jsp?ajaxparam="+new Date().getTime();
$.openInTab({
id:$.getUUID(),
title:'应用注册-复制',
type:'url',
url:_url,
queryParams:{
app_uuid:app_uuid
}/* ,
onClose:function (){
opt_query();
} */
});
}
//删除
function deleteApp(app_uuid){
confirmDialog("是否确认删除?",function(){
$.wait_open();
$.cuajax({
url:'wdk?action=portal.app&method=delete&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:{
app_uuid:app_uuid
},
success:function(result) {
$.wait_close();
var jres = $.str2json(result);
alert(jres.desc);
if(jres.code=="1"){
opt_query();
}
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
});
}
//查看
function opt_view(app_uuid){
var _url = "platform/portal/saconsole/appreg_edit.jsp?ajaxparam="+new Date().getTime();
$.openInTab({
id:$.getUUID(),
title:'应用注册-查看',
type:'url',
url:_url,
queryParams:{
actionflag:'detail',
app_uuid:app_uuid
},
height:560,
width:700,
onClose:function (){
}
});
}
//应用功能
function appFunction(){
var row = $.grid_getSelected({
id : _gridid
});
if (!row.app_uuid) {
alert('请选择要管理功能的应用!');
return;
}
var app_uuid = row.app_uuid;
window.location.href = "<%=basePath%>platform/portal/saconsole/appfunctionreg.jsp?app_uuid="+app_uuid;
}
</script>
</html>