From 2283bfc06fd71ef5dec2e59a212b6de36556aabd Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 12 Aug 2019 11:21:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20Longbow.common?= =?UTF-8?q?.js=20=E4=B8=AD=E7=9A=84=20htmlTemplate=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/wwwroot/js/common-scripts.js | 2 ++ Bootstrap.Admin/wwwroot/js/groups.js | 4 ++-- Bootstrap.Admin/wwwroot/js/menus.js | 2 +- Bootstrap.Admin/wwwroot/js/roles.js | 8 ++++---- Bootstrap.Admin/wwwroot/js/users.js | 6 +++--- Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js | 1 - Bootstrap.Client/wwwroot/lib/longbow/longbow.common.js | 1 - 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/js/common-scripts.js b/Bootstrap.Admin/wwwroot/js/common-scripts.js index 80bda9c1..6d88027c 100644 --- a/Bootstrap.Admin/wwwroot/js/common-scripts.js +++ b/Bootstrap.Admin/wwwroot/js/common-scripts.js @@ -276,6 +276,8 @@ $(function () { url: 'api/Notifications' }; + window.CheckboxHtmlTemplate = '
'; + // load widget data $('.header .nav').reloadWidget().notifi({ url: 'NotiHub', diff --git a/Bootstrap.Admin/wwwroot/js/groups.js b/Bootstrap.Admin/wwwroot/js/groups.js index 210ac2ac..1cd3bae3 100644 --- a/Bootstrap.Admin/wwwroot/js/groups.js +++ b/Bootstrap.Admin/wwwroot/js/groups.js @@ -18,7 +18,7 @@ $(function () { events: { '#btn_assignRole': function (row) { $.bc({ - id: row.Id, url: Role.url, query: { type: "group" }, method: "post", + id: row.Id, url: Role.url, query: { type: "group" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { @@ -34,7 +34,7 @@ $(function () { }, '#btn_assignUser': function (row) { $.bc({ - id: row.Id, url: User.url, query: { type: "group" }, method: "post", + id: row.Id, url: User.url, query: { type: "group" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { diff --git a/Bootstrap.Admin/wwwroot/js/menus.js b/Bootstrap.Admin/wwwroot/js/menus.js index 63dedf53..9745209d 100644 --- a/Bootstrap.Admin/wwwroot/js/menus.js +++ b/Bootstrap.Admin/wwwroot/js/menus.js @@ -42,7 +42,7 @@ $(function () { events: { '#btn_assignRole': function (row) { $.bc({ - id: row.Id, url: Role.url, query: { type: "menu" }, method: "post", + id: row.Id, url: Role.url, query: { type: "menu" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { diff --git a/Bootstrap.Admin/wwwroot/js/roles.js b/Bootstrap.Admin/wwwroot/js/roles.js index 226f0ff1..a71127b0 100644 --- a/Bootstrap.Admin/wwwroot/js/roles.js +++ b/Bootstrap.Admin/wwwroot/js/roles.js @@ -26,7 +26,7 @@ $(function () { events: { '#btn_assignUser': function (row) { $.bc({ - id: row.Id, url: User.url, query: { type: "role" }, method: "post", + id: row.Id, url: User.url, query: { type: "role" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { @@ -42,7 +42,7 @@ $(function () { }, '#btn_assignGroup': function (row) { $.bc({ - id: row.Id, url: Group.url, query: { type: "role" }, method: "post", + id: row.Id, url: Group.url, query: { type: "role" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { @@ -58,7 +58,7 @@ $(function () { }, '#btn_assignMenu': function (row) { $.bc({ - id: row.Id, url: Menu.url, query: { type: "role" }, method: "post", + id: row.Id, url: Menu.url, query: { type: "role" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { $dialogMenuHeader.text($.format('{0}-菜单授权窗口', row.RoleName)); $btnSubmitMenu.data('type', 'menu'); @@ -76,7 +76,7 @@ $(function () { }, '#btn_assignApp': function (row) { $.bc({ - id: row.Id, url: App.url, method: "get", + id: row.Id, url: App.url, method: "get", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { diff --git a/Bootstrap.Admin/wwwroot/js/users.js b/Bootstrap.Admin/wwwroot/js/users.js index 098e279b..10e6aaf2 100644 --- a/Bootstrap.Admin/wwwroot/js/users.js +++ b/Bootstrap.Admin/wwwroot/js/users.js @@ -23,7 +23,7 @@ $(function () { events: { '#btn_assignRole': function (row) { $.bc({ - id: row.Id, url: Role.url, query: { type: "user" }, method: "post", + id: row.Id, url: Role.url, query: { type: "user" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { @@ -39,7 +39,7 @@ $(function () { }, '#btn_assignGroup': function (row) { $.bc({ - id: row.Id, url: Group.url, query: { type: "user" }, method: "post", + id: row.Id, url: Group.url, query: { type: "user" }, method: "post", htmlTemplate: CheckboxHtmlTemplate, callback: function (result) { var htmlTemplate = this.htmlTemplate; var html = $.map(result, function (element, index) { @@ -96,7 +96,7 @@ $(function () { { title: "说明", field: "Description", sortable: false } ], editButtons: { - events : { + events: { 'click .reset': function (e, value, row, index) { $table.bootstrapTable('uncheckAll'); $table.bootstrapTable('check', index); diff --git a/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js b/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js index 2960132c..661581a2 100644 --- a/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js +++ b/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js @@ -123,7 +123,6 @@ id: "", url: "", data: {}, - htmlTemplate: '
', title: "", modal: false, loading: false, diff --git a/Bootstrap.Client/wwwroot/lib/longbow/longbow.common.js b/Bootstrap.Client/wwwroot/lib/longbow/longbow.common.js index 2960132c..661581a2 100644 --- a/Bootstrap.Client/wwwroot/lib/longbow/longbow.common.js +++ b/Bootstrap.Client/wwwroot/lib/longbow/longbow.common.js @@ -123,7 +123,6 @@ id: "", url: "", data: {}, - htmlTemplate: '
', title: "", modal: false, loading: false,