mirror of https://gitee.com/karson/fastadmin.git
parent
8756cf38a1
commit
b7300ea558
|
|
@ -113,15 +113,29 @@ define(['fast', 'moment'], function (Fast, Moment) {
|
|||
$(document).on('click', '.btn-dialog,.dialogit', function (e) {
|
||||
var that = this;
|
||||
var options = $.extend({}, $(that).data() || {});
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.columnIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions');
|
||||
if (tableOptions) {
|
||||
var button = tableOptions.columns[0][options.columnIndex]['buttons'][options.buttonIndex];
|
||||
var columnObj = null;
|
||||
$.each(tableOptions.columns, function (i, columns) {
|
||||
$.each(columns, function (j, column) {
|
||||
if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) {
|
||||
columnObj = column;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
var button = columnObj['buttons'][options.buttonIndex];
|
||||
if (button && typeof button.callback === 'function') {
|
||||
options.callback = button.callback;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof options.confirm !== 'undefined') {
|
||||
Layer.confirm(options.confirm, function (index) {
|
||||
Backend.api.open(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr('title'), options);
|
||||
|
|
@ -159,10 +173,23 @@ define(['fast', 'moment'], function (Fast, Moment) {
|
|||
var error = typeof options.error === 'function' ? options.error : null;
|
||||
delete options.success;
|
||||
delete options.error;
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.columnIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions');
|
||||
if (tableOptions) {
|
||||
var button = tableOptions.columns[0][options.columnIndex]['buttons'][options.buttonIndex];
|
||||
var columnObj = null;
|
||||
$.each(tableOptions.columns, function (i, columns) {
|
||||
$.each(columns, function (j, column) {
|
||||
if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) {
|
||||
columnObj = column;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
var button = columnObj['buttons'][options.buttonIndex];
|
||||
if (button && typeof button.success === 'function') {
|
||||
success = button.success;
|
||||
}
|
||||
|
|
@ -171,6 +198,7 @@ define(['fast', 'moment'], function (Fast, Moment) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新
|
||||
if (!success && typeof options.tableId !== 'undefined' && typeof options.refresh !== 'undefined' && options.refresh) {
|
||||
$("#" + options.tableId).bootstrapTable('refresh');
|
||||
|
|
|
|||
|
|
@ -6911,15 +6911,29 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
|
|||
$(document).on('click', '.btn-dialog,.dialogit', function (e) {
|
||||
var that = this;
|
||||
var options = $.extend({}, $(that).data() || {});
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.columnIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions');
|
||||
if (tableOptions) {
|
||||
var button = tableOptions.columns[0][options.columnIndex]['buttons'][options.buttonIndex];
|
||||
var columnObj = null;
|
||||
$.each(tableOptions.columns, function (i, columns) {
|
||||
$.each(columns, function (j, column) {
|
||||
if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) {
|
||||
columnObj = column;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
var button = columnObj['buttons'][options.buttonIndex];
|
||||
if (button && typeof button.callback === 'function') {
|
||||
options.callback = button.callback;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof options.confirm !== 'undefined') {
|
||||
Layer.confirm(options.confirm, function (index) {
|
||||
Backend.api.open(Backend.api.replaceids(that, $(that).attr('href')), $(that).attr('title'), options);
|
||||
|
|
@ -6957,10 +6971,23 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
|
|||
var error = typeof options.error === 'function' ? options.error : null;
|
||||
delete options.success;
|
||||
delete options.error;
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.columnIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
if (typeof options.tableId !== 'undefined' && typeof options.fieldIndex !== 'undefined' && typeof options.buttonIndex !== 'undefined') {
|
||||
var tableOptions = $("#" + options.tableId).bootstrapTable('getOptions');
|
||||
if (tableOptions) {
|
||||
var button = tableOptions.columns[0][options.columnIndex]['buttons'][options.buttonIndex];
|
||||
var columnObj = null;
|
||||
$.each(tableOptions.columns, function (i, columns) {
|
||||
$.each(columns, function (j, column) {
|
||||
if (typeof column.fieldIndex !== 'undefined' && column.fieldIndex === options.fieldIndex) {
|
||||
columnObj = column;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (columnObj) {
|
||||
var button = columnObj['buttons'][options.buttonIndex];
|
||||
if (button && typeof button.success === 'function') {
|
||||
success = button.success;
|
||||
}
|
||||
|
|
@ -6969,6 +6996,7 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新
|
||||
if (!success && typeof options.tableId !== 'undefined' && typeof options.refresh !== 'undefined' && options.refresh) {
|
||||
$("#" + options.tableId).bootstrapTable('refresh');
|
||||
|
|
@ -10005,9 +10033,8 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|||
var options = table ? table.bootstrapTable('getOptions') : {};
|
||||
var html = [];
|
||||
var url, classname, icon, text, title, extend;
|
||||
var columnIndex = options.columns[0].findIndex(function (element) {
|
||||
return element === column;
|
||||
});
|
||||
var fieldIndex = column.fieldIndex;
|
||||
|
||||
$.each(buttons, function (i, j) {
|
||||
if (type === 'operate') {
|
||||
if (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] === 'undefined') {
|
||||
|
|
@ -10028,7 +10055,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|||
refresh = j.refresh ? 'data-refresh="' + j.refresh + '"' : '';
|
||||
confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : '';
|
||||
extend = j.extend ? j.extend : '';
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + (refresh ? refresh + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-column-index="' + columnIndex + '" data-row-index="' + index + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + (refresh ? refresh + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-field-index="' + fieldIndex + '" data-row-index="' + index + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
}
|
||||
});
|
||||
return html.join(' ');
|
||||
|
|
|
|||
|
|
@ -432,9 +432,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|||
var options = table ? table.bootstrapTable('getOptions') : {};
|
||||
var html = [];
|
||||
var url, classname, icon, text, title, extend;
|
||||
var columnIndex = options.columns[0].findIndex(function (element) {
|
||||
return element === column;
|
||||
});
|
||||
var fieldIndex = column.fieldIndex;
|
||||
|
||||
$.each(buttons, function (i, j) {
|
||||
if (type === 'operate') {
|
||||
if (j.name === 'dragsort' && typeof row[Table.config.dragsortfield] === 'undefined') {
|
||||
|
|
@ -455,7 +454,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|||
refresh = j.refresh ? 'data-refresh="' + j.refresh + '"' : '';
|
||||
confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : '';
|
||||
extend = j.extend ? j.extend : '';
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + (refresh ? refresh + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-column-index="' + columnIndex + '" data-row-index="' + index + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + (refresh ? refresh + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-field-index="' + fieldIndex + '" data-row-index="' + index + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>');
|
||||
}
|
||||
});
|
||||
return html.join(' ');
|
||||
|
|
|
|||
Loading…
Reference in New Issue