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.

234 lines
6.7 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>消息服务配置</title>
<script type="text/javascript">
var _account_id = $.getSessionUser().account_id;
var _manage_unit_uuid = $.getSessionUser().manageunituuid;
//grid相关
var _gridcode = "platform.portal.msg.msg_service_grid";
var _gridid = $.getUUID();
//初始化
$(function(){
//性别
Combo_box("code_type", "ENUM_MSG_TYPE");
//初始化grid
var dataParam = getGridQueryParam();
$.grid({
id : _gridid,
containerid : 'layout_grid',
gridcode : _gridcode,
checkbox : false,
checkOnSelect : false,
selectOnCheck : false,
idField:"service_uuid",
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
queryParams:dataParam,
fitColumns:true, //是否自动填充满
nowrap:true, //自动换行
pagination:true,
formatter: {
command:'formatter_command',
status: 'formatter_status'
}
,onLoaded:function(){
$.wait_close();
}
});
//注册按钮事件
$("#btn_add").on("click", function(){
$.openInTab({
id:$.getUUID()
,title:'消息服务配置-新增'
,height:400
,width:700
,url:'platform/portal/msg/msg_service_edit.jsp'
,queryParams:{
actionflag:'add'
}
,onClose:function(){
btn_query();
}
});
});
//注册用户添加成功的监听
$.addListener("msg_service_edit","btn_query");
});
//下拉框
function Combo_box(id, moduleCode) {
$.combobox({
id : id,
url : 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
queryParams : {
_SRVNAME : 'service.wdk.pub',
_SRVMETHOD : 'wql_queryCombobox',
_DATA : $.json2str({
modulecode : moduleCode,
jparam : {
condition : ''
}
}),
_RSFIELD : 'result'
},
height : 25,
defaultOption : '全部'
});
}
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.service_uuid +'\')"></i>';
str += '<i tilte="删除" class="fa fa-trash-o grid-oper-icon" aria-hidden="true" onclick="btn_delete(\''+ row.service_uuid +'\')"></i>';
return str;
}
function formatter_status(value,row,index) {
return row.status == "0" ? "停用" : "启用";
}
//获取grid查询参数
function getGridQueryParam(){
//获取form对象值
var service_info = $.getFieldValue({formid:'search_form'});
service_info.manage_unit_uuid = $.getSessionUser().manageunituuid; //需要传入管理单元
service_info.search_bar = service_info.search_bar.trim();
//组织参数
var dataParam = {
_SRVNAME:'service.pf.msg'
,_SRVMETHOD:'pageQueryMsgServiceList'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id
,service_info: service_info
,result_fields:''
,order_fields:'display_order'
})
,_RSTYPE:'grid'
,_RSFIELD:'service_info'
,_RSPARAM:$.json2str({pagequery:'1'})
};
return dataParam;
}
//查询
function btn_query(){
//组织参数
var dataParam = getGridQueryParam();
$.grid_reload({
id:_gridid,
queryParams:dataParam
});
}
//修改 btn_modify Button
function btn_modify(service_uuid){
$.openInTab({
id:$.getUUID()
,title:'消息服务配置-修改'
,height:400
,width:700
,url:'platform/portal/msg/msg_service_edit.jsp'
,queryParams:{
actionflag:'update',
service_uuid : service_uuid
}
});
}
//删除
function btn_delete(service_uuid) {
confirmDialog("是否确认删除?",function(){
//打开旋转
$.wait_open();
//组织参数
var dataParam = {
_SRVNAME:'service.pf.msg'
,_SRVMETHOD:'delete'
,_DATA:$.json2str({
op_account_uuid:$.getSessionUser().account_id,
service_uuid : service_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'" id="btn_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 style="line-height: 22px;">
<input id="code_type" name="code_type"/>
</div>
</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>