require.config({ urlArgs: "v=", packages: [ { name: 'moment', location: '/static/libs/moment', main: 'moment' } ], include: ['jquery', 'drop', 'drag', 'form'], paths:{ 'backend': '../admin/js/backend', 'form': '/static/js/require-form', 'table': '/static/js/require-table', 'upload': '/static/js/require-upload', 'validator': '/static/js/require-validator', 'drag': 'jquery.drag.min', 'drop': 'jquery.drop.min', 'echarts': 'echarts.min', 'echarts-theme': 'echarts-theme', "jquery":'/static/libs/jquery/jquery.min', "nanoscroller":"/static/libs/nanoscroller/jquery.nanoscroller.min", "slimscroll":"/static/js/jquery.slimscroll.min", "bootstrap":"/static/libs/bootstrap/js/bootstrap.min", 'bootstrap-table-commonsearch': '/static/js/bootstrap-table-commonsearch', 'bootstrap-table-template': '/static/js/bootstrap-table-template', // // 以下的包从bower的libs目录加载 'jquery': '/static/libs/jquery/dist/jquery.min', 'bootstrap': '/static/libs/bootstrap/dist/js/bootstrap.min', 'bootstrap-datetimepicker': '/static/libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min', 'bootstrap-daterangepicker': '/static/libs/bootstrap-daterangepicker/daterangepicker', 'bootstrap-select': '/static/libs/bootstrap-select/dist/js/bootstrap-select.min', 'bootstrap-select-lang': '/static/libs/bootstrap-select/dist/js/i18n/defaults-zh_CN', 'bootstrap-table': '/static/libs/bootstrap-table/dist/bootstrap-table.min', 'bootstrap-table-export': '/static/libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min', 'bootstrap-table-mobile': '/static/libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile', 'bootstrap-table-lang': '/static/libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN', 'bootstrap-slider': '/static/libs/bootstrap-slider/bootstrap-slider', 'tableexport': '/static/libs/tableExport.jquery.plugin/tableExport.min', 'dragsort': '/static/libs/fastadmin-dragsort/jquery.dragsort', 'sortable': '/static/libs/Sortable/Sortable.min', 'addtabs': '/static/libs/fastadmin-addtabs/jquery.addtabs', 'slimscroll': '/static/libs/jquery-slimscroll/jquery.slimscroll', 'validator-core': '/static/libs/nice-validator/dist/jquery.validator', 'validator-lang': '/static/libs/nice-validator/dist/local/zh-CN', 'plupload': '/static/libs/plupload/js/plupload.min', 'toastr': '/static/libs/toastr/toastr', 'jstree': '/static/libs/jstree/dist/jstree.min', 'layer': '/static/libs/fastadmin-layer/dist/layer', 'cookie': '/static/libs/jquery.cookie/jquery.cookie', 'cxselect': '/static/libs/fastadmin-cxselect/js/jquery.cxselect', 'template': '/static/libs/art-template/dist/template-native', 'selectpage': '/static/libs/fastadmin-selectpage/selectpage', 'citypicker': '/static/libs/fastadmin-citypicker/dist/js/city-picker.min', 'citypicker-data': '/static/libs/fastadmin-citypicker/dist/js/city-picker.data', 'editable': '/static/libs/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.min' }, shim:{ "nanoscroller":['jquery'], "slimscroll":{ deps: ['jquery'], exports: '$.fn.extend' }, 'bootstrap': ['jquery'], 'bootstrap-table': { deps: [ 'bootstrap', 'css!/static/libs/bootstrap-table/dist/bootstrap-table.min.css' ], exports: '$.fn.bootstrapTable' }, 'bootstrap-table-lang': { deps: ['bootstrap-table'], exports: '$.fn.bootstrapTable.defaults' }, 'bootstrap-table-export': { deps: ['bootstrap-table', 'tableexport'], exports: '$.fn.bootstrapTable.defaults' }, 'bootstrap-table-mobile': { deps: ['bootstrap-table'], exports: '$.fn.bootstrapTable.defaults' }, 'bootstrap-table-advancedsearch': { deps: ['bootstrap-table'], exports: '$.fn.bootstrapTable.defaults' }, 'bootstrap-table-commonsearch': { deps: ['bootstrap-table'], exports: '$.fn.bootstrapTable.defaults' }, 'bootstrap-table-template': { deps: ['bootstrap-table', 'template'], exports: '$.fn.bootstrapTable.defaults' }, 'tableexport': { deps: ['jquery'], exports: '$.fn.extend' }, 'bootstrap-datetimepicker': [ 'moment/locale/zh-cn.js', 'css!/static/libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css', ], 'bootstrap-select': ['css!/static/libs/bootstrap-select/dist/css/bootstrap-select.min.css',], 'bootstrap-select-lang': ['bootstrap-select'], 'toastr': ['css!/static/libs/toastr/toastr.min.css'], 'jstree': ['css!/static/libs/jstree/dist/themes/default/style.css',], 'plupload': { deps: ['/static/libs/plupload/js/moxie.min.js'], exports: "plupload" }, 'layer': ['css!/static/libs/fastadmin-layer/dist/theme/default/layer.css'], 'validator-core': ['css!/static/libs/nice-validator/dist/jquery.validator.css'], 'validator-lang': ['validator-core'], 'selectpage': ['css!/static/libs/fastadmin-selectpage/selectpage.css'], 'citypicker': ['citypicker-data', 'css!/static/libs/fastadmin-citypicker/dist/css/city-picker.css'], 'editable':{ deps: ['bootstrap', 'css!/static/libs/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css'] } }, baseUrl:"/static/js/", map: { '*': { 'css': '/static/libs/require-css/css.min.js' } }, //baseUrl: '/static/admin/js/backend/', waitSeconds: 30, charset: 'utf-8' // 文件编码 }); require(['jquery', 'sent'], function($, Sent){ $(function($) { require(['backend', 'addons'], function (Backend, Addons) { // 避免目录冲突 require.config({baseUrl: '/static/admin/js/module/'}); var current_url = (window.location.pathname).split('/'); if (typeof(isLoadModule) != "undefined" && isLoadModule) { require([current_url[2]], function(Controller){ var action = current_url[3].split('.'); if (Controller.hasOwnProperty(action[0])) { Controller[action[0]](); } else { if (Controller.hasOwnProperty("_empty")) { Controller._empty(); } } }, function (e) { console.error(e); // 这里可捕获模块加载的错误 }) } }) }) })