/**
|
* APP设置管理初始化
|
*/
|
var TAppSet = {
|
id: "TAppSetTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
TAppSet.initColumn = function () {
|
return [
|
{field: 'selectItem', radio: true},
|
{title: 'ID', field: 'id', visible: true, align: 'center', valign: 'middle'},
|
{title: '键值', field: 'keyStr', visible: true, align: 'center', valign: 'middle'},
|
{title: '参数值', field: 'valueStr', visible: true, align: 'center', valign: 'middle'},
|
{title: '备注说明', field: 'remark', visible: true, align: 'center', valign: 'middle'}
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
TAppSet.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
TAppSet.seItem = selected[0];
|
return true;
|
}
|
};
|
|
/**
|
* 点击添加APP设置
|
*/
|
TAppSet.openAddTAppSet = function () {
|
var index = layer.open({
|
type: 2,
|
title: '添加APP设置',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tAppSet/tAppSet_add'
|
});
|
this.layerIndex = index;
|
};
|
|
/**
|
* 打开查看APP设置详情
|
*/
|
TAppSet.openTAppSetDetail = function () {
|
if (this.check()) {
|
var index = layer.open({
|
type: 2,
|
title: 'APP设置详情',
|
area: ['800px', '420px'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/tAppSet/tAppSet_update/' + TAppSet.seItem.id
|
});
|
this.layerIndex = index;
|
}
|
};
|
|
/**
|
* 删除APP设置
|
*/
|
TAppSet.delete = function () {
|
if (this.check()) {
|
var operation = function(){
|
var ajax = new $ax(Feng.ctxPath + "/tAppSet/delete", function (data) {
|
Feng.success("删除成功!");
|
TAppSet.table.refresh();
|
}, function (data) {
|
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("tAppSetId",TAppSet.seItem.id);
|
ajax.start();
|
}
|
Feng.confirm("是否确定刪除?", operation);
|
}
|
};
|
|
/**
|
* 修改APP设置状态
|
*/
|
TAppSet.updateState = function () {
|
if (this.check()) {
|
var ajax = new $ax(Feng.ctxPath + "/tAppSet/updateState", function (data) {
|
Feng.success("操作成功!");
|
TAppSet.table.refresh();
|
}, function (data) {
|
Feng.error("操作失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("tAppSetId",TAppSet.seItem.id);
|
ajax.start();
|
}
|
};
|
|
/**
|
* 查询APP设置列表
|
*/
|
TAppSet.search = function () {
|
var queryData = {};
|
queryData['condition'] = $("#condition").val();
|
TAppSet.table.refresh({query: queryData});
|
};
|
|
$(function () {
|
var defaultColunms = TAppSet.initColumn();
|
var table = new BSTable(TAppSet.id, "/tAppSet/list", defaultColunms);
|
table.setPaginationType("client");
|
TAppSet.table = table.init();
|
});
|