refactor: 移除 Longbow.common.js 中的 htmlTemplate 属性

This commit is contained in:
Argo Zhang 2019-08-12 11:21:56 +08:00
parent 9bc109e607
commit 2283bfc06f
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
7 changed files with 12 additions and 12 deletions

View File

@ -276,6 +276,8 @@ $(function () {
url: 'api/Notifications'
};
window.CheckboxHtmlTemplate = '<div class="form-group col-md-3 col-sm-4 col-6"><div class="form-check"><label class="form-check-label" title="{3}" data-toggle="tooltip"><input type="checkbox" class="form-check-input" value="{0}" {2}/><span>{1}</span></label></div></div>';
// load widget data
$('.header .nav').reloadWidget().notifi({
url: 'NotiHub',

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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);

View File

@ -123,7 +123,6 @@
id: "",
url: "",
data: {},
htmlTemplate: '<div class="form-group col-md-3 col-sm-4 col-6"><div class="form-check"><label class="form-check-label" title="{3}" data-toggle="tooltip"><input type="checkbox" class="form-check-input" value="{0}" {2}/><span>{1}</span></label></div></div>',
title: "",
modal: false,
loading: false,

View File

@ -123,7 +123,6 @@
id: "",
url: "",
data: {},
htmlTemplate: '<div class="form-group col-md-3 col-sm-4 col-6"><div class="form-check"><label class="form-check-label" title="{3}" data-toggle="tooltip"><input type="checkbox" class="form-check-input" value="{0}" {2}/><span>{1}</span></label></div></div>',
title: "",
modal: false,
loading: false,