var ccgc = new Object();
ccgc.loadSearchModule = function(p) {
var $div = $("#" + p.id);
if ($div.length > 0) {
$div.load('ccgcSearchModule.htm', {
from : p.from,
callBackFunName : p.callBackFunName,
'ccgcSearchGrid' : $("#ccgcSearchGrid").val()
}, function() {
});
}
};
/**
* 加载存储过程查询模块
*/
ccgc.loadSearchModule({
id : 'ccgcSearchModule',
from : 'ccgc',
callBackFunName : 'searchCcgcCallBack'
});
/**
* 搜索条件回调函数
*
* @param {搜索条件对象}
* data
* @param {分隔符}
* fgf
*/
function searchCcgcCallBack(data, fgf) {
huimv.searchGrid("ccgcGrid", {
url : 'getCcgcList.htm',
params : [{
name : 'param',
value : data
}, {
name : 'fgf',
value : fgf
}]
}, '存储过程搜索结果');
}
/**
* 加载存储过程列表数据
*/
function loadCcgcGrid(ccgcSearchGrid) {
jQuery("#ccgcGrid").flexigrid({
url : 'getCcgcList.htm',
dataType : 'json',
method : 'post',
params : [{
name : 'ccgcSearchGrid',
value : $('#ccgcSearchGrid').val()
}],
title : '存储过程浏览',
usepager : true,
useRp : true,
rp : 10,
singleSelect : true,
hidehead : false,
showInputPage : true,
showSelectRp : false,
showTableToggleBtn : false,
width : '790',
height : '335',
nowrap : true,
resizable : false,
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 : 300,
sortable : false,
align : 'center',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
var mc = record.mc;
jQuery(col).html('' + mc + '');
}
}, {
display : '启用状态',
name : 'zt',
width : 80,
sortable : false,
align : 'center'
}, {
display : '操作',
name : '',
width : 80,
sortable : false,
align : 'center',
process : function(col, record, postion, pid) {
jQuery(col).addClass('s');
jQuery(col).html('删除');
}
}]
});
}
loadCcgcGrid($('#ccgcSearchGrid'));
function viewCcgc(mc) {
huimv.loadPage("ccgcRight", "viewCcgc.htm", {
"mc" : mc
});
}
/**
* 作废存储过程
* @param id
*/
function deleteCcgc(mc, from) {
Dialogs.alert("确定作废当前存储过程?", {
title : '提示信息',
width : 250,
height : 80,
top : 150,
button : {
ok : ['确定',function(){
this.close();
huimv.showProcessModel('处理数据中');
jQuery.ajax({
url : 'deleteCcgc.htm',
dataType : 'json',
type : 'post',
cache : false,
data : {"mc" : mc},
success : function(data) {
huimv.hideProcessModel();
if (data.returnCode > 0) {
if (from == 'list') {
huimv.reloadGrid('ccgcGrid');
} else if (from == 'view') {
loadCcgcList();
}
} else {
Dialogs.alert("传入参数有误!", {
width : 300,
height : 50
});
}
},
error : function(data) {
huimv.showError(data.responseText);
}
});
}],
cancel : ['取消',function(){
this.close();
}]
}
});
}