var xtgg = new Object();
xtgg.loadSearchModule = function(p) {
var $div = $("#" + p.id);
if ($div.length > 0) {
$div.load('xtggSearchModule.htm', {
from : p.from,
callBackFunName : p.callBackFunName,
'xtggSearchGrid' : $("#xtggSearchModule").val()
}, function() {
});
}
};
/**
* 加载系统公告查询模块
*/
xtgg.loadSearchModule({
id : 'xtggSearchModule',
from : 'xtgg',
callBackFunName : 'searchXtggCallBack'
});
/**
* 搜索条件回调函数
*
* @param {搜索条件对象}
* data
* @param {分隔符}
* fgf
*/
function searchXtggCallBack(data, fgf) {
huimv.searchGrid("xtggGrid", {
url : 'getXtggList.htm',
params : [{
name : 'param',
value : data
}, {
name : 'fgf',
value : fgf
}]
}, '系统公告搜索结果');
}
/**
* 加载系统公告列表数据
*/
function loadXtggGrid(xtggSearchGrid) {
var xxtz_xtgg_fb = $("#xxtz_xtgg_fb").val();
jQuery("#xtggGrid").flexigrid({
url : 'getXtggList.htm',
dataType : 'json',
method : 'post',
params : [{
name : 'xtggSearchGrid',
value : $('#xtggSearchGrid').val()
},{
name : 'from',
value : $("#from").val()
}],
title : '公告浏览',
usepager : true,
useRp : true,
rp : 10,
singleSelect : true,
hidehead : false,
showInputPage : true,
showSelectRp : false,
showTableToggleBtn : false,
width : '790',
resizable : false,
nowrap : true,
height : '335',
cache : false,// 清除缓存
colModel : [{
display : '行号',
name : 'hh',
width : 25,
sortable : false,
align : 'center',
process : function(col, record, d) {
jQuery(col).html(d + 1);
}
}, {
display : '标题',
name : '',
width : 180,
sortable : false,
align : 'left',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
jQuery(col).html('' + record.bt + '');
}
}, {
display : '描述',
name : 'ms',
width : 270,
sortable : false,
align : 'left'
}, {
display : '发布时间',
name : 'fbsj',
width : 120,
sortable : true,
align : 'center'
}, {
display : '发布状态',
name : 'fbzt',
width : 60,
sortable : true,
align : 'center',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
var str = '';
if (record.fbzt == 1) {
str += '' + "已发布" + '';
} else {
str += '' + "未发布" + '';
}
jQuery(col).html(str);
}
}, {
display : '操作',
name : '',
width : 60,
sortable : true,
align : 'center',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
if (record.fbzt != 1 && xxtz_xtgg_fb == "true") {
jQuery(col).html('' + "发布" + '');
}
}
}]
});
}
loadXtggGrid($('#xtggSearchGrid'));
/**
* 发布系统公告
* @param id
*/
function fbXtgg(id) {
huimv.showProcessModel('发布中...');
jQuery.ajax({
url : 'fbXtgg.htm',
dataType : 'json',
type : 'post',
cache : false,
data : {
"id" : id
},
success : function(data) {
huimv.hideProcessModel();
huimv.reloadGrid('xtggGrid');
},
error : function(data) {
huimv.showError(data.responseText);
}
});
}
/**
* 加载系统公告查看页面
* @param id
*/
function viewXtgg(id) {
huimv.loadPage('xtggRight', 'viewXtgg.htm', {
"id" : id
});
}
/**
* 加载系统公告编辑页面
* @param id
*/
function editXtgg(id, from) {
huimv.loadPage('xtggRight', 'editXtgg.htm', {
"id" : id,
"from" : from
});
}
/**
* 编辑完成后回调函数
*
* @param {} lx
* @param {} data
*/
function processAfterEditXtgg() {
Dialogs.close();
huimv.reloadGrid('xtggGrid');
}
/**
* 作废公告
* @param id
*/
function disableXtgg(id, from) {
Dialogs.alert("确定作废系统公告?", {
title : '提示信息',
width : 250,
height : 80,
top : 150,
button : {
ok : ['确定',function(){
this.close();
huimv.showProcessModel('处理数据中');
jQuery.ajax({
url : 'disableXtgg.htm',
dataType : 'json',
type : 'post',
cache : false,
data : {"id" : id},
success : function(data) {
huimv.hideProcessModel();
if (data.returnCode > 0) {
if (from == 'list') {
huimv.reloadGrid('xtggGrid');
} else if (from == 'view') {
loadXtggList();
}
} else {
Dialogs.alert("传入参数有误!", {
width : 300,
height : 50
});
}
},
error : function(data) {
huimv.showError(data.responseText);
}
});
}],
cancel : ['取消',function(){
this.close();
}]
}
});
}