/**
* @author Zheng Tengfei
*/
var bbxx = new Object();
bbxx.loadSearchModule = function(p) {
var $div = $("#" + p.id);
if ($div.length > 0) {
$div.load('bbxxSearchModule.htm', {
from : p.from,
callBackFunName : p.callBackFunName,
'bbxxSearchGrid' : $("#bbxxSearchModule").val()
}, function() {
});
}
};
/**
* 加载新闻查询模块
*/
bbxx.loadSearchModule({
id : 'bbxxSearchModule',
from : 'bbxx',
callBackFunName : 'searchBbxxCallBack'
});
/**
* 搜索条件回调函数
*
* @param {搜索条件对象}
* data
* @param {分隔符}
* fgf
*/
function searchBbxxCallBack(data, fgf) {
huimv.searchGrid("bbxxGrid", {
url : 'getBbxxList.htm',
params : [{
name : 'param',
value : data
}, {
name : 'fgf',
value : fgf
}]
}, '版本信息搜索结果');
}
/**
* 加载新闻列表数据
*/
function loadBbxxGrid(bbxxSearchGrid) {
jQuery("#bbxxGrid").flexigrid({
url : 'getBbxxList.htm',
dataType : 'json',
method : 'post',
params : [{
name : 'bbxxSearchGrid',
value : $('#bbxxSearchGrid').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 : 'bbh',
width : 250,
sortable : false,
align : 'center',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
jQuery(col).html('' + record.bbh + '');
}
}, {
display : '发布人',
name : 'fbrxm',
width : 100,
sortable : false,
align : 'center'
}, {
display : '发布时间',
name : 'fbsj',
width : 100,
sortable : true,
align : 'center'
}, {
display : '修改人',
name : 'xgrxm',
width : 100,
sortable : false,
align : 'center'
}, {
display : '修改时间',
name : 'xgsj',
width : 100,
sortable : true,
align : 'center'
}]
});
}
loadBbxxGrid($('#xwfbSearchGrid'));
/**
* 加载新闻查看页面
* @param id
*/
function viewBbxx(id) {
huimv.loadPage('bbxxRight', 'viewBbxx.htm', {
"id" : id
});
}
/**
* 加载新闻编辑页面
* @param id
*/
function editBbxx(id, from) {
huimv.loadPage('bbxxRight', 'editBbxx.htm', {
"id" : id,
"from" : from
});
}
/**
* 作废新闻
* @param id
*/
function disableBbxx(id, from) {
Dialogs.alert("确定作废新闻?", {
title : '提示信息',
width : 250,
height : 80,
top : 150,
button : {
ok : ['确定',function(){
this.close();
huimv.showProcessModel('处理数据中');
jQuery.ajax({
url : 'disableBbxx.htm',
dataType : 'json',
type : 'post',
cache : false,
data : {"id" : id},
success : function(data) {
huimv.hideProcessModel();
if (data.returnCode > 0) {
if (from == 'list') {
huimv.reloadGrid('bbxxGrid');
} else if (from == 'view') {
loadBbxxList();
}
} else {
Dialogs.alert("传入参数有误!", {
width : 300,
height : 50
});
}
},
error : function(data) {
huimv.showError(data.responseText);
}
});
}],
cancel : ['取消',function(){
this.close();
}]
}
});
}