diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index 391269d4..872d2028 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -10510,6 +10510,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr toggle: function (value, row, index) { var table = this.table; var options = table ? table.bootstrapTable('getOptions') : {}; + var pk = options.pk || "id"; var color = typeof this.color !== 'undefined' ? this.color : 'success'; var yes = typeof this.yes !== 'undefined' ? this.yes : 1; var no = typeof this.no !== 'undefined' ? this.no : 0; @@ -10519,7 +10520,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable; } return ""; + + row[pk] + "' " + (url ? "data-url='" + url + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'>"; }, url: function (value, row, index) { return '
'; diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index dfcbd697..fc9cf550 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -525,6 +525,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table toggle: function (value, row, index) { var table = this.table; var options = table ? table.bootstrapTable('getOptions') : {}; + var pk = options.pk || "id"; var color = typeof this.color !== 'undefined' ? this.color : 'success'; var yes = typeof this.yes !== 'undefined' ? this.yes : 1; var no = typeof this.no !== 'undefined' ? this.no : 0; @@ -534,7 +535,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable; } return ""; + + row[pk] + "' " + (url ? "data-url='" + url + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'>"; }, url: function (value, row, index) { return '
';