表单增加slider控件

pull/98/MERGE
PPPSCN 2019-02-16 19:46:52 +08:00 committed by Karson
parent f011bf6da2
commit f9b43bdbe4
4 changed files with 21 additions and 2 deletions

View File

@ -11,7 +11,7 @@
"font-awesome": "^4.6.1", "font-awesome": "^4.6.1",
"bootstrap-table": "~1.11.0", "bootstrap-table": "~1.11.0",
"jstree": "~3.3.2", "jstree": "~3.3.2",
"moment": "~2.15.2", "moment": "^2.20.1",
"plupload": "~2.2.0", "plupload": "~2.2.0",
"toastr": "~2.1.3", "toastr": "~2.1.3",
"jcrop": "~2.0.4", "jcrop": "~2.0.4",
@ -32,6 +32,7 @@
"fastadmin-dragsort": "~1.0.0", "fastadmin-dragsort": "~1.0.0",
"fastadmin-addtabs": "~1.0.3", "fastadmin-addtabs": "~1.0.3",
"fastadmin-selectpage": "~1.0.0", "fastadmin-selectpage": "~1.0.0",
"fastadmin-layer": "~3.1.2" "fastadmin-layer": "~3.1.2",
"bootstrap-slider": "*"
} }
} }

View File

@ -11,6 +11,7 @@
@import url("../libs/nice-validator/dist/jquery.validator.css"); @import url("../libs/nice-validator/dist/jquery.validator.css");
@import url("../libs/bootstrap-select/dist/css/bootstrap-select.min.css"); @import url("../libs/bootstrap-select/dist/css/bootstrap-select.min.css");
@import url("../libs/fastadmin-selectpage/selectpage.css"); @import url("../libs/fastadmin-selectpage/selectpage.css");
@import url("../libs/bootstrap-slider/slider.css");
html, html,
body { body {
height: 100%; height: 100%;

View File

@ -33,6 +33,7 @@ require.config({
'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min', 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile', 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN', 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
'bootstrap-slider': '../libs/bootstrap-slider/bootstrap-slider',
'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min', 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort', 'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
'sortable': '../libs/Sortable/Sortable.min', 'sortable': '../libs/Sortable/Sortable.min',

View File

@ -368,6 +368,20 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
}, },
bindevent: function (form) { bindevent: function (form) {
},
slider: function (form) {
if ($(".slider", form).size() > 0) {
require(['bootstrap-slider'], function () {
$('.slider').removeClass('hidden').css('width', function (index, value) {
return $(this).parents('.form-control').width();
}).slider().on('slide', function (ev) {
var data = $(this).data();
if (typeof data.unit !== 'undefined') {
$(this).parents('.form-control').siblings('.value').text(ev.value + data.unit);
}
});
});
}
} }
}, },
api: { api: {
@ -467,6 +481,8 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
events.fieldlist(form); events.fieldlist(form);
events.slider(form);
events.switcher(form); events.switcher(form);
}, },
custom: {} custom: {}