/**
|
* ${context.bizChName}管理初始化
|
*/
|
var ${context.bizEnBigName} = new BasePage({
|
id: "${context.bizEnBigName}Table" //表格id
|
//查询条件 支持集合和对象
|
// Array : [ key1,key2,key3,key4....]
|
// Object: { k(页面取值的domId): v(传入后台对象字段属性) }
|
,search_keys: {
|
"create": "create",
|
"createBegin": "beginTime",
|
"createEnd": "endTime",
|
"name": "name",
|
"status": "status"
|
}
|
});
|
|
/**
|
* 初始化表格的列
|
*/
|
${context.bizEnBigName}.init_columns = function () {
|
var that = this;
|
return [
|
{field: 'selectItem', checkbox: true},
|
<% for(item in table.fields!){ %>
|
<% if(strutil.lastIndex(item.propertyName, "Image") != -1) { %>
|
{title: '${item.comment}', field: '${item.propertyName}', visible: true, align: 'center', valign: 'middle', formatter: that.getImageDom },
|
<% } else if(strutil.lastIndex(item.propertyName, "Date") != -1) { %>
|
{title: '${item.comment}', field: '${item.propertyName}', visible: true, align: 'center', valign: 'middle', formatter: that.getDateFormat },
|
<% } else if(strutil.lastIndex(item.propertyName, "Text") != -1) { %>
|
{title: '${item.comment}', field: '${item.propertyName}', visible: true, align: 'center', valign: 'middle', formatter: that.getTextFormat },
|
<% } else { %>
|
{title: '${item.comment}', field: '${item.propertyName}', visible: true, align: 'center', valign: 'middle'},
|
<% }%>
|
<% } %>
|
];
|
};
|
|
/**
|
* 点击添加${context.bizChName}
|
*/
|
${context.bizEnBigName}.open_add = function () {
|
this.open_modal({
|
title: "添加${context.bizChName}",
|
area: [ "65%", "75%"],
|
content: this.ctxPath + '/${context.bizEnName}/open_add'
|
});
|
};
|
|
/**
|
* 点击编辑${context.bizChName}
|
*/
|
${context.bizEnBigName}.open_update = function () {
|
var that = this;
|
that.run_one_callback( function ( data) {
|
that.open_modal({
|
title: "编辑${context.bizChName}",
|
area: [ "65%", "75%"],
|
content: that.ctxPath + '/${context.bizEnName}/open_update/' + data.id
|
});
|
});
|
};
|
|
/**
|
* 打开查看${context.bizChName}详情
|
*/
|
${context.bizEnBigName}.open_detail = function (id) {
|
this.open_modal({
|
title: "查看${context.bizChName}",
|
area: [ "65%", "75%"],
|
content: this.ctxPath + '/${context.bizEnName}/open_detail/' + id
|
});
|
};
|
|
/**
|
* 删除/批量删除${context.bizChName}
|
*/
|
${context.bizEnBigName}.delete = function(id){
|
var that = this, ids = id == 0 ? this.check_ids() : id;
|
if (ids.length == 0) { return; }
|
that.confirm( "是否删除所选中的数据?", function () {
|
that.$ajax( "删除", "/${context.bizEnName}/delete", { ids: ids}, function() { that.search(); });
|
});
|
};
|
|
/**
|
* 编辑${context.bizChName}状态
|
*/
|
${context.bizEnBigName}.updateState = function (id, state) {
|
var that = this, ids = id == 0 ? this.check_ids() : id;
|
if (ids.length == 0) { return; }
|
var msg = state == 1 ? "启用" : "停用"
|
that.confirm( "是否"+msg+"所选中的数据?", function () {
|
that.$ajax( msg, "/${context.bizEnName}/updateState", { ids: ids, state: state}, function() { that.search(); });
|
});
|
};
|
|
$(function () {
|
${context.bizEnBigName}.init_table( "/${context.bizEnName}/list");
|
});
|