mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-24 15:56:44 +08:00
修改后台样式
This commit is contained in:
parent
15b6202ee9
commit
aa596bd80d
@ -61,7 +61,6 @@ class Auth extends Controller
|
|||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$this->_applyFormToken();
|
|
||||||
$this->_form($this->table, 'form');
|
$this->_form($this->table, 'form');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +73,6 @@ class Auth extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
$this->_applyFormToken();
|
|
||||||
$this->_form($this->table, 'form');
|
$this->_form($this->table, 'form');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,11 +114,21 @@ class Auth extends Controller
|
|||||||
sysoplog('系统权限管理', "配置系统权限[{$map['auth']}]授权成功");
|
sysoplog('系统权限管理', "配置系统权限[{$map['auth']}]授权成功");
|
||||||
$this->success('访问权限修改成功!', 'javascript:history.back()');
|
$this->success('访问权限修改成功!', 'javascript:history.back()');
|
||||||
} else {
|
} else {
|
||||||
$this->title = '权限配置节点';
|
|
||||||
$this->_form($this->table, 'apply');
|
$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
|
* @auth true
|
||||||
|
@ -48,7 +48,8 @@ class Base extends Controller
|
|||||||
$this->types = (new SystemBase)->types();
|
$this->types = (new SystemBase)->types();
|
||||||
$this->type = input('get.type') ?: ($this->types[0] ?? '-');
|
$this->type = input('get.type') ?: ($this->types[0] ?? '-');
|
||||||
}, function (QueryHelper $query) {
|
}, 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');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ class Menu extends Controller
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$id = $this->app->db->name($this->table)->getLastInsID();
|
$id = $this->app->db->name($this->table)->getLastInsID();
|
||||||
sysoplog('系统菜单管理', "添加系统菜单[{$id}]成功");
|
sysoplog('系统菜单管理', "添加系统菜单[{$id}]成功");
|
||||||
$this->success('系统菜单添加成功!', 'javascript:location.reload()');
|
$this->success('系统菜单添加成功!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ class Menu extends Controller
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$id = input('id') ?: 0;
|
$id = input('id') ?: 0;
|
||||||
sysoplog('系统菜单管理', "修改系统菜单[{$id}]成功");
|
sysoplog('系统菜单管理', "修改系统菜单[{$id}]成功");
|
||||||
$this->success('系统菜单修改成功!', 'javascript:location.reload()');
|
$this->success('系统菜单修改成功!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,6 @@ class User extends Controller
|
|||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$this->_applyFormToken();
|
|
||||||
$this->_form($this->table, 'form');
|
$this->_form($this->table, 'form');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +108,6 @@ class User extends Controller
|
|||||||
*/
|
*/
|
||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
$this->_applyFormToken();
|
|
||||||
$this->_form($this->table, 'form');
|
$this->_form($this->table, 'form');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class SystemBase extends Model
|
|||||||
public function items(string $type, array &$data = [], string $field = 'base_code', string $bind = 'base_info'): array
|
public function items(string $type, array &$data = [], string $field = 'base_code', string $bind = 'base_info'): array
|
||||||
{
|
{
|
||||||
$map = ['status' => 1, 'deleted' => 0, 'type' => $type];
|
$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]] ?? [];
|
if (count($data) > 0) foreach ($data as &$vo) $vo[$bind] = $bases[$vo[$field]] ?? [];
|
||||||
return $bases;
|
return $bases;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
<?php
|
<?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;
|
namespace app\admin\model;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
<?php
|
<?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;
|
namespace app\admin\model;
|
||||||
|
|
||||||
use think\Model;
|
use think\Model;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
// 初始化表格组件
|
// 初始化表格组件
|
||||||
var $table = $('#BaseData').layTable({
|
var $table = $('#BaseData').layTable({
|
||||||
even: true, height: 'full',
|
even: true, height: 'full',
|
||||||
sort: {field: 'sort desc,id', type: 'desc'},
|
sort: {field: 'sort desc,id', type: 'asc'},
|
||||||
where: {type: '{$type|default=""}'},
|
where: {type: '{$type|default=""}'},
|
||||||
cols: [[
|
cols: [[
|
||||||
{checkbox: true, fixed: true},
|
{checkbox: true, fixed: true},
|
||||||
|
@ -69,11 +69,12 @@
|
|||||||
cols: [[
|
cols: [[
|
||||||
{checkbox: true, fixed: 'left'},
|
{checkbox: true, fixed: 'left'},
|
||||||
{field: 'code', title: '任务编号', width: 140, sort: true},
|
{field: 'code', title: '任务编号', width: 140, sort: true},
|
||||||
{field: 'title', title: '任务名称', minWidth: 150},
|
{field: 'title', title: '任务名称', minWidth: 130},
|
||||||
{field: 'command', title: '任务指令', minWidth: 150},
|
{field: 'command', title: '任务指令', minWidth: 130},
|
||||||
{
|
{
|
||||||
field: 'exec_time', title: '计划时间', minWidth: 245, templet: function (d) {
|
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) {
|
if (d.loops_time > 0) {
|
||||||
return d.exec_time + ' ( 每 <b class="color-blue">' + d.loops_time + '</b> 秒 ) ';
|
return d.exec_time + ' ( 每 <b class="color-blue">' + d.loops_time + '</b> 秒 ) ';
|
||||||
} else {
|
} else {
|
||||||
@ -82,8 +83,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'enter_time', title: '执行时间', minWidth: 180, templet: function (d) {
|
field: 'enter_time', title: '执行时间', minWidth: 175, templet: function (d) {
|
||||||
d.enter_time = d.enter_time || '', d.outer_time = d.outer_time || '0.0000';
|
d.enter_time = d.enter_time || '';
|
||||||
|
d.outer_time = d.outer_time || '0.0000';
|
||||||
if (d.enter_time.length > 12) {
|
if (d.enter_time.length > 12) {
|
||||||
return d.enter_time.substr(12) + '<span class="color-desc"> ( 耗时 ' + d.outer_time + ' )</span>';
|
return d.enter_time.substr(12) + '<span class="color-desc"> ( 耗时 ' + d.outer_time + ' )</span>';
|
||||||
} else {
|
} else {
|
||||||
@ -94,7 +96,7 @@
|
|||||||
{field: 'attempts', title: '执行次数', width: 95, align: 'center', sort: true, templet: "<div>{{d.attempts||0}}</div>"},
|
{field: 'attempts', title: '执行次数', width: 95, align: 'center', sort: true, templet: "<div>{{d.attempts||0}}</div>"},
|
||||||
{field: 'exec_desc', title: '执行结果', minWidth: 180},
|
{field: 'exec_desc', title: '执行结果', minWidth: 180},
|
||||||
{field: 'create_at', title: '创建时间', minWidth: 170},
|
{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">
|
<script type="text/html" id="toolbar">
|
||||||
{{# if(d.loops_time>0){ }}
|
{{# 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){ }}
|
{{# if(d.rscript===1){ }}
|
||||||
<span class="layui-badge layui-bg-green">复</span>
|
<span class="layui-badge layui-bg-green" data-tips-text="可以存在多条记录,可同时执行多个任务!">复</span>
|
||||||
{{# }else{ }}
|
{{# }else{ }}
|
||||||
<span class="layui-badge think-bg-violet">单</span>
|
<span class="layui-badge think-bg-violet" data-tips-text="只能存在一条记录,同一时间只能执行一个任务!">单</span>
|
||||||
{{# } }}
|
{{# } }}
|
||||||
|
|
||||||
{{# if(d.status===1){ }}
|
{{# if(d.status===1){ }}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<!--{if isset($isSuper) and $isSuper}-->
|
<!--{if isset($isSuper) and $isSuper}-->
|
||||||
<fieldset class="margin-bottom-15">
|
<fieldset class="margin-bottom-15 shadow-inset">
|
||||||
<legend class="notselect">服务状态</legend>
|
<legend class="notselect think-bg-gray">服务状态</legend>
|
||||||
<div class="layui-code border-0 margin-top-0">
|
<div class="layui-code border-0 margin-top-0">
|
||||||
<h4 class="color-desc margin-top-10 notselect">后台服务主进程运行状态</h4>
|
<h4 class="color-desc margin-top-10 notselect">后台服务主进程运行状态</h4>
|
||||||
<div data-queue-message>Checking task process running status ...</div>
|
<div data-queue-message>Checking task process running status ...</div>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!--{notempty name='bases'}-->
|
<!--{notempty name='bases'}-->
|
||||||
<div class="layui-form-item layui-inline">
|
<div class="layui-form-item layui-inline">
|
||||||
<label class="layui-form-label">用户身份</label>
|
<label class="layui-form-label">角色身份</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<select name="usertype" lay-search class="layui-select">
|
<select name="usertype" lay-search class="layui-select">
|
||||||
<option value=''>-- 全部 --</option>
|
<option value=''>-- 全部 --</option>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<span class="color-green font-w7">登录用户账号</span>
|
<span class="color-green font-w7">登录用户账号</span>
|
||||||
<span class="color-desc margin-left-5">Username</span>
|
<span class="color-desc margin-left-5">Username</span>
|
||||||
<!--{if isset($vo) and isset($vo.username)}-->
|
<!--{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}-->
|
<!--{else}-->
|
||||||
<input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入4位及以上字符登录用户账号" class="layui-input">
|
<input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入4位及以上字符登录用户账号" class="layui-input">
|
||||||
<!--{/if}-->
|
<!--{/if}-->
|
||||||
|
@ -19,7 +19,6 @@ if (typeof Array.prototype.forEach !== 'function') {
|
|||||||
for (var i in this) callable.call(context, this[i], i, this)
|
for (var i in this) callable.call(context, this[i], i, this)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Array.prototype.every !== 'function') {
|
if (typeof Array.prototype.every !== 'function') {
|
||||||
Array.prototype.every = function (callable) {
|
Array.prototype.every = function (callable) {
|
||||||
for (var i in this) if (callable(this[i], i, this) === false) {
|
for (var i in this) if (callable(this[i], i, this) === false) {
|
||||||
@ -28,7 +27,6 @@ if (typeof Array.prototype.every !== 'function') {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Array.prototype.some !== 'function') {
|
if (typeof Array.prototype.some !== 'function') {
|
||||||
Array.prototype.some = function (callable) {
|
Array.prototype.some = function (callable) {
|
||||||
for (var i in this) if (callable(this[i], i, this) === true) {
|
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) {
|
window.appRoot = (function (src) {
|
||||||
return src.pop(), src.pop(), src.join('/') + '/';
|
return src.pop(), src.pop(), src.join('/') + '/';
|
||||||
@ -55,7 +49,14 @@ window.baseRoot = (function (src) {
|
|||||||
/*! 动态插件库路径 */
|
/*! 动态插件库路径 */
|
||||||
window.tapiRoot = window.tapiRoot || window.appRoot + "admin";
|
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({
|
require.config({
|
||||||
waitSeconds: 60,
|
waitSeconds: 60,
|
||||||
baseUrl: baseRoot,
|
baseUrl: baseRoot,
|
||||||
@ -74,8 +75,8 @@ require.config({
|
|||||||
'websocket': ['plugs/socket/websocket'],
|
'websocket': ['plugs/socket/websocket'],
|
||||||
'pcasunzips': ['plugs/jquery/pcasunzips'],
|
'pcasunzips': ['plugs/jquery/pcasunzips'],
|
||||||
'jquery.ztree': ['plugs/ztree/ztree.all.min'],
|
'jquery.ztree': ['plugs/ztree/ztree.all.min'],
|
||||||
'jquery.cropper': ['plugs/jquery/cropper.min'],
|
|
||||||
'jquery.masonry': ['plugs/jquery/masonry.min'],
|
'jquery.masonry': ['plugs/jquery/masonry.min'],
|
||||||
|
'jquery.cropper': ['plugs/cropper/cropper.min'],
|
||||||
'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
|
'jquery.autocompleter': ['plugs/jquery/autocompleter.min'],
|
||||||
},
|
},
|
||||||
shim: {
|
shim: {
|
||||||
@ -412,13 +413,25 @@ $(function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*! 注册对象到Jq */
|
/*! 注册对象到Jq */
|
||||||
$.vali = function (form, callable, options) {
|
$.vali = function (form, callable) {
|
||||||
return (new function (that) {
|
|
||||||
that = this;
|
if ($(form).attr('submit-listen')) {
|
||||||
/*! 绑定元素事件 */
|
return $(form).data('validate');
|
||||||
|
}
|
||||||
|
|
||||||
|
return (new function () {
|
||||||
|
var that = this;
|
||||||
|
/* 绑定表单元素 */
|
||||||
|
this.form = $(form);
|
||||||
|
/* 绑定元素事件 */
|
||||||
this.evts = 'blur change';
|
this.evts = 'blur change';
|
||||||
/*! 筛选表单元素 */
|
/* 筛选表单元素 */
|
||||||
this.tags = 'input,select,textarea';
|
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) {
|
this.trim = function (str) {
|
||||||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||||||
@ -430,17 +443,20 @@ $(function () {
|
|||||||
return typeof attrProp !== 'undefined' && attrProp !== null && attrProp !== false;
|
return typeof attrProp !== 'undefined' && attrProp !== null && attrProp !== false;
|
||||||
};
|
};
|
||||||
/*! 正则验证表单元素 */
|
/*! 正则验证表单元素 */
|
||||||
this.isRegex = function (ele, regex, params) {
|
this.isRegex = function (ele) {
|
||||||
var real = this.trim($(ele).val());
|
var real = this.trim($(ele).val());
|
||||||
regex = regex || ele.getAttribute('pattern');
|
var regexp = ele.getAttribute('pattern');
|
||||||
if (real === "" || !regex) return true;
|
regexp = that.patterns[regexp] || regexp;
|
||||||
return new RegExp(regex, params || 'i').test(real);
|
if (real === "" || !regexp) return true;
|
||||||
|
return new RegExp(regexp, 'i').test(real);
|
||||||
};
|
};
|
||||||
/*! 检侧所有表单元素 */
|
/*! 检侧所有表单元素 */
|
||||||
this.checkAllInput = function () {
|
this.checkAllInput = function () {
|
||||||
var isPass = true;
|
var isPass = true;
|
||||||
$(form).find(this.tags).each(function () {
|
that.form.find(this.tags).each(function () {
|
||||||
if (that.checkInput(this) === false) return $(this).focus(), isPass = false;
|
if (that.checkInput(this) === false) {
|
||||||
|
return $(this).focus(), isPass = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return isPass;
|
return isPass;
|
||||||
};
|
};
|
||||||
@ -477,31 +493,34 @@ $(function () {
|
|||||||
return $(ele).data('input-info', $html.css(style).insertAfter(ele)), $html;
|
return $(ele).data('input-info', $html.css(style).insertAfter(ele)), $html;
|
||||||
};
|
};
|
||||||
/*! 表单验证入口 */
|
/*! 表单验证入口 */
|
||||||
this.check = function (form, callable) {
|
that.form.off(that.evts, that.tags).on(that.evts, that.tags, function () {
|
||||||
$(form).off(that.evts, that.tags).on(that.evts, that.tags, function () {
|
that.checkInput(this);
|
||||||
that.checkInput(this);
|
}).attr('novalidate', 'novalidate').attr('submit-listen', 'callable');
|
||||||
}).attr('novalidate', 'novalidate').bind("submit", function (event) {
|
/*! 绑定提交事件 */
|
||||||
if (that.checkAllInput() && typeof callable === 'function') {
|
that.form.data('validate', this).bind("submit", function (event) {
|
||||||
if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
|
/* 检查所有表单元素是否通过H5的规则验证 */
|
||||||
for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
|
if (that.checkAllInput() && typeof callable === 'function') {
|
||||||
}
|
if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
|
||||||
callable.call(this, $(form).formToJson());
|
for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
|
||||||
}
|
}
|
||||||
return event.preventDefault(), false;
|
/* 触发表单提交后,锁定三秒不能再次提交表单 */
|
||||||
}).find('[data-form-loaded]').map(function () {
|
if (that.form.attr('submit-locked')) return false; else that.form.attr('submit-locked', 1);
|
||||||
$(this).html(this.dataset.formLoaded || this.innerHTML);
|
callable.call(this, that.form.formToJson()), setTimeout(function () {
|
||||||
$(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
|
that.form.removeAttr('submit-locked');
|
||||||
});
|
}, 3000)
|
||||||
return $(form).data('validate', this);
|
}
|
||||||
};
|
return event.preventDefault(), false;
|
||||||
}).check(form, callable, options);
|
}).find('[data-form-loaded]').map(function () {
|
||||||
|
$(this).html(this.dataset.formLoaded || this.innerHTML);
|
||||||
|
$(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! 自动监听规则内表单 */
|
/*! 自动监听规则内表单 */
|
||||||
$.vali.listen = function () {
|
$.vali.listen = function () {
|
||||||
$('form[data-auto]').map(function (index, form) {
|
$('form[data-auto]').map(function (index, form) {
|
||||||
if (this.dataset.listen === 'true') return true;
|
$(this).vali(function (data) {
|
||||||
$(this).attr('data-listen', 'true').vali(function (data) {
|
|
||||||
var type = form.method || 'POST', href = form.action || location.href;
|
var type = form.method || 'POST', href = form.action || location.href;
|
||||||
var call = window[form.dataset.callable || '_default_callable'] || undefined;
|
var call = window[form.dataset.callable || '_default_callable'] || undefined;
|
||||||
var tips = form.dataset.tips || undefined, time = form.dataset.time || undefined;
|
var tips = form.dataset.tips || undefined, time = form.dataset.time || undefined;
|
||||||
@ -516,13 +535,15 @@ $(function () {
|
|||||||
|
|
||||||
/*! 注册对象到JqFn */
|
/*! 注册对象到JqFn */
|
||||||
$.fn.vali = function (callable, options) {
|
$.fn.vali = function (callable, options) {
|
||||||
return $.vali(this, callable, options);
|
return this.each(function () {
|
||||||
|
$.vali(this, callable, options);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! 表单转JSON */
|
/*! 表单转JSON */
|
||||||
$.fn.formToJson = function () {
|
$.fn.formToJson = function () {
|
||||||
var self = this, data = {}, push = {};
|
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) {
|
this.build = function (base, key, value) {
|
||||||
return (base[key] = value), base;
|
return (base[key] = value), base;
|
||||||
};
|
};
|
||||||
@ -531,16 +552,12 @@ $(function () {
|
|||||||
return push[name]++;
|
return push[name]++;
|
||||||
};
|
};
|
||||||
$.each($(this).serializeArray(), function () {
|
$.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) {
|
while ((key = keys.pop()) !== undefined) {
|
||||||
name = name.replace(new RegExp("\\[" + key + "\\]$"), '');
|
name = name.replace(new RegExp("\\[" + key + "\\]$"), '');
|
||||||
if (key.match(patterns.push)) { // push
|
if (key.match(rules.push)) merge = self.build([], self.pushCounter(name), merge);
|
||||||
merge = self.build([], self.pushCounter(name), merge);
|
else if (key.match(rules.fixed)) merge = self.build([], key, merge);
|
||||||
} else if (key.match(patterns.fixed)) { // fixed
|
else if (key.match(rules.named)) merge = self.build({}, key, merge);
|
||||||
merge = self.build([], key, merge);
|
|
||||||
} else if (key.match(patterns.named)) { // named
|
|
||||||
merge = self.build({}, key, merge);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
data = $.extend(true, data, merge);
|
data = $.extend(true, data, merge);
|
||||||
});
|
});
|
||||||
@ -663,7 +680,7 @@ $(function () {
|
|||||||
};
|
};
|
||||||
// 动态设置最大高度
|
// 动态设置最大高度
|
||||||
if (opt.height === 'full') {
|
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)));
|
$(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) {
|
}).bind('row sort tool edit radio toolbar checkbox rowDouble', function (evt, call) {
|
||||||
layui.table.on(evt.type + '(' + elem.dataset.id + ')', call)
|
layui.table.on(evt.type + '(' + elem.dataset.id + ')', call)
|
||||||
}).bind('setFullHeight', function () {
|
}).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) {
|
}).trigger('sort', function (object) {
|
||||||
(sort = object), $(elem).trigger('reload')
|
(sort = object), $(elem).trigger('reload')
|
||||||
});
|
});
|
||||||
@ -836,24 +853,22 @@ $(function () {
|
|||||||
|
|
||||||
/*! 注册 data-copy 事件行为 */
|
/*! 注册 data-copy 事件行为 */
|
||||||
onEvent('click', '[data-copy]', function () {
|
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 事件行为 */
|
/*! 注册 data-tips-text 事件行为 */
|
||||||
onEvent('mouseenter', '[data-tips-text]', function () {
|
onEvent('mouseenter', '[data-tips-text]', function () {
|
||||||
var opt = {tips: [$(this).attr('data-tips-type') || 3, '#78BA32'], time: 0};
|
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, opt));
|
$(this).attr('index', layer.tips($(this).attr('data-tips-text') || this.innerText, this, opts));
|
||||||
}).on('mouseleave', '[data-tips-text]', function () {
|
$(this).off('mouseleave').on('mouseleave', function () {
|
||||||
layer.close($(this).attr('index'));
|
setTimeout(function () {
|
||||||
|
layer.close($(that).attr('index'));
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
/*! 注册 data-tips-image 事件行为 */
|
/*! 注册 data-tips-image 事件行为 */
|
||||||
@ -870,20 +885,20 @@ $(function () {
|
|||||||
$(this).off('mouseleave').on('mouseleave', function () {
|
$(this).off('mouseleave').on('mouseleave', function () {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
layer.close($(that).attr('index'));
|
layer.close($(that).attr('index'));
|
||||||
}, 100)
|
}, 100);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$.previewImage = function (src, area) {
|
$.previewImage = function (src, area) {
|
||||||
var img = new Image(), defer = $.Deferred(), load = $.msg.loading();
|
var img = new Image(), defer = $.Deferred(), loaded = $.msg.loading();
|
||||||
img.style.background = '#FFFFFF', img.referrerPolicy = 'no-referrer';
|
img.style.background = '#FFF', img.referrerPolicy = 'no-referrer';
|
||||||
img.style.height = 'auto', img.style.width = area || '480px', img.style.display = 'none';
|
img.style.height = 'auto', img.style.width = area || '480px', img.style.display = 'none';
|
||||||
document.body.appendChild(img), img.onerror = function () {
|
document.body.appendChild(img), img.onerror = function () {
|
||||||
$.msg.close(load), defer.reject();
|
$.msg.close(loaded), defer.reject();
|
||||||
}, img.onload = function () {
|
}, img.onload = function () {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 1, title: false, shadeClose: true, content: $(img), success: function ($ele, idx) {
|
type: 1, title: false, shadeClose: true, content: $(img), success: function ($elem, idx) {
|
||||||
$.msg.close(load), defer.notify($ele, idx);
|
$.msg.close(loaded), defer.notify($elem, idx);
|
||||||
}, area: area || '480px', skin: 'layui-layer-nobg', closeBtn: 1, end: function () {
|
}, area: area || '480px', skin: 'layui-layer-nobg', closeBtn: 1, end: function () {
|
||||||
document.body.removeChild(img), defer.resolve()
|
document.body.removeChild(img), defer.resolve()
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
255
public/static/plugs/layui_exts/tableSelect.js
Normal file
255
public/static/plugs/layui_exts/tableSelect.js
Normal file
@ -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('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
})
|
@ -24,14 +24,15 @@
|
|||||||
|
|
||||||
// 基础阴影样式配置
|
// 基础阴影样式配置
|
||||||
@ShadowMinOuter: 0 2px 3px 0 rgba(0, 0, 0, .11);
|
@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;
|
@ShadowMinInset: 0 2px 5px 0 rgba(0, 0, 0, .11) inset;
|
||||||
@ShadowMaxInset: 0 2px 20px 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;
|
@TopHeaderTextColor: #333;
|
||||||
@TopHeaderBackColor: #FFF;
|
@TopHeaderBackColor: #FFF;
|
||||||
@TopHeaderBottomLine: 1px solid #E5E5E5;
|
@TopHeaderBottomLine: 1px solid rgba(0, 0, 0, .22);
|
||||||
@TopHeaderNavNormalTextColor: @TopHeaderTextColor;
|
@TopHeaderNavNormalTextColor: @TopHeaderTextColor;
|
||||||
@TopHeaderNavNormalBackColor: @TopHeaderBackColor;
|
@TopHeaderNavNormalBackColor: @TopHeaderBackColor;
|
||||||
|
|
||||||
@ -46,7 +47,7 @@
|
|||||||
@LeftMainBackColor: #393D49 !important;
|
@LeftMainBackColor: #393D49 !important;
|
||||||
@LeftMainSubBackColor: rgba(0, 0, 0, .3) !important;
|
@LeftMainSubBackColor: rgba(0, 0, 0, .3) !important;
|
||||||
|
|
||||||
@LeftMainNavHoverBackColor: hsla(0, 0%, 39%, .2) !important;
|
@LeftMainNavHoverBackColor: rgba(99, 99, 99, .2) !important;
|
||||||
@LeftMainNavHoverTextColor: #FFF;
|
@LeftMainNavHoverTextColor: #FFF;
|
||||||
|
|
||||||
@LeftMainNavNormalBackColor: none;
|
@LeftMainNavNormalBackColor: none;
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -21,8 +21,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
border-radius: @BoxBorderRadius;
|
border-radius: @BoxBorderRadius;
|
||||||
letter-spacing: 6px;
|
letter-spacing: 1px;
|
||||||
border: 1px solid @BoxBorderColor;
|
|
||||||
background-color: #f2f2f2;
|
background-color: #f2f2f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +43,10 @@
|
|||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.overauto {
|
||||||
|
overflow: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
.fixed {
|
.fixed {
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
}
|
}
|
||||||
@ -56,10 +59,6 @@
|
|||||||
position: relative !important
|
position: relative !important
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
|
||||||
display: block !important
|
|
||||||
}
|
|
||||||
|
|
||||||
.pointer {
|
.pointer {
|
||||||
cursor: pointer !important
|
cursor: pointer !important
|
||||||
}
|
}
|
||||||
@ -72,6 +71,10 @@
|
|||||||
box-shadow: @ShadowMaxOuter;
|
box-shadow: @ShadowMaxOuter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.shadow-inset {
|
||||||
|
box-shadow: @ShadowMaxInset;
|
||||||
|
}
|
||||||
|
|
||||||
.shadow-mini {
|
.shadow-mini {
|
||||||
box-shadow: @ShadowMinOuter;
|
box-shadow: @ShadowMinOuter;
|
||||||
}
|
}
|
||||||
@ -85,16 +88,54 @@
|
|||||||
font-size: 12px
|
font-size: 12px
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-block {
|
.block {
|
||||||
width: 100%;
|
display: block !important
|
||||||
display: table !important;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inline-block {
|
.inline-block {
|
||||||
display: inline-block !important
|
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 {
|
.think-box-shadow {
|
||||||
padding: 20px !important;
|
padding: 20px !important;
|
||||||
background: #fff !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 {
|
.pagination-container {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
@ -271,6 +391,10 @@
|
|||||||
font-size: 9pt
|
font-size: 9pt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
float: right;
|
float: right;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@ -343,14 +467,14 @@
|
|||||||
height: 1px;
|
height: 1px;
|
||||||
margin: 15px 0;
|
margin: 15px 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-top: 1px dashed #e7eaec
|
border-top: 1px dashed #e7eaec;
|
||||||
}
|
}
|
||||||
|
|
||||||
&solid {
|
&solid {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border-bottom: 1px solid #e7eaec;
|
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- {
|
.think-bg- {
|
||||||
&white {
|
|
||||||
background: white !important
|
|
||||||
}
|
|
||||||
|
|
||||||
&blue {
|
|
||||||
background: linear-gradient(-125deg, #57bdbf, #2f9de2) !important
|
|
||||||
}
|
|
||||||
|
|
||||||
&orig {
|
|
||||||
background: linear-gradient(-141deg, #ecca1b, #f39526) !important
|
|
||||||
}
|
|
||||||
|
|
||||||
&red {
|
&red {
|
||||||
|
color: #FFF;
|
||||||
background: linear-gradient(-125deg, #ff7d7d, #fb2c95) !important
|
background: linear-gradient(-125deg, #ff7d7d, #fb2c95) !important
|
||||||
}
|
}
|
||||||
|
|
||||||
&gray {
|
&gray {
|
||||||
background: linear-gradient(-113deg, #EEEEEE, #EFEFEF) !important
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
&violet {
|
&violet {
|
||||||
|
color: #FFF;
|
||||||
background: linear-gradient(-113deg, #c543d8, #925cc3) !important
|
background: linear-gradient(-113deg, #c543d8, #925cc3) !important
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&white {
|
||||||
|
color: #333;
|
||||||
|
background: white !important
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.text- {
|
.text- {
|
||||||
|
@ -223,47 +223,64 @@ fieldset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-form-label {
|
.layui-form-item {
|
||||||
width: auto !important;
|
&:last-child {
|
||||||
height: 32px;
|
border: none
|
||||||
padding: 0 8px;
|
}
|
||||||
line-height: 32px;
|
|
||||||
border-color: @InputBorderNormalColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layui-input-inline {
|
white-space: nowrap;
|
||||||
width: 170px;
|
margin-right: 8px;
|
||||||
display: inline-block !important;
|
border: 1px solid @InputBorderNormalColor;
|
||||||
margin: 0 10px 0 -1px !important;
|
|
||||||
|
|
||||||
input, select {
|
.layui-form-label {
|
||||||
width: 100%;
|
width: auto !important;
|
||||||
height: 32px;
|
border: none;
|
||||||
|
height: 30px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
border-color: @InputBorderNormalColor;
|
border-right: 1px solid @InputBorderNormalColor;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.layui-form-select dl {
|
.layui-input-inline {
|
||||||
top: 31px;
|
width: 150px;
|
||||||
padding: 0;
|
margin: 0 !important;
|
||||||
border-color: @InputBorderActiveColor;
|
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 {
|
.label-required {
|
||||||
&-prev:before {
|
&-prev:before {
|
||||||
width: 1em;
|
|
||||||
color: red;
|
color: red;
|
||||||
|
width: 0.5em;
|
||||||
content: '*';
|
content: '*';
|
||||||
|
margin: -2px 0 0 -0.55em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
font-size: 14px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-weight: 700;
|
font-weight: bold;
|
||||||
line-height: 1.6em;
|
line-height: 1.6em;
|
||||||
margin-left: -0.8em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:after, &-next:after {
|
&: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 {
|
.layui-table {
|
||||||
td, th {
|
td, th {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@ -440,15 +380,13 @@ table.layui-table {
|
|||||||
&[lay-size="lg"] {
|
&[lay-size="lg"] {
|
||||||
input.layui-input, .layui-btn.layui-btn-sm {
|
input.layui-input, .layui-btn.layui-btn-sm {
|
||||||
height: 38px;
|
height: 38px;
|
||||||
line-height: 38px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
line-height: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-table-view {
|
.layui-table-view {
|
||||||
margin-bottom: 0;
|
|
||||||
|
|
||||||
.layui-table-page {
|
.layui-table-page {
|
||||||
.layui-laypage {
|
.layui-laypage {
|
||||||
.layui-laypage-prev,
|
.layui-laypage-prev,
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
left: @LayoutDefaLeftSzie;
|
left: @LayoutDefaLeftSzie;
|
||||||
right: 0;
|
right: 0;
|
||||||
color: @TopHeaderTextColor !important;
|
color: @TopHeaderTextColor !important;
|
||||||
height: @TopHeaderHeight;
|
height: @TopHeaderHeight !important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
background: @TopHeaderBackColor !important;
|
background: @TopHeaderBackColor !important;
|
||||||
@ -43,8 +43,8 @@
|
|||||||
|
|
||||||
&.layui-layout-right {
|
&.layui-layout-right {
|
||||||
.headimg {
|
.headimg {
|
||||||
width: 20px;
|
width: 22px;
|
||||||
height: 20px;
|
height: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,12 +235,13 @@
|
|||||||
top: @BodyMainTop;
|
top: @BodyMainTop;
|
||||||
left: @LayoutDefaLeftSzie;
|
left: @LayoutDefaLeftSzie;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
background: @BodyMainBackColor;
|
||||||
|
box-shadow: @ShadowDownInset;
|
||||||
|
|
||||||
> .layui-card {
|
> .layui-card {
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
background: none !important;
|
background: none !important;
|
||||||
|
|
||||||
|
|
||||||
> .layui-card-body {
|
> .layui-card-body {
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -250,7 +251,7 @@
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: @BodyMainBackColor;
|
|
||||||
|
|
||||||
> .layui-card-table {
|
> .layui-card-table {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user