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.

250 lines
6.6 KiB

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@include file="/wdk/theme/je/module/public/common.jsp"%>
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<title>消息中心-信息管理</title>
</head>
<body 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="doAdd()">新增</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;" >
<div class="h_layout">
<div>
<div class="inputgroup">
<label>关键字</label>
<div>
<input class="easyui-validatebox" id="keywords" name="keywords" placeholder="可输入信息名称、编码、备注"/>
</div>
</div>
<div class="inputgroup">
<label>消息分类</label>
<div>
<input id="code_type" name="code_type" title=""/>
</div>
</div>
</div>
<div style="width:125px;">
<a class="eapbutton" style="float:right;" onclick="doQuery()"><i class="fa fa-search" aria-hidden="true"></i><span><span>查询</span></span></a>
</div>
</div>
</div>
<!-- 消息信息表格 -->
<div id="layout_grid" data-options="region:'center',border:false,collapsed:false" style="padding:0 10px;" ></div>
</div>
</div>
</body>
<script type="text/javascript">
var _getSessionUser = $.getSessionUser();
var _op_acc = _getSessionUser.account_id;
//表格参数
var _gridid = $.getUUID();
var _gridcode = 'platform.portal.msg.codegrid';
$(function() {
//消息分类
combo_box('code_type', 'ENUM_MSG_TYPE');
//初始化表格
$.grid({
id: _gridid,
containerid: 'layout_grid',
gridcode: _gridcode,
checkbox: false,
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
queryParams: {
_SRVNAME: 'service.unimessage.code',
_SRVMETHOD: 'queryMsgListByKeywordsForPage',
_DATA: $.json2str ({
keywords: '',
code_type: '',
result_fields: '',
order_fields: 'display_order asc'
}),
_RSTYPE : 'grid',
_RSFIELD : 'msg_info',
_RSPARAM : $.json2str({
pagequery : '1'
})
},
idField: 'code_uuid',
pagination: true,
formatter: {
code_name: 'formatter_view',
command: 'formatter_command'
}
})
});
function formatter_view(value,row,index) {
return '<a href="javascript:void(0);" onclick="doView(\''+ row.code_uuid +'\')">'+ value +'</a>';
}
function formatter_command(value,row,index) {
return '<i title="修改" class="fa fa-pencil-square-o oper-obj" style="font-size:14px;margin:0 5px;" aria-hidden="true" onclick="doEdit(\''+ row.code_uuid +'\')"></i>'
+ '<i title="删除" class="fa fa-trash-o grid-oper-icon" style="font-size:14px;margin:0 5px;" aria-hidden="true" onclick="doDelete(\''+ row.code_uuid +'\')"></i>';
}
function doQuery() {
var dataParams = {
_SRVNAME: 'service.unimessage.code',
_SRVMETHOD: 'queryMsgListByKeywordsForPage',
_DATA: $.json2str ({
keywords: $('#keywords').val().trim(),
code_type: $('#code_type').val(),
result_fields: '',
order_fields: 'display_order asc'
}),
_RSTYPE : 'grid',
_RSFIELD : 'msg_info',
_RSPARAM : $.json2str({
pagequery : '1'
})
};
//重新加载grid数据
$.grid_reload({
id: _gridid,
queryParams: dataParams
});
}
/**
* [doView 查看信息]
* @return {[type]} [无]
*/
function doView(code_uuid) {
var wid = $.getUUID();
$.openWin({
id: wid,
title: '查看信息',
height: 400,
width: 700,
url: 'platform/portal/msg/msg_code_edit.jsp',
queryParams:{
actionflag: 'view',
selected_id: code_uuid
},
onClose: function() {
doQuery();
}
});
}
/**
* [doAdd 新增信息]
* @return {[type]} [无]
*/
function doAdd(){
var wid = $.getUUID();
$.openWin({
id: wid,
title: '新增信息',
height:400,
width:700,
url: 'platform/portal/msg/msg_code_edit.jsp',
queryParams: {
actionflag:'add'
},
onClose: function() {
doQuery();
}
});
}
/**
* [doEdit 修改消息]
* @return {[type]} [无]
*/
function doEdit(code_uuid){
var wid = $.getUUID();
$.openWin({
id: wid,
title: '修改信息',
height:400,
width:700,
url: 'platform/portal/msg/msg_code_edit.jsp',
queryParams: {
actionflag: 'edit',
selected_id: code_uuid
},
onClose: function() {
doQuery();
}
});
}
/**
* [doDelete 删除信息]
* @return {[type]} [无]
*/
function doDelete(code_uuid){
//var ifdelete = confirm("确定要删除该信息吗?");
confirmDialog("是否确认删除?",function(){
$.wait_open("删除中,请稍候。。。");
$.cuajax({
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
method: "post",
timeout: WDK_Timeout,
data: {
_SRVNAME:'service.unimessage.code',
_SRVMETHOD:'deleteMsgCode',
_DATA:$.json2str({
op_acc: _op_acc,
code_uuid: code_uuid
})
},
success:function(result) {
$.wait_close();
//返回值字符串转json
var jres = $.str2json(result);
if(jres.code == "1"){ //操作成功
doQuery();
} else {
alert(jres.desc);
}
},
error:function(result){
$.wait_close();
alert('网络错误!result=' + result);
}
});
});
}
//下拉框
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: '请选择'
});
}
</script>
</html>