/**
|
* 初始化系统设置详情对话框
|
*/
|
var TSystemSetInfoDlg = {
|
tSystemSetInfoData : {}
|
};
|
|
/**
|
* 清除数据
|
*/
|
TSystemSetInfoDlg.clearData = function() {
|
this.tSystemSetInfoData = {};
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TSystemSetInfoDlg.set = function(key, val) {
|
this.tSystemSetInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TSystemSetInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
}
|
|
/**
|
* 关闭此对话框
|
*/
|
TSystemSetInfoDlg.close = function() {
|
parent.layer.close(window.parent.TSystemSet.layerIndex);
|
}
|
|
/**
|
* 收集数据
|
*/
|
TSystemSetInfoDlg.collectData = function() {
|
this
|
.set('id')
|
.set('keyStr')
|
.set('valueStr')
|
.set('remark');
|
}
|
|
/**
|
* 提交添加
|
*/
|
TSystemSetInfoDlg.addSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tSystemSet/add", function(data){
|
Feng.success("添加成功!");
|
window.parent.TSystemSet.table.refresh();
|
TSystemSetInfoDlg.close();
|
},function(data){
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tSystemSetInfoData);
|
ajax.start();
|
}
|
|
/**
|
* 提交修改
|
*/
|
TSystemSetInfoDlg.editSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tSystemSet/update", function(data){
|
Feng.success("修改成功!");
|
window.parent.TSystemSet.table.refresh();
|
TSystemSetInfoDlg.close();
|
},function(data){
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tSystemSetInfoData);
|
ajax.start();
|
}
|
|
$(function() {
|
|
});
|