浏览代码

修改后台样式

邹景立 3 年之前
父节点
当前提交
aa596bd80d

+ 11 - 3
app/admin/controller/Auth.php

@@ -61,7 +61,6 @@ class Auth extends Controller
      */
     public function add()
     {
-        $this->_applyFormToken();
         $this->_form($this->table, 'form');
     }
 
@@ -74,7 +73,6 @@ class Auth extends Controller
      */
     public function edit()
     {
-        $this->_applyFormToken();
         $this->_form($this->table, 'form');
     }
 
@@ -116,12 +114,22 @@ class Auth extends Controller
             sysoplog('系统权限管理', "配置系统权限[{$map['auth']}]授权成功");
             $this->success('访问权限修改成功!', 'javascript:history.back()');
         } else {
-            $this->title = '权限配置节点';
             $this->_form($this->table, 'apply');
         }
     }
 
     /**
+     * 表单后置数据处理
+     * @param array $data
+     */
+    protected function _apply_form_filter(array &$data)
+    {
+        if ($this->request->isGet()) {
+            $this->title = "编辑【{$data['title']}】授权";
+        }
+    }
+
+    /**
      * 删除系统权限
      * @auth true
      * @throws \think\db\exception\DbException

+ 2 - 1
app/admin/controller/Base.php

@@ -48,7 +48,8 @@ class Base extends Controller
             $this->types = (new SystemBase)->types();
             $this->type = input('get.type') ?: ($this->types[0] ?? '-');
         }, function (QueryHelper $query) {
-            $query->where(['deleted' => 0])->equal('type')->like('code,name,status')->dateBetween('create_at');
+            $query->where(['deleted' => 0])->equal('type');
+            $query->like('code,name,status')->dateBetween('create_at');
         });
     }
 

+ 2 - 2
app/admin/controller/Menu.php

@@ -171,7 +171,7 @@ class Menu extends Controller
         if ($result) {
             $id = $this->app->db->name($this->table)->getLastInsID();
             sysoplog('系统菜单管理', "添加系统菜单[{$id}]成功");
-            $this->success('系统菜单添加成功!', 'javascript:location.reload()');
+            $this->success('系统菜单添加成功!');
         }
     }
 
@@ -184,7 +184,7 @@ class Menu extends Controller
         if ($result) {
             $id = input('id') ?: 0;
             sysoplog('系统菜单管理', "修改系统菜单[{$id}]成功");
-            $this->success('系统菜单修改成功!', 'javascript:location.reload()');
+            $this->success('系统菜单修改成功!');
         }
     }
 

+ 0 - 2
app/admin/controller/User.php

@@ -96,7 +96,6 @@ class User extends Controller
      */
     public function add()
     {
-        $this->_applyFormToken();
         $this->_form($this->table, 'form');
     }
 
@@ -109,7 +108,6 @@ class User extends Controller
      */
     public function edit()
     {
-        $this->_applyFormToken();
         $this->_form($this->table, 'form');
     }
 

+ 1 - 1
app/admin/model/SystemBase.php

@@ -37,7 +37,7 @@ class SystemBase extends Model
     public function items(string $type, array &$data = [], string $field = 'base_code', string $bind = 'base_info'): array
     {
         $map = ['status' => 1, 'deleted' => 0, 'type' => $type];
-        $bases = $this->where($map)->order('sort desc,id desc')->column('code,name,content', 'code');
+        $bases = $this->where($map)->order('sort desc,id asc')->column('code,name,content', 'code');
         if (count($data) > 0) foreach ($data as &$vo) $vo[$bind] = $bases[$vo[$field]] ?? [];
         return $bases;
     }

+ 14 - 0
app/admin/model/SystemQueue.php

@@ -1,5 +1,19 @@
 <?php
 
+// +----------------------------------------------------------------------
+// | ThinkAdmin
+// +----------------------------------------------------------------------
+// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// +----------------------------------------------------------------------
+// | 官方网站: https://thinkadmin.top
+// +----------------------------------------------------------------------
+// | 开源协议 ( https://mit-license.org )
+// | 免费声明 ( https://thinkadmin.top/disclaimer )
+// +----------------------------------------------------------------------
+// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
+// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
+// +----------------------------------------------------------------------
+
 namespace app\admin\model;
 
 use think\Model;

+ 14 - 0
app/admin/model/SystemUser.php

@@ -1,5 +1,19 @@
 <?php
 
+// +----------------------------------------------------------------------
+// | ThinkAdmin
+// +----------------------------------------------------------------------
+// | 版权所有 2014~2021 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
+// +----------------------------------------------------------------------
+// | 官方网站: https://thinkadmin.top
+// +----------------------------------------------------------------------
+// | 开源协议 ( https://mit-license.org )
+// | 免费声明 ( https://thinkadmin.top/disclaimer )
+// +----------------------------------------------------------------------
+// | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
+// | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
+// +----------------------------------------------------------------------
+
 namespace app\admin\model;
 
 use think\Model;

+ 1 - 1
app/admin/view/base/index.html

@@ -32,7 +32,7 @@
         // 初始化表格组件
         var $table = $('#BaseData').layTable({
             even: true, height: 'full',
-            sort: {field: 'sort desc,id', type: 'desc'},
+            sort: {field: 'sort desc,id', type: 'asc'},
             where: {type: '{$type|default=""}'},
             cols: [[
                 {checkbox: true, fixed: true},

+ 13 - 9
app/admin/view/queue/index.html

@@ -69,11 +69,12 @@
             cols: [[
                 {checkbox: true, fixed: 'left'},
                 {field: 'code', title: '任务编号', width: 140, sort: true},
-                {field: 'title', title: '任务名称', minWidth: 150},
-                {field: 'command', title: '任务指令', minWidth: 150},
+                {field: 'title', title: '任务名称', minWidth: 130},
+                {field: 'command', title: '任务指令', minWidth: 130},
                 {
                     field: 'exec_time', title: '计划时间', minWidth: 245, templet: function (d) {
-                        d.exec_time = d.exec_time || 0, d.loops_time = d.loops_time || 0;
+                        d.exec_time = d.exec_time || 0;
+                        d.loops_time = d.loops_time || 0;
                         if (d.loops_time > 0) {
                             return d.exec_time + ' ( 每 <b class="color-blue">' + d.loops_time + '</b> 秒 ) ';
                         } else {
@@ -82,8 +83,9 @@
                     }
                 },
                 {
-                    field: 'enter_time', title: '执行时间', minWidth: 180, templet: function (d) {
-                        d.enter_time = d.enter_time || '', d.outer_time = d.outer_time || '0.0000';
+                    field: 'enter_time', title: '执行时间', minWidth: 175, templet: function (d) {
+                        d.enter_time = d.enter_time || '';
+                        d.outer_time = d.outer_time || '0.0000';
                         if (d.enter_time.length > 12) {
                             return d.enter_time.substr(12) + '<span class="color-desc"> ( 耗时 ' + d.outer_time + ' )</span>';
                         } else {
@@ -94,7 +96,7 @@
                 {field: 'attempts', title: '执行次数', width: 95, align: 'center', sort: true, templet: "<div>{{d.attempts||0}}</div>"},
                 {field: 'exec_desc', title: '执行结果', minWidth: 180},
                 {field: 'create_at', title: '创建时间', minWidth: 170},
-                {toolbar: '#toolbar', title: '操作面板', align: 'left', fixed: 'right', minWidth: 225}
+                {toolbar: '#toolbar', title: '操作面板', fixed: 'right', minWidth: 235}
             ]]
         });
     });
@@ -102,13 +104,15 @@
 
 <script type="text/html" id="toolbar">
     {{# if(d.loops_time>0){ }}
-    <span class="layui-badge think-bg-blue">循</span>
+    <span class="layui-badge think-bg-blue" data-tips-text="完成操作后,延时指定时间会再次执行!">循</span>
+    {{# }else{ }}
+    <span class="layui-badge think-bg-red" data-tips-text="完成操作后,不会再次主动执行!">次</span>
     {{# } }}
 
     {{# if(d.rscript===1){ }}
-    <span class="layui-badge layui-bg-green">复</span>
+    <span class="layui-badge layui-bg-green" data-tips-text="可以存在多条记录,可同时执行多个任务!">复</span>
     {{# }else{ }}
-    <span class="layui-badge think-bg-violet">单</span>
+    <span class="layui-badge think-bg-violet" data-tips-text="只能存在一条记录,同一时间只能执行一个任务!">单</span>
     {{# } }}
 
     {{# if(d.status===1){ }}

+ 2 - 2
app/admin/view/queue/index_search.html

@@ -1,6 +1,6 @@
 <!--{if isset($isSuper) and $isSuper}-->
-<fieldset class="margin-bottom-15">
-    <legend class="notselect">服务状态</legend>
+<fieldset class="margin-bottom-15 shadow-inset">
+    <legend class="notselect think-bg-gray">服务状态</legend>
     <div class="layui-code border-0 margin-top-0">
         <h4 class="color-desc margin-top-10 notselect">后台服务主进程运行状态</h4>
         <div data-queue-message>Checking task process running status ...</div>

+ 1 - 1
app/admin/view/user/index_search.html

@@ -18,7 +18,7 @@
 
         <!--{notempty name='bases'}-->
         <div class="layui-form-item layui-inline">
-            <label class="layui-form-label">用户身份</label>
+            <label class="layui-form-label">角色身份</label>
             <div class="layui-input-inline">
                 <select name="usertype" lay-search class="layui-select">
                     <option value=''>-- 全部 --</option>

+ 1 - 1
app/admin/view/user/pass.html

@@ -5,7 +5,7 @@
                 <span class="color-green font-w7">登录用户账号</span>
                 <span class="color-desc margin-left-5">Username</span>
                 <!--{if isset($vo) and isset($vo.username)}-->
-                <input disabled value='{$vo.username|default=""}' class="layui-input layui-disabled">
+                <input disabled value='{$vo.username|default=""}' class="layui-input think-bg-gray">
                 <!--{else}-->
                 <input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入4位及以上字符登录用户账号" class="layui-input">
                 <!--{/if}-->

+ 85 - 70
public/static/admin.js

@@ -19,7 +19,6 @@ if (typeof Array.prototype.forEach !== 'function') {
         for (var i in this) callable.call(context, this[i], i, this)
     };
 }
-
 if (typeof Array.prototype.every !== 'function') {
     Array.prototype.every = function (callable) {
         for (var i in this) if (callable(this[i], i, this) === false) {
@@ -28,7 +27,6 @@ if (typeof Array.prototype.every !== 'function') {
         return true;
     };
 }
-
 if (typeof Array.prototype.some !== 'function') {
     Array.prototype.some = function (callable) {
         for (var i in this) if (callable(this[i], i, this) === true) {
@@ -38,10 +36,6 @@ if (typeof Array.prototype.some !== 'function') {
     };
 }
 
-/*! LayUI & jQuery */
-if (typeof jQuery === 'undefined') window.$ = window.jQuery = layui.$;
-window.form = layui.form, window.layer = layui.layer, window.laydate = layui.laydate;
-
 /*! 脚本应用根路径 */
 window.appRoot = (function (src) {
     return src.pop(), src.pop(), src.join('/') + '/';
@@ -55,7 +49,14 @@ window.baseRoot = (function (src) {
 /*! 动态插件库路径 */
 window.tapiRoot = window.tapiRoot || window.appRoot + "admin";
 
-/*! require 配置 */
+/*! 配置 layui 插件 */
+layui.config({base: baseRoot + 'plugs/layui_exts/'});
+
+/*! 挂载 layui & jquery 对象 */
+if (typeof jQuery === 'undefined') window.$ = window.jQuery = layui.$;
+window.form = layui.form, window.layer = layui.layer, window.laydate = layui.laydate;
+
+/*! 配置 require 参数  */
 require.config({
     waitSeconds: 60,
     baseUrl: baseRoot,
@@ -74,8 +75,8 @@ require.config({
         'websocket': ['plugs/socket/websocket'],
         'pcasunzips': ['plugs/jquery/pcasunzips'],
         'jquery.ztree': ['plugs/ztree/ztree.all.min'],
-        'jquery.cropper': ['plugs/jquery/cropper.min'],
         'jquery.masonry': ['plugs/jquery/masonry.min'],
+        'jquery.cropper': ['plugs/cropper/cropper.min'],
         'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
     },
     shim: {
@@ -412,13 +413,25 @@ $(function () {
     };
 
     /*! 注册对象到Jq */
-    $.vali = function (form, callable, options) {
-        return (new function (that) {
-            that = this;
-            /*! 绑定元素事件 */
+    $.vali = function (form, callable) {
+
+        if ($(form).attr('submit-listen')) {
+            return $(form).data('validate');
+        }
+
+        return (new function () {
+            var that = this;
+            /* 绑定表单元素 */
+            this.form = $(form);
+            /* 绑定元素事件 */
             this.evts = 'blur change';
-            /*! 筛选表单元素 */
+            /* 筛选表单元素 */
             this.tags = 'input,select,textarea';
+            /* 预设检测规则 */
+            this.patterns = {
+                phone: '^1[3-9][0-9]{9}$',
+                email: '^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$'
+            };
             /*! 去除字符串的空格 */
             this.trim = function (str) {
                 return str.replace(/(^\s*)|(\s*$)/g, '');
@@ -430,17 +443,20 @@ $(function () {
                 return typeof attrProp !== 'undefined' && attrProp !== null && attrProp !== false;
             };
             /*! 正则验证表单元素 */
-            this.isRegex = function (ele, regex, params) {
+            this.isRegex = function (ele) {
                 var real = this.trim($(ele).val());
-                regex = regex || ele.getAttribute('pattern');
-                if (real === "" || !regex) return true;
-                return new RegExp(regex, params || 'i').test(real);
+                var regexp = ele.getAttribute('pattern');
+                regexp = that.patterns[regexp] || regexp;
+                if (real === "" || !regexp) return true;
+                return new RegExp(regexp, 'i').test(real);
             };
             /*! 检侧所有表单元素 */
             this.checkAllInput = function () {
                 var isPass = true;
-                $(form).find(this.tags).each(function () {
-                    if (that.checkInput(this) === false) return $(this).focus(), isPass = false;
+                that.form.find(this.tags).each(function () {
+                    if (that.checkInput(this) === false) {
+                        return $(this).focus(), isPass = false;
+                    }
                 });
                 return isPass;
             };
@@ -477,31 +493,34 @@ $(function () {
                 return $(ele).data('input-info', $html.css(style).insertAfter(ele)), $html;
             };
             /*! 表单验证入口 */
-            this.check = function (form, callable) {
-                $(form).off(that.evts, that.tags).on(that.evts, that.tags, function () {
-                    that.checkInput(this);
-                }).attr('novalidate', 'novalidate').bind("submit", function (event) {
-                    if (that.checkAllInput() && typeof callable === 'function') {
-                        if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
-                            for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
-                        }
-                        callable.call(this, $(form).formToJson());
+            that.form.off(that.evts, that.tags).on(that.evts, that.tags, function () {
+                that.checkInput(this);
+            }).attr('novalidate', 'novalidate').attr('submit-listen', 'callable');
+            /*! 绑定提交事件 */
+            that.form.data('validate', this).bind("submit", function (event) {
+                /* 检查所有表单元素是否通过H5的规则验证 */
+                if (that.checkAllInput() && typeof callable === 'function') {
+                    if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
+                        for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
                     }
-                    return event.preventDefault(), false;
-                }).find('[data-form-loaded]').map(function () {
-                    $(this).html(this.dataset.formLoaded || this.innerHTML);
-                    $(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
-                });
-                return $(form).data('validate', this);
-            };
-        }).check(form, callable, options);
+                    /* 触发表单提交后,锁定三秒不能再次提交表单 */
+                    if (that.form.attr('submit-locked')) return false; else that.form.attr('submit-locked', 1);
+                    callable.call(this, that.form.formToJson()), setTimeout(function () {
+                        that.form.removeAttr('submit-locked');
+                    }, 3000)
+                }
+                return event.preventDefault(), false;
+            }).find('[data-form-loaded]').map(function () {
+                $(this).html(this.dataset.formLoaded || this.innerHTML);
+                $(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
+            });
+        });
     };
 
     /*! 自动监听规则内表单 */
     $.vali.listen = function () {
         $('form[data-auto]').map(function (index, form) {
-            if (this.dataset.listen === 'true') return true;
-            $(this).attr('data-listen', 'true').vali(function (data) {
+            $(this).vali(function (data) {
                 var type = form.method || 'POST', href = form.action || location.href;
                 var call = window[form.dataset.callable || '_default_callable'] || undefined;
                 var tips = form.dataset.tips || undefined, time = form.dataset.time || undefined;
@@ -516,13 +535,15 @@ $(function () {
 
     /*! 注册对象到JqFn */
     $.fn.vali = function (callable, options) {
-        return $.vali(this, callable, options);
+        return this.each(function () {
+            $.vali(this, callable, options);
+        });
     };
 
     /*! 表单转JSON */
     $.fn.formToJson = function () {
         var self = this, data = {}, push = {};
-        var patterns = {key: /[a-zA-Z0-9_]+|(?=\[])/g, push: /^$/, fixed: /^\d+$/, named: /^[a-zA-Z0-9_]+$/};
+        var rules = {key: /[a-zA-Z0-9_]+|(?=\[])/g, push: /^$/, fixed: /^\d+$/, named: /^[a-zA-Z0-9_]+$/};
         this.build = function (base, key, value) {
             return (base[key] = value), base;
         };
@@ -531,16 +552,12 @@ $(function () {
             return push[name]++;
         };
         $.each($(this).serializeArray(), function () {
-            var key, keys = this.name.match(patterns.key), merge = this.value, name = this.name;
+            var key, keys = this.name.match(rules.key), merge = this.value, name = this.name;
             while ((key = keys.pop()) !== undefined) {
                 name = name.replace(new RegExp("\\[" + key + "\\]$"), '');
-                if (key.match(patterns.push)) { // push
-                    merge = self.build([], self.pushCounter(name), merge);
-                } else if (key.match(patterns.fixed)) { // fixed
-                    merge = self.build([], key, merge);
-                } else if (key.match(patterns.named)) { // named
-                    merge = self.build({}, key, merge);
-                }
+                if (key.match(rules.push)) merge = self.build([], self.pushCounter(name), merge);
+                else if (key.match(rules.fixed)) merge = self.build([], key, merge);
+                else if (key.match(rules.named)) merge = self.build({}, key, merge);
             }
             data = $.extend(true, data, merge);
         });
@@ -663,7 +680,7 @@ $(function () {
             };
             // 动态设置最大高度
             if (opt.height === 'full') {
-                opt.height = $(window).height() - $(elem).removeClass('layui-hide').offset().top - 45;
+                opt.height = $(window).height() - $(elem).removeClass('layui-hide').offset().top - 55;
             }
             // 实例并绑定对象
             $(this).data('this', layui.table.render(bindData(opt)));
@@ -675,7 +692,7 @@ $(function () {
             }).bind('row sort tool edit radio toolbar checkbox rowDouble', function (evt, call) {
                 layui.table.on(evt.type + '(' + elem.dataset.id + ')', call)
             }).bind('setFullHeight', function () {
-                $(elem).trigger('reload', {height: $(window).height() - $(elem).next().offset().top - 35})
+                $(elem).trigger('reload', {height: $(window).height() - $(elem).next().offset().top - 45})
             }).trigger('sort', function (object) {
                 (sort = object), $(elem).trigger('reload')
             });
@@ -836,24 +853,22 @@ $(function () {
 
     /*! 注册 data-copy 事件行为 */
     onEvent('click', '[data-copy]', function () {
-        $.copyToClipboard(this.dataset.copy);
+        (function (content, $textarea) {
+            $body.append($textarea.val(content)), $textarea.select();
+            document.execCommand('Copy') ? $.msg.tips('已复制到剪贴板!') : $.msg.tips('请使用鼠标操作复制!');
+            $textarea.remove();
+        })(this.dataset.copy, $('<textarea style="position:fixed;top:-500px"></textarea>'));
     });
-    $.copyToClipboard = function (content, input) {
-        input = document.createElement('textarea');
-        input.style.position = 'absolute', input.style.left = '-100000px';
-        input.style.width = '1px', input.style.height = '1px', input.innerText = content;
-        document.body.appendChild(input), input.select(), setTimeout(function () {
-            document.execCommand('Copy') ? $.msg.tips('复制成功') : $.msg.tips('复制失败,请使用鼠标操作复制!');
-            document.body.removeChild(input);
-        }, 100);
-    };
 
     /*! 注册 data-tips-text 事件行为 */
     onEvent('mouseenter', '[data-tips-text]', function () {
-        var opt = {tips: [$(this).attr('data-tips-type') || 3, '#78BA32'], time: 0};
-        $(this).attr('index', layer.tips($(this).attr('data-tips-text') || this.innerText, this, opt));
-    }).on('mouseleave', '[data-tips-text]', function () {
-        layer.close($(this).attr('index'));
+        var opts = {tips: [$(this).attr('data-tips-type') || 3, '#78BA32'], time: 0}, that = this;
+        $(this).attr('index', layer.tips($(this).attr('data-tips-text') || this.innerText, this, opts));
+        $(this).off('mouseleave').on('mouseleave', function () {
+            setTimeout(function () {
+                layer.close($(that).attr('index'));
+            }, 100);
+        });
     });
 
     /*! 注册 data-tips-image 事件行为 */
@@ -870,20 +885,20 @@ $(function () {
         $(this).off('mouseleave').on('mouseleave', function () {
             setTimeout(function () {
                 layer.close($(that).attr('index'));
-            }, 100)
+            }, 100);
         });
     });
 
     $.previewImage = function (src, area) {
-        var img = new Image(), defer = $.Deferred(), load = $.msg.loading();
-        img.style.background = '#FFFFFF', img.referrerPolicy = 'no-referrer';
+        var img = new Image(), defer = $.Deferred(), loaded = $.msg.loading();
+        img.style.background = '#FFF', img.referrerPolicy = 'no-referrer';
         img.style.height = 'auto', img.style.width = area || '480px', img.style.display = 'none';
         document.body.appendChild(img), img.onerror = function () {
-            $.msg.close(load), defer.reject();
+            $.msg.close(loaded), defer.reject();
         }, img.onload = function () {
             layer.open({
-                type: 1, title: false, shadeClose: true, content: $(img), success: function ($ele, idx) {
-                    $.msg.close(load), defer.notify($ele, idx);
+                type: 1, title: false, shadeClose: true, content: $(img), success: function ($elem, idx) {
+                    $.msg.close(loaded), defer.notify($elem, idx);
                 }, area: area || '480px', skin: 'layui-layer-nobg', closeBtn: 1, end: function () {
                     document.body.removeChild(img), defer.resolve()
                 }

文件差异内容过多而无法显示
+ 0 - 0
public/static/plugs/layui_exts/excel.js


+ 255 - 0
public/static/plugs/layui_exts/tableSelect.js

@@ -0,0 +1,255 @@
+layui.define(['table', 'jquery', 'form'], function (exports) {
+    "use strict";
+
+    var MOD_NAME = 'tableSelect',
+        $ = layui.jquery,
+        table = layui.table,
+        form = layui.form;
+    var tableSelect = function () {
+        this.v = '1.1.0';
+    };
+
+    /**
+    * 初始化表格选择器
+    */
+    tableSelect.prototype.render = function (opt) {
+        var elem = $(opt.elem);
+        var tableDone = opt.table.done || function(){};
+		
+        //默认设置
+        opt.searchKey = opt.searchKey || 'keyword';
+        opt.searchPlaceholder = opt.searchPlaceholder || '关键词搜索';
+        opt.checkedKey = opt.checkedKey;
+        opt.table.page = opt.table.page || true;
+        opt.table.height = opt.table.height || 315;
+        
+        elem.off('click').on('click', function(e) {
+            e.stopPropagation();
+
+            if($('div.tableSelect').length >= 1){
+                return false;
+            }
+
+            var t = elem.offset().top + elem.outerHeight()+"px";
+            var l = elem.offset().left +"px";
+            var tableName = "tableSelect_table_" + new Date().getTime();
+            var tableBox = '<div class="tableSelect layui-anim layui-anim-upbit" style="left:'+l+';top:'+t+';border: 1px solid #d2d2d2;background-color: #fff;box-shadow: 0 2px 4px rgba(0,0,0,.12);padding:10px 10px 0 10px;position: absolute;z-index:66666666;margin: 5px 0;border-radius: 2px;min-width:530px;">';
+                tableBox += '<div class="tableSelectBar">';
+                tableBox += '<form class="layui-form" action="" style="display:inline-block;">';
+                tableBox += '<input style="display:inline-block;width:190px;height:30px;vertical-align:middle;margin-right:-1px;border: 1px solid #C9C9C9;" type="text" name="'+opt.searchKey+'" placeholder="'+opt.searchPlaceholder+'" autocomplete="off" class="layui-input"><button class="layui-btn layui-btn-sm layui-btn-primary tableSelect_btn_search" lay-submit lay-filter="tableSelect_btn_search"><i class="layui-icon layui-icon-search"></i></button>';
+                tableBox += '</form>';
+                tableBox += '<button style="float:right;" class="layui-btn layui-btn-sm tableSelect_btn_select">选择<span></span></button>';
+                tableBox += '</div>';
+                tableBox += '<table id="'+tableName+'" lay-filter="'+tableName+'"></table>';
+                tableBox += '</div>';
+                tableBox = $(tableBox);
+            $('body').append(tableBox);
+            
+            //数据缓存
+            var checkedData = [];
+
+            //渲染TABLE
+            opt.table.elem = "#"+tableName;
+            opt.table.id = tableName;
+            opt.table.done = function(res, curr, count){
+                defaultChecked(res, curr, count);
+                setChecked(res, curr, count);
+                tableDone(res, curr, count);
+            };
+            var tableSelect_table = table.render(opt.table);
+
+            //分页选中保存数组
+            table.on('radio('+tableName+')', function(obj){
+                if(opt.checkedKey){
+                    checkedData = table.checkStatus(tableName).data
+                }
+                updataButton(table.checkStatus(tableName).data.length)
+            })
+			table.on('checkbox('+tableName+')', function(obj){
+                if(opt.checkedKey){
+                    if(obj.checked){
+                        for (var i=0;i<table.checkStatus(tableName).data.length;i++){
+                            checkedData.push(table.checkStatus(tableName).data[i])
+                        }
+                    }else{
+                        if(obj.type=='all'){
+                            for (var j=0;j<table.cache[tableName].length;j++) {
+                                for (var i=0;i<checkedData.length;i++){
+                                    if(checkedData[i][opt.checkedKey] == table.cache[tableName][j][opt.checkedKey]){
+                                        checkedData.splice(i,1)
+                                    }
+                                }
+                            }
+                        }else{
+                            //因为LAYUI问题,操作到变化全选状态时获取到的obj为空,这里用函数获取未选中的项。
+                            function nu (){
+                                var noCheckedKey = '';
+                                for (var i=0;i<table.cache[tableName].length;i++){
+                                    if(!table.cache[tableName][i].LAY_CHECKED){
+                                        noCheckedKey = table.cache[tableName][i][opt.checkedKey];
+                                    }
+                                }
+                                return noCheckedKey
+                            }
+                            var noCheckedKey = obj.data[opt.checkedKey] || nu();
+                            for (var i=0;i<checkedData.length;i++){
+                                if(checkedData[i][opt.checkedKey] == noCheckedKey){
+                                    checkedData.splice(i,1);
+                                }
+                            }
+                        }
+                    }
+                    checkedData = uniqueObjArray(checkedData, opt.checkedKey);
+                    updataButton(checkedData.length)
+                }else{
+                    updataButton(table.checkStatus(tableName).data.length)
+                }
+            });
+
+            //渲染表格后选中
+            function setChecked (res, curr, count) {
+				for(var i=0;i<res.data.length;i++){
+            		for (var j=0;j<checkedData.length;j++) {
+            			if(res.data[i][opt.checkedKey] == checkedData[j][opt.checkedKey]){
+            				res.data[i].LAY_CHECKED = true;
+                            var index= res.data[i]['LAY_TABLE_INDEX'];
+                            var checkbox = $('#'+tableName+'').next().find('tr[data-index=' + index + '] input[type="checkbox"]');
+            				    checkbox.prop('checked', true).next().addClass('layui-form-checked');
+                            var radio  = $('#'+tableName+'').next().find('tr[data-index=' + index + '] input[type="radio"]');
+                                radio.prop('checked', true).next().addClass('layui-form-radioed').find("i").html('&#xe643;');
+            			}
+            		}
+            	}
+            	var checkStatus = table.checkStatus(tableName);
+				if(checkStatus.isAll){
+					$('#'+tableName+'').next().find('.layui-table-header th[data-field="0"] input[type="checkbox"]').prop('checked', true);
+					$('#'+tableName+'').next().find('.layui-table-header th[data-field="0"] input[type="checkbox"]').next().addClass('layui-form-checked');
+				}
+				updataButton(checkedData.length)
+            }
+            
+            //写入默认选中值(puash checkedData)
+            function defaultChecked (res, curr, count){
+                if(opt.checkedKey && elem.attr('ts-selected')){
+                    var selected = elem.attr('ts-selected').split(",");
+                    for(var i=0;i<res.data.length;i++){
+                        for(var j=0;j<selected.length;j++){
+                            if(res.data[i][opt.checkedKey] == selected[j]){
+                                checkedData.push(res.data[i])
+                            }
+                        }
+                    }
+                    checkedData = uniqueObjArray(checkedData, opt.checkedKey);
+                }
+            }
+
+			//更新选中数量
+			function updataButton (n) {
+				tableBox.find('.tableSelect_btn_select span').html(n==0?'':'('+n+')')
+            }
+            
+            //数组去重
+			function uniqueObjArray(arr, type){
+                var newArr = [];
+                var tArr = [];
+                if(arr.length == 0){
+                    return arr;
+                }else{
+                    if(type){
+                        for(var i=0;i<arr.length;i++){
+                            if(!tArr[arr[i][type]]){
+                                newArr.push(arr[i]);
+                                tArr[arr[i][type]] = true;
+                            }
+                        }
+                        return newArr;
+                    }else{
+                        for(var i=0;i<arr.length;i++){
+                            if(!tArr[arr[i]]){
+                                newArr.push(arr[i]);
+                                tArr[arr[i]] = true;
+                            }
+                        }
+                        return newArr;
+                    }
+                }
+            }
+
+			//FIX位置
+			var overHeight = (elem.offset().top + elem.outerHeight() + tableBox.outerHeight() - $(window).scrollTop()) > $(window).height();
+			var overWidth = (elem.offset().left + tableBox.outerWidth()) > $(window).width();
+			    overHeight && tableBox.css({'top':'auto','bottom':'0px'});
+			    overWidth && tableBox.css({'left':'auto','right':'5px'})
+			
+            //关键词搜索
+            form.on('submit(tableSelect_btn_search)', function(data){
+                tableSelect_table.reload({
+                    where: data.field,
+                    page: {
+                      curr: 1
+                    }
+                  });
+                return false;
+            });
+
+            //双击行选中
+            table.on('rowDouble('+tableName+')', function(obj){
+                var checkStatus = {data:[obj.data]};
+                selectDone(checkStatus);
+            })
+
+            //按钮选中
+            tableBox.find('.tableSelect_btn_select').on('click', function() {
+                var checkStatus = table.checkStatus(tableName);
+                if(checkedData.length > 1){
+                	checkStatus.data = checkedData;
+                }
+                selectDone(checkStatus);
+            })
+
+            //写值回调和关闭
+            function selectDone (checkStatus){
+                if(opt.checkedKey){
+                    var selected = [];
+                    for(var i=0;i<checkStatus.data.length;i++){
+                        selected.push(checkStatus.data[i][opt.checkedKey])
+                    }
+                    elem.attr("ts-selected",selected.join(","));
+                }
+                opt.done(elem, checkStatus);
+                tableBox.remove();
+                delete table.cache[tableName];
+                checkedData = [];
+            }
+            
+            //点击其他区域关闭
+            $(document).mouseup(function(e){
+                var userSet_con = $(''+opt.elem+',.tableSelect');
+                if(!userSet_con.is(e.target) && userSet_con.has(e.target).length === 0){
+                    tableBox.remove();
+                    delete table.cache[tableName];
+                    checkedData = [];
+                }
+            });
+        })
+    }
+
+    /**
+    * 隐藏选择器
+    */
+    tableSelect.prototype.hide = function (opt) {
+        $('.tableSelect').remove();
+    }
+
+    //自动完成渲染
+    var tableSelect = new tableSelect();
+
+    //FIX 滚动时错位
+    if(window.top == window.self){
+        $(window).scroll(function () {
+            tableSelect.hide();
+        });
+    }
+
+    exports(MOD_NAME, tableSelect);
+})

+ 4 - 3
public/static/theme/css/console.config.less

@@ -24,14 +24,15 @@
 
 // 基础阴影样式配置
 @ShadowMinOuter: 0 2px 3px 0 rgba(0, 0, 0, .11);
-@ShadowMaxOuter: 0 2px 3px 0 rgba(0, 0, 0, .22);
+@ShadowMaxOuter: 0 1px 6px 0 rgba(0, 0, 0, .33);
 @ShadowMinInset: 0 2px 5px 0 rgba(0, 0, 0, .11) inset;
 @ShadowMaxInset: 0 2px 20px 0 rgba(0, 0, 0, .11) inset;
+@ShadowDownInset: 0 2px 5px 0 rgba(0, 0, 0, .22) inset;
 
 // 导航条颜色配置
 @TopHeaderTextColor: #333;
 @TopHeaderBackColor: #FFF;
-@TopHeaderBottomLine: 1px solid #E5E5E5;
+@TopHeaderBottomLine: 1px solid rgba(0, 0, 0, .22);
 @TopHeaderNavNormalTextColor: @TopHeaderTextColor;
 @TopHeaderNavNormalBackColor: @TopHeaderBackColor;
 
@@ -46,7 +47,7 @@
 @LeftMainBackColor: #393D49 !important;
 @LeftMainSubBackColor: rgba(0, 0, 0, .3) !important;
 
-@LeftMainNavHoverBackColor: hsla(0, 0%, 39%, .2) !important;
+@LeftMainNavHoverBackColor: rgba(99, 99, 99, .2) !important;
 @LeftMainNavHoverTextColor: #FFF;
 
 @LeftMainNavNormalBackColor: none;

文件差异内容过多而无法显示
+ 0 - 0
public/static/theme/css/console.css


文件差异内容过多而无法显示
+ 0 - 0
public/static/theme/css/console.css.map


+ 154 - 23
public/static/theme/css/console.custom.less

@@ -21,8 +21,7 @@
   text-align: center;
   line-height: 22px;
   border-radius: @BoxBorderRadius;
-  letter-spacing: 6px;
-  border: 1px solid @BoxBorderColor;
+  letter-spacing: 1px;
   background-color: #f2f2f2;
 }
 
@@ -44,6 +43,10 @@
   overflow: hidden !important;
 }
 
+.overauto {
+  overflow: auto !important;
+}
+
 .fixed {
   position: fixed !important;
 }
@@ -56,10 +59,6 @@
   position: relative !important
 }
 
-.block {
-  display: block !important
-}
-
 .pointer {
   cursor: pointer !important
 }
@@ -72,6 +71,10 @@
   box-shadow: @ShadowMaxOuter;
 }
 
+.shadow-inset {
+  box-shadow: @ShadowMaxInset;
+}
+
 .shadow-mini {
   box-shadow: @ShadowMinOuter;
 }
@@ -85,16 +88,54 @@
   font-size: 12px
 }
 
-.table-block {
-  width: 100%;
-  display: table !important;
-  box-sizing: border-box;
+.block {
+  display: block !important
 }
 
 .inline-block {
   display: inline-block !important
 }
 
+@think-elips: {
+  display: -webkit-box;
+  overflow: hidden;
+  line-height: 1.4em;
+  text-overflow: ellipsis;
+  -webkit-box-orient: vertical;
+}
+
+.think-elips {
+  &-1 {
+    @think-elips();
+    line-clamp: 1;
+    -webkit-line-clamp: 1;
+  }
+
+  &-2 {
+    @think-elips();
+    line-clamp: 2;
+    -webkit-line-clamp: 2;
+  }
+
+  &-3 {
+    @think-elips();
+    line-clamp: 3;
+    -webkit-line-clamp: 3;
+  }
+
+  &-4 {
+    @think-elips();
+    line-clamp: 4;
+    -webkit-line-clamp: 4;
+  }
+
+  &-5 {
+    @think-elips();
+    line-clamp: 5;
+    -webkit-line-clamp: 5;
+  }
+}
+
 .think-box-shadow {
   padding: 20px !important;
   background: #fff !important;
@@ -259,6 +300,85 @@
   }
 }
 
+
+label.think-radio,
+label.think-checkbox {
+  cursor: pointer;
+  margin-right: 10px;
+  display: inline-block;
+}
+
+.think-radio,
+.think-checkbox {
+  .notselect();
+  margin-top: 10px;
+  font-weight: 400;
+  line-height: 18px;
+
+  input[type=radio],
+  input[type=checkbox] {
+    width: 18px;
+    height: 18px;
+    cursor: pointer;
+    border: 1px solid @RadioBorderNormalColor;
+    position: relative;
+    background: #fff;
+    margin-right: 5px;
+    vertical-align: bottom;
+    display: inline-block !important;
+    box-sizing: border-box !important;
+    appearance: none;
+    -webkit-appearance: none;
+
+    &:checked {
+      border-color: #009688;
+
+      &:after {
+        display: block;
+        position: relative;
+        animation-duration: .3s;
+        -webkit-animation-duration: .3s;
+        animation-fill-mode: both;
+        -webkit-animation-fill-mode: both;
+        animation-name: layui-scale-spring;
+        -webkit-animation-name: layui-scale-spring;
+      }
+    }
+  }
+
+  input[type=radio] {
+    border-radius: 1em;
+
+    &:checked:after {
+      top: 4px;
+      left: 4px;
+      width: 8px;
+      height: 8px;
+      cursor: pointer;
+      content: '';
+      background: #009688;
+      border-radius: 1em;
+    }
+  }
+
+  input[type=checkbox] {
+    border-radius: 1px;
+
+    &:checked:after {
+      color: #009688;
+      cursor: pointer;
+      padding: 2px;
+      content: "\e605";
+      font-size: 12px;
+      font-style: normal;
+      font-weight: 700;
+      font-family: layui-icon !important;
+      -webkit-font-smoothing: antialiased;
+      -moz-osx-font-smoothing: grayscale
+    }
+  }
+}
+
 /* 通用分页 */
 .pagination-container {
   margin-top: 20px;
@@ -271,6 +391,10 @@
     font-size: 9pt
   }
 
+  select {
+    border: 1px solid #DDD;
+  }
+
   ul {
     float: right;
     height: 30px;
@@ -343,14 +467,14 @@
     height: 1px;
     margin: 15px 0;
     background-color: #fff;
-    border-top: 1px dashed #e7eaec
+    border-top: 1px dashed #e7eaec;
   }
 
   &solid {
     margin-top: 15px;
     margin-bottom: 15px;
     border-bottom: 1px solid #e7eaec;
-    background-color: rgba(0, 0, 0, 0)
+    background-color: rgba(0, 0, 0, 0);
   }
 }
 
@@ -453,29 +577,36 @@
 }
 
 .think-bg- {
-  &white {
-    background: white !important
+
+  &red {
+    color: #FFF;
+    background: linear-gradient(-125deg, #ff7d7d, #fb2c95) !important
+  }
+
+  &gray {
+    color: #333;
+    background: linear-gradient(-113deg, #EEEEEE, #EEEEEE) !important
   }
 
   &blue {
+    color: #FFF;
     background: linear-gradient(-125deg, #57bdbf, #2f9de2) !important
   }
 
   &orig {
+    color: #FFF;
     background: linear-gradient(-141deg, #ecca1b, #f39526) !important
   }
 
-  &red {
-    background: linear-gradient(-125deg, #ff7d7d, #fb2c95) !important
-  }
-
-  &gray {
-    background: linear-gradient(-113deg, #EEEEEE, #EFEFEF) !important
-  }
-
   &violet {
+    color: #FFF;
     background: linear-gradient(-113deg, #c543d8, #925cc3) !important
   }
+
+  &white {
+    color: #333;
+    background: white !important
+  }
 }
 
 .text- {
@@ -1132,4 +1263,4 @@
       padding-bottom: 40px !important
     }
   }
-}
+}

+ 41 - 103
public/static/theme/css/console.display.less

@@ -223,47 +223,64 @@ fieldset {
     }
   }
 
-  .layui-form-label {
-    width: auto !important;
-    height: 32px;
-    padding: 0 8px;
-    line-height: 32px;
-    border-color: @InputBorderNormalColor;
-  }
+  .layui-form-item {
+    &:last-child {
+      border: none
+    }
 
-  .layui-input-inline {
-    width: 170px;
-    display: inline-block !important;
-    margin: 0 10px 0 -1px !important;
+    white-space: nowrap;
+    margin-right: 8px;
+    border: 1px solid @InputBorderNormalColor;
 
-    input, select {
-      width: 100%;
-      height: 32px;
+    .layui-form-label {
+      width: auto !important;
+      border: none;
+      height: 30px;
       padding: 0 8px;
       line-height: 32px;
-      border-color: @InputBorderNormalColor;
+      border-right: 1px solid @InputBorderNormalColor;
     }
-  }
 
-  .layui-form-select dl {
-    top: 31px;
-    padding: 0;
-    border-color: @InputBorderActiveColor;
+    .layui-input-inline {
+      width: 150px;
+      margin: 0 !important;
+      display: inline-block !important;
+
+      input, select {
+        width: 100%;
+        height: 30px;
+        padding: 0 8px;
+        line-height: 32px;
+        border-width: 0;
+      }
+    }
+
+    .layui-form-select {
+      dl {
+        top: 32px;
+        padding: 0;
+        border-width: 0;
+        box-shadow: @ShadowMaxOuter;
+        border-top-left-radius: 0;
+        border-top-right-radius: 0;
+      }
+    }
   }
 }
 
 /* 表单验证异常提示 */
 .label-required {
   &-prev:before {
-    width: 1em;
     color: red;
+    width: 0.5em;
     content: '*';
+    margin: -2px 0 0 -0.55em;
     display: inline-block;
     position: absolute;
+    font-size: 14px;
     text-align: left;
-    font-weight: 700;
+    font-weight: bold;
     line-height: 1.6em;
-    margin-left: -0.8em;
   }
 
   &:after, &-next:after {
@@ -304,83 +321,6 @@ fieldset {
   }
 }
 
-label.think-radio,
-label.think-checkbox {
-  cursor: pointer;
-  margin-right: 10px;
-  display: inline-block;
-}
-
-.think-radio,
-.think-checkbox {
-  margin-top: 10px;
-  font-weight: 400;
-  line-height: 18px;
-
-  input[type=radio],
-  input[type=checkbox] {
-    width: 18px;
-    height: 18px;
-    cursor: pointer;
-    border: 1px solid @RadioBorderNormalColor;
-    position: relative;
-    background: #fff;
-    margin-right: 5px;
-    vertical-align: bottom;
-    display: inline-block !important;
-    box-sizing: border-box !important;
-    appearance: none;
-    -webkit-appearance: none;
-
-    &:checked {
-      border-color: #009688;
-
-      &:after {
-        display: block;
-        position: relative;
-        animation-duration: .3s;
-        -webkit-animation-duration: .3s;
-        animation-fill-mode: both;
-        -webkit-animation-fill-mode: both;
-        animation-name: layui-scale-spring;
-        -webkit-animation-name: layui-scale-spring;
-      }
-    }
-  }
-
-  input[type=radio] {
-    border-radius: 1em;
-
-    &:checked:after {
-      top: 4px;
-      left: 4px;
-      width: 8px;
-      height: 8px;
-      cursor: pointer;
-      content: '';
-      background: #009688;
-      border-radius: 1em;
-    }
-  }
-
-  input[type=checkbox] {
-    border-radius: 1px;
-
-    &:checked:after {
-      color: #009688;
-      cursor: pointer;
-      padding: 2px;
-      content: "\e605";
-      font-size: 12px;
-      font-style: normal;
-      font-weight: 700;
-      font-family: layui-icon !important;
-      -webkit-font-smoothing: antialiased;
-      -moz-osx-font-smoothing: grayscale
-    }
-  }
-}
-
 .layui-table {
   td, th {
     font-size: 12px;
@@ -440,15 +380,13 @@ table.layui-table {
   &[lay-size="lg"] {
     input.layui-input, .layui-btn.layui-btn-sm {
       height: 38px;
-      line-height: 38px;
       box-sizing: border-box;
+      line-height: 38px;
     }
   }
 }
 
 .layui-table-view {
-  margin-bottom: 0;
-
   .layui-table-page {
     .layui-laypage {
       .layui-laypage-prev,

+ 6 - 5
public/static/theme/css/console.layout.less

@@ -19,7 +19,7 @@
     left: @LayoutDefaLeftSzie;
     right: 0;
     color: @TopHeaderTextColor !important;
-    height: @TopHeaderHeight;
+    height: @TopHeaderHeight !important;
     position: absolute;
     box-sizing: content-box;
     background: @TopHeaderBackColor !important;
@@ -43,8 +43,8 @@
 
       &.layui-layout-right {
         .headimg {
-          width: 20px;
-          height: 20px;
+          width: 22px;
+          height: 22px;
         }
       }
 
@@ -235,12 +235,13 @@
     top: @BodyMainTop;
     left: @LayoutDefaLeftSzie;
     padding: 0;
+    background: @BodyMainBackColor;
+    box-shadow: @ShadowDownInset;
 
     > .layui-card {
       box-shadow: none !important;
       background: none !important;
 
-
       > .layui-card-body {
         top: 0;
         width: 100%;
@@ -250,7 +251,7 @@
         overflow: auto;
         position: absolute;
         box-sizing: border-box;
-        background: @BodyMainBackColor;
+
 
         > .layui-card-table {
           padding: 15px;

部分文件因为文件数量过多而无法显示