From 30c695ff61a5b9261c34d0a131828f333754df56 Mon Sep 17 00:00:00 2001 From: Karson Date: Sun, 1 Mar 2020 15:52:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=97=E8=A1=A8=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E7=BB=84=E4=BB=B6=E6=9C=AA=E5=85=BC=E5=AE=B9=E6=97=A7?= =?UTF-8?q?=E7=89=88=E6=9C=ACBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/require-backend.min.js | 3 ++- public/assets/js/require-table.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 '
';