diff --git a/public/static/admin.js b/public/static/admin.js index bc7f228c2..fe8dce85a 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -50,10 +50,40 @@ window.jQuery = window.$ = window.jQuery || window.$ || layui.$; /*! 配置 require 参数 */ require.config({ - baseUrl: baseRoot, waitSeconds: 60, map: {'*': {css: baseRoot + 'plugs/require/css.js'}}, paths: { - 'vue': ['plugs/vue/vue.min'], 'md5': ['plugs/jquery/md5.min'], 'json': ['plugs/jquery/json.min'], 'xlsx': ['plugs/jquery/xlsx.min'], 'excel': ['plugs/jquery/excel.xlsx'], 'base64': ['plugs/jquery/base64.min'], 'upload': [tapiRoot + '/api.upload/index?'], 'notify': ['plugs/notify/notify.min'], 'angular': ['plugs/angular/angular.min'], 'cropper': ['plugs/cropper/cropper.min'], 'echarts': ['plugs/echarts/echarts.min'], 'ckeditor4': ['plugs/ckeditor4/ckeditor'], 'ckeditor5': ['plugs/ckeditor5/ckeditor'], 'websocket': ['plugs/socket/websocket'], 'pcasunzips': ['plugs/jquery/pcasunzips'], 'sortablejs': ['plugs/sortable/sortable.min'], 'vue.sortable': ['plugs/sortable/vue.draggable.min'], 'jquery.ztree': ['plugs/ztree/ztree.all.min'], 'jquery.masonry': ['plugs/jquery/masonry.min'], 'jquery.cropper': ['plugs/cropper/cropper.min'], 'jquery.autocompleter': ['plugs/jquery/autocompleter.min'], + baseUrl: baseRoot, + waitSeconds: 60, + map: {'*': {css: baseRoot + 'plugs/require/css.js'}}, + paths: { + 'vue': ['plugs/vue/vue.min'], + 'md5': ['plugs/jquery/md5.min'], + 'json': ['plugs/jquery/json.min'], + 'xlsx': ['plugs/jquery/xlsx.min'], + 'excel': ['plugs/jquery/excel.xlsx'], + 'base64': ['plugs/jquery/base64.min'], + 'upload': [tapiRoot + '/api.upload/index?'], + 'notify': ['plugs/notify/notify.min'], + 'angular': ['plugs/angular/angular.min'], + 'cropper': ['plugs/cropper/cropper.min'], + 'echarts': ['plugs/echarts/echarts.min'], + 'ckeditor4': ['plugs/ckeditor4/ckeditor'], + 'ckeditor5': ['plugs/ckeditor5/ckeditor'], + 'websocket': ['plugs/socket/websocket'], + 'pcasunzips': ['plugs/jquery/pcasunzips'], + 'sortablejs': ['plugs/sortable/sortable.min'], + 'vue.sortable': ['plugs/sortable/vue.draggable.min'], + 'jquery.ztree': ['plugs/ztree/ztree.all.min'], + 'jquery.masonry': ['plugs/jquery/masonry.min'], + 'jquery.cropper': ['plugs/cropper/cropper.min'], + 'jquery.autocompleter': ['plugs/jquery/autocompleter.min'], }, shim: { - 'excel': {deps: [baseRoot + 'plugs/layui_exts/excel.js']}, 'notify': {deps: ['css!' + baseRoot + 'plugs/notify/light.css']}, 'cropper': {deps: ['css!' + baseRoot + 'plugs/cropper/cropper.min.css']}, 'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']}, 'ckeditor5': {deps: ['jquery', 'upload', 'css!' + baseRoot + 'plugs/ckeditor5/ckeditor.css']}, 'vue.sortable': {deps: ['vue', 'sortablejs']}, 'jquery.ztree': {deps: ['jquery', 'css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']}, 'jquery.autocompleter': {deps: ['jquery', 'css!' + baseRoot + 'plugs/jquery/autocompleter.css']}, + 'excel': {deps: [baseRoot + 'plugs/layui_exts/excel.js']}, + 'notify': {deps: ['css!' + baseRoot + 'plugs/notify/light.css']}, + 'cropper': {deps: ['css!' + baseRoot + 'plugs/cropper/cropper.min.css']}, + 'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']}, + 'ckeditor5': {deps: ['jquery', 'upload', 'css!' + baseRoot + 'plugs/ckeditor5/ckeditor.css']}, + 'vue.sortable': {deps: ['vue', 'sortablejs']}, + 'jquery.ztree': {deps: ['jquery', 'css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']}, + 'jquery.autocompleter': {deps: ['jquery', 'css!' + baseRoot + 'plugs/jquery/autocompleter.css']}, } }); @@ -518,7 +548,7 @@ $(function () { /*! 表单转JSON */ $.fn.formToJson = function () { var self = this, data = {}, push = {}; - var rules = {key: /[a-zA-Z0-9_]+|(?=\[])/g, push: /^$/, fixed: /^\d+$/, named: /^[a-zA-Z0-9_]+$/}; + var rules = {key: /\w+|(?=\[])/g, push: /^$/, fixed: /^\d+$/, named: /^\w+$/}; this.build = function (base, key, value) { return (base[key] = value), base; }, this.pushCounter = function (name) { @@ -765,14 +795,11 @@ $(function () { /*! 显示任务进度消息 */ $.loadQueue = function (code, doScript, element) { - var doAjax = true, doReload = false; + var doAjax = true, doReload = false, template = '
...
' + '
'; layer.open({ type: 1, title: false, area: ['560px', '315px'], anim: 2, shadeClose: false, end: function () { - doAjax = false; - if (doReload && doScript) { - $.layTable.reload(((element || {}).dataset || {}).tableId || true); - } - }, content: '' + '
' + '
' + '
' + '
' + '
', success: function ($elem) { + doAjax = doReload && doScript && $.layTable.reload(((element || {}).dataset || {}).tableId || true), false; + }, content: laytpl(template).render({code: code}), success: function ($elem) { new function () { var that = this; this.$box = $elem.find('[data-queue-load=' + code + ']');