同步系统代码

This commit is contained in:
邹景立 2021-08-16 11:49:46 +08:00
parent 7d37e91238
commit a910521f02
17 changed files with 216 additions and 314 deletions

View File

@ -28,13 +28,6 @@ use think\admin\service\AdminService;
*/
class Auth extends Controller
{
/**
* 绑定数据表
* @var string
*/
private $table = 'SystemAuth';
/**
* 系统权限管理
* @auth true
@ -61,7 +54,7 @@ class Auth extends Controller
*/
public function add()
{
$this->_form($this->table, 'form');
$this->_form(SystemAuth::class, 'form');
}
/**
@ -73,7 +66,7 @@ class Auth extends Controller
*/
public function edit()
{
$this->_form($this->table, 'form');
$this->_form(SystemAuth::class, 'form');
}
/**
@ -83,12 +76,22 @@ class Auth extends Controller
*/
public function state()
{
$this->_save($this->table, $this->_vali([
$this->_save(SystemAuth::class, $this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
}
/**
* 删除系统权限
* @auth true
* @throws \think\db\exception\DbException
*/
public function remove()
{
$this->_delete(SystemAuth::class);
}
/**
* 权限配置节点
* @auth true
@ -114,7 +117,7 @@ class Auth extends Controller
sysoplog('系统权限管理', "配置系统权限[{$map['auth']}]授权成功");
$this->success('访问权限修改成功!', 'javascript:history.back()');
} else {
$this->_form($this->table, 'apply');
$this->_form(SystemAuth::class, 'apply');
}
}
@ -128,67 +131,4 @@ class Auth extends Controller
$this->title = "编辑【{$data['title']}】授权";
}
}
/**
* 删除系统权限
* @auth true
* @throws \think\db\exception\DbException
*/
public function remove()
{
$this->_delete($this->table);
}
/**
* 表单结果处理
* @param bool $result
*/
protected function _add_form_result(bool $result)
{
if ($result) {
$id = $this->app->db->name($this->table)->getLastInsID();
sysoplog('系统权限管理', "添加系统权限[{$id}]成功");
}
}
/**
* 表单结果处理
* @param boolean $result
*/
protected function _edit_form_result(bool $result)
{
if ($result) {
$id = input('id') ?: 0;
sysoplog('系统权限管理', "修改系统权限[{$id}]成功");
}
}
/**
* 状态结果处理
* @param boolean $result
*/
protected function _state_save_result(bool $result)
{
if ($result) {
[$id, $state] = [input('id'), input('status')];
sysoplog('系统权限管理', ($state ? '激活' : '禁用') . "系统权限[{$id}]成功");
}
}
/**
* 删除结果处理
* @param boolean $result
* @throws \think\db\exception\DbException
*/
protected function _remove_delete_result(bool $result)
{
if ($result) {
$map = $this->_vali(['auth.require#id' => '权限ID不能为空']);
$this->app->db->name('SystemAuthNode')->where($map)->delete();
sysoplog('系统权限管理', "删除系统权限[{$map['auth']}]及授权配置");
$this->success("权限删除成功!");
} else {
$this->error("权限删除失败,请稍候再试!");
}
}
}

View File

@ -16,6 +16,7 @@
namespace app\admin\controller;
use app\admin\model\SystemUser;
use think\admin\Controller;
use think\admin\service\AdminService;
use think\admin\service\MenuService;
@ -106,11 +107,12 @@ class Index extends Controller
'oldpassword.require' => '旧的密码不能为空!',
'password.confirm:repassword' => '两次输入的密码不一致!',
]);
$user = $this->app->db->name('SystemUser')->where(['id' => $id])->find();
$user = (new SystemUser)->find($id);
if (empty($user)) $this->error('用户不存在!');
if (md5($data['oldpassword']) !== $user['password']) {
$this->error('旧密码验证失败,请重新输入!');
}
if (data_save('SystemUser', ['id' => $user['id'], 'password' => md5($data['password'])])) {
if ($user->save(['password' => md5($data['password'])])) {
sysoplog('系统用户管理', "修改用户[{$user['id']}]密码成功");
$this->success('密码修改成功,下次请使用新密码登录!', '');
} else {

View File

@ -16,6 +16,7 @@
namespace app\admin\controller;
use app\admin\model\SystemMenu;
use think\admin\Controller;
use think\admin\extend\DataExtend;
use think\admin\service\AdminService;
@ -29,13 +30,6 @@ use think\admin\service\NodeService;
*/
class Menu extends Controller
{
/**
* 当前操作数据库
* @var string
*/
private $table = 'SystemMenu';
/**
* 系统菜单管理
* @auth true
@ -48,7 +42,7 @@ class Menu extends Controller
{
$this->title = '系统菜单管理';
$this->type = input('type', 'index');
$this->_query($this->table)->order('sort desc,id asc')->page(false, true);
$this->_query(SystemMenu::class)->order('sort desc,id asc')->page(false, true);
}
/**
@ -88,7 +82,7 @@ class Menu extends Controller
public function add()
{
$this->_applyFormToken();
$this->_form($this->table, 'form');
$this->_form(SystemMenu::class, 'form');
}
/**
@ -101,7 +95,7 @@ class Menu extends Controller
public function edit()
{
$this->_applyFormToken();
$this->_form($this->table, 'form');
$this->_form(SystemMenu::class, 'form');
}
/**
@ -127,7 +121,7 @@ class Menu extends Controller
}
}
/* 列出可选上级菜单 */
$menus = $this->app->db->name($this->table)->order('sort desc,id asc')->column('id,pid,icon,url,node,title,params', 'id');
$menus = (new SystemMenu)->order('sort desc,id asc')->column('id,pid,icon,url,node,title,params', 'id');
$this->menus = DataExtend::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'url' => '#', 'title' => '顶部菜单']]));
if (isset($vo['id'])) foreach ($this->menus as $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
foreach ($this->menus as $key => $menu) if ($menu['spt'] >= 3 || $menu['url'] !== '#') unset($this->menus[$key]);
@ -145,7 +139,7 @@ class Menu extends Controller
public function state()
{
$this->_applyFormToken();
$this->_save($this->table, $this->_vali([
$this->_save(SystemMenu::class, $this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
@ -159,58 +153,6 @@ class Menu extends Controller
public function remove()
{
$this->_applyFormToken();
$this->_delete($this->table);
}
/**
* 表单结果处理
* @param bool $result
*/
protected function _add_form_result(bool $result)
{
if ($result) {
$id = $this->app->db->name($this->table)->getLastInsID();
sysoplog('系统菜单管理', "添加系统菜单[{$id}]成功");
$this->success('系统菜单添加成功!');
}
}
/**
* 表单结果处理
* @param boolean $result
*/
protected function _edit_form_result(bool $result)
{
if ($result) {
$id = input('id') ?: 0;
sysoplog('系统菜单管理', "修改系统菜单[{$id}]成功");
$this->success('系统菜单修改成功!');
}
}
/**
* 状态结果处理
* @param boolean $result
*/
protected function _state_save_result(bool $result)
{
if ($result) {
[$id, $state] = [input('id'), input('status')];
sysoplog('系统菜单管理', ($state ? '激活' : '禁用') . "系统菜单[{$id}]成功");
$this->success('系统菜单修改成功!', 'javascript:location.reload()');
}
}
/**
* 删除结果处理
* @param boolean $result
*/
protected function _remove_delete_result(bool $result)
{
if ($result) {
$id = input('id') ?: 0;
sysoplog('系统菜单管理', "删除系统菜单[{$id}]成功");
$this->success('系统菜单删除成功!', 'javascript:location.reload()');
}
$this->_delete(SystemMenu::class);
}
}

View File

@ -29,13 +29,6 @@ use think\admin\service\AdminService;
*/
class User extends Controller
{
/**
* 绑定数据表
* @var string
*/
private $table = 'SystemUser';
/**
* 超级用户名称
* @var string
@ -96,7 +89,7 @@ class User extends Controller
*/
public function add()
{
$this->_form($this->table, 'form');
$this->_form(SystemUser::class, 'form');
}
/**
@ -108,7 +101,7 @@ class User extends Controller
*/
public function edit()
{
$this->_form($this->table, 'form');
$this->_form(SystemUser::class, 'form');
}
/**
@ -123,7 +116,7 @@ class User extends Controller
$this->_applyFormToken();
if ($this->request->isGet()) {
$this->verify = false;
$this->_form($this->table, 'pass');
$this->_form(SystemUser::class, 'pass');
} else {
$data = $this->_vali([
'id.require' => '用户ID不能为空',
@ -131,7 +124,8 @@ class User extends Controller
'repassword.require' => '重复密码不能为空!',
'repassword.confirm:password' => '两次输入的密码不一致!',
]);
if (data_save($this->table, ['id' => $data['id'], 'password' => md5($data['password'])])) {
$user = (new SystemUser)->find($data['id']);
if (!empty($user) && $user->save(['password' => md5($data['password'])])) {
sysoplog('系统用户管理', "修改用户[{$data['id']}]密码成功");
$this->success('密码修改成功,请使用新密码登录!', '');
} else {
@ -155,10 +149,12 @@ class User extends Controller
if (isset($data['id']) && $data['id'] > 0) {
unset($data['username']);
} else {
// 检查登录账号是否出现重复
if (empty($data['username'])) $this->error('登录账号不能为空!');
$where = ['username' => $data['username'], 'is_deleted' => 0];
if ($this->app->db->name($this->table)->where($where)->count() > 0) {
// 检查账号是否重复
if (empty($data['username'])) {
$this->error('登录账号不能为空!');
}
$map = ['username' => $data['username'], 'is_deleted' => 0];
if ((new SystemUser)->where($map)->count() > 0) {
$this->error("账号已经存在,请使用其它账号!");
}
// 新添加的用户密码与账号相同
@ -183,7 +179,7 @@ class User extends Controller
public function state()
{
$this->_checkInput();
$this->_save($this->table, $this->_vali([
$this->_save(SystemUser::class, $this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
@ -197,7 +193,7 @@ class User extends Controller
public function remove()
{
$this->_checkInput();
$this->_delete($this->table);
$this->_delete(SystemUser::class);
}
/**
@ -209,57 +205,4 @@ class User extends Controller
$this->error('系统超级账号禁止删除!');
}
}
/**
* 表单结果处理
* @param bool $result
*/
protected function _add_form_result(bool $result)
{
if ($result) {
$id = $this->app->db->name($this->table)->getLastInsID();
sysoplog('系统用户管理', "添加系统用户[{$id}]成功");
}
}
/**
* 表单结果处理
* @param boolean $result
*/
protected function _edit_form_result(bool $result)
{
if ($result) {
$id = input('id') ?: 0;
sysoplog('系统用户管理', "修改系统用户[{$id}]成功");
if ($id == AdminService::instance()->getUserId()) {
$this->success('用户资料修改成功!', 'javascript:location.reload()');
} else {
$this->success('用户资料修改成功!');
}
}
}
/**
* 状态结果处理
* @param boolean $result
*/
protected function _state_save_result(bool $result)
{
if ($result) {
[$id, $state] = [input('id'), input('status')];
sysoplog('系统用户管理', ($state ? '激活' : '禁用') . "系统用户[{$id}]成功");
}
}
/**
* 删除结果处理
* @param boolean $result
*/
protected function _remove_delete_result(bool $result)
{
if ($result) {
$id = input('id') ?: 0;
sysoplog('系统用户管理', "删除系统用户[{$id}]成功");
}
}
}

View File

@ -16,7 +16,7 @@
namespace app\admin\model;
use think\Model;
use think\admin\Model;
/**
* 用户权限模型
@ -25,6 +25,30 @@ use think\Model;
*/
class SystemAuth extends Model
{
/**
* 日志名称
* @var string
*/
protected $oplogName = '系统权限';
/**
* 日志类型
* @var string
*/
protected $oplogType = '系统权限管理';
/**
* 删除权限事件
* @param string $ids
*/
public function onAdminDelete(string $ids)
{
if (count($aids = str2arr($aids ?? '')) > 0) {
M('SystemAuthNode')->whereIn('auth', $aids)->delete();
}
sysoplog($this->oplogType, "删除{$this->oplogName}[{$ids}]及授权配置");
}
/**
* 格式化创建时间
* @param string $value

View File

@ -22,7 +22,6 @@ use think\Model;
* 数据字典数据模型
* Class SystemBase
* @package app\admin\model
* @method \think\db\Query distinct(bool $true)
*/
class SystemBase extends Model
{
@ -36,7 +35,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];
$map = ['type' => $type, 'status' => 1, 'deleted' => 0];
$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;

View File

@ -0,0 +1,25 @@
<?php
namespace app\admin\model;
use think\admin\Model;
/**
* 系统菜单模型
* Class SystemMenu
* @package app\admin\model
*/
class SystemMenu extends Model
{
/**
* 日志名称
* @var string
*/
protected $oplogName = '系统菜单';
/**
* 日志类型
* @var string
*/
protected $oplogType = '系统菜单管理';
}

View File

@ -16,7 +16,7 @@
namespace app\admin\model;
use think\Model;
use think\admin\Model;
/**
* 系统用户数据模型
@ -25,6 +25,18 @@ use think\Model;
*/
class SystemUser extends Model
{
/**
* 日志名称
* @var string
*/
protected $oplogName = '系统用户';
/**
* 日志类型
* @var string
*/
protected $oplogType = '系统用户管理';
/**
* 获取用户数据
* @param array $map 数据查询规则

View File

@ -65,16 +65,15 @@
$(function () {
$('#QueueData').layTable({
even: true,
sort: {field: 'loops_time desc,id', type: 'desc'},
sort: {field: 'loops_time desc,code', type: 'desc'},
cols: [[
{checkbox: true, fixed: 'left'},
{field: 'code', title: '任务编号', width: 140, sort: true},
{field: 'title', title: '任务名称', minWidth: 130},
{field: 'command', title: '任务指令', minWidth: 130},
{field: 'title', title: '任务名称', minWidth: 100},
{field: 'command', title: '任务指令', minWidth: 100},
{
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 {
@ -84,8 +83,7 @@
},
{
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) {
return d.enter_time.substr(12) + '<span class="color-desc"> ( 耗时 ' + d.outer_time + ' )</span>';
} else {
@ -93,10 +91,10 @@
}
}
},
{field: 'attempts', title: '执行次数', width: 95, align: 'center', sort: true, templet: "<div>{{d.attempts||0}}</div>"},
{field: 'attempts', title: '执行次数', minWidth: 95, align: 'center', sort: true, templet: "<div>{{d.attempts||0}}</div>"},
{field: 'exec_desc', title: '执行结果', minWidth: 180},
{field: 'create_at', title: '创建时间', align: 'center', minWidth: 170},
{toolbar: '#toolbar', title: '操作面板', align: 'center', fixed: 'right', minWidth: 251}
{toolbar: '#toolbar', title: '操作面板', align: 'center', width: 251, fixed: 'right',}
]]
});
});

View File

@ -1,6 +1,6 @@
<!--{if isset($isSuper) and $isSuper}-->
<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">
<h4 class="color-desc notselect">后台服务主进程运行状态</h4>
<div data-queue-message>Checking task process running status ...</div>

View File

@ -294,15 +294,15 @@ $(function () {
}, load, tips);
};
/*! 打开一个iframe窗口 */
this.iframe = function (url, name, area) {
return layer.open({title: name || '窗口', type: 2, area: area || ['800px', '580px'], fixed: true, maxmin: false, content: url});
this.iframe = function (url, name, area, offset) {
return layer.open({title: name || '窗口', type: 2, area: area || ['800px', '580px'], offset: offset, fixed: true, maxmin: false, content: url});
};
/*! 加载 HTML 到弹出层 */
this.modal = function (url, data, name, call, load, tips, area) {
this.modal = function (url, data, name, call, load, tips, area, offset) {
this.load(url, data, 'GET', function (res) {
if (typeof (res) === 'object') return $.msg.auto(res), false;
$.msg.idx.push(layer.open({
type: 1, btn: false, area: area || "800px", content: res, title: name || '', success: function ($dom, idx) {
type: 1, btn: false, area: area || "800px", content: res, title: name || '', offset: offset || 'auto', success: function ($dom, idx) {
$dom.off('click', '[data-close]').on('click', '[data-close]', function () {
(function (confirm, callable) {
confirm ? $.msg.confirm(confirm, callable) : callable();
@ -352,23 +352,27 @@ $(function () {
/*! 后台菜单动作初始化 */
this.listen = function () {
/*! 菜单模式切换 */
(function ($menu, miniClass) {
/*! Mini 菜单模式切换及显示 */
if (layui.data('admin-menu-type')['type-mini']) $menu.addClass(miniClass);
onEvent('click', '[data-target-menu-type]', function () {
$menu.toggleClass(miniClass), layui.data('admin-menu-type', {key: 'type-mini', value: $menu.hasClass(miniClass)});
}).on('resize', function () {
$body.width() > 1000 ? (layui.data('admin-menu-type')['type-mini'] ? $menu.addClass(miniClass) : $menu.removeClass(miniClass)) : $menu.addClass(miniClass);
}).trigger('resize');
/*! Mini 菜单模式时TIPS文字显示 */
$('[data-target-tips]').mouseenter(function () {
if ($menu.hasClass(miniClass)) {
$(this).attr('index', layer.tips(this.dataset.targetTips || '', this, {time: 0}));
}
}).mouseleave(function () {
var $menu = $('.layui-layout-admin'), miniClass = 'layui-layout-left-mini';
/*! Mini 菜单模式切换及显示 */
if (layui.data('admin-menu-type')['type-mini']) $menu.addClass(miniClass);
/*! 菜单切换事件处理 */
onEvent('click', '[data-target-menu-type]', function () {
layui.data('admin-menu-type', {key: 'type-mini', value: $menu.toggleClass(miniClass).hasClass(miniClass)});
});
/*! 监听窗口尺寸处理 */
(function (callable) {
$(window).on('resize', callable).trigger('resize');
})(function () {
var typeMini = layui.data('admin-menu-type')['type-mini'] || false;
(typeMini || $body.width() < 1000) ? $menu.addClass(miniClass) : $menu.removeClass(miniClass);
});
/*! Mini 菜单模式时TIPS文字显示 */
$('[data-target-tips]').mouseenter(function () {
if ($menu.hasClass(miniClass)) $(this).attr('index', layer.tips(this.dataset.targetTips || '', this, {time: 0}));
$(this).mouseleave(function () {
layer.close($(this).attr('index'));
});
})($('.layui-layout-admin'), 'layui-layout-left-mini');
});
/*! 左则二级菜单展示 */
$('[data-submenu-layout]>a').on('click', function () {
that.syncOpenStatus(1);
@ -414,11 +418,9 @@ $(function () {
/*! 注册对象到Jq */
$.vali = function (form, callable) {
if ($(form).attr('submit-listen')) {
return $(form).data('validate');
}
return (new function () {
var that = this;
/* 绑定表单元素 */
@ -495,7 +497,7 @@ $(function () {
/*! 表单验证入口 */
that.form.off(that.evts, that.tags).on(that.evts, that.tags, function () {
that.checkInput(this);
}).attr('novalidate', 'novalidate').attr('submit-listen', 'callable');
}).attr('novalidate', 'novalidate').attr('submit-listen', 'validate.submit');
/*! 绑定提交事件 */
that.form.data('validate', this).bind("submit", function (event) {
/* 检查所有表单元素是否通过H5的规则验证 */
@ -680,7 +682,7 @@ $(function () {
};
// 动态设置最大高度
if (opt.height === 'full') {
opt.height = $(window).height() - $(elem).removeClass('layui-hide').offset().top - 55;
opt.height = $(window).height() - $(elem).removeClass('layui-hide').offset().top - 35;
}
// 实例并绑定对象
$(this).data('this', layui.table.render(bindData(opt)));
@ -692,7 +694,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 - 45})
$(elem).trigger('reload', {height: $(window).height() - $(elem).next().offset().top - 35})
}).trigger('sort', function (object) {
(sort = object), $(elem).trigger('reload')
});
@ -772,20 +774,6 @@ $(function () {
});
});
/*! 表单元素失焦时提交 */
onEvent('blur', '[data-action-blur]', function () {
var that = $(this), emap = this.dataset, data = {'_token_': emap.token || emap.csrf || '--'};
var attrs = (emap.value || '').replace('{value}', that.val()).split(';');
for (var i in attrs) data[attrs[i].split('#')[0]] = attrs[i].split('#')[1];
(function (confirm, callable) {
confirm ? $.msg.confirm(confirm, callable) : callable();
})(emap.confirm, function () {
$.form.load(emap.actionBlur, data, emap.method || 'post', function (ret) {
return that.css('border', (ret && ret.code) ? '1px solid #e6e6e6' : '1px solid red'), false;
}, emap.loading !== 'false', emap.loading, emap.time)
});
});
/*! 表单元素失去焦点时数字 */
onEvent('blur', '[data-blur-number]', function () {
var emap = this.dataset, min = emap.valueMin, max = emap.valueMax;
@ -795,6 +783,20 @@ $(function () {
this.value = parseFloat(value).toFixed(fiexd);
});
/*! 表单元素失焦时提交 */
onEvent('blur', '[data-action-blur],[data-blur-action]', function () {
var that = $(this), emap = this.dataset, data = {'_token_': emap.token || emap.csrf || '--'};
var attrs = (emap.value || '').replace('{value}', that.val()).split(';');
for (var i in attrs) data[attrs[i].split('#')[0]] = attrs[i].split('#')[1];
(function (confirm, callable) {
confirm ? $.msg.confirm(confirm, callable) : callable();
})(emap.confirm, function () {
$.form.load(emap.actionBlur || emap.blurAction, data, emap.method || 'post', function (ret) {
return that.css('border', (ret && ret.code) ? '1px solid #e6e6e6' : '1px solid red'), false;
}, emap.loading !== 'false', emap.loading, emap.time)
});
});
/*! 注册 data-href 事件行为 */
onEvent('click', '[data-href]', function () {
if (this.dataset.href && this.dataset.href.indexOf('#') !== 0) {
@ -832,7 +834,7 @@ $(function () {
onEvent('click', '[data-modal]', function () {
var emap = this.dataset, data = {open_type: 'modal'}, un = undefined;
if (emap.rule && (applyRuleValue(this, data)) === false) return false;
return $.form.modal(emap.modal, data, emap.title || this.innerText || '编辑', un, un, un, emap.area || emap.width || '800px');
return $.form.modal(emap.modal, data, emap.title || this.innerText || '编辑', un, un, un, emap.area || emap.width || '800px', emap.offset || 'auto');
});
/*! 注册 data-iframe 事件行为 */
@ -842,7 +844,7 @@ $(function () {
var frame = emap.iframe + (emap.iframe.indexOf('?') > -1 ? '&' : '?') + $.param(data);
$(this).attr('data-index', $.form.iframe(frame, emap.title || this.innerText || '窗口', emap.area || [
emap.width || '800px', emap.height || '580px'
]));
], emap.offset || 'auto'));
});
/*! 注册 data-icon 事件行为 */
@ -880,8 +882,8 @@ $(function () {
var img = new Image(), that = this;
img.referrerPolicy = 'no-referrer', img.style.maxWidth = '260px', img.style.maxHeight = '260px';
img.src = this.dataset.tipsImage || this.dataset.lazySrc || this.src, img.onload = function () {
$(that).attr('index', layer.tips(img.outerHTML, that, {time: 0, skin: 'layui-layer-image', scrollbar: false, anim: 5, isOutAnim: false}));
}
$(that).attr('index', layer.tips(img.outerHTML, that, {time: 0, skin: 'layui-layer-image', anim: 5, isOutAnim: false, scrollbar: false}));
};
$(this).off('mouseleave').on('mouseleave', function () {
setTimeout(function () {
layer.close($(that).attr('index'));

View File

@ -23,16 +23,14 @@
@InputBorderActiveColor: #DDD;
// 基础阴影样式配置
@ShadowMinOuter: 0 2px 3px 0 rgba(0, 0, 0, .11);
@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;
@ShadowMaxOuter: 0 1px 6px 0 rgba(0, 0, 0, .16);
@ShadowMaxInset: 0 1px 20px 0 rgba(0, 0, 0, .15) inset;
@ShadowDownInset: 0 1px 6px 0 rgba(0, 0, 0, .16) inset;
// 导航条颜色配置
@TopHeaderTextColor: #333;
@TopHeaderBackColor: #FFF;
@TopHeaderBottomLine: 1px solid rgba(0, 0, 0, .22);
@TopHeaderBottomLine: 1px solid rgba(0, 0, 0, .12);
@TopHeaderNavNormalTextColor: @TopHeaderTextColor;
@TopHeaderNavNormalBackColor: @TopHeaderBackColor;
@ -65,4 +63,4 @@
// 左侧菜单大小
@LayoutMiniLeftSize: 50px;
@LayoutDefaLeftSzie: 200px;
@LayoutDefaLeftSzie: 200px;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -72,7 +72,7 @@
}
.shadow-mini {
box-shadow: @ShadowMinOuter;
box-shadow: @ShadowMaxOuter;
}
.shadow-none {
@ -81,11 +81,6 @@
.shadow-inset {
box-shadow: @ShadowMaxInset;
legend {
background: #EEE;
border-radius: 4px;
}
}
.help-block {
@ -203,6 +198,7 @@
position: relative;
display: inline-block;
border: 1px dashed #e2e2e2;
margin-right: 10px;
background: url('../img/upimg.png') no-repeat center center;
background-size: cover;
@ -309,8 +305,8 @@
label.think-radio,
label.think-checkbox {
cursor: pointer;
margin-right: 10px;
display: inline-block;
margin: 8px 10px 8px 6px !important;
}
.think-radio,
@ -318,7 +314,7 @@ label.think-checkbox {
.notselect();
margin-top: 10px;
font-weight: 400;
line-height: 18px;
line-height: 16px;
input[type=radio],
input[type=checkbox] {
@ -342,11 +338,11 @@ label.think-checkbox {
display: block;
position: relative;
animation-duration: .3s;
-webkit-animation-duration: .3s;
animation-fill-mode: both;
animation-name: layui-fadein;
-webkit-animation-duration: .3s;
-webkit-animation-fill-mode: both;
animation-name: layui-scale-spring;
-webkit-animation-name: layui-scale-spring;
-webkit-animation-name: layui-fadein;
}
}
}

View File

@ -21,6 +21,7 @@
overflow: hidden;
text-align: center;
margin-right: 5px;
margin-bottom: 5px;
border-radius: 50%;
vertical-align: middle;
background-size: cover;
@ -72,17 +73,21 @@ fieldset {
}
.layui-layer-tips {
&.layui-layer-image .layui-layer-content {
&.layui-layer-image {
width: auto !important;
padding: 4px !important;
img {
z-index: 2;
position: relative;
}
.layui-layer-content {
width: auto !important;
padding: 4px !important;
i.layui-layer-TipsR {
z-index: 1;
img {
z-index: 2;
position: relative;
}
i.layui-layer-TipsR {
z-index: 1;
}
}
}
}
@ -331,6 +336,25 @@ fieldset {
padding-left: 5px;
}
input.layui-input,
.layui-btn.layui-btn-sm {
height: 28px;
line-height: 28px;
box-sizing: border-box;
}
.layui-btn.layui-btn-sm {
margin-top: -1px;
}
&[lay-size="lg"] {
input.layui-input, .layui-btn.layui-btn-sm {
height: 38px;
box-sizing: border-box;
line-height: 38px;
}
}
.list-table-sort-td {
width: 10px !important;
text-align: center !important;
@ -366,27 +390,15 @@ fieldset {
}
}
table.layui-table {
input.layui-input, .layui-btn.layui-btn-sm {
height: 28px;
line-height: 28px;
box-sizing: border-box;
}
.layui-btn.layui-btn-sm {
margin-top: -1px;
}
&[lay-size="lg"] {
input.layui-input, .layui-btn.layui-btn-sm {
height: 38px;
box-sizing: border-box;
line-height: 38px;
}
.tableSelect {
.layui-table-view {
margin: 10px 0;
}
}
.layui-table-view {
margin: 0;
.layui-table-page {
.layui-laypage {
.layui-laypage-prev,
@ -480,7 +492,7 @@ table.layui-table {
height: 580px;
position: relative;
background: url(../img/wechat/mobile_head.png) no-repeat 0 0;
box-shadow: @ShadowMinOuter;
box-shadow: @ShadowMaxOuter;
border-radius: @BoxBorderRadius;
.mobile-header {

View File

@ -90,6 +90,10 @@
line-height: 48px;
border-radius: 0;
&.layui-show + a.layui-elip {
background: @TopHeaderNavHoverBackColor !important;
}
+ a.layui-elip {
padding-right: 35px;
@ -106,11 +110,16 @@
}
dd {
margin: 0;
a {
padding: 0;
margin-top: 1px;
text-align: center;
&:hover {
background: @TopHeaderNavHoverBackColor !important;
}
.layui-icon {
margin-right: 5px;
}