优化上传组件

This commit is contained in:
2020-04-11 22:29:27 +08:00
parent b03606abd7
commit 456d63a231
4 changed files with 37 additions and 66 deletions

View File

@@ -15,12 +15,12 @@ var baseRoot = (function () {
// 配置参数
require.config({
waitSeconds: 60,
packages: [{
name: 'moment',
location: 'plugins/moment',
main: 'moment'
}
],
packages: [{
name: 'moment',
location: 'plugins/moment',
main: 'moment'
}
],
baseUrl: baseRoot,
map: {'*': {css: baseRoot + 'plugins/require/require.css.js'}},
paths: {
@@ -36,6 +36,7 @@ require.config({
'board': ['plugins/board/board.min'],
'droppable': ['plugins/droppable/droppable'],
'tagsinput': ['plugins/tagsinput/bootstrap-tagsinput'],
'icheck': ['plugins/iCheck/icheck.min'],
'select2': ['plugins/select2/select2.full'],
'iconpicker': ['plugins/bootstrap-iconpicker/dist/js/bootstrap-iconpicker.bundle.min'],
@@ -54,8 +55,8 @@ require.config({
'bootstrap.typeahead': ['plugins/bootstrap/js/bootstrap3-typeahead.min'],
'bootstrap.multiselect': ['plugins/bootstrap-multiselect/bootstrap-multiselect'],
'bootstrap-editable': 'plugins/bootstrap-editable/js/bootstrap-editable.min',
'bootstrap-datetimepicker': 'plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'bootstrap-daterangepicker': 'plugins/bootstrap-daterangepicker/daterangepicker',
'bootstrap-datetimepicker': 'plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'bootstrap-daterangepicker': 'plugins/bootstrap-daterangepicker/daterangepicker',
'validator-core': 'plugins/nice-validator/jquery.validator',
'validator-lang': 'plugins/nice-validator/local/zh-CN',
@@ -81,14 +82,15 @@ require.config({
'bootstrap.multiselect': {deps: ['bootstrap', 'css!' + baseRoot + 'plugins/bootstrap-multiselect/bootstrap-multiselect.css']},
'bootstrap-editable': {deps:['bootstrap', 'css!'+baseRoot+'plugins/bootstrap-editable/css/bootstrap-editable.css'], exports:'$.fn.editable'},
'distpicker': {deps: [baseRoot + 'plugins/distpicker/distpicker.data.js']},
'bootstrap-daterangepicker': ['moment/locale/zh-cn'],
'bootstrap-datetimepicker': ['moment/locale/zh-cn','css!'+baseRoot+'plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css'],
'select2': {deps: ['jquery', 'bootstrap', 'css!'+baseRoot+'plugins/select2/select2.css', 'css!'+baseRoot+'plugins/select2/sent_diy.css']},
'bootstrap-daterangepicker': ['moment/locale/zh-cn'],
'bootstrap-datetimepicker': ['moment/locale/zh-cn','css!'+baseRoot+'plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css'],
'select2': {deps: ['jquery', 'bootstrap', 'css!'+baseRoot+'plugins/select2/select2.css', 'css!'+baseRoot+'plugins/select2/sent_diy.css']},
'board': {deps:['jquery', 'droppable', 'css!'+baseRoot+'plugins/board/board.min.css'], exports: '$.fn.board'},
'droppable': {deps:['jquery'], exports: '$.fn.droppable'},
'tagsinput':{deps: ['jquery', 'bootstrap', 'css!'+baseRoot+'plugins/tagsinput/bootstrap-tagsinput.css'], exports: '$.fn.tagsinput'},
'iconpicker':{deps: ['jquery', 'bootstrap', 'css!'+baseRoot+'plugins/bootstrap-iconpicker/dist/css/bootstrap-iconpicker.min.css'], exports: '$.fn.iconpicker'},
'board': {deps:['jquery', 'droppable', 'css!'+baseRoot+'plugins/board/board.min.css'], exports: '$.fn.board'},
'droppable': {deps:['jquery'], exports: '$.fn.droppable'},
'tagsinput':{deps: ['jquery', 'bootstrap', 'css!'+baseRoot+'plugins/tagsinput/bootstrap-tagsinput.css'], exports: '$.fn.tagsinput'},
'icheck': {deps: ['jquery', 'css!'+baseRoot+'plugins/iCheck/all.css']},
'iconpicker':{deps: ['jquery', 'bootstrap', 'css!'+baseRoot+'plugins/bootstrap-iconpicker/dist/css/bootstrap-iconpicker.min.css'], exports: '$.fn.iconpicker'},
'validator-lang': ['validator-core'],
@@ -119,9 +121,10 @@ require(['jquery', 'bootstrap', 'message', 'adminlte'], function ($) {
$(function(){
require(['sent'], function(sent){
require(['admin/js/backend'], function(backend){
var controller = (Config.jsname && Config.jsname !== 'upload') ? 'admin/js/module/'+Config.jsname : Config.jsname;
//加载相应模块
if (Config.jsname) {
require(['admin/js/module/'+Config.jsname], function (Controller) {
require([controller], function (Controller) {
if (Controller.hasOwnProperty(Config.actionname)) {
Controller[Config.actionname]();
} else {