Pre Merge pull request !133 from 无木/master

pull/133/MERGE
Gitee 2019-06-29 11:02:50 +08:00
commit 6991a58593
1 changed files with 11 additions and 1 deletions

View File

@ -485,7 +485,17 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
var yes = typeof this.yes !== 'undefined' ? this.yes : 1;
var no = typeof this.no !== 'undefined' ? this.no : 0;
var url = typeof this.url !== 'undefined' ? this.url : '';
return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change' data-id='"
var enabled=true;
if (typeof this.enabled !=="undefined") {
if (typeof this.enabled==="function") {
enabled=this.enabled.call(this,value,row,index);
} else {
enabled=this.enabled;
}
}
var classname="btn-change";
if (!enabled) classname+=" btn disabled' style='padding:0'";
return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='"+classname+"' data-id='"
+ row.id + "' " + (url ? "data-url='" + url + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on " + (value == yes ? 'text-' + color : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
},
url: function (value, row, index) {