diff --git a/README.md b/README.md index 0dae557..ff6102a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# 勾股CMS +# 勾股CMS2.0 [![勾股CMS](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://gitee.com/gougucms/gougucms/) -[![勾股CMS](https://img.shields.io/badge/GouguCMS-1.0.0-brightgreen.svg)](https://gitee.com/gougucms/gougucms/) +[![勾股CMS](https://img.shields.io/badge/GouguCMS-2.0.11-brightgreen.svg)](https://gitee.com/gougucms/gougucms/) [![star](https://gitee.com/gougucms/gougucms/badge/star.svg?theme=dark)](https://gitee.com/gougucms/gougucms/stargazers) [![fork](https://gitee.com/gougucms/gougucms/badge/fork.svg?theme=dark)](https://gitee.com/gougucms/gougucms/members) @@ -12,9 +12,12 @@ - 项目会不定时进行更新,建议⭐star⭐和👁️watch👁️一份。 +- 后台体验地址:[https://www.gougucms.com/admin/index/index.html](https://www.gougucms.com/admin/index/index.html) +- 后台体验账号:gougucms 密码:gougucms + ### 开源项目 1. [![勾股OA](https://img.shields.io/badge/GouguOA-2.0.9-brightgreen.svg)](https://gitee.com/gougucms/office) [开源项目系列之勾股OA](https://gitee.com/gougucms/office) -2. [![勾股CMS](https://img.shields.io/badge/GouguCMS-1.9.6-brightgreen.svg)](https://gitee.com/gougucms/gougucms) [开源项目系列之勾股CMS](https://gitee.com/gougucms/gougucms) +2. [![勾股CMS](https://img.shields.io/badge/GouguCMS-2.0.11-brightgreen.svg)](https://gitee.com/gougucms/gougucms) [开源项目系列之勾股CMS](https://gitee.com/gougucms/gougucms) 3. [![勾股BLOG](https://img.shields.io/badge/GouguBLOG-1.5.8-brightgreen.svg)](https://gitee.com/gougucms/blog) [开源项目系列之勾股BLOG](https://gitee.com/gougucms/blog) ### 介绍 @@ -89,7 +92,7 @@ www 系统部署目录(或者子目录) ### 功能矩阵 -系统后台集成了主流的通用功能,如:登录验证、系统配置、操作日志管理、用户(组)管理、用户(组)权限、功能管理(后台菜单管理)、导航设置、网站地图、轮播广告、TAG关键字管理、文件上传、数据备份/还原、文章功能、用户管理、用户操作日志、用户注册/登录、 API接口等。更多的个性化功能可以基于当前系统便捷做二次开发。 +系统后台集成了主流的通用功能,如:登录验证、系统配置、操作日志管理、用户(组)管理、用户(组)权限、功能管理(后台菜单管理)、导航设置、网站地图、轮播广告、TAG关键字管理、文件上传、数据备份/还原、文章功能、商品功能、用户管理、用户操作日志、用户注册/登录、 API接口等。更多的个性化功能可以基于当前系统便捷做二次开发。 具体功能如下: @@ -123,6 +126,10 @@ www 系统部署目录(或者子目录) │ ├─文章分类 │ ├─文章列表 │ +├─商品中心 +│ ├─商品分类 +│ ├─商品列表 +│ ├─... ~~~ diff --git a/app/admin/common.php b/app/admin/common.php index 781babf..9aff6b4 100644 --- a/app/admin/common.php +++ b/app/admin/common.php @@ -4,8 +4,11 @@ * @license https://opensource.org/licenses/Apache-2.0 * @link https://www.gougucms.com */ - -// admin模块公共文件 +// 应用公共文件,内置主要的数据处理方法 +use think\facade\Config; +use think\facade\Request; +use think\facade\Cache; +use think\facade\Db; //获取后台模块当前登录用户的信息 function get_login_admin($key = "") { @@ -109,102 +112,107 @@ function create_tree_list($pid, $arr, $group, &$tree = []) return $tree; } -//递归排序 -function set_recursion($result, $pid = 0, $format = "L ") +//递归排序,用于分类选择 +function set_recursion($result, $pid = 0, $level=-1) { /*记录排序后的类别数组*/ static $list = array(); - + static $space = ['','├─','§§├─','§§§§├─','§§§§§§├─']; + $level++; foreach ($result as $k => $v) { if ($v['pid'] == $pid) { if ($pid != 0) { - $v['title'] = $format . $v['title']; + $v['title'] = $space[$level] . $v['title']; } /*将该类别的数据放入list中*/ $list[] = $v; - set_recursion($result, $v['id'], " " . $format); + set_recursion($result, $v['id'],$level); } } - return $list; } +/** + * 根据id递归返回子数据 + * @param $data 数据 + * @param $pid 父节点id + */ +function get_data_node($data=[],$pid=0){ + $dep = []; + foreach($data as $k => $v){ + if($v['pid'] == $pid){ + $node=get_data_node($data, $v['id']); + array_push($dep,$v); + if(!empty($node)){ + $dep=array_merge($dep,$node); + } + } + } + return array_values($dep); +} + //获取指定管理员的信息 function get_admin($id) { - $admin = \think\facade\Db::name('Admin')->where(['id' => $id])->find(); - $admin['group_id'] = \think\facade\Db::name('AdminGroupAccess')->where(['uid' => $id])->column('group_id'); + $admin = Db::name('Admin')->where(['id' => $id])->find(); + $admin['group_id'] = Db::name('AdminGroupAccess')->where(['uid' => $id])->column('group_id'); return $admin; } -//读取后台菜单列表 -function get_admin_menu() -{ - $menu = \think\facade\Db::name('AdminMenu')->order('sort asc')->select()->toArray(); - return $menu; -} - //读取权限节点列表 function get_admin_rule() { - $rule = \think\facade\Db::name('AdminRule')->order('create_time asc')->select()->toArray(); + $rule = Db::name('AdminRule')->where(['status'=>1])->order('sort asc,id asc')->select()->toArray(); return $rule; } +//读取模块列表 +function get_admin_module() +{ + $group = Db::name('AdminModule')->order('id asc')->select()->toArray(); + return $group; +} + //读取权限分组列表 function get_admin_group() { - $group = \think\facade\Db::name('AdminGroup')->order('create_time asc')->select()->toArray(); + $group = Db::name('AdminGroup')->order('create_time asc')->select()->toArray(); return $group; } //读取指定权限分组详情 function get_admin_group_info($id) { - $group = \think\facade\Db::name('AdminGroup')->where(['id' => $id])->find(); - $group['rules'] = explode(',', $group['rules']); - $group['menus'] = explode(',', $group['menus']); - return $group; -} - -//菜单父子关系排序,用于后台菜单 -function get_admin_menus() -{ - if (get_cache('menu' . get_login_admin('id'))) { - $list = get_cache('menu' . get_login_admin('id')); - } else { - $adminGroup = \think\facade\Db::name('AdminGroupAccess')->where(['uid' => get_login_admin('id')])->column('group_id'); - $adminMenu = \think\facade\Db::name('AdminGroup')->where('id', 'in', $adminGroup)->column('menus'); - $adminMenus = []; - foreach ($adminMenu as $k => $v) { - $v = explode(',', $v); - $adminMenus = array_merge($adminMenus, $v); - } - $menu = \think\facade\Db::name('AdminMenu')->where('id', 'in', $adminMenus)->order('sort asc')->select()->toArray(); - $list = list_to_tree($menu); - \think\facade\Cache::tag('adminMenu')->set('menu' . get_login_admin('id'), $list); - } - return $list; + $rule = Db::name('AdminGroup')->where(['id' => $id])->value('rules'); + $rules = explode(',', $rule); + return $rules; } //读取导航列表,用于后台 function get_nav($nav_id) { - $nav = \think\facade\Db::name('NavInfo')->where('nav_id', $nav_id)->order('sort asc')->select(); + $nav = Db::name('NavInfo')->where('nav_id', $nav_id)->order('sort asc')->select(); return $nav; } //读取关键字列表 function get_keywords() { - $keywords = \think\facade\Db::name('Keywords')->where(['status' => 1])->order('create_time asc')->select(); + $keywords = Db::name('Keywords')->where(['status' => 1])->order('create_time asc')->select(); return $keywords; } //读取文章分类列表 function get_article_cate() { - $cate = \think\facade\Db::name('ArticleCate')->order('create_time asc')->select()->toArray(); + $cate = Db::name('ArticleCate')->order('create_time asc')->select()->toArray(); + return $cate; +} + +//读取商品分类列表 +function get_goods_cate() +{ + $cate = Db::name('GoodsCate')->order('create_time asc')->select()->toArray(); return $cate; } @@ -246,35 +254,13 @@ function date_document($arrData) */ function add_log($type, $param_id = '', $param = []) { - $request = get_params(); - switch ($type) { - case 'login': - $title = '登录'; - break; - case 'upload': - $title = '上传'; - break; - case 'add': - $title = '新增'; - break; - case 'edit': - $title = '编辑'; - break; - case 'view': - $title = '查看'; - break; - case 'delete': - $title = '删除'; - break; - case 'check': - $title = '审核'; - break; - default: - $title = '未知'; - break; - } + $action = '未知操作'; + $type_action = get_config('log.admin_action'); + if($type_action[$type]){ + $action = $type_action[$type]; + } if ($type == 'login') { - $login_admin = \think\facade\Db::name('Admin')->where(array('id' => $param_id))->find(); + $login_admin = Db::name('Admin')->where(array('id' => $param_id))->find(); } else { $session_admin = get_config('app.session_admin'); $login_admin = \think\facade\Session::get($session_admin); @@ -283,17 +269,25 @@ function add_log($type, $param_id = '', $param = []) $data['uid'] = $login_admin['id']; $data['nickname'] = $login_admin['nickname']; $data['type'] = $type; + $data['action'] = $action; $data['param_id'] = $param_id; $data['param'] = json_encode($param); - $data['module'] = \think\facade\App::initialize()->http->getName(); + $data['module'] = strtolower(app('http')->getName()); $data['controller'] = strtolower(app('request')->controller()); - $data['function'] = app('request')->action(); + $data['function'] = strtolower(app('request')->action()); $parameter = $data['module'] . '/' . $data['controller'] . '/' . $data['function']; - $data['rule_menu'] = $parameter; - $data['title'] = \think\facade\Db::name('AdminRule')->where(array('src' => $parameter))->value('title') ?? $title; - $content = $login_admin['nickname'] . '在' . date('Y-m-d H:i:s') . '执行了' . $data['title'] . '操作'; + $rule_menu = Db::name('AdminRule')->where(array('src' => $parameter))->find(); + if($rule_menu){ + $data['title'] = $rule_menu['title']; + $data['subject'] = $rule_menu['name']; + } + else{ + $data['title'] = ''; + $data['subject'] ='系统'; + } + $content = $login_admin['nickname'] . '在' . date('Y-m-d H:i:s') . $data['action'] . '了' . $data['subject']; $data['content'] = $content; $data['ip'] = app('request')->ip(); $data['create_time'] = time(); - \think\facade\Db::name('AdminLog')->strict(false)->field(true)->insert($data); + Db::name('AdminLog')->strict(false)->field(true)->insert($data); } diff --git a/app/admin/controller/Admin.php b/app/admin/controller/Admin.php index ea21a86..3c35f7d 100644 --- a/app/admin/controller/Admin.php +++ b/app/admin/controller/Admin.php @@ -207,7 +207,6 @@ class Admin extends BaseController public function view() { $id = get_params('id'); - $menu = get_admin_menu(); $rule = get_admin_rule(); $user_groups = Db::name('AdminGroupAccess') @@ -218,19 +217,14 @@ class Admin extends BaseController ->toArray(); $groups = $user_groups ?: []; - $menus = []; $rules = []; foreach ($groups as $g) { - $menus = array_merge($menus, explode(',', trim($g['menus'], ','))); $rules = array_merge($rules, explode(',', trim($g['rules'], ','))); } - $menus = array_unique($menus); $rules = array_unique($rules); - $role_menu = create_tree_list(0, $menu, $menus); $role_rule = create_tree_list(0, $rule, $rules); - View::assign('role_menu', $role_menu); View::assign('role_rule', $role_rule); View::assign('admin', get_admin($id)); add_log('view', get_params('id')); diff --git a/app/admin/controller/Article.php b/app/admin/controller/Article.php index 57cbfd5..4aa412a 100644 --- a/app/admin/controller/Article.php +++ b/app/admin/controller/Article.php @@ -32,34 +32,42 @@ class Article extends BaseController } } + //获取子分类id.$is_self=1包含自己 + public function get_cate_son($id = 0, $is_self = 1) + { + $cates = Db::name('ArticleCate')->order('create_time asc')->select()->toArray(); + $cates_list = get_data_node($cates, $id); + $cates_array = array_column($cates_list, 'id'); + if ($is_self == 1) { + //包括自己在内 + $cates_array[] = $id; + } + return $cates_array; + } + //文章分类添加 public function cate_add() { - return view('', ['pid' => get_params('pid')]); - } - - //提交保存文章分类 - public function cate_post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { - $data[$param['field']] = $param['value']; - $data['id'] = $param['id']; - $data['update_time'] = time(); - if(!empty($data['title'])){ - try { - validate(ArticleCateCheck::class)->scene('edit')->check($data); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } + try { + validate(ArticleCateCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + $department_array = $this->get_cate_son($param['id']); + if (in_array($param['pid'], $department_array)) { + return to_assign(1, '上级分类不能是该分类本身或其子分类'); + } else { + $res = ArticleCate::strict(false)->field(true)->update($param); + if ($res) { + add_log('edit', $param['id'], $param); + } + return to_assign(); } - $res = ArticleCate::strict(false)->field(true)->update($data); - if ($res) { - add_log('edit', $data['id'], $data); - } - return to_assign(); } else { try { validate(ArticleCateCheck::class)->scene('add')->check($param); @@ -75,6 +83,18 @@ class Article extends BaseController return to_assign(); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + $pid = isset($param['pid']) ? $param['pid'] : 0; + if ($id > 0) { + $cate = Db::name('ArticleCate')->where(['id' => $id])->find(); + $pid = $cate['pid']; + View::assign('cate', $cate); + } + View::assign('id', $id); + View::assign('pid', $pid); + return view(); + } } //删除文章分配 @@ -126,21 +146,8 @@ class Article extends BaseController //文章添加&&编辑 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - View::assign('id', $id); - if ($id > 0) { - $article = (new ArticleList())->detail($id); - View::assign('article', $article); - return view('edit'); - } - return view(); - } - - //文章内容提交保存 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); $DbRes=false; if (!empty($param['id']) && $param['id'] > 0) { try { @@ -220,6 +227,16 @@ class Article extends BaseController return to_assign(1,'操作失败'); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + View::assign('id', $id); + if ($id > 0) { + $article = (new ArticleList())->detail($id); + View::assign('article', $article); + return view('edit'); + } + return view(); + } } //删除文章 diff --git a/app/admin/controller/Conf.php b/app/admin/controller/Conf.php index 4f7c298..c23e764 100644 --- a/app/admin/controller/Conf.php +++ b/app/admin/controller/Conf.php @@ -33,23 +33,11 @@ class Conf extends BaseController } } - //添加 + //添加/编辑配置项 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - if ($id > 0) { - $config = Db::name('Config')->where(['id' => $id])->find(); - View::assign('config', $config); - } - View::assign('id', $id); - return view(); - } - - //提交添加 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); try { validate(ConfCheck::class)->check($param); } catch (ValidateException $e) { @@ -62,7 +50,6 @@ class Conf extends BaseController if ($res) { add_log('edit', $param['id'], $param); } - return to_assign(); } else { $param['create_time'] = time(); @@ -70,12 +57,20 @@ class Conf extends BaseController if ($insertId) { add_log('add', $insertId, $param); } - return to_assign(); } + } else { + $id = isset($param['id']) ? $param['id'] : 0; + if ($id > 0) { + $config = Db::name('Config')->where(['id' => $id])->find(); + View::assign('config', $config); + } + View::assign('id', $id); + return view(); } } - //删除 + + //删除配置项 public function delete() { $id = get_params("id"); @@ -90,22 +85,11 @@ class Conf extends BaseController } } - //编辑配置 + //编辑配置信息 public function edit() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - $conf = Db::name('Config')->where('id', $id)->find(); - $config = []; - if ($conf['content']) { - $config = unserialize($conf['content']); - } - return view($conf['name'], ['id' => $id, 'config' => $config]); - } - //提交添加 - public function conf_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); $data['content'] = serialize($param); $data['update_time'] = time(); $data['id'] = $param['id']; @@ -116,6 +100,16 @@ class Conf extends BaseController add_log('edit', $param['id'], $param); } return to_assign(); + } else { + $id = isset($param['id']) ? $param['id'] : 0; + $conf = Db::name('Config')->where('id', $id)->find(); + $config = []; + if ($conf['content']) { + $config = unserialize($conf['content']); + } + View::assign('id', $id); + View::assign('config', $config); + return view($conf['name']); } } } diff --git a/app/admin/controller/Database.php b/app/admin/controller/Database.php index 26e066d..74f4fa1 100644 --- a/app/admin/controller/Database.php +++ b/app/admin/controller/Database.php @@ -62,7 +62,7 @@ class Database extends BaseController add_log('add'); return to_assign(0, '备份成功!'); } else { - return to_assign(1, '请选择要备份的表!'); + return to_assign(1, '请选择要备份的表'); } } @@ -71,14 +71,14 @@ class Database extends BaseController { $tables = get_params('id'); if (empty($tables)) { - return to_assign(0, '请选择要优化的表!'); + return to_assign(0, '请选择要优化的表'); } $tables = explode(',', $tables); if ($this->db->optimize($tables)) { add_log('edit'); return to_assign(0, '数据表优化成功!'); } else { - return to_assign(1, '数据表优化出错请重试!'); + return to_assign(1, '数据表优化出错请重试'); } } @@ -87,14 +87,14 @@ class Database extends BaseController { $tables = get_params('id'); if (empty($tables)) { - return to_assign(1, '请选择要修复的表!'); + return to_assign(1, '请选择要修复的表'); } $tables = explode(',', $tables); if ($this->db->repair($tables)) { add_log('edit'); - return to_assign(0, '数据表修复成功!'); + return to_assign(0, '数据表修复成功'); } else { - return to_assign(1, '数据表修复出错请重试!'); + return to_assign(1, '数据表修复出错请重试'); } } @@ -167,13 +167,13 @@ class Database extends BaseController $this->db->delFile($v); } add_log('delete'); - return to_assign(0, "删除成功!"); + return to_assign(0, "删除成功"); } if ($this->db->delFile($id)) { add_log('delete'); - return to_assign(0, "删除成功!"); + return to_assign(0, "删除成功"); } else { - return to_assign(1, "备份文件删除失败,请检查文件权限!"); + return to_assign(1, "备份文件删除失败,请检查文件权限"); } } } diff --git a/app/admin/controller/Goods.php b/app/admin/controller/Goods.php new file mode 100644 index 0000000..0d97286 --- /dev/null +++ b/app/admin/controller/Goods.php @@ -0,0 +1,259 @@ +isAjax()) { + $cate = Db::name('GoodsCate')->order('create_time asc')->select(); + return to_assign(0, '', $cate); + } + else{ + return view(); + } + } + + //获取子分类id.$is_self=1包含自己 + public function get_cate_son($id = 0, $is_self = 1) + { + $cates = Db::name('GoodsCate')->order('create_time asc')->select()->toArray(); + $cates_list = get_data_node($cates, $id); + $cates_array = array_column($cates_list, 'id'); + if ($is_self == 1) { + //包括自己在内 + $cates_array[] = $id; + } + return $cates_array; + } + + //文章分类添加 + public function cate_add() + { + $param = get_params(); + if (request()->isAjax()) { + if (!empty($param['id']) && $param['id'] > 0) { + try { + validate(GoodsCateCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + $department_array = $this->get_cate_son($param['id']); + if (in_array($param['pid'], $department_array)) { + return to_assign(1, '上级分类不能是该分类本身或其子分类'); + } else { + $res = GoodsCate::strict(false)->field(true)->update($param); + if ($res) { + add_log('edit', $param['id'], $param); + } + return to_assign(); + } + } else { + try { + validate(GoodsCateCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $insertId = GoodsCate::strict(false)->field(true)->insertGetId($param); + if ($insertId) { + add_log('add', $insertId, $param); + } + return to_assign(); + } + } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + $pid = isset($param['pid']) ? $param['pid'] : 0; + if ($id > 0) { + $cate = Db::name('GoodsCate')->where(['id' => $id])->find(); + $pid = $cate['pid']; + View::assign('cate', $cate); + } + View::assign('id', $id); + View::assign('pid', $pid); + return view(); + } + } + + //删除文章分配 + public function cate_delete() + { + $id = get_params("id"); + $cate_count = Db::name('GoodsCate')->where(["pid" => $id])->count(); + if ($cate_count > 0) { + return to_assign(1, "该分类下还有子分类,无法删除"); + } + $content_count = Db::name('Goods')->where(["cate_id" => $id])->count(); + if ($content_count > 0) { + return to_assign(1, "该分类下还有商品,无法删除"); + } + if (Db::name('GoodsCate')->delete($id) !== false) { + add_log('delete', $id); + return to_assign(0, "删除分类成功"); + } else { + return to_assign(1, "删除失败"); + } + } + + public function index() + { + if (request()->isAjax()) { + $param = get_params(); + $where = array(); + if (!empty($param['keywords'])) { + $where[] = ['a.id|a.title|a.keywords|a.desc|a.content|w.title', 'like', '%' . $param['keywords'] . '%']; + } + if (!empty($param['cate_id'])) { + $where[] = ['a.cate_id', '=', $param['cate_id']]; + } + $where[] = ['a.status', '>=', 0]; + $rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit']; + $content = GoodsList::where($where) + ->field('a.*,a.id as id,w.title as cate_title,a.title as title') + ->alias('a') + ->join('GoodsCate w', 'a.cate_id = w.id') + ->order('a.create_time desc') + ->paginate($rows, false, ['query' => $param]); + return table_assign(0, '', $content); + } + else{ + return view(); + } + } + + //文章添加&&编辑 + public function add() + { + $param = get_params(); + if (request()->isAjax()) { + $DbRes=false; + if (isset($param['tag_values']) && $param['tag_values']) { + $param['tag_values'] = implode(',',$param['tag_values']); + } + if (!empty($param['id']) && $param['id'] > 0) { + try { + validate(GoodsCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + Db::startTrans(); + try { + $res = GoodsList::strict(false)->field(true)->update($param); + $aid = $param['id']; + if ($res) { + //关联角色 + if (isset($param['keyword_names']) && $param['keyword_names']) { + Db::name('GoodsKeywords')->where(['aid'=>$aid])->delete(); + $keywordArray = explode(',', $param['keyword_names']); + $res_keyword = (new GoodsList())->insertKeyword($keywordArray,$aid); + } + else{ + $res_keyword == true; + } + if($res_keyword!== false){ + add_log('edit', $param['id'], $param); + Db::commit(); + $DbRes=true; + } + } else { + Db::rollback(); + } + } + catch (\Exception $e) { ##这里参数不能删除($e:错误信息) + Db::rollback(); + } + } else { + try { + validate(GoodsCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + Db::startTrans(); + try { + if(empty($param['desc'])){ + $param['desc'] = getDescriptionFromContent($param['content'], 100); + } + $aid = GoodsList::strict(false)->field(true)->insertGetId($param); + if ($aid) { + //关联角色 + if (isset($param['keyword_names']) && $param['keyword_names']) { + Db::name('GoodsKeywords')->where(['aid'=>$aid])->delete(); + $keywordArray = explode(',', $param['keyword_names']); + $res_keyword = (new GoodsList())->insertKeyword($keywordArray,$aid); + } + else{ + $res_keyword == true; + } + if($res_keyword!== false){ + add_log('add', $aid, $param); + Db::commit(); + $DbRes=true; + } + } else { + Db::rollback(); + } + } + catch (\Exception $e) { ##这里参数不能删除($e:错误信息) + Db::rollback(); + } + } + if($DbRes){ + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + View::assign('id', $id); + if ($id > 0) { + $goods = (new GoodsList())->detail($id); + View::assign('goods', $goods); + return view('edit'); + } + return view(); + } + } + + //删除文章 + public function delete() + { + $id = get_params("id"); + $data['status'] = '-1'; + $data['id'] = $id; + $data['update_time'] = time(); + if (Db::name('Goods')->update($data) !== false) { + add_log('delete', $id); + return to_assign(0, "删除成功"); + } else { + return to_assign(1, "删除失败"); + } + } +} diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 0e5e314..c840b09 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -17,8 +17,22 @@ class Index extends BaseController { public function index() { - $menu = get_admin_menus(); - View::assign('menu', $menu); + $admin = get_login_admin(); + if (get_cache('menu' . $admin['id'])) { + $list = get_cache('menu' . $admin['id']); + } else { + $adminGroup = Db::name('AdminGroupAccess')->where(['uid' => get_login_admin('id')])->column('group_id'); + $adminMenu = Db::name('AdminGroup')->where('id', 'in', $adminGroup)->column('rules'); + $adminMenus = []; + foreach ($adminMenu as $k => $v) { + $v = explode(',', $v); + $adminMenus = array_merge($adminMenus, $v); + } + $menu = Db::name('AdminRule')->where(['menu' => 1,'status'=>1])->where('id', 'in', $adminMenus)->order('sort asc')->select()->toArray(); + $list = list_to_tree($menu); + \think\facade\Cache::tag('adminMenu')->set('menu' . $admin['id'], $list); + } + View::assign('menu', $list); return View(); } diff --git a/app/admin/controller/Keywords.php b/app/admin/controller/Keywords.php index f294f54..5b5a5fa 100644 --- a/app/admin/controller/Keywords.php +++ b/app/admin/controller/Keywords.php @@ -40,20 +40,8 @@ class Keywords extends BaseController //添加 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - if ($id > 0) { - $keywords = Db::name('Keywords')->where(['id' => $id])->find(); - View::assign('keywords', $keywords); - } - View::assign('id', $id); - return view(); - } - - //提交添加 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { try { validate(KeywordsCheck::class)->scene('edit')->check($param); @@ -84,7 +72,17 @@ class Keywords extends BaseController return to_assign(); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + if ($id > 0) { + $keywords = Db::name('Keywords')->where(['id' => $id])->find(); + View::assign('keywords', $keywords); + } + View::assign('id', $id); + return view(); + } } + //删除 public function delete() { diff --git a/app/admin/controller/Level.php b/app/admin/controller/Level.php new file mode 100644 index 0000000..321b95b --- /dev/null +++ b/app/admin/controller/Level.php @@ -0,0 +1,95 @@ +isAjax()) { + $level = Db::name('UserLevel')->select(); + return to_assign(0, '', $level); + } else { + return view(); + } + } + + //添加新增/编辑 + public function add() + { + $param = get_params(); + if (request()->isAjax()) { + $param['title'] = preg_replace('# #','',$param['title']); + if ($param['id'] > 0) { + try { + validate(LevelCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + Db::name('UserLevel')->strict(false)->field(true)->update($param); + add_log('edit', $param['id'], $param); + } else { + try { + validate(LevelCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $mid = Db::name('UserLevel')->strict(false)->field(true)->insertGetId($param); + add_log('add', $mid, $param); + } + return to_assign(); + } else { + $id = isset($param['id']) ? $param['id'] : 0; + if($id>0){ + $detail = Db::name('UserLevel')->where('id',$id)->find(); + View::assign('detail', $detail); + } + View::assign('id', $id); + return view(); + } + } + + //禁用/启用 + public function disable() + { + $param = get_params(); + $module = Db::name('AdminModule')->where('id',$param['id'])->find(); + if($module['type'] == 1){ + return to_assign(1,'系统模块不能禁用'); + } + $param['update_time']= time(); + $res = Db::name('AdminModule')->strict(false)->field('status,update_time')->update($param); + if($res!==false){ + Db::name('AdminRule')->strict(false)->where('module',$module['name'])->field('status')->update(['status'=>$param['status']]); + // 删除后台节点缓存 + clear_cache('adminRules'); + if($param['status'] == 0){ + add_log('disable', $param['id'], $param); + } + else if($param['status'] == 1){ + add_log('recovery', $param['id'], $param); + } + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } +} diff --git a/app/admin/controller/Log.php b/app/admin/controller/Log.php new file mode 100644 index 0000000..a533f40 --- /dev/null +++ b/app/admin/controller/Log.php @@ -0,0 +1,62 @@ +isAjax()) { + $param = get_params(); + $where = array(); + if (!empty($param['keywords'])) { + $where[] = ['nickname|content|param_id', 'like', '%' . $param['keywords'] . '%']; + } + if (!empty($param['action'])) { + $where['action'] = $param['action']; + } + $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; + $content = DB::name('AdminLog') + ->field("id,uid,nickname,action,title,content,rule_menu,ip,param_id,param,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time") + ->order('create_time desc') + ->where($where) + ->paginate($rows, false, ['query' => $param]); + $content->toArray(); + foreach ($content as $k => $v) { + $data = $v; + $param_array = json_decode($v['param'], true); + if(is_array($param_array)){ + $param_value = ''; + foreach ($param_array as $key => $value) { + if (is_array($value)) { + $value = implode(',', $value); + } + $param_value .= $key . ':' . $value . '  |  '; + } + $data['param'] = $param_value; + } + else{ + $data['param'] = $param_array; + } + $content->offsetSet($k, $data); + } + return table_assign(0, '', $content); + } else { + $type_action = get_config('log.admin_action'); + View::assign('type_action', $type_action); + return view(); + } + } +} diff --git a/app/admin/controller/Menu.php b/app/admin/controller/Menu.php deleted file mode 100644 index aa4b433..0000000 --- a/app/admin/controller/Menu.php +++ /dev/null @@ -1,97 +0,0 @@ -isAjax()) { - $menu = Db::name('AdminMenu')->order('sort asc')->select(); - return to_assign(0, '', $menu); - } else { - return view(); - } - } - - //添加菜单页面 - - public function add() - { - return view('', ['pid' => get_params('pid')]); - } - - //提交添加 - - public function post_submit() - { - if (request()->isAjax()) { - $param = get_params(); - if ($param['id'] > 0) { - $data[$param['field']] = $param['value']; - $data['id'] = $param['id']; - if(!empty($data['title'])){ - try { - validate(MenuCheck::class)->scene('edit')->check($data); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - } - Db::name('AdminMenu')->strict(false)->field(true)->update($data); - add_log('edit', $param['id'], $data); - } else { - try { - validate(MenuCheck::class)->scene('add')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $mid = Db::name('AdminMenu')->strict(false)->field(true)->insertGetId($param); - //自动为系统所有者管理组分配新增的菜单 - $group = Db::name('AdminGroup')->find(1); - if (!empty($group)) { - $newGroup['id'] = 1; - $newGroup['menus'] = $group['menus'] . ',' . $mid; - Db::name('AdminGroup')->strict(false)->field(true)->update($newGroup); - add_log('add', $mid, $param); - } - } - // 删除后台菜单缓存 - clear_cache('adminMenu'); - return to_assign(); - } - } - - //删除 - - public function delete() - { - $id = get_params('id'); - $count = Db::name('AdminMenu')->where(['pid' => $id])->count(); - if ($count > 0) { - return to_assign(1, '该菜单下还有子菜单,无法删除'); - } - if (Db::name('AdminMenu')->delete($id) !== false) { - // 删除后台菜单缓存 - clear_cache('adminMenu'); - add_log('delete', $id, []); - return to_assign(0, '删除菜单成功'); - } else { - return to_assign(1, '删除失败'); - } - } -} diff --git a/app/admin/controller/Module.php b/app/admin/controller/Module.php new file mode 100644 index 0000000..98bd5b8 --- /dev/null +++ b/app/admin/controller/Module.php @@ -0,0 +1,99 @@ +isAjax()) { + $module = Db::name('AdminModule')->select(); + return to_assign(0, '', $module); + } else { + return view(); + } + } + + //添加新增/编辑 + public function add() + { + $param = get_params(); + if (request()->isAjax()) { + $param['name'] = preg_replace('# #','',$param['name']); + if ($param['id'] > 0) { + $module = Db::name('AdminModule')->where('id',$param['id'])->find(); + if($module['type'] == 1){ + return to_assign(1,'系统默认模块不能编辑'); + } + try { + validate(ModuleCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['update_time'] = time(); + Db::name('AdminModule')->strict(false)->field(true)->update($param); + add_log('edit', $param['id'], $param); + } else { + try { + validate(ModuleCheck::class)->scene('add')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + $param['create_time'] = time(); + $mid = Db::name('AdminModule')->strict(false)->field(true)->insertGetId($param); + add_log('add', $mid, $param); + } + return to_assign(); + } else { + $id = isset($param['id']) ? $param['id'] : 0; + if($id>0){ + $detail = Db::name('AdminModule')->where('id',$id)->find(); + View::assign('detail', $detail); + } + View::assign('id', $id); + return view(); + } + } + + //禁用/启用 + public function disable() + { + $param = get_params(); + $module = Db::name('AdminModule')->where('id',$param['id'])->find(); + if($module['type'] == 1){ + return to_assign(1,'系统模块不能禁用'); + } + $param['update_time']= time(); + $res = Db::name('AdminModule')->strict(false)->field('status,update_time')->update($param); + if($res!==false){ + Db::name('AdminRule')->strict(false)->where('module',$module['name'])->field('status')->update(['status'=>$param['status']]); + // 删除后台节点缓存 + clear_cache('adminRules'); + if($param['status'] == 0){ + add_log('disable', $param['id'], $param); + } + else if($param['status'] == 1){ + add_log('recovery', $param['id'], $param); + } + return to_assign(); + } + else{ + return to_assign(1,'操作失败'); + } + } +} diff --git a/app/admin/controller/Nav.php b/app/admin/controller/Nav.php index dc01285..6948708 100644 --- a/app/admin/controller/Nav.php +++ b/app/admin/controller/Nav.php @@ -40,20 +40,8 @@ class Nav extends BaseController //添加 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - if ($id > 0) { - $nav = Db::name('Nav')->where(['id' => $id])->find(); - View::assign('nav', $nav); - } - View::assign('id', $id); - return view(); - } - - //提交添加 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { try { validate(NavCheck::class)->scene('edit')->check($param); @@ -82,16 +70,22 @@ class Nav extends BaseController add_log('add', $nid, $param); return to_assign(); } - } + } else { + $id = isset($param['id']) ? $param['id'] : 0; + if ($id > 0) { + $nav = Db::name('Nav')->where(['id' => $id])->find(); + View::assign('nav', $nav); + } + View::assign('id', $id); + return view(); + } } //删除 public function delete() { $id = get_params('id'); - $count = Db::name('NavInfo')->where([ - 'nav_id' => $id, - ])->count(); + $count = Db::name('NavInfo')->where(['nav_id' => $id])->count(); if ($count > 0) { return to_assign(1, '该组下还有导航,无法删除'); } @@ -127,24 +121,8 @@ class Nav extends BaseController //添加导航 public function nav_info_add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - View::assign('id', $id); - View::assign('nav_id', get_params('nid')); - View::assign('pid', get_params('pid')); - if ($id > 0) { - $nav = Db::name('NavInfo')->where(['id' => $id])->find(); - View::assign('nav', $nav); - View::assign('nav_id', $nav['nav_id']); - View::assign('pid', $nav['pid']); - } - return view(); - } - - //保存添加 - public function nav_info_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { try { validate(NavCheck::class)->scene('editInfo')->check($param); @@ -169,8 +147,22 @@ class Nav extends BaseController clear_cache('homeNav'); add_log('add', $nid, $param); return to_assign(); - } - } + } + } else { + $id = isset($param['id']) ? $param['id'] : 0; + $nid = isset($param['nid']) ? $param['nid'] : 0; + $pid = isset($param['pid']) ? $param['pid'] : 0; + if ($id > 0) { + $nav = Db::name('NavInfo')->where(['id' => $id])->find(); + View::assign('nav', $nav); + $nid = $nav['nav_id']; + $pid = $nav['pid']; + } + View::assign('id', $id); + View::assign('nav_id', $nid); + View::assign('pid', $pid); + return view(); + } } //删除 diff --git a/app/admin/controller/Role.php b/app/admin/controller/Role.php index fe1150b..3e13eb9 100644 --- a/app/admin/controller/Role.php +++ b/app/admin/controller/Role.php @@ -39,37 +39,10 @@ class Role extends BaseController //添加&编辑 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - $menu = get_admin_menu(); - $rule = get_admin_rule(); - if($id > 0) { - $group = get_admin_group_info($id); - $role_menu = create_tree_list(0, $menu, $group['menus']); - $role_rule = create_tree_list(0, $rule, $group['rules']); - $role = Db::name('AdminGroup')->where(['id' => $id])->find(); - View::assign('role', $role); - } - else{ - $role_menu = create_tree_list(0, $menu, []); - $role_rule = create_tree_list(0, $rule, []); - } - View::assign('role_menu', $role_menu); - View::assign('role_rule', $role_rule); - View::assign('id', $id); - return view(); - } - - //提交保存 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); - $menuData = isset($param['menu']) ? $param['menu'] : 0; - $ruleData = isset($param['rule']) ? $param['rule'] : 0; - //sort($menuData); - //sort($ruleData); - $param['menus'] = implode(',',$menuData); - $param['rules'] = implode(',',$ruleData); + $ruleData = isset($param['rule']) ? $param['rule'] : 0; + $param['rules'] = implode(',', $ruleData); if (!empty($param['id']) && $param['id'] > 0) { try { validate(GroupCheck::class)->scene('edit')->check($param); @@ -95,8 +68,21 @@ class Role extends BaseController } //清除菜单\权限缓存 clear_cache('adminMenu'); - clear_cache('adminRules'); return to_assign(); + } else { + $id = isset($param['id']) ? $param['id'] : 0; + $rule = get_admin_rule(); + if ($id > 0) { + $rules = get_admin_group_info($id); + $role_rule = create_tree_list(0, $rule, $rules); + $role = Db::name('AdminGroup')->where(['id' => $id])->find(); + View::assign('role', $role); + } else { + $role_rule = create_tree_list(0, $rule, []); + } + View::assign('role_rule', $role_rule); + View::assign('id', $id); + return view(); } } diff --git a/app/admin/controller/Rule.php b/app/admin/controller/Rule.php index a3e5965..55845b9 100644 --- a/app/admin/controller/Rule.php +++ b/app/admin/controller/Rule.php @@ -20,7 +20,7 @@ class Rule extends BaseController public function index() { if (request()->isAjax()) { - $rule = Db::name('adminRule')->order('create_time asc')->select(); + $rule = Db::name('adminRule')->order('sort asc,id asc')->select(); return to_assign(0, '', $rule); } else { return view(); @@ -30,35 +30,18 @@ class Rule extends BaseController //添加 public function add() { - return view('', ['pid' => get_params('pid')]); - } - - //提交添加 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); + $param['src'] = preg_replace('# #','',$param['src']); if ($param['id'] > 0) { - $data[$param['field']] = $param['value']; - $data['id'] = $param['id']; - if(!empty($data['title'])){ - try { - validate(RuleCheck::class)->scene('edit_title')->check($data); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - } - if(!empty($data['src'])){ - try { - validate(RuleCheck::class)->scene('edit_src')->check($data); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - } - Db::name('AdminRule')->strict(false)->field(true)->update($data); - add_log('edit', $param['id'], $data); + try { + validate(RuleCheck::class)->scene('edit')->check($param); + } catch (ValidateException $e) { + // 验证失败 输出错误信息 + return to_assign(1, $e->getError()); + } + Db::name('AdminRule')->strict(false)->field(true)->update($param); + add_log('edit', $param['id'], $param); } else { try { validate(RuleCheck::class)->scene('add')->check($param); @@ -66,6 +49,7 @@ class Rule extends BaseController // 验证失败 输出错误信息 return to_assign(1, $e->getError()); } + $param['create_time'] = time(); $rid = Db::name('AdminRule')->strict(false)->field(true)->insertGetId($param); //自动为系统所有者管理组分配新增的节点 $group = Db::name('AdminGroup')->find(1); @@ -79,9 +63,18 @@ class Rule extends BaseController // 删除后台节点缓存 clear_cache('adminRules'); return to_assign(); + } else { + $id = isset($param['id']) ? $param['id'] : 0; + $pid = isset($param['pid']) ? $param['pid'] : 0; + if($id>0){ + $detail = Db::name('AdminRule')->where('id',$id)->find(); + View::assign('detail', $detail); + } + View::assign('id', $id); + View::assign('pid', $pid); + return view(); } } - //删除 public function delete() { diff --git a/app/admin/controller/Sitemap.php b/app/admin/controller/Sitemap.php index fb6f20e..f86ca5e 100644 --- a/app/admin/controller/Sitemap.php +++ b/app/admin/controller/Sitemap.php @@ -42,20 +42,8 @@ class Sitemap extends BaseController //添加 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - if ($id > 0) { - $cate = Db::name('SitemapCate')->where(['id' => $id])->find(); - View::assign('cate', $cate); - } - View::assign('id', $id); - return view(); - } - - //提交添加 - public function post_submit() - { - if (request()->isAjax()) { - $param = get_params(); + $param = get_params(); + if (request()->isAjax()) { if (!empty($param['id']) && $param['id'] > 0) { try { validate(SitemapCateCheck::class)->scene('edit')->check($param); @@ -84,12 +72,21 @@ class Sitemap extends BaseController if ($sid) { add_log('add', $sid, $param); } - + // 删除菜单缓存 clear_cache('homeSitemap'); return to_assign(); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + if ($id > 0) { + $cate = Db::name('SitemapCate')->where(['id' => $id])->find(); + View::assign('cate', $cate); + } + View::assign('id', $id); + return view(); + } } //删除 @@ -136,22 +133,8 @@ class Sitemap extends BaseController //添加网站地图 public function sitemap_info_add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - $sitemap_cate_id = empty(get_params('cid')) ? 0 : get_params('cid'); - if ($id > 0) { - $sitemap = Db::name('Sitemap')->where(['id' => $id])->find(); - View::assign('sitemap', $sitemap); - } - View::assign('id', $id); - View::assign('sitemap_cate_id', $sitemap_cate_id); - return view(); - } - - //保存网站地图添加 - public function sitemap_info_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { try { validate(SitemapCheck::class)->scene('edit')->check($param); @@ -188,6 +171,17 @@ class Sitemap extends BaseController return to_assign(); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + $sitemap_cate_id = isset($param['cid']) ? $param['cid'] : 0; + if ($id > 0) { + $sitemap = Db::name('Sitemap')->where(['id' => $id])->find(); + View::assign('sitemap', $sitemap); + } + View::assign('id', $id); + View::assign('sitemap_cate_id', $sitemap_cate_id); + return view(); + } } //删除网站地图 diff --git a/app/admin/controller/Slide.php b/app/admin/controller/Slide.php index 50d70c9..56142db 100644 --- a/app/admin/controller/Slide.php +++ b/app/admin/controller/Slide.php @@ -40,20 +40,8 @@ class Slide extends BaseController //添加 public function add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - if ($id > 0) { - $slide = Db::name('Slide')->where(['id' => $id])->find(); - View::assign('slide', $slide); - } - View::assign('id', $id); - return view(); - } - - //提交添加 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { try { validate(SlideCheck::class)->scene('edit')->check($param); @@ -87,6 +75,15 @@ class Slide extends BaseController return to_assign(); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + if ($id > 0) { + $slide = Db::name('Slide')->where(['id' => $id])->find(); + View::assign('slide', $slide); + } + View::assign('id', $id); + return view(); + } } //删除 @@ -149,23 +146,8 @@ class Slide extends BaseController //添加幻灯片 public function slide_info_add() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - $slide_id = empty(get_params('sid')) ? 0 : get_params('sid'); - if ($id > 0) { - $slide_info = Db::name('SlideInfo')->where(['id' => $id])->find(); - View::assign('slide_info', $slide_info); - $slide_id = $slide_info['slide_id']; - } - View::assign('id', $id); - View::assign('slide_id', $slide_id); - return view(); - } - - //保存幻灯片添加 - public function slide_info_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { try { validate(SlideCheck::class)->scene('editInfo')->check($param); @@ -200,7 +182,20 @@ class Slide extends BaseController return to_assign(); } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + $slide_id = isset($param['sid']) ? $param['sid'] : 0; + if ($id > 0) { + $slide_info = Db::name('SlideInfo')->where(['id' => $id])->find(); + View::assign('slide_info', $slide_info); + $slide_id = $slide_info['slide_id']; + } + View::assign('id', $id); + View::assign('slide_id', $slide_id); + return view(); + } } + //删除幻灯片 public function slide_info_delete() { diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index c5f2d28..8e372e2 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -47,6 +47,7 @@ class User extends BaseController ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $item->register_time = empty($item->register_time) ? '-' : date('Y-m-d H:i', $item->register_time); + $item->level_name = Db::name('UserLevel')->where(['id' => $item->level])->value('title'); }); return table_assign(0, '', $content); } else { @@ -57,17 +58,8 @@ class User extends BaseController //编辑 public function edit() { - $id = empty(get_params('id')) ? 0 : get_params('id'); - $user = Db::name('User')->where(['id' => $id])->find(); - View::assign('user', $user); - return view(); - } - - //提交添加 - public function post_submit() - { + $param = get_params(); if (request()->isAjax()) { - $param = get_params(); if (!empty($param['id']) && $param['id'] > 0) { $res = Db::name('User')->where(['id' => $param['id']])->strict(false)->field(true)->update($param); if ($res) { @@ -78,6 +70,14 @@ class User extends BaseController } } } + else{ + $id = isset($param['id']) ? $param['id'] : 0; + $user = Db::name('User')->where(['id' => $id])->find(); + $levels = Db::name('UserLevel')->where(['status' => 1])->select()->toArray(); + View::assign('user', $user); + View::assign('levels', $levels); + return view(); + } } //查看 @@ -85,6 +85,7 @@ class User extends BaseController { $id = empty(get_params('id')) ? 0 : get_params('id'); $user = Db::name('User')->where(['id' => $id])->find(); + $user['level_name'] = Db::name('UserLevel')->where(['id' => $user['level']])->value('title'); add_log('view', get_params('id')); View::assign('user', $user); return view(); @@ -110,11 +111,14 @@ class User extends BaseController $param = get_params(); $where = array(); if (!empty($param['keywords'])) { - $where[] = ['nickname|title', 'like', '%' . $param['keywords'] . '%']; + $where[] = ['nickname|content|param_id', 'like', '%' . $param['keywords'] . '%']; + } + if (!empty($param['action'])) { + $where['title'] = $param['action']; } $rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit']; $content = DB::name('UserLog') - ->field("id,uid,nickname,title,content,ip,param,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time") + ->field("id,uid,nickname,title,content,ip,param_id,param,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time") ->order('create_time desc') ->where($where) ->paginate($rows, false, ['query' => $param]); @@ -135,6 +139,8 @@ class User extends BaseController } return table_assign(0, '', $content); } else { + $type_action = get_config('log.user_action'); + View::assign('type_action', $type_action); return view(); } } diff --git a/app/admin/model/Goods.php b/app/admin/model/Goods.php new file mode 100644 index 0000000..f5edac0 --- /dev/null +++ b/app/admin/model/Goods.php @@ -0,0 +1,84 @@ +where(['id'=>$id])->find(); + if(empty($goods)) { + return $this->error('商品不存在'); + } + + //轮播图 + if(!empty($goods['banner'])) { + $goods['banner_array'] = explode(',',$goods['banner']); + } + //关键字 + $keywrod_array = \think\facade\Db::name('ArticleKeywords') + ->field('i.aid,i.keywords_id,k.title') + ->alias('i') + ->join('keywords k', 'k.id = i.keywords_id', 'LEFT') + ->order('i.create_time asc') + ->where(array('i.aid' => $id, 'k.status' => 1)) + ->select()->toArray(); + + $goods['keyword_ids'] = implode(",", array_column($keywrod_array, 'keywords_id')); + $goods['keyword_names'] = implode(',', array_column($keywrod_array, 'title')); + + //标签设置 + $goods['tag1'] = $goods['tag2'] = $goods['tag3'] = $goods['tag4'] = $goods['tag5'] = $goods['tag6'] =0; + if(!empty($goods['tag_values'])) { + $tag_values_array = explode(',', $goods['tag_values']); + if(in_array('1', $tag_values_array)){ + $goods['tag1'] = 1; + } + if(in_array('2', $tag_values_array)){ + $goods['tag2'] = 1; + } + if(in_array('3', $tag_values_array)){ + $goods['tag3'] = 1; + } + if(in_array('4', $tag_values_array)){ + $goods['tag4'] = 1; + } + if(in_array('5', $tag_values_array)){ + $goods['tag5'] = 1; + } + if(in_array('6', $tag_values_array)){ + $goods['tag6'] = 1; + } + } + + return $goods; + } + + //插入关键字 + public function insertKeyword($keywordArray = [], $aid) + { + $insert = []; + $time = time(); + foreach ($keywordArray as $key => $value) { + if (!$value) { + continue; + } + $keywords_id = (new Keywords())->increase($value); + $insert[] = ['aid' => $aid, + 'keywords_id' => $keywords_id, + 'create_time' => $time, + ]; + } + $res = \think\facade\Db::name('GoodsKeywords')->strict(false)->field(true)->insertAll($insert); + return $res; + } +} diff --git a/app/admin/model/GoodsCate.php b/app/admin/model/GoodsCate.php new file mode 100644 index 0000000..c6dba29 --- /dev/null +++ b/app/admin/model/GoodsCate.php @@ -0,0 +1,15 @@ + 'require|unique:admin_menu', + 'title' => 'require|unique:goods_cate', 'id' => 'require', ]; protected $message = [ - 'title.require' => '菜单名称不能为空', - 'title.unique' => '同样的菜单名称已经存在', + 'title.require' => '名称不能为空', + 'title.unique' => '同样的名称已经存在', 'id.require' => '缺少更新条件', ]; protected $scene = [ 'add' => ['title'], - 'edit' => ['id','title'], + 'edit' => ['id', 'title'], ]; } diff --git a/app/admin/validate/GoodsCheck.php b/app/admin/validate/GoodsCheck.php new file mode 100644 index 0000000..265e7de --- /dev/null +++ b/app/admin/validate/GoodsCheck.php @@ -0,0 +1,34 @@ + 'require|unique:article', + 'content' => 'require', + 'id' => 'require', + 'article_cate_id' => 'require', + 'status' => 'require', + ]; + + protected $message = [ + 'title.require' => '标题不能为空', + 'title.unique' => '同样的商品标题已经存在', + 'cate_id.require' => '所属分类为必选', + 'id.require' => '缺少更新条件', + 'status.require' => '状态为必选', + ]; + + protected $scene = [ + 'add' => ['title', 'cate_id', 'content', 'status'], + 'edit' => ['title', 'cate_id', 'content', 'id', 'status'], + ]; +} diff --git a/app/admin/validate/LevelCheck.php b/app/admin/validate/LevelCheck.php new file mode 100644 index 0000000..abaf998 --- /dev/null +++ b/app/admin/validate/LevelCheck.php @@ -0,0 +1,29 @@ + 'require|unique:user_level', + 'id' => 'require', + ]; + + protected $message = [ + 'title.require' => '模块名称不能为空', + 'title.unique' => '同样的等级名称已经存在', + 'id.require' => '缺少更新条件', + ]; + + protected $scene = [ + 'add' => ['title'], + 'edit' => ['id','title'], + ]; +} diff --git a/app/admin/validate/ModuleCheck.php b/app/admin/validate/ModuleCheck.php new file mode 100644 index 0000000..f16cfc5 --- /dev/null +++ b/app/admin/validate/ModuleCheck.php @@ -0,0 +1,34 @@ + 'require|unique:admin_module', + 'name' => 'require|lower|min:2|unique:admin_module', + 'id' => 'require', + ]; + + protected $message = [ + 'title.require' => '模块名称不能为空', + 'title.unique' => '同样的模块名称已经存在', + 'name.require' => '模块所在目录不能为空', + 'name.lower' => '模块所在目录只能是小写字符', + 'name.min' => '模块所在目录至少需要2个小写字符', + 'name.unique' => '同样的模块所在目录已经存在', + 'id.require' => '缺少更新条件', + ]; + + protected $scene = [ + 'add' => ['title','name'], + 'edit' => ['id','title','name'], + ]; +} diff --git a/app/admin/view/admin/add.html b/app/admin/view/admin/add.html index 401fefb..4316ba4 100644 --- a/app/admin/view/admin/add.html +++ b/app/admin/view/admin/add.html @@ -1,65 +1,55 @@ {extend name="common/base"/} {block name="body"} -
+ {if condition="$id eq 0"} +
+

新增管理员

+
- + - + - + - + - + - + - + - - +
登录账号* - 登录账号* - - 用户名* + 用户名* - - 头像
(如若不上传
系统将自动生成)
+
头像
(如若不上传
系统将自动生成)
- +
密码* - 密码* - - 确认密码* + 确认密码* - +
手机号码* - 手机号码* - - 状态* + 状态*
用户角色* + 用户角色* {volist name=":get_admin_group()" id="v"} @@ -68,27 +58,26 @@
备注备注
{else/} +
+

编辑管理员

+
- + - + @@ -98,62 +87,52 @@ - + - + - + - + - + - + - +
登录账号* - 登录账号* - - 用户名* + 用户名* - + 头像
(如若不上传
系统将自动生成)
密码密码 确认密码 - 确认密码
手机号码* - 手机号码* 状态* - 状态* - +
用户角色* - 用户角色* {volist name=":get_admin_group()" id="v"} - + {/volist}
备注备注
{/if} - - - -
+
- + 返回
{/block} @@ -186,13 +165,13 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/admin/post_submit", + url: "/admin/admin/add", type: 'post', data: data.field, success: function (e) { if (e.code == 0) { layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); + window.location.href="/admin/admin/index"; layer.close(index); }); } else { @@ -203,11 +182,10 @@ return false; }); //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); + $('.body-table').on('click', '[lay-event="back"]', function () { + window.location.href="/admin/admin/index"; return false; }); - } diff --git a/app/admin/view/admin/index.html b/app/admin/view/admin/index.html index 783fae2..2097c62 100644 --- a/app/admin/view/admin/index.html +++ b/app/admin/view/admin/index.html @@ -1,14 +1,13 @@ {extend name="common/base"/} {block name="body"} -
-
-
- - -
-
+
+
+
+ +
+ +
@@ -94,7 +93,7 @@ field: 'right', title: '操作', toolbar: '#barDemo', - width: 150, + width: 136, align: 'center' } ] diff --git a/app/admin/view/admin/log_list.html b/app/admin/view/admin/log_list.html index 64ca590..8886522 100644 --- a/app/admin/view/admin/log_list.html +++ b/app/admin/view/admin/log_list.html @@ -1,23 +1,21 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="style"} {/block} {block name="body"}
-
最新动态
+
操作日志
{/block} diff --git a/app/admin/view/admin/view.html b/app/admin/view/admin/view.html index 7f015b9..7fca3b2 100644 --- a/app/admin/view/admin/view.html +++ b/app/admin/view/admin/view.html @@ -1,8 +1,14 @@ {extend name="common/base"/} +{block name="style"} + +{/block} {block name="body"} -
-

基本信息

+ +

管理员信息

@@ -61,78 +67,37 @@
登录账号
-

用户权限

+

用户权限

+ {volist name="role_rule" id="vo"} - - - - - - + + + {/notempty} + {/volist}
权限配置
操作菜单可见
- - {volist name="role_menu" id="vo"} - - - {notempty name="vo.children"} - - {/notempty} - - {/volist} -
- - -
- {volist name="vo.children" key="k" id="voo"} -
- -
- {notempty name="voo.children"} -
- {volist name="voo.children" id="vooo"} -
- -
- {/volist} -
- {/notempty} - {/volist} -
-
+
+
权限配置
操作节点可用
- - {volist name="role_rule" id="vo"} - - - {notempty name="vo.children"} - + {/volist} + {/notempty} - {/volist} -
- - -
- {volist name="vo.children" key="k" id="voo"} -
- -
- {notempty name="voo.children"} -
- {volist name="voo.children" id="vooo"} -
- -
- {/volist} -
- {/notempty} - {/volist} + {notempty name="vo.children"} +
+
+ {volist name="vo.children" key="k" id="voo"} +
+ +
+ {notempty name="voo.children"} +
+ {volist name="voo.children" id="vooo"} +
+
-
-
-
+
@@ -146,7 +111,7 @@ var TAB = parent.layui.tab, form = layui.form; //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { + $('.body-table').on('click', '[lay-event="back"]', function () { TAB.sonDelete(); return false; }); diff --git a/app/admin/view/article/add.html b/app/admin/view/article/add.html index 82e6af7..fac07e3 100644 --- a/app/admin/view/article/add.html +++ b/app/admin/view/article/add.html @@ -1,15 +1,17 @@ {extend name="common/base"/} {block name="body"} -
+ +
+

创建文章

+
- - + + - + - + - + - + - + - + - + - + - + - + - + - +
文章标题 *文章标题 *
文章分类*文章分类* 关键字*关键字* 状态*状态*
排序排序 首页显示首页显示 属性属性
是否原创是否原创 作者/来源作者/来源 来源链接来源链接
文章摘要文章摘要 缩略图缩略图
@@ -82,14 +84,14 @@
文章内容*文章内容*
-
+
@@ -134,13 +136,13 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/article/post_submit", + url: "/admin/article/add", type: 'post', data: data.field, success: function (e) { if (e.code == 0) { layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); + window.location.href="/admin/article/index.html"; layer.close(index); }); } else { @@ -151,8 +153,8 @@ return false; }); //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); + $('.body-table').on('click', '[lay-event="back"]', function () { + window.location.href="/admin/article/index.html"; return false; }); diff --git a/app/admin/view/article/cate.html b/app/admin/view/article/cate.html index ad5367b..5a8d4bd 100644 --- a/app/admin/view/article/cate.html +++ b/app/admin/view/article/cate.html @@ -1,19 +1,11 @@ {extend name="common/base"/} - -{block name="style"} - - {block name="body"} -
-
- + 添加分类点击表格内容可编辑 +
+
+
-
+
@@ -28,9 +20,8 @@ - {include file="common/layui" base='base' extend="['treeGrid']" callback="init" /} + {include file="common/layui" base='base' extend="['treeGrid','rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/article/cate_add.html b/app/admin/view/article/cate_add.html index 87185c5..acf6a4c 100644 --- a/app/admin/view/article/cate_add.html +++ b/app/admin/view/article/cate_add.html @@ -1,42 +1,43 @@ {extend name="common/base"/} {block name="body"} - + +

文章分类

- + - + - + - + - - + +
父级分类*父级分类* 分类名称*分类名称* - +
排序排序 - + 关键词关键词 - +
描述描述
+ -
{/block} @@ -52,28 +53,20 @@ //监听提交 form.on('submit(webform)', function(data){ $.ajax({ - url:"/admin/article/cate_post_submit", - type:'post', - data:data.field, - success:function(e){ - if(e.code==0){ - layer.confirm('保存成功,返回列表页吗?', {icon: 3, title:'提示'}, function(index){ - history.back(-1); - layer.close(index); - }); - }else{ - layer.msg(e.msg); + url:"/admin/article/cate_add", + type:'post', + data:data.field, + success: function (e) { + layer.msg(e.msg); + if (e.code == 0) { + setTimeout(function(){ + parent.location.reload(); + },1000); + } } - } }) return false; }); - //监听返回 - $('.body-content').on('click','[lay-event="back"]',function () { - history.back(-1); - return false; - }); - } {include file="common/layui" base='base' extend="[]" callback="init" /} diff --git a/app/admin/view/article/edit.html b/app/admin/view/article/edit.html index 407fabf..9043f3d 100644 --- a/app/admin/view/article/edit.html +++ b/app/admin/view/article/edit.html @@ -1,16 +1,18 @@ {extend name="common/base"/} {block name="body"} -
-
+ +
+

编辑文章

+
- + - + - + - + - + - + - + - + - + - + - + - + - +
文章标题 *文章标题 *
文章分类*文章分类* 关键字*关键字* 状态*状态*
排序排序 首页显示首页显示 属性属性
是否原创是否原创 作者/来源作者/来源 来源链接来源链接
摘要摘要 缩略图缩略图
@@ -86,20 +88,19 @@
文章内容*文章内容*
-
+
-
{/block} @@ -140,13 +141,13 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/article/post_submit", + url: "/admin/article/add", type: 'post', data: data.field, success: function (e) { if (e.code == 0) { layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); + window.location.href="/admin/article/index.html"; layer.close(index); }); } else { @@ -157,8 +158,8 @@ return false; }); //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); + $('.body-table').on('click', '[lay-event="back"]', function () { + window.location.href="/admin/article/index.html"; return false; }); diff --git a/app/admin/view/article/index.html b/app/admin/view/article/index.html index b3fa372..95b52db 100644 --- a/app/admin/view/article/index.html +++ b/app/admin/view/article/index.html @@ -1,8 +1,8 @@ {extend name="common/base"/} {block name="body"} -
-
+
+
- + 如:QQ邮箱的SMTP服务器地址是smtp.qq.com,163邮箱的SMTP服务器地址是smtp.163.com @@ -18,8 +17,7 @@ 协议端口号* - + 如:QQ邮箱的ssl协议方式端口号是465/587,163邮箱的ssl协议方式端口号是465/994 @@ -27,8 +25,7 @@ 邮箱账户* - + 如:gougucms@qq.com @@ -47,7 +44,7 @@ 发送人* - 用于展示给发送方,如:勾股CMS系统管理员 @@ -56,7 +53,7 @@ 显示的邮箱* - 可以不同于上面的账户,用于展示给发送方的邮箱,如:admin@gougucms.com @@ -70,7 +67,6 @@ -
{/block} @@ -86,17 +82,15 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/conf/conf_submit", + url: "/admin/conf/edit", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,关闭本页面吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) @@ -116,7 +110,7 @@ return false; } $.ajax({ - url: "/admin/api/email_test", + url: "/home/api/email_test", data: { email: value }, type: "post", beforeSend: function () { @@ -133,11 +127,6 @@ }); return false; }) - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } diff --git a/app/admin/view/conf/index.html b/app/admin/view/conf/index.html index d5809fe..931c59d 100644 --- a/app/admin/view/conf/index.html +++ b/app/admin/view/conf/index.html @@ -1,7 +1,7 @@ {extend name="common/base"/} {block name="body"} -
+
@@ -9,8 +9,8 @@ {/block} @@ -19,15 +19,17 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/conf/other.html b/app/admin/view/conf/other.html index cff1e85..bc6073a 100644 --- a/app/admin/view/conf/other.html +++ b/app/admin/view/conf/other.html @@ -1,21 +1,19 @@ {extend name="common/base"/} {block name="body"} -
-

其他配置

- + +

其他配置

+
开发者 - + 开发版本号 - +
@@ -23,7 +21,6 @@
-
{/block} @@ -39,30 +36,20 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/conf/conf_submit", + url: "/admin/conf/edit", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,关闭本页面吗?', { - icon: 3, - title: '提示' - }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/conf/token.html b/app/admin/view/conf/token.html index 9793b51..b666fe4 100644 --- a/app/admin/view/conf/token.html +++ b/app/admin/view/conf/token.html @@ -1,34 +1,30 @@ {extend name="common/base"/} {block name="body"} -
-

Token配置

- + +

Token配置

+
Token签发组织 - + Token签发作者 - +
Token Secrect - + Token过期时间 - +
@@ -44,7 +40,6 @@
-
{/block} @@ -60,20 +55,15 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/conf/conf_submit", + url: "/admin/conf/edit", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,关闭本页面吗?', { - icon: 3, - title: '提示' - }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) @@ -137,7 +127,7 @@ return; } $.ajax({ - url:"/api/index/reg", + url: "/api/index/reg", type:'post', data:{username:username,pwd:password}, success:function(res){ @@ -181,7 +171,7 @@ return; } $.ajax({ - url:"/api/index/login", + url: "/api/index/login", type:'post', data:{username:username,password:password}, success:function(res){ diff --git a/app/admin/view/conf/web.html b/app/admin/view/conf/web.html index a9170b9..796f621 100644 --- a/app/admin/view/conf/web.html +++ b/app/admin/view/conf/web.html @@ -1,22 +1,20 @@ {extend name="common/base"/} {block name="body"} -
-

系统配置

- + +

系统配置

+
@@ -73,14 +66,12 @@
系统名称* - + 网站名称* - + 系统LOGO @@ -34,34 +32,29 @@ 网站域名* - + ICP备案号 - +
SEO关键词* - + 公安备案号 - +
SEO描述* - +
版权信息 - + 代码版本号* - +
@@ -88,7 +79,6 @@
-
{/block} @@ -106,7 +96,7 @@ //logo上传 var uploadInst = upload.render({ elem: '#test1', - url: '/admin/api/upload', + url: "/admin/api/upload", done: function (res) { //如果上传失败 if (res.code == 1) { @@ -122,30 +112,20 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/conf/conf_submit", + url: "/admin/conf/edit", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,关闭本页面吗?', { - icon: 3, - title: '提示' - }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/conf/wechat.html b/app/admin/view/conf/wechat.html index 05201f5..e7b0399 100644 --- a/app/admin/view/conf/wechat.html +++ b/app/admin/view/conf/wechat.html @@ -1,7 +1,7 @@ {extend name="common/base"/} {block name="body"} -
+

微信配置

@@ -61,7 +61,6 @@
-
{/block} @@ -75,32 +74,22 @@ layer = layui.layer; //监听提交 - form.on('submit(webform)', function(data) { + form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/conf/conf_submit", + url: "/admin/conf/edit", type: 'post', data: data.field, - success: function(e) { + success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,关闭本页面吗?', { - icon: 3, - title: '提示' - }, function(index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/database/backuplist.html b/app/admin/view/database/backuplist.html index 3b85364..9b73848 100644 --- a/app/admin/view/database/backuplist.html +++ b/app/admin/view/database/backuplist.html @@ -1,7 +1,7 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="body"} -
+
@@ -9,7 +9,7 @@ - + {empty name="list"} @@ -17,8 +17,8 @@ {/empty} {volist name="list" id="vo" key="k"} - - + + {volist name="vo.data" id="voo"} @@ -30,8 +30,8 @@ {/volist} diff --git a/app/admin/view/database/database.html b/app/admin/view/database/database.html index 9753217..e41b101 100644 --- a/app/admin/view/database/database.html +++ b/app/admin/view/database/database.html @@ -1,7 +1,7 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="body"} -
+
文件名称文件大小 文件格式 分隔符操作操作
备份时间:{$vo.time}
备份时间:{$vo.time}
.sql {$voo.compress} - 数据还原 - 备份下载备份删除 +
+{include file="common/layui" base='base' extend="['tagpicker']" callback="init" /} +{include file="common/ueditor" id="container" name="content" width="776" height="500" toolbar="[]" /} +{/block} + \ No newline at end of file diff --git a/app/admin/view/goods/cate.html b/app/admin/view/goods/cate.html new file mode 100644 index 0000000..6ca8288 --- /dev/null +++ b/app/admin/view/goods/cate.html @@ -0,0 +1,87 @@ +{extend name="common/base"/} + +{block name="body"} +
+
+ +
+
+
+
+
+ +{/block} + + + +{block name="script"} + + {include file="common/layui" base='base' extend="['treeGrid','rightpage']" callback="init" /} +{/block} + \ No newline at end of file diff --git a/app/admin/view/goods/cate_add.html b/app/admin/view/goods/cate_add.html new file mode 100644 index 0000000..45b5b90 --- /dev/null +++ b/app/admin/view/goods/cate_add.html @@ -0,0 +1,74 @@ +{extend name="common/base"/} + +{block name="body"} +
+

商品分类

+ + + + + + + + + + + + + + + + + +
父级分类* + + 分类名称* + +
排序 + + 关键词 + +
描述
+
+ + + +
+
+{/block} + + + +{block name="script"} + + {include file="common/layui" base='base' extend="[]" callback="init" /} +{/block} + \ No newline at end of file diff --git a/app/admin/view/goods/edit.html b/app/admin/view/goods/edit.html new file mode 100644 index 0000000..fdc389e --- /dev/null +++ b/app/admin/view/goods/edit.html @@ -0,0 +1,292 @@ +{extend name="common/base"/} + +{block name="body"} + +
+
+

编辑商品

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
商品标题 *状态 * + + +
关键字 * + + + 商品分类* + +
商品卖点 * + + 缩略图 * +
+ +
+ + +
+
+
商品简介 + +
商品标签 * + + + + + + +
市场价格 * + + 实际价格 * + + 是否包邮 * + + +
首页显示 + + + 属性 + + 排序 + +
商品轮播图 +
+ +
+ + {notempty name="goods.banner"} + {volist name="goods.banner_array" id="vo"} + + {/volist} + {/notempty} +
+
+
商品介绍 * + +
+
+ + + + +
+
+{/block} + + + +{block name="script"} + + {include file="common/layui" base='base' extend="['tagpicker']" use="['upload','form','laydate','table','tagpicker']" callback="init" /} + {include file="common/ueditor" id="container" name="m_content" width="776" height="500" toolbar="[]" /} +{/block} + \ No newline at end of file diff --git a/app/admin/view/goods/index.html b/app/admin/view/goods/index.html new file mode 100644 index 0000000..9e731f8 --- /dev/null +++ b/app/admin/view/goods/index.html @@ -0,0 +1,148 @@ +{extend name="common/base"/} + +{block name="body"} +
+
+
+ +
+
+ +
+ +
+
+
+ + + + + +{/block} + + + +{block name="script"} + +{include file="common/layui" base="base" extend="[]" callback="init" /} +{/block} + diff --git a/app/admin/view/index/index.html b/app/admin/view/index/index.html index dc1ae57..9a8bb51 100644 --- a/app/admin/view/index/index.html +++ b/app/admin/view/index/index.html @@ -31,9 +31,9 @@
-
-
-
+ diff --git a/app/admin/view/index/main.html b/app/admin/view/index/main.html index 147f96d..a137e8d 100644 --- a/app/admin/view/index/main.html +++ b/app/admin/view/index/main.html @@ -5,7 +5,7 @@ .table-title { font-size: 18px; font-weight: 800; - padding: 15px 0 5px 15px; + padding: 15px 15px 0; } .panel-num table { width: 100%; @@ -51,7 +51,6 @@ position: absolute; bottom: 0; left: 0; - background: linear-gradient(rgba(225, 225, 225, 0), rgba(225, 225, 225, .9)); } .panel-more a { @@ -86,7 +85,7 @@
0
-
产品
+
商品
0
@@ -94,13 +93,13 @@
注册用户
-
+
文章列表
-
+
diff --git a/app/admin/view/keywords/add.html b/app/admin/view/keywords/add.html index 3f76876..5a2482c 100644 --- a/app/admin/view/keywords/add.html +++ b/app/admin/view/keywords/add.html @@ -1,7 +1,8 @@ {extend name="common/base"/} {block name="body"} -
+ +

关键字

- + @@ -36,7 +37,6 @@
-
{/block} @@ -52,27 +52,21 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/keywords/post_submit", + url: "/admin/keywords/add", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + parent.tableIns.reload(); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } diff --git a/app/admin/view/keywords/index.html b/app/admin/view/keywords/index.html index b917ab9..b67de00 100644 --- a/app/admin/view/keywords/index.html +++ b/app/admin/view/keywords/index.html @@ -1,8 +1,8 @@ {extend name="common/base"/} {block name="body"} -
-
+
+
@@ -16,7 +16,7 @@ {/block} @@ -25,11 +25,13 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/level/index.html b/app/admin/view/level/index.html new file mode 100644 index 0000000..4aa7e57 --- /dev/null +++ b/app/admin/view/level/index.html @@ -0,0 +1,165 @@ +{extend name="common/base" /} + +{block name="body"} +
+
关键字名称* @@ -12,7 +13,7 @@ class="layui-input" style="max-width: 360px;" {notempty name="$keywords.title"} value="{$keywords.title}" {/notempty}> 排序排序
+
+ +{/block} + + + +{block name="script"} + + {include file="common/layui" base='base' extend="[]" callback="init" /} +{/block} + \ No newline at end of file diff --git a/app/admin/view/admin/log.html b/app/admin/view/log/index.html similarity index 75% rename from app/admin/view/admin/log.html rename to app/admin/view/log/index.html index a5709d2..8b0d36f 100644 --- a/app/admin/view/admin/log.html +++ b/app/admin/view/log/index.html @@ -1,20 +1,17 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="body"} -
- +
+
- +
- - - - - - - + {volist name="$type_action" id="vo"} + + {/volist}
@@ -35,7 +32,7 @@ elem: '#test', title: '操作日志列表', toolbar: '#toolbarDemo', - url: '/admin/admin/log', //数据接口 + url: "/admin/log/index", //数据接口 page: true, //开启分页 limit: 20, cols: [ @@ -46,9 +43,10 @@ align: 'center', width: 90 }, { - field: 'title', + field: 'action', title: '操作', - width: 150 + align: 'center', + width: 80 }, { field: 'content', title: '操作描述', @@ -87,7 +85,7 @@ tableIns.reload({ where: { keywords: data.field.keywords, - title_cate: data.field.title_cate + action: data.field.action }, page: { curr: 1 diff --git a/app/admin/view/menu/add.html b/app/admin/view/menu/add.html deleted file mode 100644 index 99c5b6a..0000000 --- a/app/admin/view/menu/add.html +++ /dev/null @@ -1,89 +0,0 @@ -{extend name="common/base"/} - -{block name="body"} - - - - - - - - - - - - - - - - - - - -
父级菜单* - - - 菜单名称* - -
菜单路径 - - 菜单参数 - -
菜单图标 - - - 如:icon-jichuguanli[点击查看图标] -
-
- - - -
- -{/block} - - - -{block name="script"} - -{include file="common/layui" base="base" extend="[]" callback="init" /} -{/block} - diff --git a/app/admin/view/menu/index.html b/app/admin/view/menu/index.html deleted file mode 100644 index 50005e6..0000000 --- a/app/admin/view/menu/index.html +++ /dev/null @@ -1,101 +0,0 @@ -{extend name="common/base"/} - -{block name="style"} - -{/block} - - -{block name="body"} -
-
- + 添加菜单点击表格内容可编辑 -
-
-
-
-
-{/block} - - - -{block name="script"} - -{include file="common/layui" base="base" extend="['treeGrid']" callback="init" /} -{/block} - \ No newline at end of file diff --git a/app/admin/view/module/index.html b/app/admin/view/module/index.html new file mode 100644 index 0000000..6392490 --- /dev/null +++ b/app/admin/view/module/index.html @@ -0,0 +1,179 @@ +{extend name="common/base" /} + +{block name="body"} +
+
+
+ +{/block} + + + +{block name="script"} + + {include file="common/layui" base='base' extend="[]" callback="init" /} +{/block} + \ No newline at end of file diff --git a/app/admin/view/nav/add.html b/app/admin/view/nav/add.html index 735db30..5dcc8ba 100644 --- a/app/admin/view/nav/add.html +++ b/app/admin/view/nav/add.html @@ -1,27 +1,22 @@ {extend name="common/base"/} {block name="body"} -
+ +

导航组

- + - + - + - - + +
标题* - 标题* - - 标识* + 标识* - +
状态* - 状态* {if condition="$id eq 0"} @@ -33,15 +28,13 @@
备注备注
-
{/block} @@ -57,30 +50,21 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/nav/post_submit", + url: "/admin/nav/add", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { - icon: 3, - title: '提示' - }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + parent.tableIns.reload(); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/nav/index.html b/app/admin/view/nav/index.html index 9285b67..057d1a6 100644 --- a/app/admin/view/nav/index.html +++ b/app/admin/view/nav/index.html @@ -1,10 +1,10 @@ {extend name="common/base"/} {block name="body"} -
-
+
+
- +
@@ -15,12 +15,12 @@ {/block} @@ -28,11 +28,13 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/nav/nav_info.html b/app/admin/view/nav/nav_info.html index 8264754..12cf608 100644 --- a/app/admin/view/nav/nav_info.html +++ b/app/admin/view/nav/nav_info.html @@ -1,21 +1,12 @@ {extend name="common/base"/} - -{block name="style"} - -{/block} - {block name="body"} -
-
- + 添加导航 +
+
+ +
-
+
@@ -31,17 +22,13 @@ {block name="script"} -{include file="common/layui" base="base" extend="['treeGrid']" callback="init" /} +{include file="common/layui" base="base" extend="['treeGrid','rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/nav/nav_info_add.html b/app/admin/view/nav/nav_info_add.html index c276850..2eeddc7 100644 --- a/app/admin/view/nav/nav_info_add.html +++ b/app/admin/view/nav/nav_info_add.html @@ -1,10 +1,11 @@ {extend name="common/base"/} {block name="body"} -
+ +

导航内容

- + - - - + - + - + - + - + '); //补丁元素 + patchElem.find('div').css({ + width: scollWidth + }); + that.layHeader.eq(0).find('thead tr').append(patchElem); + //that.layFilter.find('table thead tr').append(patchElem); + } + } else { + that.layFilter.eq(0).find('.layui-table-patch').remove(); + that.layHeader.eq(0).find('.layui-table-patch').remove(); + } + //固定列区域高度 + var mainHeight = that.layMain.height() + ,fixHeight = mainHeight - scollHeight; + that.layFixed.find(ELEM_BODY).css('height', layMainTable.height() > fixHeight ? fixHeight : 'auto'); + //表格宽度小于容器宽度时,隐藏固定列 + that.layFixRight[outWidth > 0 ? 'removeClass' : 'addClass'](HIDE); + //操作栏 + that.layFixRight.css('right', scollWidth - 1); + }; + //事件处理 + Class.prototype.events = function(){ + var that = this + ,options = that.config + ,_BODY = $('body') + ,dict = {} + ,th = that.layHeader.find('th') + ,resizing + ,ELEM_CELL = '.layui-table-cell' + ,filter = options.elem.attr('lay-filter') + ,layFilter=that.layFilter.find("[name^='filter_']")//行内过滤元素 + ; + + //行内过滤 + layFilter.on('keyup',function () { + that.page=1; + that.pullData(that.page, that.loading()); + }); + + + //拖拽调整宽度 + th.on('mousemove', function(e){ + var othis = $(this) + ,oLeft = othis.offset().left + ,pLeft = e.clientX - oLeft; + if(othis.attr('colspan') > 1 || othis.data('unresize') || dict.resizeStart){ + return; + } + dict.allowResize = othis.width() - pLeft <= 10; //是否处于拖拽允许区域 + _BODY.css('cursor', (dict.allowResize ? 'col-resize' : '')); + }).on('mouseleave', function(){ + var othis = $(this); + if(dict.resizeStart) return; + _BODY.css('cursor', ''); + }).on('mousedown', function(e){ + var othis = $(this); + if(dict.allowResize){ + var field = othis.data('field'); + e.preventDefault(); + dict.resizeStart = true; //开始拖拽 + dict.offset = [e.clientX, e.clientY]; //记录初始坐标 + + that.getCssRule(field, function(item){ + var width = item.style.width || othis.outerWidth(); + dict.rule = item; + dict.ruleWidth = parseFloat(width); + dict.minWidth = othis.data('minwidth') || options.cellMinWidth; + }); + } + }); + //拖拽中 + _DOC.on('mousemove', function(e){ + if(dict.resizeStart){ + e.preventDefault(); + if(dict.rule){ + var setWidth = dict.ruleWidth + e.clientX - dict.offset[0]; + if(setWidth < dict.minWidth) setWidth = dict.minWidth; + dict.rule.style.width = setWidth + 'px'; + layer.close(that.tipsIndex); + } + resizing = 1 + } + }).on('mouseup', function(e){ + if(dict.resizeStart){ + dict = {}; + _BODY.css('cursor', ''); + that.scrollPatch(); + } + if(resizing === 2){ + resizing = null; + } + }); + + //排序 + th.on('click', function(){ + var othis = $(this) + ,elemSort = othis.find(ELEM_SORT) + ,nowType = elemSort.attr('lay-sort') + ,type; + + if(!elemSort[0] || resizing === 1) return resizing = 2; + + if(nowType === 'asc'){ + type = 'desc'; + } else if(nowType === 'desc'){ + type = null; + } else { + type = 'asc'; + } + that.sort(othis, type, null, true); + }).find(ELEM_SORT+' .layui-edge ').on('click', function(e){ + var othis = $(this) + ,index = othis.index() + ,field = othis.parents('th').eq(0).data('field') + layui.stope(e); + if(index === 0){ + that.sort(field, 'asc', null, true); + } else { + that.sort(field, 'desc', null, true); + } + }); + + /** + * 树形节点点击事件(隐藏展开下级节点) + */ + that.elem.on('click', 'i.layui-tree-head', function(){ + var othis = $(this) + ,index = othis.parents('tr').eq(0).data('index') + ,tr = that.layBody.find('tr[data-index="'+ index +'"]') + ,options=that.config + ,tree_id=options[TREE_ID] + ,datas=table.getDataList(that.key);//数据 + var o=datas[index]; + that.treeNodeOpen(o,!o[table.config.cols.isOpen]); + }); + + //复选框选择 + that.elem.on('click', 'input[name="layTableCheckbox"]+', function(){ + var checkbox = $(this).prev() + ,childs = that.layBody.find('input[name="layTableCheckbox"]') + ,index = checkbox.parents('tr').eq(0).data('index') + ,checked = checkbox[0].checked + ,obj=table.getDataList(that.config.id)[index] + ,isAll = checkbox.attr('lay-filter') === 'layTableAllChoose'; + + //全选 + if(isAll){ + childs.each(function(i, item){ + item[table.config.cols.isCheckName] = checked; + that.setCheckData(i, checked); + }); + that.syncCheckAll(); + } else { + that.setCheckData(index, checked); + if(options.isTree){ + //处理下级 + var sonList=that.treeFindSonData(obj); + sonList.forEach(function (temo) { + that.setCheckData(temo[table.config.indexName], checked); + }); + //处理上级 + var uo=that.treeFindUpData(obj); + if(uo&&uo.children.length>0){ + var temis=true; + uo.children.forEach(function (temo) { + if(!temo[table.config.cols.isCheckName]){ + temis=false; + } + }); + if(temis){ + that.setCheckData(uo[table.config.indexName], checked); + } + } + } + that.syncCheckAll(); + } + layui.event.call(this, MOD_NAME, 'checkbox('+ filter +')', { + checked: checked + ,data: table.getDataList(that.key) ? (table.getDataList(that.key)[index] || {}) : {} + ,type: isAll ? 'all' : 'one' + }); + }); + + //行事件 + that.layBody.on('mouseenter', 'tr', function(){ + var othis = $(this) + ,index = othis.index(); + that.layBody.find('tr:eq('+ index +')').addClass(ELEM_HOVER) + }) + that.layBody.on('mouseleave', 'tr', function(){ + var othis = $(this) + ,index = othis.index(); + that.layBody.find('tr:eq('+ index +')').removeClass(ELEM_HOVER) + }); + + +//单元格编辑 + that.layBody.on('change', '.'+ELEM_EDIT, function(){ + var othis = $(this) + ,value = this.value + ,field = othis.parent().data('field') + ,index = othis.parents('tr').eq(0).data('index') + ,data = table.getDataList(that.key)[index]; + data[field] = value; //更新缓存中的值 + layui.event.call(this, MOD_NAME, 'edit('+ filter +')', { + value: value + ,data: data + ,field: field + }); + }); + + that.layBody.on('blur', '.'+ELEM_EDIT, function(){//单元格失去焦点 + var templet + ,othis = $(this) + ,field = othis.parent().data('field') + ,index = othis.parents('tr').eq(0).data('index') + ,editType = othis.parent().data('edit') + ,data = table.getDataList(that.key)[index]; + var options = that.config; + that.eachCols(function(i, item){ + if(item.field == field && item.templet){ + templet = item.templet; + } + }); + var value=""; + if(editType === 'select') { //选择框 + var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field); + if(rowsField&&rowsField['drop']){ + var o=dl.cache.code.get(rowsField.drop); + value=dl.ui.table.drop.findDropLable(rowsField.drop,this.value); + } + othis.parent().find(ELEM_CELL+' p').html( + templet ? laytpl($(templet).html() || value).render(data) : value + ); + } else {//输入框 + othis.parent().find(ELEM_CELL+' p').html( + templet ? laytpl($(templet).html() || this.value).render(data) : this.value + ); + } + othis.parent().data('content', this.value); + othis.remove(); + }); + + //单元格事件 + that.layBody.on('click', 'td div.layui-table-cell p', function(){ + var othis = $(this).parent().parent() + ,field = othis.data('field') + ,editType = othis.data('edit') + ,index = othis.parents('tr').eq(0).data('index') + ,data = table.getDataList(that.key)[index] + ,elemCell = othis.children(ELEM_CELL); + var options = that.config; + layer.close(that.tipsIndex); + if(othis.data('off')) return; + + //显示编辑表单 + if(editType){ + if(editType === 'select') { //选择框 + var dropName=othis.data('drop'); + var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field); + var o=dl.cache.code.get(rowsField.drop); + var html=''; + var scv=o.syscodevaluecache; + for(var i in scv){ + var isSelected=""; + if(scv[i].scv_value==data[field]){ + isSelected="selected='selected'"; + } + //选中 + html+='' + } + var select = $(''); + othis.find('.'+ELEM_EDIT)[0] || othis.append(select); + } else { //输入框 + var input = $(''); + input[0].value = $.trim($(this).text());// othis.data('content') || elemCell.text(); + othis.find('.'+ELEM_EDIT)[0] || othis.append(input); + input.focus(); + } + return; + } + + //如果出现省略,则可查看更多 + if(elemCell.find('.layui-form-switch,.layui-form-checkbox')[0]) return; //限制不出现更多(暂时) + if(Math.round(elemCell.prop('scrollWidth')) > Math.round(elemCell.outerWidth())){ + that.tipsIndex = layer.tips([ + '
' + ,elemCell.html() + ,'
' + ,'' + ].join(''), elemCell[0], { + tips: [3, ''] + ,time: -1 + ,anim: -1 + ,maxWidth: (device.ios || device.android) ? 300 : 600 + ,isOutAnim: false + ,skin: 'layui-table-tips' + ,success: function(layero, index){ + layero.find('.layui-table-tips-c').on('click', function(){ + layer.close(index); + }); + } + }); + } + }); + + //工具条操作事件 + that.layBody.on('click', '*[lay-event]', function(){ + var othis = $(this) + ,index = othis.parents('tr').eq(0).data('index') + ,tr = that.layBody.find('tr[data-index="'+ index +'"]') + ,ELEM_CLICK = 'layui-table-click' + ,list = table.getDataList(that.key) + ,data = table.getDataList(that.key)[index]; + layui.event.call(this, MOD_NAME, 'tool('+ filter +')', { + data: data//table.clearCacheKey(data) + ,event: othis.attr('lay-event') + ,tr: tr + ,del: function(){ + table.delRow(options.id,data); + } + ,update: function(fields){ + fields = fields || {}; + layui.each(fields, function(key, value){ + if(key in data){ + var templet, td = tr.children('td[data-field="'+ key +'"]'); + data[key] = value; + that.eachCols(function(i, item2){ + if(item2.field == key && item2.templet){ + templet = item2.templet; + } + }); + td.children(ELEM_CELL).html( + templet ? laytpl($(templet).html() || value).render(data) : value + ); + td.data('content', value); + } + }); + } + }); + tr.addClass(ELEM_CLICK).siblings('tr').removeClass(ELEM_CLICK); + }); + + //同步滚动条 + that.layMain.on('scroll', function(){ + var othis = $(this) + ,scrollLeft = othis.scrollLeft() + ,scrollTop = othis.scrollTop(); + + that.layHeader.scrollLeft(scrollLeft); + that.layFixed.find(ELEM_BODY).scrollTop(scrollTop); + + layer.close(that.tipsIndex); + }); + + _WIN.on('resize', function(){ //自适应 + that.resize(); + }); + }; + //表格重载 + thisTable.config = {}; + //自动完成渲染 + table.init(); + //layui.link('design/extend/treeGrid.css');//引入css + exports(MOD_NAME, table); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/dtree.js b/public/static/layui/plugin/dtree.js new file mode 100644 index 0000000..390ecdc --- /dev/null +++ b/public/static/layui/plugin/dtree.js @@ -0,0 +1 @@ +layui.define(["jquery","layer","form"],function(e){var f=layui.$,b=layui.layer,m=layui.form,y="dtree-nav-ul-sid",v="dtree-nav-item",k="dtree-nav-div",u="dtreefont",g="dtreefont-special",i="dtree-icon-move-down",o="dtree-icon-move-up",n="dtree-icon-refresh",s="dtree-icon-delete1",r="dtree-icon-search_list_light",t="dtree-toolbar",C="dtree-toolbar-tool",j="dtree-icon-dian",I="dtree-nav-checkbox-div",N="dtree-icon-fuxuankuangxuanzhong",T="dtree-icon-fuxuankuang",x="dtree-icon-fuxuankuang-banxuan",P="d-click-checkbar",c="dtree",a="dtree-",d="-item-this",l="-item",h="-dtreefont",p="-ficon",q="-icon",D="-checkbox",S="-choose",A="dtree-nav-this",L="dtree-nav-show",O="dtree-icon-hide",_=f("body"),F="dtree",w={},R={"-1":{open:"dtree-icon-null-open",close:"dtree-icon-null-close"},0:{open:"dtree-icon-jian",close:"dtree-icon-jia"},1:{open:"dtree-icon-xiangxia1",close:"dtree-icon-xiangyou"}},B={"-1":{open:"dtree-icon-null-open",close:"dtree-icon-null-close"},0:{open:"dtree-icon-wenjianjiazhankai",close:"dtree-icon-weibiaoti5"}},M={"-1":"dtree-icon-null",0:"dtree-icon-weibiaoti5",1:"dtree-icon-yonghu",2:"dtree-icon-fenzhijigou",3:"dtree-icon-fenguangbaobiao",4:"dtree-icon-xinxipilu",5:"dtree-icon-shuye1",6:"dtree-icon-caidan_xunzhang",7:"dtree-icon-normal-file"},E="checkNodeClick",U="itemNodeClick",J="addToolbar",z="editToolbar",G="delToolbar",$="moveDown",H="moveUp",X="refresh",K="remove",Q="searchNode",V={getElemId:function(e){var t=e.elem||"",a=e.obj||f(t);return 0==a.length?"":f(a)[0].id},escape:function(e){return"string"!=typeof e?"":e.replace(Z.escape,function(e){return Y.escape[e]})},unescape:function(e){return"string"!=typeof e?"":e.replace(Z.unescape,function(e){return Y.unescape[e]})},cloneObj:function(e,t){var a={};e instanceof Array&&(a=[]);var i="";for(var o in void 0!==t&&(i=t.join(",")),e)if(-1==i.indexOf(o)){var n=e[o];a[o]="object"==typeof n?V.cloneObj(n,void 0!==typeof t?t:[]):n}return a}},W=Object.keys||function(e){e=Object(e);var t=[];for(var a in e)t.push(a);return t},Y={escape:{"&":"&","<":"<",">":">","'":"&quo;"}};Y.unescape=function(e){e=Object(e);var t={};for(var a in e)t[e[a]]=a;return t}(Y.escape);var Z={escape:RegExp("["+W(Y.escape).join("")+"]","g"),unescape:RegExp("("+W(Y.unescape).join("|")+")","g")},ee=function(i){var e=i.data?i.data:{},t="boolean"!=typeof i.async||i.async;f.ajax({type:i.type?i.type:"POST",headers:i.headers,url:i.url,dataType:i.dataType?i.dataType:"json",data:e,async:t,success:i.success,error:function(e,t,a){"function"==typeof i.error?i.error():b.msg("系统异常导致操作失败, 请联系管理员。",{icon:5,shift:6})},statusCode:{404:function(){b.msg("未找到指定请求,请检查访问路径!",{icon:5,shift:6})},500:function(){b.msg("系统错误,请联系管理员。",{icon:5,shift:6})}},complete:function(e,t){"function"==typeof i.complete&&i.complete(e,t)}})},te=function(e){var t="?";for(var a in e)t+=a+"="+e[a]+"&";return t=t.substring(0,t.length-1)},ae=function(e){this.response={statusName:"code",statusCode:200,message:"message",rootName:"data",treeId:"id",parentId:"parentId",title:"title",iconClass:"iconClass",childName:"children",isLast:"isLast",spread:"spread",disabled:"disabled",checkArr:"checkArr",isChecked:"isChecked",type:"type",basicData:"basicData"},this.defaultRequest={nodeId:"nodeId",parentId:"parentId",context:"context",isLeaf:"isLeaf",level:"level",spread:"spread",dataType:"dataType",ischecked:"ischecked",initchecked:"initchecked",basicData:"basicData",recordData:"recordData"},this.toolbarFun={addTreeNode:function(e,t){},editTreeNode:function(e,t){},editTreeLoad:function(e){},delTreeNode:function(e,t){},loadToolbarBefore:function(e,t,a){return e}},this.toolbarStyle={title:"节点",area:["60%","80%"]},this.menubarFun={remove:function(e){return!0}},this.menubarTips={toolbar:[],group:[$,H,X,K,Q],freedom:[]},this.checkbarFun={chooseBefore:function(e,t){return!0},chooseDone:function(e){}},this.iframe={iframeElem:"",iframeUrl:"",iframeLoad:"leaf",iframeDefaultRequest:{nodeId:"nodeId",parentId:"parentId",context:"context",isLeaf:"isLeaf",level:"level",spread:"spread",dataType:"dataType",ischecked:"ischecked",initchecked:"initchecked",basicData:"basicData",recordData:"recordData"},iframeRequest:{}},this.iframeFun={iframeDone:function(e){}},this.style={item:"",itemThis:"",dfont:"",icon:"",cbox:"",chs:""},this.node={nodeId:"",parentId:"",context:"",isLeaf:"",level:"",spread:"",dataType:"",ischecked:"",initchecked:"",basicData:"",recordData:""},this.toolbarMenu={},this.checkbarNode=[],this.checkArrLen=0,this.temp=[],this.setting(e)};ae.prototype.setting=function(e){this.options=e||{},this.elem=this.options.elem||"",this.obj=this.options.obj||f(this.elem),this.initLevel=this.options.initLevel||2,this.type=this.options.type||"load",this.cache="boolean"!=typeof this.options.cache||this.options.cache,this.record="boolean"==typeof this.options.record&&this.options.record,this.load="boolean"!=typeof this.options.load||this.options.load,this.firstIconArray=f.extend(R,this.options.firstIconArray)||R,this.nodeIconArray=f.extend(B,this.options.nodeIconArray)||B,this.leafIconArray=f.extend(M,this.options.leafIconArray)||M,this.skin=this.options.skin||"theme","layui"==this.skin?(this.ficon=this.options.ficon||"1",this.dot="boolean"==typeof this.options.dot&&this.options.dot,this.icon=this.options.icon||"7",this.nodeIcon="string"==typeof this.icon||"number"==typeof this.icon?(this.icon,"-1"):this.icon[0]):(this.ficon=this.options.ficon||"0",this.dot="boolean"!=typeof this.options.dot||this.options.dot,this.icon=this.options.icon||"5",this.nodeIcon="string"==typeof this.icon||"number"==typeof this.icon?"-1"==this.icon?"-1":"0":this.icon[0]),this.ficonOpen=this.firstIconArray[this.ficon].open,this.ficonClose=this.firstIconArray[this.ficon].close,this.nodeIconOpen=this.nodeIconArray[this.nodeIcon].open,this.nodeIconClose=this.nodeIconArray[this.nodeIcon].close,this.leafIcon="string"==typeof this.icon||"number"==typeof this.icon?this.icon:this.icon[1],this.leafIconShow=this.leafIconArray[this.leafIcon],this.style.item=a+this.skin+l,this.style.itemThis=a+this.skin+d,this.style.dfont=a+this.skin+h,this.style.ficon=a+this.skin+p,this.style.icon=a+this.skin+q,this.style.cbox=a+this.skin+D,this.style.chs=a+this.skin+S,this.url=this.options.url||"",this.async="boolean"!=typeof this.options.async||this.options.async,this.headers=this.options.headers||{},this.method=this.options.method||"post",this.dataType=this.options.dataType||"json",this.defaultRequest=f.extend(this.defaultRequest,this.options.defaultRequest)||this.defaultRequest,this.filterRequest=this.options.filterRequest||[],this.request=this.options.request||{},this.response=f.extend(this.response,this.options.response)||this.response,this.data=this.options.data||null,this.dataFormat=this.options.dataFormat||"levelRelationship",this.dataStyle=this.options.dataStyle||"defaultStyle",this.success=this.options.success||function(e,t){},this.done=this.options.done||function(e,t){},this.toolbar=this.options.toolbar||!1,this.toolbarStyle=f.extend(this.toolbarStyle,this.options.toolbarStyle)||this.toolbarStyle,this.toolbarScroll=this.options.toolbarScroll||this.elem,this.toolbarLoad=this.options.toolbarLoad||"node",this.toolbarShow=this.options.toolbarShow||["add","edit","delete"],this.toolbarBtn=this.options.toolbarBtn||null,this.toolbarExt=this.options.toolbarExt||[],this.toolbarFun=f.extend(this.toolbarFun,this.options.toolbarFun)||this.toolbarFun,this.menubar=this.options.menubar||!1,this.menubarTips=f.extend(this.menubarTips,this.options.menubarTips)||this.menubarTips,this.menubarFun=f.extend(this.menubarFun,this.options.menubarFun)||this.menubarFun,this.checkbar=this.options.checkbar||!1,this.checkbarLoad=this.options.checkbarLoad||"node",this.checkbarType=this.options.checkbarType||"all",this.checkbarData=this.options.checkbarData||"choose",this.checkbarFun=f.extend(this.checkbarFun,this.options.checkbarFun)||this.checkbarFun,this.useIframe=this.options.useIframe||!1,this.iframe=f.extend(this.iframe,this.options.iframe)||this.iframe,this.iframeFun=f.extend(this.iframeFun,this.options.iframeFun)||this.iframeFun},ae.prototype.reloadSetting=function(e){this.options=f.extend(this.options,e)||this.options,this.elem=this.options.elem||this.elem,void 0===this.options.obj?this.elem&&0i.checkArrLen&&(i.checkArrLen=e.length),e},children:function(){return a[i.response.childName]||[]},basicData:function(){return V.escape(JSON.stringify(a[i.response.basicData]))||JSON.stringify({})},recordData:function(){var e=i.record?V.cloneObj(a,[i.response.basicData,i.response.childName]):{};return V.escape(JSON.stringify(e))},data:function(){return V.escape(JSON.stringify(a))}}},ae.prototype.getDom=function(s,e,t,r,n,d,a,l,i){var c=this,h=c.obj[0].id,p=(c.toolbar,c.checkbar);return{fnode:function(){var e=c.ficon,t=c.ficonOpen,a=c.ficonClose,i=c.dot;return"-1"!=e&&i?r?"":l?"":"":"-1"==e||i?"-1"==e&&i?r?"":l?"":"":"-1"!=e||i?void 0:r?"":l?"":"":r?"":l?"":""},node:function(){var e=c.nodeIcon,t=c.leafIcon,a=c.leafIconShow,i=c.nodeIconOpen,o=c.nodeIconClose;return n&&(o=i=a=n),"-1"!=e&&"-1"!=t?r?"":l?"":"":"-1"!=e&&"-1"==t?r?"":l?"":"":"-1"==e&&"-1"!=t?r?"":l?"":"":"-1"==e&&"-1"==t?r?"":l?"":"":void 0},checkbox:function(){var e=!1;if("node"==c.checkbarLoad?p&&(e=!0):r&&p&&(e=!0),e){var t="
";if(d&&0"}return t+="
"}return""},text:function(){return""+t+""},ul:function(){return r?"
    ":l?"
      ":"
        "}}},ae.prototype.getLiItemDom=function(e,t,a,i,o,n,s,r,d,l,c,h){var p=this,u=p.obj[0].id,f=p.getDom(e,t,a,i,o,n,s,r,d);l="{}"==l?"":l,c="{}"==c?"":c;var b="
        "),"noleaf"==p.toolbarLoad&&(b+=i?" d-contextmenu='false'>":" d-contextmenu='true'>"),"leaf"==p.toolbarLoad&&(b+=i?" d-contextmenu='true'>":" d-contextmenu='false'>")):b+=" d-contextmenu='false'>",["
      • "+b,f.fnode(),f.node(),f.checkbox(),f.text(),"
      • ",f.ul(),""].join("")},ae.prototype.dataInit=function(e){var t=this,a=t.obj.find("div[data-id='"+e+"']");a.parent().find("."+A).removeClass(A),a.parent().find("."+t.style.itemThis).removeClass(t.style.itemThis),a.addClass(A),a.addClass(t.style.itemThis),t.setNodeParam(a);var i=a.parents("."+v);return i.children("ul").addClass(L),i.children("."+k).children("i[data-spread]."+t.ficonClose).addClass(t.ficonOpen),i.children("."+k).children("i[data-spread]."+t.ficonClose).removeClass(t.ficonClose),i.children("."+k).children("i[data-spread]."+t.nodeIconClose).addClass(t.nodeIconOpen),i.children("."+k).children("i[data-spread]."+t.nodeIconClose).removeClass(t.nodeIconClose),t.getNowParam()},ae.prototype.clickSpread=function(e){var t=e.find("i[data-spread]").eq(0),a=e.find("i[data-spread]").eq(1),i=a.attr("class"),o=(e.find("cite[data-leaf]").eq(0),t.attr("data-spread")),n=e.next("ul"),s=this;if(0
        "),e.toolbar&&e.obj.before("
        ")},ae.prototype.openTreePlus=function(){var e=this,t=[];if(e.toolbar&&e.getToolbarDom(),e.menubar){var a=e.menubarTips,i=a.toolbar,o=a.group;a.freedom;if(i&&0";break;case H:a="";break;case X:a="";break;case K:a=this.checkbar?"":"";break;case Q:a=""}return a},ae.prototype.getExtMenubarDom=function(e){return""},ae.prototype.getMenubarToolDom=function(e){var t=this,a=t.obj[0].id;switch(e){case $:t.toolbarMenu[$]="
         展开"+t.toolbarStyle.title+"
        ";break;case H:t.toolbarMenu[H]="
         收缩"+t.toolbarStyle.title+"
        ";break;case X:t.toolbarMenu[X]="
         刷新
        ";break;case K:t.checkbar&&(t.toolbarMenu[K]="
         删除选中"+t.toolbarStyle.title+"
        ");break;case Q:t.toolbarMenu[Q]="
         查询"+t.toolbarStyle.title+"
        "}},ae.prototype.getExtMenubarToolDom=function(e){this.toolbarMenu[e.menubarId]="
         "+e.title+"
        "},ae.prototype.menubarMethod=function(){var p=this;return{openAllNode:function(e){for(var t=e||p.obj.children("li").children("ul"),a=0;a 新增"+e.toolbarStyle.title+""),"edit"==o&&(e.toolbarMenu[z]="
         编辑"+e.toolbarStyle.title+"
        "),"delete"==o&&(e.toolbarMenu[G]="
         删除"+e.toolbarStyle.title+"
        ")}if(0 "+n.title+""}},ae.prototype.setToolbarDom=function(e){if(e)for(var t in this.obj.prevAll("div#dtree_toolbar_"+this.obj[0].id).find("div.layui-nav-item>dl.layui-nav-child").html(""),e)this.obj.prevAll("div#dtree_toolbar_"+this.obj[0].id).find("div.layui-nav-item>dl.layui-nav-child").append(e[t])},ae.prototype.loadToolBar=function(e,t){var a=this,i=(a.toolbarShow,a.toolbarBtn),o="";switch(t){case J:var n=['
        ','','
        ','',"
        ","
        "].join(""),s=['
        ','",'
        ','',"
        ","
        "].join(""),r=['
        ','
        ','',"
        ","
        "].join(""),d=['
        ',n,s];if(null!=i&&0
        "),o=d.join("");break;case z:n=['
        ','','
        ','',"
        ","
        "].join("");var h=['
        ','",'
        ','',"
        ","
        "].join(""),p=['
        ','
        ','',"
        ","
        "].join(""),u=['
        ',n,h];if(null!=i&&0
        "),o=u.join("")}return o},ae.prototype.loadToolBarDetail=function(){return{text:function(e){return['
        ','",'
        ','',"
        ","
        "].join("")},textarea:function(e){return['
        ','",'
        ','","
        ","
        "].join("")},hidden:function(e){return[''].join("")},select:function(e){var t=e.optionsData,a="",i=e.value?e.value:"";for(var o in t)i==t[o]?a+="":a+="";return['
        ','",'
        ','","
        ","
        "].join("")}}},ae.prototype.changeTreeNodeAdd=function(e){var t=this,a=t.temp,i=a[0],o=a[1],n=a[2],s=a[3];if(e){var r=t.obj.find("[data-id='"+i+"']");if("object"==typeof e){r.remove();var d=t.parseData(e);if(!d.treeId())return b.msg("添加失败,节点ID为undefined!",{icon:5}),o.find("li[data-id='"+i+"']").remove(),t.setNodeParam(n),void(t.temp=[]);o.append(t.getLiItemDom(d.treeId(),d.parentId(),d.title(),d.isLast(0),d.iconClass(),d.checkArr(),s,d.spread(),d.disabled(),d.basicData(),d.recordData(),"item"));var l=o.find("div[data-id='"+e.id+"']");t.setNodeParam(l)}else if("string"==typeof e||"number"==typeof this.icon){r.attr("data-id",e),o.find("li[data-id='"+e+"']").show();l=o.find("div[data-id='"+e+"']");t.setNodeParam(l)}var c=n.find("i[data-spread]");"last"==c.eq(0).attr("data-spread")?(c.attr("data-spread","open"),c.eq(0).removeClass(j),c.eq(0).removeClass(O),c.eq(0).addClass(t.ficonOpen),c.eq(1).removeClass(M[t.leafIcon])):(c.attr("data-spread","open"),c.eq(0).removeClass(t.ficonClose),c.eq(0).addClass(t.ficonOpen),c.eq(1).removeClass(t.nodeIconClose)),c.eq(1).addClass(t.nodeIconOpen),o.addClass(L)}else o.find("li[data-id='"+i+"']").remove(),t.setNodeParam(n);t.temp=[]},ae.prototype.changeTreeNodeEdit=function(e){var t=this.temp,a=t[0],i=t[1];e||(a.html(title),node=this.getNodeParam(i)),this.temp=[]},ae.prototype.changeTreeNodeDone=function(e){m.val("dtree_editNode_form",e),m.render()},ae.prototype.changeTreeNodeDel=function(e){var t=this,a=t.temp,i=a[0],o=i.parent("ul"),n=a[1];if(e){if(i.remove(),0==o.children("li").length){var s=n.find("i[data-spread]");s.attr("data-spread","last"),s.eq(0).removeClass(t.ficonOpen),s.eq(0).removeClass(t.ficonClose),t.dot||s.eq(0).addClass(O),s.eq(0).addClass(j),s.eq(1).removeClass(t.nodeIconOpen),s.eq(1).removeClass(t.nodeIconClose),s.eq(1).addClass(M[t.leafIcon])}t.initNodeParam()}t.temp=[]},ae.prototype.chooseDataInit=function(e){for(var t=this,a=e.split(","),i=0;i."+k+">."+I+">i[data-type='"+i+"']");t.checkStatus(r).noCheck();for(var d=1,l=n;d."+y+" ."+I+">i[data-type='"+i+"'][data-checked='1']").length){var c=l.eq(d).find(">."+k+">."+I+">i[data-type='"+i+"']");t.checkStatus(c).noCheck()}}}else{t.checkStatus(e).check();r=s.find(">."+k+">."+I+">i[data-type='"+i+"']");t.checkStatus(r).check();for(d=1,l=n;d."+k+">."+I+">i[data-type='"+i+"']");t.checkStatus(c).check()}}},ae.prototype.checkAllOrNoallOrNot=function(e){var t=this,a=(e.closest("."+k),e.attr("data-par")),i=e.attr("data-type"),o=e.closest(a),n=e.parents(a),s=o.find(a);if("1"==e.attr("data-checked")){t.checkStatus(e).noCheck();var r=s.find(">."+k+">."+I+">i[data-type='"+i+"']");t.checkStatus(r).noCheck();for(var d=1,l=n;d."+y+" ."+I+">i[data-type='"+i+"'][data-checked='1']").length,h=l.eq(d).find(">."+k+">."+I+">i[data-type='"+i+"']");0==c?t.checkStatus(h).noCheck():t.checkStatus(h).noallCheck()}}else{t.checkStatus(e).check();r=s.find(">."+k+">."+I+">i[data-type='"+i+"']");t.checkStatus(r).check();for(d=1,l=n;d."+y+" ."+I+">i[data-type='"+i+"'][data-checked='1']").length,u=l.eq(d).find(">."+y+" ."+I+">i[data-type='"+i+"']").length;h=l.eq(d).find(">."+k+">."+I+">i[data-type='"+i+"']");p!=u?t.checkStatus(h).noallCheck():t.checkStatus(h).check()}}},ae.prototype.checkAllOrPcascOrNot=function(e){e.closest("."+k);var t=e.attr("data-par"),a=e.attr("data-type"),i=e.closest(t),o=(e.parents(t),i.find(t));if("1"==e.attr("data-checked")){this.checkStatus(e).noCheck();var n=o.find(">."+k+">."+I+">i[data-type='"+a+"']");this.checkStatus(n).noCheck()}else{this.checkStatus(e).check();n=o.find(">."+k+">."+I+">i[data-type='"+a+"']");this.checkStatus(n).check()}},ae.prototype.checkOrNot=function(e){e.closest("."+k);var t=e.attr("data-par"),a=(e.attr("data-type"),e.closest(t));e.parents(t),a.find(t);"1"==e.attr("data-checked")?this.checkStatus(e).noCheck():this.checkStatus(e).check()},ae.prototype.checkOnly=function(e){e.closest("."+k);var t=e.attr("data-par"),a=(e.attr("data-type"),e.closest(t)),i=(e.parents(t),a.find(t),e.attr("data-checked")),o=this.obj.find("i[data-checked]");this.checkStatus(o).noCheck(),"1"!=i&&this.checkStatus(e).check()},ae.prototype.changeCheck=function(){var e=this,t=e.temp[0];"all"==e.checkbarType?e.checkAllOrNot(t):"no-all"==e.checkbarType?e.checkAllOrNoallOrNot(t):"p-casc"==e.checkbarType?e.checkAllOrPcascOrNot(t):"self"==e.checkbarType?e.checkOrNot(t):"only"==e.checkbarType?e.checkOnly(t):e.checkAllOrNot(t);var a=e.setAndGetCheckbarNodesParam();e.checkbarFun.chooseDone(a),layui.event.call(this,F,"chooseDone("+f(e.obj)[0].id+")",{checkbarParams:a}),e.temp=[]},ae.prototype.initNoAllCheck=function(){var e=this.obj.find("i[data-checked='1']");if(0."+y+" ."+I+">i[data-type='"+o+"'][data-checked='1']").length,c=d.eq(r).find(">."+y+" ."+I+">i[data-type='"+o+"']").length,h=d.eq(r).find(">."+k+">."+I+">i[data-type='"+o+"']");l!=c?this.checkStatus(h).noallCheck():this.checkStatus(h).check()}},ae.prototype.initAllCheck=function(){var e=this.obj.find("i[data-checked='1']");if(0."+k+">."+I+">i[data-type='"+o+"']");this.checkStatus(l).check()}},ae.prototype.checkStatus=function(e){var t=this;return{check:function(){e.removeClass(T),e.removeClass(x),e.addClass(N),e.addClass(t.style.chs),e.attr("data-checked","1")},noCheck:function(){e.removeClass(x),e.removeClass(N),e.removeClass(t.style.chs),e.addClass(T),e.attr("data-checked","0")},noallCheck:function(){e.removeClass(T),e.removeClass(N),e.addClass(x),e.addClass(t.style.chs),e.attr("data-checked","2")}}},ae.prototype.setAndGetCheckbarNodesParam=function(){var a=this;return a.checkbarNode=[],"change"==a.checkbarData?a.obj.find("i[data-par]").each(function(){var e=f(this),t=e.closest("."+k);e.attr("data-checked")!=e.attr("data-initchecked")&&a.checkbarNode.push(a.getRequestParam(a.getCheckbarNodeParam(t,e)))}):"all"==a.checkbarData?a.obj.find("i[data-par][data-checked]").each(function(){var e=f(this),t=e.closest("."+k);a.checkbarNode.push(a.getRequestParam(a.getCheckbarNodeParam(t,e)))}):a.obj.find("i[data-par][data-checked='1']").each(function(){var e=f(this),t=e.closest("."+k);a.checkbarNode.push(a.getRequestParam(a.getCheckbarNodeParam(t,e)))}),a.checkbarNode},ae.prototype.getCheckbarNodesParam=function(){return this.setAndGetCheckbarNodesParam()},ae.prototype.getCheckbarNodeParam=function(e,t){var a={};return a.nodeId=e.attr("data-id"),a.parentId=e.parent().attr("data-pid"),a.context=e.find("cite[data-leaf]").eq(0).text(),a.isLeaf="leaf"==e.find("cite[data-leaf]").eq(0).attr("data-leaf"),a.level=e.parent().attr("data-index"),a.spread="open"==e.find("i[data-spread]").eq(0).attr("data-spread"),a.basicData=e.attr("data-basic"),a.recordData=e.attr("data-record"),a.dataType=t.attr("data-type"),a.ischecked=t.attr("data-checked"),a.initchecked=t.attr("data-initchecked"),a},ae.prototype.changeCheckbarNodes=function(){var t=!1;return this.obj.find("i[data-par]").each(function(){var e=f(this);if($div=e.closest("."+k),e.attr("data-checked")!=e.attr("data-initchecked"))return t=!0}),t},ae.prototype.loadIframe=function(e,t){var a=e.find("cite[data-leaf]").eq(0);if(!this.useIframe)return!1;var i=this.iframe.iframeElem,o=this.iframe.iframeUrl,n="leaf"!=this.iframe.iframeLoad||"leaf"==a.attr("data-leaf");if(n){if(!(0i.dtreefont{display: inline-block;margin: 0px 1px;} +.dtree-nav-checkbox-div>i.dtreefont:last-child{margin-right: 4px;} +.dtree-nav-checkbox-div>i.dtreefont:hover{opacity:0.8;filter:Alpha(opacity=80);} + +/* 行 文字*/ +.dtree-nav-div{display:block;vertical-align:top;position:relative;cursor: pointer;} +.dtree-nav-div cite{font-style: normal;cursor: pointer;} +.dtree-nav-div:hover cite{opacity:0.7;filter:Alpha(opacity=70);transition: all .3s;-webkit-transition: all .3s;} + +/* 规则属性*/ +.dtree-nav-show {display: block!important;} +.dtree-nav-this {} +.dtree-icon-hide {opacity:0;filter:Alpha(opacity=0);} +.dtree-icon-null-open,.dtree-icon-null-close,.dtree-icon-null{margin: 0 2px;} + +/* 简单适配*/ +@media screen and (max-width:1700px) and (min-width:1300px){ + .dtree-nav-item {padding-left: 15px;} +} + +/**************** 主题换肤 ****************/ +/* 默认风格*/ +.dtree-theme-item-this{background-color: #fff!important;color:#009688; font-weight:bold;} +.dtree-theme-item:hover{background-color: #eaeceb!important;} +.dtree-theme-item cite{font-size:14px!important;} +.dtree-theme-item:hover cite{color:#009688!important;} + +.dtree-theme-dtreefont{font-size: 16px!important;} +.dtree-theme-ficon{color:#000!important;} +.dtree-theme-icon{color:orange!important;} +.dtree-theme-checkbox:hover{color:#009688!important;} +.dtree-theme-choose{color:#009688!important;} + +/* layui主题风格*/ +.dtree-layui-item-this{background-color: #ddd!important;} +.dtree-layui-item:hover{background-color: #eaeceb!important;} +.dtree-layui-item cite{font-size:14px!important;} +.dtree-layui-item:hover cite{color:#01AAED!important;} + +.dtree-layui-dtreefont{font-size: 16px!important;} +.dtree-layui-ficon{font-size: 14px!important;color:#393D49!important;} +.dtree-layui-icon{color:#393D49!important;} +.dtree-layui-checkbox:hover{color:#01AAED!important;} +.dtree-layui-choose{color:#01AAED!important;} +.layui-layer-iframe .layui-layer-btn, .layui-layer-page .layui-layer-btn{ + border-top:1px solid #eee; +} + + + + + diff --git a/public/static/layui/plugin/dtree/dtree.js b/public/static/layui/plugin/dtree/dtree.js new file mode 100644 index 0000000..0781b10 --- /dev/null +++ b/public/static/layui/plugin/dtree/dtree.js @@ -0,0 +1,2808 @@ +/** + + @Name:dtree 树形组件 + @Author:智慧的小西瓜 + @Site:http://www.wisdomelon.com/DTreeHelper/ + @License:LAYUI + + */ +layui.define(['jquery','layer','form'], function(exports) { + var $ = layui.$, + layer = layui.layer, + form = layui.form; + + // 树的公共定义样式汇总 + var LI_NAV_CHILD = "dtree-nav-ul-sid", LI_NAV_ITEM = "dtree-nav-item", + LI_DIV_ITEM = "dtree-nav-div", DTREEFONT = "dtreefont", DTREEFONTSPECIAL="dtreefont-special", + LI_DIV_MENUBAR = "dtree-menubar",LI_DIV_MENUBAR_DOWN = "dtree-icon-move-down", LI_DIV_MENUBAR_UP = "dtree-icon-move-up", LI_DIV_MENUBAR_REFRESH = "dtree-icon-refresh", LI_DIV_MENUBAR_DELETE = "dtree-icon-delete1", LI_DIV_MENUBAR_SEARCH = "dtree-icon-search_list_light", + LI_DIV_TOOLBAR = "dtree-toolbar", TOOLBAR_TOOL = "dtree-toolbar-tool", LI_DIV_TOOLBAR_ADD = "dtree-icon-roundadd", LI_DIV_TOOLBAR_EDIT = "dtree-icon-bianji", LI_DIV_TOOLBAR_DEL = "dtree-icon-roundclose", + LI_DIV_SPREAD_LAST = "dtree-icon-dian", + LI_DIV_CHECKBAR = "dtree-nav-checkbox-div", LI_DIV_CHECKBAR_ON = "dtree-icon-fuxuankuangxuanzhong", LI_DIV_CHECKBAR_OUT = "dtree-icon-fuxuankuang", LI_DIV_CHECKBAR_NOALL = "dtree-icon-fuxuankuang-banxuan", + LI_CLICK_CHECKBAR = "d-click-checkbar", //绑定点击复选框时需要用到 + LI_DIV_TEXT_CLASS = "t-click", UL_ROOT="dtree"; + + // 树的自定义样式 + var DTREE = "dtree-", //自定义样式前缀 + ITEMTHIS = "-item-this", //自定义样式当前行选中后缀 + ITEM = "-item", //自定义样式当前行后缀 + DFONT = "-dtreefont", //自定义样式图标样式后缀 + FICON = "-ficon", //自定义样式一级图标样式后缀 + ICON = "-icon", //自定义样式二级图标样式后缀 + CBOX = "-checkbox", //自定义样式复选框样式后缀 + CHS = "-choose"; //自定义样式复选框选中样式后缀 + + // 树的公共指定 + var NAV_THIS = "dtree-nav-this", //当前节点 + NAV_SHOW = "dtree-nav-show", //显示子节点 + ICON_HIDE = "dtree-icon-hide", //隐藏dot图标 + $BODY = $("body"), //body选择器 + MOD_NAME = "dtree", //模块名称 + VERSION = "v2.4.5_finally_beta", //版本 + DTrees = {}; //当前被实例化的树的集合 + + // 树的一级节点图标集合 + var firstIconArray = { + "-1": {"open": "dtree-icon-null-open", "close": "dtree-icon-null-close"}, //未指定 + "0" : {"open": "dtree-icon-jian", "close": "dtree-icon-jia"}, + "1" : {"open": "dtree-icon-xiangxia1", "close": "dtree-icon-xiangyou"} + }; + + // 树的二级节点图标集合 + var nodeIconArray = { + "-1": {"open": "dtree-icon-null-open", "close": "dtree-icon-null-close"}, //未指定 + "0" : {"open": "dtree-icon-wenjianjiazhankai", "close": "dtree-icon-weibiaoti5"} + }; + + var leafIconArray = { + "-1": "dtree-icon-null", //未指定 + "0" : "dtree-icon-weibiaoti5", //文件夹 + "1" : "dtree-icon-yonghu", //人员 + "2" : "dtree-icon-fenzhijigou", //机构 + "3" : "dtree-icon-fenguangbaobiao", //报表 + "4" : "dtree-icon-xinxipilu", //信息 + "5" : "dtree-icon-shuye1", //叶子 + "6" : "dtree-icon-caidan_xunzhang", //勋章 + "7" : "dtree-icon-normal-file" //文件 + }; + + // 树自定义操作事件名称集合 绑定dtree-click的事件 + var eventName = { + checkNodeClick: "checkNodeClick", //点击复选框 + itemNodeClick: "itemNodeClick" //点击子节点div + }; + + + // 树默认toolbar提供的功能集合 绑定dtree-tool的事件 + var defaultTool = { + addToolbar: "addToolbar", //点击toolbar新增 + editToolbar: "editToolbar", //点击toolbar编辑 + delToolbar: "delToolbar" //点击toolbar删除 + }; + + // 树默认menubar提供的功能集合 绑定dtree-menu的事件 + var defaultMenu = { + moveDown: "moveDown", //menubar展开节点 + moveUp: "moveUp", //menubar收缩节点 + refresh: "refresh", //menubar刷新树 + remove: "remove", //menubar删除选中节点 + searchNode: "searchNode" //menubar查询节点 + }; + + // 树的公共事件 + var event = { + getElemId: function(options){ // 根据传入的参数获取ID + var elem = options.elem || ""; + var obj = options.obj || $(elem); + + if (obj.length == 0) { //页面中未找到绑定id + return ""; + } else { + return $(obj)[0].id; + } + }, + escape: function(html){ + if(typeof html !== 'string') return ''; + return html.replace(entityReg.escape, function(match){return entityMap.escape[match];}); + }, + unescape: function(str){ + if(typeof str !== 'string') return ''; + return str.replace(entityReg.unescape, function(match){return entityMap.unescape[match];}); + }, + cloneObj: function (obj, filter) { //深复制对象方法 + var newObj = {}; + if (obj instanceof Array) { + newObj = []; + } + var str = ""; + if(typeof filter !== 'undefined') {str = filter.join(",");} + for (var key in obj) { + if(str.indexOf(key) == -1){ + var val = obj[key]; + newObj[key] = typeof val === 'object' ? event.cloneObj(val, typeof filter !== undefined ? filter : []): val; + } + + } + return newObj; + } + }; + + // 特殊符号转义 + var keys = Object.keys || function(obj) { + obj = Object(obj); + var arr = []; + for(var a in obj) arr.push(a); + return arr; + }; + var invert = function(obj){ + obj = Object(obj); + var result = {}; + for(var a in obj) result[obj[a]] = a; + return result; + }; + var entityMap = { + escape: { + "&" : "&", + "<" : "<", + ">" : ">", + "'" : "&quo;" + } + }; + entityMap.unescape = invert(entityMap.escape); + var entityReg = { + escape: RegExp('[' + keys(entityMap.escape).join('') + ']', 'g'), + unescape: RegExp('(' + keys(entityMap.unescape).join('|') + ')', 'g') + }; + + //异步加载接口 + var AjaxHelper = { + request : function(config) { + var data = config.data ? config.data : {}; + var async = (typeof (config.async) === "boolean") ? config.async : true; + $.ajax({ + type : config.type ? config.type : "POST", + headers : config.headers, + url : config.url, + dataType : config.dataType ? config.dataType : "json", + data : data, + async : async, + success : config.success, + error : function(XMLHttpRequest, textStatus, errorThrown) { + if (typeof (config.error) === "function") { + config.error(); + } else { + layer.msg('系统异常导致操作失败, 请联系管理员。',{icon:5, shift:6}); + } + }, + statusCode : { + 404 : function() { + layer.msg('未找到指定请求,请检查访问路径!',{icon:5, shift:6}); + }, + 500 : function() { + layer.msg('系统错误,请联系管理员。',{icon:5, shift:6}); + } + }, + complete : function(XMLHttpRequest, textStatus) { + if (typeof (config.complete) === "function") { + config.complete(XMLHttpRequest, textStatus); + } + } + }); + }, + serialize: function(param){ //json序列化 key=value&key1=value1 + var p = "?"; + for (var key in param) { + p += key + "=" + param[key] + "&"; + } + p = p.substring(0, p.length-1); + return p; + } + }; + + // 树类 + var DTree = function(options){ + + /** 默认赋值**/ + this.response = { // 树返回的json格式 + statusName: "code", //返回标识 + statusCode: 200, //返回码 + message: "message", //返回信息 + rootName: "data", //根节点名称 + treeId: "id", //节点ID + parentId: "parentId", //父节点ID + title: "title", //节点名称 + iconClass: "iconClass", //自定义图标 + childName: "children", //子节点名称 + isLast: "isLast", //是否最后一级节点 +// level: "level", //层级 + spread: "spread", //展开 + disabled: "disabled", //禁用 + checkArr: "checkArr", //复选框列表 + isChecked: "isChecked", //是否选中 + type: "type", //复选框标记 + basicData: "basicData" //表示用户自定义需要存储在树节点中的数据 + }; + this.defaultRequest = { // 树的默认发起请求参数格式,最后会将value作为参数名称传递 + nodeId: "nodeId", //节点ID + parentId: "parentId", //父节点ID + context: "context", //节点内容 + isLeaf: "isLeaf", //是否叶子节点 + level: "level", //层级 + spread: "spread", //节点展开状态 + dataType: "dataType", //节点标记 + ischecked: "ischecked", //节点复选框选中状态 + initchecked: "initchecked", //节点复选框初始状态 + basicData: "basicData", //用户自定义的记录节点数据 + recordData: "recordData", //当前data数据(排除basicData和children字段) + }; + this.toolbarFun = { + addTreeNode: function(param, $div) { //添加树节点后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + editTreeNode: function(param, $div) { //编辑树节点后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + editTreeLoad: function(param){ // 编辑树的数据回显,用于打开编辑时,回填数据 + return ; + }, + delTreeNode: function(param, $div){ //删除树后调用的函数,用于用户自定义,如未指定则树不会发生变化 + return ; + }, + loadToolbarBefore: function(buttons, param, $div){ // 右键菜单加载前的函数 + return buttons; + } + }; + this.toolbarStyle = { + title: "节点", + area: ["60%","80%"] + }; + this.menubarFun = { + remove: function(checkbarNodes){ //删除复选框选中节点,需要用户自定义,如未指定则树只是页面上做了修改 + return true; + } + }; + this.menubarTips = { + toolbar: [], + group: [defaultMenu.moveDown, defaultMenu.moveUp, defaultMenu.refresh, defaultMenu.remove, defaultMenu.searchNode], + freedom: [] + }; + this.checkbarFun = { + chooseBefore: function($i, node){ // 复选框点击前回调 + return true; + }, + chooseDone: function(checkbarNodesParam) { //复选框点击事件完毕后,返回该树关于复选框操作的全部信息,用于用户自定义,如未指定则树只是页面上做了修改 + return ; + } + }; + this.iframe = { // 树点击节点时,打开iframe页面参数配置 + iframeElem: "", //iframe的ID + iframeUrl: "", //树关联的frame地址 + iframeLoad: "leaf", //点击哪一层加载frame: node:所有节点, leaf:默认,最后一级 + iframeDefaultRequest: { //iframe的默认参数,目的是与加载树的参数不一样 + nodeId: "nodeId", //节点ID + parentId: "parentId", //父节点ID + context: "context", //节点内容 + isLeaf: "isLeaf", //是否叶子节点 + level: "level", //层级 + spread: "spread", //节点展开状态 + dataType: "dataType", //节点标记 + ischecked: "ischecked", //节点复选框选中状态 + initchecked: "initchecked", //节点复选框初始状态 + basicData: "basicData", //用户自定义的记录节点数据 + recordData: "recordData", //当前data数据(排除basicData和children字段) + }, + iframeRequest: {} //iframe的自定义参数 + }; + this.iframeFun = { + iframeDone: function(iframeParam){ //iframe加载完毕后,用于用户自定义事件 + return ; + } + }; + this.style = { + item: "", + itemThis: "", + dfont: "", + icon: "", + cbox: "", + chs: "" + }; + + /** 数据绑定**/ + this.node = { // 树节点选中时,包含当前节点的全部信息 + nodeId: "", //节点ID + parentId: "", //父节点ID + context: "", //节点内容 + isLeaf: "", //是否叶子节点 + level: "", //层级 + spread: "", //节点展开状态 + dataType: "", //节点标记 + ischecked: "", //节点复选框选中状态 + initchecked: "", //节点复选框初始状态 + basicData: "", //用户自定义的记录节点数据 + recordData: "", //当前data数据(排除basicData和children字段) + }; + this.toolbarMenu = {}; // 工具栏右键菜单绑定的所有元素 + this.checkbarNode = []; // 复选框标记的全部节点数据 + this.checkArrLen = 0; //添加节点的时判断复选框个数 + this.temp = []; // 临时变量 + + this.setting(options); + }; + + /******************** 初始参数加载 ********************/ + // 设置值 + DTree.prototype.setting = function(options) { + this.options = options || {}; + + /** 绑定元素参数(必填,2个参数项必填一个)**/ + this.elem = this.options.elem || ""; //树绑定的元素ID:#elem + this.obj = this.options.obj || $(this.elem); //树绑定的jquery元素,用于当元素是延迟加载出来的话,可以用这个找到 + + /** 基本参数**/ + this.initLevel = this.options.initLevel || 2; //默认展开节点 2节 + this.type = this.options.type || "load"; // 树的加载方式 all,全量树, load,增量树,默认load + this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : true; //开启数据缓存 + this.record = (typeof (this.options.record) === "boolean") ? this.options.record : false; //开启数据记录模式 + this.load = (typeof (this.options.load) === "boolean") ? this.options.load : true; //开启加载动画 + + /** 样式相关参数**/ + this.firstIconArray = $.extend(firstIconArray, this.options.firstIconArray) || firstIconArray; //用户自定义一级图标集合,node + this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray) || nodeIconArray; //用户自定义二级图标集合,node + this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray) || leafIconArray; //用户自定义二级图标集合,leaf + this.skin = this.options.skin || "theme"; // 自定义样式 + if(this.skin == "layui"){ // layui主题 + this.ficon = this.options.ficon || "1"; // 一级图标样式,0:+,- + this.dot = (typeof (this.options.dot) === "boolean") ? this.options.dot : false; //是否显示一级图标的小圆点,默认不显示 + this.icon = this.options.icon || "7"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章, -1:不显示二级图标。默认'1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; // 二级图标中的node节点图标 + } else { // 默认主题 或者自定义主题 + this.ficon = this.options.ficon || "0"; // 一级图标样式,0:+,- + this.dot = (typeof (this.options.dot) === "boolean") ? this.options.dot : true; //是否显示一级图标的小圆点,默认显示 + this.icon = this.options.icon || "5"; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章, -1:不显示二级图标。默认'5' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; // 二级图标中的node节点图标 + } + + /** 内置样式属性*/ + this.ficonOpen = this.firstIconArray[this.ficon]["open"]; // 一级图标中的node节点open图标 + this.ficonClose = this.firstIconArray[this.ficon]["close"]; // 一级图标中的node节点close图标 + this.nodeIconOpen = this.nodeIconArray[this.nodeIcon]["open"]; // 二级图标中的node节点open图标 + this.nodeIconClose = this.nodeIconArray[this.nodeIcon]["close"]; // 二级图标中的node节点close图标 + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; // 二级图标中的leaf节点图标 + this.leafIconShow = this.leafIconArray[this.leafIcon]; // 二级图标中的leaf节点图标 + + this.style.item = DTREE + this.skin + ITEM; + this.style.itemThis = DTREE + this.skin + ITEMTHIS; + this.style.dfont = DTREE + this.skin + DFONT; + this.style.ficon = DTREE + this.skin + FICON; + this.style.icon = DTREE + this.skin + ICON; + this.style.cbox = DTREE + this.skin + CBOX; + this.style.chs = DTREE + this.skin + CHS; + + /** 数据加载参数**/ + this.url = this.options.url || ""; //请求地址 + this.async = (typeof (this.options.async) === "boolean") ? this.options.async : true; //异步同步加载,默认异步加载 + this.headers = this.options.headers || {}; // ajax header属性 + this.method = this.options.method || "post"; //请求类型 + this.dataType = this.options.dataType || "json"; //参数类型 + this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest) || this.defaultRequest; //默认请求参数 + this.filterRequest = this.options.filterRequest || []; //过滤请求参数 + this.request = this.options.request || {}; //用户自定义请求参数 + this.response = $.extend(this.response, this.options.response) || this.response; //返回json格式 + this.data = this.options.data || null; //初始化指定该参数,则不会访问异步接口 + this.dataFormat = this.options.dataFormat || "levelRelationship"; //用于用户配置的data数据格式,list:列表, levelRelationship:层级关系,默认 + this.dataStyle = this.options.dataStyle || "defaultStyle"; //用于用户配置layui通用的json数据风格,layuiStyle:layui风格,defaultStyle:默认风格 + this.success = this.options.success || function(data, obj){}; //树加载完毕后执行解析树之前的回调(仅限异步加载) + this.done = this.options.done || function(data, obj){}; //树加载完毕后的回调(仅限异步加载) + + /** 工具栏参数**/ + this.toolbar = this.options.toolbar || false; //是否开启可编辑模式 + this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle) || this.toolbarStyle; //toolbar的自定义风格,标题,弹框大小 + this.toolbarScroll = this.options.toolbarScroll || this.elem; //树的上级div容器,让树可以显示滚动条的div容器 + this.toolbarLoad = this.options.toolbarLoad || "node"; //toolbar作用范围:node:所有节点,noleaf:非最后一级节点,leaf:最后一级 + this.toolbarShow = this.options.toolbarShow || ["add","edit","delete"]; // toolbar三个按钮自定义加载 + this.toolbarBtn = this.options.toolbarBtn || null; // toolbar增删改中内容的自定义加载 + this.toolbarExt = this.options.toolbarExt || []; // toolbar按钮扩展 + this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun) || this.toolbarFun; // toolbar事件加载 + + /** 菜单栏参数**/ + this.menubar = this.options.menubar || false; //是否打开菜单栏 + this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips) || this.menubarTips; // 菜单栏吸附, toolbar:依附在工具栏,group:依附在按钮组,freedom,自由 + this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun) || this.menubarFun; //menubar事件加载 + + /** 复选框参数**/ + this.checkbar = this.options.checkbar || false; //是否开启复选框模式 + this.checkbarLoad = this.options.checkbarLoad || "node"; // 复选框作用范围,node:所有节点, leaf:最后一级;默认所有节点 + this.checkbarType = this.options.checkbarType || "all" ; //复选框选中形式 all:子集选中父级也选中, no-all:子集选中父级半选中,子集全选父级选中,p-casc:父级选中子集全选,子集无法改变父级选中状态, self:没有任何级联关系,only:只能选中一个复选框。 默认all + this.checkbarData = this.options.checkbarData || "choose" ; //复选框记录数据类型形式, change表示记录变更数据,choose表示记录选中数据,all,记录全部数据,默认choose + this.checkbarFun = $.extend(this.checkbarFun, this.options.checkbarFun) || this.checkbarFun; // checkbar事件加载 + + /** iframe模式参数**/ + this.useIframe = this.options.useIframe || false; // 是否加载iframe 默认false, + this.iframe = $.extend(this.iframe, this.options.iframe) || this.iframe; //iframe配置 + this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || this.iframeFun; //iframe事件加载 + + }; + + // 设置值 + DTree.prototype.reloadSetting = function(options) { + this.options = $.extend(this.options, options) || this.options; + + /** 绑定元素参数**/ + this.elem = this.options.elem || this.elem; //树绑定的元素ID:#elem + if(typeof this.options.obj === 'undefined'){ + if(this.elem) { + if($(this.elem).length > 0) { + this.obj = $(this.elem); + } + } + } else { + this.obj = this.options.obj || this.obj; //树绑定的jquery元素,用于当元素是延迟加载出来的话,可以用这个找到 + } + + /** 基本参数**/ + this.initLevel = this.options.initLevel || this.initLevel; //默认展开节点 2节 + this.type = this.options.type || this.type; // 树的加载方式 all,全量树, load,增量树,默认load + this.cache = (typeof (this.options.cache) === "boolean") ? this.options.cache : this.cache; //开启数据缓存 + this.record = (typeof (this.options.record) === "boolean") ? this.options.record : this.record; //开启数据记录模式 + this.load = (typeof (this.options.load) === "boolean") ? this.options.load : this.load; //开启加载动画 + + /** 样式相关参数**/ + this.firstIconArray = $.extend(firstIconArray, this.options.firstIconArray) || this.firstIconArray; //用户自定义一级图标集合,node + this.nodeIconArray = $.extend(nodeIconArray, this.options.nodeIconArray) || this.nodeIconArray; //用户自定义二级图标集合,node + this.leafIconArray = $.extend(leafIconArray, this.options.leafIconArray) || this.leafIconArray; //用户自定义二级图标集合,leaf + this.skin = this.options.skin || this.skin; // 自定义样式 + if(this.skin == "layui"){ // layui主题 + this.ficon = this.options.ficon || this.ficon; // 一级图标样式,0:+,- + this.dot = (typeof (this.options.dot) === "boolean") ? this.options.dot : false; //是否显示一级图标的小圆点,默认不显示 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章, -1:不显示二级图标。默认'1' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "-1") : this.icon[0]; // 二级图标中的node节点图标 + } else { // 默认主题 或者自定义主题 + this.ficon = this.options.ficon || this.ficon; // 一级图标样式,0:+,- + this.dot = (typeof (this.options.dot) === "boolean") ? this.options.dot : true; //是否显示一级图标的小圆点,默认显示 + this.icon = this.options.icon || this.icon; //二级图标样式,0:文件夹,1:人员,2:机构,3:报表,4:信息,5:叶子,6:勋章, -1:不显示二级图标。默认'5' + this.nodeIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? (this.icon == "-1" ? "-1" : "0") : this.icon[0]; // 二级图标中的node节点图标 + } + + /** 内置样式属性*/ + this.ficonOpen = this.firstIconArray[this.ficon]["open"]; // 一级图标中的node节点open图标 + this.ficonClose = this.firstIconArray[this.ficon]["close"]; // 一级图标中的node节点close图标 + this.nodeIconOpen = this.nodeIconArray[this.nodeIcon]["open"]; // 二级图标中的node节点open图标 + this.nodeIconClose = this.nodeIconArray[this.nodeIcon]["close"]; // 二级图标中的node节点close图标 + this.leafIcon = (typeof this.icon === 'string' || typeof this.icon === 'number') ? this.icon : this.icon[1]; // 二级图标中的leaf节点图标 + this.leafIconShow = this.leafIconArray[this.leafIcon]; // 二级图标中的leaf节点图标 + + this.style.item = DTREE + this.skin + ITEM; + this.style.itemThis = DTREE + this.skin + ITEMTHIS; + this.style.dfont = DTREE + this.skin + DFONT; + this.style.ficon = DTREE + this.skin + FICON; + this.style.icon = DTREE + this.skin + ICON; + this.style.cbox = DTREE + this.skin + CBOX; + this.style.chs = DTREE + this.skin + CHS; + + /** 数据加载参数**/ + this.url = this.options.url || this.url; //请求地址 + this.async = (typeof (this.options.async) === "boolean") ? this.options.async : this.async; //异步同步加载,默认异步加载 + this.headers = this.options.headers || this.headers; // ajax header属性 + this.method = this.options.method || this.method; //请求类型 + this.dataType = this.options.dataType || this.dataType; //参数类型 + this.defaultRequest = $.extend(this.defaultRequest, this.options.defaultRequest) || this.defaultRequest; //默认请求参数 + this.filterRequest = this.options.filterRequest || this.filterRequest; //过滤请求参数 + this.request = this.options.request || this.request; //用户自定义请求参数 + this.response = $.extend(this.response, this.options.response) || this.response; //返回json格式 + this.data = this.options.data || this.data; //初始化指定该参数,则不会访问异步接口 + this.dataFormat = this.options.dataFormat || this.dataFormat; //用于用户配置的data数据格式,list:列表, levelRelationship:层级关系,默认 + this.dataStyle = this.options.dataStyle || this.dataStyle; //用于用户配置layui通用的json数据风格,layuiStyle:layui风格,defaultStyle:默认风格 + this.success = this.options.success || this.success; //树加载完毕后执行解析树之前的回调(仅限异步加载) + this.done = this.options.done || this.done; //树加载完毕后的回调(仅限异步加载) + + /** 可编辑模式参数**/ + this.toolbar = this.options.toolbar || this.toolbar; //是否开启可编辑模式 + this.toolbarStyle = $.extend(this.toolbarStyle, this.options.toolbarStyle) || this.toolbarStyle; //toolbar的自定义风格,标题,弹框大小 + this.toolbarScroll = this.options.toolbarScroll || this.toolbarScroll; //树的上级div容器,让树可以显示滚动条的div容器 + this.toolbarLoad = this.options.toolbarLoad || this.toolbarLoad; //toolbar作用范围:node:所有节点,noleaf:非最后一级节点,leaf:最后一级 + this.toolbarShow = this.options.toolbarShow || this.toolbarShow; // toolbar三个按钮 + this.toolbarBtn = this.options.toolbarBtn || this.toolbarBtn; // toolbar增删改中内容的自定义加载 + this.toolbarExt = this.options.toolbarExt || this.toolbarExt; // toolbar按钮扩展 + this.toolbarFun = $.extend(this.toolbarFun, this.options.toolbarFun) || this.toolbarFun; // toolbar事件加载 + + /** 菜单栏参数**/ + this.menubar = this.options.menubar || this.menubar; //是否打开菜单栏 + this.menubarTips = $.extend(this.menubarTips, this.options.menubarTips) || this.menubarTips; // 菜单栏吸附, toolbar:依附在工具栏,group:依附在按钮组,freedom,自由 + this.menubarFun = $.extend(this.menubarFun, this.options.menubarFun) || this.menubarFun; //menubar事件加载 + + /** 复选框参数**/ + this.checkbar = this.options.checkbar || this.checkbar; //是否开启复选框模式 + this.checkbarLoad = this.options.checkbarLoad || this.checkbarLoad; // 复选框作用范围,node:所有节点, leaf:最后一级;默认所有节点 + this.checkbarType = this.options.checkbarType || this.checkbarType ; //复选框选中形式 all:子集选中父级也选中, no-all:子集选中父级半选中,子集全选父级选中,p-casc:父级选中子集全选,子集无法改变父级选中状态, self:没有任何级联关系,only:只能选中一个复选框。 默认all + this.checkbarData = this.options.checkbarData || this.checkbarData ; //复选框记录数据类型形式, change表示记录变更数据,choose表示记录选中数据,all,记录全部数据,默认choose + this.checkbarFun = $.extend(this.checkbarFun, this.options.checkbarFun)|| this.checkbarFun ; // checkbar事件加载 + + /** iframe模式参数**/ + this.useIframe = this.options.useIframe || this.useIframe; // 是否加载iframe 默认false, + this.iframe = $.extend(this.iframe, this.options.iframe) || this.iframe; //iframe配置 + this.iframeFun = $.extend(this.iframeFun, this.options.iframeFun) || this.iframeFun; //iframe事件加载 + + }; + + /******************** 初始化数据区域 ********************/ + // 重载树 + DTree.prototype.reload = function(options){ + var _this = this; + _this.reloadSetting(options); + _this.init(); + }; + + // 初始化树 + DTree.prototype.init = function(){ + var _this = this; + if (typeof _this !== "object") { + layer.msg("树组件未成功加载,请检查配置", {icon:5}); + return ; + } + + if(_this.data) { + if(typeof _this.data.length === 'undefined'){ + layer.msg("数据解析异常,data数据格式不正确", {icon:5}); + return ; + } + + //先将ul中的元素清空 + _this.obj.html(""); + + // 加载完毕后执行树解析前的回调 + _this.success(_this.data, _this.obj); + + // 第一次解析树 + if (_this.dataFormat == 'list'){ + //1.识别根节点ul中的data-id标签,判断顶级父节点 + var pid = _this.obj.attr("data-id"); + //2.构建一个存放节点的树组 + var rootListData = _this.queryListTreeByPid(pid, _this.data); + _this.loadListTree(rootListData, _this.data, 1); + } else { + _this.loadTree(_this.data, 1); + } + + // 加载完毕后的回调 + _this.done(_this.data, _this.obj); + + } else { + if (!_this.url) { + layer.msg("数据请求异常,url参数未指定", {icon:5}); + return ; + } + + //先将ul中的元素清空 + _this.obj.html(""); + + var index = _this.load ? layer.load(1) : ""; + + AjaxHelper.request({ + async: _this.async, + headers: _this.headers, + type: _this.method, + url: _this.url, + dataType: _this.dataType, + data: _this.getFilterRequestParam(_this.getRequestParam()), + success: function(result) { + if (typeof result === 'string') { + result = $.parseJSON(result); + } + var code = ""; + if (_this.dataStyle == 'layuiStyle'){ + code = result[_this.response.statusName]; + } else { + code = result.status[_this.response.statusName]; + } + + if (code == _this.response.statusCode) { + // 加载完毕后执行树解析前的回调 + _this.success(result, _this.obj); + + // 第一次解析树 + if (_this.dataFormat == 'list'){ + //1.识别根节点ul中的data-id标签,判断顶级父节点 + var pid = _this.obj.attr("data-id"); + //2.构建一个存放节点的树组 + var rootListData = _this.queryListTreeByPid(pid, result[_this.response.rootName]); + _this.loadListTree(rootListData, result[_this.response.rootName], 1); + } else { + _this.loadTree(result[_this.response.rootName], 1); + } + + // 加载完毕后的回调 + _this.done(result, _this.obj); + } else { + if (_this.dataStyle == 'layuiStyle'){ + layer.msg(result[_this.response.message], {icon:2}); + } else { + layer.msg(result.status[_this.response.message], {icon:2}); + } + } + }, + complete: function(){if(_this.load){layer.close(index);}} + }); + } + }; + + // 加载子节点 + DTree.prototype.getChild = function($div, data) { + var _this = this, + $ul = $div.next("ul"); + + _this.setNodeParam($div); + + if(typeof data !== 'undefined') { + if(typeof data.length === 'undefined'){ + layer.msg("数据解析异常,data数据格式不正确", {icon:5}); + return ; + } + + //先将ul中的元素清空 + $ul.html(""); + + // 解析树 + if (_this.dataFormat == 'list'){ + var pid = _this.node.nodeId; + var level = parseInt(_this.node.level)+1; + + var listData = _this.queryListTreeByPid(pid, data); + _this.loadListTree(listData, _this.data, level); + } else { + _this.loadTree(data, level); + } + + } else { + if (!_this.url) { + layer.msg("数据请求异常,url参数未指定", {icon:5}); + return ; + } + + $ul.html(""); + var index = _this.load ? layer.load(1) : ""; + AjaxHelper.request({ + async: _this.async, + headers: _this.headers, + type: _this.method, + url: _this.url, + dataType: _this.dataType, + data: _this.getFilterRequestParam(_this.getRequestParam()), + success: function(result) { + if (typeof result === 'string') { + result = $.parseJSON(result); + } + var code = ""; + if (_this.dataStyle == 'layuiStyle'){ + code = result[_this.response.statusName]; + } else { + code = result.status[_this.response.statusName]; + } + + if (code == _this.response.statusCode) { + // 解析树 + var pid = _this.node.nodeId; + var level = parseInt(_this.node.level)+1; + if (_this.dataFormat == 'list'){ + var pListData = _this.queryListTreeByPid(pid, result[_this.response.rootName]); + _this.loadListTree(pListData, result[_this.response.rootName], level, $ul); + } else { + _this.loadTree(result[_this.response.rootName], level, $ul); + } + + $ul.addClass(NAV_SHOW); + } else { + if (_this.dataStyle == 'layuiStyle'){ + layer.msg(result[_this.response.message], {icon:2}); + } else { + layer.msg(result.status[_this.response.message], {icon:2}); + } + } + }, + complete: function(){if(_this.load){layer.close(index);}} + }); + } + }; + + // 初始化树或者拼接树 + DTree.prototype.loadListTree = function(pListData, listData, level, $ul){ + var _this = this; + $ul = $ul || _this.getNowNodeUl(); //当前选中的节点或根节点 + if (pListData.length > 0){ + for (var i = 0; i < pListData.length; i++) { + // 1.获取已知节点的全部数据 + var data = pListData[i]; + if(typeof data !== "object") continue; + var parseData = _this.parseData(data); + var childListData = _this.queryListTreeByPid(parseData.treeId(), listData); // 根据已知数据的id判断该条数据是否还有子数据 + + // 3. 页面元素加载数据 + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.isLast(childListData.length), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item"))); + // 4.有子数据的元素加载子节点 + if(childListData.length > 0){ + var cLevel = parseInt(level)+1; + _this.loadListTree(childListData, listData, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']")); + } + } + } + }; + + // 根据父ID查找list数据中匹配的元素 + DTree.prototype.queryListTreeByPid = function(pid, listData){ + var _this = this; + var rootListData = []; + if (listData) { + for (var i = 0; i < listData.length; i++) { + var data = listData[i]; + if(typeof data !== "object") continue; + if(pid == "null" || pid == null){ + if(data[_this.response.parentId] == null) { + rootListData.push(data); + } + } else { + if (data[_this.response.parentId] == pid){ + rootListData.push(data); + } + } + } + } + return rootListData; + }; + + // 初始化树或者拼接树 + DTree.prototype.loadTree = function(root, level, $ul){ + var _this = this; + if (root) { + $ul = $ul || _this.getNowNodeUl(); //当前选中的节点或根节点 + for (var i = 0; i < root.length; i++) { // 遍历跟节点或追加的跟节点 + var data = root[i]; + if(typeof data !== "object") continue; + var parseData = _this.parseData(data); + var children = parseData.children(); + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.isLast(children.length), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(level), parseData.disabled(), parseData.basicData(), parseData.recordData(), ($ul.hasClass(UL_ROOT) ? "root" : "item"))); + if (children.length != 0) { + var cLevel = parseInt(level)+1; + _this.loadTree(children, cLevel, _this.obj.find("ul[data-id='"+parseData.treeId()+"']")); + } + } + } + }; + + // 解析data数据 + DTree.prototype.parseData = function(data) { + var _this = this; + + return { + treeId: function(){ + return data[_this.response.treeId]; + }, + parentId: function(){ + return data[_this.response.parentId]; + }, + title: function(){ + return data[_this.response.title] || ""; + }, + level: function(){ + return data[_this.response.level] || ""; + }, + iconClass: function(){ + return data[_this.response.iconClass] || ""; + }, + isLast: function(len){ + return ((len == 0) ? + ((typeof (data[_this.response.isLast]) === "boolean") ? data[_this.response.isLast] : true) : + ((typeof (data[_this.response.isLast]) === "boolean") ? data[_this.response.isLast] : false)); + }, + spread: function(level){ + return ((level < _this.initLevel) ? + ((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : true) : + ((typeof (data[_this.response.spread]) === "boolean") ? data[_this.response.spread] : false)); + }, + disabled: function(){ + return (typeof (data[_this.response.disabled]) === "boolean") ? data[_this.response.disabled] : false; + }, + checkArr: function(){ + var checkArr = []; + var checkArrData = data[_this.response.checkArr]; + if(typeof checkArrData === 'string'){ + if(checkArrData.indexOf("{") > -1 && checkArrData.indexOf("}") > -1){ + checkArrData = JSON.parse(checkArrData); + } else { + checkArrData = {"type":"0","isChecked":checkArrData}; + } + } + if(typeof checkArrData === 'object'){ + if(typeof checkArrData.length === 'undefined'){ + checkArr.push(checkArrData); + } else { + checkArr = checkArrData; + } + } + + if(checkArr.length > 0 && checkArr.length > _this.checkArrLen){ + _this.checkArrLen = checkArr.length; // 获取复选框个数 + } + return checkArr; + + }, + children: function(){ + return data[_this.response.childName] || []; + }, + basicData: function(){ + return event.escape(JSON.stringify(data[_this.response.basicData])) || JSON.stringify({}); + }, + recordData: function(){ + var recordData = _this.record ? event.cloneObj(data, [_this.response.basicData, _this.response.childName]) : {}; + return event.escape(JSON.stringify(recordData)); + }, + data: function(){ + return event.escape(JSON.stringify(data)); + } + } + + }; + + //新增节点的dom值 + DTree.prototype.getDom = function(treeId, parentId, title, isLast, iconClass, checkArr, level, spread, disabled) { + var _this = this, + rootId = _this.obj[0].id, + toolbar = _this.toolbar, + checkbar = _this.checkbar; + return { + fnode: function() { // + - 图标 + // 获取图标的变量 + var ficon = _this.ficon, + ficonOpen = _this.ficonOpen, + ficonClose = _this.ficonClose, + dot = _this.dot; + + if(ficon != "-1" && dot){ // 都加载 + return isLast ? "" : + (spread ? "" : ""); + } + + if(ficon != "-1" && !dot){ // 加载node 隐藏leaf + return isLast ? "" : + (spread ? "" : ""); + } + + if(ficon == "-1" && dot){ // 隐藏node 加载leaf + return isLast ? "" : + (spread ? "" : ""); + } + + if(ficon == "-1" && !dot){ // 都隐藏 + return isLast ? "" : + (spread ? "" : ""); + } + }, + node: function() { // 二级图标样式 + // 获取图标的变量 + var nodeIcon = _this.nodeIcon, + leafIcon = _this.leafIcon; + + var leafIconShow = _this.leafIconShow, + nodeIconOpen = _this.nodeIconOpen, + nodeIconClose = _this.nodeIconClose; + if(iconClass){ + leafIconShow = iconClass; + nodeIconOpen = iconClass; + nodeIconClose = iconClass; + } + + if(nodeIcon != "-1" && leafIcon != "-1"){ // 都加载 + return isLast ? "" : + (spread ? "" : ""); + } + + if(nodeIcon != "-1" && leafIcon == "-1"){ // 加载node 隐藏leaf + return isLast ? "" : + (spread ? "" : ""); + } + + if(nodeIcon == "-1" && leafIcon != "-1"){ // 隐藏node 加载leaf + return isLast ? "" : + (spread ? "" : ""); + } + + if(nodeIcon == "-1" && leafIcon == "-1"){ // 都隐藏 + return isLast ? "" : + (spread ? "" : ""); + } + }, + checkbox: function() { // 复选框 + var flag = false; + if(_this.checkbarLoad == "node"){if (checkbar) {flag = true;}} else {if (isLast) {if (checkbar) {flag = true;}}} + + if(flag){ + var result = "
        "; + if(checkArr && checkArr.length > 0){ + for (var i = 0; i < checkArr.length; i++) { + var checkData = checkArr[i]; + var isChecked = checkData.isChecked; + var CHOOSE_CLASS = LI_DIV_CHECKBAR_OUT; + if (isChecked == "2") { //半选择 + CHOOSE_CLASS = LI_DIV_CHECKBAR_NOALL + " " + _this.style.chs; + } else if (isChecked == "1") { //选择 + CHOOSE_CLASS = LI_DIV_CHECKBAR_ON + " " + _this.style.chs; + } else { //未选择或者无值 + CHOOSE_CLASS = LI_DIV_CHECKBAR_OUT; + } + result += ""; + } + } + result += "
        "; + return result; + } + + return ""; + }, + text: function() { // 文字显示 + return ""+title+""; + }, + ul: function() { //子节点ul + return isLast ? "
          " : + (spread ? "
            " : "
              "); + } + }; + + }; + + // 获取拼接好的li + DTree.prototype.getLiItemDom = function(treeId, parentId, title, isLast, iconClass, checkArr, level, spread, disabled, basicData, recordData, flag) { + var _this = this, + rootId = _this.obj[0].id; + + var dom = _this.getDom(treeId, parentId, title, isLast, iconClass, checkArr, level, spread, disabled); + basicData = (basicData == "{}") ? "" : basicData; + recordData = (recordData == "{}") ? "" : recordData; + var div = "
              " + + div , + dom.fnode(), + dom.node(), + dom.checkbox(), + dom.text(), + "
              ", dom.ul(), ""].join(""); + return li; + }; + + // 初始化节点,用于数据回显 + DTree.prototype.dataInit = function(chooseId){ + var _this = this; + var $div = _this.obj.find("div[data-id='"+chooseId+"']"); + $div.parent().find("."+NAV_THIS).removeClass(NAV_THIS); + $div.parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + _this.setNodeParam($div); + // 将该节点的父节点全部展开 + var $li_parents = $div.parents("."+LI_NAV_ITEM); + $li_parents.children("ul").addClass(NAV_SHOW); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+_this.ficonClose).addClass(_this.ficonOpen); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+_this.ficonClose).removeClass(_this.ficonClose); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+_this.nodeIconClose).addClass(_this.nodeIconOpen); + $li_parents.children("."+LI_DIV_ITEM).children("i[data-spread]."+_this.nodeIconClose).removeClass(_this.nodeIconClose); + return _this.getNowParam(); + }; + + /******************** 基础事件区域 ********************/ + // 展开或隐藏节点 作用点: div + DTree.prototype.clickSpread = function($div) { + var $i_spread = $div.find("i[data-spread]").eq(0), + $i_node = $div.find("i[data-spread]").eq(1), + i_node_class = $i_node.attr("class"), + $cite = $div.find("cite[data-leaf]").eq(0), + spread = $i_spread.attr("data-spread"), + $ul = $div.next("ul"); + var _this = this; + + if ($ul.length > 0) { + if (spread == "close") { + if (_this.type=="load") { //增加加载 + if (_this.cache) { //开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + } else { //加载节点 + _this.getChild($div); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + } + $div.find("i[data-spread]").attr("data-spread","open"); + $i_spread.removeClass(_this.ficonClose); + $i_spread.addClass(_this.ficonOpen); + + var node_class = _this.nodeIconClose; + if(i_node_class.indexOf(node_class) > 0){ + $i_node.removeClass(_this.nodeIconClose); + $i_node.addClass(_this.nodeIconOpen); + } + + } else if (spread == "open") { + $ul.removeClass(NAV_SHOW); + $div.find("i[data-spread]").attr("data-spread","close"); + $i_spread.removeClass(_this.ficonOpen); + $i_spread.addClass(_this.ficonClose); + + var node_class = _this.nodeIconOpen; + if(i_node_class.indexOf(node_class) > 0){ + $i_node.removeClass(_this.nodeIconOpen); + $i_node.addClass(_this.nodeIconClose); + } + } + } + }; + + // 数据格式化 + DTree.prototype.escape = function(html){ + return event.escape(html); + }; + + // 格式化数据转回正常数据 + DTree.prototype.unescape = function(str){ + return event.unescape(str); + }; + + /******************** 工具栏及菜单栏区域 ********************/ + + + // 初始化菜单栏和工具栏的div + DTree.prototype.initTreePlus = function(){ + var _this = this; + // 初始化菜单栏和工具栏的div + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).remove(); + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).remove(); + _this.toolbarMenu = {}; + if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0) _this.obj.before("
              "); + if(_this.toolbar) _this.obj.before("
              "); + + }; + + // 开启工具栏和菜单栏 + DTree.prototype.openTreePlus = function(){ + var _this = this; + // 先对工具栏做处理,因为菜单栏可能会与工具栏产生关联。 + var ggMenu = []; + if(_this.toolbar) _this.getToolbarDom(); + + if(_this.menubar) { + var menubarTips = _this.menubarTips, + mtbar = menubarTips.toolbar, + group = menubarTips.group, + freedom = menubarTips.freedom; + if(mtbar && mtbar.length > 0){ + // 菜单栏吸附工具栏上 + for(var i=0; i 0){ + // 菜单栏吸附在上方的按钮组div中 + for(var i=0; i"; + break; + case defaultMenu.moveUp: + gg = ""; + break; + case defaultMenu.refresh: + gg = ""; + break; + case defaultMenu.remove: + gg = (_this.checkbar) ? "" : ""; + break; + case defaultMenu.searchNode: + gg = ""; + break; + } + return gg; + }; + + // 获取扩展菜单栏 + DTree.prototype.getExtMenubarDom = function(menu){ + var _this = this; + return ""; + }; + + // 获取依附在工具栏的菜单栏 + DTree.prototype.getMenubarToolDom = function(menu){ + var _this = this; + var rootId = _this.obj[0].id; + switch (menu) { + case defaultMenu.moveDown: + _this.toolbarMenu[defaultMenu.moveDown] = "
               展开"+_this.toolbarStyle.title+"
              "; + break; + case defaultMenu.moveUp: + _this.toolbarMenu[defaultMenu.moveUp] = "
               收缩"+_this.toolbarStyle.title+"
              "; + break; + case defaultMenu.refresh: + _this.toolbarMenu[defaultMenu.refresh] = "
               刷新
              "; + break; + case defaultMenu.remove: + if(_this.checkbar) + _this.toolbarMenu[defaultMenu.remove] = "
               删除选中"+_this.toolbarStyle.title+"
              "; + break; + case defaultMenu.searchNode: + _this.toolbarMenu[defaultMenu.searchNode] = "
               查询"+_this.toolbarStyle.title+"
              "; + break; + } + }; + + // 获取依附在工具栏的扩展菜单栏 + DTree.prototype.getExtMenubarToolDom = function(menu){ + var _this = this; + _this.toolbarMenu[menu.menubarId] = "
               "+menu.title+"
              "; + }; + + + // menubar内置方法 + DTree.prototype.menubarMethod = function(){ + var _this = this; + return { + openAllNode: function(obj){ // 展开所有节点 + var $ulNode = obj || _this.obj.children("li").children("ul"); + // 遍历所有ul子节点 + for (var i = 0; i < $ulNode.length; i++) { + // 获取当前节点的信息 + var $ul = $($ulNode[i]), + $div = $ul.prev("div"), + $i_spread = $div.find("i[data-spread]").eq(0), + $i_node = $div.find("i[data-spread]").eq(1), + i_node_class = $i_node.attr("class"), + $cite = $div.find("cite[data-leaf]").eq(0), + spread = $i_spread.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + if (leaf == "leaf") { continue; } // 说明是叶子了,则继续循环下一个 + + if (spread == "open") { + // 说明该节点已经展开了,则进行子节点循环 + } else { + if (_this.type=="load") { //是否全量加载 + if (_this.cache) { //是否开启缓存 + if ($ul.html()) { + $ul.addClass(NAV_SHOW); + } else { //加载节点 + _this.getChild($div); + } + }else { //每次取新的数据 + $ul.html(""); + _this.getChild($div); + } + } else { // 全量加载 + $ul.addClass(NAV_SHOW); + } + $div.find("i[data-spread]").attr("data-spread","open"); + $i_spread.removeClass(_this.ficonClose); + $i_spread.addClass(_this.ficonOpen); + + var node_class = _this.nodeIconClose; + if(i_node_class.indexOf(node_class) > 0){ + $i_node.removeClass(_this.nodeIconClose); + $i_node.addClass(_this.nodeIconOpen); + } + } + var $childUl = $ul.children("li").children("ul"); + _this.menubarMethod().openAllNode($childUl); + } + }, + closeAllNode: function(){ //收缩所有节点 + _this.obj.find("."+LI_NAV_CHILD).each(function(){ + // 获取当前节点的信息 + var $ul = $(this), + $div = $ul.prev("div"), + $i_spread = $div.find("i[data-spread]").eq(0), + $i_node = $div.find("i[data-spread]").eq(1), + i_node_class = $i_node.attr("class"), + $cite = $div.find("cite[data-leaf]").eq(0), + spread = $i_spread.attr("data-spread"), + leaf = $cite.attr("data-leaf"); + + $ul.removeClass(NAV_SHOW); + $div.find("i[data-spread]").attr("data-spread","close"); + $i_spread.removeClass(_this.ficonOpen); + $i_spread.addClass(_this.ficonClose); + + var node_class = _this.nodeIconOpen; + if(i_node_class.indexOf(node_class) > 0){ + $i_node.removeClass(_this.nodeIconOpen); + $i_node.addClass(_this.nodeIconClose); + } + }); + }, + refreshTree: function(){// 刷新树 + _this.obj.html(""); // 清空树结构 + _this.initNodeParam(); // 清空参数 + _this.init(); //执行初始化方法 + }, + remove: function(){// 删除选中节点 + var len = _this.obj.find("i[data-par][data-checked='1']").length; + if(len == 0){ + layer.msg("请至少选中一个节点",{icon:2}); + }else{ + //操作前先清空 + _this.checkbarNode = []; + // 选择所有复选框节点 + var i_node = {}; + _this.obj.find("i[data-par][data-checked='1']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + }); + + layer.confirm('确定要删除选中节点?', {icon: 3, title:'删除选中节点'}, function(index1){ + var flag = _this.menubarFun.remove(_this.checkbarNode); + if(flag){ + _this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).next("ul").remove(); + _this.obj.find("i[data-par][data-checked='1']").closest("."+LI_DIV_ITEM).remove(); + _this.checkbarNode=[]; + } + + layer.close(index1); + }); + } + }, + searchNode: function(){//模糊查询该值,展开该值节点 + layer.prompt({ + formType: 0, + value: "", + title: '查询节点' + }, function(value, index1, elem){ + if (value) { + var flag = _this.searchNode(value); + if (!flag) { + layer.msg("该名称节点不存在!", {icon:5}); + } + } else { + layer.msg("未指定查询节点名称", {icon:5}); + } + layer.close(index1); + }); + }, + extMethod: function(menuId, $div, flag){ + if(_this.menubar && _this.menubarTips.group && _this.menubarTips.group.length > 0 && flag == "group"){ + for(var i=0; i<_this.menubarTips.group.length; i++){ + var ext = _this.menubarTips.group[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + if(_this.menubar && _this.menubarTips.toolbar && _this.menubarTips.toolbar.length > 0 && flag == "toolbar"){ + for(var i=0; i<_this.menubarTips.toolbar.length; i++){ + var ext = _this.menubarTips.toolbar[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + if(_this.menubar && _this.menubarTips.freedom && _this.menubarTips.freedom.length > 0 && flag == "freedom"){ + for(var i=0; i<_this.menubarTips.freedom.length; i++){ + var ext = _this.menubarTips.freedom[i]; + if (menuId == ext.menubarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + } + }; + }; + + // menubar监听方法 + DTree.prototype.menubarListener = function(menuId, flag){ + var _this = this; + var $div = _this.getNowNode(); + switch (menuId) { + case defaultMenu.moveDown: // 展开节点 + _this.menubarMethod().openAllNode(); + break; + case defaultMenu.moveUp: // 收缩节点 + _this.menubarMethod().closeAllNode(); + break; + case defaultMenu.refresh: + _this.menubarMethod().refreshTree(); // 刷新树 + break; + case defaultMenu.remove: + _this.menubarMethod().remove(); + break; + case defaultMenu.searchNode: + _this.menubarMethod().searchNode(); + break; + default: + _this.menubarMethod().extMethod(menuId, $div, flag); + break; + } + }; + + //模糊查询该值,展开该值节点 + DTree.prototype.searchNode = function(value){ + var _this = this; + var b = false; + var $lis = []; + _this.obj.find("cite[data-leaf]").each(function(){ + var $nthis = $(this); + var html = $nthis.html(); + if(html.indexOf(value) > -1){ + if($nthis.attr("data-leaf") == "leaf") { + // 叶子节点提供包含父节点的所有信息 + var title = ""; + $nthis.parents("li").each(function(){ + title = "-" + $(this).find("cite[data-leaf]").html() + title; + }); + title = title.substring(1, title.length); + $nthis.attr("title", title); + } + // 保存当前cite所在的li及父li中包含该值,则只保留父的 + var i = 0; + $nthis.parents("li").each(function(){ + var html2 = $(this).find("cite[data-leaf]").html(); + if(html2.indexOf(value) > -1){ + i++; + } + if(i >= 2){ + return true; + } + }); + if (i < 2){ + $lis.push($nthis.closest("li").prop("outerHTML")); + } + } + }); + if($lis.length > 0) { + b = true; + // 1.将树节点清空 + _this.obj.html(""); + // 2.遍历所有cite节点,展开当前cite节点 + for(var i=0; i<$lis.length; i++){ + _this.obj.append($lis[i]); + } + } + return b; + }; + + + /******************** 工具栏区域 ********************/ + + // 获取工具栏 + DTree.prototype.getToolbarDom = function(){ + var _this = this; + var toolbarShow = _this.toolbarShow; + var toolbarExt = _this.toolbarExt; + + if(toolbarShow.length > 0){ + for(var i=0; i 新增"+_this.toolbarStyle.title+""; + } + if(show == "edit"){ + _this.toolbarMenu[defaultTool.editToolbar] = "
               编辑"+_this.toolbarStyle.title+"
              "; + } + if(show == "delete"){ + _this.toolbarMenu[defaultTool.delToolbar] = "
               删除"+_this.toolbarStyle.title+"
              "; + } + } + } + if(toolbarExt.length > 0){ + for(var i=0; i "+ext.title+""; + } + } + }; + + + // 设置工具栏按钮 + DTree.prototype.setToolbarDom = function(toolbarMenu){ + var _this = this; + if(toolbarMenu){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').html(""); + for(var key in toolbarMenu){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).find('div.layui-nav-item>dl.layui-nav-child').append(toolbarMenu[key]); + } + } + } + + + // 加载toolBar中的内容 + DTree.prototype.loadToolBar = function(title, name){ + var _this = this; + var toolbarShow = _this.toolbarShow; + var nodeBarContents = _this.toolbarBtn; + var html = ""; + switch (name) { + case defaultTool.addToolbar: + + //1. 必须加载的节点内容 + var nowNode = ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + + var addNodeName = ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + + var addNodeBtn = ['
              ', + '
              ', + '', + '
              ', + '
              '].join(''); + //2. 用户自定义的节点内容 + var addNodeBar = ['
              ', nowNode, addNodeName]; + if(nodeBarContents != null && nodeBarContents.length > 0){ + if(nodeBarContents[0] != null && nodeBarContents[0] != undefined && nodeBarContents[0].length > 0){ + var addNodeBarContents = nodeBarContents[0]; + + for(var j=0; j
              '); + html = addNodeBar.join(''); + break; + + case defaultTool.editToolbar: + + //1. 必须加载的节点内容 + var nowNode = ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + + var editNodeName = ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + + + var editNodeBtn = ['
              ', + '
              ', + '', + '
              ', + '
              '].join(''); + + var editNodeBar = ['
              ', nowNode, editNodeName]; + //2. 用户自定义的节点内容 + if(nodeBarContents != null && nodeBarContents.length > 0){ + + if(nodeBarContents[1] != null && nodeBarContents[1] != undefined && nodeBarContents[1].length > 0){ + var editNodeBarContents = nodeBarContents[1]; + + for(var j=0; j
              '); + html = editNodeBar.join(''); + break; + } + return html; + }; + + // 获取toolbar详细的标签信息 + DTree.prototype.loadToolBarDetail = function(){ + var _this = this; + return{ + text: function(nodeBarContents){ + return ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + }, + textarea: function(nodeBarContents){ + return ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + }, + hidden: function(nodeBarContents){ + return [''].join(''); + }, + select: function(nodeBarContents){ + var optionsData = nodeBarContents.optionsData; + var options = ""; + var defaultValue = nodeBarContents.value ? nodeBarContents.value : ""; + for(var key in optionsData){ + if(defaultValue == optionsData[key]){ + options += ""; + } else { + options += ""; + } + } + return ['
              ', + '', + '
              ', + '', + '
              ', + '
              '].join(''); + } + } + }; + + // 新增节点后改变节点内容 + DTree.prototype.changeTreeNodeAdd = function(returnID){ + var _this = this; + var temp = _this.temp; + var id = temp[0], $ul = temp[1], $div = temp[2], level = temp[3]; + if(returnID){ + var $thisDiv = _this.obj.find("[data-id='"+id+"']"); + if(typeof returnID === "object"){ + // 如果是JSON格式数据,则将当前DIV删除,重新建造DIV + $thisDiv.remove(); + var parseData = _this.parseData(returnID); + + if(parseData.treeId()){ + $ul.append(_this.getLiItemDom(parseData.treeId(), parseData.parentId(), parseData.title(), parseData.isLast(0), parseData.iconClass(), parseData.checkArr(), level, parseData.spread(), parseData.disabled(), parseData.basicData(), parseData.recordData(), "item")); + + // 建造完毕后,选中该DIV + var $addDiv = $ul.find("div[data-id='"+returnID.id+"']"); + _this.setNodeParam($addDiv) + } else { + layer.msg("添加失败,节点ID为undefined!",{icon:5}); + // 将li节点删除 + $ul.find("li[data-id='"+id+"']").remove(); + // 重新赋值 + _this.setNodeParam($div); + // 临时变量制空 + _this.temp = []; + return ; + } + }else if(typeof returnID === "string" || typeof this.icon === 'number'){ + $thisDiv.attr("data-id", returnID); + // 将li节点展示 + $ul.find("li[data-id='"+returnID+"']").show(); + var $addDiv = $ul.find("div[data-id='"+returnID+"']"); + _this.setNodeParam($addDiv) + } + + // 判断当前点击的节点是否是最后一级节点,如果是,则需要修改节点的样式 + var $icon_i = $div.find("i[data-spread]"); + if ($icon_i.eq(0).attr("data-spread") == "last") { + $icon_i.attr("data-spread","open"); + $icon_i.eq(0).removeClass(LI_DIV_SPREAD_LAST); + $icon_i.eq(0).removeClass(ICON_HIDE); + $icon_i.eq(0).addClass(_this.ficonOpen); + $icon_i.eq(1).removeClass(leafIconArray[_this.leafIcon]); + $icon_i.eq(1).addClass(_this.nodeIconOpen); + } else { //如果不是,也要修改节点样式 + $icon_i.attr("data-spread","open"); + $icon_i.eq(0).removeClass(_this.ficonClose); + $icon_i.eq(0).addClass(_this.ficonOpen); + $icon_i.eq(1).removeClass(_this.nodeIconClose); + $icon_i.eq(1).addClass(_this.nodeIconOpen); + + // _this.clickSpread($div); + } + $ul.addClass(NAV_SHOW); //展开UL + } else { + // 将li节点删除 + $ul.find("li[data-id='"+id+"']").remove(); + // 重新赋值 + _this.setNodeParam($div); + } + + _this.temp = []; // 临时变量制空 + + }; + + // 修改节点后改变节点内容 + DTree.prototype.changeTreeNodeEdit = function(flag){ + var _this = this; + var temp = _this.temp; + var $cite = temp[0], + $div = temp[1]; + + if(!flag){ + $cite.html(title); + node = _this.getNodeParam($div); + } + + _this.temp = []; // 临时变量制空 + }; + + // 编辑页打开后显示编辑页内容 + DTree.prototype.changeTreeNodeDone = function(param){ + var _this = this; + form.val('dtree_editNode_form', param); + form.render(); + }; + + // 删除节点后改变节点内容 + DTree.prototype.changeTreeNodeDel = function(flag){ + var _this = this; + var temp = _this.temp; + var $p_li = temp[0], + $p_ul = $p_li.parent("ul"), + $p_div = temp[1]; + + if(flag){ + $p_li.remove(); + // 判断父级ul中是否还存在li,如果不存在,则需要修改节点的样式 + if($p_ul.children("li").length == 0){ + var $icon_i = $p_div.find("i[data-spread]"); + $icon_i.attr("data-spread","last"); + $icon_i.eq(0).removeClass(_this.ficonOpen); + $icon_i.eq(0).removeClass(_this.ficonClose); + if(!_this.dot){$icon_i.eq(0).addClass(ICON_HIDE);} + $icon_i.eq(0).addClass(LI_DIV_SPREAD_LAST); + + $icon_i.eq(1).removeClass(_this.nodeIconOpen); + $icon_i.eq(1).removeClass(_this.nodeIconClose); + $icon_i.eq(1).addClass(leafIconArray[_this.leafIcon]); + } + _this.initNodeParam(); + } + + _this.temp = []; // 临时变量制空 + }; + + + /******************** 复选框区域 ********************/ + // 初始化复选框的值 + DTree.prototype.chooseDataInit = function(chooseIds){ + var _this = this; + var chooseId = chooseIds.split(","); + for (var i=0; i."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + if (flag == 0) { + //把父级去掉选中 + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($item_i).noCheck(); + } + } + } else { + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + //把父级选中 + _this.checkStatus($item_i).check(); + } + } + }; + + //实现复选框点击, no-all 子集选中父级半选中,子集全选父级选中 + DTree.prototype.checkAllOrNoallOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag == 0) { + //把父级去掉选中 + _this.checkStatus($item_i).noCheck(); + } else { + //把父级半选 + _this.checkStatus($item_i).noallCheck(); + } + } + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag1 != flag2) { + // 父级复选框半选 + _this.checkStatus($item_i).noallCheck(); + } else { + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + }; + + //实现复选框点击,p-casc:父级选中子集全选,子集无法改变父级选中状态 + DTree.prototype.checkAllOrPcascOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).noCheck(); + + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + + // 处理子级节点的选中状态 + var $child_li_i = $child_li.find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + _this.checkStatus($child_li_i).check(); + } + }; + + //实现复选框点击,self:各自选中互不影响 + DTree.prototype.checkOrNot = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + if ($i.attr("data-checked") == "1") { //当前复选框为选中状态,点击后变为未选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).noCheck(); + } else { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + } + }; + + //实现复选框点击,only:只能选中1个复选框 + DTree.prototype.checkOnly = function($i) { + var _this = this; + //$i 当前点击的checkbox + var $div = $i.closest("."+LI_DIV_ITEM), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + var checked = $i.attr("data-checked"); + // 将全部节点全部设为未选中状态 + var $all_i = _this.obj.find("i[data-checked]"); + _this.checkStatus($all_i).noCheck(); + + if (checked != "1") { //当前复选框为未选中状态,点击后变为选中状态 + // 处理当前节点的选中状态 + _this.checkStatus($i).check(); + } + + + }; + + //实现复选框点击 + DTree.prototype.changeCheck = function() { + var _this = this; + var temp = _this.temp; + var $i = temp[0]; + // 复选框选中事件 + if (_this.checkbarType == "all") { + _this.checkAllOrNot($i); + } else if(_this.checkbarType == "no-all") { + _this.checkAllOrNoallOrNot($i); + } else if(_this.checkbarType == "p-casc") { + _this.checkAllOrPcascOrNot($i); + } else if(_this.checkbarType == "self") { + _this.checkOrNot($i); + } else if(_this.checkbarType == "only") { + _this.checkOnly($i); + } else { + _this.checkAllOrNot($i); + } + + // 获取复选框选中节点的内容 + var checkbarNodes = _this.setAndGetCheckbarNodesParam(); + + // 用户自定义想做的事情 + _this.checkbarFun.chooseDone(checkbarNodes); + layui.event.call(this, MOD_NAME, "chooseDone("+$(_this.obj)[0].id+")", {"checkbarParams": checkbarNodes}); + _this.temp = []; + }; + + //复选框半选状态初始化设置 + DTree.prototype.initNoAllCheck = function(){ + var _this = this; + //1.获取所有选中节点 + var $is = _this.obj.find("i[data-checked='1']"); + if($is.length > 0){ + for ( var key = 0; key < $is.length; key++) { + var $i = $($is[key]), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var flag1 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"'][data-checked='1']").length; + var flag2 = item.eq(i).find(">."+LI_NAV_CHILD+" ."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']").length; + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + if (flag1 != flag2) { + // 父级复选框半选 + _this.checkStatus($item_i).noallCheck(); + } else { + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + } + }; + + //复选框选中状态初始化设置 + DTree.prototype.initAllCheck = function(){ + var _this = this; + //1.获取所有选中节点 + var $is = _this.obj.find("i[data-checked='1']"); + if($is.length > 0){ + for ( var key = 0; key < $is.length; key++) { + var $i = $($is[key]), + dataPar = $i.attr("data-par"), + dataType = $i.attr("data-type"), + $li = $i.closest(dataPar), //当前checkbox的上级li节点 + $parent_li = $i.parents(dataPar), //当前checkbox的所有父级li节点 + $child_li = $li.find(dataPar); //当前checkbox的上级li节点下的所有子级li节点 + + // 处理父级节点的选中状态 + for (var i = 1, item = $parent_li; i < item.length; i++) { + var $item_i = item.eq(i).find(">."+LI_DIV_ITEM+">."+LI_DIV_CHECKBAR+">i[data-type='"+dataType+"']"); + // 父级复选框全选 + _this.checkStatus($item_i).check(); + } + } + } + }; + + // 设置复选框选中/未选中/半选 _this.checkStatus($i).check(); _this.checkStatus($i).noCheck(); _this.checkStatus($i).noallCheck(); + DTree.prototype.checkStatus = function($i) { + var _this = this; + return { + check: function(){ + $i.removeClass(LI_DIV_CHECKBAR_OUT); + $i.removeClass(LI_DIV_CHECKBAR_NOALL); + $i.addClass(LI_DIV_CHECKBAR_ON); + $i.addClass(_this.style.chs); + $i.attr("data-checked","1"); + }, + noCheck: function(){ + $i.removeClass(LI_DIV_CHECKBAR_NOALL); + $i.removeClass(LI_DIV_CHECKBAR_ON); + $i.removeClass(_this.style.chs); + $i.addClass(LI_DIV_CHECKBAR_OUT); + $i.attr("data-checked","0"); + }, + noallCheck: function(){ + $i.removeClass(LI_DIV_CHECKBAR_OUT); + $i.removeClass(LI_DIV_CHECKBAR_ON); + $i.addClass(LI_DIV_CHECKBAR_NOALL); + $i.addClass(_this.style.chs); + $i.attr("data-checked","2"); + } + } + }; + + // 设置树的复选框操作值的全部参数,并获取 + DTree.prototype.setAndGetCheckbarNodesParam = function() { + var _this = this; + //操作前先清空 + _this.checkbarNode = []; + // 选择所有复选框节点 + if (_this.checkbarData == "change"){ //记录变更数据 + _this.obj.find("i[data-par]").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + + if ($i.attr("data-checked") != $i.attr("data-initchecked")) { + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + } + }); + } else if (_this.checkbarData == "all"){ //记录全部数据 + _this.obj.find("i[data-par][data-checked]").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + + }); + } else { //记录选中数据 + _this.obj.find("i[data-par][data-checked='1']").each(function(){ + var $i = $(this), $div = $i.closest("."+LI_DIV_ITEM); + _this.checkbarNode.push(_this.getRequestParam(_this.getCheckbarNodeParam($div, $i))); + + }); + } + return _this.checkbarNode; + }; + + // 获取树的复选框操作值的全部参数 + DTree.prototype.getCheckbarNodesParam = function() { + var _this = this; + return _this.setAndGetCheckbarNodesParam(); + }; + + // 获取树的一个复选框的参数 + DTree.prototype.getCheckbarNodeParam = function($div, $i){ + var _this = this; + var temp_node = {}; + temp_node.nodeId = $div.attr("data-id"); + temp_node.parentId = $div.parent().attr("data-pid"); + temp_node.context = $div.find("cite[data-leaf]").eq(0).text(); + temp_node.isLeaf = $div.find("cite[data-leaf]").eq(0).attr("data-leaf") == "leaf" ? true : false; + temp_node.level = $div.parent().attr("data-index"); + temp_node.spread = $div.find("i[data-spread]").eq(0).attr("data-spread") == "open" ? true : false; + temp_node.basicData = $div.attr("data-basic"); + temp_node.recordData = $div.attr("data-record"); + temp_node.dataType = $i.attr("data-type"); + temp_node.ischecked = $i.attr("data-checked"); + temp_node.initchecked = $i.attr("data-initchecked"); + return temp_node; + }; + + //判断复选框是否发生变更 + DTree.prototype.changeCheckbarNodes = function(){ + var flag = false; + var _this = this; + _this.obj.find("i[data-par]").each(function(){ + var $i = $(this); + $div = $i.closest("."+LI_DIV_ITEM); + + if ($i.attr("data-checked") != $i.attr("data-initchecked")) { + flag = true; + return true; + } + }); + return flag; + }; + + + /******************** iframe区域 ********************/ + // 加载iframe + DTree.prototype.loadIframe = function($div, iframeParam) { + var _this = this; + var $cite = $div.find("cite[data-leaf]").eq(0); + if (!_this.useIframe) { // 启用iframe + return false; + } + var iframeElem = _this.iframe.iframeElem, + iframeUrl = _this.iframe.iframeUrl, + iframeLoad = _this.iframe.iframeLoad; + + var flag = iframeLoad == "leaf" ? (($cite.attr("data-leaf") == "leaf") ? true : false) : true; + + if (flag) { + if ($(iframeElem).length > 0) { //iframe存在 + if (!iframeUrl) { + layer.msg("数据请求异常,iframeUrl参数未指定", {icon:5}); + return false; + } + var param = AjaxHelper.serialize(iframeParam); + if(iframeUrl.indexOf("?")> -1){ + param = "&"+param.substring(1, param.length); + } + var url = iframeUrl + param; + $(iframeElem).attr("src", url); + } else { + layer.msg("iframe绑定异常,请确认页面中是否有iframe页对应的容器", {icon:5}); + return false; + } + } + return flag; + }; + + // 获取传递出去的参数,根据iframe.iframeDefaultRequest、iframe.iframeRequest和node拼出发出请求的参数 + DTree.prototype.getIframeRequestParam = function(nodes){ + var _this = this; + var request = _this.iframe.iframeRequest, + defaultRequestNames = _this.iframe.iframeDefaultRequest, + node = nodes || _this.node, + requestParam = {}; + + // 先拼用户自定义的,在拼树生成的,这样的话用户可以自定义当树未生成时的节点的初始值 + for ( var key in request) { + requestParam[key] = request[key]; + } + for ( var key in defaultRequestNames) { + var paramName = defaultRequestNames[key]; + var paramValue = node[key]; + if(typeof paramValue === "boolean"){ + requestParam[paramName] = paramValue; + }else { + if(paramValue){ + requestParam[paramName] = paramValue; + } + } + } + + // 解决传递中文的乱码问题 + var reg = /[\u4E00-\u9FA5\uF900-\uFA2D]/; //正则匹配中文 + for(var key in requestParam){ + if(reg.test(requestParam[key])) { + var str = requestParam[key]; + requestParam[key] = encodeURI(encodeURI(str)); + } + } + + return requestParam; + }; + + /******************** 数据回调区域 ********************/ + // 获取当前选中节点下一个UL 或根节点。为了将新节点放入ul下 + DTree.prototype.getNowNodeUl = function() { + var _this = this; + return (_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj : _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).next("ul"); + }; + + // 获取当前选中节点 或根节点。 + DTree.prototype.getNowNode = function() { + var _this = this; + return (_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).length == 0) ? _this.obj.children("li").eq(0).children("div").eq(0) : _this.obj.find("div[data-id]").parent().find("."+NAV_THIS); + }; + + // 设置当前选中节点的全部参数 + DTree.prototype.setNodeParam = function($div) { + var _this = this; + _this.node.nodeId = $div.attr("data-id"); + _this.node.parentId = $div.parent().attr("data-pid"); + _this.node.context = $div.find("cite[data-leaf]").eq(0).text(); + _this.node.isLeaf = $div.find("cite[data-leaf]").eq(0).attr("data-leaf") == "leaf" ? true : false; + _this.node.level = $div.parent().attr("data-index"); + _this.node.spread = $div.find("i[data-spread]").eq(0).attr("data-spread") == "open" ? true : false; + _this.node.basicData = $div.attr("data-basic"); + _this.node.recordData = $div.attr("data-record"); + if ($div.find("i[data-par]")) { + var dataTypes = "", ischeckeds = "", initcheckeds = ""; + $div.find("i[data-par]").each(function(){ + dataTypes += $(this).attr("data-type") + ","; + ischeckeds += $(this).attr("data-checked") + ","; + initcheckeds += $(this).attr("data-initchecked") + ","; + }); + dataTypes = dataTypes.substring(0, dataTypes.length-1); + ischeckeds = ischeckeds.substring(0, ischeckeds.length-1); + initcheckeds = initcheckeds.substring(0, initcheckeds.length-1); + + _this.node.dataType = dataTypes; + _this.node.ischecked = ischeckeds; + _this.node.initchecked = initcheckeds; + } + }; + + // 获取当前选中节点的全部参数 + DTree.prototype.getNodeParam = function($div) { + var _this = this; + if ($div) { + _this.setNodeParam($div); + } else { + if(_this.obj.find("div[data-id]").parent().find("."+NAV_THIS).length == 0){ + _this.initNodeParam(); + } + } + return this.node; + }; + + // 获取一个临时的node参数 + DTree.prototype.getTempNodeParam = function($div) { + var _this = this; + var temp_node = {}; + temp_node.nodeId = $div.attr("data-id"); + temp_node.parentId = $div.parent().attr("data-pid"); + temp_node.context = $div.find("cite[data-leaf]").eq(0).text(); + temp_node.isLeaf = $div.find("cite[data-leaf]").eq(0).attr("data-leaf") == "leaf" ? true : false; + temp_node.level = $div.parent().attr("data-index"); + temp_node.spread = $div.find("i[data-spread]").eq(0).attr("data-spread") == "open" ? true : false; + temp_node.basicData = $div.attr("data-basic"); + temp_node.recordData = $div.attr("data-record"); + if ($div.find("i[data-par]")) { + var dataTypes = "", ischeckeds = "", initcheckeds = ""; + $div.find("i[data-par]").each(function(){ + dataTypes += $(this).attr("data-type") + ","; + ischeckeds += $(this).attr("data-checked") + ","; + initcheckeds += $(this).attr("data-initchecked") + ","; + }); + dataTypes = dataTypes.substring(0, dataTypes.length-1); + ischeckeds = ischeckeds.substring(0, ischeckeds.length-1); + initcheckeds = initcheckeds.substring(0, initcheckeds.length-1); + + temp_node.dataType = dataTypes; + temp_node.ischecked = ischeckeds; + temp_node.initchecked = initcheckeds; + } + return temp_node; + }; + + // 重置参数 + DTree.prototype.initNodeParam = function(){ + var _this = this; + _this.node.nodeId = ""; + _this.node.parentId = ""; + _this.node.context = ""; + _this.node.isLeaf = ""; + _this.node.level = ""; + _this.node.spread = ""; + _this.node.dataType = ""; + _this.node.ischecked = ""; + _this.node.initchecked = ""; + _this.node.basicData = ""; + }; + + // 获取传递出去的参数,根据defaultRequest、request和node拼出发出请求的参数 + DTree.prototype.getRequestParam = function(nodes){ + var _this = this; + var request = _this.request, + defaultRequestNames = _this.defaultRequest, + node = nodes || _this.node, + requestParam = {}; + + // 先拼用户自定义的,在拼树生成的,这样的话用户可以自定义当树未生成时的节点的初始值 + for ( var key in request) { + requestParam[key] = request[key]; + } + for ( var key in defaultRequestNames) { + var paramName = defaultRequestNames[key]; + var paramValue = node[key]; + if(typeof paramValue === "boolean"){ + requestParam[paramName] = paramValue; + }else { + if(paramValue){ + requestParam[paramName] = paramValue; + } + } + + } + return requestParam; + }; + + // 获取filterParam过滤后的requestParam + DTree.prototype.getFilterRequestParam = function(requestParam){ + var _this = this; + var filterRequest = _this.filterRequest; + return event.cloneObj(requestParam, filterRequest); + }; + + // 获取当前选中值 + DTree.prototype.getNowParam = function(){ + var _this = this; + + return _this.getRequestParam(_this.getNodeParam()); + }; + + // 获取参数的上级节点 + DTree.prototype.getParentParam = function(id){ + var _this = this; + var $div = _this.obj.find("div[data-id='"+id+"']"); + if($div.length > 0){ return _this.callbackData().parentNode($div); } else { return {}; } + }; + + // 获取参数的下级节点 + DTree.prototype.getChildParam = function(id){ + var _this = this; + var $div = _this.obj.find("div[data-id='"+id+"']"); + if($div.length > 0){ return _this.callbackData().childNode($div); } else { return []; } + }; + + // 获取回调数据 + DTree.prototype.callbackData = function(){ + var _this = this; + return { + dom: function($dom){ // 获取dom + return $dom; + }, + node: function(node){ // 获取当前节点值 + return _this.getRequestParam(node); + }, + childNode: function($div){ // 获取下级节点值 + var $childDivs = $div.next("ul").find("li."+LI_NAV_ITEM+" div."+LI_DIV_ITEM); + var childNode = []; + if($childDivs && $childDivs.length > 0){ + $childDivs.each(function(){ + var $cDiv = $(this); + childNode.push(_this.getRequestParam(_this.getTempNodeParam($cDiv))); + }); + } + return childNode; + }, + parentNode: function($div){ // 获取上级节点值 + var pId = $div.parent().attr("data-pid"); + var $pdiv = _this.obj.find("div[data-id='"+pId+"']"); + if($pdiv.length > 0) {return _this.getRequestParam(_this.getTempNodeParam($pdiv));} else {return {};} + + } + } + }; + + /******************** 事件回调区域 ********************/ + // 绑定浏览器事件 + DTree.prototype.bindBrowserEvent = function(){ + var _this = this; + + // 绑定文件夹展开/收缩的图标的点击事件,点击时给当前节点的div添加选中class + _this.obj.on("click", "i[data-spread]", function(event) { + event.stopPropagation(); + var $i = $(this), + $div = $i.parent("div"), + $cite = $div.find("cite"), + node = _this.getNodeParam($div), + $ul = $div.next("ul"), + $p_li = $div.parent("li[data-index]"), //当前选中节点的顶级li节点 + $p_ul = $p_li.parent("ul"); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + + _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + + _this.clickSpread($div); // 展开或隐藏节点 + + // 树状态改变后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "changeTree("+$(_this.obj)[0].id+")", {param: _this.callbackData().node(node), dom: _this.callbackData().dom($i), show: _this.callbackData().dom($i).attr("data-spread") == "open" ? true : false}); + }); + + // 绑定所有子节点div的单击事件,点击时触发加载iframe或用户自定义想做的事情 + _this.obj.on("click", "div[dtree-click='"+eventName.itemNodeClick+"']", function(event) { + event.stopPropagation(); + var $div = $(this), + $cite = $div.find("cite"), + node = _this.getNodeParam($div), + $ul = $div.next("ul"), + $p_li = $div.parent("li[data-index]"), //当前选中节点的顶级li节点 + $p_ul = $p_li.parent("ul"); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + + _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + + if (_this.useIframe) { + var iframeParam = _this.getFilterRequestParam(_this.getIframeRequestParam(node)); + var flag = _this.loadIframe($div, iframeParam); // 加载iframe + if (flag) { + // iframe加载完毕后,用户自定义想做的事情 + _this.iframeFun.iframeDone(iframeParam); + + layui.event.call(this, MOD_NAME, "iframeDone("+$(_this.obj)[0].id+")", {"iframeParam": iframeParam, dom: _this.callbackData().dom($div)}); + } + } else { + // 单击事件执行完毕后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "node("+$(_this.obj)[0].id+")", {param: _this.callbackData().node(node), childParams: _this.callbackData().childNode($div), parentParam: _this.callbackData().parentNode($div), dom: _this.callbackData().dom($div)}); + } + }); + + // 绑定所有子节点div的双击事件,暴露on给用户自定义 + _this.obj.on("dblclick", "div[dtree-click='"+eventName.itemNodeClick+"']", function(event) { + event.stopPropagation(); + var $div = $(this), + $cite = $div.find("cite"), + node = _this.getNodeParam($div), + $ul = $div.next("ul"), + $p_li = $div.parent("li[data-index]"), //当前选中节点的顶级li节点 + $p_ul = $p_li.parent("ul"); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + + _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + // 双击事件执行完毕后,用户自定义想做的事情 + layui.event.call(this, MOD_NAME, "nodedblclick("+$(_this.obj)[0].id+")", {param: _this.callbackData().node(node), childParams: _this.callbackData().childNode($div), parentParam: _this.callbackData().parentNode($div), dom: _this.callbackData().dom($div)}); + }); + + //绑定所有子节点div的右键点击事件,用于显示toolbar + _this.obj.on("contextmenu", "div[dtree-click='"+eventName.itemNodeClick+"'][d-contextmenu]", function(e){ + var $div = $(this), + node = _this.getNodeParam($div), + contextmenu = $div.attr("d-contextmenu"); + if(_this.toolbar){ + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + + // toolbar加载前执行的方法,执行完毕之后创建按钮 + _this.setToolbarDom(_this.toolbarFun.loadToolbarBefore(event.cloneObj(_this.toolbarMenu), _this.getRequestParam(node), $div)); + + var e = e || window.event, + mx = e.pageX - $div.offset().left +45 , + my = $div.offset().top - _this.obj.closest(_this.toolbarScroll).offset().top +15; + if(contextmenu == "true"){ + _this.obj.find("div[data-id]").parent().find("."+NAV_THIS).removeClass(NAV_THIS); + _this.obj.find("div[data-id]").parent().find("."+_this.style.itemThis).removeClass(_this.style.itemThis); + $div.addClass(NAV_THIS); + $div.addClass(_this.style.itemThis); + $toolBarDiv.find(".layui-nav-child").addClass('layui-anim-fadein layui-show'); + $toolBarDiv.css({'left':mx+'px','top':my+'px'}); + } + } + e.stopPropagation(); + return false; + }); + + // 绑定装载树的上层出现滚动条的容器,让toolbar隐藏 + _this.obj.closest(_this.toolbarScroll).scroll(function() { + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + }); + + // 绑定toolbar的点击事件 + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[dtree-tool]", function(event) { + event.stopPropagation(); + var $div = _this.getNowNode(), + node = _this.getNodeParam($div), + $ul = $div.next("ul"), + $p_li = $div.parent("li[data-index]"), //当前选中节点的顶级li节点 + $p_ul = $p_li.parent("ul"), //当前选中节点的顶级li节点的父级ul + $p_div = $p_ul.prev("div"), //当前选中节点的顶级li节点的父级ul的前一个div + $cite = $div.children("cite"), //当前选中节点的text + title = $cite.html(); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + var tool = $(this).attr("dtree-tool"); + switch (tool) { + case defaultTool.addToolbar: + var content = _this.loadToolBar(title, defaultTool.addToolbar); + + layer.open({ + title: "新增"+_this.toolbarStyle.title, + type: 1, + area: _this.toolbarStyle.area, + content: content, + success: function(layero, index){ + form.render(); + form.on("submit(dtree_addNode_form)",function(data){ + var data = data.field; + var parentId = $div.attr("data-id"), + id = $div.attr("data-id")+"_node_"+$ul[0].childNodes.length, + isLeaf = true, + isChecked = "0", + level = parseInt($p_li.attr("data-index"))+1; + + // 创建子节点的DOM,添加子节点 + var checkArr = []; + if (_this.checkArrLen > 0) { + for (var i = 0; i < _this.checkArrLen; i++) { + checkArr.push({"type":i,"isChecked":"0"}); + } + } + + $ul.append(_this.getLiItemDom(id, parentId, data.addNodeName, true, "", checkArr, level, false, false, "", "", "item")); + // 先将li节点隐藏 + $ul.find("li[data-id='"+id+"']").hide(); + // 重新赋值 + var $addDiv = $ul.find("div[data-id='"+id+"']"); + node = _this.getNodeParam($addDiv); + + //获取组装后的requestNode,组合参数 + var requestNode = _this.getRequestParam(node); + requestNode = $.extend(requestNode, data); + + _this.temp = [id, $ul, $div, level]; + // 用户自定义想做的事情 + _this.toolbarFun.addTreeNode(requestNode, $div); + + layer.close(index); + return false; + }); + } + }); + break; + case defaultTool.editToolbar: + var content = _this.loadToolBar(title, defaultTool.editToolbar); + + layer.open({ + title: "编辑"+_this.toolbarStyle.title, + type: 1, + area: _this.toolbarStyle.area, + content: content, + success: function(layero, index){ + _this.toolbarFun.editTreeLoad(_this.getRequestParam(node)); + form.render(); + form.on("submit(dtree_editNode_form)",function(data){ + var data = data.field; + $cite.html(data.editNodeName); + node = _this.getNodeParam($div); + var requestNode = _this.getRequestParam(node); + requestNode = $.extend(requestNode, data); + _this.temp = [$cite, $div]; + _this.toolbarFun.editTreeNode(requestNode, $div); + + layer.close(index); + }); + } + }); + break; + case defaultTool.delToolbar: + layer.confirm('确定要删除该'+_this.toolbarStyle.title+'?', {icon: 3, title:'删除'+_this.toolbarStyle.title}, function(index){ + var node = _this.getNodeParam($div); + _this.temp = [$p_li, $p_div]; + _this.toolbarFun.delTreeNode(_this.getRequestParam(node), $div); + + layer.close(index); + }); + break; + default: + var toolbarId = $(this).attr("dtree-tool"); + if(_this.toolbarExt.length > 0){ + for(var i=0; i<_this.toolbarExt.length; i++){ + var ext = _this.toolbarExt[i]; + if (toolbarId == ext.toolbarId){ + ext.handler(_this.getRequestParam(_this.getNodeParam($div), $div)); + break; + } + } + } + break; + } + }); + + // 绑定menubar的点击事件 + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).on("click", "button[d-menu]", function(event) { + event.stopPropagation(); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + _this.menubarListener($(this).attr("d-menu"), "group"); + }); + + // 绑定menubar的点击事件 + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).on("click", "a[d-menu]", function(event) { + event.stopPropagation(); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + _this.menubarListener($(this).attr("d-menu"), "toolbar"); + }); + + // 绑定menubar的点击按钮事件 + _this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").on("click", function(event) { + event.stopPropagation(); + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + _this.menubarListener($(this).attr("dtree-menu"), "freedom"); + }); + + // 绑定cheboxbar的节点复选框 + _this.obj.on("click", "i[dtree-click='"+eventName.checkNodeClick+"']", function(event) { + var $toolBarDiv = _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id); + $toolBarDiv.find(".layui-nav-child").removeClass('layui-anim-fadein layui-show'); + var $i = $(this), + $div = $i.closest("div[dtree-click='"+eventName.itemNodeClick+"']"), + node = _this.getNodeParam($div); + // 复选框选中前的回调 + var flag = _this.checkbarFun.chooseBefore($i, _this.getRequestParam(node)); + _this.temp = [$i]; + if(flag){_this.changeCheck();} + event.stopPropagation(); + }); + }; + + // 绑定body的单击,让本页面所有的toolbar隐藏 + $BODY.on("click", function(event){ + $("div."+LI_DIV_TOOLBAR).find(".layui-show").removeClass('layui-anim-fadein layui-show'); + }); + + // 解绑浏览器事件 + DTree.prototype.unbindBrowserEvent = function(){ + var _this = this; + + // 本身事件解绑 + _this.obj.unbind(); + // 菜单栏解绑 + if(_this.menubar){ + _this.obj.prevAll('div#dtree_menubar_'+_this.obj[0].id).unbind(); + if(_this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").length > 0){ + _this.obj.closest('body').find("*[dtree-id='"+_this.obj[0].id+"'][dtree-menu]").unbind(); + } + } + + // 工具栏解绑 + if(_this.toolbar){ + _this.obj.prevAll('div#dtree_toolbar_'+_this.obj[0].id).unbind(); + if(_this.obj.closest(_this.toolbarScroll).length > 0){ + _this.obj.closest(_this.toolbarScroll).unbind(); + } + } + }; + + + /** 外部访问 **/ + var dtree = { + render: function(options){ // 初始化树 + var dTree = null; + var id = event.getElemId(options); + if(id == "") { + layer.msg("页面中未找到绑定id", {icon:5}); + } else { + dTree = DTrees[id]; + if(typeof dTree === 'object'){ + dTree.reloadSetting(options); + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.init(); + dTree.unbindBrowserEvent(); + dTree.bindBrowserEvent(); + } else { + // 创建树 + dTree = new DTree(options); + // 添加到树数组中去 + DTrees[id] = dTree; + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.init(); + dTree.bindBrowserEvent(); + } + } + + return dTree; + }, + reload: function(dTree, options){ + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + dTree.reloadSetting(options); + dTree.initTreePlus(); + dTree.openTreePlus(); + dTree.init(); + dTree.unbindBrowserEvent(); + dTree.bindBrowserEvent(); + }, + on: function(events, callback) { // 绑定事件 + if(events.indexOf("'") > 0){ + events = events.replace(/'/g,""); + } + if(events.indexOf('"') > 0) { + events = events.replace(/"/g,""); + } + return layui.onevent.call(this, MOD_NAME, events, callback); + }, + getNowParam: function(dTree){ + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getNowParam(); // 获取当前选中值 + }, + getParentParam: function(dTree, id){ // 获取参数的上级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getParentParam(id); + }, + getChildParam: function(dTree, id){ // 获取参数的全部下级节点 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.getChildParam(id); + }, + getCheckbarNodesParam: function(dTree){ + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return {}; + } + return dTree.getCheckbarNodesParam(); // 获取复选框选中值 + }, + dataInit: function(dTree, chooseId){ // 初始化选中树,针对数据返选 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + if(chooseId){ + return dTree.dataInit(chooseId); + } + }, + chooseDataInit: function(dTree, chooseIds){ // 初始化复选框的值 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + if(chooseIds){ + return dTree.chooseDataInit(chooseIds); + } + }, + changeCheckbarNodes: function(dTree){ //判断复选框是否发生变更 + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + return dTree.changeCheckbarNodes(); + }, + refreshTree: function(dTree){ //刷新树,并具有数据回显的功能,自动识别复选框or单选(未完成) + if(typeof dTree === "string"){ + dTree = DTrees[dTree]; + } + if(typeof dTree === "undefined"){ + layer.msg("方法获取失败,请检查ID或对象传递是否正确",{icon:2}); + return ; + } + }, + escape: function(html){ + return event.escape(html); + }, + unescape: function(str){ + return event.unescape(str); + }, + version: function(){ + return VERSION; + } + }; + + exports('dtree', dtree); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/dtree/font/dtreefont.css b/public/static/layui/plugin/dtree/font/dtreefont.css new file mode 100644 index 0000000..df7af65 --- /dev/null +++ b/public/static/layui/plugin/dtree/font/dtreefont.css @@ -0,0 +1,229 @@ +@font-face { + font-family: 'dtreefont'; + src: url('dtreefont.eot?x3m8fp'); + src: url('dtreefont.eot?x3m8fp#iefix') format('embedded-opentype'), + url('dtreefont.ttf?x3m8fp') format('truetype'), + url('dtreefont.woff?x3m8fp') format('woff'), + url('dtreefont.svg?x3m8fp#dtreefont') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="dtree-icon-"], [class*=" dtree-icon-"] { + /* use !important to prevent issues with browser extensions that change font */ + font-family: 'dtreefont' !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; +} + +.dtree-icon-xiangxia1:before { + content: "\e771"; +} +.dtree-icon-normal-file:before { + content: "\e60c"; +} +.dtree-icon-xiangyou:before { + content: "\e78f"; +} +.dtree-icon-ok-circle:before { + content: "\1005"; +} +.dtree-icon-close1:before { + content: "\1006"; +} +.dtree-icon-close-fill:before { + content: "\1007"; +} +.dtree-icon-jian1:before { + content: "\e600"; +} +.dtree-icon-jia1:before { + content: "\e601"; +} +.dtree-icon-bianji:before { + content: "\e602"; +} +.dtree-icon-yonghu:before { + content: "\e603"; +} +.dtree-icon-shijian:before { + content: "\e606"; +} +.dtree-icon-fuxuankuang-banxuan:before { + content: "\e607"; +} +.dtree-icon-star:before { + content: "\e608"; +} +.dtree-icon-wenjianjiazhankai:before { + content: "\e60e"; +} +.dtree-icon-xiangmuxiaoxi:before { + content: "\e60f"; +} +.dtree-icon-search2:before { + content: "\e615"; +} +.dtree-icon-weibiaoti5:before { + content: "\e618"; +} +.dtree-icon-layim-theme:before { + content: "\e61b"; +} +.dtree-icon-shuye1:before { + content: "\e61e"; +} +.dtree-icon-add-circle:before { + content: "\e61f"; +} +.dtree-icon-xinxipilu:before { + content: "\e620"; +} +.dtree-icon-set-sm:before { + content: "\e621"; +} +.dtree-icon-about:before { + content: "\e623"; +} +.dtree-icon-chart-screen:before { + content: "\e62a"; +} +.dtree-icon-delete1:before { + content: "\e640"; +} +.dtree-icon-share3:before { + content: "\e641"; +} +.dtree-icon-youjian:before { + content: "\e642"; +} +.dtree-icon-check:before { + content: "\e645"; +} +.dtree-icon-close:before { + content: "\e646"; +} +.dtree-icon-favorfill:before { + content: "\e64b"; +} +.dtree-icon-favor:before { + content: "\e64c"; +} +.dtree-icon-fuxuankuangxuanzhong:before { + content: "\e652"; +} +.dtree-icon-fenguangbaobiao:before { + content: "\e655"; +} +.dtree-icon-jian:before { + content: "\e656"; +} +.dtree-icon-jia:before { + content: "\e657"; +} +.dtree-icon-fenzhijigou:before { + content: "\e658"; +} +.dtree-icon-roundcheckfill:before { + content: "\e659"; +} +.dtree-icon-roundcheck:before { + content: "\e65a"; +} +.dtree-icon-roundclosefill:before { + content: "\e65b"; +} +.dtree-icon-roundclose:before { + content: "\e65c"; +} +.dtree-icon-roundrightfill:before { + content: "\e65d"; +} +.dtree-icon-roundright:before { + content: "\e65e"; +} +.dtree-icon-like:before { + content: "\e66c"; +} +.dtree-icon-samefill:before { + content: "\e671"; +} +.dtree-icon-same:before { + content: "\e672"; +} +.dtree-icon-evaluate:before { + content: "\e674"; +} +.dtree-icon-circle1:before { + content: "\e687"; +} +.dtree-icon-radio:before { + content: "\e688"; +} +.dtree-icon-caidan_xunzhang:before { + content: "\e68e"; +} +.dtree-icon-pulldown:before { + content: "\e6a0"; +} +.dtree-icon-pullup:before { + content: "\e6a1"; +} +.dtree-icon-refresh:before { + content: "\e6a4"; +} +.dtree-icon-qrcode1:before { + content: "\e6b0"; +} +.dtree-icon-profile1:before { + content: "\e6b7"; +} +.dtree-icon-home1:before { + content: "\e6b8"; +} +.dtree-icon-homefill:before { + content: "\e6bb"; +} +.dtree-icon-roundaddfill:before { + content: "\e6d8"; +} +.dtree-icon-roundadd:before { + content: "\e6d9"; +} +.dtree-icon-fuxuankuang:before { + content: "\e6f2"; +} +.dtree-icon-wefill:before { + content: "\e6f5"; +} +.dtree-icon-sort:before { + content: "\e701"; +} +.dtree-icon-repair:before { + content: "\e738"; +} +.dtree-icon-shujudaping:before { + content: "\e742"; +} +.dtree-icon-dian:before { + content: "\e7a5"; +} +.dtree-icon-search_list_light:before { + content: "\e807"; +} +.dtree-icon-round_list_light:before { + content: "\e82b"; +} +.dtree-icon-star-fill:before { + content: "\e832"; +} +.dtree-icon-rate:before { + content: "\e833"; +} +.dtree-icon-move-up:before { + content: "\ea47"; +} +.dtree-icon-move-down:before { + content: "\ea48"; +} diff --git a/public/static/layui/plugin/dtree/font/dtreefont.eot b/public/static/layui/plugin/dtree/font/dtreefont.eot new file mode 100644 index 0000000..68bf5f2 Binary files /dev/null and b/public/static/layui/plugin/dtree/font/dtreefont.eot differ diff --git a/public/static/layui/plugin/dtree/font/dtreefont.svg b/public/static/layui/plugin/dtree/font/dtreefont.svg new file mode 100644 index 0000000..90fe50f --- /dev/null +++ b/public/static/layui/plugin/dtree/font/dtreefont.svg @@ -0,0 +1,80 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/static/layui/plugin/dtree/font/dtreefont.ttf b/public/static/layui/plugin/dtree/font/dtreefont.ttf new file mode 100644 index 0000000..78bacd1 Binary files /dev/null and b/public/static/layui/plugin/dtree/font/dtreefont.ttf differ diff --git a/public/static/layui/plugin/dtree/font/dtreefont.woff b/public/static/layui/plugin/dtree/font/dtreefont.woff new file mode 100644 index 0000000..2b54645 Binary files /dev/null and b/public/static/layui/plugin/dtree/font/dtreefont.woff differ diff --git a/public/static/layui/plugin/dtree/font/icons.json b/public/static/layui/plugin/dtree/font/icons.json new file mode 100644 index 0000000..35a90fb --- /dev/null +++ b/public/static/layui/plugin/dtree/font/icons.json @@ -0,0 +1,283 @@ +{ + "data": [{ + "cls": "dtree-icon-xiangxia1", + "uncode": "e771" + }, + { + "cls": "dtree-icon-xiangyou", + "uncode": "e78f" + }, + { + "cls": "dtree-icon-jian", + "uncode": "e656" + }, + { + "cls": "dtree-icon-jia", + "uncode": "e657" + }, + { + "cls": "dtree-icon-weibiaoti5", + "uncode": "e618" + }, + { + "cls": "dtree-icon-wenjianjiazhankai", + "uncode": "e60e" + }, + { + "cls": "dtree-icon-dian", + "uncode": "e7a5" + }, + { + "cls": "dtree-icon-yonghu", + "uncode": "e603" + }, + { + "cls": "dtree-icon-fenzhijigou", + "uncode": "e658" + }, + { + "cls": "dtree-icon-fenguangbaobiao", + "uncode": "e655" + }, + { + "cls": "dtree-icon-xinxipilu", + "uncode": "e620" + }, + { + "cls": "dtree-icon-shuye1", + "uncode": "e61e" + }, + { + "cls": "dtree-icon-caidan_xunzhang", + "uncode": "e68e" + }, + { + "cls": "dtree-icon-normal-file", + "uncode": "e60c" + }, + { + "cls": "dtree-icon-roundclose", + "uncode": "e65c" + }, + { + "cls": "dtree-icon-bianji", + "uncode": "e602" + }, + { + "cls": "dtree-icon-roundadd", + "uncode": "e6d9" + }, + { + "cls": "dtree-icon-fuxuankuangxuanzhong", + "uncode": "e652" + }, + { + "cls": "dtree-icon-fuxuankuang", + "uncode": "e6f2" + }, + { + "cls": "dtree-icon-fuxuankuang-banxuan", + "uncode": "e607" + }, + { + "cls": "dtree-icon-search_list_light", + "uncode": "e807" + }, + { + "cls": "dtree-icon-move-up", + "uncode": "ea47" + }, + { + "cls": "dtree-icon-move-down", + "uncode": "ea48" + }, + { + "cls": "dtree-icon-delete1", + "uncode": "e640" + }, + { + "cls": "dtree-icon-refresh", + "uncode": "e6a4" + }, + { + "cls": "dtree-icon-jian1", + "uncode": "e600" + }, + { + "cls": "dtree-icon-jia1", + "uncode": "e601" + }, + { + "cls": "dtree-icon-shijian", + "uncode": "e606" + }, + { + "cls": "dtree-icon-check", + "uncode": "e645" + }, + { + "cls": "dtree-icon-close", + "uncode": "e646" + }, + { + "cls": "dtree-icon-favorfill", + "uncode": "e64b" + }, + { + "cls": "dtree-icon-favor", + "uncode": "e64c" + }, + { + "cls": "dtree-icon-roundcheckfill", + "uncode": "e659" + }, + { + "cls": "dtree-icon-roundcheck", + "uncode": "e65a" + }, + { + "cls": "dtree-icon-roundclosefill", + "uncode": "e65b" + }, + { + "cls": "dtree-icon-roundrightfill", + "uncode": "e65d" + }, + { + "cls": "dtree-icon-roundright", + "uncode": "e65e" + }, + { + "cls": "dtree-icon-samefill", + "uncode": "e671" + }, + { + "cls": "dtree-icon-same", + "uncode": "e672" + }, + { + "cls": "dtree-icon-pulldown", + "uncode": "e6a0" + }, + { + "cls": "dtree-icon-pullup", + "uncode": "e6a1" + }, + { + "cls": "dtree-icon-qrcode1", + "uncode": "e6b0" + }, + { + "cls": "dtree-icon-profile1", + "uncode": "e6b7" + }, + { + "cls": "dtree-icon-home1", + "uncode": "e6b8" + }, + { + "cls": "dtree-icon-homefill", + "uncode": "e6bb" + }, + { + "cls": "dtree-icon-roundaddfill", + "uncode": "e6d8" + }, + { + "cls": "dtree-icon-wefill", + "uncode": "e6f5" + }, + { + "cls": "dtree-icon-sort", + "uncode": "e701" + }, + { + "cls": "dtree-icon-round_list_light", + "uncode": "e82b" + }, + { + "cls": "dtree-icon-search2", + "uncode": "e615" + }, + { + "cls": "dtree-icon-set-sm", + "uncode": "e621" + }, + { + "cls": "dtree-icon-close1", + "uncode": "1006" + }, + { + "cls": "dtree-icon-close-fill", + "uncode": "1007" + }, + { + "cls": "dtree-icon-chart-screen", + "uncode": "e62a" + }, + { + "cls": "dtree-icon-star", + "uncode": "e608" + }, + { + "cls": "dtree-icon-ok-circle", + "uncode": "1005" + }, + { + "cls": "dtree-icon-add-circle", + "uncode": "e61f" + }, + { + "cls": "dtree-icon-about", + "uncode": "e623" + }, + { + "cls": "dtree-icon-circle1", + "uncode": "e687" + }, + { + "cls": "dtree-icon-radio", + "uncode": "e688" + }, + { + "cls": "dtree-icon-star-fill", + "uncode": "e832" + }, + { + "cls": "dtree-icon-rate", + "uncode": "e833" + }, + { + "cls": "dtree-icon-shujudaping", + "uncode": "e742" + }, + { + "cls": "dtree-icon-share3", + "uncode": "e641" + }, + { + "cls": "dtree-icon-youjian", + "uncode": "e642" + }, + { + "cls": "dtree-icon-repair", + "uncode": "e738" + }, + { + "cls": "dtree-icon-evaluate", + "uncode": "e674" + }, + { + "cls": "dtree-icon-like", + "uncode": "e66c" + }, + { + "cls": "dtree-icon-layim-theme", + "uncode": "e61b" + }, + { + "cls": "dtree-icon-xiangmuxiaoxi", + "uncode": "e60f" + } + ] +} \ No newline at end of file diff --git a/public/static/layui/plugin/employeepicker.js b/public/static/layui/plugin/employeepicker.js new file mode 100644 index 0000000..4ac2a72 --- /dev/null +++ b/public/static/layui/plugin/employeepicker.js @@ -0,0 +1,229 @@ +layui.define(['layer','dtree'],function(exports){ + //提示:模块也可以依赖其它模块,如:layui.define('layer', callback); + var layer = layui.layer; + var dtree = layui.dtree; + var opts={ + "title":'选择员工', + "type":1, + "ids":[], + "names":[], + "dids":[], + "departments":[], + "fixedid":0, + "callback": function(){} + }; + obj = { + render:function(){ + var me=this,letterTem=''; + for(var i=0;i<26;i++){ + letterTem+=''+String.fromCharCode(65+i)+''; + } + var tpl='
              \ +
              \ +
              \ +
              \ +
              ⇐ 点击左边部门筛选员工,或者点击下面字母筛选
              '+letterTem+'
              \ +
              \ +
              已选择全选
              \ +
              '+me.initSelect()+'
              \ +
              '; + return tpl; + }, + initSelect:function(){ + var me=this,select_tags=''; + if(me.settings.type == 0){ + select_tags+=''+me.settings.names+''; + } + else{ + for(var a=0;a'; + } + else{ + select_tags+=''+me.settings.names[a]+''; + } + } + } + return select_tags; + }, + init: function (options) { + this.settings = $.extend({}, opts, options); + var me=this; + layer.open({ + type:1, + title:me.settings.title, + area:['800px','500px'], + content:me.render(), + success:function(obj,idx){ + var dataList=[]; + $.ajax({ + url:me.settings.department_url, + type:'post', + success:function(res){ + dtree.render({ + elem: "#employeetree", + data: res.trees, + type: "all", + initLevel: "1", + icon: "2" //修改二级图标样式 + }); + dtree.on("node('employeetree')" ,function(obj){ + $('#letterBtn').find('span').removeClass('on'); + $.ajax({ + url:me.settings.employee_url, + type:'post', + data:{did:obj.param.nodeId}, + success:function(res){ + dataList=res.data; + if(dataList.length>2 && me.settings.type == 1){ + $('.layui-tags-all').show(); + } + else{ + $('.layui-tags-all').hide(); + } + if(dataList.length>0){ + var tagsItem=''; + for(var i=0; i'+dataList[i].nickname+''; + } + $('#employee').html(tagsItem); + }else{ + $('#employee').html('
              暂无员工
              '); + } + } + }) + }); + $('#letterBtn').on("click" ,'span',function(){ + var code=$(this).data('code'); + $(this).addClass('on').siblings().removeClass('on'); + $.ajax({ + url:me.settings.employee_url, + type:'post', + data:{id:1}, + success:function(res){ + dataList=res.data; + var letterData=[]; + if(dataList.length>0){ + var tagsItem=''; + for(var i=0; i'+dataList[i].nickname+''; + letterData.push(dataList[i]); + } + } + dataList=letterData; + if(dataList.length>2 && me.settings.type == 1){ + $('.layui-tags-all').show(); + } + else{ + $('.layui-tags-all').hide(); + } + if(tagsItem==''){ + tagsItem='
              暂无员工
              '; + } + $('#employee').html(tagsItem); + }else{ + $('#employee').html('
              暂无员工
              '); + } + } + }) + }); + } + }); + + if(me.settings.type == 1){ + $('.layui-tags-all').on('click',function(){ + var sIds = me.settings.ids.join(','); + var sNames = me.settings.names.join(','); + var sDids = me.settings.dids.join(','); + var sDepartments = me.settings.departments.join(','); + for(var a=0; a=0){ + return; + } + if(me.settings.type == 0){ + layer.close(idx); + me.settings.callback(item_id,item_name,item_did,item_department); + } + else{ + var sIds = me.settings.ids.join(',')+','+item_id; + var sNames = me.settings.names.join(',')+','+item_name; + var sDids = me.settings.dids.join(',')+','+item_did; + var sDepartments = me.settings.departments.join(',')+','+item_department; + if(me.settings.ids.length==0){ + sIds=item_id; + sNames=item_name; + sDids=item_did; + sDepartments=item_department; + } + me.settings.ids=sIds.split(','); + me.settings.names=sNames.split(','); + me.settings.dids=sDids.split(','); + me.settings.departments=sDepartments.split(','); + $('#selectTags').html(me.initSelect()); + } + }); + + $('#selectTags').on('click','.layui-tags-close',function(){ + var index=$(this).data('index'); + var newIds=[],newNames=[],newDids=[],newDepartments=[]; + for(var i=0;i>>0;if(t){n=t}i=new Array(l);a=0;while(a>>0;if(typeof t!=="function"){throw new TypeError(t+" is not a function")}if(arguments.length>1){i=n}a=0;while(a>>0;if(typeof e!=="function"){throw new TypeError}var i=[];var a=arguments[1];for(var r=0;r','',""];var u=Q('
              \n\t\t\t\t\t\n\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t\t\t"+f.join("")+'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t
              \n\t\t\t\t\t
              '+d+"
              \n\t\t\t\t
              ");var p=Q('
              ');p.append(u);n.after(p);n.attr("lay-ignore","");n.removeAttr("name")&&n.attr("_name",s.config.formname);n.removeAttr("lay-verify")&&n.attr("_lay-verify",s.config.layverify);if(s.config.isSearch){Y[i]=Q.extend({},X,{searchUrl:s.config.searchUrl},Y[i]);Q(document).on("input","div."+m+'[FS_ID="'+i+'"] .'+y,function(e){h.search(i,e,s.config.searchUrl)});if(s.config.searchUrl){h.triggerSearch(u,true)}}else{u.find("dl dd."+W).css("display","none")}})};o.prototype.search=function(a,e,t,n){var r=this;var i=void 0;if(n){i=n}else{i=e.target;var l=e.keyCode;if(l===9||l===13||l===37||l===38||l===39||l===40){return false}}var o=Q.trim(i.value);this.changePlaceHolder(Q(i));var s=Y[a]?Y[a]:X;t=s.searchUrl||t;var d=q[a],c=d.config.isCreate,f=Q('dl[xid="'+a+'"]').parents("."+P);if(t){if(s.searchVal){o=s.searchVal;s.searchVal=""}if(!s.beforeSearch||s.beforeSearch&&s.beforeSearch instanceof Function&&s.beforeSearch(a,t,o)){var u=s.delay;if(s.first){s.first=false;u=10}clearTimeout(d.clearid);d.clearid=setTimeout(function(){f.find("dl > *:not(."+J+")").remove();f.find("dd."+V).addClass(U).text("请求中");r.ajax(a,t,o,false,null,true)},u)}}else{f.find("dl ."+h).removeClass(h);f.find("dl dd:not(."+J+")").each(function(e,t){var n=Q(t);var i=z.filter[a]||q[a].config.filter;if(i&&i(a,o,r.getItem(a,n),n.hasClass(E))==true){n.addClass(h)}});f.find("dl dt").each(function(e,t){if(!Q(t).nextUntil("dt",":not(."+h+")").length){Q(t).addClass(h)}});this.create(a,c,o);var p=f.find("dl dd:not(."+J+"):not(."+h+")");if(!p.length){f.find("dd."+V).addClass(U).text("无匹配项")}else{f.find("dd."+V).removeClass(U)}}};o.prototype.isArray=function(e){return Object.prototype.toString.call(e)=="[object Array]"};o.prototype.triggerSearch=function(e,i){var a=this;(e?[e]:Q("."+P).toArray()).forEach(function(e,t){e=Q(e);var n=e.find("dl").attr("xid");if(n&&q[n]&&q[n].config.isEmpty||i){a.search(n,null,null,q[n].config.searchType==0?e.find("."+x+" ."+y):e.find("dl ."+W+" ."+y))}})};o.prototype.clearInput=function(e){var t=Q("."+m+'[fs_id="'+e+'"]');var n=q[e].config.searchType==0?t.find("."+x+" ."+y):t.find("dl ."+W+" ."+y);n.val("")};o.prototype.ajax=function(i,a,r,l,o,s,d,c){var f=this;var u=Q("."+m+' dl[xid="'+i+'"]').parents("."+P);if(!u[0]||!a){return}var p=Y[i]?Y[i]:X;var e=Q.extend(true,{},p.data);e[p.searchName]=r;Q.ajax({type:p.type,headers:p.header,url:a,data:p.dataType=="json"?JSON.stringify(e):e,success:function e(t){if(typeof t=="string"){t=JSON.parse(t)}p.beforeSuccess&&p.beforeSuccess instanceof Function&&(t=p.beforeSuccess(i,a,r,t));if(f.isArray(t)){var n={};n[p.response.statusName]=p.response.statusCode;n[p.response.msgName]="";n[p.response.dataName]=t;t=n}if(t[p.response.statusName]!=p.response.statusCode){u.find("dd."+V).addClass(U).text(t[p.response.msgName])}else{u.find("dd."+V).removeClass(U);f.renderData(i,t[p.response.dataName],l,o,s,c);q[i].config.isEmpty=t[p.response.dataName].length==0}d&&d(i);p.success&&p.success instanceof Function&&p.success(i,a,r,t)},error:function e(t){u.find("dd[lay-value]:not(."+J+")").remove();u.find("dd."+V).addClass(U).text("服务异常");p.error&&p.error instanceof Function&&p.error(i,a,r,t)}})};o.prototype.renderData=function(n,e,t,i,a,r){var l=this;if(t){this.renderLinkage(n,e,i);return}if(r){this.renderReplace(n,e);return}var o=Q("."+m+' dl[xid="'+n+'"]').parents("."+P);var s=Y[n]?Y[n]:X;var d=o.find("."+g+" input");e=this.exchangeData(n,e);var c=[];o.find("dl").html(this.renderSelect(n,d.attr("placeholder")||d.attr("back"),e.map(function(e){var t=Q.extend({},e,{innerHTML:e[s.keyName],value:e[s.keyVal],sel:e[s.keySel],disabled:e[s.keyDis],type:e.type,name:e[s.keyName]});if(t.sel){c.push(t)}return t})));var f=o.find("."+x);var u=o.find("dl[xid]");if(a){var p=q[n].values;p.forEach(function(e,t){u.find('dd[lay-value="'+e.value+'"]').addClass(w)});c.forEach(function(e,t){if(l.indexOf(p,e)==-1){l.addLabel(n,f,e);u.find('dd[lay-value="'+e.value+'"]').addClass(w);p.push(e)}})}else{c.forEach(function(e,t){l.addLabel(n,f,e);u.find('dd[lay-value="'+e.value+'"]').addClass(w)});q[n].values=c}this.commonHandler(n,f)};o.prototype.renderLinkage=function(l,e,n){var i=[],a=0,o={0:e},s=Y[l]?Y[l]:X;G[l]={};var t=function e(){var r=i[a++]=[],t=o;o={};Q.each(t,function(a,e){Q.each(e,function(e,t){var n={pid:a,name:t[s.keyName],value:t[s.keyVal]};G[l][n.value]=Q.extend(t,n);r.push(n);var i=t[s.keyChildren];if(i&&i.length){o[n.value]=i}})})};do{t()}while(Object.getOwnPropertyNames(o).length);var r=Q("."+m+' dl[xid="'+l+'"]').parents("."+P);var d=['
              '];Q.each(i,function(e,t){var i=['
              '];Q.each(t,function(e,t){var n='
            • '+t.name+"
            • ";i.push(n)});i.push("
              ");d=d.concat(i)});d.push('
              ');d.push("
              ");r.find("dl").html(d.join(""));r.find("."+y).css("display","none")};o.prototype.renderReplace=function(n,e){var i=this;var t=Q("."+m+' dl[xid="'+n+'"]');var a=Y[n]?Y[n]:X;e=this.exchangeData(n,e);G[n]=e;var r=e.map(function(e){var t=Q.extend({},e,{innerHTML:e[a.keyName],value:e[a.keyVal],sel:e[a.keySel],disabled:e[a.keyDis],type:e.type,name:e[a.keyName]});return i.createDD(n,t)}).join("");t.find("dd:not(."+J+"),dt:not([style])").remove();t.find("dt[style]").after(Q(r))};o.prototype.exchangeData=function(e,t){var n=Y[e]?Y[e]:X;var i=n["keyChildren"];var a=n["keyDis"];G[e]={};var r=this.getChildrenList(t,i,a,[],false);return r};o.prototype.getChildrenList=function(e,t,n,i,a){var r=[],l=0;for(var o=0;o\n\t\t\t\t\t
              \n\t\t\t\t\t\t\n\t\t\t\t\t\t'+r+"\n\t\t\t\t\t
              \n\t\t\t\t"};o.prototype.createQuickBtn=function(e,t){return'
              '+e.name+"
              "};o.prototype.renderBtns=function(e,t,n){var i=this;var a=[];var r=Q('dl[xid="'+e+'"]');a.push('
              ');Q.each(q[e].config.btns,function(e,t){a.push(i.createQuickBtn(t,n))});a.push("
              ");a.push(this.createQuickBtn({icon:"xm-iconfont icon-caidan",name:""}));return a.join("")};o.prototype.renderSelect=function(n,e,t){var i=this;G[n]={};var a=[];if(q[n].config.btns.length){setTimeout(function(){var e=Q('dl[xid="'+n+'"]');e.parents("."+P).attr(b,q[n].config.searchType);e.find("."+l).css("max-width",e.prev().width()-54+"px")},10);a.push(['
              ',this.renderBtns(n,null,"30px"),"
              ",'
              ','','',"
              "].join(""))}else{a.push('
              '+e+"
              ")}if(this.isArray(t)){Q(t).each(function(e,t){if(t){if(t.type&&t.type==="optgroup"){a.push("
              "+t.name+"
              ")}else{a.push(i.createDD(n,t))}}})}else{Q(t).find("*").each(function(e,t){if(t.tagName.toLowerCase()=="option"&&e==0&&!t.value){return}if(t.tagName.toLowerCase()==="optgroup"){a.push("
              "+t.label+"
              ")}else{a.push(i.createDD(n,t))}})}a.push('
              ');a.push('
              没有选项
              ');return a.join("")};o.prototype.on=function(){var n=this;this.one();Q(document).on("click",function(e){if(!Q(e.target).parents("."+I)[0]){Q("."+m+" dl ."+h).removeClass(h);Q("."+m+" dl dd."+U).removeClass(U);Q("."+m+" dl dd."+p).remove();Q.each(q,function(e,t){n.clearInput(e);if(!t.values.length){n.changePlaceHolder(Q('div[FS_ID="'+e+'"] .'+x))}})}Q("."+m+" ."+f).each(function(e,t){n.changeShow(Q(t).find("."+I),false)})})};o.prototype.calcLabelLeft=function(e,t,n){var i=this.getPosition(e[0]);i.y=i.x+e[0].clientWidth;var a=e[0].offsetLeft;if(!e.find("span").length){a=0}else if(n){var r=e.find("span:last");r.css("display")=="none"?r=r.prev()[0]:r=r[0];var l=this.getPosition(r);l.y=l.x+r.clientWidth;if(l.y>i.y){a=a-(l.y-i.y)-5}else{a=0}}else{if(t<0){var o=e.find(":last");o.css("display")=="none"?o=o.prev()[0]:o=o[0];var s=this.getPosition(o);s.y=s.x+o.clientWidth;if(s.y>i.y){a-=10}}else{if(a<0){a+=10}if(a>0){a=0}}}e.css("left",a+"px")};o.prototype.one=function(e){var C=this;Q(e?e:document).off("click","."+I).on("click","."+I,function(e){var t=Q(e.target),n=t.is(I)?t:t.parents("."+I),i=n.next(),a=i.attr("xid");Q("dl[xid]").not(i).each(function(e,t){C.clearInput(Q(t).attr("xid"))});Q("dl[xid]").not(i).find("dd."+h).removeClass(h);if(n.hasClass(N)){return false}if(t.is("."+O)||t.is("."+y+"[readonly]")){C.changeShow(n,!n.parents("."+P).hasClass(f));return false}if(n.find("."+y+":not(readonly)")[0]){var r=n.find("."+y),l={x:e.pageX,y:e.pageY},o=C.getPosition(n[0]),s=n.width();while(l.x>o.x){if(Q(document.elementFromPoint(l.x,l.y)).is(r)){r.focus();C.changeShow(n,true);return false}l.x-=50}}if(t.is("."+y)){C.changeShow(n,true);return false}if(t.is('i[fsw="'+v+'"]')){var d=C.getItem(a,t),c=i.find("dd[lay-value='"+d.value+"']");if(c.hasClass(E)){return false}C.handlerLabel(a,c,false,d);return false}C.changeShow(n,!n.parents("."+P).hasClass(f));return false});Q(e?e:document).off("click","dl."+F).on("click","dl."+F,function(e){var t=Q(e.target);if(t.is("."+H)||t.parents("."+H)[0]){t=t.is("li")?t:t.parents("li[xm-value]");var n=t.parents(".xm-select-linkage-group"),i=t.parents("dl").attr("xid");if(!i){return false}n.find(".xm-select-active").removeClass("xm-select-active");t.addClass("xm-select-active");n.nextAll(".xm-select-linkage-group").addClass("xm-select-linkage-hide");var a=n.next(".xm-select-linkage-group");a.find("li").addClass("xm-select-linkage-hide");a.find('li[pid="'+t.attr("xm-value")+'"]').removeClass("xm-select-linkage-hide");if(!a[0]||a.find("li:not(.xm-select-linkage-hide)").length==0){var r=[],l=0,o=!t.hasClass("xm-select-this");if(q[i].config.radio){t.parents(".xm-select-linkage").find(".xm-select-this").removeClass("xm-select-this")}do{r[l++]={name:t.find("span").text(),value:t.attr("xm-value")};t=t.parents(".xm-select-linkage-group").prev().find('li[xm-value="'+t.attr("pid")+'"]')}while(t.length);r.reverse();var s={name:r.map(function(e){return e.name}).join("/"),value:r.map(function(e){return e.value}).join("/")};C.handlerLabel(i,null,o,s)}else{a.removeClass("xm-select-linkage-hide")}return false}if(t.is("dl")){return false}if(t.is("dt")){t.nextUntil("dt").each(function(e,t){t=Q(t);if(t.hasClass(E)||t.hasClass(w)){}else{t.find("i:not(.icon-expand)").click()}});return false}var d=t.is("dd")?t:t.parents("dd");var c=d.parent("dl").attr("xid");if(d.hasClass(E)){return false}if(t.is("i.icon-caidan")){var f=[],u=[];t.parents("dl").find('dd[tree-folder="true"]').each(function(e,t){Q(t).attr("xm-tree-hidn")==undefined?f.push(t):u.push(t)});var p=u.length?u:f;p.forEach(function(e){return e.click()});return false}var h=d.attr("tree-id");if(h){if(t.is("i:not(.icon-expand)")){C.handlerLabel(c,d,!d.hasClass(w));return false}var v=Y[c]||X;var m=v.tree;var y=d.nextAll('dd[tree-id^="'+h+'"]');if(y&&y.length){var g=y[0].clientHeight;g?(C.addTreeHeight(d,g),g=0):(g=d.attr("xm-tree-hidn")||36,d.removeAttr("xm-tree-hidn"),d.find(">i").remove(),y=y.filter(function(e,t){return Q(t).attr("tree-id").split("-").length-1==h.split("-").length}));y.animate({height:g},150);return false}else{if(m.nextClick&&m.nextClick instanceof Function){m.nextClick(c,C.getItem(c,d),function(e){if(!e||!e.length){C.handlerLabel(c,d,!d.hasClass(w))}else{d.attr("tree-folder","true");var n=[];e.forEach(function(e,t){e.innerHTML=e[v.keyName];e[B]=JSON.stringify(h.split("-").concat([t]));n.push(C.createDD(c,e));G[c][e[v.keyVal]]=e});d.after(n.join(""))}});return false}}}if(d.hasClass(J)){var x=t.is("."+R)?t:t.parents("."+R);if(!x[0]){return false}var k=x.attr("method");var b=q[c].config.btns.filter(function(e){return e.name==k})[0];b&&b.click&&b.click instanceof Function&&b.click(c,C);return false}C.handlerLabel(c,d,!d.hasClass(w));return false})};o.prototype.addTreeHeight=function(e,i){var a=this;var t=e.attr("tree-id");var n=e.nextAll('dd[tree-id^="'+t+'"]');if(n.length){e.append('');e.attr("xm-tree-hidn",i);n.each(function(e,t){var n=Q(t);a.addTreeHeight(n,i)})}};var G={};o.prototype.getItem=function(e,t){if(t instanceof Q){if(t.is('i[fsw="'+v+'"]')){var n=t.parent();return G[e][t]||{name:n.find("font").text(),value:n.attr("value")}}var i=t.attr("lay-value");return!G[e][i]?G[e][i]={name:t.find("span[name]").attr("name"),value:i}:G[e][i]}else if(typeof t=="string"&&t.indexOf("/")!=-1){return G[e][t]||{name:this.valToName(e,t),value:t}}return G[e][t]};o.prototype.linkageAdd=function(e,t){var n=Q('dl[xid="'+e+'"]');n.find(".xm-select-active").removeClass("xm-select-active");var i=t.value.split("/");var a=void 0,r=void 0,l=0;var o=[];do{a=i[l];r=n.find(".xm-select-linkage-group"+(l+1)+' li[xm-value="'+a+'"]');r[0]&&o.push(r);l++}while(r.length&&a!=undefined);if(o.length==i.length){Q.each(o,function(e,t){t.addClass("xm-select-this")})}};o.prototype.linkageDel=function(e,t){var n=Q('dl[xid="'+e+'"]');var i=t.value.split("/");var a=void 0,r=void 0,l=i.length-1;do{a=i[l];r=n.find(".xm-select-linkage-group"+(l+1)+' li[xm-value="'+a+'"]');if(!r.parent().next().find("li[pid="+a+"].xm-select-this").length){r.removeClass("xm-select-this")}l--}while(r.length&&a!=undefined)};o.prototype.valToName=function(e,t){var i=Q('dl[xid="'+e+'"]');var n=(t+"").split("/");if(!n.length){return null}var a=[];Q.each(n,function(e,t){var n=i.find(".xm-select-linkage-group"+(e+1)+' li[xm-value="'+t+'"] span').text();a.push(n)});return a.length==n.length?a.join("/"):null};o.prototype.commonHandler=function(e,t){if(!t||!t[0]){return}this.checkHideSpan(e,t);this.changePlaceHolder(t);this.retop(t.parents("."+P));this.calcLabelLeft(t,0,true);this.setHidnVal(e,t);t.parents("."+I+" ."+v).attr("title",q[e].values.map(function(e){return e.name}).join(","))};o.prototype.initVal=function(e){var o=this;var t={};if(e){t[e]=q[e]}else{t=q}Q.each(t,function(n,e){var t=e.values,i=Q('dl[xid="'+n+'"]').parent(),a=i.find("."+x),r=i.find("dl");r.find("dd."+w).removeClass(w);var l=t.concat([]);l.concat([]).forEach(function(e,t){o.addLabel(n,a,e);r.find('dd[lay-value="'+e.value+'"]').addClass(w)});if(e.config.radio){l.length&&t.push(l[l.length-1])}o.commonHandler(n,a)})};o.prototype.setHidnVal=function(e,t){if(!t||!t[0]){return}t.parents("."+m).find("."+_).val(q[e].values.map(function(e){return e.value}).join(","))};o.prototype.handlerLabel=function(e,t,n,i,a){var r=Q('[xid="'+e+'"]').prev().find("."+x),l=t&&this.getItem(e,t),o=q[e].values,s=q[e].config.on||z.on[e],d=q[e].config.endOn||z.endOn[e];if(i){l=i}var c=q[e];if(n&&c.config.max&&c.values.length>=c.config.max){var f=z.maxTips[e]||q[e].config.maxTips;f&&f(e,o.concat([]),l,c.config.max);return}if(!a){if(s&&s instanceof Function&&s(e,o.concat([]),l,n,t&&t.hasClass(E))==false){return}}var u=Q('dl[xid="'+e+'"]');n?(t&&t[0]?(t.addClass(w),t.removeClass(p)):u.find(".xm-select-linkage")[0]&&this.linkageAdd(e,l),this.addLabel(e,r,l),o.push(l)):(t&&t[0]?t.removeClass(w):u.find(".xm-select-linkage")[0]&&this.linkageDel(e,l),this.delLabel(e,r,l),this.remove(o,l));if(!r[0])return;if(c.config.radio){this.changeShow(r,false)}r.parents("."+I).prev().removeClass("layui-form-danger");c.config.clearInput&&this.clearInput(e);this.commonHandler(e,r);!a&&d&&d instanceof Function&&d(e,o.concat([]),l,n,t&&t.hasClass(E))};o.prototype.addLabel=function(e,t,n){if(!n)return;var i='fsw="'+v+'"';var a=[Q(""+n.name+""),Q("')],r=a[0],l=a[1];r.append(l);var o=q[e];if(o.config.radio){o.values.length=0;Q('dl[xid="'+e+'"]').find("dd."+w+':not([lay-value="'+n.value+'"])').removeClass(w);t.find("span").remove()}t.find("input").css("width","50px");t.find("input").before(r)};o.prototype.delLabel=function(e,t,n){if(!n)return;t.find('span[value="'+n.value+'"]:first').remove()};o.prototype.checkHideSpan=function(e,t){var n=t.parents("."+v)[0].offsetHeight+5;t.find("span.xm-span-hide").removeClass("xm-span-hide");t.find("span[style]").remove();var i=q[e].config.showCount;t.find("span").each(function(e,t){if(e>=i){Q(t).addClass("xm-span-hide")}});var a=t.find("span:eq("+i+")");a[0]&&a.before(Q(' + '+(t.find("span").length-i)+""))};o.prototype.retop=function(e){var t=e.find("dl"),n=e.offset().top+e.outerHeight()+5-c.scrollTop(),i=t.outerHeight();var a=e.hasClass("layui-form-selectup")||t.css("top").indexOf("-")!=-1||n+i>c.height()&&n>=i;e=e.find("."+v);var r=q[t.attr("xid")];var l=t.parents(".layui-form-pane")[0]&&t.prev()[0].clientHeight>38?14:10;if(r&&r.config.direction=="up"||a){a=true;if(r&&r.config.direction=="down"){a=false}}var o=e[0].offsetTop+e.height()+l;if(a){t.css({top:"auto",bottom:o+3+"px"})}else{t.css({top:o+"px",bottom:"auto"})}};o.prototype.changeShow=function(e,t){Q(".layui-form-selected").removeClass("layui-form-selected");var n=e.parents("."+P),i=n.hasClass(f),a=n.find("dl").attr("xid");Q("."+m+" ."+P).not(n).removeClass(f);if(t){this.retop(n);n.addClass(f);n.find("."+y).focus();if(!n.find("dl dd[lay-value]:not(."+J+")").length){n.find("dl ."+V).addClass(U)}}else{n.removeClass(f);this.clearInput(a);n.find("dl ."+U).removeClass(U);n.find("dl dd."+h).removeClass(h);n.find("dl dd."+p).remove();if(a&&q[a]&&q[a].config.isEmpty){this.triggerSearch(n)}this.changePlaceHolder(n.find("."+x))}if(t!=i){var r=q[a].config.opened||z.opened[a];t&&r&&r instanceof Function&&r(a);var l=q[a].config.closed||z.closed[a];!t&&l&&l instanceof Function&&l(a)}};o.prototype.changePlaceHolder=function(e){var t=e.parents("."+I);t[0]||(t=e.parents("dl").prev());if(!t[0]){return}var n=e.parents("."+m).find("dl[xid]").attr("xid");if(q[n]&&q[n].config.height){}else{var i=t.find("."+v)[0].clientHeight;t.css("height",(i>36?i+4:i)+"px");var a=t.parents("."+m).parent().prev();if(a.is(".layui-form-label")&&t.parents(".layui-form-pane")[0]){i=i>36?i+4:i;t.css("height",i+"px");a.css({height:i+2+"px",lineHeight:i-18+"px"})}}var r=t.find("."+g+" input"),l=!e.find("span:last")[0]&&!t.find("."+y).val();if(l){var o=r.attr("back");r.removeAttr("back");r.attr("placeholder",o)}else{var s=r.attr("placeholder");r.removeAttr("placeholder");r.attr("back",s)}};o.prototype.indexOf=function(e,t){for(var n=0;n-1){e.splice(n,1);return true}return false};o.prototype.selectAll=function(i,a,e){var r=this;var l=Q('[xid="'+i+'"]');if(!l[0]){return}if(l.find(".xm-select-linkage")[0]){return}l.find("dd[lay-value]:not(."+J+"):not(."+w+")"+(e?":not(."+E+")":"")).each(function(e,t){t=Q(t);var n=r.getItem(i,t);r.handlerLabel(i,l.find('dd[lay-value="'+n.value+'"]'),true,n,!a)})};o.prototype.removeAll=function(n,i,a){var r=this;var l=Q('[xid="'+n+'"]');if(!l[0]){return}if(l.find(".xm-select-linkage")[0]){q[n].values.concat([]).forEach(function(e,t){var n=e.value.split("/");var i=void 0,a=void 0,r=0;do{i=n[r++];a=l.find(".xm-select-linkage-group"+r+':not(.xm-select-linkage-hide) li[xm-value="'+i+'"]');a.click()}while(a.length&&i!=undefined)});return}q[n].values.concat([]).forEach(function(e,t){if(a&&l.find('dd[lay-value="'+e.value+'"]').hasClass(E)){}else{r.handlerLabel(n,l.find('dd[lay-value="'+e.value+'"]'),false,e,!i)}})};o.prototype.reverse=function(i,a,e){var r=this;var l=Q('[xid="'+i+'"]');if(!l[0]){return}if(l.find(".xm-select-linkage")[0]){return}l.find("dd[lay-value]:not(."+J+")"+(e?":not(."+E+")":"")).each(function(e,t){t=Q(t);var n=r.getItem(i,t);r.handlerLabel(i,l.find('dd[lay-value="'+n.value+'"]'),!t.hasClass(w),n,!a)})};o.prototype.skin=function(e){var t=["default","primary","normal","warm","danger"];var n=t[Math.floor(Math.random()*t.length)];Q('dl[xid="'+e+'"]').parents("."+m).find("."+P).attr("xm-select-skin",n);this.check(e)&&this.commonHandler(e,Q('dl[xid="'+e+'"]').parents("."+m).find("."+x))};o.prototype.getPosition=function(e){var t=0,n=0;while(e!=null){t+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}return{x:t,y:n}};o.prototype.onreset=function(){Q(document).on("click","[type=reset]",function(e){Q(e.target).parents("form").find("."+m+" dl[xid]").each(function(e,t){var n=t.getAttribute("xid"),i=Q(t),a=void 0,r={};K.removeAll(n);q[n].config.init.forEach(function(e,t){if(e&&(!r[e]||q[n].config.repeat)&&(a=i.find('dd[lay-value="'+e.value+'"]'))[0]){K.handlerLabel(n,a,true);r[e]=1}})})})};o.prototype.bindEvent=function(n,e,i){if(e&&e instanceof Function){i=e;e=null}if(i&&i instanceof Function){if(!e){Q.each(q,function(e,t){q[e]?q[e].config[n]=i:z[n][e]=i})}else{q[e]?(q[e].config[n]=i,delete z[n][e]):z[n][e]=i}}};o.prototype.check=function(e,t){if(Q('dl[xid="'+e+'"]').length){return true}else if(Q('select[xm-select="'+e+'"]').length){if(!t){this.render(e,Q('select[xm-select="'+e+'"]'));return true}}else{delete q[e];return false}};o.prototype.render=function(e,t){K.init(t);K.one(Q('dl[xid="'+e+'"]').parents("."+m));K.initVal(e)};o.prototype.log=function(e){console.log(e)};var u=function e(){this.v=t;this.render()};var K=new o;u.prototype.value=function(i,e,t){if(typeof i!="string"){return[]}var a=q[i];if(!K.check(i)){return[]}if(typeof e=="string"||e==undefined){var n=a.values.concat([])||[];if(e=="val"){return n.map(function(e){return e.value})}if(e=="valStr"){return n.map(function(e){return e.value}).join(",")}if(e=="name"){return n.map(function(e){return e.name})}if(e=="nameStr"){return n.map(function(e){return e.name}).join(",")}return n}if(K.isArray(e)){var r=Q('[xid="'+i+'"]'),l={},o=void 0,s=true;if(t==false){s=false}else if(t==true){s=true}else{K.removeAll(i)}if(s){a.values.forEach(function(e,t){l[e.value]=1})}e.forEach(function(e,t){if(e&&(!l[e]||a.config.repeat)){if((o=r.find('dd[lay-value="'+e+'"]'))[0]){K.handlerLabel(i,o,s,null,true);l[e]=1}else{var n=K.valToName(i,e);if(n){K.handlerLabel(i,o,s,K.getItem(i,e),true);l[e]=1}}}})}};u.prototype.on=function(e,t,n){K.bindEvent(n?"endOn":"on",e,t);return this};u.prototype.filter=function(e,t){K.bindEvent("filter",e,t);return this};u.prototype.maxTips=function(e,t){K.bindEvent("maxTips",e,t);return this};u.prototype.opened=function(e,t){K.bindEvent("opened",e,t);return this};u.prototype.closed=function(e,t){K.bindEvent("closed",e,t);return this};u.prototype.config=function(e,n,t){if(e&&(typeof e==="undefined"?"undefined":_typeof(e))=="object"){t=n==true;n=e;e=null}if(n&&(typeof n==="undefined"?"undefined":_typeof(n))=="object"){if(t){n.header||(n.header={});n.header["Content-Type"]="application/json; charset=UTF-8";n.dataType="json"}e?(Y[e]=Q.extend(true,{},Y[e]||X,n),!K.check(e)&&this.render(e),q[e]&&n.direction&&(q[e].config.direction=n.direction),q[e]&&n.clearInput&&(q[e].config.clearInput=true),n.searchUrl&&q[e]&&K.triggerSearch(Q("."+m+' dl[xid="'+e+'"]').parents("."+P),true)):(Q.extend(true,X,n),Q.each(Y,function(e,t){Q.extend(true,t,n)}))}return this};u.prototype.render=function(e,t){var n;if(e&&(typeof e==="undefined"?"undefined":_typeof(e))=="object"){t=e;e=null}var i=t?(n={init:t.init,disabled:t.disabled,max:t.max,isSearch:t.isSearch,searchUrl:t.searchUrl,isCreate:t.isCreate,radio:t.radio,skin:t.skin,direction:t.direction,height:t.height,formname:t.formname,layverify:t.layverify,layverType:t.layverType,showCount:t.showCount,placeholder:t.placeholder,create:t.create,filter:t.filter,maxTips:t.maxTips,on:t.on},_defineProperty(n,"on",t.on),_defineProperty(n,"opened",t.opened),_defineProperty(n,"closed",t.closed),_defineProperty(n,"template",t.template),_defineProperty(n,"clearInput",t.clearInput),n):{};t&&t.searchType!=undefined&&(i.searchType=t.searchType=="dl"?1:0);if(e){r[e]={};Q.extend(r[e],q[e]?q[e].config:{},i)}else{Q.extend(a,i)}(Q("select["+v+'="'+e+'"]')[0]?Q("select["+v+'="'+e+'"]'):Q("select["+v+"]")).each(function(e,t){var n=t.getAttribute(v);K.render(n,t);setTimeout(function(){return K.setHidnVal(n,Q('select[xm-select="'+n+'"] + div.'+m+" ."+x))},10)});return this};u.prototype.disabled=function(e){var t={};e?K.check(e)&&(t[e]=q[e]):t=q;Q.each(t,function(e,t){Q('dl[xid="'+e+'"]').prev().addClass(N)});return this};u.prototype.undisabled=function(e){var t={};e?K.check(e)&&(t[e]=q[e]):t=q;Q.each(t,function(e,t){Q('dl[xid="'+e+'"]').prev().removeClass(N)});return this};u.prototype.data=function(e,t,n){if(!e||!t||!n){K.log("id: "+e+" param error !!!");return this}if(!K.check(e)){K.log("id: "+e+" not render !!!");return this}this.value(e,[]);this.config(e,n);if(t=="local"){K.renderData(e,n.arr,n.linkage==true,n.linkageWidth?n.linkageWidth:"100")}else if(t=="server"){K.ajax(e,n.url,n.keyword,n.linkage==true,n.linkageWidth?n.linkageWidth:"100")}return this};u.prototype.btns=function(e,o,s){if(e&&K.isArray(e)){o=e;e=null}if(!o||!K.isArray(o)){return this}var t={};e?K.check(e)&&(t[e]=q[e]):t=q;o=o.map(function(e){if(typeof e=="string"){if(e=="select"){return i[0]}if(e=="remove"){return i[1]}if(e=="reverse"){return i[2]}if(e=="skin"){return i[3]}}return e});Q.each(t,function(e,t){t.config.btns=o;var n=Q('dl[xid="'+e+'"]').find("."+J+":first");if(o.length){var i=s&&s.show&&(s.show=="name"||s.show=="icon")?s.show:"";var a=K.renderBtns(e,i,s&&s.space?s.space:"30px");n.html(a)}else{var r=n.parents("."+P).find("."+g+" input");var l=r.attr("placeholder")||r.attr("back");n.html(l);n.removeAttr("style")}});return this};u.prototype.search=function(e,t){if(e&&K.check(e)){Y[e]=Q.extend(true,{},Y[e]||X,{first:true,searchVal:t});K.triggerSearch(Q('dl[xid="'+e+'"]').parents("."+P),true)}return this};u.prototype.replace=function(e,t,n){var i=this;if(!e||!t||!n){K.log("id: "+e+" param error !!!");return this}if(!K.check(e,true)){K.log("id: "+e+" not render !!!");return this}var a=this.value(e,"val");this.value(e,[]);this.config(e,n);if(t=="local"){K.renderData(e,n.arr,n.linkage==true,n.linkageWidth?n.linkageWidth:"100",false,true);this.value(e,a,true)}else if(t=="server"){K.ajax(e,n.url,n.keyword,n.linkage==true,n.linkageWidth?n.linkageWidth:"100",false,function(e){i.value(e,a,true)},true)}};return new u}); \ No newline at end of file diff --git a/public/static/layui/plugin/formSelects/formSelects-v3.js b/public/static/layui/plugin/formSelects/formSelects-v3.js new file mode 100644 index 0000000..276c381 --- /dev/null +++ b/public/static/layui/plugin/formSelects/formSelects-v3.js @@ -0,0 +1,954 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +/** + * name: formSelects + * 基于Layui Select多选 + * version: 3.0.9.0607 + * https://faysunshine.com/layui/template/formSelects-v3/formSelects-v3.js + */ +(function (layui, window, factory) { + if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') { + // 支持 CommonJS + module.exports = factory(); + } else if (typeof define === 'function' && define.amd) { + // 支持 AMD + define(factory); + } else if (window.layui && layui.define) { + //layui加载 + layui.define(['jquery', 'form'], function (exports) { + exports('formSelects', factory()); + }); + } else { + window.formSelects = factory(); + } +})(layui, window, function () { + //针对IE的一些处理 + if (window.Map == undefined) { + var _Map = function _Map() { + this.value = {}; + }; + + _Map.prototype.set = function (key, val) { + this.value[key] = val; + }; + + _Map.prototype.get = function (key) { + return this.value[key]; + }; + + _Map.prototype.has = function (key) { + return this.value.hasOwnProperty(key); + }; + + _Map.prototype.delete = function (key) { + delete this.value[key]; + }; + + window.Map = _Map; + } + + var $ = layui.jquery || $, + form = layui.form, + select3 = { + value: function value(name) { + var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all'; + var vals = arguments[2]; + + if (Array.isArray(type)) { + vals = type; + type = 'all'; + } + if (name && vals && Array.isArray(vals)) { + var options = commons.data.confs.get(name); + if (options) { + var dl = commons.methods.getDiv(options).find('dl'); + if (!options.repeat) { + var map = {}, + newVals = []; + vals.forEach(function (val) { + if (!map[val]) { + newVals.push(val); + map[val] = 1; + } + }); + vals = newVals; + } + var on = options.on; + options.on = null; + commons.methods.removeAll(options); + options.delete = false; + vals.forEach(function (val) { + dl.find('dd:not(.layui-disabled)[lay-value=\'' + val + '\']').click(); + }); + options.on = on; + } + return; + } + var arr = commons.data.values.get(name); + if (!arr) { + return vals; + } + if (type == 'val') { + return arr.map(function (val) { + return val.val; + }); + } + if (type == 'valStr') { + return arr.map(function (val) { + return val.val; + }).join(','); + } + if (type == 'name') { + return arr.map(function (val) { + return val.name; + }); + } + if (type == 'nameStr') { + return arr.map(function (val) { + return val.name; + }).join(','); + } + return arr; + }, + render: function render(options) { + if (options) { + if (commons.data.confs.get(options.name)) { + options = commons.methods.cloneOptions(options, commons.data.confs.get(options.name)); + commons.methods.init(options); + } else { + var dom = commons.methods.getDom(options, true); + if (dom.length) { + var hisOptions = commons.methods.cloneOptions(commons.methods.getOptions(dom), commons.data.DEFAULT_OPTIONS); + options = commons.methods.cloneOptions(options, hisOptions); + commons.methods.init(options); + } + } + } else { + commons.methods.autoInit(); + } + }, + delete: function _delete(name, abs) { + if (name && commons.data.confs.get(name)) { + var dom = commons.methods.getDom({ + name: name + }); + if (dom.parent().hasClass(commons.data.pclass)) { + if (abs) { + dom.removeAttr(commons.data.name); + } + dom.removeAttr('style'); + dom.parent()[0].outerHTML = dom[0].outerHTML; + } + commons.data.confs.delete(name); + for (var item in commons.data.temps) { + commons.data.temps[item].delete(name); + } + commons.data.values.delete(name); + } + }, + style: function style(name, colors) { + if (name) { + if (!colors) { + commons.methods.loadCss(name, null); + } else if (Array.isArray(colors)) { + commons.methods.loadCss(name, colors); + } else { + var arr = [colors.labelBgColor, colors.labelColor, colors.labelIconBgColor, colors.labelIconColor, colors.labelLabelBorderColor, colors.thisBgColor, colors.thisColor]; + commons.methods.loadCss(name, arr); + } + } + } + }, + commons = { + data: { + name: 'xm-select', + pclass: 'xm-select-parent', + vclass: 'xm-select-validate', + DEFAULT_OPTIONS: { + name: null, //xm-select="xxx" + type: 1, //显示模式, 1:layui-this, 2:checkbox, 3:icon + icon: { + class: 'layui-icon-ok', + text: '' + }, + max: null, + maxTips: null, + init: null, //初始化的选择值, + on: null, //select值发生变化 + data: null + }, + DEFAULT_RENDER: { + arr: null, + name: 'name', + val: 'val', + selected: 'selected', + disabled: 'disabled' + }, + confs: new Map(), + temps: { + dom: new Map(), + div: new Map() + }, + resize: new Map(), + values: new Map(), + times: new Map() + }, + methods: { + init: function init(options, clone) { + if (!clone) { + options = commons.methods.cloneOptions(options); + } + //原始dom添加一个filter + var _ref = ['xm-' + options.name, commons.methods.getDom(options, true)], + filter = _ref[0], + dom = _ref[1]; + + if (dom.next().hasClass('layui-form-select')) { + dom.next().remove(); + } + if (options.data && options.data.arr) { + var os = $.extend({}, commons.data.DEFAULT_RENDER, options.data); + var html = ''; + for (var i in os.arr) { + var db = os.arr[i]; + if (db.arr && Array.isArray(db.arr)) { + html += ''; + for (var j in db.arr) { + var gdb = db.arr[j]; + html += ''; + } + html += ''; + } else { + html += ''; + } + } + dom.html(html); + } + //判断dom中是否包含了空的option, 如果不包含, 添加 + if (!dom.find('option[value=""]').length) { + $('').insertBefore(dom.find('option:first')); + } + if (dom.parent().hasClass(commons.data.pclass)) { + dom.parent().attr('lay-filter', filter).addClass('layui-form'); + } else { + dom.wrap('
              '); + } + dom.attr('lay-filter', filter); + options.type ? dom.attr('xm-select-type', options.type) : dom.removeAttr('xm-select-type'); + options.max ? dom.attr('xm-select-max', options.max) : dom.removeAttr('xm-select-max'); + commons.methods.formRender('select', filter, true); + //1.去掉layui的原始渲染 + commons.methods.getDom(options).next().addClass(commons.data.vclass); + //2. + commons.data.confs.set(options.name, options); + for (var item in commons.data.temps) { + commons.data.temps[item].delete(options.name); + } + commons.data.values.delete(options.name); + //3.渲染input + commons.methods.overrideInput(options); + commons.methods.typeInit(options, filter); + //4.初始化init + var vals = commons.methods.getInitVal(options); + vals.forEach(function (val) { + commons.methods.valHandler(options, val, true); + }); + commons.methods.showPlaceholder(options); + commons.methods.retop(options); + commons.methods.removeDefaultClass(options); + commons.methods.on(options, filter); + }, + addLabel: function addLabel(options, vals) { + var ipt = commons.methods.getIpt(options); + ipt.find('.xm-select-empty').remove(); + vals.forEach(function (val) { + var tips = 'fsw="' + options.name + '"'; + var _ref2 = [$('' + val.name + ''), $('')], + $label = _ref2[0], + $close = _ref2[1]; + + $label.append($close); + ipt.append($label); + }); + }, + delLabel: function delLabel(options, vals) { + var ipt = commons.methods.getIpt(options); + vals.forEach(function (val) { + ipt.find('span[value=\'' + val.val + '\']:first').remove(); + }); + }, + showPlaceholder: function showPlaceholder(options) { + var vals = commons.methods.getValues(options); + if (!vals.length) { + var _ref3 = ['fsw="' + options.name + '"', commons.methods.getIpt(options)], + tips = _ref3[0], + ipt = _ref3[1]; + + if (!ipt.find('.xm-select-empty').length) { + var _tips = options.tips ? options.tips : ipt.prev().attr('placeholder'); + var cls = 'fsw="' + options.name + '"'; + var span = $('' + _tips + ''); + ipt.append(span); + } + } + }, + valHandler: function valHandler(options, val, isAdd, isShow) { + var vals = commons.methods.getValues(options); + var dd = commons.methods.getDiv(options).find('dl dd[lay-value=\'' + val.val + '\']'); + if (isAdd) { + if (!options.max || options.max && vals.length < options.max) { + vals.push(val); + commons.methods.addLabel(options, [val]); + commons.methods.typeHandler(options, dd, isAdd); + } else { + commons.methods.maxTips(options, val); + commons.methods.typeHandler(options, dd, false); + } + } else { + if (!dd.hasClass('layui-disabled')) { + commons.methods.remove(vals, val); + commons.methods.delLabel(options, [val]); + if (commons.methods.indexOf(vals, val) == -1) { + commons.methods.typeHandler(options, dd, isAdd); + } + } + } + commons.methods.retop(options); + }, + typeInit: function typeInit(options, filter) { + var div = commons.methods.getDiv(options); + if (options.type == 2) { + //checkbox + div.find('dl dd:not(.layui-select-tips)').each(function (index, target) { + var $target = $(target); + var text = $target.text(); + var dis = $target.hasClass('layui-disabled') ? 'disabled' : ''; + $target.text(''); + $target.append('\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'); + }); + form.render('checkbox', filter); + div.find('dl dd .layui-form-checkbox').css('margin-top', '1px'); + } else { + div.find('dl dd:not(.layui-select-tips)').each(function (index, target) { + $(target).css({ + margin: '1px 0' + }); + }); + } + }, + typeHandler: function typeHandler(options, dd, isAdd) { + if (options.type == 3) { + //对勾 + if (isAdd) { + var span = $('\n\t\t\t\t\t\t\t\t' + options.icon.text + '\t\n\t\t\t\t\t\t\t'); + dd.append(span); + } else { + dd.find('span').remove(); + } + } else if (options.type == 2) { + //checkbox + if (isAdd) { + dd.find('.layui-form-checkbox').addClass('layui-form-checked'); + } else { + dd.find('.layui-form-checkbox').removeClass('layui-form-checked'); + } + } + isAdd ? dd.addClass(commons.data.name + '-this') : dd.removeClass(commons.data.name + '-this'); + dd.removeClass('layui-this'); + commons.methods.showPlaceholder(options); + }, + on: function on(options, filter) { + form.on('select(' + filter + ')', function (data) { + if (options.radio) { + commons.methods.getDiv(options).find('dl').removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none'); + var selected = void 0, + val = void 0; + if (data.value) { + val = { + name: commons.methods.getDom(options).find('option[value=\'' + data.value + '\']').text(), + val: data.value + }; + selected = commons.methods.indexOf(commons.methods.getValues(options), val) == -1; + if (selected) { + var hisVal = select3.value(options.name)[0]; + if (hisVal) { + commons.methods.valHandler(options, hisVal, false, false); + commons.methods.setValues(options, []); + } + } + commons.methods.valHandler(options, val, selected, false); + } else { + selected = false; + val = select3.value(options.name)[0]; + if (val) { + commons.methods.valHandler(options, val, selected, false); + commons.methods.setValues(options, []); + } + } + if (val && options.on && options.on instanceof Function) { + options.on(data, select3.value(options.name), val, selected); + } + return; + } + if (commons.methods.getDiv(options).hasClass('layui-form-selectup') || commons.methods.getDiv(options).find('dl').css('top').indexOf('-') == 0) { + setTimeout(function () { + commons.methods.getDiv(options).addClass('layui-form-selectup'); + }, 50); + } + + if (options.repeat) { + if (data.value) { + var ipt = commons.methods.getIpt(options); + if (options.delete) { + var arr = select3.value(options.name); + var _val = arr[commons.methods.indexOf(arr, data.value)]; + if (_val) { + commons.methods.valHandler(options, _val, false); + ipt.parent().next().find('dd[lay-value=\'' + data.value + '\'] .layui-form-checkbox > i').html(''); + if (options.on && options.on instanceof Function) { + options.on(data, select3.value(options.name), _val, false); + } + } + options.delete = false; + return; + } else { + var vals = commons.methods.getValues(options); + var _val2 = { + name: commons.methods.getDom(options).find('option[value=\'' + data.value + '\']').text(), + val: data.value + }; + commons.methods.valHandler(options, _val2, true); + if (options.on && options.on instanceof Function) { + options.on(data, select3.value(options.name), _val2, true); + } + } + setTimeout(function () { + commons.methods.getDiv(options).addClass('layui-form-selected').find('dl dd.layui-this').removeClass('layui-this'); + }, 3); + return; + } + } + if (data.value) { + var _val3 = { + name: commons.methods.getDom(options).find('option[value=\'' + data.value + '\']').text(), + val: data.value + }; + var _selected = commons.methods.indexOf(commons.methods.getValues(options), _val3) == -1; + commons.methods.valHandler(options, _val3, _selected, true); + + if (options.on && options.on instanceof Function) { + options.on(data, select3.value(options.name), _val3, _selected); + } + + setTimeout(function () { + commons.methods.getDiv(options).addClass('layui-form-selected').find('dl dd.layui-this').removeClass('layui-this'); + }, 3); + } else { + if (commons.methods.getDom(options).attr('xm-select-search') == undefined) { + commons.methods.removeAll(options); + setTimeout(function () { + commons.methods.getDiv(options).addClass('layui-form-selected'); + }, 3); + } + } + }); + }, + maxTips: function maxTips(options, val) { + if (options.maxTips && options.maxTips instanceof Function) { + options.maxTips(select3.value(options.name), val, options.max); + return; + } + var ipt = commons.methods.getIpt(options); + if (ipt.parents('.layui-form-item[pane]').length) { + ipt = ipt.parents('.layui-form-item[pane]'); + } + ipt.css('border-color', 'red'); + setTimeout(function () { + ipt.css('border-color', '#e6e6e6'); + }, 300); + }, + indexOf: function indexOf(arr, val) { + for (var i = 0; i < arr.length; i++) { + if (arr[i].val == val || arr[i].val == (val ? val.val : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) { + return i; + } + } + return -1; + }, + remove: function remove(arr, val) { + var index = commons.methods.indexOf(arr, val ? val.val : val); + if (index > -1) { + arr.splice(index, 1); + return true; + } + return false; + }, + removeAll: function removeAll(options) { + var div = commons.methods.getDiv(options); + var vals = div.find('.xm-select > span'); + vals.each(function (index, item) { + options.delete = true; + div.find('dl dd.xm-select-this:not(.layui-disabled)[lay-value=\'' + item.getAttribute('value') + '\']').click(); + }); + return vals.length; + }, + removeDefaultClass: function removeDefaultClass(options) { + var _ref4 = [commons.methods.getDom(options), commons.methods.getDiv(options)], + dom = _ref4[0], + div = _ref4[1]; + + div.find('dl').addClass('xm-select-hidn'); + div.find('dl dd.layui-this').removeClass('layui-this'); + div.find('dl').append('
              x
              '); + var text = options.radio ? '请选择' : '清空已选择' + (options.max ? '. \u5F53\u524D\u914D\u7F6E: \u6700\u591A\u9009\u62E9 ' + options.max + ' \u4E2A' : ''); + var html = '' + text + ''; + var that = div.find('dl dd.layui-select-tips'); + if (dom.attr('xm-select-search') != undefined) { + var icon = ''; + html = '' + icon + ''; + that.addClass('xm-select-dd-search'); + that.off('click'); + } + commons.methods.handlerDataTable(dom, '38px'); + that.html(html); + }, + handlerDataTable: function handlerDataTable(dom, height) { + if (dom.length == undefined) { + dom = $(dom); + } + if (dom.parents('div.layui-table-cell').length) { + var index = dom.parents('tr').attr('data-index'); + dom.parents('.layui-table-box').find('tbody tr[data-index=\'' + index + '\'] div.layui-table-cell').css({ + height: height, + lineHeight: height, + overflow: 'unset' + }); + } + }, + overrideInput: function overrideInput(options) { + var _ref5 = [commons.methods.getDiv(options), commons.methods.getDom(options)], + _div = _ref5[0], + _dom = _ref5[1]; + var _ref6 = [_div.find('.layui-select-title input:first'), $('
              ')], + $input = _ref6[0], + $orinput = _ref6[1]; + + $orinput.insertAfter($input); + if ($input.parents('.layui-form-pane').length && $input.parents('.layui-form-item[pane]').length) { + $orinput.css('border', 'none'); + } + if (options.height) { + $orinput.addClass('.xm-select-height').css('height', options.height); + } + if (_dom.attr('disabled') != undefined) { + $orinput.append($('
              ').addClass('layui-disabled')); + } + }, + retop: function retop(options) { + var div = commons.methods.getIpt(options); + if (div.length) { + var dl = div.parent('.layui-select-title').next(); + var up = dl.parent().hasClass('layui-form-selectup') || dl.css('top').indexOf('-') == 0; + var time = commons.data.times.get(options.name); + if (time) { + if (Date.now() - time.time < 100 || options.delete) { + up = time.up; + options.delete = false; + } else { + time.up = up; + } + time.time = Date.now(); + } else { + commons.data.times.set(options.name, { + time: Date.now(), + up: up + }); + } + if (up) { + div.parent('.layui-select-title').next().css({ + top: 'auto', + bottom: div[0].offsetTop + div.height() + 14 + 'px' + }); + } else { + div.parent('.layui-select-title').next().css({ + top: div[0].offsetTop + div.height() + 14 + 'px', + bottom: 'auto' + }); + } + } + }, + getElementTop: function getElementTop(element) { + var actualTop = element.offsetTop; + var current = element.offsetParent; + while (current !== null) { + actualTop += current.offsetTop; + current = current.offsetParent; + } + return actualTop; + }, + getDom: function getDom(options, isNew) { + var _ref7 = [commons.data.temps.dom, options.name], + _dom = _ref7[0], + _name = _ref7[1]; + + if (isNew) { + _dom.set(_name, $('select[' + commons.data.name + '=\'' + _name + '\']')); + } + if (!_dom.has(_name)) { + _dom.set(_name, $('select[' + commons.data.name + '=\'' + _name + '\']')); + } + return _dom.get(_name); + }, + getDiv: function getDiv(options) { + var _ref8 = [commons.data.temps.div, options.name], + _div = _ref8[0], + _name = _ref8[1]; + + if (!_div.has(_name)) { + _div.set(_name, $('select[' + commons.data.name + '=\'' + _name + '\']').next()); + } + return _div.get(_name); + }, + getIpt: function getIpt(options) { + return commons.methods.getDiv(options).find('div .' + commons.data.name); + }, + getInitVal: function getInitVal(options) { + var _dom = commons.methods.getDom(options); + var vals = options.init ? options.init : _dom.find('option[selected]').map(function (index, target) { + return $(target).attr('value'); + }).toArray(); + var result = void 0; + if (options.radio) { + var one = vals.map(function (val) { + var opt = _dom.find('option[value=\'' + val + '\']'); + return { + name: opt.attr('disabled') != undefined ? null : opt.text(), + val: val + "" + }; + }).filter(function (val) { + return val.name && val.val; + })[0]; + result = one ? [one] : []; + } else { + result = vals.map(function (val) { + return { + name: _dom.find('option[value=\'' + val + '\']').text(), + val: val + "" + }; + }).filter(function (val) { + return val.name && val.val; + }); + } + return result; + }, + getValues: function getValues(options) { + var _ref9 = [commons.data.values, options.name], + _arr = _ref9[0], + _name = _ref9[1]; + + if (!_arr.has(_name)) { + _arr.set(_name, []); + } + return _arr.get(_name); + }, + setValues: function setValues(options, vals) { + var _ref10 = [commons.data.values, options.name], + _arr = _ref10[0], + _name = _ref10[1]; + + _arr.set(_name, vals); + }, + getOptions: function getOptions(sel) { + return { + name: sel.attr('' + commons.data.name), + type: sel.attr(commons.data.name + '-type'), + max: sel.attr(commons.data.name + '-max'), + icon: sel.attr(commons.data.name + '-icon'), + tips: sel.attr(commons.data.name + '-placeholder'), + height: sel.attr(commons.data.name + '-height'), + radio: sel.attr(commons.data.name + '-radio') != undefined, + repeat: sel.attr(commons.data.name + '-repeat') != undefined + }; + }, + cloneOptions: function cloneOptions(options, hisOptions) { + if (!hisOptions) { + hisOptions = commons.data.DEFAULT_OPTIONS; + } + if (options.icon && typeof options.icon == 'string') { + var icon = options.icon; + if (icon.indexOf('layui') == 0) { + options.icon = { + class: icon, + text: '' + }; + } else { + options.icon = { + class: '', + text: icon + }; + } + } else { + var v = layui.v.split('.'); + if (v[0] < 2 || v[1] <= 2) { + options.icon = { + class: '', + text: hisOptions.icon.text + }; + } else { + options.icon = { + class: hisOptions.icon.class, + text: '' + }; + } + } + return $.extend({}, hisOptions, options); + }, + autoInit: function autoInit(repeat) { + $('select[' + commons.data.name + ']').each(function (index, target) { + var sel = $(target); + sel.css('display', 'none'); + var options = commons.methods.getOptions(sel); + if (!repeat) { + var hisOptions = commons.data.confs.get(options.name); + options.init = select3.value(options.name, 'val'); + commons.methods.init(commons.methods.cloneOptions(options, hisOptions), true); + } else { + commons.methods.init(options); + } + }); + }, + listenCloseHandler: function listenCloseHandler(e, that, block) { + if (block.length) { + var _ref11 = [block.find('.layui-form-select'), block.find('dl')], + div = _ref11[0], + dl = _ref11[1]; + + var name = block.find('select').attr('xm-select'); + + if (that.hasClass('layui-disabled')) { + return; + } + + if (that.attr('xm-select-clear') != undefined) { + if (that.is('i')) { + var options = commons.data.confs.get($(e.target).attr('xm-select-clear')); + if (options) { + var length = commons.methods.removeAll(options); + if (options.radio && length) { + return; + } + } + div.addClass('layui-form-selected'); + dl.find('.xm-select-input-search').focus(); + return; + } + } + + if (that.hasClass('xm-select-dd-search') || that.hasClass('xm-select-input-search')) { + div.addClass('layui-form-selected'); + dl.find('.xm-select-input-search').focus(); + return; + } + + $('.xm-select-parent > select:not([xm-select=\'' + name + '\']) + div > dl').removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none'); + + if (that.attr('fsw') != undefined) { + if (that.is('i')) { + var _ref12 = [$(e.target).parents('.layui-form-select').prev(), $(e.target).parent()], + sel = _ref12[0], + span = _ref12[1]; + + var val = { + name: span.find('font').text(), + val: span.attr('value') + }; + var _options = commons.methods.getOptions(sel); + _options = commons.data.confs.get(_options.name); + _options.delete = true; + commons.methods.getDiv(_options).find('dl dd[lay-value=\'' + val.val + '\']').click(); + setTimeout(function () { + if (dl.hasClass('xm-select-show')) { + div.addClass('layui-form-selected'); + dl.find('.xm-select-input-search').focus(); + } else { + div.removeClass('layui-form-selected'); + } + }, 3); + return; + } + } + + if (block.find('select').attr('xm-select-radio') != undefined) { + setTimeout(function () { + if (dl.hasClass('xm-select-show')) { + div.removeClass('layui-form-selected'); + dl.removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none'); + } else { + div.addClass('layui-form-selected'); + dl.removeClass('xm-select-hidn').addClass('xm-select-show').css('display', 'block'); + dl.find('.xm-select-input-search').focus(); + } + }, 3); + return; + } + + if (dl.hasClass('xm-select-show')) { + if (that.hasClass('xm-select') || that.hasClass('xm-select-empty')) { + dl.removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none'); + div.removeClass('layui-form-selected'); + } else { + div.addClass('layui-form-selected'); + dl.find('.xm-select-input-search').focus(); + } + return; + } + dl.removeClass('xm-select-hidn').addClass('xm-select-show').css('display', 'block'); + div.addClass('layui-form-selected'); + dl.find('.xm-select-input-search').focus(); + } else { + $('.xm-select-parent > .layui-form-select > dl.xm-select-show').removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none'); + } + }, + listenClose: function listenClose() { + $(document).on('click', function (e) { + var that = $(e.target); + var block = that.parents('.xm-select-parent'); + setTimeout(function () { + commons.methods.listenCloseHandler(e, that, block); + commons.methods.retop({ name: block.find('select[xm-select]').attr('xm-select') }); + $('.xm-select-parent input.xm-select-input-search').each(function (index, item) { + var that = $(item); + if (that.parents('dl').hasClass('xm-select-hidn')) { + that.val(''); + that.parents('dl').find('.layui-hide').removeClass('layui-hide'); + that.parents('dl').find('p').remove(); + } + }); + }, 10); + }); + $(document).on({ + 'input propertychange': function inputPropertychange(e) { + var that = $(e.target); + var dl = that.parents('dl'); + that.parents('dl').find('p').remove(); + dl.find('.layui-hide').removeClass('layui-hide'); + dl.find('dd:not(.layui-select-tips):not(:contains(\'' + that.val() + '\'))').addClass('layui-hide'); + if (!dl.find('dd:not(.layui-select-tips):not(.layui-hide)').length) { + dl.append('

              \u65E0\u5339\u914D\u9879

              '); + } + dl.find('dt').each(function (index, item) { + if (!$(item).nextUntil('dt', ':not(.layui-hide)').length) { + $(item).addClass('layui-hide'); + } + }); + } + }, '.xm-select-parent input.xm-select-input-search'); + }, + formRender: null, + rewriteRender: function rewriteRender() { + commons.methods.formRender = form.render; + form.render = function (type, filter, repeat) { + commons.methods.formRender(type, filter); + if (filter) { + var sel = $('[lay-filter=' + filter + ']').find('select[' + commons.data.name + ']'); + if (sel.length) { + if (repeat) { + commons.methods.init(commons.methods.getOptions(sel)); + } + } + return; + } + commons.methods.autoInit(repeat); + }; + }, + loadCss: function loadCss(skin, cs) { + if (skin) { + if (skin == 'default') { + return; + } + var sn = void 0; + if ($('style[skin]').length) { + sn = $('style[skin]'); + } else { + sn = $(''); + } + var df = styles.colors[skin] ? styles.colors[skin] : styles.colors.default; + var colors = $.extend([], df, cs); + sn.html(styles.cssColor(skin, colors[0], colors[1], colors[2], colors[3], colors[4], colors[5], colors[6])); + sn.insertAfter($('head style:last')); + } else { + $('').insertBefore($('head *:first')); + + var html = ''; + for (var name in styles.colors) { + var _colors = styles.colors[name]; + if (_colors) { + _colors = $.extend([], styles.colors.default, _colors); + html += ''; + } + } + if (html) { + $(html).insertAfter($('head style[' + commons.data.name + ']')); + } + } + }, + loadLastStyle: function loadLastStyle() { + $('head').append(''); + }, + resize: function resize(selector, fun) { + var id = commons.data.resize.get(selector); + if (id != undefined) { + clearInterval(id); + } + if (fun && fun instanceof Function) { + var hisize = new Map(); + id = setInterval(function (e) { + $(selector).each(function (index, item) { + var thisize = [item.clientHeight, item.clientWidth]; + if (hisize.get(item)) { + var his = hisize.get(item); + if (his[0] != thisize[0] || his[1] != thisize[1]) { + fun(item); + } + } + hisize.set(item, thisize); + }); + }, 250); + commons.data.resize.set(selector, id); + } + }, + run: function run() { + commons.methods.rewriteRender(); + commons.methods.listenClose(); + commons.methods.loadCss(); + commons.methods.loadLastStyle(); + commons.methods.autoInit(); + commons.methods.resize('.xm-select:not(.xm-select-height)', function (dom) { + commons.methods.handlerDataTable(dom, dom.clientHeight + 'px'); + }); + } + } + }, + styles = { + colors: { //name, spanBgColor, spanColor, iBgColor, iColor, borderColor, tBgColor, tColor + default: ['#F0F2F5', '#909399', '#C0C4CC', '#FFFFFF', '#F0F2F5', '#5FB878', '#FFFFFF'], + primary: ['#009688', '#FFFFFF', '#009688', '#FFFFFF', '#009688', '#009688', '#FFFFFF'], + normal: ['#1E9FFF', '#FFFFFF', '#1E9FFF', '#FFFFFF', '#1E9FFF', '#1E9FFF', '#FFFFFF'], + warm: ['#FFB800', '#FFFFFF', '#FFB800', '#FFFFFF', '#FFB800', '#FFB800', '#FFFFFF'], + danger: ['#FF5722', '#FFFFFF', '#FF5722', '#FFFFFF', '#FF5722', '#FF5722', '#FFFFFF'] + }, + css: function css() { + return '\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > input{display: none!important;}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select{\n\t\t\t\t\t\tline-height: normal;\n\t\t\t\t\t\theight: auto;\n\t\t\t\t\t\tpadding: 4px 10px;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\tmin-height: 38px;\n\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\tz-index: 99;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\tpadding-right: 20px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty){\n\t\t\t\t\t\tpadding: 2px 5px;\n\t\t\t\t\t\tbackground: #f0f2f5;\n\t\t\t\t\t\tborder-radius: 2px;\n\t\t\t\t\t\tcolor: #909399;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tline-height: 18px;\n\t\t\t\t\t\theight: 18px;\n\t\t\t\t\t\tmargin: 2px 5px 2px 0px;\n\t\t\t\t\t\tfloat: left;\n\t\t\t\t\t\tcursor: initial;\n\t\t\t\t\t\tuser-select: none;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i{\n\t\t\t\t\t\tbackground-color: #c0c4cc;\n\t\t\t\t\t\tcolor: #ffffff;\n\t\t\t\t\t\tmargin-left: 8px;\n\t\t\t\t\t\tborder-radius: 20px;\n\t\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\t\tcursor: initial;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i:hover{\n\t\t\t\t\t\tbackground-color: #909399;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span.xm-select-empty{\n\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\theight: 28px;\n\t\t\t\t\t\tline-height: 28px;\n\t\t\t\t\t\tcolor: #999999\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search{\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t\tpadding-bottom: 5px;\n\t\t\t\t\t\tmargin-right: 30px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > input{\n\t\t\t\t\t\tcursor: text;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > span{\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t right: 8px;\n\t\t\t\t\t top: 5px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > span > i{\n\t\t\t\t\t\tfont-size: 22px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > span > i:hover{\n\t\t\t\t\t\tcolor: red;\n\t\t\t\t\t\topacity:.8;\n\t\t\t\t\t\tfilter:alpha(opacity=80);\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl p.xm-select-search-empty{\n\t\t\t\t\t\tmargin: 10px 0;\n\t\t\t\t\t text-align: center;\n\t\t\t\t\t color: #999;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'1\'] + div dl dd.xm-select-this,select[xm-select]:not([xm-select-type]) + div dl dd.xm-select-this{\n\t\t\t\t\t\tbackground-color: #5FB878;\n\t\t\t\t\t\tcolor: #FFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'1\'] + div dl dd.layui-disabled,select[xm-select]:not([xm-select-type]) + div dl dd.layui-disabled{\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'2\'] + div dl dd.layui-disabled i{\n\t\t\t\t\t\tborder-color: #C2C2C2;\n\t\t\t\t\t\tcolor: #FFFFFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'2\'] + div dl dd.xm-select-this.layui-disabled i{\n\t\t\t\t\t\tbackground-color: #D2D2D2;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'2\'] + div dl dd.xm-select-this:not(.layui-disabled) i{\n\t\t\t\t\t\tbackground-color: #5FB878;\n\t\t\t\t\t\tborder-color: #5FB878;\n\t\t\t\t\t\tcolor: #FFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'3\'] + div dl dd.xm-select-this:not(.layui-disabled){\n\t\t\t\t\t\tcolor: #5FB878;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'3\'] + div dl dd.xm-select-this i{\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t'; + }, + cssColor: function cssColor(name, spanBgColor, spanColor, iBgColor, iColor, borderColor, tBgColor, tColor) { + return '\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty){\n\t\t\t\t\t\tbackground: ' + spanBgColor + ';\n\t\t\t\t\t\tcolor: ' + spanColor + ';\n\t\t\t\t\t\tborder: 1px solid ' + borderColor + '\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i{\n\t\t\t\t\t\tbackground: ' + iBgColor + ';\n\t\t\t\t\t\tcolor: ' + iColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i:hover{\n\t\t\t\t\t\topacity:.8;\n\t\t\t\t\t\tfilter:alpha(opacity=80);\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'][xm-select-type=\'1\'] + div dl dd.xm-select-this:not(.layui-disabled),select[xm-select][xm-select-skin=\'' + name + '\']:not([xm-select-type]) + div dl dd.xm-select-this:not(.layui-disabled){\n\t\t\t\t\t\tbackground-color: ' + tBgColor + ';\n\t\t\t\t\t\tcolor: ' + tColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'][xm-select-type=\'2\'] + div dl dd.xm-select-this:not(.layui-disabled) i{\n\t\t\t\t\t\tbackground-color: ' + tBgColor + ';\n\t\t\t\t\t\tborder-color: ' + tBgColor + ';\n\t\t\t\t\t\tcolor: ' + tColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'][xm-select-type=\'3\'] + div dl dd.xm-select-this:not(.layui-disabled){\n\t\t\t\t\t\tcolor: ' + tBgColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'3\'] + div dl dd.xm-select-this i{\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t}\n\t\t\t\t'; + }, + renderCss: function renderCss() { + return '\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty){\n\t\t\t\t\t\tbox-sizing: content-box;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-parent .layui-form-select dl dd.layui-this{\n\t\t\t\t\t background-color: inherit;\n\t\t\t\t\t color: inherit;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-parent .layui-form-select dl dd.layui-this.layui-select-tips {\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t color: #999999;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-parent .layui-form-selected dl {\n\t\t\t\t\t display: none;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-show:{\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-hidn:{\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t}\n\t\t\t\t'; + } + }; + commons.methods.run(); + return select3; +}); \ No newline at end of file diff --git a/public/static/layui/plugin/formSelects/formSelects-v4.css b/public/static/layui/plugin/formSelects/formSelects-v4.css new file mode 100644 index 0000000..d7d6981 --- /dev/null +++ b/public/static/layui/plugin/formSelects/formSelects-v4.css @@ -0,0 +1,174 @@ +/* formSelects多选css */ +select[xm-select]{display: none !important;} +.xm-select-parent * {margin: 0;padding: 0;font-family: "Helvetica Neue", Helvetica, "PingFang SC", 微软雅黑, Tahoma, Arial, sans-serif; box-sizing: initial;} +.xm-select-parent {text-align: left;} +.xm-select-parent select {display: none;} +.xm-select-parent .xm-select-title {position: relative;min-height: 36px;} +.xm-select-parent .xm-input {cursor: pointer;border-radius: 2px;border-width: 1px;border-style: solid;border-color: #E6E6E6;display: block;width: 100%;box-sizing: border-box;background-color: #FFF;height: 36px;line-height: 1.3;padding-left: 10px;outline: 0} +.xm-select-parent .xm-select-sj {display: inline-block;width: 0;height: 0;border-style: dashed;border-color: transparent;overflow: hidden;position: absolute;right: 10px;top: 50%;margin-top: -3px;cursor: pointer;border-width: 6px;border-top-color: #C2C2C2;border-top-style: solid;transition: all .3s;-webkit-transition: all .3s} +.xm-select-parent .xm-form-selected .xm-select-sj {margin-top: -9px;transform: rotate(180deg)} +.xm-select-parent .xm-form-select dl {display: none;position: absolute;left: 0;top: 42px;padding: 5px 0;z-index: 999;min-width: 100%;border: 1px solid #d2d2d2;max-height: 300px;overflow-y: auto;background-color: #fff;border-radius: 2px;box-shadow: 0 2px 4px rgba(0, 0, 0, .12);box-sizing: border-box;animation-fill-mode: both;-webkit-animation-name: layui-upbit;animation-name: layui-upbit;-webkit-animation-duration: .3s;animation-duration: .3s;-webkit-animation-fill-mode: both;animation-fill-mode: both} +@-webkit-keyframes layui-upbit { + from {-webkit-transform: translate3d(0, 30px, 0);opacity: .3} + to {-webkit-transform: translate3d(0, 0, 0);opacity: 1} +} +@keyframes layui-upbit { + from {transform: translate3d(0, 30px, 0);opacity: .3} + to {transform: translate3d(0, 0, 0);opacity: 1} +} +.xm-select-parent .xm-form-selected dl {display: block} +.xm-select-parent .xm-form-select dl dd,.xm-select-parent .xm-form-select dl dt {padding: 0 10px;line-height: 36px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis} +.xm-select-parent .xm-form-select dl dd {cursor: pointer;height: 36px;} +.xm-select-parent .xm-form-select dl dd:hover {background-color: #f2f2f2} +.xm-select-parent .xm-form-select dl dt {font-size: 12px;color: #999} +.layui-select-disabled .xm-dis-disabled {border-color: #eee!important} +.xm-select-parent .xm-form-select dl .xm-select-tips {padding-left: 10px!important;color: #999;font-size: 14px} +.xm-unselect {-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none} + +.xm-form-checkbox {position: relative;display: block;vertical-align: middle;cursor: pointer;font-size: 0;-webkit-transition: .1s linear;transition: .1s linear;box-sizing: border-box;height: auto!important;line-height: normal!important;border: none!important;margin-right: 0;padding-right: 0;background: 0 0;} +.xm-form-checkbox > i {color: #FFF; font-size: 16px; width: 16px; height: 16px; position: absolute; top: 9px; border: 1px solid #5FB878; border-radius: 3px; z-index: 2;} +.xm-form-checkbox:hover > i {border-color: #5FB878;} +.xm-form-checkbox > span{display: block;position: relative;padding: 0 15px 0 30px;height: 100%;font-size: 14px;border-radius: 2px 0 0 2px;background-color: #d2d2d2;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;background: 0 0;color: #666;line-height: 36px;} + +.xm-select-parent dl{width: 100%;} +.xm-select-parent dl dd{position: relative;} +.xm-select-parent dl dd > i:not(.icon-sousuo){position: absolute; right: 10px; top: 0; color: #AAAAAA;} +.xm-select-parent dl dd.xm-select-this div i {border: none; color: #009688; font-size: 18px;} +.xm-select-parent dl dd.xm-select-this div i:after{content: '\e613';} +.xm-select-parent dl dd.xm-dis-disabled div i {border-color: #C2C2C2;} +.xm-select-parent dl dd.xm-dis-disabled.xm-select-this div i {color: #C2C2C2;} +.xm-select-radio div.xm-form-checkbox > i {border-radius: 20px;} +.xm-select-parent dl.xm-select-radio dd.xm-select-this div i:after{content: '\e62b';} + +.xm-dis-disabled,.xm-dis-disabled:hover {cursor: not-allowed!important} +.xm-form-select dl dd.xm-dis-disabled {background-color: #fff!important} +.xm-form-select dl dd.xm-dis-disabled span {color: #C2C2C2} +.xm-form-select dl dd.xm-dis-disabled .xm-icon-yes {border-color: #C2C2C2} +.xm-select-parent {position: relative;-moz-user-select: none;-ms-user-select: none;-webkit-user-select: none} +.xm-select-parent .xm-select {line-height: normal;height: auto;padding: 4px 10px 1px 10px;overflow: hidden;min-height: 36px;left: 0;z-index: 99;position: absolute;background: 0 0;padding-right: 20px} +.xm-select-parent .xm-select:hover {border-color: #C0C4CC} +.xm-select-parent .xm-select .xm-select-label {display: inline-block;margin: 0;vertical-align: middle} +.xm-select-parent .xm-select-title div.xm-select-label>span {position: relative;padding: 2px 5px;background-color: #009688;border-radius: 2px;color: #FFF;display: inline-block;line-height: 18px;height: 18px;margin: 2px 5px 2px 0;cursor: initial;user-select: none;font-size: 14px;padding-right: 25px;-webkit-user-select: none;} +.xm-select-parent .xm-select-title div.xm-select-label>span i {position: absolute; margin-left: 8px; font-size: 12px; cursor: pointer; line-height: 20px;} +.xm-select-parent .xm-select .xm-select-input {border: none;height: 28px;background-color: transparent;padding: 0;vertical-align: middle;display: inline-block;width: 50px} +.xm-select-parent .xm-select--suffix input {border: none} +.xm-form-selected .xm-select,.xm-form-selected .xm-select:hover {border-color: #009688!important} +.xm-select--suffix+div {position: absolute;top: 0;left: 0;bottom: 0;right: 0} +.xm-select-dis .xm-select--suffix+div {z-index: 100;cursor: no-drop!important;opacity: .2;background-color: #FFF;} +.xm-select-disabled,.xm-select-disabled:hover {color: #d2d2d2!important;cursor: not-allowed!important;background-color: #fff} +.xm-select-none {display: none;margin: 5px 0;text-align: center;} +.xm-select-none:hover {background-color: #FFF!important} +.xm-select-empty {display: block} +.xm-span-hide {display: none!important;} +.layui-form-pane .xm-select,.layui-form-pane .xm-select:hover {border: none!important;top: 0px} +.layui-form-pane .xm-select-title {border: 1px solid #e6e6e6!important} +.xm-select-hide {display: none !important;} +div[xm-hg] .xm-select-label{white-space: nowrap; overflow: hidden; position: absolute; right: 30px; left: 0; padding-left: 10px;} + +/* 颜色相关 */ +div[xm-select-skin] .xm-select-title div.xm-select-label>span {border: 1px solid #009688} +div[xm-select-skin] .xm-select-title div.xm-select-label>span i:hover {opacity: .8;filter: alpha(opacity=80);cursor: pointer} +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span {background-color: #F0F2F5;color: #909399;border: 1px solid #F0F2F5} +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span i {color: #C0C4CC} +div[xm-select-skin=default] .xm-select-title div.xm-select-label>span i:before {content: '\e60b'; font-size: 16px; margin-left: -3px;} +div[xm-select-skin=default] dl dd:not(.xm-dis-disabled) i {border-color: #5FB878} +div[xm-select-skin=default] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #5FB878} +div[xm-select-skin=default].xm-form-selected .xm-select,div[xm-select-skin=default].xm-form-selected .xm-select:hover {border-color: #C0C4CC!important} +div[xm-select-skin=primary] .xm-select-title div.xm-select-label>span {background-color: #009688;color: #FFF;border: 1px solid #009688} +div[xm-select-skin=primary] .xm-select-title div.xm-select-label>span i {background-color: #009688; color: #FFF} +div[xm-select-skin=primary] dl dd:not(.xm-dis-disabled) i {border-color: #009688} +div[xm-select-skin=primary] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #009688} +div[xm-select-skin=primary].xm-form-selected .xm-select,div[xm-select-skin=primary].xm-form-selected .xm-select:hover {border-color: #009688!important} +div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span {background-color: #1E9FFF;color: #FFF;border: 1px solid #1E9FFF} +div[xm-select-skin=normal] .xm-select-title div.xm-select-label>span i {background-color: #1E9FFF;color: #FFF} +div[xm-select-skin=normal] dl dd:not(.xm-dis-disabled) i {border-color: #1E9FFF} +div[xm-select-skin=normal] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #1E9FFF} +div[xm-select-skin=normal].xm-form-selected .xm-select,div[xm-select-skin=normal].xm-form-selected .xm-select:hover {border-color: #1E9FFF!important} +div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span {background-color: #FFB800;color: #FFF;border: 1px solid #FFB800} +div[xm-select-skin=warm] .xm-select-title div.xm-select-label>span i {background-color: #FFB800;color: #FFF} +div[xm-select-skin=warm] dl dd:not(.xm-dis-disabled) i {border-color: #FFB800} +div[xm-select-skin=warm] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #FFB800} +div[xm-select-skin=warm].xm-form-selected .xm-select,div[xm-select-skin=warm].xm-form-selected .xm-select:hover {border-color: #FFB800!important} +div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span {background-color: #FF5722;color: #FFF;border: 1px solid #FF5722} +div[xm-select-skin=danger] .xm-select-title div.xm-select-label>span i {background-color: #FF5722;color: #FFF} +div[xm-select-skin=danger] dl dd:not(.xm-dis-disabled) i {border-color: #FF5722} +div[xm-select-skin=danger] dl dd.xm-select-this:not(.xm-dis-disabled) i {color: #FF5722} +div[xm-select-skin=danger].xm-form-selected .xm-select,div[xm-select-skin=danger].xm-form-selected .xm-select:hover {border-color: #FF5722!important} + + +/* 多选联动 */ +.xm-select-parent .layui-form-danger+.xm-select-title .xm-select {border-color: #FF5722 !important;} +.xm-select-linkage li {padding: 10px 0px;cursor: pointer;} +.xm-select-linkage li span {padding-left: 20px;padding-right: 30px;display: inline-block;height: 20px;overflow: hidden;text-overflow: ellipsis;} +.xm-select-linkage li.xm-select-this span {border-left: 5px solid #009688;color: #009688;padding-left: 15px;} +.xm-select-linkage-group {position: absolute;left: 0;top: 0;right: 0;bottom: 0;overflow-x: hidden;overflow-y: auto;} +.xm-select-linkage-group li:hover {border-left: 1px solid #009688;} +.xm-select-linkage-group li:hover span {padding-left: 19px;} +.xm-select-linkage-group li.xm-select-this:hover span {padding-left: 15px;border-left-width: 4px;} +.xm-select-linkage-group:nth-child(4n+1){background-color: #EFEFEF; left: 0;} +.xm-select-linkage-group:nth-child(4n+1) li.xm-select-active{background-color: #F5F5F5;} +.xm-select-linkage-group:nth-child(4n+2){background-color: #F5F5F5; left: 100px;} +.xm-select-linkage-group:nth-child(4n+3) li.xm-select-active{background-color: #FAFAFA;} +.xm-select-linkage-group:nth-child(4n+3){background-color: #FAFAFA; left: 200px;} +.xm-select-linkage-group:nth-child(4n+3) li.xm-select-active{background-color: #FFFFFF;} +.xm-select-linkage-group:nth-child(4n+4){background-color: #FFFFFF; left: 300px;} +.xm-select-linkage-group:nth-child(4n+4) li.xm-select-active{background-color: #EFEFEF;} +.xm-select-linkage li{list-style: none;} +.xm-select-linkage-hide {display: none;} +.xm-select-linkage-show {display: block;} + +div[xm-select-skin='default'] .xm-select-linkage li.xm-select-this span {border-left-color: #5FB878;color: #5FB878;} +div[xm-select-skin='default'] .xm-select-linkage-group li:hover {border-left-color: #5FB878;} +div[xm-select-skin='primary'] .xm-select-linkage li.xm-select-this span {border-left-color: #1E9FFF;color: #1E9FFF;} +div[xm-select-skin='primary'] .xm-select-linkage-group li:hover {border-left-color: #1E9FFF;} +div[xm-select-skin='normal'] .xm-select-linkage li.xm-select-this span {border-left-color: #1E9FFF;color: #1E9FFF;} +div[xm-select-skin='normal'] .xm-select-linkage-group li:hover {border-left-color: #1E9FFF;} +div[xm-select-skin='warm'] .xm-select-linkage li.xm-select-this span {border-left-color: #FFB800;color: #FFB800;} +div[xm-select-skin='warm'] .xm-select-linkage-group li:hover {border-left-color: #FFB800;} +div[xm-select-skin='danger'] .xm-select-linkage li.xm-select-this span {border-left-color: #FF5722;color: #FF5722;} +div[xm-select-skin='danger'] .xm-select-linkage-group li:hover {border-left-color: #FF5722;} + + +/* 快捷操作 */ +.xm-select-tips[style]:hover{background-color: #FFF!important;} +.xm-select-parent dd > .xm-cz{position: absolute; top: 0px; right: 10px;} +.xm-select-parent dd > .xm-cz-group{margin-right: 30px; border-right: 2px solid #ddd; height: 16px; margin-top: 10px; line-height: 16px; overflow: hidden;} +.xm-select-parent dd > .xm-cz-group .xm-cz{display: inline-block; margin-right: 30px;} +.xm-select-parent dd > .xm-cz-group .xm-cz i{margin-right: 10px;} +.xm-select-parent dd > .xm-cz-group[show='name'] .xm-cz i{display: none;} +.xm-select-parent dd > .xm-cz-group[show='icon'] .xm-cz span{display: none;} +.xm-select-parent dd .xm-cz:hover{color: #009688;} +div[xm-select-skin='default'] dd .xm-cz:hover{color: #C0C4CC;} +div[xm-select-skin='primary'] dd .xm-cz:hover{color: #009688;} +div[xm-select-skin='normal'] dd .xm-cz:hover{color: #1E9FFF;} +div[xm-select-skin='warm'] dd .xm-cz:hover{color: #FFB800;} +div[xm-select-skin='danger'] dd .xm-cz:hover{color: #FF5722;} + + +/* 下拉里面的搜索 */ +.xm-select-tips .xm-input{border: none; border-bottom: 1px solid #E6E6E6; padding-left: 27px;} +.xm-select-tips .icon-sousuo{position: absolute;} +.xm-select-tips.xm-dl-input{display: none;} +div[xm-select-search-type="1"] .xm-select-tips.xm-dl-input{display: block;} +div[xm-select-search-type="1"] .xm-select .xm-select-input{display: none !important;} + +/* 阿里巴巴矢量图标库 */ +@font-face {font-family: "xm-iconfont"; + src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831'); /* IE9*/ + src: url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.eot?t=1534240067831#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAsYAAsAAAAAEQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8ukovY21hcAAAAYAAAACrAAACPBtV6wxnbHlmAAACLAAABnEAAAmMovtEvWhlYWQAAAigAAAAMQAAADYSctBCaGhlYQAACNQAAAAgAAAAJAgBA69obXR4AAAI9AAAABsAAAAwMCX//WxvY2EAAAkQAAAAGgAAABoN8gwubWF4cAAACSwAAAAeAAAAIAEiAM9uYW1lAAAJTAAAAUUAAAJtPlT+fXBvc3QAAAqUAAAAhAAAALJ1LunfeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWacwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGByeMbwwZ27438AQw9zMcAQozAiSAwDk4AxmeJzlks0JwzAMhZ8bN/1xD4GU0h2Se26BbJMJOkkn6KmTPbJF8mT5UGg3qMRn0EPIRs8A9gAq0YsIhDcCLF5SQ9YrnLMe8VB9RSMlMjCxYcueIyfOy7CuAFHU7lP9iqApt5L3ksBJbzlgZ9PVkXDUvbWa6x8T/i0u+XyWKtmmHW0NDI55yeRok2DjaKdg65jX7Bzzm71jXnN08vzJkQvg7Ng/WAYH9Qb3wzM/AHicjVVvbFzFEd/Zfbv7/vn9uXf33vl8Pt/dO99BHOzEZ9/DKTImRS0KjUoLDUFCjtpCMGkT1D9qldQmhkiUSv2G1BBB1VYqilGREOIDViWEGzttqkpI/cAXqyL5gFRALVIF+VCJe9fZd+fEpR/o6d3s7G9mZ2dmZ3aJIKR3h0ZYmVgkIjGZJV8mDxECtenOTDOu1UU+hJoD+TCqzcNMk2V8O5OCbDVRPgZhEt4JCNTZ/4HA3+DfuWIxl8pcFFErG3K7oD7fvev8UaMUmEu259lrRjBsfs6cLhYbRfzSbSjGRVAkfQYihUXsyPkHTVyyZDNmXzSHg3Tl+aPKxpJFqbWGdtLl8w8iYDxuDTQIx7yc1YCdIx7Jk3HSwbwQwGBcyMKZVtG0ZCuJxjFJBb+foMSfhJaPOSr4FYgwSwqIx2MHJALtAdBi/7xcSMJL+fxmmBS2guD61tZm96X02mgcj0J1NAaIR9UMmhXIV24FuLUC71+r1AEmK1AYrQHUK/Tly/m8MrOZz2+FSf7jzc3NK9XR9F2lVq+gmRp0r+HK9B+VJmR263Rgd7ALwR/FOFfx/FeJS0YxQh9drakgMJhaBVizkwgqWxLD6eQ0Qo8f7p44fJziSH9x+PjLZUO+/jZ9+K35X37ljn/Rv+yW4Ziuf2nl4PfS5/LrP47OHTsFJULYjf369UZAEBmSqEOSJmG4Me6LeznA0BFkcDoJlGynVzmH2vY21DhPr25v9DjvbfTp2TXG1s5mlK0q4S7lT++6obbRox/s6CHF2LMEsHvoFfSFQIKnKQMZJVFCD6WH0p0PVvvcRx8uph8eUks0jOFNtskOkpDsJ18k9+NqVRg3qqMCSSerjyRuYUi1/vFH7YIqikGVcD+ehFl/pqPSPKZ6DG6mHisljFhBFvU/PoRkSNd/JHO6Ja5JOXcfwIGJbm/igBq/hn8Kfb57YbYUxyX4cwkLKH1u4gD9GVSL6USxCjjCO2p8VdcvH9XRYIQWqUblu3pR/v2BvXMAc3tTmJiDAQ895B9NL0C9BFdKqqRKczDX/Whg7O1irVbcqZ8/sbfYBOZwihC+6wSDzszUf+dF7rRO1O+fKaDO+nXOr6+vf8L5J44Qe4UvnlyRntwrxMoKzpFdeRJBNb9dGyiur1+nE59R+uwi9M1G395jb9KP0bcK2YM9nJB5cojcS75OFskxclzdc+pW699z8iYbtf14BGKf77ruZNyXKC0e50OEBI+V/Aug5Dex/9WjJfipuqnS00gfybjXbNe1f762tXmRPp3Bdl/l6g5JXyqXR0bK8J3PR+jvwYs8/GBnTM+kr8FX4ZknwC16XtG9iH9QfNn1vDHPe2GAj3ieV3XdF2+IPdeteh62Ra+HfQrsKWKSBtlHSOBgM7KkKQBLWnZoq1mVwotCLRGhOtSkMzMuqq2ml3SqUehdnZtynbtPLB88/Dy9dDrYVzoy/MTT6Svnlpd/AHueon5wpnGsEae/PZm+d3Jp6SSUTy7R3xw4f9/B5RN3O+5t3VNncjm6Cnt+uLx8DpedGj4yvD84HceNxTcG6ku4VPmZ9n6nNdj95BHyB3IJKxBPsKm6rpn4QopmqzlFm1MwqdxO5rPGnIc7aSfCGg1Vqyo6nUlQhnh7WiFhXzgGhVC4qjPRki9xdGCc4zXeSWb9BG1ktlqz2Q5Y7S2sIJfivkpVKCCDpyCWdbQzECj76qMVqvyJ/LxyI2rTv1bTC25lSM9xAUJ4Lc+U0wXTsKXDmaA8tHX+hvDt4Wa9IHLcMUBz9VwpL4xi2aGasAPPKNUbbmD/2jAtk0uXY4eJx8zRgj9iAnVNt5X+BL5vlHTOaiOmG7g6+7ZBNUOaefNXuJF3u25RjVvBLeW8E4wV7ZJBpbAXXGnqrwgupWVTAKqZjq5HbW44fMguNJhgwmw8oOk8GCqE8F3GhLB0uS/UDVt4lgjtqGxK/rpwuaDAqKHZNuWmJjVKuWUxbpg2B9DtoRdN3TKF9B0hw4p41C5i3CI9w4civP3aQLlmLMK3wpJpaI7BvmlhPtH3nPWCKQAdE2hK9zyuUeAm921qCA2kvqY8N1yDMq4beJlG+4XQqHDCQnqPlJIyyN579S4tIGcRv/82BbFfK9SgnVHkZzMeaSQjqR5/fP5XF2Chh+sW0g0gn27snqXv3/bsszsfJbCAIiTdjRTVCBL6jV0K5D8H/8xVAAAAeJxjYGRgYADi16c/vIvnt/nKwM3CAALXZxxzhtH///23YVFhbgZyORiYQKIAm34OJQAAAHicY2BkYGBu+N/AEMOi/P/f//8sKgxAERTAAwCmuAa3eJxjYWBgYAFhRiiNFf//z6L8/x+IDQAkCQRQAAAAAAAAjAEAATgBfgGaAiACbgMMA2AEhATGAAB4nGNgZGBg4GE4DMQgwATEXEDIwPAfzGcAAB2tAfIAAHicZY9NTsMwEIVf+gekEqqoYIfkBWIBKP0Rq25YVGr3XXTfpk6bKokjx63UA3AejsAJOALcgDvwSCebNpbH37x5Y08A3OAHHo7fLfeRPVwyO3INF7gXrlN/EG6QX4SbaONVuEX9TdjHM6bCbXRheYPXuGL2hHdhDx18CNdwjU/hOvUv4Qb5W7iJO/wKt9Dx6sI+5l5XuI1HL/bHVi+cXqnlQcWhySKTOb+CmV7vkoWt0uqca1vEJlODoF9JU51pW91T7NdD5yIVWZOqCas6SYzKrdnq0AUb5/JRrxeJHoQm5Vhj/rbGAo5xBYUlDowxQhhkiMro6DtVZvSvsUPCXntWPc3ndFsU1P9zhQEC9M9cU7qy0nk6T4E9XxtSdXQrbsuelDSRXs1JErJCXta2VELqATZlV44RelzRiT8oZ0j/AAlabsgAAAB4nG2L3QqCQBCFZ9RWU7sOfAeh8IFi3N10EHYUG1p8+gSjqz44F+cPEjgo4T81Jphihic0mGOBZyyxwhovUCxKIe4ylthRuDqV+I22UcLQ6+QH4ubWdZZkU3m4o/0tUqtSvT33TPLits12fzc+zhRcvoquo0o281OLhcMw7Q+AD8sULE0=') format('woff'), + url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.ttf?t=1534240067831') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ + url('//at.alicdn.com/t/font_792691_qxv28s6g1l9.svg?t=1534240067831#iconfont') format('svg'); /* iOS 4.1- */ +} +.xm-iconfont {font-family:"xm-iconfont" !important; font-size:16px; font-style:normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;} +.icon-quanxuan:before { content: "\e62c"; } +.icon-caidan:before { content: "\e610"; } +.icon-fanxuan:before { content: "\e837"; } +.icon-pifu:before { content: "\e668"; } +.icon-qingkong:before { content: "\e63e"; } +.icon-sousuo:before { content: "\e600"; } +.icon-danx:before { content: "\e62b"; } +.icon-duox:before { content: "\e613"; } +.icon-close:before { content: "\e601"; } +.icon-expand:before { content: "\e641"; } + diff --git a/public/static/layui/plugin/formSelects/formSelects-v4.js b/public/static/layui/plugin/formSelects/formSelects-v4.js new file mode 100644 index 0000000..8792ca9 --- /dev/null +++ b/public/static/layui/plugin/formSelects/formSelects-v4.js @@ -0,0 +1,1791 @@ +'use strict'; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/** + * name: formSelects + * 基于Layui Select多选 + * version: 4.0.0.0910 + * http://sun.faysunshine.com/layui/formSelects-v4/dist/formSelects-v4.js + */ +(function (layui, window, factory) { + if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') { + // 支持 CommonJS + module.exports = factory(); + } else if (typeof define === 'function' && define.amd) { + // 支持 AMD + define(factory); + } else if (window.layui && layui.define) { + //layui加载 + layui.define(['jquery'], function (exports) { + exports('formSelects', factory()); + }); + } else { + window.formSelects = factory(); + } +})(typeof layui == 'undefined' ? null : layui, window, function () { + var v = '4.0.0.0910', + NAME = 'xm-select', + PNAME = 'xm-select-parent', + INPUT = 'xm-select-input', + TDIV = 'xm-select--suffix', + THIS = 'xm-select-this', + LABEL = 'xm-select-label', + SEARCH = 'xm-select-search', + SEARCH_TYPE = 'xm-select-search-type', + SHOW_COUNT = 'xm-select-show-count', + CREATE = 'xm-select-create', + CREATE_LONG = 'xm-select-create-long', + MAX = 'xm-select-max', + SKIN = 'xm-select-skin', + DIRECTION = "xm-select-direction", + HEIGHT = 'xm-select-height', + DISABLED = 'xm-dis-disabled', + DIS = 'xm-select-dis', + TEMP = 'xm-select-temp', + RADIO = 'xm-select-radio', + LINKAGE = 'xm-select-linkage', + DL = 'xm-select-dl', + DD_HIDE = 'xm-select-hide', + HIDE_INPUT = 'xm-hide-input', + SANJIAO = 'xm-select-sj', + ICON_CLOSE = 'xm-icon-close', + FORM_TITLE = 'xm-select-title', + FORM_SELECT = 'xm-form-select', + FORM_SELECTED = 'xm-form-selected', + FORM_NONE = 'xm-select-none', + FORM_EMPTY = 'xm-select-empty', + FORM_INPUT = 'xm-input', + FORM_DL_INPUT = 'xm-dl-input', + FORM_SELECT_TIPS = 'xm-select-tips', + CHECKBOX_YES = 'xm-iconfont', + FORM_TEAM_PID = 'XM_PID_VALUE', + CZ = 'xm-cz', + CZ_GROUP = 'xm-cz-group', + TIPS = '请选择', + data = {}, + events = { + on: {}, + endOn: {}, + filter: {}, + maxTips: {}, + opened: {}, + closed: {} + }, + ajax = { + type: 'get', + header: {}, + first: true, + data: {}, + searchUrl: '', + searchName: 'keyword', + searchVal: null, + keyName: 'name', + keyVal: 'value', + keySel: 'selected', + keyDis: 'disabled', + keyChildren: 'children', + dataType: '', + delay: 500, + beforeSuccess: null, + success: null, + error: null, + beforeSearch: null, + response: { + statusCode: 0, + statusName: 'code', + msgName: 'msg', + dataName: 'data' + }, + tree: { + nextClick: function nextClick(id, item, callback) { + callback([]); + }, + folderChoose: true, + lazy: true + } + }, + quickBtns = [{ icon: 'xm-iconfont icon-quanxuan', name: '全选', click: function click(id, cm) { + cm.selectAll(id, true, true); + } }, { icon: 'xm-iconfont icon-qingkong', name: '清空', click: function click(id, cm) { + cm.removeAll(id, true, true); + } }, { icon: 'xm-iconfont icon-fanxuan', name: '反选', click: function click(id, cm) { + cm.reverse(id, true, true); + } }, { icon: 'xm-iconfont icon-pifu', name: '换肤', click: function click(id, cm) { + cm.skin(id); + } }], + $ = window.$ || window.layui && window.layui.jquery, + $win = $(window), + ajaxs = {}, + fsConfig = {}, + fsConfigs = {}, + FormSelects = function FormSelects(options) { + var _this = this; + + this.config = { + name: null, //xm-select="xxx" + max: null, + maxTips: function maxTips(id, vals, val, max) { + var ipt = $('[xid="' + _this.config.name + '"]').prev().find('.' + NAME); + if (ipt.parents('.layui-form-item[pane]').length) { + ipt = ipt.parents('.layui-form-item[pane]'); + } + ipt.attr('style', 'border-color: red !important'); + setTimeout(function () { + ipt.removeAttr('style'); + }, 300); + }, + init: null, //初始化的选择值, + on: null, //select值发生变化 + opened: null, + closed: null, + filter: function filter(id, inputVal, val, isDisabled) { + return val.name.indexOf(inputVal) == -1; + }, + clearid: -1, + direction: 'auto', + height: null, + isEmpty: false, + btns: [quickBtns[0], quickBtns[1], quickBtns[2]], + searchType: 0, + create: function create(id, name) { + return Date.now(); + }, + template: function template(id, item) { + return item.name; + }, + showCount: 0, + isCreate: false, + placeholder: TIPS, + clearInput: false + }; + this.select = null; + this.values = []; + $.extend(this.config, options, { + searchUrl: options.isSearch ? options.searchUrl : null, + placeholder: options.optionsFirst ? options.optionsFirst.value ? TIPS : options.optionsFirst.innerHTML || TIPS : TIPS, + btns: options.radio ? [quickBtns[1]] : [quickBtns[0], quickBtns[1], quickBtns[2]] + }, fsConfigs[options.name] || fsConfig); + if (isNaN(this.config.showCount) || this.config.showCount <= 0) { + this.config.showCount = 19921012; + } + }; + + //一些简单的处理方法 + var Common = function Common() { + this.appender(); + this.on(); + this.onreset(); + }; + + Common.prototype.appender = function () { + //针对IE做的一些拓展 + //拓展Array map方法 + if (!Array.prototype.map) { + Array.prototype.map = function (i, h) { + var b, + a, + c, + e = Object(this), + f = e.length >>> 0;if (h) { + b = h; + }a = new Array(f);c = 0;while (c < f) { + var d, g;if (c in e) { + d = e[c];g = i.call(b, d, c, e);a[c] = g; + }c++; + }return a; + }; + }; + + //拓展Array foreach方法 + if (!Array.prototype.forEach) { + Array.prototype.forEach = function forEach(g, b) { + var d, c;if (this == null) { + throw new TypeError("this is null or not defined"); + }var f = Object(this);var a = f.length >>> 0;if (typeof g !== "function") { + throw new TypeError(g + " is not a function"); + }if (arguments.length > 1) { + d = b; + }c = 0;while (c < a) { + var e;if (c in f) { + e = f[c];g.call(d, e, c, f); + }c++; + } + }; + }; + + //拓展Array filter方法 + if (!Array.prototype.filter) { + Array.prototype.filter = function (b) { + if (this === void 0 || this === null) { + throw new TypeError(); + }var f = Object(this);var a = f.length >>> 0;if (typeof b !== "function") { + throw new TypeError(); + }var e = [];var d = arguments[1];for (var c = 0; c < a; c++) { + if (c in f) { + var g = f[c];if (b.call(d, g, c, f)) { + e.push(g); + } + } + }return e; + }; + }; + }; + + Common.prototype.init = function (target) { + var _this2 = this; + + //初始化页面上已有的select + $(target ? target : 'select[' + NAME + ']').each(function (index, select) { + var othis = $(select), + id = othis.attr(NAME), + hasLayuiRender = othis.next('.layui-form-select'), + hasRender = othis.next('.' + PNAME), + options = { + name: id, + disabled: select.disabled, + max: othis.attr(MAX) - 0, + isSearch: othis.attr(SEARCH) != undefined, + searchUrl: othis.attr(SEARCH), + isCreate: othis.attr(CREATE) != undefined, + radio: othis.attr(RADIO) != undefined, + skin: othis.attr(SKIN), + direction: othis.attr(DIRECTION), + optionsFirst: select.options[0], + height: othis.attr(HEIGHT), + formname: othis.attr('name') || othis.attr('_name'), + layverify: othis.attr('lay-verify') || othis.attr('_lay-verify'), + layverType: othis.attr('lay-verType'), + searchType: othis.attr(SEARCH_TYPE) == 'dl' ? 1 : 0, + showCount: othis.attr(SHOW_COUNT) - 0 + }, + value = othis.find('option[selected]').toArray().map(function (option) { + //获取已选中的数据 + return { + name: option.innerHTML, + value: option.value + }; + }), + fs = new FormSelects(options); + + fs.values = value; + + if (fs.config.init) { + fs.values = fs.config.init.map(function (item) { + if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) == 'object') { + return item; + } + return { + name: othis.find('option[value="' + item + '"]').text(), + value: item + }; + }).filter(function (item) { + return item.name; + }); + fs.config.init = fs.values.concat([]); + } else { + fs.config.init = value.concat([]); + } + + !fs.values && (fs.values = []); + + data[id] = fs; + + //先取消layui对select的渲染 + hasLayuiRender[0] && hasLayuiRender.remove(); + hasRender[0] && hasRender.remove(); + + //构造渲染div + var dinfo = _this2.renderSelect(id, fs.config.placeholder, select); + var heightStyle = !fs.config.height || fs.config.height == 'auto' ? '' : 'xm-hg style="height: 34px;"'; + var inputHtml = ['
              ', '', '
              ']; + var reElem = $('
              \n\t\t\t\t\t\n\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t\t\t' + inputHtml.join('') + '\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t
              \n\t\t\t\t\t
              ' + dinfo + '
              \n\t\t\t\t
              '); + + var $parent = $('
              '); + $parent.append(reElem); + othis.after($parent); + othis.attr('lay-ignore', ''); + othis.removeAttr('name') && othis.attr('_name', fs.config.formname); + othis.removeAttr('lay-verify') && othis.attr('_lay-verify', fs.config.layverify); + + //如果可搜索, 加上事件 + if (fs.config.isSearch) { + ajaxs[id] = $.extend({}, ajax, { searchUrl: fs.config.searchUrl }, ajaxs[id]); + $(document).on('input', 'div.' + PNAME + '[FS_ID="' + id + '"] .' + INPUT, function (e) { + _this2.search(id, e, fs.config.searchUrl); + }); + if (fs.config.searchUrl) { + //触发第一次请求事件 + _this2.triggerSearch(reElem, true); + } + } else { + //隐藏第二个dl + reElem.find('dl dd.' + FORM_DL_INPUT).css('display', 'none'); + } + }); + }; + + Common.prototype.search = function (id, e, searchUrl, call) { + var _this3 = this; + + var input = void 0; + if (call) { + input = call; + } else { + input = e.target; + var keyCode = e.keyCode; + if (keyCode === 9 || keyCode === 13 || keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) { + return false; + } + } + var inputValue = $.trim(input.value); + //过滤一下tips + this.changePlaceHolder($(input)); + + var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + searchUrl = ajaxConfig.searchUrl || searchUrl; + var fs = data[id], + isCreate = fs.config.isCreate, + reElem = $('dl[xid="' + id + '"]').parents('.' + FORM_SELECT); + //如果开启了远程搜索 + if (searchUrl) { + if (ajaxConfig.searchVal) { + inputValue = ajaxConfig.searchVal; + ajaxConfig.searchVal = ''; + } + if (!ajaxConfig.beforeSearch || ajaxConfig.beforeSearch && ajaxConfig.beforeSearch instanceof Function && ajaxConfig.beforeSearch(id, searchUrl, inputValue)) { + var delay = ajaxConfig.delay; + if (ajaxConfig.first) { + ajaxConfig.first = false; + delay = 10; + } + clearTimeout(fs.clearid); + fs.clearid = setTimeout(function () { + reElem.find('dl > *:not(.' + FORM_SELECT_TIPS + ')').remove(); + reElem.find('dd.' + FORM_NONE).addClass(FORM_EMPTY).text('请求中'); + _this3.ajax(id, searchUrl, inputValue, false, null, true); + }, delay); + } + } else { + reElem.find('dl .' + DD_HIDE).removeClass(DD_HIDE); + //遍历选项, 选择可以显示的值 + reElem.find('dl dd:not(.' + FORM_SELECT_TIPS + ')').each(function (idx, item) { + var _item = $(item); + var searchFun = events.filter[id] || data[id].config.filter; + if (searchFun && searchFun(id, inputValue, _this3.getItem(id, _item), _item.hasClass(DISABLED)) == true) { + _item.addClass(DD_HIDE); + } + }); + //控制分组名称 + reElem.find('dl dt').each(function (index, item) { + if (!$(item).nextUntil('dt', ':not(.' + DD_HIDE + ')').length) { + $(item).addClass(DD_HIDE); + } + }); + //动态创建 + this.create(id, isCreate, inputValue); + var shows = reElem.find('dl dd:not(.' + FORM_SELECT_TIPS + '):not(.' + DD_HIDE + ')'); + if (!shows.length) { + reElem.find('dd.' + FORM_NONE).addClass(FORM_EMPTY).text('无匹配项'); + } else { + reElem.find('dd.' + FORM_NONE).removeClass(FORM_EMPTY); + } + } + }; + + Common.prototype.isArray = function (obj) { + return Object.prototype.toString.call(obj) == "[object Array]"; + }; + + Common.prototype.triggerSearch = function (div, isCall) { + var _this4 = this; + + (div ? [div] : $('.' + FORM_SELECT).toArray()).forEach(function (reElem, index) { + reElem = $(reElem); + var id = reElem.find('dl').attr('xid'); + if (id && data[id] && data[id].config.isEmpty || isCall) { + _this4.search(id, null, null, data[id].config.searchType == 0 ? reElem.find('.' + LABEL + ' .' + INPUT) : reElem.find('dl .' + FORM_DL_INPUT + ' .' + INPUT)); + } + }); + }; + + Common.prototype.clearInput = function (id) { + var div = $('.' + PNAME + '[fs_id="' + id + '"]'); + var input = data[id].config.searchType == 0 ? div.find('.' + LABEL + ' .' + INPUT) : div.find('dl .' + FORM_DL_INPUT + ' .' + INPUT); + input.val(''); + }; + + Common.prototype.ajax = function (id, searchUrl, inputValue, isLinkage, linkageWidth, isSearch, successCallback, isReplace) { + var _this5 = this; + + var reElem = $('.' + PNAME + ' dl[xid="' + id + '"]').parents('.' + FORM_SELECT); + if (!reElem[0] || !searchUrl) { + return; + } + var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + var ajaxData = $.extend(true, {}, ajaxConfig.data); + ajaxData[ajaxConfig.searchName] = inputValue; + //是否需要对ajax添加随机时间 + //ajaxData['_'] = Date.now(); + $.ajax({ + type: ajaxConfig.type, + headers: ajaxConfig.header, + url: searchUrl, + data: ajaxConfig.dataType == 'json' ? JSON.stringify(ajaxData) : ajaxData, + success: function success(res) { + if (typeof res == 'string') { + res = JSON.parse(res); + } + ajaxConfig.beforeSuccess && ajaxConfig.beforeSuccess instanceof Function && (res = ajaxConfig.beforeSuccess(id, searchUrl, inputValue, res)); + if (_this5.isArray(res)) { + var newRes = {}; + newRes[ajaxConfig.response.statusName] = ajaxConfig.response.statusCode; + newRes[ajaxConfig.response.msgName] = ""; + newRes[ajaxConfig.response.dataName] = res; + res = newRes; + } + if (res[ajaxConfig.response.statusName] != ajaxConfig.response.statusCode) { + reElem.find('dd.' + FORM_NONE).addClass(FORM_EMPTY).text(res[ajaxConfig.response.msgName]); + } else { + reElem.find('dd.' + FORM_NONE).removeClass(FORM_EMPTY); + _this5.renderData(id, res[ajaxConfig.response.dataName], isLinkage, linkageWidth, isSearch, isReplace); + data[id].config.isEmpty = res[ajaxConfig.response.dataName].length == 0; + } + successCallback && successCallback(id); + ajaxConfig.success && ajaxConfig.success instanceof Function && ajaxConfig.success(id, searchUrl, inputValue, res); + }, + error: function error(err) { + reElem.find('dd[lay-value]:not(.' + FORM_SELECT_TIPS + ')').remove(); + reElem.find('dd.' + FORM_NONE).addClass(FORM_EMPTY).text('服务异常'); + ajaxConfig.error && ajaxConfig.error instanceof Function && ajaxConfig.error(id, searchUrl, inputValue, err); + } + }); + }; + + Common.prototype.renderData = function (id, dataArr, linkage, linkageWidth, isSearch, isReplace) { + var _this6 = this; + + if (linkage) { + //渲染多级联动 + this.renderLinkage(id, dataArr, linkageWidth); + return; + } + if (isReplace) { + this.renderReplace(id, dataArr); + return; + } + + var reElem = $('.' + PNAME + ' dl[xid="' + id + '"]').parents('.' + FORM_SELECT); + var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + var pcInput = reElem.find('.' + TDIV + ' input'); + + dataArr = this.exchangeData(id, dataArr); + var values = []; + reElem.find('dl').html(this.renderSelect(id, pcInput.attr('placeholder') || pcInput.attr('back'), dataArr.map(function (item) { + var itemVal = $.extend({}, item, { + innerHTML: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + sel: item[ajaxConfig.keySel], + disabled: item[ajaxConfig.keyDis], + type: item.type, + name: item[ajaxConfig.keyName] + }); + if (itemVal.sel) { + values.push(itemVal); + } + return itemVal; + }))); + + var label = reElem.find('.' + LABEL); + var dl = reElem.find('dl[xid]'); + if (isSearch) { + //如果是远程搜索, 这里需要判重 + var oldVal = data[id].values; + oldVal.forEach(function (item, index) { + dl.find('dd[lay-value="' + item.value + '"]').addClass(THIS); + }); + values.forEach(function (item, index) { + if (_this6.indexOf(oldVal, item) == -1) { + _this6.addLabel(id, label, item); + dl.find('dd[lay-value="' + item.value + '"]').addClass(THIS); + oldVal.push(item); + } + }); + } else { + values.forEach(function (item, index) { + _this6.addLabel(id, label, item); + dl.find('dd[lay-value="' + item.value + '"]').addClass(THIS); + }); + data[id].values = values; + } + this.commonHandler(id, label); + }; + + Common.prototype.renderLinkage = function (id, dataArr, linkageWidth) { + var result = [], + index = 0, + temp = { "0": dataArr }, + ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + db[id] = {}; + + var _loop = function _loop() { + var group = result[index++] = [], + _temp = temp; + temp = {}; + $.each(_temp, function (pid, arr) { + $.each(arr, function (idx, item) { + var val = { + pid: pid, + name: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal] + }; + db[id][val.value] = $.extend(item, val); + group.push(val); + var children = item[ajaxConfig.keyChildren]; + if (children && children.length) { + temp[val.value] = children; + } + }); + }); + }; + + do { + _loop(); + } while (Object.getOwnPropertyNames(temp).length); + + var reElem = $('.' + PNAME + ' dl[xid="' + id + '"]').parents('.' + FORM_SELECT); + var html = ['
              ']; + + $.each(result, function (idx, arr) { + var groupDiv = ['
              ']; + $.each(arr, function (idx2, item) { + var span = '
            • ' + item.name + '
            • '; + groupDiv.push(span); + }); + groupDiv.push('
              '); + html = html.concat(groupDiv); + }); + html.push('
              '); + html.push('
              '); + reElem.find('dl').html(html.join('')); + reElem.find('.' + INPUT).css('display', 'none'); //联动暂时不支持搜索 + }; + + Common.prototype.renderReplace = function (id, dataArr) { + var _this7 = this; + + var dl = $('.' + PNAME + ' dl[xid="' + id + '"]'); + var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + + dataArr = this.exchangeData(id, dataArr); + db[id] = dataArr; + + var html = dataArr.map(function (item) { + var itemVal = $.extend({}, item, { + innerHTML: item[ajaxConfig.keyName], + value: item[ajaxConfig.keyVal], + sel: item[ajaxConfig.keySel], + disabled: item[ajaxConfig.keyDis], + type: item.type, + name: item[ajaxConfig.keyName] + }); + return _this7.createDD(id, itemVal); + }).join(''); + + dl.find('dd:not(.' + FORM_SELECT_TIPS + '),dt:not([style])').remove(); + dl.find('dt[style]').after($(html)); + }; + + Common.prototype.exchangeData = function (id, arr) { + //这里处理树形结构 + var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + var childrenName = ajaxConfig['keyChildren']; + var disabledName = ajaxConfig['keyDis']; + db[id] = {}; + var result = this.getChildrenList(arr, childrenName, disabledName, [], false); + return result; + }; + + Common.prototype.getChildrenList = function (arr, childrenName, disabledName, pid, disabled) { + var result = [], + offset = 0; + for (var a = 0; a < arr.length; a++) { + var item = arr[a]; + if (item.type && item.type == 'optgroup') { + result.push(item); + continue; + } else { + offset++; + } + var parentIds = pid.concat([]); + parentIds.push(offset - 1 + '_E'); + item[FORM_TEAM_PID] = JSON.stringify(parentIds); + item[disabledName] = item[disabledName] || disabled; + result.push(item); + var child = item[childrenName]; + if (child && common.isArray(child) && child.length) { + item['XM_TREE_FOLDER'] = true; + var pidArr = parentIds.concat([]); + var childResult = this.getChildrenList(child, childrenName, disabledName, pidArr, item[disabledName]); + result = result.concat(childResult); + } + } + return result; + }; + + Common.prototype.create = function (id, isCreate, inputValue) { + if (isCreate && inputValue) { + var fs = data[id], + dl = $('[xid="' + id + '"]'), + tips = dl.find('dd.' + FORM_SELECT_TIPS + '.' + FORM_DL_INPUT), + tdd = null, + temp = dl.find('dd.' + TEMP); + dl.find('dd:not(.' + FORM_SELECT_TIPS + '):not(.' + TEMP + ')').each(function (index, item) { + if (inputValue == $(item).find('span').attr('name')) { + tdd = item; + } + }); + if (!tdd) { + //如果不存在, 则创建 + var val = fs.config.create(id, inputValue); + if (temp[0]) { + temp.attr('lay-value', val); + temp.find('span').text(inputValue); + temp.find('span').attr("name", inputValue); + temp.removeClass(DD_HIDE); + } else { + tips.after($(this.createDD(id, { + name: inputValue, + innerHTML: inputValue, + value: val + }, TEMP + ' ' + CREATE_LONG))); + } + } + } else { + $('[xid=' + id + '] dd.' + TEMP).remove(); + } + }; + + Common.prototype.createDD = function (id, item, clz) { + var ajaxConfig = ajaxs[id] ? ajaxs[id] : ajax; + var name = $.trim(item.innerHTML); + db[id][item.value] = $(item).is('option') ? item = function () { + var resultItem = {}; + resultItem[ajaxConfig.keyName] = name; + resultItem[ajaxConfig.keyVal] = item.value; + resultItem[ajaxConfig.keyDis] = item.disabled; + return resultItem; + }() : item; + var template = data[id].config.template(id, item); + var pid = item[FORM_TEAM_PID]; + pid ? pid = JSON.parse(pid) : pid = [-1]; + var attr = pid[0] == -1 ? '' : 'tree-id="' + pid.join('-') + '" tree-folder="' + !!item['XM_TREE_FOLDER'] + '"'; + return '
              \n\t\t\t\t\t
              \n\t\t\t\t\t\t\n\t\t\t\t\t\t' + template + '\n\t\t\t\t\t
              \n\t\t\t\t
              '; + }; + + Common.prototype.createQuickBtn = function (obj, right) { + return '
              ' + obj.name + '
              '; + }; + + Common.prototype.renderBtns = function (id, show, right) { + var _this8 = this; + + var quickBtn = []; + var dl = $('dl[xid="' + id + '"]'); + quickBtn.push('
              '); + $.each(data[id].config.btns, function (index, item) { + quickBtn.push(_this8.createQuickBtn(item, right)); + }); + quickBtn.push('
              '); + quickBtn.push(this.createQuickBtn({ icon: 'xm-iconfont icon-caidan', name: '' })); + return quickBtn.join(''); + }; + + Common.prototype.renderSelect = function (id, tips, select) { + var _this9 = this; + + db[id] = {}; + var arr = []; + if (data[id].config.btns.length) { + setTimeout(function () { + var dl = $('dl[xid="' + id + '"]'); + dl.parents('.' + FORM_SELECT).attr(SEARCH_TYPE, data[id].config.searchType); + dl.find('.' + CZ_GROUP).css('max-width', dl.prev().width() - 54 + 'px'); + }, 10); + arr.push(['
              ', this.renderBtns(id, null, '30px'), '
              ', '
              ', '', '', '
              '].join('')); + } else { + arr.push('
              ' + tips + '
              '); + } + if (this.isArray(select)) { + $(select).each(function (index, item) { + if (item) { + if (item.type && item.type === 'optgroup') { + arr.push('
              ' + item.name + '
              '); + } else { + arr.push(_this9.createDD(id, item)); + } + } + }); + } else { + $(select).find('*').each(function (index, item) { + if (item.tagName.toLowerCase() == 'option' && index == 0 && !item.value) { + return; + } + if (item.tagName.toLowerCase() === 'optgroup') { + arr.push('
              ' + item.label + '
              '); + } else { + arr.push(_this9.createDD(id, item)); + } + }); + } + arr.push('
              '); + arr.push('
              \u6CA1\u6709\u9009\u9879
              '); + return arr.join(''); + }; + + Common.prototype.on = function () { + var _this10 = this; + + //事件绑定 + this.one(); + + $(document).on('click', function (e) { + if (!$(e.target).parents('.' + FORM_TITLE)[0]) { + //清空input中的值 + $('.' + PNAME + ' dl .' + DD_HIDE).removeClass(DD_HIDE); + $('.' + PNAME + ' dl dd.' + FORM_EMPTY).removeClass(FORM_EMPTY); + $('.' + PNAME + ' dl dd.' + TEMP).remove(); + $.each(data, function (key, fs) { + _this10.clearInput(key); + if (!fs.values.length) { + _this10.changePlaceHolder($('div[FS_ID="' + key + '"] .' + LABEL)); + } + }); + } + $('.' + PNAME + ' .' + FORM_SELECTED).each(function (index, item) { + _this10.changeShow($(item).find('.' + FORM_TITLE), false); + }); + }); + }; + + Common.prototype.calcLabelLeft = function (label, w, call) { + var pos = this.getPosition(label[0]); + pos.y = pos.x + label[0].clientWidth; + var left = label[0].offsetLeft; + if (!label.find('span').length) { + left = 0; + } else if (call) { + //校正归位 + var span = label.find('span:last'); + span.css('display') == 'none' ? span = span.prev()[0] : span = span[0]; + var spos = this.getPosition(span); + spos.y = spos.x + span.clientWidth; + + if (spos.y > pos.y) { + left = left - (spos.y - pos.y) - 5; + } else { + left = 0; + } + } else { + if (w < 0) { + var _span = label.find(':last'); + _span.css('display') == 'none' ? _span = _span.prev()[0] : _span = _span[0]; + var _spos = this.getPosition(_span); + _spos.y = _spos.x + _span.clientWidth; + if (_spos.y > pos.y) { + left -= 10; + } + } else { + if (left < 0) { + left += 10; + } + if (left > 0) { + left = 0; + } + } + } + label.css('left', left + 'px'); + }; + + Common.prototype.one = function (target) { + var _this11 = this; + + //一次性事件绑定 + $(target ? target : document).off('click', '.' + FORM_TITLE).on('click', '.' + FORM_TITLE, function (e) { + var othis = $(e.target), + title = othis.is(FORM_TITLE) ? othis : othis.parents('.' + FORM_TITLE), + dl = title.next(), + id = dl.attr('xid'); + + //清空非本select的input val + $('dl[xid]').not(dl).each(function (index, item) { + _this11.clearInput($(item).attr('xid')); + }); + $('dl[xid]').not(dl).find('dd.' + DD_HIDE).removeClass(DD_HIDE); + + //如果是disabled select + if (title.hasClass(DIS)) { + return false; + } + //如果点击的是右边的三角或者只读的input + if (othis.is('.' + SANJIAO) || othis.is('.' + INPUT + '[readonly]')) { + _this11.changeShow(title, !title.parents('.' + FORM_SELECT).hasClass(FORM_SELECTED)); + return false; + } + //如果点击的是input的右边, focus一下 + if (title.find('.' + INPUT + ':not(readonly)')[0]) { + var input = title.find('.' + INPUT), + epos = { x: e.pageX, y: e.pageY }, + pos = _this11.getPosition(title[0]), + width = title.width(); + while (epos.x > pos.x) { + if ($(document.elementFromPoint(epos.x, epos.y)).is(input)) { + input.focus(); + _this11.changeShow(title, true); + return false; + } + epos.x -= 50; + } + } + + //如果点击的是可搜索的input + if (othis.is('.' + INPUT)) { + _this11.changeShow(title, true); + return false; + } + //如果点击的是x按钮 + if (othis.is('i[fsw="' + NAME + '"]')) { + var val = _this11.getItem(id, othis), + dd = dl.find('dd[lay-value=\'' + val.value + '\']'); + if (dd.hasClass(DISABLED)) { + //如果是disabled状态, 不可选, 不可删 + return false; + } + _this11.handlerLabel(id, dd, false, val); + return false; + } + + _this11.changeShow(title, !title.parents('.' + FORM_SELECT).hasClass(FORM_SELECTED)); + return false; + }); + $(target ? target : document).off('click', 'dl.' + DL).on('click', 'dl.' + DL, function (e) { + var othis = $(e.target); + if (othis.is('.' + LINKAGE) || othis.parents('.' + LINKAGE)[0]) { + //linkage的处理 + othis = othis.is('li') ? othis : othis.parents('li[xm-value]'); + var _group = othis.parents('.xm-select-linkage-group'), + _id = othis.parents('dl').attr('xid'); + if (!_id) { + return false; + } + //激活li + _group.find('.xm-select-active').removeClass('xm-select-active'); + othis.addClass('xm-select-active'); + //激活下一个group, 激活前显示对应数据 + _group.nextAll('.xm-select-linkage-group').addClass('xm-select-linkage-hide'); + var nextGroup = _group.next('.xm-select-linkage-group'); + nextGroup.find('li').addClass('xm-select-linkage-hide'); + nextGroup.find('li[pid="' + othis.attr('xm-value') + '"]').removeClass('xm-select-linkage-hide'); + //如果没有下一个group, 或没有对应的值 + if (!nextGroup[0] || nextGroup.find('li:not(.xm-select-linkage-hide)').length == 0) { + var vals = [], + index = 0, + isAdd = !othis.hasClass('xm-select-this'); + if (data[_id].config.radio) { + othis.parents('.xm-select-linkage').find('.xm-select-this').removeClass('xm-select-this'); + } + do { + vals[index++] = { + name: othis.find('span').text(), + value: othis.attr('xm-value') + }; + othis = othis.parents('.xm-select-linkage-group').prev().find('li[xm-value="' + othis.attr('pid') + '"]'); + } while (othis.length); + vals.reverse(); + var val = { + name: vals.map(function (item) { + return item.name; + }).join('/'), + value: vals.map(function (item) { + return item.value; + }).join('/') + }; + _this11.handlerLabel(_id, null, isAdd, val); + } else { + nextGroup.removeClass('xm-select-linkage-hide'); + } + return false; + } + + if (othis.is('dl')) { + return false; + } + + if (othis.is('dt')) { + othis.nextUntil('dt').each(function (index, item) { + item = $(item); + if (item.hasClass(DISABLED) || item.hasClass(THIS)) {} else { + item.find('i:not(.icon-expand)').click(); + } + }); + return false; + } + var dd = othis.is('dd') ? othis : othis.parents('dd'); + var id = dd.parent('dl').attr('xid'); + + if (dd.hasClass(DISABLED)) { + //被禁用选项的处理 + return false; + } + + //菜单功效 + if (othis.is('i.icon-caidan')) { + var opens = [], + closes = []; + othis.parents('dl').find('dd[tree-folder="true"]').each(function (index, item) { + $(item).attr('xm-tree-hidn') == undefined ? opens.push(item) : closes.push(item); + }); + var arr = closes.length ? closes : opens; + arr.forEach(function (item) { + return item.click(); + }); + return false; + } + //树状结构的选择 + var treeId = dd.attr('tree-id'); + if (treeId) { + //忽略右边的图标 + if (othis.is('i:not(.icon-expand)')) { + _this11.handlerLabel(id, dd, !dd.hasClass(THIS)); + return false; + } + var ajaxConfig = ajaxs[id] || ajax; + var treeConfig = ajaxConfig.tree; + var childrens = dd.nextAll('dd[tree-id^="' + treeId + '"]'); + if (childrens && childrens.length) { + var len = childrens[0].clientHeight; + len ? (_this11.addTreeHeight(dd, len), len = 0) : (len = dd.attr('xm-tree-hidn') || 36, dd.removeAttr('xm-tree-hidn'), dd.find('>i').remove(), childrens = childrens.filter(function (index, item) { + return $(item).attr('tree-id').split('-').length - 1 == treeId.split('-').length; + })); + childrens.animate({ + height: len + }, 150); + return false; + } else { + if (treeConfig.nextClick && treeConfig.nextClick instanceof Function) { + treeConfig.nextClick(id, _this11.getItem(id, dd), function (res) { + if (!res || !res.length) { + _this11.handlerLabel(id, dd, !dd.hasClass(THIS)); + } else { + dd.attr('tree-folder', 'true'); + var ddChilds = []; + res.forEach(function (item, idx) { + item.innerHTML = item[ajaxConfig.keyName]; + item[FORM_TEAM_PID] = JSON.stringify(treeId.split('-').concat([idx])); + ddChilds.push(_this11.createDD(id, item)); + db[id][item[ajaxConfig.keyVal]] = item; + }); + dd.after(ddChilds.join('')); + } + }); + return false; + } + } + } + + if (dd.hasClass(FORM_SELECT_TIPS)) { + //tips的处理 + var btn = othis.is('.' + CZ) ? othis : othis.parents('.' + CZ); + if (!btn[0]) { + return false; + } + var method = btn.attr('method'); + var obj = data[id].config.btns.filter(function (bean) { + return bean.name == method; + })[0]; + obj && obj.click && obj.click instanceof Function && obj.click(id, _this11); + return false; + } + _this11.handlerLabel(id, dd, !dd.hasClass(THIS)); + return false; + }); + }; + + Common.prototype.addTreeHeight = function (dd, len) { + var _this12 = this; + + var treeId = dd.attr('tree-id'); + var childrens = dd.nextAll('dd[tree-id^="' + treeId + '"]'); + if (childrens.length) { + dd.append(''); + dd.attr('xm-tree-hidn', len); + childrens.each(function (index, item) { + var that = $(item); + _this12.addTreeHeight(that, len); + }); + } + }; + + var db = {}; + Common.prototype.getItem = function (id, value) { + if (value instanceof $) { + if (value.is('i[fsw="' + NAME + '"]')) { + var span = value.parent(); + return db[id][value] || { + name: span.find('font').text(), + value: span.attr('value') + }; + } + var val = value.attr('lay-value'); + return !db[id][val] ? db[id][val] = { + name: value.find('span[name]').attr('name'), + value: val + } : db[id][val]; + } else if (typeof value == 'string' && value.indexOf('/') != -1) { + return db[id][value] || { + name: this.valToName(id, value), + value: value + }; + } + return db[id][value]; + }; + + Common.prototype.linkageAdd = function (id, val) { + var dl = $('dl[xid="' + id + '"]'); + dl.find('.xm-select-active').removeClass('xm-select-active'); + var vs = val.value.split('/'); + var pid = void 0, + li = void 0, + index = 0; + var lis = []; + do { + pid = vs[index]; + li = dl.find('.xm-select-linkage-group' + (index + 1) + ' li[xm-value="' + pid + '"]'); + li[0] && lis.push(li); + index++; + } while (li.length && pid != undefined); + if (lis.length == vs.length) { + $.each(lis, function (idx, item) { + item.addClass('xm-select-this'); + }); + } + }; + + Common.prototype.linkageDel = function (id, val) { + var dl = $('dl[xid="' + id + '"]'); + var vs = val.value.split('/'); + var pid = void 0, + li = void 0, + index = vs.length - 1; + do { + pid = vs[index]; + li = dl.find('.xm-select-linkage-group' + (index + 1) + ' li[xm-value="' + pid + '"]'); + if (!li.parent().next().find('li[pid=' + pid + '].xm-select-this').length) { + li.removeClass('xm-select-this'); + } + index--; + } while (li.length && pid != undefined); + }; + + Common.prototype.valToName = function (id, val) { + var dl = $('dl[xid="' + id + '"]'); + var vs = (val + "").split('/'); + if (!vs.length) { + return null; + } + var names = []; + $.each(vs, function (idx, item) { + var name = dl.find('.xm-select-linkage-group' + (idx + 1) + ' li[xm-value="' + item + '"] span').text(); + names.push(name); + }); + return names.length == vs.length ? names.join('/') : null; + }; + + Common.prototype.commonHandler = function (key, label) { + if (!label || !label[0]) { + return; + } + this.checkHideSpan(key, label); + //计算input的提示语 + this.changePlaceHolder(label); + //计算高度 + this.retop(label.parents('.' + FORM_SELECT)); + this.calcLabelLeft(label, 0, true); + //表单默认值 + this.setHidnVal(key, label); + //title值 + label.parents('.' + FORM_TITLE + ' .' + NAME).attr('title', data[key].values.map(function (val) { + return val.name; + }).join(',')); + }; + + Common.prototype.initVal = function (id) { + var _this13 = this; + + var target = {}; + if (id) { + target[id] = data[id]; + } else { + target = data; + } + $.each(target, function (key, val) { + var values = val.values, + div = $('dl[xid="' + key + '"]').parent(), + label = div.find('.' + LABEL), + dl = div.find('dl'); + dl.find('dd.' + THIS).removeClass(THIS); + + var _vals = values.concat([]); + _vals.concat([]).forEach(function (item, index) { + _this13.addLabel(key, label, item); + dl.find('dd[lay-value="' + item.value + '"]').addClass(THIS); + }); + if (val.config.radio) { + _vals.length && values.push(_vals[_vals.length - 1]); + } + _this13.commonHandler(key, label); + }); + }; + + Common.prototype.setHidnVal = function (key, label) { + if (!label || !label[0]) { + return; + } + label.parents('.' + PNAME).find('.' + HIDE_INPUT).val(data[key].values.map(function (val) { + return val.value; + }).join(',')); + }; + + Common.prototype.handlerLabel = function (id, dd, isAdd, oval, notOn) { + var div = $('[xid="' + id + '"]').prev().find('.' + LABEL), + val = dd && this.getItem(id, dd), + vals = data[id].values, + on = data[id].config.on || events.on[id], + endOn = data[id].config.endOn || events.endOn[id]; + if (oval) { + val = oval; + } + var fs = data[id]; + if (isAdd && fs.config.max && fs.values.length >= fs.config.max) { + var maxTipsFun = events.maxTips[id] || data[id].config.maxTips; + maxTipsFun && maxTipsFun(id, vals.concat([]), val, fs.config.max); + return; + } + if (!notOn) { + if (on && on instanceof Function && on(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)) == false) { + return; + } + } + var dl = $('dl[xid="' + id + '"]'); + isAdd ? (dd && dd[0] ? (dd.addClass(THIS), dd.removeClass(TEMP)) : dl.find('.xm-select-linkage')[0] && this.linkageAdd(id, val), this.addLabel(id, div, val), vals.push(val)) : (dd && dd[0] ? dd.removeClass(THIS) : dl.find('.xm-select-linkage')[0] && this.linkageDel(id, val), this.delLabel(id, div, val), this.remove(vals, val)); + if (!div[0]) return; + //单选选完后直接关闭选择域 + if (fs.config.radio) { + this.changeShow(div, false); + } + //移除表单验证的红色边框 + div.parents('.' + FORM_TITLE).prev().removeClass('layui-form-danger'); + + //清空搜索值 + fs.config.clearInput && this.clearInput(id); + + this.commonHandler(id, div); + + !notOn && endOn && endOn instanceof Function && endOn(id, vals.concat([]), val, isAdd, dd && dd.hasClass(DISABLED)); + }; + + Common.prototype.addLabel = function (id, div, val) { + if (!val) return; + var tips = 'fsw="' + NAME + '"'; + var _ref = [$('' + val.name + ''), $('')], + $label = _ref[0], + $close = _ref[1]; + + $label.append($close); + //如果是radio模式 + var fs = data[id]; + if (fs.config.radio) { + fs.values.length = 0; + $('dl[xid="' + id + '"]').find('dd.' + THIS + ':not([lay-value="' + val.value + '"])').removeClass(THIS); + div.find('span').remove(); + } + //如果是固定高度 + div.find('input').css('width', '50px'); + div.find('input').before($label); + }; + + Common.prototype.delLabel = function (id, div, val) { + if (!val) return; + div.find('span[value="' + val.value + '"]:first').remove(); + }; + + Common.prototype.checkHideSpan = function (id, div) { + var parentHeight = div.parents('.' + NAME)[0].offsetHeight + 5; + div.find('span.xm-span-hide').removeClass('xm-span-hide'); + div.find('span[style]').remove(); + + var count = data[id].config.showCount; + div.find('span').each(function (index, item) { + if (index >= count) { + $(item).addClass('xm-span-hide'); + } + }); + + var prefix = div.find('span:eq(' + count + ')'); + prefix[0] && prefix.before($(' + ' + (div.find('span').length - count) + '')); + }; + + Common.prototype.retop = function (div) { + //计算dl显示的位置 + var dl = div.find('dl'), + top = div.offset().top + div.outerHeight() + 5 - $win.scrollTop(), + dlHeight = dl.outerHeight(); + var up = div.hasClass('layui-form-selectup') || dl.css('top').indexOf('-') != -1 || top + dlHeight > $win.height() && top >= dlHeight; + div = div.find('.' + NAME); + + var fs = data[dl.attr('xid')]; + var base = dl.parents('.layui-form-pane')[0] && dl.prev()[0].clientHeight > 38 ? 14 : 10; + if (fs && fs.config.direction == 'up' || up) { + up = true; + if (fs && fs.config.direction == 'down') { + up = false; + } + } + var reHeight = div[0].offsetTop + div.height() + base; + if (up) { + dl.css({ + top: 'auto', + bottom: reHeight + 3 + 'px' + }); + } else { + dl.css({ + top: reHeight + 'px', + bottom: 'auto' + }); + } + }; + + Common.prototype.changeShow = function (children, isShow) { + //显示于隐藏 + $('.layui-form-selected').removeClass('layui-form-selected'); + var top = children.parents('.' + FORM_SELECT), + realShow = top.hasClass(FORM_SELECTED), + id = top.find('dl').attr('xid'); + $('.' + PNAME + ' .' + FORM_SELECT).not(top).removeClass(FORM_SELECTED); + if (isShow) { + this.retop(top); + top.addClass(FORM_SELECTED); + top.find('.' + INPUT).focus(); + if (!top.find('dl dd[lay-value]:not(.' + FORM_SELECT_TIPS + ')').length) { + top.find('dl .' + FORM_NONE).addClass(FORM_EMPTY); + } + } else { + top.removeClass(FORM_SELECTED); + this.clearInput(id); + top.find('dl .' + FORM_EMPTY).removeClass(FORM_EMPTY); + top.find('dl dd.' + DD_HIDE).removeClass(DD_HIDE); + top.find('dl dd.' + TEMP).remove(); + //计算ajax数据是否为空, 然后重新请求数据 + if (id && data[id] && data[id].config.isEmpty) { + this.triggerSearch(top); + } + this.changePlaceHolder(top.find('.' + LABEL)); + } + if (isShow != realShow) { + var openFun = data[id].config.opened || events.opened[id]; + isShow && openFun && openFun instanceof Function && openFun(id); + var closeFun = data[id].config.closed || events.closed[id]; + !isShow && closeFun && closeFun instanceof Function && closeFun(id); + } + }; + + Common.prototype.changePlaceHolder = function (div) { + //显示于隐藏提示语 + //调整pane模式下的高度 + var title = div.parents('.' + FORM_TITLE); + title[0] || (title = div.parents('dl').prev()); + if (!title[0]) { + return; + } + + var id = div.parents('.' + PNAME).find('dl[xid]').attr('xid'); + if (data[id] && data[id].config.height) {//既然固定高度了, 那就看着办吧 + + } else { + var height = title.find('.' + NAME)[0].clientHeight; + title.css('height', (height > 36 ? height + 4 : height) + 'px'); + //如果是layui pane模式, 处理label的高度 + var label = title.parents('.' + PNAME).parent().prev(); + if (label.is('.layui-form-label') && title.parents('.layui-form-pane')[0]) { + height = height > 36 ? height + 4 : height; + title.css('height', height + 'px'); + label.css({ + height: height + 2 + 'px', + lineHeight: height - 18 + 'px' + }); + } + } + + var input = title.find('.' + TDIV + ' input'), + isShow = !div.find('span:last')[0] && !title.find('.' + INPUT).val(); + if (isShow) { + var ph = input.attr('back'); + input.removeAttr('back'); + input.attr('placeholder', ph); + } else { + var _ph = input.attr('placeholder'); + input.removeAttr('placeholder'); + input.attr('back', _ph); + } + }; + + Common.prototype.indexOf = function (arr, val) { + for (var i = 0; i < arr.length; i++) { + if (arr[i].value == val || arr[i].value == (val ? val.value : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) { + return i; + } + } + return -1; + }; + + Common.prototype.remove = function (arr, val) { + var idx = this.indexOf(arr, val ? val.value : val); + if (idx > -1) { + arr.splice(idx, 1); + return true; + } + return false; + }; + + Common.prototype.selectAll = function (id, isOn, skipDis) { + var _this14 = this; + + var dl = $('[xid="' + id + '"]'); + if (!dl[0]) { + return; + } + if (dl.find('.xm-select-linkage')[0]) { + return; + } + dl.find('dd[lay-value]:not(.' + FORM_SELECT_TIPS + '):not(.' + THIS + ')' + (skipDis ? ':not(.' + DISABLED + ')' : '')).each(function (index, item) { + item = $(item); + var val = _this14.getItem(id, item); + _this14.handlerLabel(id, dl.find('dd[lay-value="' + val.value + '"]'), true, val, !isOn); + }); + }; + + Common.prototype.removeAll = function (id, isOn, skipDis) { + var _this15 = this; + + var dl = $('[xid="' + id + '"]'); + if (!dl[0]) { + return; + } + if (dl.find('.xm-select-linkage')[0]) { + //针对多级联动的处理 + data[id].values.concat([]).forEach(function (item, idx) { + var vs = item.value.split('/'); + var pid = void 0, + li = void 0, + index = 0; + do { + pid = vs[index++]; + li = dl.find('.xm-select-linkage-group' + index + ':not(.xm-select-linkage-hide) li[xm-value="' + pid + '"]'); + li.click(); + } while (li.length && pid != undefined); + }); + return; + } + data[id].values.concat([]).forEach(function (item, index) { + if (skipDis && dl.find('dd[lay-value="' + item.value + '"]').hasClass(DISABLED)) {} else { + _this15.handlerLabel(id, dl.find('dd[lay-value="' + item.value + '"]'), false, item, !isOn); + } + }); + }; + + Common.prototype.reverse = function (id, isOn, skipDis) { + var _this16 = this; + + var dl = $('[xid="' + id + '"]'); + if (!dl[0]) { + return; + } + if (dl.find('.xm-select-linkage')[0]) { + return; + } + dl.find('dd[lay-value]:not(.' + FORM_SELECT_TIPS + ')' + (skipDis ? ':not(.' + DISABLED + ')' : '')).each(function (index, item) { + item = $(item); + var val = _this16.getItem(id, item); + _this16.handlerLabel(id, dl.find('dd[lay-value="' + val.value + '"]'), !item.hasClass(THIS), val, !isOn); + }); + }; + + Common.prototype.skin = function (id) { + var skins = ['default', 'primary', 'normal', 'warm', 'danger']; + var skin = skins[Math.floor(Math.random() * skins.length)]; + $('dl[xid="' + id + '"]').parents('.' + PNAME).find('.' + FORM_SELECT).attr('xm-select-skin', skin); + this.check(id) && this.commonHandler(id, $('dl[xid="' + id + '"]').parents('.' + PNAME).find('.' + LABEL)); + }; + + Common.prototype.getPosition = function (e) { + var x = 0, + y = 0; + while (e != null) { + x += e.offsetLeft; + y += e.offsetTop; + e = e.offsetParent; + } + return { x: x, y: y }; + }; + + Common.prototype.onreset = function () { + //监听reset按钮, 然后重置多选 + $(document).on('click', '[type=reset]', function (e) { + $(e.target).parents('form').find('.' + PNAME + ' dl[xid]').each(function (index, item) { + var id = item.getAttribute('xid'), + dl = $(item), + dd = void 0, + temp = {}; + common.removeAll(id); + data[id].config.init.forEach(function (val, idx) { + if (val && (!temp[val] || data[id].config.repeat) && (dd = dl.find('dd[lay-value="' + val.value + '"]'))[0]) { + common.handlerLabel(id, dd, true); + temp[val] = 1; + } + }); + }); + }); + }; + + Common.prototype.bindEvent = function (name, id, fun) { + if (id && id instanceof Function) { + fun = id; + id = null; + } + if (fun && fun instanceof Function) { + if (!id) { + $.each(data, function (id, val) { + data[id] ? data[id].config[name] = fun : events[name][id] = fun; + }); + } else { + data[id] ? (data[id].config[name] = fun, delete events[name][id]) : events[name][id] = fun; + } + } + }; + + Common.prototype.check = function (id, notAutoRender) { + if ($('dl[xid="' + id + '"]').length) { + return true; + } else if ($('select[xm-select="' + id + '"]').length) { + if (!notAutoRender) { + this.render(id, $('select[xm-select="' + id + '"]')); + return true; + } + } else { + delete data[id]; + return false; + } + }; + + Common.prototype.render = function (id, select) { + common.init(select); + common.one($('dl[xid="' + id + '"]').parents('.' + PNAME)); + common.initVal(id); + }; + + Common.prototype.log = function (obj) { + console.log(obj); + }; + + var Select4 = function Select4() { + this.v = v; + this.render(); + }; + var common = new Common(); + + Select4.prototype.value = function (id, type, isAppend) { + if (typeof id != 'string') { + return []; + } + var fs = data[id]; + if (!common.check(id)) { + return []; + } + if (typeof type == 'string' || type == undefined) { + var arr = fs.values.concat([]) || []; + if (type == 'val') { + return arr.map(function (val) { + return val.value; + }); + } + if (type == 'valStr') { + return arr.map(function (val) { + return val.value; + }).join(','); + } + if (type == 'name') { + return arr.map(function (val) { + return val.name; + }); + } + if (type == 'nameStr') { + return arr.map(function (val) { + return val.name; + }).join(','); + } + return arr; + } + if (common.isArray(type)) { + var dl = $('[xid="' + id + '"]'), + temp = {}, + dd = void 0, + isAdd = true; + if (isAppend == false) { + //删除传入的数组 + isAdd = false; + } else if (isAppend == true) { + //追加模式 + isAdd = true; + } else { + //删除原有的数据 + common.removeAll(id); + } + if (isAdd) { + fs.values.forEach(function (val, index) { + temp[val.value] = 1; + }); + } + type.forEach(function (val, index) { + if (val && (!temp[val] || fs.config.repeat)) { + if ((dd = dl.find('dd[lay-value="' + val + '"]'))[0]) { + common.handlerLabel(id, dd, isAdd, null, true); + temp[val] = 1; + } else { + var name = common.valToName(id, val); + if (name) { + common.handlerLabel(id, dd, isAdd, common.getItem(id, val), true); + temp[val] = 1; + } + } + } + }); + } + }; + + Select4.prototype.on = function (id, fun, isEnd) { + common.bindEvent(isEnd ? 'endOn' : 'on', id, fun); + return this; + }; + + Select4.prototype.filter = function (id, fun) { + common.bindEvent('filter', id, fun); + return this; + }; + + Select4.prototype.maxTips = function (id, fun) { + common.bindEvent('maxTips', id, fun); + return this; + }; + + Select4.prototype.opened = function (id, fun) { + common.bindEvent('opened', id, fun); + return this; + }; + + Select4.prototype.closed = function (id, fun) { + common.bindEvent('closed', id, fun); + return this; + }; + + Select4.prototype.config = function (id, config, isJson) { + if (id && (typeof id === 'undefined' ? 'undefined' : _typeof(id)) == 'object') { + isJson = config == true; + config = id; + id = null; + } + if (config && (typeof config === 'undefined' ? 'undefined' : _typeof(config)) == 'object') { + if (isJson) { + config.header || (config.header = {}); + config.header['Content-Type'] = 'application/json; charset=UTF-8'; + config.dataType = 'json'; + } + id ? (ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, config), !common.check(id) && this.render(id), data[id] && config.direction && (data[id].config.direction = config.direction), data[id] && config.clearInput && (data[id].config.clearInput = true), config.searchUrl && data[id] && common.triggerSearch($('.' + PNAME + ' dl[xid="' + id + '"]').parents('.' + FORM_SELECT), true)) : ($.extend(true, ajax, config), $.each(ajaxs, function (key, item) { + $.extend(true, item, config); + })); + } + return this; + }; + + Select4.prototype.render = function (id, options) { + var _ref2; + + if (id && (typeof id === 'undefined' ? 'undefined' : _typeof(id)) == 'object') { + options = id; + id = null; + } + var config = options ? (_ref2 = { + init: options.init, + disabled: options.disabled, + max: options.max, + isSearch: options.isSearch, + searchUrl: options.searchUrl, + isCreate: options.isCreate, + radio: options.radio, + skin: options.skin, + direction: options.direction, + height: options.height, + formname: options.formname, + layverify: options.layverify, + layverType: options.layverType, + showCount: options.showCount, + placeholder: options.placeholder, + create: options.create, + filter: options.filter, + maxTips: options.maxTips, + on: options.on + }, _defineProperty(_ref2, 'on', options.on), _defineProperty(_ref2, 'opened', options.opened), _defineProperty(_ref2, 'closed', options.closed), _defineProperty(_ref2, 'template', options.template), _defineProperty(_ref2, 'clearInput', options.clearInput), _ref2) : {}; + + options && options.searchType != undefined && (config.searchType = options.searchType == 'dl' ? 1 : 0); + + if (id) { + fsConfigs[id] = {}; + $.extend(fsConfigs[id], data[id] ? data[id].config : {}, config); + } else { + $.extend(fsConfig, config); + } + + ($('select[' + NAME + '="' + id + '"]')[0] ? $('select[' + NAME + '="' + id + '"]') : $('select[' + NAME + ']')).each(function (index, select) { + var sid = select.getAttribute(NAME); + common.render(sid, select); + setTimeout(function () { + return common.setHidnVal(sid, $('select[xm-select="' + sid + '"] + div.' + PNAME + ' .' + LABEL)); + }, 10); + }); + return this; + }; + + Select4.prototype.disabled = function (id) { + var target = {}; + id ? common.check(id) && (target[id] = data[id]) : target = data; + + $.each(target, function (key, val) { + $('dl[xid="' + key + '"]').prev().addClass(DIS); + }); + return this; + }; + + Select4.prototype.undisabled = function (id) { + var target = {}; + id ? common.check(id) && (target[id] = data[id]) : target = data; + + $.each(target, function (key, val) { + $('dl[xid="' + key + '"]').prev().removeClass(DIS); + }); + return this; + }; + + Select4.prototype.data = function (id, type, config) { + if (!id || !type || !config) { + common.log('id: ' + id + ' param error !!!'); + return this; + } + if (!common.check(id)) { + common.log('id: ' + id + ' not render !!!'); + return this; + } + this.value(id, []); + this.config(id, config); + if (type == 'local') { + common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); + } else if (type == 'server') { + common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100'); + } + return this; + }; + + Select4.prototype.btns = function (id, btns, config) { + if (id && common.isArray(id)) { + btns = id; + id = null; + } + if (!btns || !common.isArray(btns)) { + return this; + }; + var target = {}; + id ? common.check(id) && (target[id] = data[id]) : target = data; + + btns = btns.map(function (obj) { + if (typeof obj == 'string') { + if (obj == 'select') { + return quickBtns[0]; + } + if (obj == 'remove') { + return quickBtns[1]; + } + if (obj == 'reverse') { + return quickBtns[2]; + } + if (obj == 'skin') { + return quickBtns[3]; + } + } + return obj; + }); + + $.each(target, function (key, val) { + val.config.btns = btns; + var dd = $('dl[xid="' + key + '"]').find('.' + FORM_SELECT_TIPS + ':first'); + if (btns.length) { + var show = config && config.show && (config.show == 'name' || config.show == 'icon') ? config.show : ''; + var html = common.renderBtns(key, show, config && config.space ? config.space : '30px'); + dd.html(html); + } else { + var pcInput = dd.parents('.' + FORM_SELECT).find('.' + TDIV + ' input'); + var _html = pcInput.attr('placeholder') || pcInput.attr('back'); + dd.html(_html); + dd.removeAttr('style'); + } + }); + + return this; + }; + + Select4.prototype.search = function (id, val) { + if (id && common.check(id)) { + ajaxs[id] = $.extend(true, {}, ajaxs[id] || ajax, { + first: true, + searchVal: val + }); + common.triggerSearch($('dl[xid="' + id + '"]').parents('.' + FORM_SELECT), true); + } + return this; + }; + + Select4.prototype.replace = function (id, type, config) { + var _this17 = this; + + if (!id || !type || !config) { + common.log('id: ' + id + ' param error !!!'); + return this; + } + if (!common.check(id, true)) { + common.log('id: ' + id + ' not render !!!'); + return this; + } + var oldVals = this.value(id, 'val'); + this.value(id, []); + this.config(id, config); + if (type == 'local') { + common.renderData(id, config.arr, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, true); + this.value(id, oldVals, true); + } else if (type == 'server') { + common.ajax(id, config.url, config.keyword, config.linkage == true, config.linkageWidth ? config.linkageWidth : '100', false, function (id) { + _this17.value(id, oldVals, true); + }, true); + } + }; + + return new Select4(); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/formSelects/formSelects-v4.min.js b/public/static/layui/plugin/formSelects/formSelects-v4.min.js new file mode 100644 index 0000000..7316855 --- /dev/null +++ b/public/static/layui/plugin/formSelects/formSelects-v4.min.js @@ -0,0 +1 @@ +"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _defineProperty(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}(function(e,t,n){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"){module.exports=n()}else if(typeof define==="function"&&define.amd){define(n)}else if(t.layui&&e.define){e.define(["jquery"],function(e){e("formSelects",n())})}else{t.formSelects=n()}})(typeof layui=="undefined"?null:layui,window,function(){var t="4.0.0.0910",v="xm-select",m="xm-select-parent",y="xm-select-input",g="xm-select--suffix",w="xm-select-this",x="xm-select-label",k="xm-select-search",b="xm-select-search-type",C="xm-select-show-count",S="xm-select-create",d="xm-select-create-long",T="xm-select-max",L="xm-select-skin",j="xm-select-direction",A="xm-select-height",E="xm-dis-disabled",N="xm-select-dis",p="xm-select-temp",D="xm-select-radio",H="xm-select-linkage",F="xm-select-dl",h="xm-select-hide",_="xm-hide-input",O="xm-select-sj",e="xm-icon-close",I="xm-select-title",P="xm-form-select",f="xm-form-selected",V="xm-select-none",U="xm-select-empty",M="xm-input",W="xm-dl-input",J="xm-select-tips",s="xm-iconfont",B="XM_PID_VALUE",R="xm-cz",l="xm-cz-group",n="请选择",q={},z={on:{},endOn:{},filter:{},maxTips:{},opened:{},closed:{}},X={type:"get",header:{},first:true,data:{},searchUrl:"",searchName:"keyword",searchVal:null,keyName:"name",keyVal:"value",keySel:"selected",keyDis:"disabled",keyChildren:"children",dataType:"",delay:500,beforeSuccess:null,success:null,error:null,beforeSearch:null,response:{statusCode:0,statusName:"code",msgName:"msg",dataName:"data"},tree:{nextClick:function e(t,n,i){i([])},folderChoose:true,lazy:true}},i=[{icon:"xm-iconfont icon-quanxuan",name:"全选",click:function e(t,n){n.selectAll(t,true,true)}},{icon:"xm-iconfont icon-qingkong",name:"清空",click:function e(t,n){n.removeAll(t,true,true)}},{icon:"xm-iconfont icon-fanxuan",name:"反选",click:function e(t,n){n.reverse(t,true,true)}},{icon:"xm-iconfont icon-pifu",name:"换肤",click:function e(t,n){n.skin(t)}}],Q=window.$||window.layui&&window.layui.jquery,c=Q(window),Y={},a={},r={},$=function e(t){var l=this;this.config={name:null,max:null,maxTips:function e(t,n,i,a){var r=Q('[xid="'+l.config.name+'"]').prev().find("."+v);if(r.parents(".layui-form-item[pane]").length){r=r.parents(".layui-form-item[pane]")}r.attr("style","border-color: red !important");setTimeout(function(){r.removeAttr("style")},300)},init:null,on:null,opened:null,closed:null,filter:function e(t,n,i,a){return i.name.indexOf(n)==-1},clearid:-1,direction:"auto",height:null,isEmpty:false,btns:[i[0],i[1],i[2]],searchType:0,create:function e(t,n){return Date.now()},template:function e(t,n){return n.name},showCount:0,isCreate:false,placeholder:n,clearInput:false};this.select=null;this.values=[];Q.extend(this.config,t,{searchUrl:t.isSearch?t.searchUrl:null,placeholder:t.optionsFirst?t.optionsFirst.value?n:t.optionsFirst.innerHTML||n:n,btns:t.radio?[i[1]]:[i[0],i[1],i[2]]},r[t.name]||a);if(isNaN(this.config.showCount)||this.config.showCount<=0){this.config.showCount=19921012}};var o=function e(){this.appender();this.on();this.onreset()};o.prototype.appender=function(){if(!Array.prototype.map){Array.prototype.map=function(e,t){var n,i,a,r=Object(this),l=r.length>>>0;if(t){n=t}i=new Array(l);a=0;while(a>>0;if(typeof t!=="function"){throw new TypeError(t+" is not a function")}if(arguments.length>1){i=n}a=0;while(a>>0;if(typeof e!=="function"){throw new TypeError}var i=[];var a=arguments[1];for(var r=0;r','',""];var u=Q('
              \n\t\t\t\t\t\n\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t\t\t"+f.join("")+'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
              \n\t\t\t\t\t\t
              \n\t\t\t\t\t
              \n\t\t\t\t\t
              '+d+"
              \n\t\t\t\t
              ");var p=Q('
              ');p.append(u);n.after(p);n.attr("lay-ignore","");n.removeAttr("name")&&n.attr("_name",s.config.formname);n.removeAttr("lay-verify")&&n.attr("_lay-verify",s.config.layverify);if(s.config.isSearch){Y[i]=Q.extend({},X,{searchUrl:s.config.searchUrl},Y[i]);Q(document).on("input","div."+m+'[FS_ID="'+i+'"] .'+y,function(e){h.search(i,e,s.config.searchUrl)});if(s.config.searchUrl){h.triggerSearch(u,true)}}else{u.find("dl dd."+W).css("display","none")}})};o.prototype.search=function(a,e,t,n){var r=this;var i=void 0;if(n){i=n}else{i=e.target;var l=e.keyCode;if(l===9||l===13||l===37||l===38||l===39||l===40){return false}}var o=Q.trim(i.value);this.changePlaceHolder(Q(i));var s=Y[a]?Y[a]:X;t=s.searchUrl||t;var d=q[a],c=d.config.isCreate,f=Q('dl[xid="'+a+'"]').parents("."+P);if(t){if(s.searchVal){o=s.searchVal;s.searchVal=""}if(!s.beforeSearch||s.beforeSearch&&s.beforeSearch instanceof Function&&s.beforeSearch(a,t,o)){var u=s.delay;if(s.first){s.first=false;u=10}clearTimeout(d.clearid);d.clearid=setTimeout(function(){f.find("dl > *:not(."+J+")").remove();f.find("dd."+V).addClass(U).text("请求中");r.ajax(a,t,o,false,null,true)},u)}}else{f.find("dl ."+h).removeClass(h);f.find("dl dd:not(."+J+")").each(function(e,t){var n=Q(t);var i=z.filter[a]||q[a].config.filter;if(i&&i(a,o,r.getItem(a,n),n.hasClass(E))==true){n.addClass(h)}});f.find("dl dt").each(function(e,t){if(!Q(t).nextUntil("dt",":not(."+h+")").length){Q(t).addClass(h)}});this.create(a,c,o);var p=f.find("dl dd:not(."+J+"):not(."+h+")");if(!p.length){f.find("dd."+V).addClass(U).text("无匹配项")}else{f.find("dd."+V).removeClass(U)}}};o.prototype.isArray=function(e){return Object.prototype.toString.call(e)=="[object Array]"};o.prototype.triggerSearch=function(e,i){var a=this;(e?[e]:Q("."+P).toArray()).forEach(function(e,t){e=Q(e);var n=e.find("dl").attr("xid");if(n&&q[n]&&q[n].config.isEmpty||i){a.search(n,null,null,q[n].config.searchType==0?e.find("."+x+" ."+y):e.find("dl ."+W+" ."+y))}})};o.prototype.clearInput=function(e){var t=Q("."+m+'[fs_id="'+e+'"]');var n=q[e].config.searchType==0?t.find("."+x+" ."+y):t.find("dl ."+W+" ."+y);n.val("")};o.prototype.ajax=function(i,a,r,l,o,s,d,c){var f=this;var u=Q("."+m+' dl[xid="'+i+'"]').parents("."+P);if(!u[0]||!a){return}var p=Y[i]?Y[i]:X;var e=Q.extend(true,{},p.data);e[p.searchName]=r;Q.ajax({type:p.type,headers:p.header,url:a,data:p.dataType=="json"?JSON.stringify(e):e,success:function e(t){if(typeof t=="string"){t=JSON.parse(t)}p.beforeSuccess&&p.beforeSuccess instanceof Function&&(t=p.beforeSuccess(i,a,r,t));if(f.isArray(t)){var n={};n[p.response.statusName]=p.response.statusCode;n[p.response.msgName]="";n[p.response.dataName]=t;t=n}if(t[p.response.statusName]!=p.response.statusCode){u.find("dd."+V).addClass(U).text(t[p.response.msgName])}else{u.find("dd."+V).removeClass(U);f.renderData(i,t[p.response.dataName],l,o,s,c);q[i].config.isEmpty=t[p.response.dataName].length==0}d&&d(i);p.success&&p.success instanceof Function&&p.success(i,a,r,t)},error:function e(t){u.find("dd[lay-value]:not(."+J+")").remove();u.find("dd."+V).addClass(U).text("服务异常");p.error&&p.error instanceof Function&&p.error(i,a,r,t)}})};o.prototype.renderData=function(n,e,t,i,a,r){var l=this;if(t){this.renderLinkage(n,e,i);return}if(r){this.renderReplace(n,e);return}var o=Q("."+m+' dl[xid="'+n+'"]').parents("."+P);var s=Y[n]?Y[n]:X;var d=o.find("."+g+" input");e=this.exchangeData(n,e);var c=[];o.find("dl").html(this.renderSelect(n,d.attr("placeholder")||d.attr("back"),e.map(function(e){var t=Q.extend({},e,{innerHTML:e[s.keyName],value:e[s.keyVal],sel:e[s.keySel],disabled:e[s.keyDis],type:e.type,name:e[s.keyName]});if(t.sel){c.push(t)}return t})));var f=o.find("."+x);var u=o.find("dl[xid]");if(a){var p=q[n].values;p.forEach(function(e,t){u.find('dd[lay-value="'+e.value+'"]').addClass(w)});c.forEach(function(e,t){if(l.indexOf(p,e)==-1){l.addLabel(n,f,e);u.find('dd[lay-value="'+e.value+'"]').addClass(w);p.push(e)}})}else{c.forEach(function(e,t){l.addLabel(n,f,e);u.find('dd[lay-value="'+e.value+'"]').addClass(w)});q[n].values=c}this.commonHandler(n,f)};o.prototype.renderLinkage=function(l,e,n){var i=[],a=0,o={0:e},s=Y[l]?Y[l]:X;G[l]={};var t=function e(){var r=i[a++]=[],t=o;o={};Q.each(t,function(a,e){Q.each(e,function(e,t){var n={pid:a,name:t[s.keyName],value:t[s.keyVal]};G[l][n.value]=Q.extend(t,n);r.push(n);var i=t[s.keyChildren];if(i&&i.length){o[n.value]=i}})})};do{t()}while(Object.getOwnPropertyNames(o).length);var r=Q("."+m+' dl[xid="'+l+'"]').parents("."+P);var d=['
              '];Q.each(i,function(e,t){var i=['
              '];Q.each(t,function(e,t){var n='
            • '+t.name+"
            • ";i.push(n)});i.push("
              ");d=d.concat(i)});d.push('
              ');d.push("
              ");r.find("dl").html(d.join(""));r.find("."+y).css("display","none")};o.prototype.renderReplace=function(n,e){var i=this;var t=Q("."+m+' dl[xid="'+n+'"]');var a=Y[n]?Y[n]:X;e=this.exchangeData(n,e);G[n]=e;var r=e.map(function(e){var t=Q.extend({},e,{innerHTML:e[a.keyName],value:e[a.keyVal],sel:e[a.keySel],disabled:e[a.keyDis],type:e.type,name:e[a.keyName]});return i.createDD(n,t)}).join("");t.find("dd:not(."+J+"),dt:not([style])").remove();t.find("dt[style]").after(Q(r))};o.prototype.exchangeData=function(e,t){var n=Y[e]?Y[e]:X;var i=n["keyChildren"];var a=n["keyDis"];G[e]={};var r=this.getChildrenList(t,i,a,[],false);return r};o.prototype.getChildrenList=function(e,t,n,i,a){var r=[],l=0;for(var o=0;o\n\t\t\t\t\t
              \n\t\t\t\t\t\t\n\t\t\t\t\t\t'+r+"\n\t\t\t\t\t
              \n\t\t\t\t"};o.prototype.createQuickBtn=function(e,t){return'
              '+e.name+"
              "};o.prototype.renderBtns=function(e,t,n){var i=this;var a=[];var r=Q('dl[xid="'+e+'"]');a.push('
              ');Q.each(q[e].config.btns,function(e,t){a.push(i.createQuickBtn(t,n))});a.push("
              ");a.push(this.createQuickBtn({icon:"xm-iconfont icon-caidan",name:""}));return a.join("")};o.prototype.renderSelect=function(n,e,t){var i=this;G[n]={};var a=[];if(q[n].config.btns.length){setTimeout(function(){var e=Q('dl[xid="'+n+'"]');e.parents("."+P).attr(b,q[n].config.searchType);e.find("."+l).css("max-width",e.prev().width()-54+"px")},10);a.push(['
              ',this.renderBtns(n,null,"30px"),"
              ",'
              ','','',"
              "].join(""))}else{a.push('
              '+e+"
              ")}if(this.isArray(t)){Q(t).each(function(e,t){if(t){if(t.type&&t.type==="optgroup"){a.push("
              "+t.name+"
              ")}else{a.push(i.createDD(n,t))}}})}else{Q(t).find("*").each(function(e,t){if(t.tagName.toLowerCase()=="option"&&e==0&&!t.value){return}if(t.tagName.toLowerCase()==="optgroup"){a.push("
              "+t.label+"
              ")}else{a.push(i.createDD(n,t))}})}a.push('
              ');a.push('
              没有选项
              ');return a.join("")};o.prototype.on=function(){var n=this;this.one();Q(document).on("click",function(e){if(!Q(e.target).parents("."+I)[0]){Q("."+m+" dl ."+h).removeClass(h);Q("."+m+" dl dd."+U).removeClass(U);Q("."+m+" dl dd."+p).remove();Q.each(q,function(e,t){n.clearInput(e);if(!t.values.length){n.changePlaceHolder(Q('div[FS_ID="'+e+'"] .'+x))}})}Q("."+m+" ."+f).each(function(e,t){n.changeShow(Q(t).find("."+I),false)})})};o.prototype.calcLabelLeft=function(e,t,n){var i=this.getPosition(e[0]);i.y=i.x+e[0].clientWidth;var a=e[0].offsetLeft;if(!e.find("span").length){a=0}else if(n){var r=e.find("span:last");r.css("display")=="none"?r=r.prev()[0]:r=r[0];var l=this.getPosition(r);l.y=l.x+r.clientWidth;if(l.y>i.y){a=a-(l.y-i.y)-5}else{a=0}}else{if(t<0){var o=e.find(":last");o.css("display")=="none"?o=o.prev()[0]:o=o[0];var s=this.getPosition(o);s.y=s.x+o.clientWidth;if(s.y>i.y){a-=10}}else{if(a<0){a+=10}if(a>0){a=0}}}e.css("left",a+"px")};o.prototype.one=function(e){var C=this;Q(e?e:document).off("click","."+I).on("click","."+I,function(e){var t=Q(e.target),n=t.is(I)?t:t.parents("."+I),i=n.next(),a=i.attr("xid");Q("dl[xid]").not(i).each(function(e,t){C.clearInput(Q(t).attr("xid"))});Q("dl[xid]").not(i).find("dd."+h).removeClass(h);if(n.hasClass(N)){return false}if(t.is("."+O)||t.is("."+y+"[readonly]")){C.changeShow(n,!n.parents("."+P).hasClass(f));return false}if(n.find("."+y+":not(readonly)")[0]){var r=n.find("."+y),l={x:e.pageX,y:e.pageY},o=C.getPosition(n[0]),s=n.width();while(l.x>o.x){if(Q(document.elementFromPoint(l.x,l.y)).is(r)){r.focus();C.changeShow(n,true);return false}l.x-=50}}if(t.is("."+y)){C.changeShow(n,true);return false}if(t.is('i[fsw="'+v+'"]')){var d=C.getItem(a,t),c=i.find("dd[lay-value='"+d.value+"']");if(c.hasClass(E)){return false}C.handlerLabel(a,c,false,d);return false}C.changeShow(n,!n.parents("."+P).hasClass(f));return false});Q(e?e:document).off("click","dl."+F).on("click","dl."+F,function(e){var t=Q(e.target);if(t.is("."+H)||t.parents("."+H)[0]){t=t.is("li")?t:t.parents("li[xm-value]");var n=t.parents(".xm-select-linkage-group"),i=t.parents("dl").attr("xid");if(!i){return false}n.find(".xm-select-active").removeClass("xm-select-active");t.addClass("xm-select-active");n.nextAll(".xm-select-linkage-group").addClass("xm-select-linkage-hide");var a=n.next(".xm-select-linkage-group");a.find("li").addClass("xm-select-linkage-hide");a.find('li[pid="'+t.attr("xm-value")+'"]').removeClass("xm-select-linkage-hide");if(!a[0]||a.find("li:not(.xm-select-linkage-hide)").length==0){var r=[],l=0,o=!t.hasClass("xm-select-this");if(q[i].config.radio){t.parents(".xm-select-linkage").find(".xm-select-this").removeClass("xm-select-this")}do{r[l++]={name:t.find("span").text(),value:t.attr("xm-value")};t=t.parents(".xm-select-linkage-group").prev().find('li[xm-value="'+t.attr("pid")+'"]')}while(t.length);r.reverse();var s={name:r.map(function(e){return e.name}).join("/"),value:r.map(function(e){return e.value}).join("/")};C.handlerLabel(i,null,o,s)}else{a.removeClass("xm-select-linkage-hide")}return false}if(t.is("dl")){return false}if(t.is("dt")){t.nextUntil("dt").each(function(e,t){t=Q(t);if(t.hasClass(E)||t.hasClass(w)){}else{t.find("i:not(.icon-expand)").click()}});return false}var d=t.is("dd")?t:t.parents("dd");var c=d.parent("dl").attr("xid");if(d.hasClass(E)){return false}if(t.is("i.icon-caidan")){var f=[],u=[];t.parents("dl").find('dd[tree-folder="true"]').each(function(e,t){Q(t).attr("xm-tree-hidn")==undefined?f.push(t):u.push(t)});var p=u.length?u:f;p.forEach(function(e){return e.click()});return false}var h=d.attr("tree-id");if(h){if(t.is("i:not(.icon-expand)")){C.handlerLabel(c,d,!d.hasClass(w));return false}var v=Y[c]||X;var m=v.tree;var y=d.nextAll('dd[tree-id^="'+h+'"]');if(y&&y.length){var g=y[0].clientHeight;g?(C.addTreeHeight(d,g),g=0):(g=d.attr("xm-tree-hidn")||36,d.removeAttr("xm-tree-hidn"),d.find(">i").remove(),y=y.filter(function(e,t){return Q(t).attr("tree-id").split("-").length-1==h.split("-").length}));y.animate({height:g},150);return false}else{if(m.nextClick&&m.nextClick instanceof Function){m.nextClick(c,C.getItem(c,d),function(e){if(!e||!e.length){C.handlerLabel(c,d,!d.hasClass(w))}else{d.attr("tree-folder","true");var n=[];e.forEach(function(e,t){e.innerHTML=e[v.keyName];e[B]=JSON.stringify(h.split("-").concat([t]));n.push(C.createDD(c,e));G[c][e[v.keyVal]]=e});d.after(n.join(""))}});return false}}}if(d.hasClass(J)){var x=t.is("."+R)?t:t.parents("."+R);if(!x[0]){return false}var k=x.attr("method");var b=q[c].config.btns.filter(function(e){return e.name==k})[0];b&&b.click&&b.click instanceof Function&&b.click(c,C);return false}C.handlerLabel(c,d,!d.hasClass(w));return false})};o.prototype.addTreeHeight=function(e,i){var a=this;var t=e.attr("tree-id");var n=e.nextAll('dd[tree-id^="'+t+'"]');if(n.length){e.append('');e.attr("xm-tree-hidn",i);n.each(function(e,t){var n=Q(t);a.addTreeHeight(n,i)})}};var G={};o.prototype.getItem=function(e,t){if(t instanceof Q){if(t.is('i[fsw="'+v+'"]')){var n=t.parent();return G[e][t]||{name:n.find("font").text(),value:n.attr("value")}}var i=t.attr("lay-value");return!G[e][i]?G[e][i]={name:t.find("span[name]").attr("name"),value:i}:G[e][i]}else if(typeof t=="string"&&t.indexOf("/")!=-1){return G[e][t]||{name:this.valToName(e,t),value:t}}return G[e][t]};o.prototype.linkageAdd=function(e,t){var n=Q('dl[xid="'+e+'"]');n.find(".xm-select-active").removeClass("xm-select-active");var i=t.value.split("/");var a=void 0,r=void 0,l=0;var o=[];do{a=i[l];r=n.find(".xm-select-linkage-group"+(l+1)+' li[xm-value="'+a+'"]');r[0]&&o.push(r);l++}while(r.length&&a!=undefined);if(o.length==i.length){Q.each(o,function(e,t){t.addClass("xm-select-this")})}};o.prototype.linkageDel=function(e,t){var n=Q('dl[xid="'+e+'"]');var i=t.value.split("/");var a=void 0,r=void 0,l=i.length-1;do{a=i[l];r=n.find(".xm-select-linkage-group"+(l+1)+' li[xm-value="'+a+'"]');if(!r.parent().next().find("li[pid="+a+"].xm-select-this").length){r.removeClass("xm-select-this")}l--}while(r.length&&a!=undefined)};o.prototype.valToName=function(e,t){var i=Q('dl[xid="'+e+'"]');var n=(t+"").split("/");if(!n.length){return null}var a=[];Q.each(n,function(e,t){var n=i.find(".xm-select-linkage-group"+(e+1)+' li[xm-value="'+t+'"] span').text();a.push(n)});return a.length==n.length?a.join("/"):null};o.prototype.commonHandler=function(e,t){if(!t||!t[0]){return}this.checkHideSpan(e,t);this.changePlaceHolder(t);this.retop(t.parents("."+P));this.calcLabelLeft(t,0,true);this.setHidnVal(e,t);t.parents("."+I+" ."+v).attr("title",q[e].values.map(function(e){return e.name}).join(","))};o.prototype.initVal=function(e){var o=this;var t={};if(e){t[e]=q[e]}else{t=q}Q.each(t,function(n,e){var t=e.values,i=Q('dl[xid="'+n+'"]').parent(),a=i.find("."+x),r=i.find("dl");r.find("dd."+w).removeClass(w);var l=t.concat([]);l.concat([]).forEach(function(e,t){o.addLabel(n,a,e);r.find('dd[lay-value="'+e.value+'"]').addClass(w)});if(e.config.radio){l.length&&t.push(l[l.length-1])}o.commonHandler(n,a)})};o.prototype.setHidnVal=function(e,t){if(!t||!t[0]){return}t.parents("."+m).find("."+_).val(q[e].values.map(function(e){return e.value}).join(","))};o.prototype.handlerLabel=function(e,t,n,i,a){var r=Q('[xid="'+e+'"]').prev().find("."+x),l=t&&this.getItem(e,t),o=q[e].values,s=q[e].config.on||z.on[e],d=q[e].config.endOn||z.endOn[e];if(i){l=i}var c=q[e];if(n&&c.config.max&&c.values.length>=c.config.max){var f=z.maxTips[e]||q[e].config.maxTips;f&&f(e,o.concat([]),l,c.config.max);return}if(!a){if(s&&s instanceof Function&&s(e,o.concat([]),l,n,t&&t.hasClass(E))==false){return}}var u=Q('dl[xid="'+e+'"]');n?(t&&t[0]?(t.addClass(w),t.removeClass(p)):u.find(".xm-select-linkage")[0]&&this.linkageAdd(e,l),this.addLabel(e,r,l),o.push(l)):(t&&t[0]?t.removeClass(w):u.find(".xm-select-linkage")[0]&&this.linkageDel(e,l),this.delLabel(e,r,l),this.remove(o,l));if(!r[0])return;if(c.config.radio){this.changeShow(r,false)}r.parents("."+I).prev().removeClass("layui-form-danger");c.config.clearInput&&this.clearInput(e);this.commonHandler(e,r);!a&&d&&d instanceof Function&&d(e,o.concat([]),l,n,t&&t.hasClass(E))};o.prototype.addLabel=function(e,t,n){if(!n)return;var i='fsw="'+v+'"';var a=[Q(""+n.name+""),Q("')],r=a[0],l=a[1];r.append(l);var o=q[e];if(o.config.radio){o.values.length=0;Q('dl[xid="'+e+'"]').find("dd."+w+':not([lay-value="'+n.value+'"])').removeClass(w);t.find("span").remove()}t.find("input").css("width","50px");t.find("input").before(r)};o.prototype.delLabel=function(e,t,n){if(!n)return;t.find('span[value="'+n.value+'"]:first').remove()};o.prototype.checkHideSpan=function(e,t){var n=t.parents("."+v)[0].offsetHeight+5;t.find("span.xm-span-hide").removeClass("xm-span-hide");t.find("span[style]").remove();var i=q[e].config.showCount;t.find("span").each(function(e,t){if(e>=i){Q(t).addClass("xm-span-hide")}});var a=t.find("span:eq("+i+")");a[0]&&a.before(Q(' + '+(t.find("span").length-i)+""))};o.prototype.retop=function(e){var t=e.find("dl"),n=e.offset().top+e.outerHeight()+5-c.scrollTop(),i=t.outerHeight();var a=e.hasClass("layui-form-selectup")||t.css("top").indexOf("-")!=-1||n+i>c.height()&&n>=i;e=e.find("."+v);var r=q[t.attr("xid")];var l=t.parents(".layui-form-pane")[0]&&t.prev()[0].clientHeight>38?14:10;if(r&&r.config.direction=="up"||a){a=true;if(r&&r.config.direction=="down"){a=false}}var o=e[0].offsetTop+e.height()+l;if(a){t.css({top:"auto",bottom:o+3+"px"})}else{t.css({top:o+"px",bottom:"auto"})}};o.prototype.changeShow=function(e,t){Q(".layui-form-selected").removeClass("layui-form-selected");var n=e.parents("."+P),i=n.hasClass(f),a=n.find("dl").attr("xid");Q("."+m+" ."+P).not(n).removeClass(f);if(t){this.retop(n);n.addClass(f);n.find("."+y).focus();if(!n.find("dl dd[lay-value]:not(."+J+")").length){n.find("dl ."+V).addClass(U)}}else{n.removeClass(f);this.clearInput(a);n.find("dl ."+U).removeClass(U);n.find("dl dd."+h).removeClass(h);n.find("dl dd."+p).remove();if(a&&q[a]&&q[a].config.isEmpty){this.triggerSearch(n)}this.changePlaceHolder(n.find("."+x))}if(t!=i){var r=q[a].config.opened||z.opened[a];t&&r&&r instanceof Function&&r(a);var l=q[a].config.closed||z.closed[a];!t&&l&&l instanceof Function&&l(a)}};o.prototype.changePlaceHolder=function(e){var t=e.parents("."+I);t[0]||(t=e.parents("dl").prev());if(!t[0]){return}var n=e.parents("."+m).find("dl[xid]").attr("xid");if(q[n]&&q[n].config.height){}else{var i=t.find("."+v)[0].clientHeight;t.css("height",(i>36?i+4:i)+"px");var a=t.parents("."+m).parent().prev();if(a.is(".layui-form-label")&&t.parents(".layui-form-pane")[0]){i=i>36?i+4:i;t.css("height",i+"px");a.css({height:i+2+"px",lineHeight:i-18+"px"})}}var r=t.find("."+g+" input"),l=!e.find("span:last")[0]&&!t.find("."+y).val();if(l){var o=r.attr("back");r.removeAttr("back");r.attr("placeholder",o)}else{var s=r.attr("placeholder");r.removeAttr("placeholder");r.attr("back",s)}};o.prototype.indexOf=function(e,t){for(var n=0;n-1){e.splice(n,1);return true}return false};o.prototype.selectAll=function(i,a,e){var r=this;var l=Q('[xid="'+i+'"]');if(!l[0]){return}if(l.find(".xm-select-linkage")[0]){return}l.find("dd[lay-value]:not(."+J+"):not(."+w+")"+(e?":not(."+E+")":"")).each(function(e,t){t=Q(t);var n=r.getItem(i,t);r.handlerLabel(i,l.find('dd[lay-value="'+n.value+'"]'),true,n,!a)})};o.prototype.removeAll=function(n,i,a){var r=this;var l=Q('[xid="'+n+'"]');if(!l[0]){return}if(l.find(".xm-select-linkage")[0]){q[n].values.concat([]).forEach(function(e,t){var n=e.value.split("/");var i=void 0,a=void 0,r=0;do{i=n[r++];a=l.find(".xm-select-linkage-group"+r+':not(.xm-select-linkage-hide) li[xm-value="'+i+'"]');a.click()}while(a.length&&i!=undefined)});return}q[n].values.concat([]).forEach(function(e,t){if(a&&l.find('dd[lay-value="'+e.value+'"]').hasClass(E)){}else{r.handlerLabel(n,l.find('dd[lay-value="'+e.value+'"]'),false,e,!i)}})};o.prototype.reverse=function(i,a,e){var r=this;var l=Q('[xid="'+i+'"]');if(!l[0]){return}if(l.find(".xm-select-linkage")[0]){return}l.find("dd[lay-value]:not(."+J+")"+(e?":not(."+E+")":"")).each(function(e,t){t=Q(t);var n=r.getItem(i,t);r.handlerLabel(i,l.find('dd[lay-value="'+n.value+'"]'),!t.hasClass(w),n,!a)})};o.prototype.skin=function(e){var t=["default","primary","normal","warm","danger"];var n=t[Math.floor(Math.random()*t.length)];Q('dl[xid="'+e+'"]').parents("."+m).find("."+P).attr("xm-select-skin",n);this.check(e)&&this.commonHandler(e,Q('dl[xid="'+e+'"]').parents("."+m).find("."+x))};o.prototype.getPosition=function(e){var t=0,n=0;while(e!=null){t+=e.offsetLeft;n+=e.offsetTop;e=e.offsetParent}return{x:t,y:n}};o.prototype.onreset=function(){Q(document).on("click","[type=reset]",function(e){Q(e.target).parents("form").find("."+m+" dl[xid]").each(function(e,t){var n=t.getAttribute("xid"),i=Q(t),a=void 0,r={};K.removeAll(n);q[n].config.init.forEach(function(e,t){if(e&&(!r[e]||q[n].config.repeat)&&(a=i.find('dd[lay-value="'+e.value+'"]'))[0]){K.handlerLabel(n,a,true);r[e]=1}})})})};o.prototype.bindEvent=function(n,e,i){if(e&&e instanceof Function){i=e;e=null}if(i&&i instanceof Function){if(!e){Q.each(q,function(e,t){q[e]?q[e].config[n]=i:z[n][e]=i})}else{q[e]?(q[e].config[n]=i,delete z[n][e]):z[n][e]=i}}};o.prototype.check=function(e,t){if(Q('dl[xid="'+e+'"]').length){return true}else if(Q('select[xm-select="'+e+'"]').length){if(!t){this.render(e,Q('select[xm-select="'+e+'"]'));return true}}else{delete q[e];return false}};o.prototype.render=function(e,t){K.init(t);K.one(Q('dl[xid="'+e+'"]').parents("."+m));K.initVal(e)};o.prototype.log=function(e){console.log(e)};var u=function e(){this.v=t;this.render()};var K=new o;u.prototype.value=function(i,e,t){if(typeof i!="string"){return[]}var a=q[i];if(!K.check(i)){return[]}if(typeof e=="string"||e==undefined){var n=a.values.concat([])||[];if(e=="val"){return n.map(function(e){return e.value})}if(e=="valStr"){return n.map(function(e){return e.value}).join(",")}if(e=="name"){return n.map(function(e){return e.name})}if(e=="nameStr"){return n.map(function(e){return e.name}).join(",")}return n}if(K.isArray(e)){var r=Q('[xid="'+i+'"]'),l={},o=void 0,s=true;if(t==false){s=false}else if(t==true){s=true}else{K.removeAll(i)}if(s){a.values.forEach(function(e,t){l[e.value]=1})}e.forEach(function(e,t){if(e&&(!l[e]||a.config.repeat)){if((o=r.find('dd[lay-value="'+e+'"]'))[0]){K.handlerLabel(i,o,s,null,true);l[e]=1}else{var n=K.valToName(i,e);if(n){K.handlerLabel(i,o,s,K.getItem(i,e),true);l[e]=1}}}})}};u.prototype.on=function(e,t,n){K.bindEvent(n?"endOn":"on",e,t);return this};u.prototype.filter=function(e,t){K.bindEvent("filter",e,t);return this};u.prototype.maxTips=function(e,t){K.bindEvent("maxTips",e,t);return this};u.prototype.opened=function(e,t){K.bindEvent("opened",e,t);return this};u.prototype.closed=function(e,t){K.bindEvent("closed",e,t);return this};u.prototype.config=function(e,n,t){if(e&&(typeof e==="undefined"?"undefined":_typeof(e))=="object"){t=n==true;n=e;e=null}if(n&&(typeof n==="undefined"?"undefined":_typeof(n))=="object"){if(t){n.header||(n.header={});n.header["Content-Type"]="application/json; charset=UTF-8";n.dataType="json"}e?(Y[e]=Q.extend(true,{},Y[e]||X,n),!K.check(e)&&this.render(e),q[e]&&n.direction&&(q[e].config.direction=n.direction),q[e]&&n.clearInput&&(q[e].config.clearInput=true),n.searchUrl&&q[e]&&K.triggerSearch(Q("."+m+' dl[xid="'+e+'"]').parents("."+P),true)):(Q.extend(true,X,n),Q.each(Y,function(e,t){Q.extend(true,t,n)}))}return this};u.prototype.render=function(e,t){var n;if(e&&(typeof e==="undefined"?"undefined":_typeof(e))=="object"){t=e;e=null}var i=t?(n={init:t.init,disabled:t.disabled,max:t.max,isSearch:t.isSearch,searchUrl:t.searchUrl,isCreate:t.isCreate,radio:t.radio,skin:t.skin,direction:t.direction,height:t.height,formname:t.formname,layverify:t.layverify,layverType:t.layverType,showCount:t.showCount,placeholder:t.placeholder,create:t.create,filter:t.filter,maxTips:t.maxTips,on:t.on},_defineProperty(n,"on",t.on),_defineProperty(n,"opened",t.opened),_defineProperty(n,"closed",t.closed),_defineProperty(n,"template",t.template),_defineProperty(n,"clearInput",t.clearInput),n):{};t&&t.searchType!=undefined&&(i.searchType=t.searchType=="dl"?1:0);if(e){r[e]={};Q.extend(r[e],q[e]?q[e].config:{},i)}else{Q.extend(a,i)}(Q("select["+v+'="'+e+'"]')[0]?Q("select["+v+'="'+e+'"]'):Q("select["+v+"]")).each(function(e,t){var n=t.getAttribute(v);K.render(n,t);setTimeout(function(){return K.setHidnVal(n,Q('select[xm-select="'+n+'"] + div.'+m+" ."+x))},10)});return this};u.prototype.disabled=function(e){var t={};e?K.check(e)&&(t[e]=q[e]):t=q;Q.each(t,function(e,t){Q('dl[xid="'+e+'"]').prev().addClass(N)});return this};u.prototype.undisabled=function(e){var t={};e?K.check(e)&&(t[e]=q[e]):t=q;Q.each(t,function(e,t){Q('dl[xid="'+e+'"]').prev().removeClass(N)});return this};u.prototype.data=function(e,t,n){if(!e||!t||!n){K.log("id: "+e+" param error !!!");return this}if(!K.check(e)){K.log("id: "+e+" not render !!!");return this}this.value(e,[]);this.config(e,n);if(t=="local"){K.renderData(e,n.arr,n.linkage==true,n.linkageWidth?n.linkageWidth:"100")}else if(t=="server"){K.ajax(e,n.url,n.keyword,n.linkage==true,n.linkageWidth?n.linkageWidth:"100")}return this};u.prototype.btns=function(e,o,s){if(e&&K.isArray(e)){o=e;e=null}if(!o||!K.isArray(o)){return this}var t={};e?K.check(e)&&(t[e]=q[e]):t=q;o=o.map(function(e){if(typeof e=="string"){if(e=="select"){return i[0]}if(e=="remove"){return i[1]}if(e=="reverse"){return i[2]}if(e=="skin"){return i[3]}}return e});Q.each(t,function(e,t){t.config.btns=o;var n=Q('dl[xid="'+e+'"]').find("."+J+":first");if(o.length){var i=s&&s.show&&(s.show=="name"||s.show=="icon")?s.show:"";var a=K.renderBtns(e,i,s&&s.space?s.space:"30px");n.html(a)}else{var r=n.parents("."+P).find("."+g+" input");var l=r.attr("placeholder")||r.attr("back");n.html(l);n.removeAttr("style")}});return this};u.prototype.search=function(e,t){if(e&&K.check(e)){Y[e]=Q.extend(true,{},Y[e]||X,{first:true,searchVal:t});K.triggerSearch(Q('dl[xid="'+e+'"]').parents("."+P),true)}return this};u.prototype.replace=function(e,t,n){var i=this;if(!e||!t||!n){K.log("id: "+e+" param error !!!");return this}if(!K.check(e,true)){K.log("id: "+e+" not render !!!");return this}var a=this.value(e,"val");this.value(e,[]);this.config(e,n);if(t=="local"){K.renderData(e,n.arr,n.linkage==true,n.linkageWidth?n.linkageWidth:"100",false,true);this.value(e,a,true)}else if(t=="server"){K.ajax(e,n.url,n.keyword,n.linkage==true,n.linkageWidth?n.linkageWidth:"100",false,function(e){i.value(e,a,true)},true)}};return new u}); \ No newline at end of file diff --git a/public/static/layui/plugin/gougucms.js b/public/static/layui/plugin/gougucms.js new file mode 100644 index 0000000..61f0538 --- /dev/null +++ b/public/static/layui/plugin/gougucms.js @@ -0,0 +1,195 @@ +layui.define(['element'], function(exports){ + var MOD_NAME = 'tab'; + var element = layui.element; + var tab = { + //在这里给active绑定几项事件,后面可通过active调用这些事件 + tabAdd: function(url,id,name) { + //新增一个Tab项 传入三个参数,分别对应其标题,tab页面的地址,还有一个规定的id,是标签中data-id的属性值 + //关于tabAdd的方法所传入的参数可看layui的开发文档中基础方法部分 + element.tabAdd('gougu-admin-tab', { + title: ''+name, + content: '', + id: id //规定好的id + }); + this.tabChange(id); + var thetabs = $('.layui-tab-title').find('li'); + if(thetabs.length>10){ + layer.tips('点击LOGO快速关闭打开的TAB',$('[ittab-home]')); + } + // FrameWH(); //计算ifram层的大小 + }, + tabChange: function(id) { + //根据传入的id传入到指定的tab项,并滚动定位 + element.tabChange('gougu-admin-tab', id); + + var $tabTitle = $('.layui-tab-title'); + var autoLeft = 0; + $tabTitle.children("li").each(function() { + if ($(this).hasClass('layui-this')) { + return false; + } else { + autoLeft += $(this).outerWidth(); + } + }); + $tabTitle.animate({ + scrollLeft: autoLeft - $tabTitle.width() / 3 + }, 200); + }, + tabDelete: function (id) { + element.tabDelete('gougu-admin-tab', id);//删除 + }, + tabDeleteAll: function (ids) { + //删除所有 + $.each(ids, function (i,item) { + //ids是一个数组,里面存放了多个id,调用tabDelete方法分别删除 + element.tabDelete('gougu-admin-tab', item); + }) + }, + //子页面打开新的窗口 + sonAdd: function(url,name) { + var id=new Date().getTime(); + this.tabAdd(url,id,name); + }, + //子页面关闭窗口 + sonDelete: function(id) { + $('.layui-tab .layui-tab-title .layui-this i').click();//框架页面删除tab + }, + tabRoll: function(d) { + var $tabTitle = $('.layui-tab-title'); + var left = $tabTitle.scrollLeft(); + if ('left' === d) { + $tabTitle.animate({ + scrollLeft: left - 360 + }, 200); + } else { + $tabTitle.animate({ + scrollLeft: left + 360 + }, 200); + } + } + }; + layui.tab=tab; + + //关闭全部tab,只保留首页 + $("[ittab-home]").on('click', function(){ + var thetabs = $('.layui-tab-title').find('li'),ids=[]; + var thisid=$('.layui-this').attr('lay-id'); + for(var i=0;i 0){ + for (var a = 0; a < ids.length; a++) { + if(ids[a] != 0){ + element.tabDelete('gougu-admin-tab', ids[a]); + } + } + } + return false; + }) + + //左右滚动菜单 + $("#right_button").click(function() { + tab.tabRoll("right"); + }) + + $("#left_button").click(function() { + tab.tabRoll("left"); + }) + + //当点击有menu-active属性的标签时,即左侧菜单栏中内容 ,触发点击事件 + $('body').on('click', 'a.menu-active', function() { + var that = $(this); + var src=that.data("src"),id=that.data("id"),title=that.data("title"); + if(src=='' || src=='/'){ + return false; + } + //这时会判断右侧.layui-tab-title属性下的有lay-id属性的li的数目,即已经打开的tab项数目 + $('.site-menu-active').removeClass('layui-this'); + that.addClass('layui-this'); + if ($(".layui-tab-title li[lay-id]").length <= 0) { + //如果比零小,则直接打开新的tab项 + tab.tabAdd(src, id,title); + } else { + //否则判断该tab项是否以及存在 + var isData = false; //初始化一个标志,为false说明未打开该tab项 为true则说明已有 + $.each($(".layui-tab-title li[lay-id]"), function () { + //如果点击左侧菜单栏所传入的id 在右侧tab项中的lay-id属性可以找到,则说明该tab项已经打开 + if ($(this).attr("lay-id") == id) { + isData = true; + $('[data-frameid="'+id+'"]').attr('src',src); + //最后不管是否新增tab,最后都转到要打开的选项页面上 + tab.tabChange(id); + } + }) + if (isData == false) { + //标志为false 新增一个tab项 + tab.tabAdd(src, id,title); + } + } + }); + + + //右上角刷新 + $("[ittab-refresh]").on('click', function(){ + if($(this).hasClass("refreshThis")){ + $("[ittab-loading]").show(); + $(this).removeClass("refreshThis"); + var iframe = $(".layui-tab-item.layui-show").find("iframe")[0]; + if(iframe){ + var src = parent.document.getElementById(iframe.id).contentWindow.location.href ? parent.document.getElementById(iframe.id).contentWindow.location.href : iframe.src; + document.getElementById(iframe.id).src=src; + } + setTimeout(function(){ + $("[ittab-loading]").hide(); + },500) + setTimeout(function(){ + $("[ittab-refresh]").attr("class","refreshThis"); + },1000) + }else{ + layer.tips("每秒只可刷新一次",this, { + tips: 1 + }); + } + return false; + }) + + //清除缓存 + $("[ittab-del-cache]").on('click', function(e){ + var that = $(this); + if(that.attr('class') === 'clearThis'){ + layer.tips('正在努力清理中...',this); + return false; + } + layer.tips('正在清理系统缓存...',this); + that.attr('class','clearThis'); + $.ajax({ + url:"/admin/api/cache_clear", + success:function(res){ + if(res.code == 1){ + setTimeout(function(){ + that.attr('class',''); + layer.tips(res.msg,that); + },1000) + } else { + layer.tips(res.msg,that); + } + } + }) + }) + + + function FrameWH() { + var h = $(window).height() -41- 10 - 60 -10-44 -10; + $("iframe").css("height",h+"px"); + } + + $(window).resize(function () { + //FrameWH(); + }) + + + exports('gougucms', {}); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/rightpage.js b/public/static/layui/plugin/rightpage.js new file mode 100644 index 0000000..e4f8077 --- /dev/null +++ b/public/static/layui/plugin/rightpage.js @@ -0,0 +1,45 @@ +layui.define(['layer'], function(exports){ + var layer = layui.layer; + var obj = { + callback:null, + open: function (content='',width='88%',callback) { + if(callback && typeof callback === 'function'){ + this.callback = callback; + } + layer.open({ + type: 2, + title: '', + offset: ['0', '100%'], + skin: 'layui-anim layui-anim-rl layui-layer-admin-right', + closeBtn: 0, + content: content, + area: [width, '100%'], + success:function(obj,index){ + if($('#rightPopup'+index).length<1){ + var btn='
              关闭
              '; + obj.append(btn); + $('#rightPopup'+index).click(function(){ + let op_width = $('.layui-anim-rl').outerWidth(); + $('.layui-anim-rl').animate({left:'+='+op_width+'px'}, 200, 'linear', function () { + $('.layui-anim-rl').remove() + $('.layui-layer-shade').remove() + }) + }) + } + } + }) + }, + success:function(){ + $('.right-popup-close').click(); + var d = this; + setTimeout(function() { + d.timer = null; + d.callback && d.callback(); + }, 300) + }, + close: function(){ + $('.right-popup-close').click(); + } + }; + exports('rightpage', obj); +}); diff --git a/public/static/layui/plugin/tagpicker.js b/public/static/layui/plugin/tagpicker.js new file mode 100644 index 0000000..0bbf477 --- /dev/null +++ b/public/static/layui/plugin/tagpicker.js @@ -0,0 +1,269 @@ +layui.define(['layer'],function(exports){ + //提示:模块也可以依赖其它模块,如:layui.define('layer', callback); + var layer = layui.layer; + var opts={ + "title":'请选择', + "len": 5, + "url":null, + "where":{}, + "width":720, + "height":320, + "target":'tag', + "field_id":'id', + "field_title":'title', + "tag_ids": 'tag_ids', + "tag_tags": 'tag_tags', + "isDiy":0, + "default":0, + "callback": null + }; + var tagpicker = function(options){ + this.settings = $.extend({}, opts, options); + this.ajaxData = []; + this.createStyle(); + var me=this; + $('#'+me.settings.target).click(function(){ + me.init(); + }); + }; + tagpicker.prototype = { + init: function () { + var me = this; + $.ajax({ + url:me.settings.url, + type:'post', + data:me.settings.where, + success:function(e){ + if(e.code==0){ + if(e.data.length>0){ + me.ajaxData=e.data; + layer.open({ + title:me.settings.title, + area:[me.settings.width+'px',me.settings.height+'px'], + content:me.render(), + type:1, + success:function(){ + me.click(); + }, + btn: ['确定'], + yes: function(idx){ + me.set(); + layer.close(idx); + } + }); + } + else{ + layer.msg('暂无数据'); + } + }else{ + layer.msg(e.msg); + } + } + }) + }, + render: function (){ + var me=this,_li='',_item='',_input='',_data=this.ajaxData,_ids=$('#'+this.settings.tag_ids).val(),_tags=$('#'+this.settings.tag_tags).val(); + if(_tags!='' && _tags.length>0){ + var tags_array=_tags.split(','); + var ids_array=_ids.split(','); + for(var i=0;i'+ tags_array[i] +'×'; + } + } + for(var i=0;i<_data.length;i++){ + if($.inArray(_data[i][this.settings.field_id].toString(),ids_array)>=0){ + _li+='
            • '+_data[i][this.settings.field_title]+'
            • '; + } + else{ + _li+='
            • '+_data[i][this.settings.field_title]+'
            • '; + } + } + if(_item=='' && me.settings.isDiy==0){ + _item='请选择下面的选项'; + } + if(me.settings.isDiy==1){ + _input=''; + } + var template = '
              \ +
              \ +
                '+_item+'
              '+_input+'\ +
              \ +
              \ +
              \ +
                '+_li+'
              \ +
              \ +
              \ +
              '; + return template; + }, + click:function(){ + var me=this, + list=$('#keyword_list_'+me.settings.target), + list_wrap=$('#keyword_list_wrap_'+me.settings.target), + tags = $("li", list), + wraps = $('li', list_wrap); + tags.each(function(i, o) { + $(o).find('a').on('click', function() { + var li = $(this).parents('li'); + me.remove(li); + }) + }); + wraps.on('click', function() { + me.select(this); + }); + list.on('click', function() { + $(".tag-txt", list).focus(); + }); + //如果开启自定义关键字 + if(me.settings.isDiy==1){ + $(".tag-txt", list).on('blur', function(e) { + var text = $.trim($(this).val()); + if (me.add(text, 0)) { + $(this).val(""); + } + }).on('keypress', function(e) { + var text = $.trim($(this).val()); + e = e ? e : window.event; + var keyCode = e.which ? e.which : e.keyCode; + if (keyCode == 32) { + if (me.add(text, 0)) { + $(this).val(""); + } else { + $(this).val(text); + } + } + }).on('keyup', function(e) { + var text = $(this).val(); + e = e ? e : window.event; + var keyCode = e.which ? e.which : e.keyCode; + if (keyCode == 8) { + if (text.length == 0) { + var li = $('li', list).last(); + if (li) { + li.find('a').trigger('click'); + } + } + } + me.set(); + }); + } + }, + add: function(text, id) { + var me = this, + list=$('#keyword_list_'+me.settings.target), + list_wrap=$('#keyword_list_wrap_'+me.settings.target), + tags = $('li', list); + text = $.trim(text); + if (text == "") { + return true; + } + if (text.length < 2) { + layer.msg("关键词【"+text+"】至少要两个字以上"); + return false; + } + if (!(/^[\u0391-\uFFE5A-Za-z0-9]+$/.test(text))) { + layer.msg("关键词【"+text+"】不能还有特殊字符或空格"); + return false; + } + if(tags.length==0){ + $('span', list).remove(); + } + if(tags.length>=me.settings.len){ + layer.msg("最多个添加" + me.settings.len + "个选项"); + return false; + } + for (var i = 0; i < tags.length; i++) { + if ($(tags[i]).data('title') == text) { + layer.msg("关键词【"+text+"】关键词已添加"); + return false; + } + } + var node = $('
            • '+ text +'×
            • '); + node.find("a").click(function() { + var li = $(this).parents('li'); + me.remove(li); + }); + $('li[data-title="' + text + '"]',list_wrap).addClass('a_cur'); + node.appendTo($("ul", list)); + return true; + }, + select: function (item) { + var me = this, + list=$('#keyword_list_'+me.settings.target), + li = $(item), + text = li.data('title'), + id = li.data('id'); + if (li.hasClass('a_cur')) { + li.removeClass("a_cur"); + me.del(text, id); + } else { + me.add(text,id); + } + }, + remove: function(li) { + var me = this, + list=$('#keyword_list_'+me.settings.target), + list_wrap=$('#keyword_list_wrap_'+me.settings.target), + text = $(li).data('title'), + id = $(li).data('id'); + + var wrap = $('li[data-title="' + text + '"]', list_wrap); + wrap && wrap.removeClass("a_cur"); + me.del(text, id); + }, + del: function(text, id) { + var me = this, + list=$('#keyword_list_'+me.settings.target), + tags = $('li', list); + for(var i = 0; i < tags.length; i++) { + if ($(tags[i]).data('id') == id) { + $(tags[i]).remove(); + if(tags.length==1 && me.settings.isDiy==0){ + $('ul', list).append('请选择下面的选项'); + } + return true; + } + } + return false; + }, + set: function() { + var me = this; + list=$('#keyword_list_'+me.settings.target), + list_wrap=$('#keyword_list_wrap_'+me.settings.target), + tags = $('li', list); + var ids=[],text = []; + tags.each(function(i, o) { + ids.push($(o).data('id')); + text.push($(o).data('title')); + }); + $("#"+me.settings.tag_ids).val(ids.join(',')); + $("#"+me.settings.tag_tags).val(text.join(',')); + }, + createStyle:function(){ + var cssText='.selectbox .keywords{padding:8px 0 10px 10px; color: #bfbfbf; background: #ffffff; min-height:35px; line-height: 32px; width: 700px;}\ + .selectbox .keywords ul{float:left;}\ + .selectbox .keywords ul li{background: #e1f2ff; color:#01AAED; border: 1px solid #69d6fe; display:inline-block; font-size: 12px;line-height: 20px;margin: 5px 3px;padding: 3px 5px 2px 6px; border-radius:2px;}\ + .selectbox .keywords ul li a {color: #333;text-decoration: none;}\ + .selectbox .keywords ul li a.del{cursor: pointer; font-size:16px; padding:0 1px 0 5px;text-decoration: none;}\ + .selectbox .keywords .tag-txt{background:#fff; float:left; border: 1px solid #fff;height: 36px;line-height: 36px;white-space: nowrap;width: 200px;}\ + .selectbox .tag-wrap{border-top: 1px solid #e7e8eb; background: #ffffff;}\ + .selectbox .tag-wrap .tag-box{padding: 15px;}\ + .selectbox .tag-wrap .tag-box ul li{background: transparent; border:1px solid #ddd; cursor:pointer; border-radius:3px; font-size:12px; background-color:#f9f9f9; display:inline-block; line-height: 27px; margin-bottom:6px; margin-right: 6px;text-align: center; padding:0 10px; position: relative;}\ + .selectbox .tag-wrap .tag-box ul li.a_cur{background: #1E9FFF; border:1px solid #1E9FFF; color:#fff;}'; + + var document = window.document; + var styleTag = document.createElement("style"); + styleTag.setAttribute("type", "text/css"); + if (styleTag.styleSheet) { //ie + styleTag.styleSheet.cssText += cssText; + } + else{ + styleTag.innerHTML = cssText; + } + document.getElementsByTagName("head").item(0).appendChild(styleTag); + } + } + + //输出接口 + exports('tagpicker', tagpicker); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/treeGrid.all.js b/public/static/layui/plugin/treeGrid.all.js new file mode 100644 index 0000000..bf57857 --- /dev/null +++ b/public/static/layui/plugin/treeGrid.all.js @@ -0,0 +1,2807 @@ +/** + 码云地址:https://gitee.com/beijiyi/tree_table_treegrid_based_on_layui + 在线demo:http://beijiyi.com/ + */ +layui.config({ +}).extend({ +}).define(['laytpl', 'laypage', 'layer', 'form'], function(exports){ + "use strict"; + var $ = layui.$ + ,laytpl = layui.laytpl + ,laypage = layui.laypage + ,layer = layui.layer + ,form = layui.form + ,hint = layui.hint() + ,device = layui.device() + //外部接口 + ,table = { + config: {//全局配置项,表格级别 + indexName: 'lay_table_index' //下标索引名 + ,cols:{//节点级别的附加字段 + isCheckName: 'lay_is_checked' //选中状态(true,false) + ,isRadio:'lay_is_radio'//单选状态(true,false) + ,isOpen:'lay_is_open'//是否展开节点 + ,isShow:'lay_is_show'//是否显示节点 + ,level:'lay_level'//节点的层级关系(不需要设置) + ,children:'children'//存放下级的变量 + ,isRowCheck:'lay_is_row_check'//行选中 + + ,cheDisabled:'lay_che_disabled'//禁止多选(true,false) + ,radDisabled:'lay_rad_disabled'//禁止单选(true,false) + + ,iconOpen:'lay_icon_open'//打开的图标 + ,iconClose:'lay_icon_close'//关闭的图标 + ,icon:'lay_icon'//叶子节点图标 + } + ,initWidth:{//默认列宽度定义 + checkbox: 48 + ,space: 15 + ,numbers: 40 + ,radio:48 + } + } + /** + * 缓存数据 + * + * 结构图示 + * cache{} 缓存(对象) + * key['data']{} 全部数据缓存(对象) + * key[list][] 列表数据对象(数组) + * key[map]{} 列表数据Map对象(Map) + * key[treeList][] 树状结构的对象(数组) + * key['cla']{} 全部已初始化过的Calss对象类(注意渲染是异步执行) + * key['claIds'][] 全部已经吊用过初始化方法的表格类 + * key[claObjs]{key[tableId]} 全部已经初始化好的cla对象 + * + */ + ,cache: { + tableId:{ + data:{ + list:[]//列表数据 + ,map:{}//列表数据以idField或唯一值作为key的Map数据 + ,treeList:[]//树状数据 + ,upIds:[]//父节点集合 在一次外部请求前严格按照第一次的顺序 + } + } + ,cla:{ + claIds:{ + tableId:true + } + ,claObjs:{ + tableId:{} + } + } + ,selectcode:{//数据字典缓存 + demokey:[ + { + key:{value:''} + } + ] + } + } + ,index: layui.table ? (layui.table.index + 10000) : 0 + /** + * 设置全局项 + * @param options + * @return {table} + */ + ,set: function(options){ + var that = this; + that.config = $.extend({}, that.config, options); + return that; + } + /** + * 事件监听 + * @param events + * @param callback + * @return {*} + */ + ,on: function(events, callback){ + return layui.onevent.call(this, MOD_NAME, events, callback); + } + ,getClass:function (tableId) { + return table.cache.cla.claObjs[tableId];; + } + ,pushClass:function (tableId,that) { + table.cache.cla.claObjs[tableId]=that; + } + ,isCalss:function (tableId) { + var ids=this.cache.cla.claIds||{}; + return ids.hasOwnProperty(tableId)||false; + } + ,isClassYes:function (tableId) { + var ids=this.cache.cla.claIds||{}; + return ids[tableId]||false; + } + ,pushClassIds:function (tableId,is) { + this.cache.cla.claIds[tableId]=is; + } + ,setObj:function (tableId,key,o) { + if(!this.obj[tableId])this.obj[tableId]={}; + this.obj[tableId][key]=o; + } + ,getObj:function (tableId, key) { + return this.obj[tableId]?this.obj[tableId][key]:null; + } + /** + * 获取列表数据 + */ + ,getDataList:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.list; + } + return []; + } + /** + * 设置列表数据 + */ + ,setDataList:function (tableId, list) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.list)table.cache[tableId].data.list=[]; + table.cache[tableId].data.list=list; + } + /** + * 获取列表数据 + */ + ,getDataMap:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.map; + } + return {}; + } + /** + * 设置列表数据 + */ + ,setDataMap:function (tableId, map) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.map)table.cache[tableId].data.map={}; + table.cache[tableId].data.map=map; + } + /** + * 获取树状数据 + */ + ,getDataTreeList:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.treeList; + } + return []; + } + /** + * 设置树状数据 + */ + ,setDataTreeList:function (tableId, treeList) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.treeList)table.cache[tableId].data.treeList={}; + table.cache[tableId].data.treeList=treeList; + } + /** + * 获取根节点数据 + */ + ,getDataRootList:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.upIds||[]; + } + return []; + } + /** + * 设置根节点数据 + */ + ,setDataRootList:function (tableId, rootList) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.upIds)table.cache[tableId].data.upIds=[]; + table.cache[tableId].data.upIds=rootList; + } + /** + * 初始化 + * @param filter + * @param settings + * @return {table} + */ + ,init:function (filter, settings) { + settings = settings || {}; + var that = this + ,elemTable = filter ? $('table[lay-filter="'+ filter +'"]') : $(ELEM + '[lay-data]') + ,errorTips = 'Table element property lay-data configuration item has a syntax error: '; + //遍历数据表格 + elemTable.each(function(){ + var othis = $(this), tableData = othis.attr('lay-data'); + try{ + tableData = new Function('return '+ tableData)(); + } catch(e){ + hint.error(errorTips + tableData) + } + var cols = [], options = $.extend({ + elem: this + ,cols: [] + ,data: [] + ,skin: othis.attr('lay-skin') //风格 + ,size: othis.attr('lay-size') //尺寸 + ,even: typeof othis.attr('lay-even') === 'string' //偶数行背景 + }, table.config, settings, tableData); + + filter && othis.hide(); + + //获取表头数据 + othis.find('thead>tr').each(function(i){ + options.cols[i] = []; + $(this).children().each(function(ii){ + var th = $(this), itemData = th.attr('lay-data'); + + try{ + itemData = new Function('return '+ itemData)(); + } catch(e){ + return hint.error(errorTips + itemData) + } + + var row = $.extend({ + title: th.text() + ,colspan: th.attr('colspan') || 0 //列单元格 + ,rowspan: th.attr('rowspan') || 0 //行单元格 + }, itemData); + + if(row.colspan < 2) cols.push(row); + options.cols[i].push(row); + }); + }); + + //获取表体数据 + othis.find('tbody>tr').each(function(i1){ + var tr = $(this), row = {}; + //如果定义了字段名 + tr.children('td').each(function(i2, item2){ + var td = $(this) + ,field = td.data('field'); + if(field){ + return row[field] = td.html(); + } + }); + //如果未定义字段名 + layui.each(cols, function(i3, item3){ + var td = tr.children('td').eq(i3); + row[item3.field] = td.html(); + }); + options.data[i1] = row; + }); + table.render(options); + }); + + return that; + } + /** + * 渲染入口方法(核心入口) + */ + ,render:function (options) { + table.pushClassIds(options.id); + var inst = new Class(options); + return thisTable.call(inst); + } + /** + * 对应的表格加载完成后执行(方法已弃用,请使用parseData代替) + * @param tableId + * @param fn + */ + ,ready:function (tableId,fn) { + var is=false; + var myDate=new Date(); + function isReady() { + if(tableId){ + var that=table.getClass(tableId); + if(that&&that.hasOwnProperty('layBody')){ + fn(that); + is=true; + }else{ + var myDate2=new Date(); + var i=myDate2.getTime()-myDate.getTime(); + if(i<=(1000*10)&&!is){//大于10秒退出 + setTimeout(isReady,50); + } + } + } + } + if(tableId&&fn){ + setTimeout(isReady,50); + } + } + /** + * 获取表格选中记录 + * @param tableId + * @return {{data: Array, isAll: boolean}} + */ + ,checkStatus:function (tableId) { + var nums = 0 + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || []; + //计算全选个数 + layui.each(data, function(i, item){ + if(item.constructor === Array){ + invalidNum++; //无效数据,或已删除的 + return; + } + if(item[table.config.cols.isCheckName]){ + nums++; + arr.push(table.clearCacheKey(item)); + } + }); + return { + data: arr //选中的数据 + ,isAll: data.length ? (nums === (data.length - invalidNum)) : false //是否全选 + }; + } + /** + * 设置表格复选状态 + * @param tableId + * @param value 此值存在时为设置操作 + * @returns {*} + */ + ,setCheckStatus:function(tableId, fildName, ids){ + var retObj=null; + var that=table.getClass(tableId) + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || [] + ,childs = that.layBody.find('input[name="'+TABLE_CHECKBOX_ID+'"]')//复选框 + ; + if(fildName&&ids){//设置选中 + var idsarr=ids.split(','); + idsarr.forEach(function (o) { + var temo=null; + data.forEach(function (e) { + var b1=e[fildName]+""; + var b2=o+""; + if(b1==b2){ + temo=e; + return; + }; + }); + if(temo){ + var v=temo[table.config.indexName]; + that.layBody.find('input[name="'+TABLE_CHECKBOX_ID+'"][value="'+v+'"]').prop("checked",true); + that.setCheckData(v, true); + } + }); + that.syncCheckAll(); + that.renderForm('checkbox'); + } + return retObj; + } + /** + * 表格单选状态 + * @param tableId + * @param value 此值存在时为设置操作 + * @returns {*} + */ + ,radioStatus:function (tableId) { + var that=table.getClass(tableId); + var retObj=null; + var nums = 0 + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || []; + var v=that.layBody.find("input[name='"+TABLE_RADIO_ID+"']:checked").val(); + v=parseInt(v); + data.forEach(function (e) { + if(e[table.config.indexName]==v){ + retObj=e; + }; + }); + return table.clearCacheKey(retObj); + } + /** + * 设置表格单选状态 + * @param tableId + * @param value 此值存在时为设置操作 + * @returns {*} + */ + ,setRadioStatus:function (tableId,fildName,value) { + var that=table.getClass(tableId); + var retObj=null; + var nums = 0 + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || []; + + if(fildName&&value){//设置选中 + data.forEach(function (e) { + var b1=e[fildName]+""; + var b2=value+""; + if(b1==b2){ + retObj=e; + return; + }; + }); + + if(retObj){ + var v=retObj[table.config.indexName]; + that.layBody.find("input:radio[name='"+TABLE_RADIO_ID+"'][value='"+v+"']").prop("checked",true); + form.render('radio'); + } + } + return retObj; + } + /** + * 清除临时Key + * @param data + * @return {*} + */ + ,clearCacheKey:function (data) { + data = $.extend({}, data); + delete data[table.config.cols.isCheckName]; + delete data[table.config.indexName]; + return data; + } + /** + * 刷新数据 + * @param id + * @param options + * @return {*} + */ + ,query:function (tableId, options) { + var that= table.getClass(tableId); + that.renderTdCss(); + if(that.config.data && that.config.data.constructor === Array) delete that.config.data; + that.config = $.extend({}, that.config, options); + that.pullData(that.page, that.loading()); + } + /** + * 此方法为整体重新渲染(重量级刷新方法) + * @param id + * @param options + */ + ,reload:function (tableId, options) { + var config = thisTable.config[tableId]; + options = options || {}; + if(!config) return hint.error('The ID option was not found in the table instance'); + if(options.data && options.data.constructor === Array) delete config.data; + return table.render($.extend(true, {}, config, options)); + } + /** + * 添加一行或多行数据 + * @param tableId 表格id + * @param index 在第几个位置插入(从0开始) + * @param data 数据 + * @returns {*} + */ + ,addRow:function (tableId, index, data) { + var that=table.getClass(tableId) + ,options=that.config + ,uo = []//父级节点 + ,treeList=table.getDataTreeList(tableId) + ,list = table.getDataList(tableId) || []; + that.resetData(data); + //插入到父节点后面 + list.splice(index,0,data);//更新缓存 + table.kit.restNumbers(list);//重置下标 + table.setDataMap(tableId,that.resetDataMap(list));//处理map + if(options.isTree){//处理层级 + //1、处理父级 2、处理treeObj 3、层级 + var uo=that.treeFindUpData(data); + if(uo) { + if(!uo.children){uo.children=[]} + uo.children.push(data); + data[table.config.cols.level]=uo[table.config.cols.level]+1; + }else{ + data[table.config.cols.level]=1; + treeList.push(data); + } + } + //生成html + var tds=that.renderTr(data,data[table.config.indexName]); + var trs='
              '+ tds.join('') + ''; + if(index==0){//在第一个位置插入 + var tbody=that.layBody.find('table tbody'); + $(tbody).prepend(trs); + that.layBody.find(".layui-none").remove(); + }else{ + var o=that.layBody.find('[data-index='+(index-1)+']');//父节点dom树 + $(o).after(trs); + } + that.renderForm(); + if(options.isPage)that.renderPage(that.config.page.count+1);//分页渲染 + that.restNumbers(); + that.events(); + if(options.isTree) {//展开节点 + that.treeNodeOpen(uo, true); + that.renderTreeConvertShowName(uo); + } + } + /** + * 删除一行或多行数据 + * (如果是树状则删除自己和子节点) + * @param tableId + * @param data(1、数组;2、对象) + */ + ,delRow:function (tableId, data) { + //1、页面清除 2、缓存清除 + var that=table.getClass(tableId) + ,options=that.config + ,list=table.getDataList(tableId); + var sonList=[];//需要删除的数据 + var delIds={};//需要删除的数据map + var delDatas=[]; + var upDelDatas=[];//全部待删除节点的父节点(处理折叠) + if(!that||!data)return; + if(table.kit.isArray(data)){//是数组,删除多个 + delDatas=data; + }else{ + delDatas[0]=data; + } + delDatas.forEach(function(temo) {//记录全部父节点 + var uo=that.treeFindUpData(temo); + if(uo){ + upDelDatas.push(uo); + } + }); + sonList=options.isTree?table.treeFindSonList(that.config.id,delDatas):delDatas; + sonList.forEach(function (temo) {//页面元素处理 + var index=temo[table.config.indexName]; + delIds[index]=index;//设置代删除的id集合 + var tr = that.layBody.find('tr[data-index="'+ index +'"]'); + tr.remove(); + }); + that.restNumbers();//数据处理 + var newList=[];//重构一个新的数组 + for (var i=0,len=list.length;i0){ + var temSonList=that.treeFindSonData(temo); + temSonList.forEach(function (temii) { + if(!delIds[temii[table.config.indexName]]){ + sonList.push(temii); + delIds[temii[table.config.indexName]]=temii[table.config.indexName]; + } + }); + } + sonList.push(temo); + delIds[temo[table.config.indexName]]=temo[table.config.indexName]; + }); + return sonList; + } + ,treeFindUpDatas:function (tableId, o) { + var that=table.getClass(tableId); + if(!that||!o)return []; + return that.treeFindUpDatas(o); + } + ,treeFindUpData:function (tableId, o) { + var that=table.getClass(tableId); + if(!that||!o)return []; + return that.treeFindUpData(o); + } + /** + * 获取全部需要子节点id集合 + * @param data(数组或对象) + */ + ,treeFindSonIds:function (tableId,data) { + var delIds=[]; + var sonList=table.treeFindSonList(tableId,data); + sonList.forEach(function (temo) { + delIds.push([table.config.indexName]); + }); + return delIds; + } + /** + * 获取全部的id字段集合 + * @param tableId + * @param data + * @returns {Array} + */ + ,treeFindSonIdFields:function (tableId,data) { + var idField=[]; + var that=table.getClass(tableId); + var sonList=table.treeFindSonList(tableId,data); + sonList.forEach(function (temo) { + idField.push(temo[that.config.idField]); + }); + return idField; + } + /** + * icon渲染 + * @param tableId + * @param o + * @return {*} + */ + ,treeIconRender:function (tableId, o) { + var that=table.getClass(tableId); + if(!that||!o)return []; + return that.treeIconRender(o,false); + } + /** + * 获取当前选中的行 + * @param tableId + */ + ,treeFindRowCheck:function (tableId) { + var rowchecks=[]; + var list=table.getDataList(tableId); + if(list){ + list.forEach(function (temo) { + if(temo[table.config.cols.isRowCheck]){ + rowchecks.push(temo); + } + }); + } + return rowchecks; + } + /** + * 当前选中的行 + * @param tableId + */ + ,treeRowCheck:function (tableId,index) { + var that=table.getClass(tableId); + if(!that)return; + var list=table.getDataList(that.config.id); + var o=list[index]; + if(that.config.model=="tree"){ + list.forEach(function (temo) { + temo[table.config.cols.isRowCheck]=false; + }); + o[table.config.cols.isRowCheck]=true; + that.layBody.find("tr").css("background-color",""); + that.getTr(index).css("background-color","#ccc"); + } + typeof that.config.onClickRow === 'function' && that.config.onClickRow(index,o); + } + + /** + * 工具方法对象 + */ + ,kit:{ + isArray:function (o) { + return Object.prototype.toString.call(o) === '[object Array]'; + } + ,isNumber:function (val){ + var regPos = /^\d+(\.\d+)?$/; //非负浮点数 + var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数 + if(regPos.test(val) || regNeg.test(val)){ + return true; + }else{ + return false; + } + + } + ,restNumbers:function (list) { + if(!list)return; + var i=0; + list.forEach(function (o) { + o[table.config.indexName]=i; + i++; + }); + } + } + } + //操作当前实例 + ,thisTable = function(){ + var that = this + ,options = that.config + ,id = options.id; + id && (thisTable.config[id] = options); + return { + reload: function(options){ + that.reload.call(that, options); + } + ,config: options + } + } + //字符常量 + ,MOD_NAME = 'treeGrid', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled', NONE = 'layui-none' + ,ELEM_VIEW = 'layui-table-view', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOOL = '.layui-table-tool', ELEM_PAGE = '.layui-table-page', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover' + ,TABLE_RADIO_ID='table_radio_',TABLE_CHECKBOX_ID='layTableCheckbox' + ,ELEM_FILTER='.layui-table-filter' + ,TREE_ID='treeId',TREE_UPID='treeUpId',TREE_SHOW_NAME='treeShowName',TREE_KEY_MAP='tree_key_map' + //thead区域模板 + ,TPL_HEADER = function(options){ + var rowCols = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}'; + options = options || {}; + return ['
              父级导航*父级导航* @@ -15,28 +16,26 @@ {/volist} 排序 + 排序
              导航名称*导航名称* 网址链接网址链接
              参数参数 是否新窗口打开 - 是否新窗口打开 {if condition="$id eq 0"} @@ -48,8 +47,7 @@
              状态* - 状态* {if condition="$id eq 0"} @@ -65,7 +63,6 @@
              -
              {/block} @@ -81,30 +78,20 @@ //监听提交 form.on('submit(webform)', function(data) { $.ajax({ - url: "/admin/nav/nav_info_submit", + url: "/admin/nav/nav_info_add", type: 'post', data: data.field, - success: function(e) { + success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { - icon: 3, - title: '提示' - }, function(index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + window.setTimeout(function(){ + parent.location.reload(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function() { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/role/add.html b/app/admin/view/role/add.html index bec6603..fb28516 100644 --- a/app/admin/view/role/add.html +++ b/app/admin/view/role/add.html @@ -1,14 +1,19 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="body"} -
              - + + +

              权限角色

              +
              - - - - - + '].join(''); + + return td; + } + /** + * 生成tr中的一行 + * @param obj 行数据 + * @param numbers 行号 + * @returns {*} + */ + Class.prototype.renderTr=function (obj,numbers) { + var that = this + ,options = that.config; + var tds= []; + that.eachCols(function(i3, cols){//cols列定义 + var field = cols.field || i3, content = obj[field] + ,cell = that.getColElem(that.layHeader, field); + if(content === undefined || content === null) content = ''; + if(cols.colspan > 1) return; + //td内容 + var td = that.renderTd({ + 'obj':obj,'numbers':numbers,'cols':cols,'i3':i3 + }); + tds.push(td); + // if(item3.fixed && item3.fixed !== 'right') tds_fixed.push(td); + // if(item3.fixed === 'right') tds_fixed_r.push(td); + }); + return tds; + }; + /** + * 表格数据部分渲染入口 + * @param res + * @param curr + * @param count + * @param sort + */ + Class.prototype.renderData = function(res, curr, count, sort){ + var that = this + ,options = that.config + ,data = res[options.response.dataName] || [] + ,trs = [] + ,trs_fixed = [] + ,trs_fixed_r = [] + //渲染视图 + ,render = function(){ //后续性能提升的重点 + if(!sort && that.sortKey){ + return that.sort(that.sortKey.field, that.sortKey.sort, true); + } + layui.each(data, function(i1, obj){ + var uo=that.treeFindUpData(obj); + var display=""; + if(!obj[table.config.cols.isShow]){ + display="display: none;"; + } + var tds = [], tds_fixed = [], tds_fixed_r = [] + ,numbers = i1 + options.limit*(curr - 1) + 1; //序号 + if(obj.length === 0) return; + if(!sort){ + obj[table.config.indexName] = i1; + } + tds=that.renderTr(obj,numbers); + trs.push(''+ tds.join('') + ''); + + trs_fixed.push(''+ tds_fixed.join('') + ''); + trs_fixed_r.push(''+ tds_fixed_r.join('') + ''); + }); + + //if(data.length === 0) return; + + that.layBody.scrollTop(0); + that.layMain.find('.'+ NONE).remove(); + that.layMain.find('tbody').html(trs.join('')); + that.layFixLeft.find('tbody').html(trs_fixed.join('')); + that.layFixRight.find('tbody').html(trs_fixed_r.join('')); + + that.renderForm(); + that.syncCheckAll(); + that.haveInit ? that.scrollPatch() : setTimeout(function(){ + that.scrollPatch(); + }, 50); + that.haveInit = true; + layer.close(that.tipsIndex); + }; + that.key = options.id || options.index; + // table.cache[that.key] = data; //记录数据 + table.setDataList(that.key,data); + //显示隐藏分页栏 + that.layPage[data.length === 0 && curr == 1 ? 'addClass' : 'removeClass'](HIDE); + //排序 + if(sort){ + return render(); + } + if(data.length === 0){ + that.renderForm(); + that.layFixed.remove(); + that.layMain.find('tbody').html(''); + that.layMain.find('.'+ NONE).remove(); + return that.layMain.append('
              '+ options.text.none +'
              '); + } + render(); + that.renderPage(count);//分页渲染 + //calss加载完成 + table.pushClassIds(options.id,true); + that.syncCheckAll(); + layui.each(options.cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + }) + }); + }; + /** + * 渲染分页 + */ + Class.prototype.renderPage=function (count) { + var that = this + ,options = that.config; + //同步分页状态 + if(options.page){ + options.page = $.extend({ + elem: 'layui-table-page' + options.index + ,count: count + ,limit: options.limit + ,limits: options.limits || [10,15,20,30,40,50,60,70,80,90] + ,groups: 3 + ,layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'] + ,prev: '' + ,next: '' + ,jump: function(obj, first){ + if(!first){ + //分页本身并非需要做以下更新,下面参数的同步,主要是因为其它处理统一用到了它们 + //而并非用的是 options.page 中的参数(以确保分页未开启的情况仍能正常使用) + that.page = obj.curr; //更新页码 + options.limit = obj.limit; //更新每页条数 + that.pullData(obj.curr, that.loading()); + } + } + }, options.page); + options.page.count = count; //更新总条数 + laypage.render(options.page); + } + }; + /** + * 过滤区域的渲染 + */ + Class.prototype.renderFilter = function(){ + var that = this + ,options = that.config + ,VIEW_CLASS=ELEM_VIEW + ,index=that.index; //索引 + var v = []; + v.push(''); + v.push('
              角色名称* - 状态* @@ -24,45 +29,7 @@
              权限配置
              操作菜单可见
              - - - - - - {volist name="role_menu" id="vo"} - - - {notempty name="vo.children"} - - {/notempty} - - {/volist} -
              选择要显示的顶级菜单 选择要显示的子级菜单
              - - -
              - {volist name="vo.children" key="k" id="voo"} -
              - -
              - {notempty name="voo.children"} -
              - {volist name="voo.children" id="vooo"} -
              - -
              - {/volist} -
              - {/notempty} - {/volist} -
              -
              -
              权限配置
              操作节点可用
              权限配置 @@ -71,18 +38,18 @@ {volist name="role_rule" id="vo"} - {notempty name="vo.children"} diff --git a/app/install/data/gougucms.sql b/app/install/data/gougucms.sql index 7b1e24a..1914bef 100644 --- a/app/install/data/gougucms.sql +++ b/app/install/data/gougucms.sql @@ -39,7 +39,6 @@ CREATE TABLE `cms_admin_group` ( `title` varchar(255) NOT NULL DEFAULT '', `status` int(1) NOT NULL DEFAULT '1', `rules` varchar(1000) DEFAULT '' COMMENT '用户组拥有的规则id, 多个规则","隔开', - `menus` varchar(1000) DEFAULT '', `desc` text COMMENT '备注', `create_time` int(11) NOT NULL DEFAULT '0', `update_time` int(11) NOT NULL DEFAULT '0', @@ -50,8 +49,8 @@ CREATE TABLE `cms_admin_group` ( -- ---------------------------- -- Records of cms_admin_group -- ---------------------------- -INSERT INTO `cms_admin_group` VALUES ('1', '超级管理员', '1', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22', '超级管理员,系统自动分配所有可操作权限及菜单。', '0', '0'); -INSERT INTO `cms_admin_group` VALUES (2, '测试角色', 1, '1,5,6,11,15,19,23,28,29,30,2,37,41,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,3,67,68,70,71,72,73,4,74,75,76,77,78,79,80,81', '1,5,6,7,8,9,10,11,12,2,13,14,15,16,17,3,18,19,4,20,21,22', '测试角色', 0, 0); +INSERT INTO `cms_admin_group` VALUES ('1', '超级管理员', '1', '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80', '超级管理员,系统自动分配所有可操作权限及菜单。', '0', '0'); +INSERT INTO `cms_admin_group` VALUES (2, '测试角色', 1, '1,11,15,18,21,26,28,29,30,33,2,37,40,46,49,52,55,58,3,60,63,65,67,68,4,69,72,5,75,78', '测试角色', 0, 0); -- ---------------------------- -- Table structure for `cms_admin_group_access` -- ---------------------------- @@ -70,170 +69,167 @@ CREATE TABLE `cms_admin_group_access` ( INSERT INTO `cms_admin_group_access` VALUES ('1', '1', '0', '0'); -- ---------------------------- --- Table structure for `cms_admin_menu` +-- Table structure for cms_admin_module -- ---------------------------- -DROP TABLE IF EXISTS `cms_admin_menu`; -CREATE TABLE `cms_admin_menu` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `pid` int(11) NOT NULL DEFAULT '0', - `title` varchar(255) NOT NULL DEFAULT '', - `src` varchar(255) DEFAULT '', - `icon` varchar(255) DEFAULT '', - `sort` int(11) NOT NULL DEFAULT '1' COMMENT '越大越靠前', - `create_time` int(11) NOT NULL DEFAULT '0', - `update_time` int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='后台菜单'; +DROP TABLE IF EXISTS `cms_admin_module`; +CREATE TABLE `cms_admin_module` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '模块名称', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT '模块所在目录,小写字母', + `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标', + `status` int(1) NOT NULL DEFAULT 1 COMMENT '状态,0禁用,1正常', + `type` int(1) NOT NULL DEFAULT 2 COMMENT '模块类型,2普通模块,1系统模块', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '功能模块表'; -- ---------------------------- --- Records of cms_admin_menu +-- Records of cms_admin_module -- ---------------------------- -INSERT INTO `cms_admin_menu` VALUES (1, 0, '系统管理', '', 'icon-yingyongguanli', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (2, 0, '基础数据', '', 'icon-shebeiguanli', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (3, 0, '平台用户', '', 'icon-quanxianshenpi', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (4, 0, '资讯中心', '', 'icon-daibanshixiang', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (5, 1, '系统配置', 'admin/conf/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (6, 1, '功能菜单', 'admin/menu/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (7, 1, '功能节点', 'admin/rule/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (8, 1, '权限角色', 'admin/role/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (9, 1, '管 理 员', 'admin/admin/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (10, 1, '操作日志', 'admin/admin/log', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (11, 1, '数据备份', 'admin/database/database', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (12, 1, '数据还原', 'admin/database/backuplist', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (13, 2, '导航设置', 'admin/nav/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (14, 2, '网站地图', 'admin/sitemap/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (15, 2, '轮播广告', 'admin/slide/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (16, 2, 'SEO关键字', 'admin/keywords/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (17, 2, '搜索关键词', 'admin/search/index', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (18, 3, '用户列表', 'admin/user/index', '',1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (19, 3, '操作记录', 'admin/user/record', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (20, 3, '操作日志', 'admin/user/log', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (21, 4, '文章分类', 'admin/article/cate', '', 1, 0, 0); -INSERT INTO `cms_admin_menu` VALUES (22, 4, '文章列表', 'admin/article/index', '', 1, 0, 0); +INSERT INTO `cms_admin_module` VALUES (1, '后台模块', 'admin', '', 1, 1, 1639562910, 0); +INSERT INTO `cms_admin_module` VALUES (2, '前台模块', 'home', '', 1, 1, 1639562910, 0); -- ---------------------------- --- Table structure for `cms_admin_rule` +-- Table structure for cms_admin_rule -- ---------------------------- DROP TABLE IF EXISTS `cms_admin_rule`; -CREATE TABLE `cms_admin_rule` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `pid` int(11) unsigned NOT NULL DEFAULT '0', - `src` varchar(255) NOT NULL DEFAULT '' COMMENT '规则', - `title` varchar(255) NOT NULL DEFAULT '', - `create_time` int(11) NOT NULL DEFAULT '0', - `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', - PRIMARY KEY (`id`), - UNIQUE KEY `id` (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='权限节点'; +CREATE TABLE `cms_admin_rule` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `pid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父id', + `src` varchar(255) NOT NULL DEFAULT '' COMMENT 'url链接', + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '名称', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT '日志操作名称', + `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标', + `menu` int(1) NOT NULL DEFAULT 0 COMMENT '是否是菜单,1是,2不是', + `sort` int(11) NOT NULL DEFAULT 1 COMMENT '越小越靠前', + `status` int(1) NOT NULL DEFAULT 1 COMMENT '状态,0禁用,1正常', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '菜单及权限表'; -- ---------------------------- -- Records of cms_admin_rule -- ---------------------------- -INSERT INTO `cms_admin_rule` VALUES (1, 0, '', '系统管理', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (2, 0, '', '基础数据', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (3, 0, '', '平台用户', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (4, 0, '', '资讯中心', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (5, 1, 'admin/conf/index', '系统配置', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (6, 5, 'admin/conf/add', '新增配置信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (7, 5, 'admin/conf/post_submit', '保存配置信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (8, 5, 'admin/conf/edit', '编辑配置详情', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (9, 5, 'admin/conf/conf_submit', '保存配置内容', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (10, 5, 'admin/conf/delete', '删除配置信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (11, 1, 'admin/menu/index', '功能菜单', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (12, 11, 'admin/menu/add', '添加菜单', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (13, 11, 'admin/menu/post_submit', '保存菜单信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (14, 11, 'admin/menu/delete', '删除菜单', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (15, 1, 'admin/rule/index', '功能节点', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (16, 15, 'admin/rule/add', '添加节点', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (17, 15, 'admin/rule/post_submit', '保存节点信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (18, 15, 'admin/rule/delete', '删除节点', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (19, 1, 'admin/role/index', '权限角色', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (20, 19, 'admin/role/add', '添加角色',0, 0); -INSERT INTO `cms_admin_rule` VALUES (21, 19, 'admin/role/post_submit', '保存角色信息',0, 0); -INSERT INTO `cms_admin_rule` VALUES (22, 19, 'admin/role/delete', '删除角色', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (23, 1, 'admin/admin/index', '管理员', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (24, 23, 'admin/admin/add', '添加/修改管理员', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (25, 23, 'admin/admin/post_submit', '保存管理员信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (26, 23, 'admin/admin/view', '查看管理员信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (27, 23, 'admin/admin/delete', '删除管理员',0, 0); -INSERT INTO `cms_admin_rule` VALUES (28, 1, 'admin/admin/log', '操作日志',0, 0); -INSERT INTO `cms_admin_rule` VALUES (29, 1, 'admin/database/database', '备份数据', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (30, 29, 'admin/database/backup', '备份数据表', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (31, 29, 'admin/database/optimize', '优化数据表', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (32, 29, 'admin/database/repair', '修复数据表', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (33, 1, 'admin/database/backuplist', '还原数据', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (34, 33, 'admin/database/import', '还原数据表', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (35, 33, 'admin/database/downfile', '下载备份数据', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (36, 33, 'admin/database/del', '删除备份数据', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (37, 2, 'admin/nav/index', '导航组管理', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (38, 37, 'admin/nav/add', '添加/修改导航组', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (39, 37, 'admin/nav/post_submit', '保存导航组信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (40, 37, 'admin/nav/delete', '删除导航组', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (41, 2, 'admin/nav/nav_info', '导航管理', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (42, 41, 'admin/nav/nav_info_add', '添加/修改导航', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (43, 41, 'admin/nav/nav_info_submit', '保存导航信息',0, 0); -INSERT INTO `cms_admin_rule` VALUES (44, 41, 'admin/nav/nav_info_delete', '删除导航',0, 0); -INSERT INTO `cms_admin_rule` VALUES (45, 2, 'admin/sitemap/index', '网站地图分类', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (46, 45, 'admin/sitemap/add', '添加/编辑网站地图分类', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (47, 45, 'admin/sitemap/post_submit', '保存网站地图分类信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (48, 45, 'admin/sitemap/delete', '删除网站地图分类', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (49, 2, 'admin/sitemap/sitemap_info', '网站地图', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (50, 49, 'admin/sitemap/sitemap_info_add', '添加/编辑网站地图',0, 0); -INSERT INTO `cms_admin_rule` VALUES (51, 49, 'admin/sitemap/sitemap_info_submit', '保存网站地图信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (52, 49, 'admin/sitemap/sitemap_info_delete', '删除网站地图', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (53, 2, 'admin/slide/index', '轮播组',0, 0); -INSERT INTO `cms_admin_rule` VALUES (54, 53, 'admin/slide/add', '添加轮播组', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (55, 53, 'admin/slide/post_submit', '保存轮播组信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (56, 53, 'admin/slide/delete', '删除轮播组', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (57, 2, 'admin/slide/slide_info', '轮播广告', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (58, 57, 'admin/slide/slide_info_add', '添加轮播图', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (59, 57, 'admin/slide/slide_info_submit', '保存轮播图信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (60, 57, 'admin/slide/slide_info_delete', '删除轮播图', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (61, 2, 'admin/keywords/index', 'SEO关键字', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (62, 61, 'admin/keywords/add', '添加SEO关键字', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (63, 61, 'admin/keywords/post_submit', '保存SEO关键字', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (64, 61, 'admin/keywords/delete', '删除SEO关键字', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (65, 2, 'admin/search/index', '搜索关键字', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (66, 65, 'admin/search/delete', '删除搜索关键字', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (67, 3, 'admin/user/index', '用户管理', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (68, 67, 'admin/user/edit', '编辑用户信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (69, 67, 'admin/user/post_submit', '保存用户信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (70, 67, 'admin/user/view', '查看用户信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (71, 67, 'admin/user/delete', '禁用用户',0, 0); -INSERT INTO `cms_admin_rule` VALUES (72, 3, 'admin/user/record', '操作记录', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (73, 3, 'admin/user/log', '操作日志', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (74, 4, 'admin/article/cate', '文章分类', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (75, 74, 'admin/article/cate_add', '添加文章分类', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (76, 74, 'admin/article/cate_post_submit', '保存文章分类信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (77, 74, 'admin/article/cate_delete', '删除文章分类', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (78, 4, 'admin/article/index', '文章列表', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (79, 78, 'admin/article/add', '添加文章', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (80, 78, 'admin/article/post_submit', '保存文章信息', 0, 0); -INSERT INTO `cms_admin_rule` VALUES (81, 78, 'admin/article/delete', '删除文章', 0, 0); +INSERT INTO `cms_admin_rule` VALUES (1, 0, '', '系统管理', '系统管理', 'icon-jichupeizhi', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (2, 0, '', '基础数据', '基础数据', 'icon-hetongshezhi', 1, 2, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (3, 0, '', '平台用户', '平台用户', 'icon-renshishezhi', 1, 3, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (4, 0, '', '资讯中心', '资讯中心', 'icon-kechengziyuanguanli', 1, 4, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (5, 0, '', '商品中心', '商品中心', 'icon-dianshang', 1, 5, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (11, 1, 'admin/conf/index', '系统配置', '系统配置', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (12, 11, 'admin/conf/add', '新建/编辑', '配置项', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (13, 11, 'admin/conf/delete', '删除', '配置项', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (14, 11, 'admin/conf/edit', '编辑', '配置详情', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (15, 1, 'admin/module/index', '功能模块', '功能模块', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (16, 15, 'admin/module/add', '新建/编辑', '功能模块', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (17, 15, 'admin/module/disable', '禁用/启用', '功能模块', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (18, 1, 'admin/rule/index', '功能节点', '功能节点', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (19, 18, 'admin/rule/add', '新建/编辑', '功能节点', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (20, 18, 'admin/rule/delete', '删除', '功能节点', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (21, 1, 'admin/role/index', '权限角色', '权限角色', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (22, 21, 'admin/role/add', '新建/编辑', '权限角色', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (23, 21, 'admin/role/delete', '删除', '权限角色', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (24, 1, 'admin/admin/index', '管理员', '管理员', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (25, 24, 'admin/admin/add', '添加/修改', '管理员', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (26, 24, 'admin/admin/view', '查看', '管理员', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (27, 24, 'admin/admin/delete', '删除', '管理员', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (28, 1, 'admin/log/index', '操作日志', '操作日志', '', 1, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (29, 1, 'admin/database/database', '备份数据', '备份数据', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (30, 29, 'admin/database/backup', '备份数据表', '备份数据', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (31, 29, 'admin/database/optimize', '优化数据表', '优化数据表', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (32, 29, 'admin/database/repair', '修复数据表', '修复数据表', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (33, 1, 'admin/database/backuplist', '还原数据', '还原数据', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (34, 33, 'admin/database/import', '还原数据表', '还原数据', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (35, 33, 'admin/database/downfile', '下载备份数据', '下载备份数据', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (36, 33, 'admin/database/del', '删除备份数据', '删除备份数据', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (37, 2, 'admin/nav/index', '导航设置','导航组', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (38, 37, 'admin/nav/add', '新建/编辑','导航组', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (39, 37, 'admin/nav/delete', '删除','导航组', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (40, 2, 'admin/nav/nav_info', '导航管理','导航', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (41, 40, 'admin/nav/nav_info_add', '新建/编辑','导航', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (42, 40, 'admin/nav/nav_info_delete', '删除导航','导航', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (43, 2, 'admin/sitemap/index', '网站地图','网站地图分类', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (44, 43, 'admin/sitemap/add', '新建/编辑','网站地图分类', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (45, 43, 'admin/sitemap/delete', '删除','网站地图分类', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (46, 2, 'admin/sitemap/sitemap_info', '网站地图管理','网站地图', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (47, 46, 'admin/sitemap/sitemap_info_add', '新建/编辑','网站地图', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (48, 46, 'admin/sitemap/sitemap_info_delete', '删除','网站地图', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (49, 2, 'admin/slide/index', '轮播广告','轮播组', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (50, 49, 'admin/slide/add', '新建/编辑','轮播组', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (51, 49, 'admin/slide/delete', '删除','轮播组', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (52, 2, 'admin/slide/slide_info', '轮播广告管理','轮播图', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (53, 52, 'admin/slide/slide_info_add', '新建/编辑','轮播图', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (54, 52, 'admin/slide/slide_info_delete', '删除','轮播图', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (55, 2, 'admin/keywords/index', 'SEO关键字','SEO关键字', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (56, 55, 'admin/keywords/add', '新建/编辑','SEO关键字', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (57, 55, 'admin/keywords/delete', '删除','SEO关键字', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (58, 2, 'admin/search/index', '搜索关键字','搜索关键字', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (59, 58, 'admin/search/delete', '删除','搜索关键字', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (60, 3, 'admin/level/index', '用户等级', '用户等级', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (61, 60, 'admin/level/add', '新建/编辑', '用户等级', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (62, 60, 'admin/level/disable', '禁用/启用', '用户等级', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (63, 3, 'admin/user/index', '用户管理','用户', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (64, 63, 'admin/user/edit', '编辑','用户信息', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (65, 63, 'admin/user/view', '查看','用户信息', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (66, 63, 'admin/user/delete', '禁用','用户', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (67, 3, 'admin/user/record', '操作记录','用户操作记录', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (68, 3, 'admin/user/log', '操作日志','用户操作日志', '', 1, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (69, 4, 'admin/article/cate', '文章分类','文章分类', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (70, 69, 'admin/article/cate_add', '新建/编辑','文章分类', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (71, 69, 'admin/article/cate_delete', '删除','文章分类', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (72, 4, 'admin/article/index', '文章列表','文章', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (73, 72, 'admin/article/add', '新建/编辑','文章', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (74, 72, 'admin/article/delete', '删除','文章', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (75, 5, 'admin/goods/cate', '商品分类','商品分类', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (76, 75, 'admin/goods/cate_add', '新建/编辑','商品分类', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (77, 75, 'admin/goods/cate_delete', '删除','商品分类', '', 2, 1, 1, 0, 0); + +INSERT INTO `cms_admin_rule` VALUES (78, 5, 'admin/goods/index', '商品列表','商品', '', 1, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (79, 78, 'admin/goods/add', '新建/编辑','商品', '', 2, 1, 1, 0, 0); +INSERT INTO `cms_admin_rule` VALUES (80, 78, 'admin/goods/delete', '删除','商品', '', 2, 1, 1, 0, 0); -- ---------------------------- -- Table structure for `cms_admin_log` -- ---------------------------- DROP TABLE IF EXISTS `cms_admin_log`; -CREATE TABLE `cms_admin_log` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', - `uid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', +CREATE TABLE `cms_admin_log` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', + `uid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '用户ID', `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '昵称', `type` varchar(80) NOT NULL DEFAULT '' COMMENT '操作类型', + `action` varchar(80) NOT NULL DEFAULT '' COMMENT '操作动作', + `subject` varchar(80) NOT NULL DEFAULT '' COMMENT '操作主体', `title` varchar(255) NOT NULL DEFAULT '' COMMENT '操作标题', - `content` text COMMENT '操作描述', + `content` text NULL COMMENT '操作描述', `module` varchar(32) NOT NULL DEFAULT '' COMMENT '模块', `controller` varchar(32) NOT NULL DEFAULT '' COMMENT '控制器', `function` varchar(32) NOT NULL DEFAULT '' COMMENT '方法', `rule_menu` varchar(255) NOT NULL DEFAULT '' COMMENT '节点权限路径', `ip` varchar(64) NOT NULL DEFAULT '' COMMENT '登录ip', - `param_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作数据id', - `param` text COMMENT '参数json格式', - `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0删除 1正常', - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='后台操作日志表'; + `param_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作数据id', + `param` text NULL COMMENT '参数json格式', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '0删除 1正常', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '后台操作日志表'; -- ---------------------------- -- Table structure for `cms_config` @@ -291,11 +287,11 @@ CREATE TABLE `cms_article_cate` ( `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='内容分类表'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='文章分类表'; -- ---------------------------- -- Records of cms_article_cate -- ---------------------------- -INSERT INTO `cms_article_cate` VALUES (1, 0, 0, '勾股cms', '1', '分类描述内容...', 0, 1610196442); +INSERT INTO `cms_article_cate` VALUES (1, 0, 0, '勾股cms', '1', '文章描述内容...', 0, 1610196442); -- ---------------------------- -- Table structure for `cms_article` @@ -469,10 +465,6 @@ CREATE TABLE `cms_slide_info` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='幻灯片详情表'; --- ---------------------------- --- Records of cms_slide_info --- ---------------------------- - -- ---------------------------- -- Table structure for cms_search_keywords -- ---------------------------- @@ -485,6 +477,37 @@ CREATE TABLE `cms_search_keywords` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '搜索关键字表'; +-- ---------------------------- +-- Records of cms_search_keywords +-- ---------------------------- +INSERT INTO `cms_search_keywords` VALUES (1, '勾股CMS', 1, 1); + + +-- ---------------------------- +-- Table structure for cms_user_level +-- ---------------------------- +DROP TABLE IF EXISTS `cms_user_level`; +CREATE TABLE `cms_user_level` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '等级名称', + `desc` varchar(1000) DEFAULT NULL, + `status` int(1) NOT NULL DEFAULT 1 COMMENT '状态,0禁用,1正常', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '会员等级表'; + +-- ---------------------------- +-- Records of cms_admin_module +-- ---------------------------- +INSERT INTO `cms_user_level` VALUES (1, '普通会员','', 1, 1639562910, 0); +INSERT INTO `cms_user_level` VALUES (2, '铜牌会员','', 1, 1639562910, 0); +INSERT INTO `cms_user_level` VALUES (3, '银牌会员','', 1, 1639562910, 0); +INSERT INTO `cms_user_level` VALUES (4, '黄金会员','', 1, 1639562910, 0); +INSERT INTO `cms_user_level` VALUES (5, '白金会员','', 1, 1639562910, 0); +INSERT INTO `cms_user_level` VALUES (6, '钻石会员','', 1, 1639562910, 0); + + -- ---------------------------- -- Table structure for cms_user -- ---------------------------- @@ -513,7 +536,8 @@ CREATE TABLE `cms_user` ( `position` varchar(20) NOT NULL DEFAULT '' COMMENT '职位', `puid` int(11) NOT NULL DEFAULT 0 COMMENT '推荐人ID,默认是0', `qrcode_invite` int(11) NOT NULL DEFAULT 0 COMMENT '邀请场景二维码id', - `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态 -1删除 0禁用 1正常 ', + `level` tinyint(1) NOT NULL DEFAULT 1 COMMENT '等级 默认是普通会员', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态 -1删除 0禁用 1正常', `last_login_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间', `last_login_ip` varchar(64) NOT NULL DEFAULT '' COMMENT '最后登录IP', `login_num` int(11) NOT NULL DEFAULT '0', @@ -523,6 +547,10 @@ CREATE TABLE `cms_user` ( PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '用户表'; +-- ---------------------------- +-- Records of for `cms_user` +-- ---------------------------- +INSERT INTO `cms`.`cms_user`(`id`, `nickname`, `nickname_a`, `username`, `password`, `salt`, `name`, `mobile`, `mobile_status`, `email`, `headimgurl`, `sex`, `desc`, `birthday`, `country`, `province`, `city`, `company`, `address`, `depament`, `position`, `puid`, `qrcode_invite`, `level`, `status`, `last_login_time`, `last_login_ip`, `login_num`, `register_time`, `register_ip`, `wx_platform`) VALUES (1, '勾股cms', '', 'hdm58', '88964d8919fea661b3d156d46b492165', 'gmwI4f2ZKdqAHyMB1hoe', '小明名', '13800138000', 0, 'gougu@admin.com', '/static/admin/images/icon.png', 1, '勾股CMS是一套基于ThinkPHP6 + Layui + MySql打造的轻量级、高性能极速后台开发框架。', 0, '', '', '广州', '广州勾股科技有限公司', '珠江新城', '技术部', '技术总监', 0, 0, 1, 1, 1644820413, '127.0.0.1', 1, 1644820401, '127.0.0.1', 0); -- ---------------------------- -- Table structure for `cms_user_log` -- ---------------------------- @@ -571,3 +599,84 @@ CREATE TABLE `cms_file` ( `download` int(11) NOT NULL DEFAULT 0 COMMENT '下载量', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='文件表'; + + +-- ---------------------------- +-- Table structure for cms_goods_cate +-- ---------------------------- +DROP TABLE IF EXISTS `cms_goods_cate`; +CREATE TABLE `cms_goods_cate` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(100) NOT NULL DEFAULT '' COMMENT '商品分类名称', + `sort` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `pid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级id', + `keywords` varchar(255) DEFAULT '' COMMENT '关键字', + `desc` varchar(1000) DEFAULT '' COMMENT '描述', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态:-1删除 0禁用 1启用', + `create_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '商品分类表'; + +-- ---------------------------- +-- Records of cms_goods_cate +-- ---------------------------- +INSERT INTO `cms`.`cms_goods_cate`(`id`, `title`, `sort`, `pid`, `status`, `create_time`, `update_time`) VALUES (1, '勾股科技', 0, 0, 1, 1644808267, 0); + +-- ---------------------------- +-- Table structure for cms_goods +-- ---------------------------- +DROP TABLE IF EXISTS `cms_goods`; +CREATE TABLE `cms_goods` ( + `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, + `cate_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '分类ID', + `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '属性:1精华 2热门 3推荐', + `is_home` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否首页显示 0否 1是', + `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '-1删除 0下架 1正常', + `title` varchar(200) NOT NULL DEFAULT '' COMMENT '商品名称', + `thumb` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '缩略图', + `banner` varchar(1000) NOT NULL DEFAULT '' COMMENT '商品轮播图', + `tips` varchar(255) NOT NULL DEFAULT '' COMMENT '商品卖点,一句话推销', + `desc` varchar(1000) NOT NULL DEFAULT '' COMMENT '商品摘要', + `content` text NULL COMMENT 'PC端内容', + `m_content` text NULL COMMENT '手机端内容', + `base_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '市场价格', + `price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '实际价格', + `stocks` int(11) NOT NULL DEFAULT 0 COMMENT '商品库存', + `sales` int(11) NOT NULL DEFAULT 0 COMMENT '商品销量', + `address` varchar(200) NOT NULL DEFAULT '' COMMENT '商品发货地址', + `start_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '开始抢购时间', + `end_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '结束抢购时间', + `read` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '阅读量', + `sort` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '排序', + `is_mail` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否包邮 0否 1是', + `tag_values` varchar(200) NOT NULL DEFAULT '' COMMENT '商品标签 1正品保证 2一年保修 3七天退换 4赠运费险 5闪电发货 6售后无忧', + `admin_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人', + `create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间', + `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '编辑时间', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COMMENT = '商品表'; + +-- ---------------------------- +-- Records of cms_goods +-- ---------------------------- +INSERT INTO `cms`.`cms_goods`(`id`, `cate_id`, `type`, `is_home`, `status`, `title`, `thumb`, `banner`, `tips`, `desc`, `content`, `m_content`, `base_price`, `price`, `stocks`, `sales`, `address`, `start_time`, `end_time`, `read`, `sort`, `is_mail`, `tag_values`, `admin_id`, `create_time`, `update_time`) VALUES (1, 1, 1, 1, 1, '勾股CMS定制开发方案', 1, '', '赠送一年免费维护服务', '勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案。', '

              勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案勾股CMS定制开发方案。

              ', NULL, 1999.00, 1888.00, 0, 0, '', 0, 0, 0, 1, 1, '1,2,6', 0, 1644823517, 0); + +-- ---------------------------- +-- Table structure for `cms_goods_keywords` +-- ---------------------------- +DROP TABLE IF EXISTS `cms_goods_keywords`; +CREATE TABLE `cms_goods_keywords` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `aid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID', + `keywords_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关联关键字id', + `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:-1删除 0禁用 1启用', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `aid` (`aid`), + KEY `inid` (`keywords_id`) +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='商品关联表'; +-- ---------------------------- +-- Records of cms_goods_keywords +-- ---------------------------- +INSERT INTO `cms`.`cms_goods_keywords`(`id`, `aid`, `keywords_id`, `status`, `create_time`) VALUES (1, 1, 1, 1, 1644823517); \ No newline at end of file diff --git a/app/install/view/index/step3.html b/app/install/view/index/step3.html index 3eea3a4..b3f8944 100644 --- a/app/install/view/index/step3.html +++ b/app/install/view/index/step3.html @@ -195,7 +195,7 @@ $.ajax({ url:"https://www.gougucms.com/index.php?s=home/login/install_ajax", dataType:'jsonp', - data:'', + data:{'name':'勾股CMS'}, jsonp:'callback', success:function(result) { console.log(result); diff --git a/config/log.php b/config/log.php index ea24ff9..a23f66b 100644 --- a/config/log.php +++ b/config/log.php @@ -41,5 +41,38 @@ return [ ], // 其它日志通道配置 ], - + 'admin_action' => [ + 'login' => '登录', + 'upload' => '上传', + 'down' => '下载', + 'import' => '导入', + 'export' => '导出', + 'add' => '新增', + 'edit' => '编辑', + 'view' => '查看', + 'save' => '保存', + 'delete' => '删除', + 'send' => '发送', + 'disable' => '禁用', + 'recovery' => '恢复', + 'reset' => '重新设置', + ], + 'user_action' => [ + 'login' => '登录', + 'reg' => '注册', + 'upload' => '上传', + 'down' => '下载', + 'import' => '导入', + 'export' => '导出', + 'add' => '新增', + 'edit' => '编辑', + 'view' => '查看', + 'save' => '保存', + 'delete' => '删除', + 'sign' => '签到', + 'join' => '报名', + 'install' => '安装', + 'spider' => '爬行', + 'api' => 'API请求', + ], ]; diff --git a/extend/avatars/MDAvatars.php b/extend/avatars/MDAvatars.php index 79d8a26..6f69702 100644 --- a/extend/avatars/MDAvatars.php +++ b/extend/avatars/MDAvatars.php @@ -48,7 +48,7 @@ class MDAvatars ) { //如果是中文,并且没有中文字体包,则按拼音首字母对其进行转换 $CNByte = iconv("UTF-8", "gb2312", $this->Char); - $Code = ord($CNByte{0}) * 256 + ord($CNByte{1}) - 65536;//求其偏移量 + $Code = ord($CNByte[0]) * 256 + ord($CNByte[1]) - 65536;//求其偏移量 if ($Code >= -20319 and $Code <= -20284) $this->Char = "A"; if ($Code >= -20283 and $Code <= -19776) $this->Char = "B"; if ($Code >= -19775 and $Code <= -19219) $this->Char = "C"; diff --git a/public/index.php b/public/index.php index 7a5d482..7efb802 100644 --- a/public/index.php +++ b/public/index.php @@ -15,7 +15,7 @@ if (empty(file_exists(__DIR__ . '/../vendor/autoload.php'))) { require __DIR__ . '/../vendor/autoload.php'; // 定义当前版本号 -define('CMS_VERSION','1.9.6'); +define('CMS_VERSION','2.0.11'); // 定义ThinkPHP版本号 define('TP_VERSION','6.0.9'); diff --git a/public/static/admin/css/common.css b/public/static/admin/css/common.css index 9b19d28..701c8f7 100644 --- a/public/static/admin/css/common.css +++ b/public/static/admin/css/common.css @@ -39,9 +39,12 @@ :-ms-input-placeholder { /* Internet Explorer 10-11 */ color: #aaa; } - + .layui-card { box-shadow: 0 1px 3px 0 rgb(5 32 96 / 10%);} + .layui-table, .layui-table-view{margin:0} .layui-table td,.layui-table th{padding:9px 10px;} - + .layui-table-cell{padding:0 10px;} + .layui-table[lay-size=sm] td, .layui-table[lay-size=sm] th {padding: 5px;} + .layui-form-bar{padding:12px;border:1px solid #eee; border-bottom:none;} .auth-single .auth-icon{font-size:24px; float:left;} .auth-single .layui-form-radio,.auth-single .layui-form-checkbox{margin-left:0;} .auth-single .layui-form-radio{margin-top:0;} @@ -63,8 +66,11 @@ .layui-td-gray3{color:#999; width:120px; text-align:right; background-color:#f8f8f8;} .layui-td-gray4{color:#999; width:150px; text-align:right; background-color:#f8f8f8;} .layui-td-gray font,.layui-td-gray2 font,.layui-td-gray3 font{color:#FF6347; margin-left: 3px;} - .main-body{padding:10px;padding-bottom: 0;min-width: 800px;} - .body-content{padding:10px;background-color:#fff;box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);} + .main-body{padding:15px;padding-bottom: 0; min-width: 868px;} + .body-content{background-color:#fff; padding:10px 15px;} + .body-table{background-color:#fff; margin-bottom:15px} + .h3-title{font-size:18px; height:39px; font-weight:800} + .h3-title2{font-size:18px; height:39px; font-weight:800; padding-top:20px} .body-form-btn{padding:10px 0;} .span-color--1{color:#999999;} .span-color-0{color:#5FB878;} @@ -75,4 +81,945 @@ .span-color-5{color:#CCCC00;} .span-color-6{color:#FF33CC;} .span-color-7{color:#6699FF;} - .span-color-8{color:#CC9933;} \ No newline at end of file + .span-color-8{color:#CC9933;} +.layui-tab-title .layui-this:after {width:calc(100% - 35px );left:15px; min-width:65px;} + +@keyframes layui-rl{ + from{transform:translateX(0px);}to{transform:translateX(-100%);} +} +@-webkit-keyframes layui-rl{ + from{transform:translateX(0px);}to{transform:translateX(-100%);} +} +.layui-anim { + -webkit-animation-duration: .3s; + animation-duration: .3s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.layui-anim-rl { + -webkit-animation-name: layui-rl; + animation-name: layui-rl; +} +.layui-layer-admin-right { + box-shadow: 1px 1px 10px rgba(0,0,0,.1); + border-radius: 0!important; + overflow: auto; +} +.layui-anim-rl.layui-layer-iframe{ + overflow:inherit!important; +} +.right-popup-close{position: absolute;width:50px;height:44px;line-height:44px;text-align:center; left: -52px;right:0; top: 50px;background-color:#FF5722;color:#fff;border-radius:6px 0 0 6px; cursor:pointer; border:2px solid #fff;} +.page-content{background-color:#fff;} +.layui-form-select dl{ z-index: 1899; } + + +@font-face { + font-family: "iconfont"; /* Project id 2936988 */ + src: url('/static/layui/font/extend/iconfont.woff2?t=1636884517050') format('woff2'), + url('/static/layui/font/extend/iconfont.woff?t=1636884517050') format('woff'), + url('/static/layui/font/extend/iconfont.ttf?t=1636884517050') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-xueshengyidong:before { + content: "\e6e9"; +} + +.icon-baokao:before { + content: "\e6ea"; +} + +.icon-chengji:before { + content: "\e6eb"; +} + +.icon-yuejuan:before { + content: "\e6ec"; +} + +.icon-kaoheshezhi:before { + content: "\e6ed"; +} + +.icon-lunwenguanli:before { + content: "\e6ee"; +} + +.icon-shenbao:before { + content: "\e6ef"; +} + +.icon-kecheng:before { + content: "\e6f0"; +} + +.icon-tiku:before { + content: "\e6f1"; +} + +.icon-jiaowushezhi:before { + content: "\e6f2"; +} + +.icon-zidingyishezhi:before { + content: "\e6f3"; +} + +.icon-chaojitongji:before { + content: "\e6f4"; +} + +.icon-zhaoshengtongji:before { + content: "\e6f5"; +} + +.icon-tuiguangtongji:before { + content: "\e6f6"; +} + +.icon-xuexitongji:before { + content: "\e6f7"; +} + +.icon-diqushujutongji:before { + content: "\e6f8"; +} + +.icon-shujudaoru:before { + content: "\e6f9"; +} + +.icon-chengkaoguanli:before { + content: "\e6fb"; +} + +.icon-yuanchengguanli:before { + content: "\e6fe"; +} + +.icon-shujiguanli:before { + content: "\e6ff"; +} + +.icon-guochengxingkaohe:before { + content: "\e700"; +} + +.icon-xuefenrending:before { + content: "\e701"; +} + +.icon-kechengdingdan:before { + content: "\e702"; +} + +.icon-wentifankui:before { + content: "\e703"; +} + +.icon-zichan:before { + content: "\e704"; +} + +.icon-KPIguanli:before { + content: "\e705"; +} + +.icon-xiangmuguanli:before { + content: "\e706"; +} + +.icon-weixingongzhonghao:before { + content: "\e707"; +} + +.icon-anquanshezhi:before { + content: "\e708"; +} + +.icon-fuwuzhongxin:before { + content: "\e709"; +} + +.icon-qiyefuwu:before { + content: "\e70a"; +} + +.icon-wangkefuwu:before { + content: "\e70b"; +} + +.icon-shoufeiguanli:before { + content: "\e70c"; +} + +.icon-quanxianshezhi:before { + content: "\e70d"; +} + +.icon-jiaowutongji:before { + content: "\e70f"; +} + +.icon-jiaoxuetongji:before { + content: "\e710"; +} + +.icon-shoufeitongji:before { + content: "\e711"; +} + +.icon-fuwutongji:before { + content: "\e713"; +} + +.icon-tongzhitongji:before { + content: "\e714"; +} + +.icon-kaohetongji:before { + content: "\e715"; +} + +.icon-yonghuhuoyuedu:before { + content: "\e716"; +} + +.icon-xueshengbaoming:before { + content: "\e717"; +} + +.icon-xueshengluqu:before { + content: "\e718"; +} + +.icon-xueshengzhuce:before { + content: "\e719"; +} + +.icon-zaijixuesheng:before { + content: "\e71a"; +} + +.icon-huamingce:before { + content: "\e71b"; +} + +.icon-fenleiguanli:before { + content: "\e71c"; +} + +.icon-fuwuliebiao:before { + content: "\e71d"; +} + +.icon-fenleiliebiao:before { + content: "\e71e"; +} + +.icon-tongzhiliebiao:before { + content: "\e71f"; +} + +.icon-jiaoxuejihua:before { + content: "\e720"; +} + +.icon-jiaoxueanpai:before { + content: "\e721"; +} + +.icon-chengjiguanli:before { + content: "\e722"; +} + +.icon-tupianguanli:before { + content: "\e723"; +} + +.icon-kaoshijihua:before { + content: "\e724"; +} + +.icon-kaoshipeizhi:before { + content: "\e725"; +} + +.icon-xuexizhongxinguanli:before { + content: "\e726"; +} + +.icon-kaoheguanli:before { + content: "\e728"; +} + +.icon-jiaoshiguanli:before { + content: "\e729"; +} + +.icon-wangkeguanli:before { + content: "\e72a"; +} + +.icon-bulujiesuan:before { + content: "\e72b"; +} + +.icon-biyeguanli:before { + content: "\e72c"; +} + +.icon-kaohezhibiao:before { + content: "\e72d"; +} + +.icon-qiyeguanli:before { + content: "\e77e"; +} + +.icon-chubuguanli:before { + content: "\e77f"; +} + +.icon-hujiaobaobiao:before { + content: "\e780"; +} + +.icon-saomiaodianjing:before { + content: "\e781"; +} + +.icon-jiezhang:before { + content: "\e782"; +} + +.icon-xiaoshoubaobiao:before { + content: "\e783"; +} + +.icon-pingzheng:before { + content: "\e784"; +} + +.icon-hetongyidong:before { + content: "\e785"; +} + +.icon-xiaoshoupin:before { + content: "\e787"; +} + +.icon-xueshuguanli:before { + content: "\e788"; +} + +.icon-yihaopin:before { + content: "\e789"; +} + +.icon-renwuguanli:before { + content: "\e78a"; +} + +.icon-dianshang:before { + content: "\e78b"; +} + +.icon-mingpianbaobiao_1:before { + content: "\e78c"; +} + +.icon-gudingzichan:before { + content: "\e78d"; +} + +.icon-dongtaiguanli:before { + content: "\e78e"; +} + +.icon-jichupeizhi:before { + content: "\e78f"; +} + +.icon-hujiaotongji:before { + content: "\e790"; +} + +.icon-xiaoshoubaobiao_1:before { + content: "\e791"; +} + +.icon-dashuju:before { + content: "\e792"; +} + +.icon-huodongguanli:before { + content: "\e793"; +} + +.icon-hujiaoshezhi:before { + content: "\e794"; +} + +.icon-fenxiaoshichang:before { + content: "\e795"; +} + +.icon-chengjitongji:before { + content: "\e796"; +} + +.icon-tuiguangshezhi:before { + content: "\e797"; +} + +.icon-kechengzhongxin:before { + content: "\e798"; +} + +.icon-hetongshezhi:before { + content: "\e799"; +} + +.icon-kechengbaoguanli:before { + content: "\e79a"; +} + +.icon-yonghuguanli:before { + content: "\e79b"; +} + +.icon-yonghuhuaxiang:before { + content: "\e79c"; +} + +.icon-zhanghaoguanli:before { + content: "\e79d"; +} + +.icon-SEMguanli:before { + content: "\e79e"; +} + +.icon-yusuan:before { + content: "\e79f"; +} + +.icon-mingpianbaobiao:before { + content: "\e7a0"; +} + +.icon-dingdanguanli:before { + content: "\e7a1"; +} + +.icon-tuiguangguanli:before { + content: "\e7a2"; +} + +.icon-zhuantiguanli:before { + content: "\e7a3"; +} + +.icon-xinxiliu:before { + content: "\e7a4"; +} + +.icon-xiaoshoushezhi:before { + content: "\e7a5"; +} + +.icon-sucaiguanli:before { + content: "\e7a9"; +} + +.icon-xueshengdaoru:before { + content: "\e7aa"; +} + +.icon-shangpinguanli:before { + content: "\e7ab"; +} + +.icon-paikeguanli:before { + content: "\e7ac"; +} + +.icon-xinxidaoru:before { + content: "\e7ad"; +} + +.icon-shoufeipeizhi:before { + content: "\e7ae"; +} + +.icon-yonghuquanxian:before { + content: "\e7af"; +} + +.icon-zaijixueshengguanli:before { + content: "\e7b0"; +} + +.icon-xuehaoguanli:before { + content: "\e7b1"; +} + +.icon-kechengziyuanguanli:before { + content: "\e7b2"; +} + +.icon-mianshoujiaoxueanpai:before { + content: "\e7b3"; +} + +.icon-zhangfang:before { + content: "\e7b4"; +} + +.icon-kaikeguanli:before { + content: "\e7b5"; +} + +.icon-biyetongji:before { + content: "\e7b6"; +} + +.icon-zhaoshengzhunbei:before { + content: "\e7b8"; +} + +.icon-paikeshezhi:before { + content: "\e7b9"; +} + +.icon-banjiguanli:before { + content: "\e7ba"; +} + +.icon-jingpinketang:before { + content: "\e7bb"; +} + +.icon-yuangongtidian:before { + content: "\e7bc"; +} + +.icon-kaoshianpai:before { + content: "\e7bd"; +} + +.icon-wangluojiaoxueanpai:before { + content: "\e7bf"; +} + +.icon-ruxuechengji:before { + content: "\e7c3"; +} + +.icon-mianshoujiaoxue:before { + content: "\e7c6"; +} + +.icon-jiaoshijiaoshiguanli:before { + content: "\e7c7"; +} + +.icon-luquguanli:before { + content: "\e7c8"; +} + +.icon-luquchengji:before { + content: "\e7c9"; +} + +.icon-ziyuan:before { + content: "\e7ca"; +} + +.icon-kejian:before { + content: "\e7cc"; +} + +.icon-waibukejian:before { + content: "\e7cd"; +} + +.icon-rizhiguanli:before { + content: "\e7ce"; +} + +.icon-mobanguanli:before { + content: "\e7cf"; +} + +.icon-xuelirenzheng:before { + content: "\e7d1"; +} + +.icon-yiyichuli:before { + content: "\e7d2"; +} + +.icon-lunwenshenbao:before { + content: "\e7d3"; +} + +.icon-lunwenshezhi:before { + content: "\e7d4"; +} + +.icon-jiaoxuedianshezhi:before { + content: "\e7d5"; +} + +.icon-buluchenjiang:before { + content: "\e7d6"; +} + +.icon-mokuaishezhi:before { + content: "\e7d7"; +} + +.icon-ziliaoguanli:before { + content: "\e7d8"; +} + +.icon-jituanguanli:before { + content: "\e7d9"; +} + +.icon-yingyongguanli:before { + content: "\e7da"; +} + +.icon-guanwangshijuan:before { + content: "\e7db"; +} + +.icon-wodewangke:before { + content: "\e7dc"; +} + +.icon-jiaobenguanli:before { + content: "\e7dd"; +} + +.icon-zhuanyeguanliyuan:before { + content: "\e7de"; +} + +.icon-xueshengchengji:before { + content: "\e7df"; +} + +.icon-fuwuguanli:before { + content: "\e7e2"; +} + +.icon-daijinquan:before { + content: "\e7e3"; +} + +.icon-hujiaozhongxin:before { + content: "\e7e4"; +} + +.icon-yinjinshoufei:before { + content: "\e7e5"; +} + +.icon-yingjiaoqingdan:before { + content: "\e7e6"; +} + +.icon-duizhangdan:before { + content: "\e7e7"; +} + +.icon-shangjiguanli:before { + content: "\e7e8"; +} + +.icon-qiyehuihuacundang:before { + content: "\e7e9"; +} + +.icon-yonghushezhi:before { + content: "\e7ea"; +} + +.icon-xiaoxishezhi:before { + content: "\e7ec"; +} + +.icon-yingxiaoshezhi:before { + content: "\e7ed"; +} + +.icon-fuwushichang:before { + content: "\e7ee"; +} + +.icon-sucaiziyuan:before { + content: "\e7ef"; +} + +.icon-yingxiaowanfa:before { + content: "\e7f0"; +} + +.icon-tuiguang:before { + content: "\e7f1"; +} + +.icon-yonghuliebiao:before { + content: "\e7f2"; +} + +.icon-ziyuanguanli:before { + content: "\e692"; +} + +.icon-kechengguanli:before { + content: "\e693"; +} + +.icon-kechengbao:before { + content: "\e694"; +} + +.icon-tikuguanli:before { + content: "\e695"; +} + +.icon-wangkeshichang:before { + content: "\e696"; +} + +.icon-gongdan:before { + content: "\e697"; +} + +.icon-fangkeguanli:before { + content: "\e698"; +} + +.icon-xiansuoguanli:before { + content: "\e699"; +} + +.icon-kehuguanli:before { + content: "\e69a"; +} + +.icon-jituankehu:before { + content: "\e69b"; +} + +.icon-genjinjilu:before { + content: "\e69c"; +} + +.icon-hujiaoguanli:before { + content: "\e69d"; +} + +.icon-gongzuotai:before { + content: "\e69e"; +} + +.icon-shujubaobiao:before { + content: "\e69f"; +} + +.icon-fangkebaobiao:before { + content: "\e6a0"; +} + +.icon-zhangbuguanli:before { + content: "\e6a1"; +} + +.icon-zhangbuguanli_zi:before { + content: "\e6a2"; +} + +.icon-zhangbuguanli_zixitong_A:before { + content: "\e6a3"; +} + +.icon-hetongguanli:before { + content: "\e6a4"; +} + +.icon-yunyingzheguanli:before { + content: "\e6a5"; +} + +.icon-zhaopinguanli:before { + content: "\e6a6"; +} + +.icon-gongziguanli:before { + content: "\e6a7"; +} + +.icon-wodeshenpi:before { + content: "\e6a8"; +} + +.icon-biaozhunmobanshezhi:before { + content: "\e6a9"; +} + +.icon-jichushezhi:before { + content: "\e6aa"; +} + +.icon-caiwushezhi:before { + content: "\e6ab"; +} + +.icon-chanpinshezhi:before { + content: "\e6ac"; +} + +.icon-shenpishezhi:before { + content: "\e6ad"; +} + +.icon-mubiaoguanli:before { + content: "\e6ae"; +} + +.icon-zhandianshezhi:before { + content: "\e6af"; +} + +.icon-renshishezhi:before { + content: "\e6b0"; +} + +.icon-CRMshezhi:before { + content: "\e6b1"; +} + +.icon-mingpianshezhi:before { + content: "\e6b2"; +} + +.icon-wangxiaoshezhi:before { + content: "\e6b3"; +} + +.icon-wodedianping:before { + content: "\e6b4"; +} + +.icon-wodexuesheng:before { + content: "\e6b5"; +} + +.icon-lianxijilu:before { + content: "\e6b8"; +} + +.icon-tousutiwen:before { + content: "\e6b9"; +} + +.icon-peixunjihua:before { + content: "\e6ba"; +} + +.icon-feiyongchaxun:before { + content: "\e6bb"; +} + +.icon-xueshengjiaofei:before { + content: "\e6bc"; +} + +.icon-jizhang:before { + content: "\e6bd"; +} + +.icon-chaxun:before { + content: "\e6be"; +} + +.icon-chazhang:before { + content: "\e6bf"; +} + +.icon-baobiao:before { + content: "\e6c0"; +} + +.icon-shezhi:before { + content: "\e6c2"; +} + +.icon-daqiajilu:before { + content: "\e6ce"; +} + +.icon-wangluobanji:before { + content: "\e6d3"; +} + +.icon-wangxiaoshezhi1:before { + content: "\e6d6"; +} + +.icon-houtaishezhi:before { + content: "\e6d8"; +} + +.icon-zhaoshengshezhi:before { + content: "\e6db"; +} + +.icon-xiaoxizhongxin:before { + content: "\e6df"; +} + +.icon-zhaoshengbaobiao:before { + content: "\e6e1"; +} + +.icon-caidanguanli:before { + content: "\e6e2"; +} + +.icon-jituanshezhi:before { + content: "\e6e3"; +} + +.icon-shichangguanli:before { + content: "\e6e4"; +} + +.icon-chuangjianxitong:before { + content: "\e6e5"; +} + +.icon-gongdanguanli:before { + content: "\e6e6"; +} + +.icon-duanxin:before { + content: "\e6e7"; +} + +.icon-bangzhuzhongxin:before { + content: "\e6e8"; +} \ No newline at end of file diff --git a/public/static/admin/css/gougucms.css b/public/static/admin/css/gougucms.css index b8cfab3..ef46e31 100644 --- a/public/static/admin/css/gougucms.css +++ b/public/static/admin/css/gougucms.css @@ -1,55 +1,67 @@ -.main-body{padding:0;} -.ittab-bg-gray {background-color:#1c2b36;} -.layui-layout-admin .layui-header {height:50px;background-color:#fff;} -.layui-layout-admin .layui-logo {line-height:50px;cursor:pointer;font-size:16px;color:#fff;background:#1C2B36;width:200px;} +.main-body{padding:0;min-width: 1220px; +-moz-user-select: none; /*火狐*/ +-webkit-user-select: none; /*webkit浏览器*/ +-ms-user-select: none; /*IE10*/ +-khtml-user-select: none; /*早期浏览器*/ +user-select: none;} +.layui-layout-admin .layui-header {height:49px;background-color:#fff;box-shadow: 0 2px 6px 0 rgb(5 32 96 / 10%);} +.layui-layout-admin .layui-logo {line-height:49px;cursor:pointer;font-size:16px;color:#fff;background:#001529;width:200px;border-bottom: 1px solid #001529;} .layui-layout-admin .layui-side {top:50px;width:200px;border-right:1px solid #ddd;} -.layui-nav .layui-nav-item {line-height:45px;} -.layui-nav.layui-layout-left {color:#333;margin-left:10px;} -.layui-nav.layui-layout-left input {border:0;} -.layui-layout-admin .layui-body {top:50px;padding:0px;padding-right:0px;padding-bottom:0px;bottom:0px;left:200px;z-index:1017;overflow:visible;right:0;background-color:#eff0f4;} +.layui-header .layui-nav-item {line-height:49px; height:49px; border-left: 1px solid #eee;position: relative;display: inline-block; *display: inline; *zoom: 1; vertical-align: middle;} +.layui-header .layui-nav-item a{padding: 0 12px; text-align: center; min-width: 24px;} +.layui-header.layui-layout-left {color:#333;margin-left:10px;} +.layui-header.layui-layout-left input {border:0;} +.layui-header .layui-nav-bar {display:none;} +.layui-layout-right{padding: 0 3px; background-color:#fff;} +.layui-header .layui-nav-item #ittab-refresh {color:#000;} +.layui-header .layui-nav-item #ittab-refresh i {font-size:16px;} +.layui-header .layui-nav-item #ittab-del-cache{color:#000} +.layui-header .layui-nav-item #ittab-del-cache i{font-size:16px} +.layui-header.layui-layout-right .layui-nav-bar {background-color: #fff;} +.layui-tab-brief>.layui-tab-more li.layui-this:after {border-bottom: 0;} +.layui-nav-img {width:25px;height:25px;margin-right:0;} +.layui-header .msg-num { min-width: 18px;height: 18px;position: absolute;top: -10px;right: 5px;display: none;} +.layui-header .msg-num a {min-width: 18px; height: 18px; margin: 0; padding: 0; display: inline-block; font-size: 11px;line-height: 18px;text-align: center; background-color: #FF5722; color: #fff;border-radius: 12px; cursor: pointer;} -.ittab-menulist {width:100%;height:100%; border-right:1px solid #ccc; font-size:14px; color:#8dacc4;} -.ittab-menulist-top {padding: 10px 12px; font-size:0; border-bottom: 1px solid #17232c; text-align:center;} -.ittab-menulist-top a {background-color:#34a853; opacity:1; width: 25%; margin:0; padding: 5px 0; display:inline-block;} -.ittab-menulist-top .layui-icon {color:#fff;font-size:16px;} -.ittab-menulist-top a:first-child {border-radius: 3px 0 0 3px;} -.ittab-menulist-top a:last-child {border-radius: 0 3px 3px 0;} -.ittab-menulist-top a:hover{opacity: .9;} +.layui-layout-admin .layui-body {top:50px; z-index:1008; padding:0;padding-right:0;padding-bottom:0;bottom:0;left:200px;overflow:visible;right:0;background-color:#F5F8FA;} -.ittab-menulist-1 li{height:44px; line-height:44px; cursor:pointer; list-style:none;} -.ittab-menulist-2 {height:48px;line-height:48px;position:relative;padding-left:12px; cursor: pointer;} -.ittab-menulist-1 li:hover,.ittab-menulist-2:hover {background-color: rgba(255,255,255,.1)} -.ittab-menulist-1 .iconfont{font-size: 16px;} -.ittab-menulist-1 .site-menu-active span{padding-left:29px; border-left: 3px solid#131E25; width: 168px; display: inline-block;} -.ittab-menulist-1 li:hover span{border-color: rgba(255,255,255,.1)} -.ittab-menulist-1 li.layui-this span{border-color:#E94335 !important; color:#fff !important; background-color: rgba(255,255,255,.1);} -.ittab-menulist-1 li .layui-icon-triangle-r{float:right; margin-right:16px;} -.ittab-menulist-1 li .layui-icon-triangle-d{float:right; margin-right:16px;} +.menulist-bg-gray{background-color:#001529;} +.menulist {width:100%;height:100%; border-right:1px solid #ccc; font-size:14px; color:#aaaaaa;} -.ittab-menulist-3 {display:none;cursor:pointer;font-size:13px;} -.ittab-menulist-3 li {background-color: #131E25;} -.tab-menulist-4 li {padding-left:45px; background-color: #131E25;} -.tab-menulist-5 li {padding-left:62px; background-color: #131E25;} +.menulist-top {padding: 10px 12px; font-size:0; border-bottom: 1px solid #17232c; text-align:center;} +.menulist-top a {background-color:#34a853; opacity:1; width: 25%; margin:0; padding: 5px 0; display:inline-block;} +.menulist-top .layui-icon {color:#fff;font-size:16px;} +.menulist-top a:first-child {border-radius: 3px 0 0 3px;} +.menulist-top a:last-child {border-radius: 0 3px 3px 0;} +.menulist-top a:hover{opacity: .9;} +.menulist .layui-nav{background-color:#001529;} +.menulist .layui-nav-tree .layui-nav-bar{width:4px;background-color:#E94335} +.layui-nav-tree .layui-nav-child{padding:0;} +.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover{background-color:#131E25} +.layui-nav .layui-nav-item a{padding-left:12px;} +.layui-nav .layui-nav-item a.menu-b{padding-left:32px;} +.layui-nav .layui-nav-item a.menu-c{padding-left:45px;} +.layui-nav .layui-nav-item a.menu-d{padding-left:58px;} .gougu-admin-tab {margin:0;} -.gougu-admin-tab .layui-icon-prev {position:absolute;top:-50px; left:0; width:39px; height:50px; line-height:50px; color: #999; text-align:center; cursor:pointer; background-color:#fff;border-right: 1px solid #f1f2f7;} -.gougu-admin-tab .layui-icon-prev:hover{color: #333;} -.gougu-admin-tab .layui-icon-next {position:absolute;top:-50px; right:152px; width:39px; height:50px; line-height:50px; color: #999; text-align:center; cursor:pointer; background-color:#fff;border-left: 1px solid #f1f2f7;} -.gougu-admin-tab .layui-icon-next:hover{color: #333;} -.gougu-admin-tab .layui-tab-title {position:absolute;top:-50px;height:50px;left:36px; border:0;max-width:calc(100% - 226px); overflow:hidden;} +.gougu-admin-tab .layui-icon-prev,.gougu-admin-tab .layui-icon-next {position:absolute;top:-50px; width:39px; height:49px; line-height:49px; color: #999; text-align:center; cursor:pointer; background-color:#fff;} +.gougu-admin-tab .layui-icon-prev{left:0; border-right: 1px solid #eee;} +.gougu-admin-tab .layui-icon-next {right:152px; border-left: 1px solid #eee;} +.gougu-admin-tab .layui-icon-prev:hover,.gougu-admin-tab .layui-icon-next:hover{color: #333;} -.gougu-admin-tab .layui-tab-title li {min-width:36px; padding:0 24px 0 12px; color:#666;font-size:12px;line-height:48px;border-top:3px solid #fff; border-right: 1px solid #f1f2f7; background-color:#fff;} +.gougu-admin-tab .layui-tab-title {position:absolute;top:-50px; z-index:58; height:49px;left:40px; border:0;max-width:calc(100% - 226px); overflow:hidden;} +.gougu-admin-tab .layui-tab-title li {min-width:36px; padding:0 24px 0 12px; color:#666;font-size:12px;line-height:48px;border-top:3px solid #fff; border-right: 1px solid #F5F8FA; background-color:#fff;} .gougu-admin-tab .layui-tab-title li .gougu-tab-active {display: inline-block; background-color: #999; width: 8px; height: 8px; border-radius: 20px; margin-right: 6px;} .gougu-admin-tab .layui-tab-title li .layui-tab-close {position:absolute;width:15px;height:15px;line-height:16px;top:16px;right:5px;font-size:10px;display:none;border-radius:50%;} -.gougu-admin-tab .layui-tab-title li:hover {color:#333;background-color:#f1f2f7;border-top:3px solid #333;} +.gougu-admin-tab .layui-tab-title li:hover {color:#333;background-color:#F5F8FA;border-top:3px solid #333;} .gougu-admin-tab .layui-tab-title li:hover .gougu-tab-active {background-color:#333} .gougu-admin-tab .layui-tab-title li:hover .layui-tab-close {display:inline-block;} .gougu-admin-tab .layui-tab-title li .layui-tab-close:hover {background-color:#E94335;color:#fff;} -.gougu-admin-tab .layui-tab-title li.layui-this {color:#333;background-color:#f1f2f7;border-top:3px solid #E94335;} +.gougu-admin-tab .layui-tab-title li.layui-this {color:#333;background-color:#F5F8FA;border-top:3px solid #E94335;} .gougu-admin-tab .layui-tab-title li.layui-this .gougu-tab-active{background-color:#E94335;} .gougu-admin-tab .layui-tab-title li.layui-this .layui-tab-close{display:inline-block;} @@ -59,16 +71,7 @@ .gougu-admin-tab .layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after {border:0;} .gougu-admin-tab .layui-tab-item {height:100%;} -.gougu-admin-tab .layui-tab-bar { height: 50px;border-width: 0;line-height: 50px;} +.gougu-admin-tab .layui-tab-bar {height: 50px;border-width: 0;line-height: 50px;} -.layui-layout-right{padding: 0 3px; background-color:#fff;} -.layui-nav .layui-nav-item a{padding: 0 12px; text-align: center; min-width: 24px; border-left: 1px solid #eee;} -.layui-nav .layui-nav-item #ittab-refresh {color:#000;} -.layui-nav .layui-nav-item #ittab-refresh i {font-size:16px;} -.layui-nav .layui-nav-item #ittab-del-cache{color:#000} -.layui-nav .layui-nav-item #ittab-del-cache i{font-size:16px} -.layui-nav.layui-layout-right .layui-nav-bar {background-color: #fff;} -.layui-tab-brief>.layui-tab-more li.layui-this:after {border-bottom: 0;} -.layui-nav-img {width:25px;height:25px;margin-right:0;} .layui-layout-admin .layui-footer {left:200px;height:30px;line-height:30px;background-color:#f0f0f0;font-size:12px;} .layui-tab-content {padding:0px;} \ No newline at end of file diff --git a/public/static/layui/css/layui.css b/public/static/layui/css/layui.css index c784a25..3f4b442 100644 --- a/public/static/layui/css/layui.css +++ b/public/static/layui/css/layui.css @@ -1 +1 @@ -.layui-inline,img{display:inline-block;vertical-align:middle}h1,h2,h3,h4,h5,h6{font-weight:400}a,body{color:#333}.layui-edge,.layui-header,.layui-inline,.layui-main{position:relative}.layui-edge,hr{height:0;overflow:hidden}.layui-layout-body,.layui-side,.layui-side-scroll{overflow-x:hidden}.layui-edge,.layui-elip,hr{overflow:hidden}.layui-btn,.layui-edge,.layui-inline,img{vertical-align:middle}.layui-btn,.layui-disabled,.layui-icon,.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{border:none}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h4,h5,h6{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}body{line-height:1.6;color:rgba(0,0,0,.85);font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{line-height:0;margin:10px 0;padding:0;border:none!important;border-bottom:1px solid #eee!important;clear:both;background:0 0}a{text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-inline{*display:inline;*zoom:1}.layui-btn,.layui-btn-group,.layui-edge{display:inline-block}.layui-edge{width:0;border-width:6px;border-style:dashed;border-color:transparent}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-elip{text-overflow:ellipsis;white-space:nowrap}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-show-v{visibility:visible!important}.layui-hide-v{visibility:hidden!important}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=256);src:url(../font/iconfont.eot?v=256#iefix) format('embedded-opentype'),url(../font/iconfont.woff2?v=256) format('woff2'),url(../font/iconfont.woff?v=256) format('woff'),url(../font/iconfont.ttf?v=256) format('truetype'),url(../font/iconfont.svg?v=256#layui-icon) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-icon-reply-fill:before{content:"\e611"}.layui-icon-set-fill:before{content:"\e614"}.layui-icon-menu-fill:before{content:"\e60f"}.layui-icon-search:before{content:"\e615"}.layui-icon-share:before{content:"\e641"}.layui-icon-set-sm:before{content:"\e620"}.layui-icon-engine:before{content:"\e628"}.layui-icon-close:before{content:"\1006"}.layui-icon-close-fill:before{content:"\1007"}.layui-icon-chart-screen:before{content:"\e629"}.layui-icon-star:before{content:"\e600"}.layui-icon-circle-dot:before{content:"\e617"}.layui-icon-chat:before{content:"\e606"}.layui-icon-release:before{content:"\e609"}.layui-icon-list:before{content:"\e60a"}.layui-icon-chart:before{content:"\e62c"}.layui-icon-ok-circle:before{content:"\1005"}.layui-icon-layim-theme:before{content:"\e61b"}.layui-icon-table:before{content:"\e62d"}.layui-icon-right:before{content:"\e602"}.layui-icon-left:before{content:"\e603"}.layui-icon-cart-simple:before{content:"\e698"}.layui-icon-face-cry:before{content:"\e69c"}.layui-icon-face-smile:before{content:"\e6af"}.layui-icon-survey:before{content:"\e6b2"}.layui-icon-tree:before{content:"\e62e"}.layui-icon-ie:before{content:"\e7bb"}.layui-icon-upload-circle:before{content:"\e62f"}.layui-icon-add-circle:before{content:"\e61f"}.layui-icon-download-circle:before{content:"\e601"}.layui-icon-templeate-1:before{content:"\e630"}.layui-icon-util:before{content:"\e631"}.layui-icon-face-surprised:before{content:"\e664"}.layui-icon-edit:before{content:"\e642"}.layui-icon-speaker:before{content:"\e645"}.layui-icon-down:before{content:"\e61a"}.layui-icon-file:before{content:"\e621"}.layui-icon-layouts:before{content:"\e632"}.layui-icon-rate-half:before{content:"\e6c9"}.layui-icon-add-circle-fine:before{content:"\e608"}.layui-icon-prev-circle:before{content:"\e633"}.layui-icon-read:before{content:"\e705"}.layui-icon-404:before{content:"\e61c"}.layui-icon-carousel:before{content:"\e634"}.layui-icon-help:before{content:"\e607"}.layui-icon-code-circle:before{content:"\e635"}.layui-icon-windows:before{content:"\e67f"}.layui-icon-water:before{content:"\e636"}.layui-icon-username:before{content:"\e66f"}.layui-icon-find-fill:before{content:"\e670"}.layui-icon-about:before{content:"\e60b"}.layui-icon-location:before{content:"\e715"}.layui-icon-up:before{content:"\e619"}.layui-icon-pause:before{content:"\e651"}.layui-icon-date:before{content:"\e637"}.layui-icon-layim-uploadfile:before{content:"\e61d"}.layui-icon-delete:before{content:"\e640"}.layui-icon-play:before{content:"\e652"}.layui-icon-top:before{content:"\e604"}.layui-icon-firefox:before{content:"\e686"}.layui-icon-friends:before{content:"\e612"}.layui-icon-refresh-3:before{content:"\e9aa"}.layui-icon-ok:before{content:"\e605"}.layui-icon-layer:before{content:"\e638"}.layui-icon-face-smile-fine:before{content:"\e60c"}.layui-icon-dollar:before{content:"\e659"}.layui-icon-group:before{content:"\e613"}.layui-icon-layim-download:before{content:"\e61e"}.layui-icon-picture-fine:before{content:"\e60d"}.layui-icon-link:before{content:"\e64c"}.layui-icon-diamond:before{content:"\e735"}.layui-icon-log:before{content:"\e60e"}.layui-icon-key:before{content:"\e683"}.layui-icon-rate-solid:before{content:"\e67a"}.layui-icon-fonts-del:before{content:"\e64f"}.layui-icon-unlink:before{content:"\e64d"}.layui-icon-fonts-clear:before{content:"\e639"}.layui-icon-triangle-r:before{content:"\e623"}.layui-icon-circle:before{content:"\e63f"}.layui-icon-radio:before{content:"\e643"}.layui-icon-align-center:before{content:"\e647"}.layui-icon-align-right:before{content:"\e648"}.layui-icon-align-left:before{content:"\e649"}.layui-icon-loading-1:before{content:"\e63e"}.layui-icon-return:before{content:"\e65c"}.layui-icon-fonts-strong:before{content:"\e62b"}.layui-icon-upload:before{content:"\e67c"}.layui-icon-dialogue:before{content:"\e63a"}.layui-icon-video:before{content:"\e6ed"}.layui-icon-headset:before{content:"\e6fc"}.layui-icon-cellphone-fine:before{content:"\e63b"}.layui-icon-add-1:before{content:"\e654"}.layui-icon-face-smile-b:before{content:"\e650"}.layui-icon-fonts-html:before{content:"\e64b"}.layui-icon-screen-full:before{content:"\e622"}.layui-icon-form:before{content:"\e63c"}.layui-icon-cart:before{content:"\e657"}.layui-icon-camera-fill:before{content:"\e65d"}.layui-icon-tabs:before{content:"\e62a"}.layui-icon-heart-fill:before{content:"\e68f"}.layui-icon-fonts-code:before{content:"\e64e"}.layui-icon-ios:before{content:"\e680"}.layui-icon-at:before{content:"\e687"}.layui-icon-fire:before{content:"\e756"}.layui-icon-set:before{content:"\e716"}.layui-icon-fonts-u:before{content:"\e646"}.layui-icon-triangle-d:before{content:"\e625"}.layui-icon-tips:before{content:"\e702"}.layui-icon-picture:before{content:"\e64a"}.layui-icon-more-vertical:before{content:"\e671"}.layui-icon-bluetooth:before{content:"\e689"}.layui-icon-flag:before{content:"\e66c"}.layui-icon-loading:before{content:"\e63d"}.layui-icon-fonts-i:before{content:"\e644"}.layui-icon-refresh-1:before{content:"\e666"}.layui-icon-rmb:before{content:"\e65e"}.layui-icon-addition:before{content:"\e624"}.layui-icon-home:before{content:"\e68e"}.layui-icon-time:before{content:"\e68d"}.layui-icon-user:before{content:"\e770"}.layui-icon-notice:before{content:"\e667"}.layui-icon-chrome:before{content:"\e68a"}.layui-icon-edge:before{content:"\e68b"}.layui-icon-login-weibo:before{content:"\e675"}.layui-icon-voice:before{content:"\e688"}.layui-icon-upload-drag:before{content:"\e681"}.layui-icon-login-qq:before{content:"\e676"}.layui-icon-snowflake:before{content:"\e6b1"}.layui-icon-heart:before{content:"\e68c"}.layui-icon-logout:before{content:"\e682"}.layui-icon-file-b:before{content:"\e655"}.layui-icon-template:before{content:"\e663"}.layui-icon-transfer:before{content:"\e691"}.layui-icon-auz:before{content:"\e672"}.layui-icon-console:before{content:"\e665"}.layui-icon-app:before{content:"\e653"}.layui-icon-prev:before{content:"\e65a"}.layui-icon-website:before{content:"\e7ae"}.layui-icon-next:before{content:"\e65b"}.layui-icon-component:before{content:"\e857"}.layui-icon-android:before{content:"\e684"}.layui-icon-more:before{content:"\e65f"}.layui-icon-login-wechat:before{content:"\e677"}.layui-icon-shrink-right:before{content:"\e668"}.layui-icon-spread-left:before{content:"\e66b"}.layui-icon-camera:before{content:"\e660"}.layui-icon-note:before{content:"\e66e"}.layui-icon-refresh:before{content:"\e669"}.layui-icon-female:before{content:"\e661"}.layui-icon-male:before{content:"\e662"}.layui-icon-screen-restore:before{content:"\e758"}.layui-icon-password:before{content:"\e673"}.layui-icon-senior:before{content:"\e674"}.layui-icon-theme:before{content:"\e66a"}.layui-icon-tread:before{content:"\e6c5"}.layui-icon-praise:before{content:"\e6c6"}.layui-icon-star-fill:before{content:"\e658"}.layui-icon-rate:before{content:"\e67b"}.layui-icon-template-1:before{content:"\e656"}.layui-icon-vercode:before{content:"\e679"}.layui-icon-service:before{content:"\e626"}.layui-icon-cellphone:before{content:"\e678"}.layui-icon-print:before{content:"\e66d"}.layui-icon-cols:before{content:"\e610"}.layui-icon-wifi:before{content:"\e7e0"}.layui-icon-export:before{content:"\e67d"}.layui-icon-rss:before{content:"\e808"}.layui-icon-slider:before{content:"\e714"}.layui-icon-email:before{content:"\e618"}.layui-icon-subtraction:before{content:"\e67e"}.layui-icon-mike:before{content:"\e6dc"}.layui-icon-light:before{content:"\e748"}.layui-icon-gift:before{content:"\e627"}.layui-icon-mute:before{content:"\e685"}.layui-icon-reduce-circle:before{content:"\e616"}.layui-icon-music:before{content:"\e690"}.layui-main{width:1140px;margin:0 auto}.layui-header{z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;left:0;top:0;bottom:0;z-index:999;width:200px}.layui-side-scroll{position:relative;width:220px;height:100%}.layui-body{position:relative;left:200px;right:0;top:0;bottom:0;z-index:900;width:auto;box-sizing:border-box}.layui-layout-admin .layui-header{position:fixed;top:0;left:0;right:0;background-color:#23262E}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{position:absolute;top:60px;padding-bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;z-index:990;height:44px;line-height:44px;padding:0 15px;box-shadow:-1px 0 4px rgb(0 0 0 / 12%);background-color:#FAFAFA}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#009688;font-size:16px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 15%)}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;padding:0 15px;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:"";display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:768px){.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:750px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:970px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1170px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space2{margin:-1px}.layui-col-space2>*{padding:1px}.layui-col-space4{margin:-2px}.layui-col-space4>*{padding:2px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space6{margin:-3px}.layui-col-space6>*{padding:3px}.layui-col-space8{margin:-4px}.layui-col-space8>*{padding:4px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space14{margin:-7px}.layui-col-space14>*{padding:7px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space16{margin:-8px}.layui-col-space16>*{padding:8px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space24{margin:-12px}.layui-col-space24>*{padding:12px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space26{margin:-13px}.layui-col-space26>*{padding:13px}.layui-col-space28{margin:-14px}.layui-col-space28>*{padding:14px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:1.6;border-left:5px solid #5FB878;border-radius:0 2px 2px 0;background-color:#FAFAFA}.layui-quote-nm{border-style:solid;border-width:1px 1px 1px 5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border-width:1px;border-style:solid}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border-width:1px 0 0}.layui-field-box{padding:15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#eee}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#5FB878;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#666}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#FAFAFA;cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{display:none;padding:10px 15px;line-height:1.6;color:#666}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-card-body,.layui-card-header,.layui-form-label,.layui-form-mid,.layui-form-select,.layui-input-block,.layui-input-inline,.layui-panel,.layui-textarea{position:relative}.layui-card{margin-bottom:15px;border-radius:2px;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.layui-form-select dl,.layui-panel{box-shadow:1px 1px 4px rgb(0 0 0 / 8%)}.layui-card:last-child{margin-bottom:0}.layui-card-header{height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;color:#333;border-radius:2px 2px 0 0;font-size:14px}.layui-card-body{padding:10px 15px;line-height:24px}.layui-card-body[pad15]{padding:15px}.layui-card-body[pad20]{padding:20px}.layui-card-body .layui-table{margin:5px 0}.layui-card .layui-tab{margin:0}.layui-panel{border-width:1px;border-style:solid;border-radius:2px;background-color:#fff;color:#666}.layui-bg-black,.layui-bg-blue,.layui-bg-cyan,.layui-bg-green,.layui-bg-orange,.layui-bg-red{color:#fff!important}.layui-panel-window{position:relative;padding:15px;border-radius:0;border-top:5px solid #eee;background-color:#fff}.layui-border,.layui-border-black,.layui-border-blue,.layui-border-cyan,.layui-border-green,.layui-border-orange,.layui-border-red{border-width:1px;border-style:solid}.layui-auxiliar-moving{position:fixed;left:0;right:0;top:0;bottom:0;width:100%;height:100%;background:0 0;z-index:9999999999}.layui-bg-red{background-color:#FF5722!important}.layui-bg-orange{background-color:#FFB800!important}.layui-bg-green{background-color:#009688!important}.layui-bg-cyan{background-color:#2F4056!important}.layui-bg-blue{background-color:#1E9FFF!important}.layui-bg-black{background-color:#393D49!important}.layui-bg-gray{background-color:#FAFAFA!important;color:#666!important}.layui-badge-rim,.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-input,.layui-layedit,.layui-layedit-tool,.layui-panel,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea{border-color:#eee}.layui-border{color:#666!important}.layui-border-red{border-color:#FF5722!important;color:#FF5722!important}.layui-border-orange{border-color:#FFB800!important;color:#FFB800!important}.layui-border-green{border-color:#009688!important;color:#009688!important}.layui-border-cyan{border-color:#2F4056!important;color:#2F4056!important}.layui-border-blue{border-color:#1E9FFF!important;color:#1E9FFF!important}.layui-border-black{border-color:#393D49!important;color:#393D49!important}.layui-timeline-item:before{background-color:#eee}.layui-text{line-height:1.6;font-size:14px;color:#666}.layui-text h1,.layui-text h2,.layui-text h3{font-weight:500;color:#333}.layui-text h1{font-size:30px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text a:not(.layui-btn){color:#01AAED}.layui-text a:not(.layui-btn):hover{text-decoration:underline}.layui-text ul{padding:5px 0 5px 15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text em,.layui-word-aux{color:#999!important;padding-left:5px!important;padding-right:5px!important}.layui-text p{margin:10px 0}.layui-text p:first-child{margin-top:0}.layui-font-12{font-size:12px!important}.layui-font-14{font-size:14px!important}.layui-font-16{font-size:16px!important}.layui-font-18{font-size:18px!important}.layui-font-20{font-size:20px!important}.layui-font-red{color:#FF5722!important}.layui-font-orange{color:#FFB800!important}.layui-font-green{color:#009688!important}.layui-font-cyan{color:#2F4056!important}.layui-font-blue{color:#01AAED!important}.layui-font-black{color:#000!important}.layui-font-gray{color:#c2c2c2!important}.layui-btn{height:38px;line-height:38px;border:1px solid transparent;padding:0 18px;background-color:#009688;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border-radius:2px;cursor:pointer}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-container{font-size:0}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}.layui-table .layui-btn-container .layui-btn{margin-bottom:9px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\9;vertical-align:bottom}.layui-btn-primary{border-color:#d2d2d2;background:0 0;color:#666}.layui-btn-primary:hover{border-color:#009688;color:#333}.layui-btn-normal{background-color:#1E9FFF}.layui-btn-warm{background-color:#FFB800}.layui-btn-danger{background-color:#FF5722}.layui-btn-checked{background-color:#5FB878}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#FBFBFB!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-group{vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#d2d2d2;color:#009688}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #d2d2d2}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-btn-fluid{width:100%}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:1.3;line-height:38px\9;border-width:1px;border-style:solid;background-color:#fff;color:rgba(0,0,0,.85);border-radius:2px}.layui-input::-webkit-input-placeholder,.layui-select::-webkit-input-placeholder,.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#eee!important}.layui-input:focus,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea{min-height:100px;height:auto;line-height:20px;padding:6px 10px;resize:vertical}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form [lay-ignore]{display:initial}.layui-form-item{margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{float:left;display:block;padding:9px 15px;width:80px;font-weight:400;line-height:20px;text-align:right}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#FF5722!important}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #eee;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#F6F6F6;-webkit-transition:.5s all;transition:.5s all}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#5FB878;color:#fff}.layui-form-checkbox,.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-checkbox,.layui-form-checkbox *,.layui-form-switch{display:inline-block;vertical-align:middle}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg);margin-top:-3px\9}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layui-form-checkbox:hover span{background-color:#c2c2c2}.layui-form-checkbox i{position:absolute;right:0;top:0;width:30px;height:28px;border:1px solid #d2d2d2;border-left:none;border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:#c2c2c2;color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#5FB878}.layui-form-checked span,.layui-form-checked:hover span{background-color:#5FB878}.layui-form-checked i,.layui-form-checked:hover i{color:#5FB878}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:#5FB878;color:#fff}.layui-form-checked[lay-skin=primary] i{border-color:#5FB878!important;background-color:#5FB878;color:#fff}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:#c2c2c2!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-switch{position:relative;height:22px;line-height:22px;min-width:35px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch em{position:relative;top:0;width:25px;margin-left:21px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#5FB878;background-color:#5FB878}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:#eee!important}.layui-form-onswitch i{left:100%;margin-left:-21px;background-color:#fff}.layui-form-onswitch em{margin-left:5px;margin-right:21px;color:#fff!important}.layui-checkbox-disabled span{background-color:#eee!important}.layui-checkbox-disabled em{color:#d2d2d2!important}.layui-checkbox-disabled:hover i{color:#fff!important}[lay-radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:#5FB878}.layui-radio-disabled>i{color:#eee!important}.layui-radio-disabled *{color:#c2c2c2!important}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#FAFAFA;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border-width:1px;border-style:solid}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0 1px 0 0}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto!important;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-layedit{border-width:1px;border-style:solid;border-radius:2px}.layui-layedit-tool{padding:3px 5px;border-bottom-width:1px;border-bottom-style:solid;font-size:0}.layedit-tool-fixed{position:fixed;top:0;border-top:1px solid #eee}.layui-layedit-tool .layedit-tool-mid,.layui-layedit-tool .layui-icon{display:inline-block;vertical-align:middle;text-align:center;font-size:14px}.layui-layedit-tool .layui-icon{position:relative;width:32px;height:30px;line-height:30px;margin:3px 5px;color:#777;cursor:pointer;border-radius:2px}.layui-layedit-tool .layui-icon:hover{color:#393D49}.layui-layedit-tool .layui-icon:active{color:#000}.layui-layedit-tool .layedit-tool-active{background-color:#eee;color:#000}.layui-layedit-tool .layui-disabled,.layui-layedit-tool .layui-disabled:hover{color:#d2d2d2;cursor:not-allowed}.layui-layedit-tool .layedit-tool-mid{width:1px;height:18px;margin:0 10px;background-color:#d2d2d2}.layedit-tool-html{width:50px!important;font-size:30px!important}.layedit-tool-b,.layedit-tool-code,.layedit-tool-help{font-size:16px!important}.layedit-tool-d,.layedit-tool-face,.layedit-tool-image,.layedit-tool-unlink{font-size:18px!important}.layedit-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-layedit-iframe iframe{display:block;width:100%}#LAY_layedit_code{overflow:hidden}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #eee}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-flow-more a *,.layui-laypage input,.layui-table-view select[lay-ignore]{display:inline-block}.layui-laypage a:hover{color:#009688}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#009688}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#009688!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-table,.layui-table-view{margin:10px 0}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;background-color:#fff;color:#666}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table th{text-align:left;font-weight:400}.layui-table tbody tr:hover,.layui-table thead tr,.layui-table-click,.layui-table-header,.layui-table-hover,.layui-table-mend,.layui-table-patch,.layui-table-tool,.layui-table-total,.layui-table-total tr,.layui-table[lay-even] tr:nth-child(even){background-color:#FAFAFA}.layui-table td,.layui-table th,.layui-table-col-set,.layui-table-fixed-r,.layui-table-grid-down,.layui-table-header,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-total,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-width:1px;border-style:solid;border-color:#eee}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0 0 1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0 1px 0 0}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding:15px 30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:40px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{font-size:12px;padding:5px 10px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:20px;line-height:20px}.layui-table[lay-data]{display:none}.layui-table-box{position:relative;overflow:hidden}.layui-table-view .layui-table{position:relative;width:auto;margin:0}.layui-table-view .layui-table[lay-skin=line]{border-width:0 1px 0 0}.layui-table-view .layui-table[lay-skin=row]{border-width:0 0 1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:5px 0;border-top:none;border-left:none}.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor:pointer}.layui-table-view .layui-table td{cursor:default}.layui-table-view .layui-table td[data-edit=text]{cursor:text}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px}.layui-table-view .layui-form-radio{line-height:0;padding:0}.layui-table-view .layui-form-radio>i{margin:0;font-size:20px}.layui-table-init{position:absolute;left:0;top:0;width:100%;height:100%;text-align:center;z-index:110}.layui-table-init .layui-icon{position:absolute;left:50%;top:50%;margin:-15px 0 0 -15px;font-size:30px;color:#c2c2c2}.layui-table-header{border-width:0 0 1px;overflow:hidden}.layui-table-header .layui-table{margin-bottom:-1px}.layui-table-tool .layui-inline[lay-event]{position:relative;width:26px;height:26px;padding:5px;line-height:16px;margin-right:10px;text-align:center;color:#333;border:1px solid #ccc;cursor:pointer;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool .layui-inline[lay-event]:hover{border:1px solid #999}.layui-table-tool-temp{padding-right:120px}.layui-table-tool-self{position:absolute;right:17px;top:10px}.layui-table-tool .layui-table-tool-self .layui-inline[lay-event]{margin:0 0 0 10px}.layui-table-tool-panel{position:absolute;top:29px;left:-1px;padding:5px 0;min-width:150px;min-height:40px;border:1px solid #d2d2d2;text-align:left;overflow-y:auto;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-table-cell,.layui-table-tool-panel li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-table-tool-panel li{padding:0 10px;line-height:30px;-webkit-transition:.5s all;transition:.5s all}.layui-menu li,.layui-menu-body-title a:hover,.layui-menu-body-title>.layui-icon:hover{transition:all .3s}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{width:100%;padding-left:28px}.layui-table-tool-panel li:hover{background-color:#F6F6F6}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] i{position:absolute;left:0;top:0}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] span{padding:0}.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left:auto;right:-1px}.layui-table-col-set{position:absolute;right:0;top:0;width:20px;height:100%;border-width:0 0 0 1px;background-color:#fff}.layui-table-sort{width:10px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{position:absolute;left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:3px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#666}.layui-table-sort .layui-table-sort-desc{bottom:5px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#666}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:28px;line-height:28px;padding:0 15px;position:relative;box-sizing:border-box}.layui-table-cell .layui-form-checkbox[lay-skin=primary]{top:-1px;padding:0}.layui-table-cell .layui-table-link{color:#01AAED}.laytable-cell-checkbox,.laytable-cell-numbers,.laytable-cell-radio,.laytable-cell-space{padding:0;text-align:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px;margin-bottom:-1px}.layui-table-body .layui-none{line-height:26px;padding:30px 15px;text-align:center;color:#999}.layui-table-fixed{position:absolute;left:0;top:0;z-index:101}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-l{box-shadow:1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r{left:auto;right:-1px;border-width:0 0 0 1px;box-shadow:-1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px}.layui-table-tool{position:relative;z-index:890;width:100%;min-height:50px;line-height:30px;padding:10px 15px;border-width:0 0 1px}.layui-table-tool .layui-btn-container{margin-bottom:-10px}.layui-table-page,.layui-table-total{border-width:1px 0 0;margin-bottom:-1px;overflow:hidden}.layui-table-page{position:relative;width:100%;padding:7px 7px 0;height:41px;font-size:12px;white-space:nowrap}.layui-table-page>div{height:26px}.layui-table-page .layui-laypage{margin:0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span{height:26px;line-height:26px;margin-bottom:10px;border:none;background:0 0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span.layui-laypage-curr{padding:0 12px}.layui-table-page .layui-laypage span{margin-left:0;padding:0}.layui-table-page .layui-laypage .layui-laypage-prev{margin-left:-7px!important}.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left:0;top:0;padding:0}.layui-table-page .layui-laypage button,.layui-table-page .layui-laypage input{height:26px;line-height:26px}.layui-table-page .layui-laypage input{width:40px}.layui-table-page .layui-laypage button{padding:0 10px}.layui-table-page select{height:18px}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 14px 1px;border-radius:0;box-shadow:1px 1px 20px rgba(0,0,0,.15)}.layui-table-edit:focus{border-color:#5FB878!important}select.layui-table-edit{padding:0 0 0 10px;border-color:#d2d2d2}.layui-table-view .layui-form-checkbox,.layui-table-view .layui-form-radio,.layui-table-view .layui-form-switch{top:0;margin:0;box-sizing:content-box}.layui-colorpicker-alpha-slider,.layui-colorpicker-side-slider,.layui-menu,.layui-menu *,.layui-nav{box-sizing:border-box}.layui-table-view .layui-form-checkbox{top:-1px;height:26px;line-height:26px}.layui-table-view .layui-form-checkbox i{height:26px}.layui-table-grid .layui-table-cell{overflow:visible}.layui-table-grid-down{position:absolute;top:0;right:0;width:26px;height:100%;padding:5px 0;border-width:0 0 0 1px;text-align:center;background-color:#fff;color:#999;cursor:pointer}.layui-table-grid-down .layui-icon{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px}.layui-table-grid-down:hover{background-color:#fbfbfb}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.12)}.layui-table-tips-main{margin:-44px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#666}.layui-table-tips-c{position:absolute;right:-3px;top:-13px;width:20px;height:20px;padding:3px;cursor:pointer;background-color:#666;border-radius:50%;color:#fff}.layui-table-tips-c:hover{background-color:#777}.layui-table-tips-c:before{position:relative;right:-2px}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-drag,.layui-upload-form,.layui-upload-wrap{display:inline-block}.layui-upload-list{margin:10px 0}.layui-upload-choose{max-width:200px;padding:0 10px;color:#999;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-upload-drag{position:relative;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#009688}.layui-upload-drag[lay-over]{border-color:#009688}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-btn-container .layui-upload-choose{padding-left:0}.layui-menu{position:relative;margin:5px 0;background-color:#fff}.layui-menu li,.layui-menu-body-title a{padding:5px 15px}.layui-menu li{position:relative;margin:1px 0;width:calc(100% + 1px);line-height:26px;color:rgba(0,0,0,.8);font-size:14px;white-space:nowrap;cursor:pointer}.layui-menu li:hover{background-color:#F6F6F6}.layui-menu-item-parent:hover>.layui-menu-body-panel{display:block;animation-name:layui-fadein;animation-duration:.3s;animation-fill-mode:both;animation-delay:.2s}.layui-menu-item-group .layui-menu-body-title,.layui-menu-item-parent .layui-menu-body-title{padding-right:25px}.layui-menu .layui-menu-item-divider:hover,.layui-menu .layui-menu-item-group:hover,.layui-menu .layui-menu-item-none:hover{background:0 0;cursor:default}.layui-menu .layui-menu-item-group>ul{margin:5px 0 -5px}.layui-menu .layui-menu-item-group>.layui-menu-body-title{color:rgba(0,0,0,.35);user-select:none}.layui-menu .layui-menu-item-none{color:rgba(0,0,0,.35);cursor:default;text-align:center}.layui-menu .layui-menu-item-divider{margin:5px 0;padding:0;height:0;line-height:0;border-bottom:1px solid #eee;overflow:hidden}.layui-menu .layui-menu-item-down:hover,.layui-menu .layui-menu-item-up:hover{cursor:pointer}.layui-menu .layui-menu-item-up>.layui-menu-body-title{color:rgba(0,0,0,.8)}.layui-menu .layui-menu-item-up>ul{visibility:hidden;height:0;overflow:hidden}.layui-menu .layui-menu-item-down:hover>.layui-menu-body-title>.layui-icon,.layui-menu .layui-menu-item-up>.layui-menu-body-title:hover>.layui-icon{color:rgba(0,0,0,1)}.layui-menu .layui-menu-item-down>ul{visibility:visible;height:auto}.layui-breadcrumb,.layui-tree-btnGroup{visibility:hidden}.layui-menu .layui-menu-item-checked,.layui-menu .layui-menu-item-checked2{background-color:#F6F6F6!important;color:#5FB878}.layui-menu .layui-menu-item-checked a,.layui-menu .layui-menu-item-checked2 a{color:#5FB878}.layui-menu .layui-menu-item-checked:after{position:absolute;right:0;top:0;bottom:0;border-right:3px solid #5FB878;content:""}.layui-menu-body-title{position:relative;overflow:hidden;text-overflow:ellipsis}.layui-menu-body-title a{display:block;margin:-5px -15px;color:rgba(0,0,0,.8)}.layui-menu-body-title>.layui-icon{position:absolute;right:0;top:0;font-size:14px}.layui-menu-body-title>.layui-icon-right{right:-1px}.layui-menu-body-panel{display:none;position:absolute;top:-7px;left:100%;z-index:1000;margin-left:13px;padding:5px 0}.layui-menu-body-panel:before{content:"";position:absolute;width:20px;left:-16px;top:0;bottom:0}.layui-menu-body-panel-left{left:auto;right:100%;margin:0 13px}.layui-menu-body-panel-left:before{left:auto;right:-16px}.layui-menu-lg li{line-height:32px}.layui-menu-lg .layui-menu-body-title a:hover,.layui-menu-lg li:hover{background:0 0;color:#5FB878}.layui-menu-lg li .layui-menu-body-panel{margin-left:14px}.layui-menu-lg li .layui-menu-body-panel-left{margin:0 15px}.layui-dropdown{position:absolute;left:-999999px;top:-999999px;z-index:66666666;margin:5px 0;min-width:100px}.layui-dropdown:before{content:"";position:absolute;width:100%;height:6px;left:0;top:-6px}.layui-nav{position:relative;padding:0 20px;background-color:#393D49;color:#fff;border-radius:2px;font-size:0}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);transition:all .3s;-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar{content:"";position:absolute;left:0;top:0;width:0;height:5px;background-color:#5FB878;transition:all .2s;-webkit-transition:all .2s;pointer-events:none}.layui-nav-bar{z-index:1000}.layui-nav[lay-bar=disabled] .layui-nav-bar{display:none}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff}.layui-nav .layui-this:after{top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:10px;border-radius:50%}.layui-nav .layui-nav-more{position:absolute;top:0;right:3px;left:auto!important;margin-top:0;font-size:12px;cursor:pointer;transition:all .2s;-webkit-transition:all .2s}.layui-nav .layui-nav-mored,.layui-nav-itemed>a .layui-nav-more{transform:rotate(180deg)}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #eee;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap}.layui-nav .layui-nav-child a{color:#666;color:rgba(0,0,0,.8)}.layui-nav .layui-nav-child a:hover{background-color:#F6F6F6;color:rgba(0,0,0,.8)}.layui-nav-child dd{margin:1px 0;position:relative}.layui-nav-child dd.layui-this{background-color:#F6F6F6;color:#000}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-child-r{left:auto;right:0}.layui-nav-child-c{text-align:center}.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:40px}.layui-nav-tree .layui-nav-item a{position:relative;height:40px;line-height:40px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item>a{padding-top:5px;padding-bottom:5px}.layui-nav-tree .layui-nav-more{right:15px}.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding:5px 0}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#009688}.layui-side .layui-nav-tree .layui-nav-bar{width:2px}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#009688;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child dd{margin:0}.layui-nav-tree .layui-nav-child a{color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-itemed>.layui-nav-child{display:block;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-breadcrumb{font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#5FB878!important}.layui-breadcrumb a cite{color:#666;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#eee;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\9;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:15px 0}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#FF5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#009688}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #5FB878}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#FAFAFA}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#5FB878}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#5FB878;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#FF5722}.layui-timeline-item:before{content:"";position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:first-child:before{display:block}.layui-timeline-item:last-child:before{display:none}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px;line-height:22px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#FF5722;color:#fff;border-radius:2px}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;color:#666}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#c2c2c2;font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\9;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\9;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#eee;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:15px;bottom:15px;z-index:999999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9F9F9F;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#666;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-transfer-active,.layui-transfer-box{display:inline-block;vertical-align:middle}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #D9D9D9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-code{position:relative;margin:10px 0;padding:15px;line-height:20px;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New;font-size:12px}.layui-transfer-box,.layui-transfer-header,.layui-transfer-search{border-width:0;border-style:solid;border-color:#eee}.layui-transfer-box{position:relative;border-width:1px;width:200px;height:360px;border-radius:2px;background-color:#fff}.layui-transfer-box .layui-form-checkbox{width:100%;margin:0!important}.layui-transfer-header{height:38px;line-height:38px;padding:0 10px;border-bottom-width:1px}.layui-transfer-search{position:relative;padding:10px;border-bottom-width:1px}.layui-transfer-search .layui-input{height:32px;padding-left:30px;font-size:12px}.layui-transfer-search .layui-icon-search{position:absolute;left:20px;top:50%;margin-top:-8px;color:#666}.layui-transfer-active{margin:0 15px}.layui-transfer-active .layui-btn{display:block;margin:0;padding:0 15px;background-color:#5FB878;border-color:#5FB878;color:#fff}.layui-transfer-active .layui-btn-disabled{background-color:#FBFBFB;border-color:#eee;color:#d2d2d2}.layui-transfer-active .layui-btn:first-child{margin-bottom:15px}.layui-transfer-active .layui-btn .layui-icon{margin:0;font-size:14px!important}.layui-transfer-data{padding:5px 0;overflow:auto}.layui-transfer-data li{height:32px;line-height:32px;padding:0 10px}.layui-transfer-data li:hover{background-color:#F6F6F6;transition:.5s all}.layui-transfer-data .layui-none{padding:15px 10px;text-align:center;color:#999}.layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:10px 5px 10px 0;font-size:0}.layui-rate li i.layui-icon{font-size:20px;color:#FFB800;margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-colorpicker{width:26px;height:26px;border:1px solid #eee;padding:5px;border-radius:2px;line-height:24px;display:inline-block;cursor:pointer;transition:all .3s;-webkit-transition:all .3s}.layui-colorpicker:hover{border-color:#d2d2d2}.layui-colorpicker.layui-colorpicker-lg{width:34px;height:34px;line-height:32px}.layui-colorpicker.layui-colorpicker-sm{width:24px;height:24px;line-height:22px}.layui-colorpicker.layui-colorpicker-xs{width:22px;height:22px;line-height:20px}.layui-colorpicker-trigger-bgcolor{display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px}.layui-colorpicker-trigger-span{display:block;height:100%;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;text-align:center}.layui-colorpicker-trigger-i{display:inline-block;color:#FFF;font-size:12px}.layui-colorpicker-trigger-i.layui-icon-close{color:#999}.layui-colorpicker-main{position:absolute;left:-999999px;top:-999999px;z-index:66666666;width:280px;margin:5px 0;padding:7px;background:#FFF;border:1px solid #d2d2d2;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-colorpicker-main-wrapper{height:180px;position:relative}.layui-colorpicker-basis{width:260px;height:100%;position:relative}.layui-colorpicker-basis-white{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(90deg,#FFF,hsla(0,0%,100%,0))}.layui-colorpicker-basis-black{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(0deg,#000,transparent)}.layui-colorpicker-basis-cursor{width:10px;height:10px;border:1px solid #FFF;border-radius:50%;position:absolute;top:-3px;right:-3px;cursor:pointer}.layui-colorpicker-side{position:absolute;top:0;right:0;width:12px;height:100%;background:linear-gradient(red,#FF0,#0F0,#0FF,#00F,#F0F,red)}.layui-colorpicker-side-slider{width:100%;height:5px;box-shadow:0 0 1px #888;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;left:0}.layui-colorpicker-main-alpha{display:none;height:12px;margin-top:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-alpha-bgcolor{height:100%;position:relative}.layui-colorpicker-alpha-slider{width:5px;height:100%;box-shadow:0 0 1px #888;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;top:0}.layui-colorpicker-main-pre{padding-top:7px;font-size:0}.layui-colorpicker-pre{width:20px;height:20px;border-radius:2px;display:inline-block;margin-left:6px;margin-bottom:7px;cursor:pointer}.layui-colorpicker-pre:nth-child(11n+1){margin-left:0}.layui-colorpicker-pre-isalpha{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-pre.layui-this{box-shadow:0 0 3px 2px rgba(0,0,0,.15)}.layui-colorpicker-pre>div{height:100%;border-radius:2px}.layui-colorpicker-main-input{text-align:right;padding-top:7px}.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin:0 0 0 10px}.layui-colorpicker-main-input div.layui-inline{float:left;margin-right:10px;font-size:14px}.layui-colorpicker-main-input input.layui-input{width:150px;height:30px;color:#666}.layui-slider{height:4px;background:#eee;border-radius:3px;position:relative;cursor:pointer}.layui-slider-bar{border-radius:3px;position:absolute;height:100%}.layui-slider-step{position:absolute;top:0;width:4px;height:4px;border-radius:50%;background:#FFF;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layui-slider-wrap{width:36px;height:36px;position:absolute;top:-16px;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10;text-align:center}.layui-slider-wrap-btn{width:12px;height:12px;border-radius:50%;background:#FFF;display:inline-block;vertical-align:middle;cursor:pointer;transition:.3s}.layui-slider-wrap:after{content:"";height:100%;display:inline-block;vertical-align:middle}.layui-slider-wrap-btn.layui-slider-hover,.layui-slider-wrap-btn:hover{transform:scale(1.2)}.layui-slider-wrap-btn.layui-disabled:hover{transform:scale(1)!important}.layui-slider-tips{position:absolute;top:-42px;z-index:66666666;white-space:nowrap;display:none;-webkit-transform:translateX(-50%);transform:translateX(-50%);color:#FFF;background:#000;border-radius:3px;height:25px;line-height:25px;padding:0 10px}.layui-slider-tips:after{content:"";position:absolute;bottom:-12px;left:50%;margin-left:-6px;width:0;height:0;border-width:6px;border-style:solid;border-color:#000 transparent transparent}.layui-slider-input{width:70px;height:32px;border:1px solid #eee;border-radius:3px;font-size:16px;line-height:32px;position:absolute;right:0;top:-14px}.layui-slider-input-btn{position:absolute;top:0;right:0;width:20px;height:100%;border-left:1px solid #eee}.layui-slider-input-btn i{cursor:pointer;position:absolute;right:0;bottom:0;width:20px;height:50%;font-size:12px;line-height:16px;text-align:center;color:#999}.layui-slider-input-btn i:first-child{top:0;border-bottom:1px solid #eee}.layui-slider-input-txt{height:100%;font-size:14px}.layui-slider-input-txt input{height:100%;border:none}.layui-slider-input-btn i:hover{color:#009688}.layui-slider-vertical{width:4px;margin-left:33px}.layui-slider-vertical .layui-slider-bar{width:4px}.layui-slider-vertical .layui-slider-step{top:auto;left:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-wrap{top:auto;left:-16px;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-tips{top:auto;left:2px}@media \0screen{.layui-slider-wrap-btn{margin-left:-20px}.layui-slider-vertical .layui-slider-wrap-btn{margin-left:0;margin-bottom:-20px}.layui-slider-vertical .layui-slider-tips{margin-left:-8px}.layui-slider>span{margin-left:8px}}.layui-tree{line-height:22px}.layui-tree .layui-form-checkbox{margin:0!important}.layui-tree-set{width:100%;position:relative}.layui-tree-pack{display:none;padding-left:20px;position:relative}.layui-tree-iconClick,.layui-tree-main{display:inline-block;vertical-align:middle}.layui-tree-line .layui-tree-pack{padding-left:27px}.layui-tree-line .layui-tree-set .layui-tree-set:after{content:"";position:absolute;top:14px;left:-9px;width:17px;height:0;border-top:1px dotted #c0c4cc}.layui-tree-entry{position:relative;padding:3px 0;height:20px;white-space:nowrap}.layui-tree-entry:hover{background-color:#eee}.layui-tree-line .layui-tree-entry:hover{background-color:rgba(0,0,0,0)}.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color:#999;text-decoration:underline;transition:.3s}.layui-tree-main{cursor:pointer;padding-right:10px}.layui-tree-line .layui-tree-set:before{content:"";position:absolute;top:0;left:-9px;width:0;height:100%;border-left:1px dotted #c0c4cc}.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height:13px}.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height:0}.layui-tree-iconClick{position:relative;height:20px;line-height:20px;margin:0 10px;color:#c0c4cc}.layui-tree-icon{height:12px;line-height:12px;width:12px;text-align:center;border:1px solid #c0c4cc}.layui-tree-iconClick .layui-icon{font-size:18px}.layui-tree-icon .layui-icon{font-size:12px;color:#666}.layui-tree-iconArrow{padding:0 5px}.layui-tree-iconArrow:after{content:"";position:absolute;left:4px;top:3px;z-index:100;width:0;height:0;border-width:5px;border-style:solid;border-color:transparent transparent transparent #c0c4cc;transition:.5s}.layui-tree-btnGroup,.layui-tree-editInput{position:relative;vertical-align:middle;display:inline-block}.layui-tree-spread>.layui-tree-entry>.layui-tree-iconClick>.layui-tree-iconArrow:after{transform:rotate(90deg) translate(3px,4px)}.layui-tree-txt{display:inline-block;vertical-align:middle;color:#555}.layui-tree-search{margin-bottom:15px;color:#666}.layui-tree-btnGroup .layui-icon{display:inline-block;vertical-align:middle;padding:0 2px;cursor:pointer}.layui-tree-btnGroup .layui-icon:hover{color:#999;transition:.3s}.layui-tree-entry:hover .layui-tree-btnGroup{visibility:visible}.layui-tree-editInput{height:20px;line-height:20px;padding:0 3px;border:none;background-color:rgba(0,0,0,.05)}.layui-tree-emptyText{text-align:center;color:#999}.layui-anim{-webkit-animation-duration:.3s;-webkit-animation-fill-mode:both;animation-duration:.3s;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.layui-trans,.layui-trans a{transition:all .2s;-webkit-transition:all .2s}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,15px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,15px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@keyframes layui-down{0%{opacity:.3;transform:translate3d(0,-100%,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-down{animation-name:layui-down}@keyframes layui-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-downbit{animation-name:layui-downbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@keyframes layui-scalesmall{0%{opacity:.3;transform:scale(1.5)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall{animation-name:layui-scalesmall}@keyframes layui-scalesmall-spring{0%{opacity:.3;transform:scale(1.5)}80%{opacity:.8;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall-spring{animation-name:layui-scalesmall-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout} \ No newline at end of file +.layui-inline,img{display:inline-block;vertical-align:middle}h1,h2,h3,h4,h5,h6{font-weight:400}a,body{color:#333}.layui-edge,.layui-header,.layui-inline,.layui-main{position:relative}.layui-edge,hr{height:0;overflow:hidden}.layui-layout-body,.layui-side,.layui-side-scroll{overflow-x:hidden}.layui-edge,.layui-elip,hr{overflow:hidden}.layui-btn,.layui-edge,.layui-inline,img{vertical-align:middle}.layui-btn,.layui-disabled,.layui-icon,.layui-unselect{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,li,ol,p,pre,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}a:active,a:hover{outline:0}img{border:none}li{list-style:none}table{border-collapse:collapse;border-spacing:0}h4,h5,h6{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}pre{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}body{line-height:1.6;color:rgba(0,0,0,.85);font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{line-height:0;margin:10px 0;padding:0;border:none!important;border-bottom:1px solid #eee!important;clear:both;background:0 0}a{text-decoration:none}a:hover{color:#777}a cite{font-style:normal;*cursor:pointer}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-box,.layui-box *{box-sizing:content-box}.layui-clear{clear:both;*zoom:1}.layui-clear:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-inline{*display:inline;*zoom:1}.layui-btn,.layui-btn-group,.layui-edge{display:inline-block}.layui-edge{width:0;border-width:6px;border-style:dashed;border-color:transparent}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-elip{text-overflow:ellipsis;white-space:nowrap}.layui-disabled,.layui-disabled:hover{color:#d2d2d2!important;cursor:not-allowed!important}.layui-circle{border-radius:100%}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-show-v{visibility:visible!important}.layui-hide-v{visibility:hidden!important}@font-face{font-family:layui-icon;src:url(../font/iconfont.eot?v=256);src:url(../font/iconfont.eot?v=256#iefix) format('embedded-opentype'),url(../font/iconfont.woff2?v=256) format('woff2'),url(../font/iconfont.woff?v=256) format('woff'),url(../font/iconfont.ttf?v=256) format('truetype'),url(../font/iconfont.svg?v=256#layui-icon) format('svg')}.layui-icon{font-family:layui-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-icon-reply-fill:before{content:"\e611"}.layui-icon-set-fill:before{content:"\e614"}.layui-icon-menu-fill:before{content:"\e60f"}.layui-icon-search:before{content:"\e615"}.layui-icon-share:before{content:"\e641"}.layui-icon-set-sm:before{content:"\e620"}.layui-icon-engine:before{content:"\e628"}.layui-icon-close:before{content:"\1006"}.layui-icon-close-fill:before{content:"\1007"}.layui-icon-chart-screen:before{content:"\e629"}.layui-icon-star:before{content:"\e600"}.layui-icon-circle-dot:before{content:"\e617"}.layui-icon-chat:before{content:"\e606"}.layui-icon-release:before{content:"\e609"}.layui-icon-list:before{content:"\e60a"}.layui-icon-chart:before{content:"\e62c"}.layui-icon-ok-circle:before{content:"\1005"}.layui-icon-layim-theme:before{content:"\e61b"}.layui-icon-table:before{content:"\e62d"}.layui-icon-right:before{content:"\e602"}.layui-icon-left:before{content:"\e603"}.layui-icon-cart-simple:before{content:"\e698"}.layui-icon-face-cry:before{content:"\e69c"}.layui-icon-face-smile:before{content:"\e6af"}.layui-icon-survey:before{content:"\e6b2"}.layui-icon-tree:before{content:"\e62e"}.layui-icon-ie:before{content:"\e7bb"}.layui-icon-upload-circle:before{content:"\e62f"}.layui-icon-add-circle:before{content:"\e61f"}.layui-icon-download-circle:before{content:"\e601"}.layui-icon-templeate-1:before{content:"\e630"}.layui-icon-util:before{content:"\e631"}.layui-icon-face-surprised:before{content:"\e664"}.layui-icon-edit:before{content:"\e642"}.layui-icon-speaker:before{content:"\e645"}.layui-icon-down:before{content:"\e61a"}.layui-icon-file:before{content:"\e621"}.layui-icon-layouts:before{content:"\e632"}.layui-icon-rate-half:before{content:"\e6c9"}.layui-icon-add-circle-fine:before{content:"\e608"}.layui-icon-prev-circle:before{content:"\e633"}.layui-icon-read:before{content:"\e705"}.layui-icon-404:before{content:"\e61c"}.layui-icon-carousel:before{content:"\e634"}.layui-icon-help:before{content:"\e607"}.layui-icon-code-circle:before{content:"\e635"}.layui-icon-windows:before{content:"\e67f"}.layui-icon-water:before{content:"\e636"}.layui-icon-username:before{content:"\e66f"}.layui-icon-find-fill:before{content:"\e670"}.layui-icon-about:before{content:"\e60b"}.layui-icon-location:before{content:"\e715"}.layui-icon-up:before{content:"\e619"}.layui-icon-pause:before{content:"\e651"}.layui-icon-date:before{content:"\e637"}.layui-icon-layim-uploadfile:before{content:"\e61d"}.layui-icon-delete:before{content:"\e640"}.layui-icon-play:before{content:"\e652"}.layui-icon-top:before{content:"\e604"}.layui-icon-firefox:before{content:"\e686"}.layui-icon-friends:before{content:"\e612"}.layui-icon-refresh-3:before{content:"\e9aa"}.layui-icon-ok:before{content:"\e605"}.layui-icon-layer:before{content:"\e638"}.layui-icon-face-smile-fine:before{content:"\e60c"}.layui-icon-dollar:before{content:"\e659"}.layui-icon-group:before{content:"\e613"}.layui-icon-layim-download:before{content:"\e61e"}.layui-icon-picture-fine:before{content:"\e60d"}.layui-icon-link:before{content:"\e64c"}.layui-icon-diamond:before{content:"\e735"}.layui-icon-log:before{content:"\e60e"}.layui-icon-key:before{content:"\e683"}.layui-icon-rate-solid:before{content:"\e67a"}.layui-icon-fonts-del:before{content:"\e64f"}.layui-icon-unlink:before{content:"\e64d"}.layui-icon-fonts-clear:before{content:"\e639"}.layui-icon-triangle-r:before{content:"\e623"}.layui-icon-circle:before{content:"\e63f"}.layui-icon-radio:before{content:"\e643"}.layui-icon-align-center:before{content:"\e647"}.layui-icon-align-right:before{content:"\e648"}.layui-icon-align-left:before{content:"\e649"}.layui-icon-loading-1:before{content:"\e63e"}.layui-icon-return:before{content:"\e65c"}.layui-icon-fonts-strong:before{content:"\e62b"}.layui-icon-upload:before{content:"\e67c"}.layui-icon-dialogue:before{content:"\e63a"}.layui-icon-video:before{content:"\e6ed"}.layui-icon-headset:before{content:"\e6fc"}.layui-icon-cellphone-fine:before{content:"\e63b"}.layui-icon-add-1:before{content:"\e654"}.layui-icon-face-smile-b:before{content:"\e650"}.layui-icon-fonts-html:before{content:"\e64b"}.layui-icon-screen-full:before{content:"\e622"}.layui-icon-form:before{content:"\e63c"}.layui-icon-cart:before{content:"\e657"}.layui-icon-camera-fill:before{content:"\e65d"}.layui-icon-tabs:before{content:"\e62a"}.layui-icon-heart-fill:before{content:"\e68f"}.layui-icon-fonts-code:before{content:"\e64e"}.layui-icon-ios:before{content:"\e680"}.layui-icon-at:before{content:"\e687"}.layui-icon-fire:before{content:"\e756"}.layui-icon-set:before{content:"\e716"}.layui-icon-fonts-u:before{content:"\e646"}.layui-icon-triangle-d:before{content:"\e625"}.layui-icon-tips:before{content:"\e702"}.layui-icon-picture:before{content:"\e64a"}.layui-icon-more-vertical:before{content:"\e671"}.layui-icon-bluetooth:before{content:"\e689"}.layui-icon-flag:before{content:"\e66c"}.layui-icon-loading:before{content:"\e63d"}.layui-icon-fonts-i:before{content:"\e644"}.layui-icon-refresh-1:before{content:"\e666"}.layui-icon-rmb:before{content:"\e65e"}.layui-icon-addition:before{content:"\e624"}.layui-icon-home:before{content:"\e68e"}.layui-icon-time:before{content:"\e68d"}.layui-icon-user:before{content:"\e770"}.layui-icon-notice:before{content:"\e667"}.layui-icon-chrome:before{content:"\e68a"}.layui-icon-edge:before{content:"\e68b"}.layui-icon-login-weibo:before{content:"\e675"}.layui-icon-voice:before{content:"\e688"}.layui-icon-upload-drag:before{content:"\e681"}.layui-icon-login-qq:before{content:"\e676"}.layui-icon-snowflake:before{content:"\e6b1"}.layui-icon-heart:before{content:"\e68c"}.layui-icon-logout:before{content:"\e682"}.layui-icon-file-b:before{content:"\e655"}.layui-icon-template:before{content:"\e663"}.layui-icon-transfer:before{content:"\e691"}.layui-icon-auz:before{content:"\e672"}.layui-icon-console:before{content:"\e665"}.layui-icon-app:before{content:"\e653"}.layui-icon-prev:before{content:"\e65a"}.layui-icon-website:before{content:"\e7ae"}.layui-icon-next:before{content:"\e65b"}.layui-icon-component:before{content:"\e857"}.layui-icon-android:before{content:"\e684"}.layui-icon-more:before{content:"\e65f"}.layui-icon-login-wechat:before{content:"\e677"}.layui-icon-shrink-right:before{content:"\e668"}.layui-icon-spread-left:before{content:"\e66b"}.layui-icon-camera:before{content:"\e660"}.layui-icon-note:before{content:"\e66e"}.layui-icon-refresh:before{content:"\e669"}.layui-icon-female:before{content:"\e661"}.layui-icon-male:before{content:"\e662"}.layui-icon-screen-restore:before{content:"\e758"}.layui-icon-password:before{content:"\e673"}.layui-icon-senior:before{content:"\e674"}.layui-icon-theme:before{content:"\e66a"}.layui-icon-tread:before{content:"\e6c5"}.layui-icon-praise:before{content:"\e6c6"}.layui-icon-star-fill:before{content:"\e658"}.layui-icon-rate:before{content:"\e67b"}.layui-icon-template-1:before{content:"\e656"}.layui-icon-vercode:before{content:"\e679"}.layui-icon-service:before{content:"\e626"}.layui-icon-cellphone:before{content:"\e678"}.layui-icon-print:before{content:"\e66d"}.layui-icon-cols:before{content:"\e610"}.layui-icon-wifi:before{content:"\e7e0"}.layui-icon-export:before{content:"\e67d"}.layui-icon-rss:before{content:"\e808"}.layui-icon-slider:before{content:"\e714"}.layui-icon-email:before{content:"\e618"}.layui-icon-subtraction:before{content:"\e67e"}.layui-icon-mike:before{content:"\e6dc"}.layui-icon-light:before{content:"\e748"}.layui-icon-gift:before{content:"\e627"}.layui-icon-mute:before{content:"\e685"}.layui-icon-reduce-circle:before{content:"\e616"}.layui-icon-music:before{content:"\e690"}.layui-main{width:1140px;margin:0 auto}.layui-header{z-index:1000;height:60px}.layui-header a:hover{transition:all .5s;-webkit-transition:all .5s}.layui-side{position:fixed;left:0;top:0;bottom:0;z-index:999;width:200px}.layui-side-scroll{position:relative;width:220px;height:100%}.layui-body{position:relative;left:200px;right:0;top:0;bottom:0;z-index:900;width:auto;box-sizing:border-box}.layui-layout-admin .layui-header{position:fixed;top:0;left:0;right:0;background-color:#23262E}.layui-layout-admin .layui-side{top:60px;width:200px;overflow-x:hidden}.layui-layout-admin .layui-body{position:absolute;top:60px;padding-bottom:44px}.layui-layout-admin .layui-main{width:auto;margin:0 15px}.layui-layout-admin .layui-footer{position:fixed;left:200px;right:0;bottom:0;z-index:990;height:44px;line-height:44px;padding:0 15px;box-shadow:-1px 0 4px rgb(0 0 0 / 12%);background-color:#FAFAFA}.layui-layout-admin .layui-logo{position:absolute;left:0;top:0;width:200px;height:100%;line-height:60px;text-align:center;color:#12bb37;font-size:16px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 15%)}.layui-layout-admin .layui-header .layui-nav{background:0 0}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}.layui-container{position:relative;margin:0 auto;padding:0 15px;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}.layui-row:after,.layui-row:before{content:"";display:block;clear:both}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9,.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9,.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9,.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{position:relative;display:block;box-sizing:border-box}.layui-col-xs1,.layui-col-xs10,.layui-col-xs11,.layui-col-xs12,.layui-col-xs2,.layui-col-xs3,.layui-col-xs4,.layui-col-xs5,.layui-col-xs6,.layui-col-xs7,.layui-col-xs8,.layui-col-xs9{float:left}.layui-col-xs1{width:8.33333333%}.layui-col-xs2{width:16.66666667%}.layui-col-xs3{width:25%}.layui-col-xs4{width:33.33333333%}.layui-col-xs5{width:41.66666667%}.layui-col-xs6{width:50%}.layui-col-xs7{width:58.33333333%}.layui-col-xs8{width:66.66666667%}.layui-col-xs9{width:75%}.layui-col-xs10{width:83.33333333%}.layui-col-xs11{width:91.66666667%}.layui-col-xs12{width:100%}.layui-col-xs-offset1{margin-left:8.33333333%}.layui-col-xs-offset2{margin-left:16.66666667%}.layui-col-xs-offset3{margin-left:25%}.layui-col-xs-offset4{margin-left:33.33333333%}.layui-col-xs-offset5{margin-left:41.66666667%}.layui-col-xs-offset6{margin-left:50%}.layui-col-xs-offset7{margin-left:58.33333333%}.layui-col-xs-offset8{margin-left:66.66666667%}.layui-col-xs-offset9{margin-left:75%}.layui-col-xs-offset10{margin-left:83.33333333%}.layui-col-xs-offset11{margin-left:91.66666667%}.layui-col-xs-offset12{margin-left:100%}@media screen and (max-width:768px){.layui-hide-xs{display:none!important}.layui-show-xs-block{display:block!important}.layui-show-xs-inline{display:inline!important}.layui-show-xs-inline-block{display:inline-block!important}}@media screen and (min-width:768px){.layui-container{width:750px}.layui-hide-sm{display:none!important}.layui-show-sm-block{display:block!important}.layui-show-sm-inline{display:inline!important}.layui-show-sm-inline-block{display:inline-block!important}.layui-col-sm1,.layui-col-sm10,.layui-col-sm11,.layui-col-sm12,.layui-col-sm2,.layui-col-sm3,.layui-col-sm4,.layui-col-sm5,.layui-col-sm6,.layui-col-sm7,.layui-col-sm8,.layui-col-sm9{float:left}.layui-col-sm1{width:8.33333333%}.layui-col-sm2{width:16.66666667%}.layui-col-sm3{width:25%}.layui-col-sm4{width:33.33333333%}.layui-col-sm5{width:41.66666667%}.layui-col-sm6{width:50%}.layui-col-sm7{width:58.33333333%}.layui-col-sm8{width:66.66666667%}.layui-col-sm9{width:75%}.layui-col-sm10{width:83.33333333%}.layui-col-sm11{width:91.66666667%}.layui-col-sm12{width:100%}.layui-col-sm-offset1{margin-left:8.33333333%}.layui-col-sm-offset2{margin-left:16.66666667%}.layui-col-sm-offset3{margin-left:25%}.layui-col-sm-offset4{margin-left:33.33333333%}.layui-col-sm-offset5{margin-left:41.66666667%}.layui-col-sm-offset6{margin-left:50%}.layui-col-sm-offset7{margin-left:58.33333333%}.layui-col-sm-offset8{margin-left:66.66666667%}.layui-col-sm-offset9{margin-left:75%}.layui-col-sm-offset10{margin-left:83.33333333%}.layui-col-sm-offset11{margin-left:91.66666667%}.layui-col-sm-offset12{margin-left:100%}}@media screen and (min-width:992px){.layui-container{width:970px}.layui-hide-md{display:none!important}.layui-show-md-block{display:block!important}.layui-show-md-inline{display:inline!important}.layui-show-md-inline-block{display:inline-block!important}.layui-col-md1,.layui-col-md10,.layui-col-md11,.layui-col-md12,.layui-col-md2,.layui-col-md3,.layui-col-md4,.layui-col-md5,.layui-col-md6,.layui-col-md7,.layui-col-md8,.layui-col-md9{float:left}.layui-col-md1{width:8.33333333%}.layui-col-md2{width:16.66666667%}.layui-col-md3{width:25%}.layui-col-md4{width:33.33333333%}.layui-col-md5{width:41.66666667%}.layui-col-md6{width:50%}.layui-col-md7{width:58.33333333%}.layui-col-md8{width:66.66666667%}.layui-col-md9{width:75%}.layui-col-md10{width:83.33333333%}.layui-col-md11{width:91.66666667%}.layui-col-md12{width:100%}.layui-col-md-offset1{margin-left:8.33333333%}.layui-col-md-offset2{margin-left:16.66666667%}.layui-col-md-offset3{margin-left:25%}.layui-col-md-offset4{margin-left:33.33333333%}.layui-col-md-offset5{margin-left:41.66666667%}.layui-col-md-offset6{margin-left:50%}.layui-col-md-offset7{margin-left:58.33333333%}.layui-col-md-offset8{margin-left:66.66666667%}.layui-col-md-offset9{margin-left:75%}.layui-col-md-offset10{margin-left:83.33333333%}.layui-col-md-offset11{margin-left:91.66666667%}.layui-col-md-offset12{margin-left:100%}}@media screen and (min-width:1200px){.layui-container{width:1170px}.layui-hide-lg{display:none!important}.layui-show-lg-block{display:block!important}.layui-show-lg-inline{display:inline!important}.layui-show-lg-inline-block{display:inline-block!important}.layui-col-lg1,.layui-col-lg10,.layui-col-lg11,.layui-col-lg12,.layui-col-lg2,.layui-col-lg3,.layui-col-lg4,.layui-col-lg5,.layui-col-lg6,.layui-col-lg7,.layui-col-lg8,.layui-col-lg9{float:left}.layui-col-lg1{width:8.33333333%}.layui-col-lg2{width:16.66666667%}.layui-col-lg3{width:25%}.layui-col-lg4{width:33.33333333%}.layui-col-lg5{width:41.66666667%}.layui-col-lg6{width:50%}.layui-col-lg7{width:58.33333333%}.layui-col-lg8{width:66.66666667%}.layui-col-lg9{width:75%}.layui-col-lg10{width:83.33333333%}.layui-col-lg11{width:91.66666667%}.layui-col-lg12{width:100%}.layui-col-lg-offset1{margin-left:8.33333333%}.layui-col-lg-offset2{margin-left:16.66666667%}.layui-col-lg-offset3{margin-left:25%}.layui-col-lg-offset4{margin-left:33.33333333%}.layui-col-lg-offset5{margin-left:41.66666667%}.layui-col-lg-offset6{margin-left:50%}.layui-col-lg-offset7{margin-left:58.33333333%}.layui-col-lg-offset8{margin-left:66.66666667%}.layui-col-lg-offset9{margin-left:75%}.layui-col-lg-offset10{margin-left:83.33333333%}.layui-col-lg-offset11{margin-left:91.66666667%}.layui-col-lg-offset12{margin-left:100%}}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space2{margin:-1px}.layui-col-space2>*{padding:1px}.layui-col-space4{margin:-2px}.layui-col-space4>*{padding:2px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space6{margin:-3px}.layui-col-space6>*{padding:3px}.layui-col-space8{margin:-4px}.layui-col-space8>*{padding:4px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space14{margin:-7px}.layui-col-space14>*{padding:7px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space16{margin:-8px}.layui-col-space16>*{padding:8px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space24{margin:-12px}.layui-col-space24>*{padding:12px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space26{margin:-13px}.layui-col-space26>*{padding:13px}.layui-col-space28{margin:-14px}.layui-col-space28>*{padding:14px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-elem-quote{margin-bottom:10px;padding:15px;line-height:1.6;border-left:5px solid #5FB878;border-radius:0 2px 2px 0;background-color:#FAFAFA}.layui-quote-nm{border-style:solid;border-width:1px 1px 1px 5px;background:0 0}.layui-elem-field{margin-bottom:10px;padding:0;border-width:1px;border-style:solid}.layui-elem-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border-width:1px 0 0}.layui-field-box{padding:15px}.layui-field-title .layui-field-box{padding:10px 0}.layui-progress{position:relative;height:6px;border-radius:20px;background-color:#eee}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:#5FB878;transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#666}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:#FAFAFA;cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{display:none;padding:10px 15px;line-height:1.6;color:#666}.layui-colla-icon{position:absolute;left:15px;top:0;font-size:14px}.layui-card-body,.layui-card-header,.layui-form-label,.layui-form-mid,.layui-form-select,.layui-input-block,.layui-input-inline,.layui-panel,.layui-textarea{position:relative}.layui-card{margin-bottom:15px;border-radius:2px;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.layui-form-select dl,.layui-panel{box-shadow:1px 1px 4px rgb(0 0 0 / 8%)}.layui-card:last-child{margin-bottom:0}.layui-card-header{height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;color:#333;border-radius:2px 2px 0 0;font-size:14px}.layui-card-body{padding:10px 15px;line-height:24px}.layui-card-body[pad15]{padding:15px}.layui-card-body[pad20]{padding:20px}.layui-card-body .layui-table{margin:5px 0}.layui-card .layui-tab{margin:0}.layui-panel{border-width:1px;border-style:solid;border-radius:2px;background-color:#fff;color:#666}.layui-bg-black,.layui-bg-blue,.layui-bg-cyan,.layui-bg-green,.layui-bg-orange,.layui-bg-red{color:#fff!important}.layui-panel-window{position:relative;padding:15px;border-radius:0;border-top:5px solid #eee;background-color:#fff}.layui-border,.layui-border-black,.layui-border-blue,.layui-border-cyan,.layui-border-green,.layui-border-orange,.layui-border-red{border-width:1px;border-style:solid}.layui-auxiliar-moving{position:fixed;left:0;right:0;top:0;bottom:0;width:100%;height:100%;background:0 0;z-index:9999999999}.layui-bg-red{background-color:#FF5722!important}.layui-bg-orange{background-color:#FFB800!important}.layui-bg-green{background-color:#12bb37!important}.layui-bg-cyan{background-color:#2F4056!important}.layui-bg-blue{background-color:#1E9FFF!important}.layui-bg-black{background-color:#393D49!important}.layui-bg-gray{background-color:#FAFAFA!important;color:#666!important}.layui-badge-rim,.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-elem-field,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-input,.layui-layedit,.layui-layedit-tool,.layui-panel,.layui-quote-nm,.layui-select,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after,.layui-textarea{border-color:#eee}.layui-border{color:#666!important}.layui-border-red{border-color:#FF5722!important;color:#FF5722!important}.layui-border-orange{border-color:#FFB800!important;color:#FFB800!important}.layui-border-green{border-color:#12bb37!important;color:#12bb37!important}.layui-border-cyan{border-color:#2F4056!important;color:#2F4056!important}.layui-border-blue{border-color:#1E9FFF!important;color:#1E9FFF!important}.layui-border-black{border-color:#393D49!important;color:#393D49!important}.layui-timeline-item:before{background-color:#eee}.layui-text{line-height:1.6;font-size:14px;color:#666}.layui-text h1,.layui-text h2,.layui-text h3{font-weight:500;color:#333}.layui-text h1{font-size:30px}.layui-text h2{font-size:24px}.layui-text h3{font-size:18px}.layui-text a:not(.layui-btn){color:#01AAED}.layui-text a:not(.layui-btn):hover{text-decoration:underline}.layui-text ul{padding:5px 0 5px 15px}.layui-text ul li{margin-top:5px;list-style-type:disc}.layui-text em,.layui-word-aux{color:#999!important;padding-left:5px!important;padding-right:5px!important}.layui-text p{margin:10px 0}.layui-text p:first-child{margin-top:0}.layui-font-12{font-size:12px!important}.layui-font-14{font-size:14px!important}.layui-font-16{font-size:16px!important}.layui-font-18{font-size:18px!important}.layui-font-20{font-size:20px!important}.layui-font-red{color:#FF5722!important}.layui-font-orange{color:#FFB800!important}.layui-font-green{color:#12bb37!important}.layui-font-cyan{color:#2F4056!important}.layui-font-blue{color:#01AAED!important}.layui-font-black{color:#000!important}.layui-font-gray{color:#c2c2c2!important}.layui-btn{height:38px;line-height:38px;border:1px solid transparent;padding:0 18px;background-color:#12bb37;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border-radius:2px;cursor:pointer}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80);color:#fff}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn+.layui-btn{margin-left:10px}.layui-btn-container{font-size:0}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}.layui-table .layui-btn-container .layui-btn{margin-bottom:9px}.layui-btn-radius{border-radius:100px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\9;vertical-align:bottom}.layui-btn-primary{border-color:#d2d2d2;background:0 0;color:#666}.layui-btn-primary:hover{border-color:#12bb37;color:#333}.layui-btn-normal{background-color:#1E9FFF}.layui-btn-warm{background-color:#FFB800}.layui-btn-danger{background-color:#FF5722}.layui-btn-checked{background-color:#5FB878}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#FBFBFB!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-group{vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-left:1px solid rgba(255,255,255,.5);border-radius:0}.layui-btn-group .layui-btn-primary{border-left:none}.layui-btn-group .layui-btn-primary:hover{border-color:#d2d2d2;color:#12bb37}.layui-btn-group .layui-btn:first-child{border-left:none;border-radius:2px 0 0 2px}.layui-btn-group .layui-btn-primary:first-child{border-left:1px solid #d2d2d2}.layui-btn-group .layui-btn:last-child{border-radius:0 2px 2px 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}.layui-btn-fluid{width:100%}.layui-input,.layui-select,.layui-textarea{height:38px;line-height:1.3;line-height:38px\9;border-width:1px;border-style:solid;background-color:#fff;color:rgba(0,0,0,.85);border-radius:2px}.layui-input::-webkit-input-placeholder,.layui-select::-webkit-input-placeholder,.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-input,.layui-textarea{display:block;width:100%;padding-left:10px}.layui-input:hover,.layui-textarea:hover{border-color:#eee!important}.layui-input:focus,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea{min-height:100px;height:auto;line-height:20px;padding:6px 10px;resize:vertical}.layui-select{padding:0 10px}.layui-form input[type=checkbox],.layui-form input[type=radio],.layui-form select{display:none}.layui-form [lay-ignore]{display:initial}.layui-form-item{margin-bottom:15px;clear:both;*zoom:1}.layui-form-item:after{content:'\20';clear:both;*zoom:1;display:block;height:0}.layui-form-label{float:left;display:block;padding:9px 15px;width:80px;font-weight:400;line-height:20px;text-align:right}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#FF5722!important}.layui-form-select .layui-input{padding-right:30px;cursor:pointer}.layui-form-select .layui-edge{position:absolute;right:10px;top:50%;margin-top:-3px;cursor:pointer;border-width:6px;border-top-color:#c2c2c2;border-top-style:solid;transition:all .3s;-webkit-transition:all .3s}.layui-form-select dl{display:none;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #eee;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-sizing:border-box}.layui-form-select dl dd,.layui-form-select dl dt{padding:0 10px;line-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-form-select dl dt{font-size:12px;color:#999}.layui-form-select dl dd{cursor:pointer}.layui-form-select dl dd:hover{background-color:#F6F6F6;-webkit-transition:.5s all;transition:.5s all}.layui-form-select .layui-select-group dd{padding-left:20px}.layui-form-select dl dd.layui-select-tips{padding-left:10px!important;color:#999}.layui-form-select dl dd.layui-this{background-color:#5FB878;color:#fff}.layui-form-checkbox,.layui-form-select dl dd.layui-disabled{background-color:#fff}.layui-form-selected dl{display:block}.layui-form-checkbox,.layui-form-checkbox *,.layui-form-switch{display:inline-block;vertical-align:middle}.layui-form-selected .layui-edge{margin-top:-9px;-webkit-transform:rotate(180deg);transform:rotate(180deg);margin-top:-3px\9}:root .layui-form-selected .layui-edge{margin-top:-9px\0/IE9}.layui-form-selectup dl{top:auto;bottom:42px}.layui-select-none{margin:5px 0;text-align:center;color:#999}.layui-select-disabled .layui-disabled{border-color:#eee!important}.layui-select-disabled .layui-edge{border-top-color:#d2d2d2}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layui-form-checkbox:hover span{background-color:#c2c2c2}.layui-form-checkbox i{position:absolute;right:0;top:0;width:30px;height:28px;border:1px solid #d2d2d2;border-left:none;border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:#c2c2c2;color:#c2c2c2}.layui-form-checked,.layui-form-checked:hover{border-color:#5FB878}.layui-form-checked span,.layui-form-checked:hover span{background-color:#5FB878}.layui-form-checked i,.layui-form-checked:hover i{color:#5FB878}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid #d2d2d2;font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:#5FB878;color:#fff}.layui-form-checked[lay-skin=primary] i{border-color:#5FB878!important;background-color:#5FB878;color:#fff}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:#c2c2c2!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:#d2d2d2}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-form-switch{position:relative;height:22px;line-height:22px;min-width:35px;padding:0 5px;margin-top:8px;border:1px solid #d2d2d2;border-radius:20px;cursor:pointer;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch i{position:absolute;left:5px;top:3px;width:16px;height:16px;border-radius:20px;background-color:#d2d2d2;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-switch em{position:relative;top:0;width:25px;margin-left:21px;padding:0!important;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px}.layui-form-onswitch{border-color:#5FB878;background-color:#5FB878}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:#eee!important}.layui-form-onswitch i{left:100%;margin-left:-21px;background-color:#fff}.layui-form-onswitch em{margin-left:5px;margin-right:21px;color:#fff!important}.layui-checkbox-disabled span{background-color:#eee!important}.layui-checkbox-disabled em{color:#d2d2d2!important}.layui-checkbox-disabled:hover i{color:#fff!important}[lay-radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:#c2c2c2}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:#5FB878}.layui-radio-disabled>i{color:#eee!important}.layui-radio-disabled *{color:#c2c2c2!important}.layui-form-pane .layui-form-label{width:110px;padding:8px 15px;height:38px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#FAFAFA;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box}.layui-form-pane .layui-input-inline{margin-left:-1px}.layui-form-pane .layui-input-block{margin-left:110px;left:-1px}.layui-form-pane .layui-input{border-radius:0 2px 2px 0}.layui-form-pane .layui-form-text .layui-form-label{float:none;width:100%;border-radius:2px;box-sizing:border-box;text-align:left}.layui-form-pane .layui-form-text .layui-input-inline{display:block;margin:0;top:-1px;clear:both}.layui-form-pane .layui-form-text .layui-input-block{margin:0;left:0;top:-1px}.layui-form-pane .layui-form-text .layui-textarea{min-height:100px;border-radius:0 0 2px 2px}.layui-form-pane .layui-form-checkbox{margin:4px 0 4px 10px}.layui-form-pane .layui-form-radio,.layui-form-pane .layui-form-switch{margin-top:6px;margin-left:10px}.layui-form-pane .layui-form-item[pane]{position:relative;border-width:1px;border-style:solid}.layui-form-pane .layui-form-item[pane] .layui-form-label{position:absolute;left:0;top:0;height:100%;border-width:0 1px 0 0}.layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:110px}@media screen and (max-width:450px){.layui-form-item .layui-form-label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-form-item .layui-inline{display:block;margin-right:0;margin-bottom:20px;clear:both}.layui-form-item .layui-inline:after{content:'\20';clear:both;display:block;height:0}.layui-form-item .layui-input-inline{display:block;float:none;left:-3px;width:auto!important;margin:0 0 10px 112px}.layui-form-item .layui-input-inline+.layui-form-mid{margin-left:110px;top:-5px;padding:0}.layui-form-item .layui-form-checkbox{margin-right:5px;margin-bottom:5px}}.layui-layedit{border-width:1px;border-style:solid;border-radius:2px}.layui-layedit-tool{padding:3px 5px;border-bottom-width:1px;border-bottom-style:solid;font-size:0}.layedit-tool-fixed{position:fixed;top:0;border-top:1px solid #eee}.layui-layedit-tool .layedit-tool-mid,.layui-layedit-tool .layui-icon{display:inline-block;vertical-align:middle;text-align:center;font-size:14px}.layui-layedit-tool .layui-icon{position:relative;width:32px;height:30px;line-height:30px;margin:3px 5px;color:#777;cursor:pointer;border-radius:2px}.layui-layedit-tool .layui-icon:hover{color:#393D49}.layui-layedit-tool .layui-icon:active{color:#000}.layui-layedit-tool .layedit-tool-active{background-color:#eee;color:#000}.layui-layedit-tool .layui-disabled,.layui-layedit-tool .layui-disabled:hover{color:#d2d2d2;cursor:not-allowed}.layui-layedit-tool .layedit-tool-mid{width:1px;height:18px;margin:0 10px;background-color:#d2d2d2}.layedit-tool-html{width:50px!important;font-size:30px!important}.layedit-tool-b,.layedit-tool-code,.layedit-tool-help{font-size:16px!important}.layedit-tool-d,.layedit-tool-face,.layedit-tool-image,.layedit-tool-unlink{font-size:18px!important}.layedit-tool-image input{position:absolute;font-size:0;left:0;top:0;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-layedit-iframe iframe{display:block;width:100%}#LAY_layedit_code{overflow:hidden}.layui-laypage{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid #eee}.layui-laypage a,.layui-laypage span{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-flow-more a *,.layui-laypage input,.layui-table-view select[lay-ignore]{display:inline-block}.layui-laypage a:hover{color:#12bb37}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:#12bb37}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input:focus,.layui-laypage select:focus{border-color:#12bb37!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}.layui-table,.layui-table-view{margin:10px 0}.layui-flow-more{margin:10px 0;text-align:center;color:#999;font-size:14px}.layui-flow-more a{height:32px;line-height:32px}.layui-flow-more a *{vertical-align:top}.layui-flow-more a cite{padding:0 20px;border-radius:3px;background-color:#eee;color:#333;font-style:normal}.layui-flow-more a cite:hover{opacity:.8}.layui-flow-more a i{font-size:30px;color:#737383}.layui-table{width:100%;background-color:#fff;color:#666}.layui-table tr{transition:all .3s;-webkit-transition:all .3s}.layui-table th{text-align:left;font-weight:400}.layui-table tbody tr:hover,.layui-table thead tr,.layui-table-click,.layui-table-header,.layui-table-hover,.layui-table-mend,.layui-table-patch,.layui-table-tool,.layui-table-total,.layui-table-total tr,.layui-table[lay-even] tr:nth-child(even){background-color:#FAFAFA}.layui-table td,.layui-table th,.layui-table-col-set,.layui-table-fixed-r,.layui-table-grid-down,.layui-table-header,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-total,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-width:1px;border-style:solid;border-color:#eee}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:14px}.layui-table[lay-skin=line] td,.layui-table[lay-skin=line] th{border-width:0 0 1px}.layui-table[lay-skin=row] td,.layui-table[lay-skin=row] th{border-width:0 1px 0 0}.layui-table[lay-skin=nob] td,.layui-table[lay-skin=nob] th{border:none}.layui-table img{max-width:100px}.layui-table[lay-size=lg] td,.layui-table[lay-size=lg] th{padding:15px 30px}.layui-table-view .layui-table[lay-size=lg] .layui-table-cell{height:40px;line-height:40px}.layui-table[lay-size=sm] td,.layui-table[lay-size=sm] th{font-size:12px;padding:5px 10px}.layui-table-view .layui-table[lay-size=sm] .layui-table-cell{height:20px;line-height:20px}.layui-table[lay-data]{display:none}.layui-table-box{position:relative;overflow:hidden}.layui-table-view .layui-table{position:relative;width:auto;margin:0}.layui-table-view .layui-table[lay-skin=line]{border-width:0 1px 0 0}.layui-table-view .layui-table[lay-skin=row]{border-width:0 0 1px}.layui-table-view .layui-table td,.layui-table-view .layui-table th{padding:5px 0;border-top:none;border-left:none}.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor:pointer}.layui-table-view .layui-table td{cursor:default}.layui-table-view .layui-table td[data-edit=text]{cursor:text}.layui-table-view .layui-form-checkbox[lay-skin=primary] i{width:18px;height:18px}.layui-table-view .layui-form-radio{line-height:0;padding:0}.layui-table-view .layui-form-radio>i{margin:0;font-size:20px}.layui-table-init{position:absolute;left:0;top:0;width:100%;height:100%;text-align:center;z-index:110}.layui-table-init .layui-icon{position:absolute;left:50%;top:50%;margin:-15px 0 0 -15px;font-size:30px;color:#c2c2c2}.layui-table-header{border-width:0 0 1px;overflow:hidden}.layui-table-header .layui-table{margin-bottom:-1px}.layui-table-tool .layui-inline[lay-event]{position:relative;width:26px;height:26px;padding:5px;line-height:16px;margin-right:10px;text-align:center;color:#333;border:1px solid #ccc;cursor:pointer;-webkit-transition:.5s all;transition:.5s all}.layui-table-tool .layui-inline[lay-event]:hover{border:1px solid #999}.layui-table-tool-temp{padding-right:120px}.layui-table-tool-self{position:absolute;right:17px;top:10px}.layui-table-tool .layui-table-tool-self .layui-inline[lay-event]{margin:0 0 0 10px}.layui-table-tool-panel{position:absolute;top:29px;left:-1px;padding:5px 0;min-width:150px;min-height:40px;border:1px solid #d2d2d2;text-align:left;overflow-y:auto;background-color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-table-cell,.layui-table-tool-panel li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-table-tool-panel li{padding:0 10px;line-height:30px;-webkit-transition:.5s all;transition:.5s all}.layui-menu li,.layui-menu-body-title a:hover,.layui-menu-body-title>.layui-icon:hover{transition:all .3s}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary]{width:100%;padding-left:28px}.layui-table-tool-panel li:hover{background-color:#F6F6F6}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] i{position:absolute;left:0;top:0}.layui-table-tool-panel li .layui-form-checkbox[lay-skin=primary] span{padding:0}.layui-table-tool .layui-table-tool-self .layui-table-tool-panel{left:auto;right:-1px}.layui-table-col-set{position:absolute;right:0;top:0;width:20px;height:100%;border-width:0 0 0 1px;background-color:#fff}.layui-table-sort{width:10px;height:20px;margin-left:5px;cursor:pointer!important}.layui-table-sort .layui-edge{position:absolute;left:5px;border-width:5px}.layui-table-sort .layui-table-sort-asc{top:3px;border-top:none;border-bottom-style:solid;border-bottom-color:#b2b2b2}.layui-table-sort .layui-table-sort-asc:hover{border-bottom-color:#666}.layui-table-sort .layui-table-sort-desc{bottom:5px;border-bottom:none;border-top-style:solid;border-top-color:#b2b2b2}.layui-table-sort .layui-table-sort-desc:hover{border-top-color:#666}.layui-table-sort[lay-sort=asc] .layui-table-sort-asc{border-bottom-color:#000}.layui-table-sort[lay-sort=desc] .layui-table-sort-desc{border-top-color:#000}.layui-table-cell{height:28px;line-height:28px;padding:0 15px;position:relative;box-sizing:border-box}.layui-table-cell .layui-form-checkbox[lay-skin=primary]{top:-1px;padding:0}.layui-table-cell .layui-table-link{color:#01AAED}.laytable-cell-checkbox,.laytable-cell-numbers,.laytable-cell-radio,.laytable-cell-space{padding:0;text-align:center}.layui-table-body{position:relative;overflow:auto;margin-right:-1px;margin-bottom:-1px}.layui-table-body .layui-none{line-height:26px;padding:30px 15px;text-align:center;color:#999}.layui-table-fixed{position:absolute;left:0;top:0;z-index:101}.layui-table-fixed .layui-table-body{overflow:hidden}.layui-table-fixed-l{box-shadow:1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r{left:auto;right:-1px;border-width:0 0 0 1px;box-shadow:-1px 0 8px rgba(0,0,0,.08)}.layui-table-fixed-r .layui-table-header{position:relative;overflow:visible}.layui-table-mend{position:absolute;right:-49px;top:0;height:100%;width:50px}.layui-table-tool{position:relative;z-index:890;width:100%;min-height:50px;line-height:30px;padding:10px 15px;border-width:0 0 1px}.layui-table-tool .layui-btn-container{margin-bottom:-10px}.layui-table-page,.layui-table-total{border-width:1px 0 0;margin-bottom:-1px;overflow:hidden}.layui-table-page{position:relative;width:100%;padding:7px 7px 0;height:41px;font-size:12px;white-space:nowrap}.layui-table-page>div{height:26px}.layui-table-page .layui-laypage{margin:0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span{height:26px;line-height:26px;margin-bottom:10px;border:none;background:0 0}.layui-table-page .layui-laypage a,.layui-table-page .layui-laypage span.layui-laypage-curr{padding:0 12px}.layui-table-page .layui-laypage span{margin-left:0;padding:0}.layui-table-page .layui-laypage .layui-laypage-prev{margin-left:-7px!important}.layui-table-page .layui-laypage .layui-laypage-curr .layui-laypage-em{left:0;top:0;padding:0}.layui-table-page .layui-laypage button,.layui-table-page .layui-laypage input{height:26px;line-height:26px}.layui-table-page .layui-laypage input{width:40px}.layui-table-page .layui-laypage button{padding:0 10px}.layui-table-page select{height:18px}.layui-table-patch .layui-table-cell{padding:0;width:30px}.layui-table-edit{position:absolute;left:0;top:0;width:100%;height:100%;padding:0 14px 1px;border-radius:0;box-shadow:1px 1px 20px rgba(0,0,0,.15)}.layui-table-edit:focus{border-color:#5FB878!important}select.layui-table-edit{padding:0 0 0 10px;border-color:#d2d2d2}.layui-table-view .layui-form-checkbox,.layui-table-view .layui-form-radio,.layui-table-view .layui-form-switch{top:0;margin:0;box-sizing:content-box}.layui-colorpicker-alpha-slider,.layui-colorpicker-side-slider,.layui-menu,.layui-menu *,.layui-nav{box-sizing:border-box}.layui-table-view .layui-form-checkbox{top:-1px;height:26px;line-height:26px}.layui-table-view .layui-form-checkbox i{height:26px}.layui-table-grid .layui-table-cell{overflow:visible}.layui-table-grid-down{position:absolute;top:0;right:0;width:26px;height:100%;padding:5px 0;border-width:0 0 0 1px;text-align:center;background-color:#fff;color:#999;cursor:pointer}.layui-table-grid-down .layui-icon{position:absolute;top:50%;left:50%;margin:-8px 0 0 -8px}.layui-table-grid-down:hover{background-color:#fbfbfb}body .layui-table-tips .layui-layer-content{background:0 0;padding:0;box-shadow:0 1px 6px rgba(0,0,0,.12)}.layui-table-tips-main{margin:-44px 0 0 -1px;max-height:150px;padding:8px 15px;font-size:14px;overflow-y:scroll;background-color:#fff;color:#666}.layui-table-tips-c{position:absolute;right:-3px;top:-13px;width:20px;height:20px;padding:3px;cursor:pointer;background-color:#666;border-radius:50%;color:#fff}.layui-table-tips-c:hover{background-color:#777}.layui-table-tips-c:before{position:relative;right:-2px}.layui-upload-file{display:none!important;opacity:.01;filter:Alpha(opacity=1)}.layui-upload-drag,.layui-upload-form,.layui-upload-wrap{display:inline-block}.layui-upload-list{margin:10px 0}.layui-upload-choose{max-width:200px;padding:0 10px;color:#999;font-size:14px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-upload-drag{position:relative;padding:30px;border:1px dashed #e2e2e2;background-color:#fff;text-align:center;cursor:pointer;color:#999}.layui-upload-drag .layui-icon{font-size:50px;color:#12bb37}.layui-upload-drag[lay-over]{border-color:#12bb37}.layui-upload-iframe{position:absolute;width:0;height:0;border:0;visibility:hidden}.layui-upload-wrap{position:relative;vertical-align:middle}.layui-upload-wrap .layui-upload-file{display:block!important;position:absolute;left:0;top:0;z-index:10;font-size:100px;width:100%;height:100%;opacity:.01;filter:Alpha(opacity=1);cursor:pointer}.layui-btn-container .layui-upload-choose{padding-left:0}.layui-menu{position:relative;margin:5px 0;background-color:#fff}.layui-menu li,.layui-menu-body-title a{padding:5px 15px}.layui-menu li{position:relative;margin:1px 0;width:calc(100% + 1px);line-height:26px;color:rgba(0,0,0,.8);font-size:14px;white-space:nowrap;cursor:pointer}.layui-menu li:hover{background-color:#F6F6F6}.layui-menu-item-parent:hover>.layui-menu-body-panel{display:block;animation-name:layui-fadein;animation-duration:.3s;animation-fill-mode:both;animation-delay:.2s}.layui-menu-item-group .layui-menu-body-title,.layui-menu-item-parent .layui-menu-body-title{padding-right:25px}.layui-menu .layui-menu-item-divider:hover,.layui-menu .layui-menu-item-group:hover,.layui-menu .layui-menu-item-none:hover{background:0 0;cursor:default}.layui-menu .layui-menu-item-group>ul{margin:5px 0 -5px}.layui-menu .layui-menu-item-group>.layui-menu-body-title{color:rgba(0,0,0,.35);user-select:none}.layui-menu .layui-menu-item-none{color:rgba(0,0,0,.35);cursor:default;text-align:center}.layui-menu .layui-menu-item-divider{margin:5px 0;padding:0;height:0;line-height:0;border-bottom:1px solid #eee;overflow:hidden}.layui-menu .layui-menu-item-down:hover,.layui-menu .layui-menu-item-up:hover{cursor:pointer}.layui-menu .layui-menu-item-up>.layui-menu-body-title{color:rgba(0,0,0,.8)}.layui-menu .layui-menu-item-up>ul{visibility:hidden;height:0;overflow:hidden}.layui-menu .layui-menu-item-down:hover>.layui-menu-body-title>.layui-icon,.layui-menu .layui-menu-item-up>.layui-menu-body-title:hover>.layui-icon{color:rgba(0,0,0,1)}.layui-menu .layui-menu-item-down>ul{visibility:visible;height:auto}.layui-breadcrumb,.layui-tree-btnGroup{visibility:hidden}.layui-menu .layui-menu-item-checked,.layui-menu .layui-menu-item-checked2{background-color:#F6F6F6!important;color:#5FB878}.layui-menu .layui-menu-item-checked a,.layui-menu .layui-menu-item-checked2 a{color:#5FB878}.layui-menu .layui-menu-item-checked:after{position:absolute;right:0;top:0;bottom:0;border-right:3px solid #5FB878;content:""}.layui-menu-body-title{position:relative;overflow:hidden;text-overflow:ellipsis}.layui-menu-body-title a{display:block;margin:-5px -15px;color:rgba(0,0,0,.8)}.layui-menu-body-title>.layui-icon{position:absolute;right:0;top:0;font-size:14px}.layui-menu-body-title>.layui-icon-right{right:-1px}.layui-menu-body-panel{display:none;position:absolute;top:-7px;left:100%;z-index:1000;margin-left:13px;padding:5px 0}.layui-menu-body-panel:before{content:"";position:absolute;width:20px;left:-16px;top:0;bottom:0}.layui-menu-body-panel-left{left:auto;right:100%;margin:0 13px}.layui-menu-body-panel-left:before{left:auto;right:-16px}.layui-menu-lg li{line-height:32px}.layui-menu-lg .layui-menu-body-title a:hover,.layui-menu-lg li:hover{background:0 0;color:#5FB878}.layui-menu-lg li .layui-menu-body-panel{margin-left:14px}.layui-menu-lg li .layui-menu-body-panel-left{margin:0 15px}.layui-dropdown{position:absolute;left:-999999px;top:-999999px;z-index:66666666;margin:5px 0;min-width:100px}.layui-dropdown:before{content:"";position:absolute;width:100%;height:6px;left:0;top:-6px}.layui-nav{position:relative;padding:0 20px;background-color:#393D49;color:#fff;border-radius:2px;font-size:0}.layui-nav *{font-size:14px}.layui-nav .layui-nav-item{position:relative;display:inline-block;*display:inline;*zoom:1;vertical-align:middle;line-height:60px}.layui-nav .layui-nav-item a{display:block;padding:0 20px;color:#fff;color:rgba(255,255,255,.7);transition:all .3s;-webkit-transition:all .3s}.layui-nav .layui-this:after,.layui-nav-bar{content:"";position:absolute;left:0;top:0;width:0;height:5px;background-color:#5FB878;transition:all .2s;-webkit-transition:all .2s;pointer-events:none}.layui-nav-bar{z-index:1000}.layui-nav[lay-bar=disabled] .layui-nav-bar{display:none}.layui-nav .layui-nav-item a:hover,.layui-nav .layui-this a{color:#fff}.layui-nav .layui-this:after{top:auto;bottom:0;width:100%}.layui-nav-img{width:30px;height:30px;margin-right:10px;border-radius:50%}.layui-nav .layui-nav-more{position:absolute;top:0;right:3px;left:auto!important;margin-top:0;font-size:12px;cursor:pointer;transition:all .2s;-webkit-transition:all .2s}.layui-nav .layui-nav-mored,.layui-nav-itemed>a .layui-nav-more{transform:rotate(180deg)}.layui-nav-child{display:none;position:absolute;left:0;top:65px;min-width:100%;line-height:36px;padding:5px 0;box-shadow:0 2px 4px rgba(0,0,0,.12);border:1px solid #eee;background-color:#fff;z-index:100;border-radius:2px;white-space:nowrap}.layui-nav .layui-nav-child a{color:#666;color:rgba(0,0,0,.8)}.layui-nav .layui-nav-child a:hover{background-color:#F6F6F6;color:rgba(0,0,0,.8)}.layui-nav-child dd{margin:1px 0;position:relative}.layui-nav-child dd.layui-this{background-color:#F6F6F6;color:#000}.layui-nav-child dd.layui-this:after{display:none}.layui-nav-child-r{left:auto;right:0}.layui-nav-child-c{text-align:center}.layui-nav-tree{width:200px;padding:0}.layui-nav-tree .layui-nav-item{display:block;width:100%;line-height:40px}.layui-nav-tree .layui-nav-item a{position:relative;height:40px;line-height:40px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layui-nav-tree .layui-nav-item>a{padding-top:5px;padding-bottom:5px}.layui-nav-tree .layui-nav-more{right:15px}.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding:5px 0}.layui-nav-tree .layui-nav-bar{width:5px;height:0;background-color:#12bb37}.layui-side .layui-nav-tree .layui-nav-bar{width:2px}.layui-nav-tree .layui-nav-child dd.layui-this,.layui-nav-tree .layui-nav-child dd.layui-this a,.layui-nav-tree .layui-this,.layui-nav-tree .layui-this>a,.layui-nav-tree .layui-this>a:hover{background-color:#12bb37;color:#fff}.layui-nav-tree .layui-this:after{display:none}.layui-nav-itemed>a,.layui-nav-tree .layui-nav-title a,.layui-nav-tree .layui-nav-title a:hover{color:#fff!important}.layui-nav-tree .layui-nav-child{position:relative;z-index:0;top:0;border:none;box-shadow:none}.layui-nav-tree .layui-nav-child dd{margin:0}.layui-nav-tree .layui-nav-child a{color:#fff;color:rgba(255,255,255,.7)}.layui-nav-tree .layui-nav-child,.layui-nav-tree .layui-nav-child a:hover{background:0 0;color:#fff}.layui-nav-itemed>.layui-nav-child{display:block;background-color:rgba(0,0,0,.3)!important}.layui-nav-itemed>.layui-nav-child>.layui-this>.layui-nav-child{display:block}.layui-nav-side{position:fixed;top:0;bottom:0;left:0;overflow-x:hidden;z-index:999}.layui-breadcrumb{font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999!important}.layui-breadcrumb a:hover{color:#5FB878!important}.layui-breadcrumb a cite{color:#666;font-style:normal}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:#999}.layui-tab{margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-title{overflow:hidden}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer}.layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-title .layui-this{color:#000}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-bar{position:absolute;right:0;top:0;z-index:10;width:30px;height:39px;line-height:39px;border-width:1px;border-style:solid;border-radius:2px;text-align:center;background-color:#fff;cursor:pointer}.layui-tab-bar .layui-icon{position:relative;display:inline-block;top:3px;transition:all .3s;-webkit-transition:all .3s}.layui-tab-item{display:none}.layui-tab-more{padding-right:30px;height:auto!important;white-space:normal!important}.layui-tab-more li.layui-this:after{border-bottom-color:#eee;border-radius:2px}.layui-tab-more .layui-tab-bar .layui-icon{top:-2px;top:3px\9;-webkit-transform:rotate(180deg);transform:rotate(180deg)}:root .layui-tab-more .layui-tab-bar .layui-icon{top:-2px\0/IE9}.layui-tab-content{padding:15px 0}.layui-tab-title li .layui-tab-close{position:relative;display:inline-block;width:18px;height:18px;line-height:20px;margin-left:8px;top:1px;text-align:center;font-size:14px;color:#c2c2c2;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li .layui-tab-close:hover{border-radius:2px;background-color:#FF5722;color:#fff}.layui-tab-brief>.layui-tab-title .layui-this{color:#12bb37}.layui-tab-brief>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-title .layui-this:after{border:none;border-radius:0;border-bottom:2px solid #5FB878}.layui-tab-brief[overflow]>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px 0 rgba(0,0,0,.1)}.layui-tab-card>.layui-tab-title{background-color:#FAFAFA}.layui-tab-card>.layui-tab-title li{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-title .layui-this{background-color:#fff}.layui-tab-card>.layui-tab-title .layui-this:after{border-top:none;border-width:1px;border-bottom-color:#fff}.layui-tab-card>.layui-tab-title .layui-tab-bar{height:40px;line-height:40px;border-radius:0;border-top:none;border-right:none}.layui-tab-card>.layui-tab-more .layui-this{background:0 0;color:#5FB878}.layui-tab-card>.layui-tab-more .layui-this:after{border:none}.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:#5FB878;border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#FF5722}.layui-timeline-item:before{content:"";position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:first-child:before{display:block}.layui-timeline-item:last-child:before{display:none}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px;line-height:22px}.layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#FF5722;color:#fff;border-radius:2px}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;color:#666}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:'\e63d';left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:#c2c2c2;font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\9;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:rgba(0,0,0,.2);color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:rgba(0,0,0,.35)}.layui-carousel:hover .layui-carousel-arrow{display:block\9;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:rgba(0,0,0,.5)}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:rgba(0,0,0,.2);border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:#eee;background-color:rgba(255,255,255,.5);border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:rgba(255,255,255,.7)}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-left{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this.layui-carousel-right{top:100%}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev{opacity:0}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-carousel-prev.layui-carousel-right{opacity:1}.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-left,.layui-carousel[lay-anim=fade]>[carousel-item]>.layui-this.layui-carousel-right{opacity:0}.layui-fixbar{position:fixed;right:15px;bottom:15px;z-index:999999}.layui-fixbar li{width:50px;height:50px;line-height:50px;margin-bottom:1px;text-align:center;cursor:pointer;font-size:30px;background-color:#9F9F9F;color:#fff;border-radius:2px;opacity:.95}.layui-fixbar li:hover{opacity:.85}.layui-fixbar li:active{opacity:1}.layui-fixbar .layui-fixbar-top{display:none;font-size:40px}body .layui-util-face{border:none;background:0 0}body .layui-util-face .layui-layer-content{padding:0;background-color:#fff;color:#666;box-shadow:none}.layui-util-face .layui-layer-TipsG{display:none}.layui-transfer-active,.layui-transfer-box{display:inline-block;vertical-align:middle}.layui-util-face ul{position:relative;width:372px;padding:10px;border:1px solid #D9D9D9;background-color:#fff;box-shadow:0 0 20px rgba(0,0,0,.2)}.layui-util-face ul li{cursor:pointer;float:left;border:1px solid #e8e8e8;height:22px;width:26px;overflow:hidden;margin:-1px 0 0 -1px;padding:4px 2px;text-align:center}.layui-util-face ul li:hover{position:relative;z-index:2;border:1px solid #eb7350;background:#fff9ec}.layui-code{position:relative;margin:10px 0;padding:15px;line-height:20px;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New;font-size:12px}.layui-transfer-box,.layui-transfer-header,.layui-transfer-search{border-width:0;border-style:solid;border-color:#eee}.layui-transfer-box{position:relative;border-width:1px;width:200px;height:360px;border-radius:2px;background-color:#fff}.layui-transfer-box .layui-form-checkbox{width:100%;margin:0!important}.layui-transfer-header{height:38px;line-height:38px;padding:0 10px;border-bottom-width:1px}.layui-transfer-search{position:relative;padding:10px;border-bottom-width:1px}.layui-transfer-search .layui-input{height:32px;padding-left:30px;font-size:12px}.layui-transfer-search .layui-icon-search{position:absolute;left:20px;top:50%;margin-top:-8px;color:#666}.layui-transfer-active{margin:0 15px}.layui-transfer-active .layui-btn{display:block;margin:0;padding:0 15px;background-color:#5FB878;border-color:#5FB878;color:#fff}.layui-transfer-active .layui-btn-disabled{background-color:#FBFBFB;border-color:#eee;color:#d2d2d2}.layui-transfer-active .layui-btn:first-child{margin-bottom:15px}.layui-transfer-active .layui-btn .layui-icon{margin:0;font-size:14px!important}.layui-transfer-data{padding:5px 0;overflow:auto}.layui-transfer-data li{height:32px;line-height:32px;padding:0 10px}.layui-transfer-data li:hover{background-color:#F6F6F6;transition:.5s all}.layui-transfer-data .layui-none{padding:15px 10px;text-align:center;color:#999}.layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:10px 5px 10px 0;font-size:0}.layui-rate li i.layui-icon{font-size:20px;color:#FFB800;margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-colorpicker{width:26px;height:26px;border:1px solid #eee;padding:5px;border-radius:2px;line-height:24px;display:inline-block;cursor:pointer;transition:all .3s;-webkit-transition:all .3s}.layui-colorpicker:hover{border-color:#d2d2d2}.layui-colorpicker.layui-colorpicker-lg{width:34px;height:34px;line-height:32px}.layui-colorpicker.layui-colorpicker-sm{width:24px;height:24px;line-height:22px}.layui-colorpicker.layui-colorpicker-xs{width:22px;height:22px;line-height:20px}.layui-colorpicker-trigger-bgcolor{display:block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);border-radius:2px}.layui-colorpicker-trigger-span{display:block;height:100%;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);border-radius:2px;text-align:center}.layui-colorpicker-trigger-i{display:inline-block;color:#FFF;font-size:12px}.layui-colorpicker-trigger-i.layui-icon-close{color:#999}.layui-colorpicker-main{position:absolute;left:-999999px;top:-999999px;z-index:66666666;width:280px;margin:5px 0;padding:7px;background:#FFF;border:1px solid #d2d2d2;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12)}.layui-colorpicker-main-wrapper{height:180px;position:relative}.layui-colorpicker-basis{width:260px;height:100%;position:relative}.layui-colorpicker-basis-white{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(90deg,#FFF,hsla(0,0%,100%,0))}.layui-colorpicker-basis-black{width:100%;height:100%;position:absolute;top:0;left:0;background:linear-gradient(0deg,#000,transparent)}.layui-colorpicker-basis-cursor{width:10px;height:10px;border:1px solid #FFF;border-radius:50%;position:absolute;top:-3px;right:-3px;cursor:pointer}.layui-colorpicker-side{position:absolute;top:0;right:0;width:12px;height:100%;background:linear-gradient(red,#FF0,#0F0,#0FF,#00F,#F0F,red)}.layui-colorpicker-side-slider{width:100%;height:5px;box-shadow:0 0 1px #888;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;left:0}.layui-colorpicker-main-alpha{display:none;height:12px;margin-top:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-alpha-bgcolor{height:100%;position:relative}.layui-colorpicker-alpha-slider{width:5px;height:100%;box-shadow:0 0 1px #888;background:#FFF;border-radius:1px;border:1px solid #f0f0f0;cursor:pointer;position:absolute;top:0}.layui-colorpicker-main-pre{padding-top:7px;font-size:0}.layui-colorpicker-pre{width:20px;height:20px;border-radius:2px;display:inline-block;margin-left:6px;margin-bottom:7px;cursor:pointer}.layui-colorpicker-pre:nth-child(11n+1){margin-left:0}.layui-colorpicker-pre-isalpha{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.layui-colorpicker-pre.layui-this{box-shadow:0 0 3px 2px rgba(0,0,0,.15)}.layui-colorpicker-pre>div{height:100%;border-radius:2px}.layui-colorpicker-main-input{text-align:right;padding-top:7px}.layui-colorpicker-main-input .layui-btn-container .layui-btn{margin:0 0 0 10px}.layui-colorpicker-main-input div.layui-inline{float:left;margin-right:10px;font-size:14px}.layui-colorpicker-main-input input.layui-input{width:150px;height:30px;color:#666}.layui-slider{height:4px;background:#eee;border-radius:3px;position:relative;cursor:pointer}.layui-slider-bar{border-radius:3px;position:absolute;height:100%}.layui-slider-step{position:absolute;top:0;width:4px;height:4px;border-radius:50%;background:#FFF;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.layui-slider-wrap{width:36px;height:36px;position:absolute;top:-16px;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:10;text-align:center}.layui-slider-wrap-btn{width:12px;height:12px;border-radius:50%;background:#FFF;display:inline-block;vertical-align:middle;cursor:pointer;transition:.3s}.layui-slider-wrap:after{content:"";height:100%;display:inline-block;vertical-align:middle}.layui-slider-wrap-btn.layui-slider-hover,.layui-slider-wrap-btn:hover{transform:scale(1.2)}.layui-slider-wrap-btn.layui-disabled:hover{transform:scale(1)!important}.layui-slider-tips{position:absolute;top:-42px;z-index:66666666;white-space:nowrap;display:none;-webkit-transform:translateX(-50%);transform:translateX(-50%);color:#FFF;background:#000;border-radius:3px;height:25px;line-height:25px;padding:0 10px}.layui-slider-tips:after{content:"";position:absolute;bottom:-12px;left:50%;margin-left:-6px;width:0;height:0;border-width:6px;border-style:solid;border-color:#000 transparent transparent}.layui-slider-input{width:70px;height:32px;border:1px solid #eee;border-radius:3px;font-size:16px;line-height:32px;position:absolute;right:0;top:-14px}.layui-slider-input-btn{position:absolute;top:0;right:0;width:20px;height:100%;border-left:1px solid #eee}.layui-slider-input-btn i{cursor:pointer;position:absolute;right:0;bottom:0;width:20px;height:50%;font-size:12px;line-height:16px;text-align:center;color:#999}.layui-slider-input-btn i:first-child{top:0;border-bottom:1px solid #eee}.layui-slider-input-txt{height:100%;font-size:14px}.layui-slider-input-txt input{height:100%;border:none}.layui-slider-input-btn i:hover{color:#12bb37}.layui-slider-vertical{width:4px;margin-left:33px}.layui-slider-vertical .layui-slider-bar{width:4px}.layui-slider-vertical .layui-slider-step{top:auto;left:0;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-wrap{top:auto;left:-16px;-webkit-transform:translateY(50%);transform:translateY(50%)}.layui-slider-vertical .layui-slider-tips{top:auto;left:2px}@media \0screen{.layui-slider-wrap-btn{margin-left:-20px}.layui-slider-vertical .layui-slider-wrap-btn{margin-left:0;margin-bottom:-20px}.layui-slider-vertical .layui-slider-tips{margin-left:-8px}.layui-slider>span{margin-left:8px}}.layui-tree{line-height:22px}.layui-tree .layui-form-checkbox{margin:0!important}.layui-tree-set{width:100%;position:relative}.layui-tree-pack{display:none;padding-left:20px;position:relative}.layui-tree-iconClick,.layui-tree-main{display:inline-block;vertical-align:middle}.layui-tree-line .layui-tree-pack{padding-left:27px}.layui-tree-line .layui-tree-set .layui-tree-set:after{content:"";position:absolute;top:14px;left:-9px;width:17px;height:0;border-top:1px dotted #c0c4cc}.layui-tree-entry{position:relative;padding:3px 0;height:20px;white-space:nowrap}.layui-tree-entry:hover{background-color:#eee}.layui-tree-line .layui-tree-entry:hover{background-color:rgba(0,0,0,0)}.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color:#999;text-decoration:underline;transition:.3s}.layui-tree-main{cursor:pointer;padding-right:10px}.layui-tree-line .layui-tree-set:before{content:"";position:absolute;top:0;left:-9px;width:0;height:100%;border-left:1px dotted #c0c4cc}.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height:13px}.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height:0}.layui-tree-iconClick{position:relative;height:20px;line-height:20px;margin:0 10px;color:#c0c4cc}.layui-tree-icon{height:12px;line-height:12px;width:12px;text-align:center;border:1px solid #c0c4cc}.layui-tree-iconClick .layui-icon{font-size:18px}.layui-tree-icon .layui-icon{font-size:12px;color:#666}.layui-tree-iconArrow{padding:0 5px}.layui-tree-iconArrow:after{content:"";position:absolute;left:4px;top:3px;z-index:100;width:0;height:0;border-width:5px;border-style:solid;border-color:transparent transparent transparent #c0c4cc;transition:.5s}.layui-tree-btnGroup,.layui-tree-editInput{position:relative;vertical-align:middle;display:inline-block}.layui-tree-spread>.layui-tree-entry>.layui-tree-iconClick>.layui-tree-iconArrow:after{transform:rotate(90deg) translate(3px,4px)}.layui-tree-txt{display:inline-block;vertical-align:middle;color:#555}.layui-tree-search{margin-bottom:15px;color:#666}.layui-tree-btnGroup .layui-icon{display:inline-block;vertical-align:middle;padding:0 2px;cursor:pointer}.layui-tree-btnGroup .layui-icon:hover{color:#999;transition:.3s}.layui-tree-entry:hover .layui-tree-btnGroup{visibility:visible}.layui-tree-editInput{height:20px;line-height:20px;padding:0 3px;border:none;background-color:rgba(0,0,0,.05)}.layui-tree-emptyText{text-align:center;color:#999}.layui-anim{-webkit-animation-duration:.3s;-webkit-animation-fill-mode:both;animation-duration:.3s;animation-fill-mode:both}.layui-anim.layui-icon{display:inline-block}.layui-anim-loop{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.layui-trans,.layui-trans a{transition:all .2s;-webkit-transition:all .2s}@-webkit-keyframes layui-rotate{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes layui-rotate{from{transform:rotate(0)}to{transform:rotate(360deg)}}.layui-anim-rotate{-webkit-animation-name:layui-rotate;animation-name:layui-rotate;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes layui-up{from{-webkit-transform:translate3d(0,100%,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-up{from{transform:translate3d(0,100%,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-up{-webkit-animation-name:layui-up;animation-name:layui-up}@-webkit-keyframes layui-upbit{from{-webkit-transform:translate3d(0,15px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes layui-upbit{from{transform:translate3d(0,15px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-anim-upbit{-webkit-animation-name:layui-upbit;animation-name:layui-upbit}@keyframes layui-down{0%{opacity:.3;transform:translate3d(0,-100%,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-down{animation-name:layui-down}@keyframes layui-downbit{0%{opacity:.3;transform:translate3d(0,-5px,0)}100%{opacity:1;transform:translate3d(0,0,0)}}.layui-anim-downbit{animation-name:layui-downbit}@-webkit-keyframes layui-scale{0%{opacity:.3;-webkit-transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale{0%{opacity:.3;-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-ms-transform:scale(1);transform:scale(1)}}.layui-anim-scale{-webkit-animation-name:layui-scale;animation-name:layui-scale}@-webkit-keyframes layui-scale-spring{0%{opacity:.5;-webkit-transform:scale(.5)}80%{opacity:.8;-webkit-transform:scale(1.1)}100%{opacity:1;-webkit-transform:scale(1)}}@keyframes layui-scale-spring{0%{opacity:.5;transform:scale(.5)}80%{opacity:.8;transform:scale(1.1)}100%{opacity:1;transform:scale(1)}}.layui-anim-scaleSpring{-webkit-animation-name:layui-scale-spring;animation-name:layui-scale-spring}@keyframes layui-scalesmall{0%{opacity:.3;transform:scale(1.5)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall{animation-name:layui-scalesmall}@keyframes layui-scalesmall-spring{0%{opacity:.3;transform:scale(1.5)}80%{opacity:.8;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}.layui-anim-scalesmall-spring{animation-name:layui-scalesmall-spring}@-webkit-keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}@keyframes layui-fadein{0%{opacity:0}100%{opacity:1}}.layui-anim-fadein{-webkit-animation-name:layui-fadein;animation-name:layui-fadein}@-webkit-keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes layui-fadeout{0%{opacity:1}100%{opacity:0}}.layui-anim-fadeout{-webkit-animation-name:layui-fadeout;animation-name:layui-fadeout} \ No newline at end of file diff --git a/public/static/layui/font/extend/demo_index.html b/public/static/layui/font/extend/demo_index.html index df6a433..95913a3 100644 --- a/public/static/layui/font/extend/demo_index.html +++ b/public/static/layui/font/extend/demo_index.html @@ -47,7 +47,7 @@
            • Symbol
            • - 查看项目 + 查看项目
              @@ -55,243 +55,1347 @@
              • - -
                分销
                -
                &#xe618;
                + +
                学生异动
                +
                &#xe6e9;
              • - -
                订单
                -
                &#xe620;
                + +
                报考
                +
                &#xe6ea;
              • - + +
                成绩
                +
                &#xe6eb;
                +
              • + +
              • + +
                阅卷
                +
                &#xe6ec;
                +
              • + +
              • + +
                考核设置
                +
                &#xe6ed;
                +
              • + +
              • + +
                论文管理
                +
                &#xe6ee;
                +
              • + +
              • + +
                申报
                +
                &#xe6ef;
                +
              • + +
              • +
                课程
                -
                &#xe609;
                +
                &#xe6f0;
                +
              • + +
              • + +
                题库
                +
                &#xe6f1;
                +
              • + +
              • + +
                教务设置
                +
                &#xe6f2;
                +
              • + +
              • + +
                自定义设置
                +
                &#xe6f3;
              • -
                事务中心_进修培训
                +
                超级统计
                &#xe6f4;
              • - -
                商品
                -
                &#xe64f;
                + +
                招生统计
                +
                &#xe6f5;
              • - -
                数据库
                -
                &#xe625;
                + +
                推广统计
                +
                &#xe6f6;
              • - -
                网站
                -
                &#xe652;
                + +
                学习统计
                +
                &#xe6f7;
              • - -
                设计
                -
                &#xe65e;
                + +
                地区数据统计
                +
                &#xe6f8;
              • - -
                运营
                -
                &#xe607;
                + +
                数据导入
                +
                &#xe6f9;
              • - -
                8_4后端开发
                -
                &#xe606;
                + +
                成考管理
                +
                &#xe6fb;
              • - -
                8_3前端开发
                -
                &#xe608;
                + +
                远程管理
                +
                &#xe6fe;
              • - -
                8_5移动开发
                -
                &#xe610;
                + +
                书籍管理
                +
                &#xe6ff;
              • - -
                KHCFDC_产品
                -
                &#xe6c7;
                + +
                过程性考核
                +
                &#xe700;
              • - -
                测试
                -
                &#xe669;
                + +
                学分认定
                +
                &#xe701;
              • - -
                规则
                -
                &#xebb8;
                + +
                课程订单
                +
                &#xe702;
              • - -
                运营中心
                -
                &#xebd0;
                + +
                问题反馈
                +
                &#xe703;
              • - -
                执行反馈
                -
                &#xec35;
                + +
                资产
                +
                &#xe704;
              • - -
                工单确认
                -
                &#xec36;
                + +
                KPI管理
                +
                &#xe705;
              • - -
                工单
                -
                &#xec37;
                + +
                项目管理
                +
                &#xe706;
              • - -
                消息
                -
                &#xec3b;
                + +
                微信公众号
                +
                &#xe707;
              • - -
                iframe添加
                -
                &#xec7d;
                + +
                安全设置
                +
                &#xe708;
              • - -
                基础管理
                -
                &#xeb64;
                + +
                服务中心
                +
                &#xe709;
              • - -
                测试申请
                -
                &#xeb61;
                + +
                企业服务
                +
                &#xe70a;
              • - -
                配网引导
                -
                &#xeb66;
                + +
                网课服务
                +
                &#xe70b;
              • - -
                人机交互
                -
                &#xeb68;
                + +
                收费管理
                +
                &#xe70c;
              • - -
                数据看板
                -
                &#xeb69;
                + +
                权限设置
                +
                &#xe70d;
              • - -
                icon_账号
                -
                &#xeb8a;
                + +
                教务统计
                +
                &#xe70f;
              • - -
                物模型
                -
                &#xec33;
                + +
                教学统计
                +
                &#xe710;
              • - -
                待办事项
                -
                &#xec4e;
                + +
                收费统计
                +
                &#xe711;
              • - -
                流计算
                -
                &#xec56;
                + +
                服务统计
                +
                &#xe713;
              • - -
                折线图
                -
                &#xec66;
                + +
                通知统计
                +
                &#xe714;
              • - -
                合作伙伴密钥管理
                -
                &#xeb63;
                + +
                考核统计
                +
                &#xe715;
              • - -
                权限审批
                -
                &#xeb65;
                + +
                用户活跃度
                +
                &#xe716;
              • - + +
                学生报名
                +
                &#xe717;
                +
              • + +
              • + +
                学生录取
                +
                &#xe718;
                +
              • + +
              • + +
                学生注册
                +
                &#xe719;
                +
              • + +
              • + +
                在籍学生
                +
                &#xe71a;
                +
              • + +
              • + +
                花名册
                +
                &#xe71b;
                +
              • + +
              • + +
                服务分类管理
                +
                &#xe71c;
                +
              • + +
              • + +
                学生服务列表
                +
                &#xe71d;
                +
              • + +
              • + +
                通知分类管理
                +
                &#xe71e;
                +
              • + +
              • + +
                通知列表
                +
                &#xe71f;
                +
              • + +
              • + +
                教学计划
                +
                &#xe720;
                +
              • + +
              • + +
                教学安排
                +
                &#xe721;
                +
              • + +
              • + +
                成绩管理
                +
                &#xe722;
                +
              • + +
              • + +
                图片管理
                +
                &#xe723;
                +
              • + +
              • + +
                考试计划
                +
                &#xe724;
                +
              • + +
              • + +
                考试配置
                +
                &#xe725;
                +
              • + +
              • + +
                学习中心管理
                +
                &#xe726;
                +
              • + +
              • + +
                考核管理
                +
                &#xe728;
                +
              • + +
              • + +
                教师管理
                +
                &#xe729;
                +
              • + +
              • + +
                网课管理
                +
                &#xe72a;
                +
              • + +
              • + +
                补录结算
                +
                &#xe72b;
                +
              • + +
              • + +
                毕业管理
                +
                &#xe72c;
                +
              • + +
              • + +
                考核指标
                +
                &#xe72d;
                +
              • + +
              • + +
                企业管理
                +
                &#xe77e;
                +
              • + +
              • + +
                初步管理
                +
                &#xe77f;
                +
              • + +
              • + +
                呼叫报表
                +
                &#xe780;
                +
              • + +
              • + +
                扫描电镜
                +
                &#xe781;
                +
              • + +
              • + +
                结账
                +
                &#xe782;
                +
              • + +
              • + +
                销售报表
                +
                &#xe783;
                +
              • + +
              • + +
                凭证
                +
                &#xe784;
                +
              • + +
              • + +
                合同异动
                +
                &#xe785;
                +
              • + +
              • + +
                销售品
                +
                &#xe787;
                +
              • + +
              • + +
                学术管理
                +
                &#xe788;
                +
              • + +
              • + +
                易耗品
                +
                &#xe789;
                +
              • + +
              • + +
                任务管理
                +
                &#xe78a;
                +
              • + +
              • + +
                电商
                +
                &#xe78b;
                +
              • + +
              • + +
                名片报表
                +
                &#xe78c;
                +
              • + +
              • + +
                固定资产
                +
                &#xe78d;
                +
              • + +
              • + +
                动态管理
                +
                &#xe78e;
                +
              • + +
              • + +
                基础配置
                +
                &#xe78f;
                +
              • + +
              • + +
                呼叫统计
                +
                &#xe790;
                +
              • + +
              • + +
                销售报表
                +
                &#xe791;
                +
              • + +
              • + +
                大数据
                +
                &#xe792;
                +
              • + +
              • + +
                活动管理
                +
                &#xe793;
                +
              • + +
              • + +
                呼叫设置
                +
                &#xe794;
                +
              • + +
              • + +
                分销市场
                +
                &#xe795;
                +
              • + +
              • + +
                成绩统计
                +
                &#xe796;
                +
              • + +
              • + +
                推广设置
                +
                &#xe797;
                +
              • + +
              • + +
                课程中心
                +
                &#xe798;
                +
              • + +
              • + +
                合同设置
                +
                &#xe799;
                +
              • + +
              • + +
                课程包管理
                +
                &#xe79a;
                +
              • + +
              • + +
                用户管理
                +
                &#xe79b;
                +
              • + +
              • + +
                用户画像
                +
                &#xe79c;
                +
              • + +
              • + +
                帐号管理
                +
                &#xe79d;
                +
              • + +
              • + +
                SEM管理
                +
                &#xe79e;
                +
              • + +
              • + +
                预算
                +
                &#xe79f;
                +
              • + +
              • + +
                名片报表
                +
                &#xe7a0;
                +
              • + +
              • + +
                订单管理
                +
                &#xe7a1;
                +
              • + +
              • + +
                推广管理
                +
                &#xe7a2;
                +
              • + +
              • + +
                专题管理
                +
                &#xe7a3;
                +
              • + +
              • + +
                信息流
                +
                &#xe7a4;
                +
              • + +
              • + +
                销售设置
                +
                &#xe7a5;
                +
              • + +
              • + +
                素材管理
                +
                &#xe7a9;
                +
              • + +
              • + +
                学生导入
                +
                &#xe7aa;
                +
              • + +
              • + +
                商品管理
                +
                &#xe7ab;
                +
              • + +
              • + +
                排课管理
                +
                &#xe7ac;
                +
              • + +
              • + +
                信息导入
                +
                &#xe7ad;
                +
              • + +
              • + +
                收费配置
                +
                &#xe7ae;
                +
              • + +
              • + +
                用户权限
                +
                &#xe7af;
                +
              • + +
              • + +
                在籍学生管理
                +
                &#xe7b0;
                +
              • + +
              • + +
                学号管理
                +
                &#xe7b1;
                +
              • + +
              • + +
                课程资源管理
                +
                &#xe7b2;
                +
              • + +
              • + +
                面授教学安排
                +
                &#xe7b3;
                +
              • + +
              • + +
                账房
                +
                &#xe7b4;
                +
              • + +
              • + +
                开课管理
                +
                &#xe7b5;
                +
              • + +
              • + +
                毕业统计
                +
                &#xe7b6;
                +
              • + +
              • + +
                招生准备
                +
                &#xe7b8;
                +
              • + +
              • + +
                排课设置
                +
                &#xe7b9;
                +
              • + +
              • + +
                班级管理
                +
                &#xe7ba;
                +
              • + +
              • + +
                精品课堂
                +
                &#xe7bb;
                +
              • + +
              • + +
                员工提点
                +
                &#xe7bc;
                +
              • + +
              • + +
                考试安排
                +
                &#xe7bd;
                +
              • + +
              • + +
                网络教学安排
                +
                &#xe7bf;
                +
              • + +
              • + +
                入学成绩
                +
                &#xe7c3;
                +
              • + +
              • + +
                面授教学
                +
                &#xe7c6;
                +
              • + +
              • + +
                教师教室管理
                +
                &#xe7c7;
                +
              • + +
              • + +
                录取管理
                +
                &#xe7c8;
                +
              • + +
              • + +
                录取成绩
                +
                &#xe7c9;
                +
              • + +
              • + +
                资源
                +
                &#xe7ca;
                +
              • + +
              • + +
                课件
                +
                &#xe7cc;
                +
              • + +
              • + +
                外部课件
                +
                &#xe7cd;
                +
              • + +
              • + +
                日志管理
                +
                &#xe7ce;
                +
              • + +
              • + +
                模版管理
                +
                &#xe7cf;
                +
              • + +
              • + +
                学历认证
                +
                &#xe7d1;
                +
              • + +
              • + +
                异议处理
                +
                &#xe7d2;
                +
              • + +
              • + +
                论文申报
                +
                &#xe7d3;
                +
              • + +
              • + +
                论文设置
                +
                &#xe7d4;
                +
              • + +
              • + +
                教学点设置
                +
                &#xe7d5;
                +
              • + +
              • + +
                补录沉降
                +
                &#xe7d6;
                +
              • + +
              • + +
                模块设置
                +
                &#xe7d7;
                +
              • + +
              • + +
                资料管理
                +
                &#xe7d8;
                +
              • + +
              • + +
                集团管理
                +
                &#xe7d9;
                +
              • + +
              • +
                应用管理
                -
                &#xeb67;
                +
                &#xe7da;
              • - -
                icon_设置
                -
                &#xeb8d;
                + +
                官网试卷
                +
                &#xe7db;
              • - -
                设备管理
                -
                &#xebb7;
                + +
                我的网课
                +
                &#xe7dc;
              • - -
                组织群组
                -
                &#xebd8;
                + +
                脚本管理
                +
                &#xe7dd;
              • - -
                未知格式
                -
                &#xec1a;
                + +
                专业管理员
                +
                &#xe7de;
              • - -
                储存
                -
                &#xec5e;
                + +
                学生成绩
                +
                &#xe7df;
              • - -
                get
                -
                &#xec64;
                + +
                服务管理
                +
                &#xe7e2;
                +
              • + +
              • + +
                代金券
                +
                &#xe7e3;
                +
              • + +
              • + +
                呼叫中心
                +
                &#xe7e4;
                +
              • + +
              • + +
                引进收费
                +
                &#xe7e5;
                +
              • + +
              • + +
                应缴清单
                +
                &#xe7e6;
                +
              • + +
              • + +
                对账单
                +
                &#xe7e7;
                +
              • + +
              • + +
                商机管理
                +
                &#xe7e8;
                +
              • + +
              • + +
                企微会话存档
                +
                &#xe7e9;
                +
              • + +
              • + +
                用户设置
                +
                &#xe7ea;
                +
              • + +
              • + +
                消息设置
                +
                &#xe7ec;
                +
              • + +
              • + +
                营销设置
                +
                &#xe7ed;
                +
              • + +
              • + +
                服务市场
                +
                &#xe7ee;
                +
              • + +
              • + +
                素材资源
                +
                &#xe7ef;
                +
              • + +
              • + +
                营销玩法
                +
                &#xe7f0;
                +
              • + +
              • + +
                推广
                +
                &#xe7f1;
                +
              • + +
              • + +
                用户列表
                +
                &#xe7f2;
                +
              • + +
              • + +
                资源管理
                +
                &#xe692;
                +
              • + +
              • + +
                课程管理
                +
                &#xe693;
                +
              • + +
              • + +
                课程包
                +
                &#xe694;
                +
              • + +
              • + +
                题库管理
                +
                &#xe695;
                +
              • + +
              • + +
                网课市场
                +
                &#xe696;
                +
              • + +
              • + +
                工单
                +
                &#xe697;
                +
              • + +
              • + +
                访客管理
                +
                &#xe698;
                +
              • + +
              • + +
                线索管理
                +
                &#xe699;
                +
              • + +
              • + +
                客户管理
                +
                &#xe69a;
                +
              • + +
              • + +
                集团客户
                +
                &#xe69b;
                +
              • + +
              • + +
                跟进记录
                +
                &#xe69c;
                +
              • + +
              • + +
                呼叫管理
                +
                &#xe69d;
                +
              • + +
              • + +
                工作台
                +
                &#xe69e;
                +
              • + +
              • + +
                数据报表
                +
                &#xe69f;
                +
              • + +
              • + +
                访客报表
                +
                &#xe6a0;
                +
              • + +
              • + +
                账簿管理
                +
                &#xe6a1;
                +
              • + +
              • + +
                账簿管理_子系统
                +
                &#xe6a2;
                +
              • + +
              • + +
                账簿管理_子系统
                +
                &#xe6a3;
                +
              • + +
              • + +
                合同管理
                +
                &#xe6a4;
                +
              • + +
              • + +
                运营者管理
                +
                &#xe6a5;
                +
              • + +
              • + +
                招聘管理
                +
                &#xe6a6;
                +
              • + +
              • + +
                工资管理
                +
                &#xe6a7;
                +
              • + +
              • + +
                我的审批
                +
                &#xe6a8;
                +
              • + +
              • + +
                标准模版设置
                +
                &#xe6a9;
                +
              • + +
              • + +
                基础设置
                +
                &#xe6aa;
                +
              • + +
              • + +
                财务设置
                +
                &#xe6ab;
                +
              • + +
              • + +
                产品设置
                +
                &#xe6ac;
                +
              • + +
              • + +
                审批设置
                +
                &#xe6ad;
                +
              • + +
              • + +
                目标管理
                +
                &#xe6ae;
                +
              • + +
              • + +
                站点设置
                +
                &#xe6af;
                +
              • + +
              • + +
                人事设置
                +
                &#xe6b0;
                +
              • + +
              • + +
                CRM设置
                +
                &#xe6b1;
                +
              • + +
              • + +
                名片设置
                +
                &#xe6b2;
                +
              • + +
              • + +
                网校设置
                +
                &#xe6b3;
                +
              • + +
              • + +
                我的点评
                +
                &#xe6b4;
                +
              • + +
              • + +
                我的学生
                +
                &#xe6b5;
                +
              • + +
              • + +
                联系记录
                +
                &#xe6b8;
                +
              • + +
              • + +
                投诉提问
                +
                &#xe6b9;
                +
              • + +
              • + +
                培训计划
                +
                &#xe6ba;
                +
              • + +
              • + +
                费用查询
                +
                &#xe6bb;
                +
              • + +
              • + +
                学生缴费
                +
                &#xe6bc;
                +
              • + +
              • + +
                记账
                +
                &#xe6bd;
                +
              • + +
              • + +
                查账
                +
                &#xe6be;
                +
              • + +
              • + +
                查账
                +
                &#xe6bf;
                +
              • + +
              • + +
                报表
                +
                &#xe6c0;
                +
              • + +
              • + +
                设置
                +
                &#xe6c2;
                +
              • + +
              • + +
                招生报表
                +
                &#xe6ce;
                +
              • + +
              • + +
                打卡记录
                +
                &#xe6d3;
                +
              • + +
              • + +
                网络班级
                +
                &#xe6d6;
                +
              • + +
              • + +
                小程序
                +
                &#xe6d8;
                +
              • + +
              • + +
                后台设置
                +
                &#xe6db;
                +
              • + +
              • + +
                招生设置
                +
                &#xe6df;
                +
              • + +
              • + +
                消息中心
                +
                &#xe6e1;
                +
              • + +
              • + +
                菜单管理
                +
                &#xe6e2;
                +
              • + +
              • + +
                集团设置
                +
                &#xe6e3;
                +
              • + +
              • + +
                市场管理
                +
                &#xe6e4;
                +
              • + +
              • + +
                创建系统
                +
                &#xe6e5;
                +
              • + +
              • + +
                工单管理
                +
                &#xe6e6;
                +
              • + +
              • + +
                短信
                +
                &#xe6e7;
                +
              • + +
              • + +
                帮助中心
                +
                &#xe6e8;
              @@ -312,9 +1416,9 @@
              @font-face {
                 font-family: 'iconfont';
              -  src: url('iconfont.woff2?t=1626055526638') format('woff2'),
              -       url('iconfont.woff?t=1626055526638') format('woff'),
              -       url('iconfont.ttf?t=1626055526638') format('truetype');
              +  src: url('iconfont.woff2?t=1640935732189') format('woff2'),
              +       url('iconfont.woff?t=1640935732189') format('woff'),
              +       url('iconfont.ttf?t=1640935732189') format('truetype');
               }
               

              第二步:定义使用 iconfont 的样式

              @@ -341,20 +1445,65 @@
              • - +
                - 分销 + 学生异动
                -
                .icon-fenxiao +
                .icon-xueshengyidong
              • - +
                - 订单 + 报考
                -
                .icon-dingdan +
                .icon-baokao +
                +
              • + +
              • + +
                + 成绩 +
                +
                .icon-chengji +
                +
              • + +
              • + +
                + 阅卷 +
                +
                .icon-yuejuan +
                +
              • + +
              • + +
                + 考核设置 +
                +
                .icon-kaoheshezhi +
                +
              • + +
              • + +
                + 论文管理 +
                +
                .icon-lunwenguanli +
                +
              • + +
              • + +
                + 申报 +
                +
                .icon-shenbao
              • @@ -368,272 +1517,1208 @@
              • - +
                - 事务中心_进修培训 + 题库
                -
                .icon-banji +
                .icon-tiku
              • - +
                - 商品 + 教务设置
                -
                .icon-shangpin +
                .icon-jiaowushezhi
              • - +
                - 数据库 + 自定义设置
                -
                .icon-shuju +
                .icon-zidingyishezhi
              • - +
                - 网站 + 超级统计
                -
                .icon-wangzhan +
                .icon-chaojitongji
              • - +
                - 设计 + 招生统计
                -
                .icon-sheji +
                .icon-zhaoshengtongji
              • - +
                - 运营 + 推广统计
                -
                .icon-yunying +
                .icon-tuiguangtongji
              • - +
                - 8_4后端开发 + 学习统计
                -
                .icon-houduankaifa +
                .icon-xuexitongji
              • - +
                - 8_3前端开发 + 地区数据统计
                -
                .icon-qianduankaifa +
                .icon-diqushujutongji
              • - +
                - 8_5移动开发 + 数据导入
                -
                .icon-yidongkaifa +
                .icon-shujudaoru
              • - +
                - KHCFDC_产品 + 成考管理
                -
                .icon-chanpin +
                .icon-chengkaoguanli
              • - +
                - 测试 + 远程管理
                -
                .icon-ceshi +
                .icon-yuanchengguanli
              • - +
                - 规则 + 书籍管理
                -
                .icon-guize +
                .icon-shujiguanli
              • - +
                - 运营中心 + 过程性考核
                -
                .icon-yunyingzhongxin +
                .icon-guochengxingkaohe
              • - +
                - 执行反馈 + 学分认定
                -
                .icon-zhihangfankui +
                .icon-xuefenrending
              • - +
                - 工单确认 + 课程订单
                -
                .icon-gongdanqueren +
                .icon-kechengdingdan
              • - +
                - 工单 + 问题反馈
                -
                .icon-gongdan +
                .icon-wentifankui
              • - +
                - 消息 + 资产
                -
                .icon-xiaoxi +
                .icon-zichan
              • - +
                - iframe添加 + KPI管理
                -
                .icon-iframetianjia +
                .icon-KPIguanli
              • - +
                - 基础管理 + 项目管理
                -
                .icon-jichuguanli +
                .icon-xiangmuguanli
              • - +
                - 测试申请 + 微信公众号
                -
                .icon-ceshishenqing +
                .icon-weixingongzhonghao
              • - +
                - 配网引导 + 安全设置
                -
                .icon-peiwangyindao +
                .icon-anquanshezhi
              • - +
                - 人机交互 + 服务中心
                -
                .icon-renjijiaohu +
                .icon-fuwuzhongxin
              • - +
                - 数据看板 + 企业服务
                -
                .icon-shujukanban +
                .icon-qiyefuwu
              • - +
                - icon_账号 + 网课服务
                -
                .icon-icon_zhanghao +
                .icon-wangkefuwu
              • - +
                - 物模型 + 收费管理
                -
                .icon-wumoxing +
                .icon-shoufeiguanli
              • - +
                - 待办事项 + 权限设置
                -
                .icon-daibanshixiang +
                .icon-quanxianshezhi
              • - +
                - 流计算 + 教务统计
                -
                .icon-liujisuan +
                .icon-jiaowutongji
              • - +
                - 折线图 + 教学统计
                -
                .icon-zhexiantu +
                .icon-jiaoxuetongji
              • - +
                - 合作伙伴密钥管理 + 收费统计
                -
                .icon-hezuohuobanmiyueguanli +
                .icon-shoufeitongji
              • - +
                - 权限审批 + 服务统计
                -
                .icon-quanxianshenpi +
                .icon-fuwutongji +
                +
              • + +
              • + +
                + 通知统计 +
                +
                .icon-tongzhitongji +
                +
              • + +
              • + +
                + 考核统计 +
                +
                .icon-kaohetongji +
                +
              • + +
              • + +
                + 用户活跃度 +
                +
                .icon-yonghuhuoyuedu +
                +
              • + +
              • + +
                + 学生报名 +
                +
                .icon-xueshengbaoming +
                +
              • + +
              • + +
                + 学生录取 +
                +
                .icon-xueshengluqu +
                +
              • + +
              • + +
                + 学生注册 +
                +
                .icon-xueshengzhuce +
                +
              • + +
              • + +
                + 在籍学生 +
                +
                .icon-zaijixuesheng +
                +
              • + +
              • + +
                + 花名册 +
                +
                .icon-huamingce +
                +
              • + +
              • + +
                + 服务分类管理 +
                +
                .icon-fenleiguanli +
                +
              • + +
              • + +
                + 学生服务列表 +
                +
                .icon-fuwuliebiao +
                +
              • + +
              • + +
                + 通知分类管理 +
                +
                .icon-fenleiliebiao +
                +
              • + +
              • + +
                + 通知列表 +
                +
                .icon-tongzhiliebiao +
                +
              • + +
              • + +
                + 教学计划 +
                +
                .icon-jiaoxuejihua +
                +
              • + +
              • + +
                + 教学安排 +
                +
                .icon-jiaoxueanpai +
                +
              • + +
              • + +
                + 成绩管理 +
                +
                .icon-chengjiguanli +
                +
              • + +
              • + +
                + 图片管理 +
                +
                .icon-tupianguanli +
                +
              • + +
              • + +
                + 考试计划 +
                +
                .icon-kaoshijihua +
                +
              • + +
              • + +
                + 考试配置 +
                +
                .icon-kaoshipeizhi +
                +
              • + +
              • + +
                + 学习中心管理 +
                +
                .icon-xuexizhongxinguanli +
                +
              • + +
              • + +
                + 考核管理 +
                +
                .icon-kaoheguanli +
                +
              • + +
              • + +
                + 教师管理 +
                +
                .icon-jiaoshiguanli +
                +
              • + +
              • + +
                + 网课管理 +
                +
                .icon-wangkeguanli +
                +
              • + +
              • + +
                + 补录结算 +
                +
                .icon-bulujiesuan +
                +
              • + +
              • + +
                + 毕业管理 +
                +
                .icon-biyeguanli +
                +
              • + +
              • + +
                + 考核指标 +
                +
                .icon-kaohezhibiao +
                +
              • + +
              • + +
                + 企业管理 +
                +
                .icon-qiyeguanli +
                +
              • + +
              • + +
                + 初步管理 +
                +
                .icon-chubuguanli +
                +
              • + +
              • + +
                + 呼叫报表 +
                +
                .icon-hujiaobaobiao +
                +
              • + +
              • + +
                + 扫描电镜 +
                +
                .icon-saomiaodianjing +
                +
              • + +
              • + +
                + 结账 +
                +
                .icon-jiezhang +
                +
              • + +
              • + +
                + 销售报表 +
                +
                .icon-xiaoshoubaobiao +
                +
              • + +
              • + +
                + 凭证 +
                +
                .icon-pingzheng +
                +
              • + +
              • + +
                + 合同异动 +
                +
                .icon-hetongyidong +
                +
              • + +
              • + +
                + 销售品 +
                +
                .icon-xiaoshoupin +
                +
              • + +
              • + +
                + 学术管理 +
                +
                .icon-xueshuguanli +
                +
              • + +
              • + +
                + 易耗品 +
                +
                .icon-yihaopin +
                +
              • + +
              • + +
                + 任务管理 +
                +
                .icon-renwuguanli +
                +
              • + +
              • + +
                + 电商 +
                +
                .icon-dianshang +
                +
              • + +
              • + +
                + 名片报表 +
                +
                .icon-mingpianbaobiao_1 +
                +
              • + +
              • + +
                + 固定资产 +
                +
                .icon-gudingzichan +
                +
              • + +
              • + +
                + 动态管理 +
                +
                .icon-dongtaiguanli +
                +
              • + +
              • + +
                + 基础配置 +
                +
                .icon-jichupeizhi +
                +
              • + +
              • + +
                + 呼叫统计 +
                +
                .icon-hujiaotongji +
                +
              • + +
              • + +
                + 销售报表 +
                +
                .icon-xiaoshoubaobiao_1 +
                +
              • + +
              • + +
                + 大数据 +
                +
                .icon-dashuju +
                +
              • + +
              • + +
                + 活动管理 +
                +
                .icon-huodongguanli +
                +
              • + +
              • + +
                + 呼叫设置 +
                +
                .icon-hujiaoshezhi +
                +
              • + +
              • + +
                + 分销市场 +
                +
                .icon-fenxiaoshichang +
                +
              • + +
              • + +
                + 成绩统计 +
                +
                .icon-chengjitongji +
                +
              • + +
              • + +
                + 推广设置 +
                +
                .icon-tuiguangshezhi +
                +
              • + +
              • + +
                + 课程中心 +
                +
                .icon-kechengzhongxin +
                +
              • + +
              • + +
                + 合同设置 +
                +
                .icon-hetongshezhi +
                +
              • + +
              • + +
                + 课程包管理 +
                +
                .icon-kechengbaoguanli +
                +
              • + +
              • + +
                + 用户管理 +
                +
                .icon-yonghuguanli +
                +
              • + +
              • + +
                + 用户画像 +
                +
                .icon-yonghuhuaxiang +
                +
              • + +
              • + +
                + 帐号管理 +
                +
                .icon-zhanghaoguanli +
                +
              • + +
              • + +
                + SEM管理 +
                +
                .icon-SEMguanli +
                +
              • + +
              • + +
                + 预算 +
                +
                .icon-yusuan +
                +
              • + +
              • + +
                + 名片报表 +
                +
                .icon-mingpianbaobiao +
                +
              • + +
              • + +
                + 订单管理 +
                +
                .icon-dingdanguanli +
                +
              • + +
              • + +
                + 推广管理 +
                +
                .icon-tuiguangguanli +
                +
              • + +
              • + +
                + 专题管理 +
                +
                .icon-zhuantiguanli +
                +
              • + +
              • + +
                + 信息流 +
                +
                .icon-xinxiliu +
                +
              • + +
              • + +
                + 销售设置 +
                +
                .icon-xiaoshoushezhi +
                +
              • + +
              • + +
                + 素材管理 +
                +
                .icon-sucaiguanli +
                +
              • + +
              • + +
                + 学生导入 +
                +
                .icon-xueshengdaoru +
                +
              • + +
              • + +
                + 商品管理 +
                +
                .icon-shangpinguanli +
                +
              • + +
              • + +
                + 排课管理 +
                +
                .icon-paikeguanli +
                +
              • + +
              • + +
                + 信息导入 +
                +
                .icon-xinxidaoru +
                +
              • + +
              • + +
                + 收费配置 +
                +
                .icon-shoufeipeizhi +
                +
              • + +
              • + +
                + 用户权限 +
                +
                .icon-yonghuquanxian +
                +
              • + +
              • + +
                + 在籍学生管理 +
                +
                .icon-zaijixueshengguanli +
                +
              • + +
              • + +
                + 学号管理 +
                +
                .icon-xuehaoguanli +
                +
              • + +
              • + +
                + 课程资源管理 +
                +
                .icon-kechengziyuanguanli +
                +
              • + +
              • + +
                + 面授教学安排 +
                +
                .icon-mianshoujiaoxueanpai +
                +
              • + +
              • + +
                + 账房 +
                +
                .icon-zhangfang +
                +
              • + +
              • + +
                + 开课管理 +
                +
                .icon-kaikeguanli +
                +
              • + +
              • + +
                + 毕业统计 +
                +
                .icon-biyetongji +
                +
              • + +
              • + +
                + 招生准备 +
                +
                .icon-zhaoshengzhunbei +
                +
              • + +
              • + +
                + 排课设置 +
                +
                .icon-paikeshezhi +
                +
              • + +
              • + +
                + 班级管理 +
                +
                .icon-banjiguanli +
                +
              • + +
              • + +
                + 精品课堂 +
                +
                .icon-jingpinketang +
                +
              • + +
              • + +
                + 员工提点 +
                +
                .icon-yuangongtidian +
                +
              • + +
              • + +
                + 考试安排 +
                +
                .icon-kaoshianpai +
                +
              • + +
              • + +
                + 网络教学安排 +
                +
                .icon-wangluojiaoxueanpai +
                +
              • + +
              • + +
                + 入学成绩 +
                +
                .icon-ruxuechengji +
                +
              • + +
              • + +
                + 面授教学 +
                +
                .icon-mianshoujiaoxue +
                +
              • + +
              • + +
                + 教师教室管理 +
                +
                .icon-jiaoshijiaoshiguanli +
                +
              • + +
              • + +
                + 录取管理 +
                +
                .icon-luquguanli +
                +
              • + +
              • + +
                + 录取成绩 +
                +
                .icon-luquchengji +
                +
              • + +
              • + +
                + 资源 +
                +
                .icon-ziyuan +
                +
              • + +
              • + +
                + 课件 +
                +
                .icon-kejian +
                +
              • + +
              • + +
                + 外部课件 +
                +
                .icon-waibukejian +
                +
              • + +
              • + +
                + 日志管理 +
                +
                .icon-rizhiguanli +
                +
              • + +
              • + +
                + 模版管理 +
                +
                .icon-mobanguanli +
                +
              • + +
              • + +
                + 学历认证 +
                +
                .icon-xuelirenzheng +
                +
              • + +
              • + +
                + 异议处理 +
                +
                .icon-yiyichuli +
                +
              • + +
              • + +
                + 论文申报 +
                +
                .icon-lunwenshenbao +
                +
              • + +
              • + +
                + 论文设置 +
                +
                .icon-lunwenshezhi +
                +
              • + +
              • + +
                + 教学点设置 +
                +
                .icon-jiaoxuedianshezhi +
                +
              • + +
              • + +
                + 补录沉降 +
                +
                .icon-buluchenjiang +
                +
              • + +
              • + +
                + 模块设置 +
                +
                .icon-mokuaishezhi +
                +
              • + +
              • + +
                + 资料管理 +
                +
                .icon-ziliaoguanli +
                +
              • + +
              • + +
                + 集团管理 +
                +
                .icon-jituanguanli
              • @@ -647,56 +2732,731 @@
              • - +
                - icon_设置 + 官网试卷
                -
                .icon-icon_shezhi +
                .icon-guanwangshijuan
              • - +
                - 设备管理 + 我的网课
                -
                .icon-shebeiguanli +
                .icon-wodewangke
              • - +
                - 组织群组 + 脚本管理
                -
                .icon-zuzhiqunzu +
                .icon-jiaobenguanli
              • - +
                - 未知格式 + 专业管理员
                -
                .icon-weizhigeshi +
                .icon-zhuanyeguanliyuan
              • - +
                - 储存 + 学生成绩
                -
                .icon-chucun +
                .icon-xueshengchengji
              • - +
                - get + 服务管理
                -
                .icon-get +
                .icon-fuwuguanli +
                +
              • + +
              • + +
                + 代金券 +
                +
                .icon-daijinquan +
                +
              • + +
              • + +
                + 呼叫中心 +
                +
                .icon-hujiaozhongxin +
                +
              • + +
              • + +
                + 引进收费 +
                +
                .icon-yinjinshoufei +
                +
              • + +
              • + +
                + 应缴清单 +
                +
                .icon-yingjiaoqingdan +
                +
              • + +
              • + +
                + 对账单 +
                +
                .icon-duizhangdan +
                +
              • + +
              • + +
                + 商机管理 +
                +
                .icon-shangjiguanli +
                +
              • + +
              • + +
                + 企微会话存档 +
                +
                .icon-qiyehuihuacundang +
                +
              • + +
              • + +
                + 用户设置 +
                +
                .icon-yonghushezhi +
                +
              • + +
              • + +
                + 消息设置 +
                +
                .icon-xiaoxishezhi +
                +
              • + +
              • + +
                + 营销设置 +
                +
                .icon-yingxiaoshezhi +
                +
              • + +
              • + +
                + 服务市场 +
                +
                .icon-fuwushichang +
                +
              • + +
              • + +
                + 素材资源 +
                +
                .icon-sucaiziyuan +
                +
              • + +
              • + +
                + 营销玩法 +
                +
                .icon-yingxiaowanfa +
                +
              • + +
              • + +
                + 推广 +
                +
                .icon-tuiguang +
                +
              • + +
              • + +
                + 用户列表 +
                +
                .icon-yonghuliebiao +
                +
              • + +
              • + +
                + 资源管理 +
                +
                .icon-ziyuanguanli +
                +
              • + +
              • + +
                + 课程管理 +
                +
                .icon-kechengguanli +
                +
              • + +
              • + +
                + 课程包 +
                +
                .icon-kechengbao +
                +
              • + +
              • + +
                + 题库管理 +
                +
                .icon-tikuguanli +
                +
              • + +
              • + +
                + 网课市场 +
                +
                .icon-wangkeshichang +
                +
              • + +
              • + +
                + 工单 +
                +
                .icon-gongdan +
                +
              • + +
              • + +
                + 访客管理 +
                +
                .icon-fangkeguanli +
                +
              • + +
              • + +
                + 线索管理 +
                +
                .icon-xiansuoguanli +
                +
              • + +
              • + +
                + 客户管理 +
                +
                .icon-kehuguanli +
                +
              • + +
              • + +
                + 集团客户 +
                +
                .icon-jituankehu +
                +
              • + +
              • + +
                + 跟进记录 +
                +
                .icon-genjinjilu +
                +
              • + +
              • + +
                + 呼叫管理 +
                +
                .icon-hujiaoguanli +
                +
              • + +
              • + +
                + 工作台 +
                +
                .icon-gongzuotai +
                +
              • + +
              • + +
                + 数据报表 +
                +
                .icon-shujubaobiao +
                +
              • + +
              • + +
                + 访客报表 +
                +
                .icon-fangkebaobiao +
                +
              • + +
              • + +
                + 账簿管理 +
                +
                .icon-zhangbuguanli +
                +
              • + +
              • + +
                + 账簿管理_子系统 +
                +
                .icon-zhangbuguanli_zi +
                +
              • + +
              • + +
                + 账簿管理_子系统 +
                +
                .icon-zhangbuguanli_zixitong_A +
                +
              • + +
              • + +
                + 合同管理 +
                +
                .icon-hetongguanli +
                +
              • + +
              • + +
                + 运营者管理 +
                +
                .icon-yunyingzheguanli +
                +
              • + +
              • + +
                + 招聘管理 +
                +
                .icon-zhaopinguanli +
                +
              • + +
              • + +
                + 工资管理 +
                +
                .icon-gongziguanli +
                +
              • + +
              • + +
                + 我的审批 +
                +
                .icon-wodeshenpi +
                +
              • + +
              • + +
                + 标准模版设置 +
                +
                .icon-biaozhunmobanshezhi +
                +
              • + +
              • + +
                + 基础设置 +
                +
                .icon-jichushezhi +
                +
              • + +
              • + +
                + 财务设置 +
                +
                .icon-caiwushezhi +
                +
              • + +
              • + +
                + 产品设置 +
                +
                .icon-chanpinshezhi +
                +
              • + +
              • + +
                + 审批设置 +
                +
                .icon-shenpishezhi +
                +
              • + +
              • + +
                + 目标管理 +
                +
                .icon-mubiaoguanli +
                +
              • + +
              • + +
                + 站点设置 +
                +
                .icon-zhandianshezhi +
                +
              • + +
              • + +
                + 人事设置 +
                +
                .icon-renshishezhi +
                +
              • + +
              • + +
                + CRM设置 +
                +
                .icon-CRMshezhi +
                +
              • + +
              • + +
                + 名片设置 +
                +
                .icon-mingpianshezhi +
                +
              • + +
              • + +
                + 网校设置 +
                +
                .icon-wangxiaoshezhi +
                +
              • + +
              • + +
                + 我的点评 +
                +
                .icon-wodedianping +
                +
              • + +
              • + +
                + 我的学生 +
                +
                .icon-wodexuesheng +
                +
              • + +
              • + +
                + 联系记录 +
                +
                .icon-lianxijilu +
                +
              • + +
              • + +
                + 投诉提问 +
                +
                .icon-tousutiwen +
                +
              • + +
              • + +
                + 培训计划 +
                +
                .icon-peixunjihua +
                +
              • + +
              • + +
                + 费用查询 +
                +
                .icon-feiyongchaxun +
                +
              • + +
              • + +
                + 学生缴费 +
                +
                .icon-xueshengjiaofei +
                +
              • + +
              • + +
                + 记账 +
                +
                .icon-jizhang +
                +
              • + +
              • + +
                + 查账 +
                +
                .icon-chaxun +
                +
              • + +
              • + +
                + 查账 +
                +
                .icon-chazhang +
                +
              • + +
              • + +
                + 报表 +
                +
                .icon-baobiao +
                +
              • + +
              • + +
                + 设置 +
                +
                .icon-shezhi +
                +
              • + +
              • + +
                + 招生报表 +
                +
                .icon-daqiajilu +
                +
              • + +
              • + +
                + 打卡记录 +
                +
                .icon-wangluobanji +
                +
              • + +
              • + +
                + 网络班级 +
                +
                .icon-wangxiaoshezhi1 +
                +
              • + +
              • + +
                + 小程序 +
                +
                .icon-houtaishezhi +
                +
              • + +
              • + +
                + 后台设置 +
                +
                .icon-zhaoshengshezhi +
                +
              • + +
              • + +
                + 招生设置 +
                +
                .icon-xiaoxizhongxin +
                +
              • + +
              • + +
                + 消息中心 +
                +
                .icon-zhaoshengbaobiao +
                +
              • + +
              • + +
                + 菜单管理 +
                +
                .icon-caidanguanli +
                +
              • + +
              • + +
                + 集团设置 +
                +
                .icon-jituanshezhi +
                +
              • + +
              • + +
                + 市场管理 +
                +
                .icon-shichangguanli +
                +
              • + +
              • + +
                + 创建系统 +
                +
                .icon-chuangjianxitong +
                +
              • + +
              • + +
                + 工单管理 +
                +
                .icon-gongdanguanli +
                +
              • + +
              • + +
                + 短信 +
                +
                .icon-duanxin +
                +
              • + +
              • + +
                + 帮助中心 +
                +
                .icon-bangzhuzhongxin
              • @@ -729,18 +3489,58 @@
              • -
                分销
                -
                #icon-fenxiao
                +
                学生异动
                +
                #icon-xueshengyidong
              • -
                订单
                -
                #icon-dingdan
                +
                报考
                +
                #icon-baokao
                +
              • + +
              • + +
                成绩
                +
                #icon-chengji
                +
              • + +
              • + +
                阅卷
                +
                #icon-yuejuan
                +
              • + +
              • + +
                考核设置
                +
                #icon-kaoheshezhi
                +
              • + +
              • + +
                论文管理
                +
                #icon-lunwenguanli
                +
              • + +
              • + +
                申报
                +
                #icon-shenbao
              • @@ -753,242 +3553,1074 @@
              • -
                事务中心_进修培训
                -
                #icon-banji
                +
                题库
                +
                #icon-tiku
              • -
                商品
                -
                #icon-shangpin
                +
                教务设置
                +
                #icon-jiaowushezhi
              • -
                数据库
                -
                #icon-shuju
                +
                自定义设置
                +
                #icon-zidingyishezhi
              • -
                网站
                -
                #icon-wangzhan
                +
                超级统计
                +
                #icon-chaojitongji
              • -
                设计
                -
                #icon-sheji
                +
                招生统计
                +
                #icon-zhaoshengtongji
              • -
                运营
                -
                #icon-yunying
                +
                推广统计
                +
                #icon-tuiguangtongji
              • -
                8_4后端开发
                -
                #icon-houduankaifa
                +
                学习统计
                +
                #icon-xuexitongji
              • -
                8_3前端开发
                -
                #icon-qianduankaifa
                +
                地区数据统计
                +
                #icon-diqushujutongji
              • -
                8_5移动开发
                -
                #icon-yidongkaifa
                +
                数据导入
                +
                #icon-shujudaoru
              • -
                KHCFDC_产品
                -
                #icon-chanpin
                +
                成考管理
                +
                #icon-chengkaoguanli
              • -
                测试
                -
                #icon-ceshi
                +
                远程管理
                +
                #icon-yuanchengguanli
              • -
                规则
                -
                #icon-guize
                +
                书籍管理
                +
                #icon-shujiguanli
              • -
                运营中心
                -
                #icon-yunyingzhongxin
                +
                过程性考核
                +
                #icon-guochengxingkaohe
              • -
                执行反馈
                -
                #icon-zhihangfankui
                +
                学分认定
                +
                #icon-xuefenrending
              • -
                工单确认
                -
                #icon-gongdanqueren
                +
                课程订单
                +
                #icon-kechengdingdan
              • -
                工单
                -
                #icon-gongdan
                +
                问题反馈
                +
                #icon-wentifankui
              • -
                消息
                -
                #icon-xiaoxi
                +
                资产
                +
                #icon-zichan
              • -
                iframe添加
                -
                #icon-iframetianjia
                +
                KPI管理
                +
                #icon-KPIguanli
              • -
                基础管理
                -
                #icon-jichuguanli
                +
                项目管理
                +
                #icon-xiangmuguanli
              • -
                测试申请
                -
                #icon-ceshishenqing
                +
                微信公众号
                +
                #icon-weixingongzhonghao
              • -
                配网引导
                -
                #icon-peiwangyindao
                +
                安全设置
                +
                #icon-anquanshezhi
              • -
                人机交互
                -
                #icon-renjijiaohu
                +
                服务中心
                +
                #icon-fuwuzhongxin
              • -
                数据看板
                -
                #icon-shujukanban
                +
                企业服务
                +
                #icon-qiyefuwu
              • -
                icon_账号
                -
                #icon-icon_zhanghao
                +
                网课服务
                +
                #icon-wangkefuwu
              • -
                物模型
                -
                #icon-wumoxing
                +
                收费管理
                +
                #icon-shoufeiguanli
              • -
                待办事项
                -
                #icon-daibanshixiang
                +
                权限设置
                +
                #icon-quanxianshezhi
              • -
                流计算
                -
                #icon-liujisuan
                +
                教务统计
                +
                #icon-jiaowutongji
              • -
                折线图
                -
                #icon-zhexiantu
                +
                教学统计
                +
                #icon-jiaoxuetongji
              • -
                合作伙伴密钥管理
                -
                #icon-hezuohuobanmiyueguanli
                +
                收费统计
                +
                #icon-shoufeitongji
              • -
                权限审批
                -
                #icon-quanxianshenpi
                +
                服务统计
                +
                #icon-fuwutongji
                +
              • + +
              • + +
                通知统计
                +
                #icon-tongzhitongji
                +
              • + +
              • + +
                考核统计
                +
                #icon-kaohetongji
                +
              • + +
              • + +
                用户活跃度
                +
                #icon-yonghuhuoyuedu
                +
              • + +
              • + +
                学生报名
                +
                #icon-xueshengbaoming
                +
              • + +
              • + +
                学生录取
                +
                #icon-xueshengluqu
                +
              • + +
              • + +
                学生注册
                +
                #icon-xueshengzhuce
                +
              • + +
              • + +
                在籍学生
                +
                #icon-zaijixuesheng
                +
              • + +
              • + +
                花名册
                +
                #icon-huamingce
                +
              • + +
              • + +
                服务分类管理
                +
                #icon-fenleiguanli
                +
              • + +
              • + +
                学生服务列表
                +
                #icon-fuwuliebiao
                +
              • + +
              • + +
                通知分类管理
                +
                #icon-fenleiliebiao
                +
              • + +
              • + +
                通知列表
                +
                #icon-tongzhiliebiao
                +
              • + +
              • + +
                教学计划
                +
                #icon-jiaoxuejihua
                +
              • + +
              • + +
                教学安排
                +
                #icon-jiaoxueanpai
                +
              • + +
              • + +
                成绩管理
                +
                #icon-chengjiguanli
                +
              • + +
              • + +
                图片管理
                +
                #icon-tupianguanli
                +
              • + +
              • + +
                考试计划
                +
                #icon-kaoshijihua
                +
              • + +
              • + +
                考试配置
                +
                #icon-kaoshipeizhi
                +
              • + +
              • + +
                学习中心管理
                +
                #icon-xuexizhongxinguanli
                +
              • + +
              • + +
                考核管理
                +
                #icon-kaoheguanli
                +
              • + +
              • + +
                教师管理
                +
                #icon-jiaoshiguanli
                +
              • + +
              • + +
                网课管理
                +
                #icon-wangkeguanli
                +
              • + +
              • + +
                补录结算
                +
                #icon-bulujiesuan
                +
              • + +
              • + +
                毕业管理
                +
                #icon-biyeguanli
                +
              • + +
              • + +
                考核指标
                +
                #icon-kaohezhibiao
                +
              • + +
              • + +
                企业管理
                +
                #icon-qiyeguanli
                +
              • + +
              • + +
                初步管理
                +
                #icon-chubuguanli
                +
              • + +
              • + +
                呼叫报表
                +
                #icon-hujiaobaobiao
                +
              • + +
              • + +
                扫描电镜
                +
                #icon-saomiaodianjing
                +
              • + +
              • + +
                结账
                +
                #icon-jiezhang
                +
              • + +
              • + +
                销售报表
                +
                #icon-xiaoshoubaobiao
                +
              • + +
              • + +
                凭证
                +
                #icon-pingzheng
                +
              • + +
              • + +
                合同异动
                +
                #icon-hetongyidong
                +
              • + +
              • + +
                销售品
                +
                #icon-xiaoshoupin
                +
              • + +
              • + +
                学术管理
                +
                #icon-xueshuguanli
                +
              • + +
              • + +
                易耗品
                +
                #icon-yihaopin
                +
              • + +
              • + +
                任务管理
                +
                #icon-renwuguanli
                +
              • + +
              • + +
                电商
                +
                #icon-dianshang
                +
              • + +
              • + +
                名片报表
                +
                #icon-mingpianbaobiao_1
                +
              • + +
              • + +
                固定资产
                +
                #icon-gudingzichan
                +
              • + +
              • + +
                动态管理
                +
                #icon-dongtaiguanli
                +
              • + +
              • + +
                基础配置
                +
                #icon-jichupeizhi
                +
              • + +
              • + +
                呼叫统计
                +
                #icon-hujiaotongji
                +
              • + +
              • + +
                销售报表
                +
                #icon-xiaoshoubaobiao_1
                +
              • + +
              • + +
                大数据
                +
                #icon-dashuju
                +
              • + +
              • + +
                活动管理
                +
                #icon-huodongguanli
                +
              • + +
              • + +
                呼叫设置
                +
                #icon-hujiaoshezhi
                +
              • + +
              • + +
                分销市场
                +
                #icon-fenxiaoshichang
                +
              • + +
              • + +
                成绩统计
                +
                #icon-chengjitongji
                +
              • + +
              • + +
                推广设置
                +
                #icon-tuiguangshezhi
                +
              • + +
              • + +
                课程中心
                +
                #icon-kechengzhongxin
                +
              • + +
              • + +
                合同设置
                +
                #icon-hetongshezhi
                +
              • + +
              • + +
                课程包管理
                +
                #icon-kechengbaoguanli
                +
              • + +
              • + +
                用户管理
                +
                #icon-yonghuguanli
                +
              • + +
              • + +
                用户画像
                +
                #icon-yonghuhuaxiang
                +
              • + +
              • + +
                帐号管理
                +
                #icon-zhanghaoguanli
                +
              • + +
              • + +
                SEM管理
                +
                #icon-SEMguanli
                +
              • + +
              • + +
                预算
                +
                #icon-yusuan
                +
              • + +
              • + +
                名片报表
                +
                #icon-mingpianbaobiao
                +
              • + +
              • + +
                订单管理
                +
                #icon-dingdanguanli
                +
              • + +
              • + +
                推广管理
                +
                #icon-tuiguangguanli
                +
              • + +
              • + +
                专题管理
                +
                #icon-zhuantiguanli
                +
              • + +
              • + +
                信息流
                +
                #icon-xinxiliu
                +
              • + +
              • + +
                销售设置
                +
                #icon-xiaoshoushezhi
                +
              • + +
              • + +
                素材管理
                +
                #icon-sucaiguanli
                +
              • + +
              • + +
                学生导入
                +
                #icon-xueshengdaoru
                +
              • + +
              • + +
                商品管理
                +
                #icon-shangpinguanli
                +
              • + +
              • + +
                排课管理
                +
                #icon-paikeguanli
                +
              • + +
              • + +
                信息导入
                +
                #icon-xinxidaoru
                +
              • + +
              • + +
                收费配置
                +
                #icon-shoufeipeizhi
                +
              • + +
              • + +
                用户权限
                +
                #icon-yonghuquanxian
                +
              • + +
              • + +
                在籍学生管理
                +
                #icon-zaijixueshengguanli
                +
              • + +
              • + +
                学号管理
                +
                #icon-xuehaoguanli
                +
              • + +
              • + +
                课程资源管理
                +
                #icon-kechengziyuanguanli
                +
              • + +
              • + +
                面授教学安排
                +
                #icon-mianshoujiaoxueanpai
                +
              • + +
              • + +
                账房
                +
                #icon-zhangfang
                +
              • + +
              • + +
                开课管理
                +
                #icon-kaikeguanli
                +
              • + +
              • + +
                毕业统计
                +
                #icon-biyetongji
                +
              • + +
              • + +
                招生准备
                +
                #icon-zhaoshengzhunbei
                +
              • + +
              • + +
                排课设置
                +
                #icon-paikeshezhi
                +
              • + +
              • + +
                班级管理
                +
                #icon-banjiguanli
                +
              • + +
              • + +
                精品课堂
                +
                #icon-jingpinketang
                +
              • + +
              • + +
                员工提点
                +
                #icon-yuangongtidian
                +
              • + +
              • + +
                考试安排
                +
                #icon-kaoshianpai
                +
              • + +
              • + +
                网络教学安排
                +
                #icon-wangluojiaoxueanpai
                +
              • + +
              • + +
                入学成绩
                +
                #icon-ruxuechengji
                +
              • + +
              • + +
                面授教学
                +
                #icon-mianshoujiaoxue
                +
              • + +
              • + +
                教师教室管理
                +
                #icon-jiaoshijiaoshiguanli
                +
              • + +
              • + +
                录取管理
                +
                #icon-luquguanli
                +
              • + +
              • + +
                录取成绩
                +
                #icon-luquchengji
                +
              • + +
              • + +
                资源
                +
                #icon-ziyuan
                +
              • + +
              • + +
                课件
                +
                #icon-kejian
                +
              • + +
              • + +
                外部课件
                +
                #icon-waibukejian
                +
              • + +
              • + +
                日志管理
                +
                #icon-rizhiguanli
                +
              • + +
              • + +
                模版管理
                +
                #icon-mobanguanli
                +
              • + +
              • + +
                学历认证
                +
                #icon-xuelirenzheng
                +
              • + +
              • + +
                异议处理
                +
                #icon-yiyichuli
                +
              • + +
              • + +
                论文申报
                +
                #icon-lunwenshenbao
                +
              • + +
              • + +
                论文设置
                +
                #icon-lunwenshezhi
                +
              • + +
              • + +
                教学点设置
                +
                #icon-jiaoxuedianshezhi
                +
              • + +
              • + +
                补录沉降
                +
                #icon-buluchenjiang
                +
              • + +
              • + +
                模块设置
                +
                #icon-mokuaishezhi
                +
              • + +
              • + +
                资料管理
                +
                #icon-ziliaoguanli
                +
              • + +
              • + +
                集团管理
                +
                #icon-jituanguanli
              • @@ -1001,50 +4633,650 @@
              • -
                icon_设置
                -
                #icon-icon_shezhi
                +
                官网试卷
                +
                #icon-guanwangshijuan
              • -
                设备管理
                -
                #icon-shebeiguanli
                +
                我的网课
                +
                #icon-wodewangke
              • -
                组织群组
                -
                #icon-zuzhiqunzu
                +
                脚本管理
                +
                #icon-jiaobenguanli
              • -
                未知格式
                -
                #icon-weizhigeshi
                +
                专业管理员
                +
                #icon-zhuanyeguanliyuan
              • -
                储存
                -
                #icon-chucun
                +
                学生成绩
                +
                #icon-xueshengchengji
              • -
                get
                -
                #icon-get
                +
                服务管理
                +
                #icon-fuwuguanli
                +
              • + +
              • + +
                代金券
                +
                #icon-daijinquan
                +
              • + +
              • + +
                呼叫中心
                +
                #icon-hujiaozhongxin
                +
              • + +
              • + +
                引进收费
                +
                #icon-yinjinshoufei
                +
              • + +
              • + +
                应缴清单
                +
                #icon-yingjiaoqingdan
                +
              • + +
              • + +
                对账单
                +
                #icon-duizhangdan
                +
              • + +
              • + +
                商机管理
                +
                #icon-shangjiguanli
                +
              • + +
              • + +
                企微会话存档
                +
                #icon-qiyehuihuacundang
                +
              • + +
              • + +
                用户设置
                +
                #icon-yonghushezhi
                +
              • + +
              • + +
                消息设置
                +
                #icon-xiaoxishezhi
                +
              • + +
              • + +
                营销设置
                +
                #icon-yingxiaoshezhi
                +
              • + +
              • + +
                服务市场
                +
                #icon-fuwushichang
                +
              • + +
              • + +
                素材资源
                +
                #icon-sucaiziyuan
                +
              • + +
              • + +
                营销玩法
                +
                #icon-yingxiaowanfa
                +
              • + +
              • + +
                推广
                +
                #icon-tuiguang
                +
              • + +
              • + +
                用户列表
                +
                #icon-yonghuliebiao
                +
              • + +
              • + +
                资源管理
                +
                #icon-ziyuanguanli
                +
              • + +
              • + +
                课程管理
                +
                #icon-kechengguanli
                +
              • + +
              • + +
                课程包
                +
                #icon-kechengbao
                +
              • + +
              • + +
                题库管理
                +
                #icon-tikuguanli
                +
              • + +
              • + +
                网课市场
                +
                #icon-wangkeshichang
                +
              • + +
              • + +
                工单
                +
                #icon-gongdan
                +
              • + +
              • + +
                访客管理
                +
                #icon-fangkeguanli
                +
              • + +
              • + +
                线索管理
                +
                #icon-xiansuoguanli
                +
              • + +
              • + +
                客户管理
                +
                #icon-kehuguanli
                +
              • + +
              • + +
                集团客户
                +
                #icon-jituankehu
                +
              • + +
              • + +
                跟进记录
                +
                #icon-genjinjilu
                +
              • + +
              • + +
                呼叫管理
                +
                #icon-hujiaoguanli
                +
              • + +
              • + +
                工作台
                +
                #icon-gongzuotai
                +
              • + +
              • + +
                数据报表
                +
                #icon-shujubaobiao
                +
              • + +
              • + +
                访客报表
                +
                #icon-fangkebaobiao
                +
              • + +
              • + +
                账簿管理
                +
                #icon-zhangbuguanli
                +
              • + +
              • + +
                账簿管理_子系统
                +
                #icon-zhangbuguanli_zi
                +
              • + +
              • + +
                账簿管理_子系统
                +
                #icon-zhangbuguanli_zixitong_A
                +
              • + +
              • + +
                合同管理
                +
                #icon-hetongguanli
                +
              • + +
              • + +
                运营者管理
                +
                #icon-yunyingzheguanli
                +
              • + +
              • + +
                招聘管理
                +
                #icon-zhaopinguanli
                +
              • + +
              • + +
                工资管理
                +
                #icon-gongziguanli
                +
              • + +
              • + +
                我的审批
                +
                #icon-wodeshenpi
                +
              • + +
              • + +
                标准模版设置
                +
                #icon-biaozhunmobanshezhi
                +
              • + +
              • + +
                基础设置
                +
                #icon-jichushezhi
                +
              • + +
              • + +
                财务设置
                +
                #icon-caiwushezhi
                +
              • + +
              • + +
                产品设置
                +
                #icon-chanpinshezhi
                +
              • + +
              • + +
                审批设置
                +
                #icon-shenpishezhi
                +
              • + +
              • + +
                目标管理
                +
                #icon-mubiaoguanli
                +
              • + +
              • + +
                站点设置
                +
                #icon-zhandianshezhi
                +
              • + +
              • + +
                人事设置
                +
                #icon-renshishezhi
                +
              • + +
              • + +
                CRM设置
                +
                #icon-CRMshezhi
                +
              • + +
              • + +
                名片设置
                +
                #icon-mingpianshezhi
                +
              • + +
              • + +
                网校设置
                +
                #icon-wangxiaoshezhi
                +
              • + +
              • + +
                我的点评
                +
                #icon-wodedianping
                +
              • + +
              • + +
                我的学生
                +
                #icon-wodexuesheng
                +
              • + +
              • + +
                联系记录
                +
                #icon-lianxijilu
                +
              • + +
              • + +
                投诉提问
                +
                #icon-tousutiwen
                +
              • + +
              • + +
                培训计划
                +
                #icon-peixunjihua
                +
              • + +
              • + +
                费用查询
                +
                #icon-feiyongchaxun
                +
              • + +
              • + +
                学生缴费
                +
                #icon-xueshengjiaofei
                +
              • + +
              • + +
                记账
                +
                #icon-jizhang
                +
              • + +
              • + +
                查账
                +
                #icon-chaxun
                +
              • + +
              • + +
                查账
                +
                #icon-chazhang
                +
              • + +
              • + +
                报表
                +
                #icon-baobiao
                +
              • + +
              • + +
                设置
                +
                #icon-shezhi
                +
              • + +
              • + +
                招生报表
                +
                #icon-daqiajilu
                +
              • + +
              • + +
                打卡记录
                +
                #icon-wangluobanji
                +
              • + +
              • + +
                网络班级
                +
                #icon-wangxiaoshezhi1
                +
              • + +
              • + +
                小程序
                +
                #icon-houtaishezhi
                +
              • + +
              • + +
                后台设置
                +
                #icon-zhaoshengshezhi
                +
              • + +
              • + +
                招生设置
                +
                #icon-xiaoxizhongxin
                +
              • + +
              • + +
                消息中心
                +
                #icon-zhaoshengbaobiao
                +
              • + +
              • + +
                菜单管理
                +
                #icon-caidanguanli
                +
              • + +
              • + +
                集团设置
                +
                #icon-jituanshezhi
                +
              • + +
              • + +
                市场管理
                +
                #icon-shichangguanli
                +
              • + +
              • + +
                创建系统
                +
                #icon-chuangjianxitong
                +
              • + +
              • + +
                工单管理
                +
                #icon-gongdanguanli
                +
              • + +
              • + +
                短信
                +
                #icon-duanxin
                +
              • + +
              • + +
                帮助中心
                +
                #icon-bangzhuzhongxin
              @@ -1087,8 +5319,6 @@
              diff --git a/public/static/layui/font/extend/iconfont.css b/public/static/layui/font/extend/iconfont.css index db48271..1112dac 100644 --- a/public/static/layui/font/extend/iconfont.css +++ b/public/static/layui/font/extend/iconfont.css @@ -1,8 +1,8 @@ @font-face { - font-family: "iconfont"; /* Project id 1322180 */ - src: url('iconfont.woff2?t=1626055526638') format('woff2'), - url('iconfont.woff?t=1626055526638') format('woff'), - url('iconfont.ttf?t=1626055526638') format('truetype'); + font-family: "iconfont"; /* Project id 2936988 */ + src: url('iconfont.woff2?t=1640935732189') format('woff2'), + url('iconfont.woff?t=1640935732189') format('woff'), + url('iconfont.ttf?t=1640935732189') format('truetype'); } .iconfont { @@ -13,163 +13,899 @@ -moz-osx-font-smoothing: grayscale; } -.icon-fenxiao:before { - content: "\e618"; +.icon-xueshengyidong:before { + content: "\e6e9"; } -.icon-dingdan:before { - content: "\e620"; +.icon-baokao:before { + content: "\e6ea"; +} + +.icon-chengji:before { + content: "\e6eb"; +} + +.icon-yuejuan:before { + content: "\e6ec"; +} + +.icon-kaoheshezhi:before { + content: "\e6ed"; +} + +.icon-lunwenguanli:before { + content: "\e6ee"; +} + +.icon-shenbao:before { + content: "\e6ef"; } .icon-kecheng:before { - content: "\e609"; + content: "\e6f0"; } -.icon-banji:before { +.icon-tiku:before { + content: "\e6f1"; +} + +.icon-jiaowushezhi:before { + content: "\e6f2"; +} + +.icon-zidingyishezhi:before { + content: "\e6f3"; +} + +.icon-chaojitongji:before { content: "\e6f4"; } -.icon-shangpin:before { - content: "\e64f"; +.icon-zhaoshengtongji:before { + content: "\e6f5"; } -.icon-shuju:before { - content: "\e625"; +.icon-tuiguangtongji:before { + content: "\e6f6"; } -.icon-wangzhan:before { - content: "\e652"; +.icon-xuexitongji:before { + content: "\e6f7"; } -.icon-sheji:before { - content: "\e65e"; +.icon-diqushujutongji:before { + content: "\e6f8"; } -.icon-yunying:before { - content: "\e607"; +.icon-shujudaoru:before { + content: "\e6f9"; } -.icon-houduankaifa:before { - content: "\e606"; +.icon-chengkaoguanli:before { + content: "\e6fb"; } -.icon-qianduankaifa:before { - content: "\e608"; +.icon-yuanchengguanli:before { + content: "\e6fe"; } -.icon-yidongkaifa:before { - content: "\e610"; +.icon-shujiguanli:before { + content: "\e6ff"; } -.icon-chanpin:before { - content: "\e6c7"; +.icon-guochengxingkaohe:before { + content: "\e700"; } -.icon-ceshi:before { - content: "\e669"; +.icon-xuefenrending:before { + content: "\e701"; } -.icon-guize:before { - content: "\ebb8"; +.icon-kechengdingdan:before { + content: "\e702"; } -.icon-yunyingzhongxin:before { - content: "\ebd0"; +.icon-wentifankui:before { + content: "\e703"; } -.icon-zhihangfankui:before { - content: "\ec35"; +.icon-zichan:before { + content: "\e704"; } -.icon-gongdanqueren:before { - content: "\ec36"; +.icon-KPIguanli:before { + content: "\e705"; } -.icon-gongdan:before { - content: "\ec37"; +.icon-xiangmuguanli:before { + content: "\e706"; } -.icon-xiaoxi:before { - content: "\ec3b"; +.icon-weixingongzhonghao:before { + content: "\e707"; } -.icon-iframetianjia:before { - content: "\ec7d"; +.icon-anquanshezhi:before { + content: "\e708"; } -.icon-jichuguanli:before { - content: "\eb64"; +.icon-fuwuzhongxin:before { + content: "\e709"; } -.icon-ceshishenqing:before { - content: "\eb61"; +.icon-qiyefuwu:before { + content: "\e70a"; } -.icon-peiwangyindao:before { - content: "\eb66"; +.icon-wangkefuwu:before { + content: "\e70b"; } -.icon-renjijiaohu:before { - content: "\eb68"; +.icon-shoufeiguanli:before { + content: "\e70c"; } -.icon-shujukanban:before { - content: "\eb69"; +.icon-quanxianshezhi:before { + content: "\e70d"; } -.icon-icon_zhanghao:before { - content: "\eb8a"; +.icon-jiaowutongji:before { + content: "\e70f"; } -.icon-wumoxing:before { - content: "\ec33"; +.icon-jiaoxuetongji:before { + content: "\e710"; } -.icon-daibanshixiang:before { - content: "\ec4e"; +.icon-shoufeitongji:before { + content: "\e711"; } -.icon-liujisuan:before { - content: "\ec56"; +.icon-fuwutongji:before { + content: "\e713"; } -.icon-zhexiantu:before { - content: "\ec66"; +.icon-tongzhitongji:before { + content: "\e714"; } -.icon-hezuohuobanmiyueguanli:before { - content: "\eb63"; +.icon-kaohetongji:before { + content: "\e715"; } -.icon-quanxianshenpi:before { - content: "\eb65"; +.icon-yonghuhuoyuedu:before { + content: "\e716"; +} + +.icon-xueshengbaoming:before { + content: "\e717"; +} + +.icon-xueshengluqu:before { + content: "\e718"; +} + +.icon-xueshengzhuce:before { + content: "\e719"; +} + +.icon-zaijixuesheng:before { + content: "\e71a"; +} + +.icon-huamingce:before { + content: "\e71b"; +} + +.icon-fenleiguanli:before { + content: "\e71c"; +} + +.icon-fuwuliebiao:before { + content: "\e71d"; +} + +.icon-fenleiliebiao:before { + content: "\e71e"; +} + +.icon-tongzhiliebiao:before { + content: "\e71f"; +} + +.icon-jiaoxuejihua:before { + content: "\e720"; +} + +.icon-jiaoxueanpai:before { + content: "\e721"; +} + +.icon-chengjiguanli:before { + content: "\e722"; +} + +.icon-tupianguanli:before { + content: "\e723"; +} + +.icon-kaoshijihua:before { + content: "\e724"; +} + +.icon-kaoshipeizhi:before { + content: "\e725"; +} + +.icon-xuexizhongxinguanli:before { + content: "\e726"; +} + +.icon-kaoheguanli:before { + content: "\e728"; +} + +.icon-jiaoshiguanli:before { + content: "\e729"; +} + +.icon-wangkeguanli:before { + content: "\e72a"; +} + +.icon-bulujiesuan:before { + content: "\e72b"; +} + +.icon-biyeguanli:before { + content: "\e72c"; +} + +.icon-kaohezhibiao:before { + content: "\e72d"; +} + +.icon-qiyeguanli:before { + content: "\e77e"; +} + +.icon-chubuguanli:before { + content: "\e77f"; +} + +.icon-hujiaobaobiao:before { + content: "\e780"; +} + +.icon-saomiaodianjing:before { + content: "\e781"; +} + +.icon-jiezhang:before { + content: "\e782"; +} + +.icon-xiaoshoubaobiao:before { + content: "\e783"; +} + +.icon-pingzheng:before { + content: "\e784"; +} + +.icon-hetongyidong:before { + content: "\e785"; +} + +.icon-xiaoshoupin:before { + content: "\e787"; +} + +.icon-xueshuguanli:before { + content: "\e788"; +} + +.icon-yihaopin:before { + content: "\e789"; +} + +.icon-renwuguanli:before { + content: "\e78a"; +} + +.icon-dianshang:before { + content: "\e78b"; +} + +.icon-mingpianbaobiao_1:before { + content: "\e78c"; +} + +.icon-gudingzichan:before { + content: "\e78d"; +} + +.icon-dongtaiguanli:before { + content: "\e78e"; +} + +.icon-jichupeizhi:before { + content: "\e78f"; +} + +.icon-hujiaotongji:before { + content: "\e790"; +} + +.icon-xiaoshoubaobiao_1:before { + content: "\e791"; +} + +.icon-dashuju:before { + content: "\e792"; +} + +.icon-huodongguanli:before { + content: "\e793"; +} + +.icon-hujiaoshezhi:before { + content: "\e794"; +} + +.icon-fenxiaoshichang:before { + content: "\e795"; +} + +.icon-chengjitongji:before { + content: "\e796"; +} + +.icon-tuiguangshezhi:before { + content: "\e797"; +} + +.icon-kechengzhongxin:before { + content: "\e798"; +} + +.icon-hetongshezhi:before { + content: "\e799"; +} + +.icon-kechengbaoguanli:before { + content: "\e79a"; +} + +.icon-yonghuguanli:before { + content: "\e79b"; +} + +.icon-yonghuhuaxiang:before { + content: "\e79c"; +} + +.icon-zhanghaoguanli:before { + content: "\e79d"; +} + +.icon-SEMguanli:before { + content: "\e79e"; +} + +.icon-yusuan:before { + content: "\e79f"; +} + +.icon-mingpianbaobiao:before { + content: "\e7a0"; +} + +.icon-dingdanguanli:before { + content: "\e7a1"; +} + +.icon-tuiguangguanli:before { + content: "\e7a2"; +} + +.icon-zhuantiguanli:before { + content: "\e7a3"; +} + +.icon-xinxiliu:before { + content: "\e7a4"; +} + +.icon-xiaoshoushezhi:before { + content: "\e7a5"; +} + +.icon-sucaiguanli:before { + content: "\e7a9"; +} + +.icon-xueshengdaoru:before { + content: "\e7aa"; +} + +.icon-shangpinguanli:before { + content: "\e7ab"; +} + +.icon-paikeguanli:before { + content: "\e7ac"; +} + +.icon-xinxidaoru:before { + content: "\e7ad"; +} + +.icon-shoufeipeizhi:before { + content: "\e7ae"; +} + +.icon-yonghuquanxian:before { + content: "\e7af"; +} + +.icon-zaijixueshengguanli:before { + content: "\e7b0"; +} + +.icon-xuehaoguanli:before { + content: "\e7b1"; +} + +.icon-kechengziyuanguanli:before { + content: "\e7b2"; +} + +.icon-mianshoujiaoxueanpai:before { + content: "\e7b3"; +} + +.icon-zhangfang:before { + content: "\e7b4"; +} + +.icon-kaikeguanli:before { + content: "\e7b5"; +} + +.icon-biyetongji:before { + content: "\e7b6"; +} + +.icon-zhaoshengzhunbei:before { + content: "\e7b8"; +} + +.icon-paikeshezhi:before { + content: "\e7b9"; +} + +.icon-banjiguanli:before { + content: "\e7ba"; +} + +.icon-jingpinketang:before { + content: "\e7bb"; +} + +.icon-yuangongtidian:before { + content: "\e7bc"; +} + +.icon-kaoshianpai:before { + content: "\e7bd"; +} + +.icon-wangluojiaoxueanpai:before { + content: "\e7bf"; +} + +.icon-ruxuechengji:before { + content: "\e7c3"; +} + +.icon-mianshoujiaoxue:before { + content: "\e7c6"; +} + +.icon-jiaoshijiaoshiguanli:before { + content: "\e7c7"; +} + +.icon-luquguanli:before { + content: "\e7c8"; +} + +.icon-luquchengji:before { + content: "\e7c9"; +} + +.icon-ziyuan:before { + content: "\e7ca"; +} + +.icon-kejian:before { + content: "\e7cc"; +} + +.icon-waibukejian:before { + content: "\e7cd"; +} + +.icon-rizhiguanli:before { + content: "\e7ce"; +} + +.icon-mobanguanli:before { + content: "\e7cf"; +} + +.icon-xuelirenzheng:before { + content: "\e7d1"; +} + +.icon-yiyichuli:before { + content: "\e7d2"; +} + +.icon-lunwenshenbao:before { + content: "\e7d3"; +} + +.icon-lunwenshezhi:before { + content: "\e7d4"; +} + +.icon-jiaoxuedianshezhi:before { + content: "\e7d5"; +} + +.icon-buluchenjiang:before { + content: "\e7d6"; +} + +.icon-mokuaishezhi:before { + content: "\e7d7"; +} + +.icon-ziliaoguanli:before { + content: "\e7d8"; +} + +.icon-jituanguanli:before { + content: "\e7d9"; } .icon-yingyongguanli:before { - content: "\eb67"; + content: "\e7da"; } -.icon-icon_shezhi:before { - content: "\eb8d"; +.icon-guanwangshijuan:before { + content: "\e7db"; } -.icon-shebeiguanli:before { - content: "\ebb7"; +.icon-wodewangke:before { + content: "\e7dc"; } -.icon-zuzhiqunzu:before { - content: "\ebd8"; +.icon-jiaobenguanli:before { + content: "\e7dd"; } -.icon-weizhigeshi:before { - content: "\ec1a"; +.icon-zhuanyeguanliyuan:before { + content: "\e7de"; } -.icon-chucun:before { - content: "\ec5e"; +.icon-xueshengchengji:before { + content: "\e7df"; } -.icon-get:before { - content: "\ec64"; +.icon-fuwuguanli:before { + content: "\e7e2"; +} + +.icon-daijinquan:before { + content: "\e7e3"; +} + +.icon-hujiaozhongxin:before { + content: "\e7e4"; +} + +.icon-yinjinshoufei:before { + content: "\e7e5"; +} + +.icon-yingjiaoqingdan:before { + content: "\e7e6"; +} + +.icon-duizhangdan:before { + content: "\e7e7"; +} + +.icon-shangjiguanli:before { + content: "\e7e8"; +} + +.icon-qiyehuihuacundang:before { + content: "\e7e9"; +} + +.icon-yonghushezhi:before { + content: "\e7ea"; +} + +.icon-xiaoxishezhi:before { + content: "\e7ec"; +} + +.icon-yingxiaoshezhi:before { + content: "\e7ed"; +} + +.icon-fuwushichang:before { + content: "\e7ee"; +} + +.icon-sucaiziyuan:before { + content: "\e7ef"; +} + +.icon-yingxiaowanfa:before { + content: "\e7f0"; +} + +.icon-tuiguang:before { + content: "\e7f1"; +} + +.icon-yonghuliebiao:before { + content: "\e7f2"; +} + +.icon-ziyuanguanli:before { + content: "\e692"; +} + +.icon-kechengguanli:before { + content: "\e693"; +} + +.icon-kechengbao:before { + content: "\e694"; +} + +.icon-tikuguanli:before { + content: "\e695"; +} + +.icon-wangkeshichang:before { + content: "\e696"; +} + +.icon-gongdan:before { + content: "\e697"; +} + +.icon-fangkeguanli:before { + content: "\e698"; +} + +.icon-xiansuoguanli:before { + content: "\e699"; +} + +.icon-kehuguanli:before { + content: "\e69a"; +} + +.icon-jituankehu:before { + content: "\e69b"; +} + +.icon-genjinjilu:before { + content: "\e69c"; +} + +.icon-hujiaoguanli:before { + content: "\e69d"; +} + +.icon-gongzuotai:before { + content: "\e69e"; +} + +.icon-shujubaobiao:before { + content: "\e69f"; +} + +.icon-fangkebaobiao:before { + content: "\e6a0"; +} + +.icon-zhangbuguanli:before { + content: "\e6a1"; +} + +.icon-zhangbuguanli_zi:before { + content: "\e6a2"; +} + +.icon-zhangbuguanli_zixitong_A:before { + content: "\e6a3"; +} + +.icon-hetongguanli:before { + content: "\e6a4"; +} + +.icon-yunyingzheguanli:before { + content: "\e6a5"; +} + +.icon-zhaopinguanli:before { + content: "\e6a6"; +} + +.icon-gongziguanli:before { + content: "\e6a7"; +} + +.icon-wodeshenpi:before { + content: "\e6a8"; +} + +.icon-biaozhunmobanshezhi:before { + content: "\e6a9"; +} + +.icon-jichushezhi:before { + content: "\e6aa"; +} + +.icon-caiwushezhi:before { + content: "\e6ab"; +} + +.icon-chanpinshezhi:before { + content: "\e6ac"; +} + +.icon-shenpishezhi:before { + content: "\e6ad"; +} + +.icon-mubiaoguanli:before { + content: "\e6ae"; +} + +.icon-zhandianshezhi:before { + content: "\e6af"; +} + +.icon-renshishezhi:before { + content: "\e6b0"; +} + +.icon-CRMshezhi:before { + content: "\e6b1"; +} + +.icon-mingpianshezhi:before { + content: "\e6b2"; +} + +.icon-wangxiaoshezhi:before { + content: "\e6b3"; +} + +.icon-wodedianping:before { + content: "\e6b4"; +} + +.icon-wodexuesheng:before { + content: "\e6b5"; +} + +.icon-lianxijilu:before { + content: "\e6b8"; +} + +.icon-tousutiwen:before { + content: "\e6b9"; +} + +.icon-peixunjihua:before { + content: "\e6ba"; +} + +.icon-feiyongchaxun:before { + content: "\e6bb"; +} + +.icon-xueshengjiaofei:before { + content: "\e6bc"; +} + +.icon-jizhang:before { + content: "\e6bd"; +} + +.icon-chaxun:before { + content: "\e6be"; +} + +.icon-chazhang:before { + content: "\e6bf"; +} + +.icon-baobiao:before { + content: "\e6c0"; +} + +.icon-shezhi:before { + content: "\e6c2"; +} + +.icon-daqiajilu:before { + content: "\e6ce"; +} + +.icon-wangluobanji:before { + content: "\e6d3"; +} + +.icon-wangxiaoshezhi1:before { + content: "\e6d6"; +} + +.icon-houtaishezhi:before { + content: "\e6d8"; +} + +.icon-zhaoshengshezhi:before { + content: "\e6db"; +} + +.icon-xiaoxizhongxin:before { + content: "\e6df"; +} + +.icon-zhaoshengbaobiao:before { + content: "\e6e1"; +} + +.icon-caidanguanli:before { + content: "\e6e2"; +} + +.icon-jituanshezhi:before { + content: "\e6e3"; +} + +.icon-shichangguanli:before { + content: "\e6e4"; +} + +.icon-chuangjianxitong:before { + content: "\e6e5"; +} + +.icon-gongdanguanli:before { + content: "\e6e6"; +} + +.icon-duanxin:before { + content: "\e6e7"; +} + +.icon-bangzhuzhongxin:before { + content: "\e6e8"; } diff --git a/public/static/layui/font/extend/iconfont.eot b/public/static/layui/font/extend/iconfont.eot deleted file mode 100644 index 16a7738..0000000 Binary files a/public/static/layui/font/extend/iconfont.eot and /dev/null differ diff --git a/public/static/layui/font/extend/iconfont.js b/public/static/layui/font/extend/iconfont.js index b1b9fc3..731db90 100644 --- a/public/static/layui/font/extend/iconfont.js +++ b/public/static/layui/font/extend/iconfont.js @@ -1 +1 @@ -!function(a){var h,c,l,t,i,o,v='',z=(z=document.getElementsByTagName("script"))[z.length-1].getAttribute("data-injectcss");if(z&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function p(){i||(i=!0,l())}h=function(){var a,h,c;(c=document.createElement("div")).innerHTML=v,v=null,(h=c.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",a=h,(c=document.body).firstChild?(h=c.firstChild).parentNode.insertBefore(a,h):c.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),h()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(l=h,t=a.document,i=!1,(o=function(){try{t.documentElement.doScroll("left")}catch(a){return void setTimeout(o,50)}p()})(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,p())})}(window); \ No newline at end of file +!function(c){var h,l,i,v,a,z='',o=(o=document.getElementsByTagName("script"))[o.length-1].getAttribute("data-injectcss"),s=function(c,h){h.parentNode.insertBefore(c,h)};if(o&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}function t(){a||(a=!0,i())}function p(){try{v.documentElement.doScroll("left")}catch(c){return void setTimeout(p,50)}t()}h=function(){var c,h;(h=document.createElement("div")).innerHTML=z,z=null,(c=h.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",h=c,(c=document.body).firstChild?s(h,c.firstChild):c.appendChild(h))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(l=function(){document.removeEventListener("DOMContentLoaded",l,!1),h()},document.addEventListener("DOMContentLoaded",l,!1)):document.attachEvent&&(i=h,v=c.document,a=!1,p(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,t())})}(window); \ No newline at end of file diff --git a/public/static/layui/font/extend/iconfont.json b/public/static/layui/font/extend/iconfont.json new file mode 100644 index 0000000..a333bfe --- /dev/null +++ b/public/static/layui/font/extend/iconfont.json @@ -0,0 +1,1577 @@ +{ + "id": "2936988", + "name": "oa", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "8574208", + "name": "学生异动", + "font_class": "xueshengyidong", + "unicode": "e6e9", + "unicode_decimal": 59113 + }, + { + "icon_id": "8574209", + "name": "报考", + "font_class": "baokao", + "unicode": "e6ea", + "unicode_decimal": 59114 + }, + { + "icon_id": "8574211", + "name": "成绩", + "font_class": "chengji", + "unicode": "e6eb", + "unicode_decimal": 59115 + }, + { + "icon_id": "8574212", + "name": "阅卷", + "font_class": "yuejuan", + "unicode": "e6ec", + "unicode_decimal": 59116 + }, + { + "icon_id": "8574213", + "name": "考核设置", + "font_class": "kaoheshezhi", + "unicode": "e6ed", + "unicode_decimal": 59117 + }, + { + "icon_id": "8574233", + "name": "论文管理", + "font_class": "lunwenguanli", + "unicode": "e6ee", + "unicode_decimal": 59118 + }, + { + "icon_id": "8574234", + "name": "申报", + "font_class": "shenbao", + "unicode": "e6ef", + "unicode_decimal": 59119 + }, + { + "icon_id": "8574236", + "name": "课程", + "font_class": "kecheng", + "unicode": "e6f0", + "unicode_decimal": 59120 + }, + { + "icon_id": "8574237", + "name": "题库", + "font_class": "tiku", + "unicode": "e6f1", + "unicode_decimal": 59121 + }, + { + "icon_id": "8574241", + "name": "教务设置", + "font_class": "jiaowushezhi", + "unicode": "e6f2", + "unicode_decimal": 59122 + }, + { + "icon_id": "8574242", + "name": "自定义设置", + "font_class": "zidingyishezhi", + "unicode": "e6f3", + "unicode_decimal": 59123 + }, + { + "icon_id": "8710313", + "name": "超级统计", + "font_class": "chaojitongji", + "unicode": "e6f4", + "unicode_decimal": 59124 + }, + { + "icon_id": "8710316", + "name": "招生统计", + "font_class": "zhaoshengtongji", + "unicode": "e6f5", + "unicode_decimal": 59125 + }, + { + "icon_id": "8710320", + "name": "推广统计", + "font_class": "tuiguangtongji", + "unicode": "e6f6", + "unicode_decimal": 59126 + }, + { + "icon_id": "8710324", + "name": "学习统计", + "font_class": "xuexitongji", + "unicode": "e6f7", + "unicode_decimal": 59127 + }, + { + "icon_id": "8710326", + "name": "地区数据统计", + "font_class": "diqushujutongji", + "unicode": "e6f8", + "unicode_decimal": 59128 + }, + { + "icon_id": "8710329", + "name": "数据导入", + "font_class": "shujudaoru", + "unicode": "e6f9", + "unicode_decimal": 59129 + }, + { + "icon_id": "8710363", + "name": "成考管理", + "font_class": "chengkaoguanli", + "unicode": "e6fb", + "unicode_decimal": 59131 + }, + { + "icon_id": "8710444", + "name": "远程管理", + "font_class": "yuanchengguanli", + "unicode": "e6fe", + "unicode_decimal": 59134 + }, + { + "icon_id": "8710455", + "name": "书籍管理", + "font_class": "shujiguanli", + "unicode": "e6ff", + "unicode_decimal": 59135 + }, + { + "icon_id": "8710489", + "name": "过程性考核", + "font_class": "guochengxingkaohe", + "unicode": "e700", + "unicode_decimal": 59136 + }, + { + "icon_id": "8710519", + "name": "学分认定", + "font_class": "xuefenrending", + "unicode": "e701", + "unicode_decimal": 59137 + }, + { + "icon_id": "8710528", + "name": "课程订单", + "font_class": "kechengdingdan", + "unicode": "e702", + "unicode_decimal": 59138 + }, + { + "icon_id": "8710536", + "name": "问题反馈", + "font_class": "wentifankui", + "unicode": "e703", + "unicode_decimal": 59139 + }, + { + "icon_id": "8710538", + "name": "资产", + "font_class": "zichan", + "unicode": "e704", + "unicode_decimal": 59140 + }, + { + "icon_id": "8710540", + "name": "KPI管理", + "font_class": "KPIguanli", + "unicode": "e705", + "unicode_decimal": 59141 + }, + { + "icon_id": "8710547", + "name": "项目管理", + "font_class": "xiangmuguanli", + "unicode": "e706", + "unicode_decimal": 59142 + }, + { + "icon_id": "8710560", + "name": "微信公众号", + "font_class": "weixingongzhonghao", + "unicode": "e707", + "unicode_decimal": 59143 + }, + { + "icon_id": "8710565", + "name": "安全设置", + "font_class": "anquanshezhi", + "unicode": "e708", + "unicode_decimal": 59144 + }, + { + "icon_id": "8710642", + "name": "服务中心", + "font_class": "fuwuzhongxin", + "unicode": "e709", + "unicode_decimal": 59145 + }, + { + "icon_id": "8710650", + "name": "企业服务", + "font_class": "qiyefuwu", + "unicode": "e70a", + "unicode_decimal": 59146 + }, + { + "icon_id": "8710673", + "name": "网课服务", + "font_class": "wangkefuwu", + "unicode": "e70b", + "unicode_decimal": 59147 + }, + { + "icon_id": "8710677", + "name": "收费管理", + "font_class": "shoufeiguanli", + "unicode": "e70c", + "unicode_decimal": 59148 + }, + { + "icon_id": "8710679", + "name": "权限设置", + "font_class": "quanxianshezhi", + "unicode": "e70d", + "unicode_decimal": 59149 + }, + { + "icon_id": "8827470", + "name": "教务统计", + "font_class": "jiaowutongji", + "unicode": "e70f", + "unicode_decimal": 59151 + }, + { + "icon_id": "8827474", + "name": "教学统计", + "font_class": "jiaoxuetongji", + "unicode": "e710", + "unicode_decimal": 59152 + }, + { + "icon_id": "8827479", + "name": "收费统计", + "font_class": "shoufeitongji", + "unicode": "e711", + "unicode_decimal": 59153 + }, + { + "icon_id": "8827489", + "name": "服务统计", + "font_class": "fuwutongji", + "unicode": "e713", + "unicode_decimal": 59155 + }, + { + "icon_id": "8827490", + "name": "通知统计", + "font_class": "tongzhitongji", + "unicode": "e714", + "unicode_decimal": 59156 + }, + { + "icon_id": "8827501", + "name": "考核统计", + "font_class": "kaohetongji", + "unicode": "e715", + "unicode_decimal": 59157 + }, + { + "icon_id": "8827503", + "name": "用户活跃度", + "font_class": "yonghuhuoyuedu", + "unicode": "e716", + "unicode_decimal": 59158 + }, + { + "icon_id": "8827511", + "name": "学生报名", + "font_class": "xueshengbaoming", + "unicode": "e717", + "unicode_decimal": 59159 + }, + { + "icon_id": "8827513", + "name": "学生录取", + "font_class": "xueshengluqu", + "unicode": "e718", + "unicode_decimal": 59160 + }, + { + "icon_id": "8827518", + "name": "学生注册", + "font_class": "xueshengzhuce", + "unicode": "e719", + "unicode_decimal": 59161 + }, + { + "icon_id": "8827519", + "name": "在籍学生", + "font_class": "zaijixuesheng", + "unicode": "e71a", + "unicode_decimal": 59162 + }, + { + "icon_id": "8827523", + "name": "花名册", + "font_class": "huamingce", + "unicode": "e71b", + "unicode_decimal": 59163 + }, + { + "icon_id": "8827524", + "name": "服务分类管理", + "font_class": "fenleiguanli", + "unicode": "e71c", + "unicode_decimal": 59164 + }, + { + "icon_id": "8827680", + "name": "学生服务列表", + "font_class": "fuwuliebiao", + "unicode": "e71d", + "unicode_decimal": 59165 + }, + { + "icon_id": "8827692", + "name": "通知分类管理", + "font_class": "fenleiliebiao", + "unicode": "e71e", + "unicode_decimal": 59166 + }, + { + "icon_id": "8827697", + "name": "通知列表", + "font_class": "tongzhiliebiao", + "unicode": "e71f", + "unicode_decimal": 59167 + }, + { + "icon_id": "8827700", + "name": "教学计划", + "font_class": "jiaoxuejihua", + "unicode": "e720", + "unicode_decimal": 59168 + }, + { + "icon_id": "8827702", + "name": "教学安排", + "font_class": "jiaoxueanpai", + "unicode": "e721", + "unicode_decimal": 59169 + }, + { + "icon_id": "8827704", + "name": "成绩管理", + "font_class": "chengjiguanli", + "unicode": "e722", + "unicode_decimal": 59170 + }, + { + "icon_id": "8827714", + "name": "图片管理", + "font_class": "tupianguanli", + "unicode": "e723", + "unicode_decimal": 59171 + }, + { + "icon_id": "8827722", + "name": "考试计划", + "font_class": "kaoshijihua", + "unicode": "e724", + "unicode_decimal": 59172 + }, + { + "icon_id": "8827726", + "name": "考试配置", + "font_class": "kaoshipeizhi", + "unicode": "e725", + "unicode_decimal": 59173 + }, + { + "icon_id": "8827732", + "name": "学习中心管理", + "font_class": "xuexizhongxinguanli", + "unicode": "e726", + "unicode_decimal": 59174 + }, + { + "icon_id": "8827763", + "name": "考核管理", + "font_class": "kaoheguanli", + "unicode": "e728", + "unicode_decimal": 59176 + }, + { + "icon_id": "8827768", + "name": "教师管理", + "font_class": "jiaoshiguanli", + "unicode": "e729", + "unicode_decimal": 59177 + }, + { + "icon_id": "8827784", + "name": "网课管理", + "font_class": "wangkeguanli", + "unicode": "e72a", + "unicode_decimal": 59178 + }, + { + "icon_id": "8827789", + "name": "补录结算", + "font_class": "bulujiesuan", + "unicode": "e72b", + "unicode_decimal": 59179 + }, + { + "icon_id": "8827791", + "name": "毕业管理", + "font_class": "biyeguanli", + "unicode": "e72c", + "unicode_decimal": 59180 + }, + { + "icon_id": "8827794", + "name": "考核指标", + "font_class": "kaohezhibiao", + "unicode": "e72d", + "unicode_decimal": 59181 + }, + { + "icon_id": "15562222", + "name": "企业管理", + "font_class": "qiyeguanli", + "unicode": "e77e", + "unicode_decimal": 59262 + }, + { + "icon_id": "15562223", + "name": "初步管理", + "font_class": "chubuguanli", + "unicode": "e77f", + "unicode_decimal": 59263 + }, + { + "icon_id": "15562224", + "name": "呼叫报表", + "font_class": "hujiaobaobiao", + "unicode": "e780", + "unicode_decimal": 59264 + }, + { + "icon_id": "15562225", + "name": "扫描电镜", + "font_class": "saomiaodianjing", + "unicode": "e781", + "unicode_decimal": 59265 + }, + { + "icon_id": "15562226", + "name": "结账", + "font_class": "jiezhang", + "unicode": "e782", + "unicode_decimal": 59266 + }, + { + "icon_id": "15562227", + "name": "销售报表", + "font_class": "xiaoshoubaobiao", + "unicode": "e783", + "unicode_decimal": 59267 + }, + { + "icon_id": "15562228", + "name": "凭证", + "font_class": "pingzheng", + "unicode": "e784", + "unicode_decimal": 59268 + }, + { + "icon_id": "15562229", + "name": "合同异动", + "font_class": "hetongyidong", + "unicode": "e785", + "unicode_decimal": 59269 + }, + { + "icon_id": "15562231", + "name": "销售品", + "font_class": "xiaoshoupin", + "unicode": "e787", + "unicode_decimal": 59271 + }, + { + "icon_id": "15562232", + "name": "学术管理", + "font_class": "xueshuguanli", + "unicode": "e788", + "unicode_decimal": 59272 + }, + { + "icon_id": "15562233", + "name": "易耗品", + "font_class": "yihaopin", + "unicode": "e789", + "unicode_decimal": 59273 + }, + { + "icon_id": "15562234", + "name": "任务管理", + "font_class": "renwuguanli", + "unicode": "e78a", + "unicode_decimal": 59274 + }, + { + "icon_id": "15562235", + "name": "电商", + "font_class": "dianshang", + "unicode": "e78b", + "unicode_decimal": 59275 + }, + { + "icon_id": "15562236", + "name": "名片报表", + "font_class": "mingpianbaobiao_1", + "unicode": "e78c", + "unicode_decimal": 59276 + }, + { + "icon_id": "15562237", + "name": "固定资产", + "font_class": "gudingzichan", + "unicode": "e78d", + "unicode_decimal": 59277 + }, + { + "icon_id": "15562238", + "name": "动态管理", + "font_class": "dongtaiguanli", + "unicode": "e78e", + "unicode_decimal": 59278 + }, + { + "icon_id": "15562239", + "name": "基础配置", + "font_class": "jichupeizhi", + "unicode": "e78f", + "unicode_decimal": 59279 + }, + { + "icon_id": "15562240", + "name": "呼叫统计", + "font_class": "hujiaotongji", + "unicode": "e790", + "unicode_decimal": 59280 + }, + { + "icon_id": "15562241", + "name": "销售报表", + "font_class": "xiaoshoubaobiao_1", + "unicode": "e791", + "unicode_decimal": 59281 + }, + { + "icon_id": "15562242", + "name": "大数据", + "font_class": "dashuju", + "unicode": "e792", + "unicode_decimal": 59282 + }, + { + "icon_id": "15562243", + "name": "活动管理", + "font_class": "huodongguanli", + "unicode": "e793", + "unicode_decimal": 59283 + }, + { + "icon_id": "15562244", + "name": "呼叫设置", + "font_class": "hujiaoshezhi", + "unicode": "e794", + "unicode_decimal": 59284 + }, + { + "icon_id": "15562245", + "name": "分销市场", + "font_class": "fenxiaoshichang", + "unicode": "e795", + "unicode_decimal": 59285 + }, + { + "icon_id": "15562246", + "name": "成绩统计", + "font_class": "chengjitongji", + "unicode": "e796", + "unicode_decimal": 59286 + }, + { + "icon_id": "15562247", + "name": "推广设置", + "font_class": "tuiguangshezhi", + "unicode": "e797", + "unicode_decimal": 59287 + }, + { + "icon_id": "15562248", + "name": "课程中心", + "font_class": "kechengzhongxin", + "unicode": "e798", + "unicode_decimal": 59288 + }, + { + "icon_id": "15562249", + "name": "合同设置", + "font_class": "hetongshezhi", + "unicode": "e799", + "unicode_decimal": 59289 + }, + { + "icon_id": "15562250", + "name": "课程包管理", + "font_class": "kechengbaoguanli", + "unicode": "e79a", + "unicode_decimal": 59290 + }, + { + "icon_id": "15562251", + "name": "用户管理", + "font_class": "yonghuguanli", + "unicode": "e79b", + "unicode_decimal": 59291 + }, + { + "icon_id": "15562252", + "name": "用户画像", + "font_class": "yonghuhuaxiang", + "unicode": "e79c", + "unicode_decimal": 59292 + }, + { + "icon_id": "15562253", + "name": "帐号管理", + "font_class": "zhanghaoguanli", + "unicode": "e79d", + "unicode_decimal": 59293 + }, + { + "icon_id": "15562254", + "name": "SEM管理", + "font_class": "SEMguanli", + "unicode": "e79e", + "unicode_decimal": 59294 + }, + { + "icon_id": "15562255", + "name": "预算", + "font_class": "yusuan", + "unicode": "e79f", + "unicode_decimal": 59295 + }, + { + "icon_id": "15562256", + "name": "名片报表", + "font_class": "mingpianbaobiao", + "unicode": "e7a0", + "unicode_decimal": 59296 + }, + { + "icon_id": "15562257", + "name": "订单管理", + "font_class": "dingdanguanli", + "unicode": "e7a1", + "unicode_decimal": 59297 + }, + { + "icon_id": "15562258", + "name": "推广管理", + "font_class": "tuiguangguanli", + "unicode": "e7a2", + "unicode_decimal": 59298 + }, + { + "icon_id": "15562259", + "name": "专题管理", + "font_class": "zhuantiguanli", + "unicode": "e7a3", + "unicode_decimal": 59299 + }, + { + "icon_id": "15562260", + "name": "信息流", + "font_class": "xinxiliu", + "unicode": "e7a4", + "unicode_decimal": 59300 + }, + { + "icon_id": "15562261", + "name": "销售设置", + "font_class": "xiaoshoushezhi", + "unicode": "e7a5", + "unicode_decimal": 59301 + }, + { + "icon_id": "18486333", + "name": "素材管理", + "font_class": "sucaiguanli", + "unicode": "e7a9", + "unicode_decimal": 59305 + }, + { + "icon_id": "18486347", + "name": "学生导入", + "font_class": "xueshengdaoru", + "unicode": "e7aa", + "unicode_decimal": 59306 + }, + { + "icon_id": "18486348", + "name": "商品管理", + "font_class": "shangpinguanli", + "unicode": "e7ab", + "unicode_decimal": 59307 + }, + { + "icon_id": "18486365", + "name": "排课管理", + "font_class": "paikeguanli", + "unicode": "e7ac", + "unicode_decimal": 59308 + }, + { + "icon_id": "18486366", + "name": "信息导入", + "font_class": "xinxidaoru", + "unicode": "e7ad", + "unicode_decimal": 59309 + }, + { + "icon_id": "18486367", + "name": "收费配置", + "font_class": "shoufeipeizhi", + "unicode": "e7ae", + "unicode_decimal": 59310 + }, + { + "icon_id": "18486368", + "name": "用户权限", + "font_class": "yonghuquanxian", + "unicode": "e7af", + "unicode_decimal": 59311 + }, + { + "icon_id": "18486369", + "name": "在籍学生管理", + "font_class": "zaijixueshengguanli", + "unicode": "e7b0", + "unicode_decimal": 59312 + }, + { + "icon_id": "18486370", + "name": "学号管理", + "font_class": "xuehaoguanli", + "unicode": "e7b1", + "unicode_decimal": 59313 + }, + { + "icon_id": "18486371", + "name": "课程资源管理", + "font_class": "kechengziyuanguanli", + "unicode": "e7b2", + "unicode_decimal": 59314 + }, + { + "icon_id": "18486372", + "name": "面授教学安排", + "font_class": "mianshoujiaoxueanpai", + "unicode": "e7b3", + "unicode_decimal": 59315 + }, + { + "icon_id": "18486373", + "name": "账房", + "font_class": "zhangfang", + "unicode": "e7b4", + "unicode_decimal": 59316 + }, + { + "icon_id": "18486374", + "name": "开课管理", + "font_class": "kaikeguanli", + "unicode": "e7b5", + "unicode_decimal": 59317 + }, + { + "icon_id": "18486375", + "name": "毕业统计", + "font_class": "biyetongji", + "unicode": "e7b6", + "unicode_decimal": 59318 + }, + { + "icon_id": "18486377", + "name": "招生准备", + "font_class": "zhaoshengzhunbei", + "unicode": "e7b8", + "unicode_decimal": 59320 + }, + { + "icon_id": "18486379", + "name": "排课设置", + "font_class": "paikeshezhi", + "unicode": "e7b9", + "unicode_decimal": 59321 + }, + { + "icon_id": "18486380", + "name": "班级管理", + "font_class": "banjiguanli", + "unicode": "e7ba", + "unicode_decimal": 59322 + }, + { + "icon_id": "18486382", + "name": "精品课堂", + "font_class": "jingpinketang", + "unicode": "e7bb", + "unicode_decimal": 59323 + }, + { + "icon_id": "18486383", + "name": "员工提点", + "font_class": "yuangongtidian", + "unicode": "e7bc", + "unicode_decimal": 59324 + }, + { + "icon_id": "18486384", + "name": "考试安排", + "font_class": "kaoshianpai", + "unicode": "e7bd", + "unicode_decimal": 59325 + }, + { + "icon_id": "18486551", + "name": "网络教学安排", + "font_class": "wangluojiaoxueanpai", + "unicode": "e7bf", + "unicode_decimal": 59327 + }, + { + "icon_id": "18493044", + "name": "入学成绩", + "font_class": "ruxuechengji", + "unicode": "e7c3", + "unicode_decimal": 59331 + }, + { + "icon_id": "18493065", + "name": "面授教学", + "font_class": "mianshoujiaoxue", + "unicode": "e7c6", + "unicode_decimal": 59334 + }, + { + "icon_id": "18493071", + "name": "教师教室管理", + "font_class": "jiaoshijiaoshiguanli", + "unicode": "e7c7", + "unicode_decimal": 59335 + }, + { + "icon_id": "18493074", + "name": "录取管理", + "font_class": "luquguanli", + "unicode": "e7c8", + "unicode_decimal": 59336 + }, + { + "icon_id": "18493075", + "name": "录取成绩", + "font_class": "luquchengji", + "unicode": "e7c9", + "unicode_decimal": 59337 + }, + { + "icon_id": "18493080", + "name": "资源", + "font_class": "ziyuan", + "unicode": "e7ca", + "unicode_decimal": 59338 + }, + { + "icon_id": "18493083", + "name": "课件", + "font_class": "kejian", + "unicode": "e7cc", + "unicode_decimal": 59340 + }, + { + "icon_id": "18493085", + "name": "外部课件", + "font_class": "waibukejian", + "unicode": "e7cd", + "unicode_decimal": 59341 + }, + { + "icon_id": "18493087", + "name": "日志管理", + "font_class": "rizhiguanli", + "unicode": "e7ce", + "unicode_decimal": 59342 + }, + { + "icon_id": "18493091", + "name": "模版管理", + "font_class": "mobanguanli", + "unicode": "e7cf", + "unicode_decimal": 59343 + }, + { + "icon_id": "18493288", + "name": "学历认证", + "font_class": "xuelirenzheng", + "unicode": "e7d1", + "unicode_decimal": 59345 + }, + { + "icon_id": "18493306", + "name": "异议处理", + "font_class": "yiyichuli", + "unicode": "e7d2", + "unicode_decimal": 59346 + }, + { + "icon_id": "18493315", + "name": "论文申报", + "font_class": "lunwenshenbao", + "unicode": "e7d3", + "unicode_decimal": 59347 + }, + { + "icon_id": "18493322", + "name": "论文设置", + "font_class": "lunwenshezhi", + "unicode": "e7d4", + "unicode_decimal": 59348 + }, + { + "icon_id": "18493393", + "name": "教学点设置", + "font_class": "jiaoxuedianshezhi", + "unicode": "e7d5", + "unicode_decimal": 59349 + }, + { + "icon_id": "18493447", + "name": "补录沉降", + "font_class": "buluchenjiang", + "unicode": "e7d6", + "unicode_decimal": 59350 + }, + { + "icon_id": "18493458", + "name": "模块设置", + "font_class": "mokuaishezhi", + "unicode": "e7d7", + "unicode_decimal": 59351 + }, + { + "icon_id": "18493462", + "name": "资料管理", + "font_class": "ziliaoguanli", + "unicode": "e7d8", + "unicode_decimal": 59352 + }, + { + "icon_id": "18493464", + "name": "集团管理", + "font_class": "jituanguanli", + "unicode": "e7d9", + "unicode_decimal": 59353 + }, + { + "icon_id": "18493465", + "name": "应用管理", + "font_class": "yingyongguanli", + "unicode": "e7da", + "unicode_decimal": 59354 + }, + { + "icon_id": "18493468", + "name": "官网试卷", + "font_class": "guanwangshijuan", + "unicode": "e7db", + "unicode_decimal": 59355 + }, + { + "icon_id": "18493471", + "name": "我的网课", + "font_class": "wodewangke", + "unicode": "e7dc", + "unicode_decimal": 59356 + }, + { + "icon_id": "18493474", + "name": "脚本管理", + "font_class": "jiaobenguanli", + "unicode": "e7dd", + "unicode_decimal": 59357 + }, + { + "icon_id": "18493477", + "name": "专业管理员", + "font_class": "zhuanyeguanliyuan", + "unicode": "e7de", + "unicode_decimal": 59358 + }, + { + "icon_id": "18493480", + "name": "学生成绩", + "font_class": "xueshengchengji", + "unicode": "e7df", + "unicode_decimal": 59359 + }, + { + "icon_id": "18494025", + "name": "服务管理", + "font_class": "fuwuguanli", + "unicode": "e7e2", + "unicode_decimal": 59362 + }, + { + "icon_id": "18494028", + "name": "代金券", + "font_class": "daijinquan", + "unicode": "e7e3", + "unicode_decimal": 59363 + }, + { + "icon_id": "18494030", + "name": "呼叫中心", + "font_class": "hujiaozhongxin", + "unicode": "e7e4", + "unicode_decimal": 59364 + }, + { + "icon_id": "18494031", + "name": "引进收费", + "font_class": "yinjinshoufei", + "unicode": "e7e5", + "unicode_decimal": 59365 + }, + { + "icon_id": "18494033", + "name": "应缴清单", + "font_class": "yingjiaoqingdan", + "unicode": "e7e6", + "unicode_decimal": 59366 + }, + { + "icon_id": "18494034", + "name": "对账单", + "font_class": "duizhangdan", + "unicode": "e7e7", + "unicode_decimal": 59367 + }, + { + "icon_id": "18494036", + "name": "商机管理", + "font_class": "shangjiguanli", + "unicode": "e7e8", + "unicode_decimal": 59368 + }, + { + "icon_id": "18494037", + "name": "企微会话存档", + "font_class": "qiyehuihuacundang", + "unicode": "e7e9", + "unicode_decimal": 59369 + }, + { + "icon_id": "18494048", + "name": "用户设置", + "font_class": "yonghushezhi", + "unicode": "e7ea", + "unicode_decimal": 59370 + }, + { + "icon_id": "18494050", + "name": "消息设置", + "font_class": "xiaoxishezhi", + "unicode": "e7ec", + "unicode_decimal": 59372 + }, + { + "icon_id": "18494051", + "name": "营销设置", + "font_class": "yingxiaoshezhi", + "unicode": "e7ed", + "unicode_decimal": 59373 + }, + { + "icon_id": "18494056", + "name": "服务市场", + "font_class": "fuwushichang", + "unicode": "e7ee", + "unicode_decimal": 59374 + }, + { + "icon_id": "18494060", + "name": "素材资源", + "font_class": "sucaiziyuan", + "unicode": "e7ef", + "unicode_decimal": 59375 + }, + { + "icon_id": "18494089", + "name": "营销玩法", + "font_class": "yingxiaowanfa", + "unicode": "e7f0", + "unicode_decimal": 59376 + }, + { + "icon_id": "18494111", + "name": "推广", + "font_class": "tuiguang", + "unicode": "e7f1", + "unicode_decimal": 59377 + }, + { + "icon_id": "18494112", + "name": "用户列表", + "font_class": "yonghuliebiao", + "unicode": "e7f2", + "unicode_decimal": 59378 + }, + { + "icon_id": "8387574", + "name": "资源管理", + "font_class": "ziyuanguanli", + "unicode": "e692", + "unicode_decimal": 59026 + }, + { + "icon_id": "8387603", + "name": "课程管理", + "font_class": "kechengguanli", + "unicode": "e693", + "unicode_decimal": 59027 + }, + { + "icon_id": "8387606", + "name": "课程包", + "font_class": "kechengbao", + "unicode": "e694", + "unicode_decimal": 59028 + }, + { + "icon_id": "8387646", + "name": "题库管理", + "font_class": "tikuguanli", + "unicode": "e695", + "unicode_decimal": 59029 + }, + { + "icon_id": "8387654", + "name": "网课市场", + "font_class": "wangkeshichang", + "unicode": "e696", + "unicode_decimal": 59030 + }, + { + "icon_id": "8387659", + "name": "工单", + "font_class": "gongdan", + "unicode": "e697", + "unicode_decimal": 59031 + }, + { + "icon_id": "8387662", + "name": "访客管理", + "font_class": "fangkeguanli", + "unicode": "e698", + "unicode_decimal": 59032 + }, + { + "icon_id": "8387718", + "name": "线索管理", + "font_class": "xiansuoguanli", + "unicode": "e699", + "unicode_decimal": 59033 + }, + { + "icon_id": "8387737", + "name": "客户管理", + "font_class": "kehuguanli", + "unicode": "e69a", + "unicode_decimal": 59034 + }, + { + "icon_id": "8387740", + "name": "集团客户", + "font_class": "jituankehu", + "unicode": "e69b", + "unicode_decimal": 59035 + }, + { + "icon_id": "8387742", + "name": "跟进记录", + "font_class": "genjinjilu", + "unicode": "e69c", + "unicode_decimal": 59036 + }, + { + "icon_id": "8387743", + "name": "呼叫管理", + "font_class": "hujiaoguanli", + "unicode": "e69d", + "unicode_decimal": 59037 + }, + { + "icon_id": "8387803", + "name": "工作台", + "font_class": "gongzuotai", + "unicode": "e69e", + "unicode_decimal": 59038 + }, + { + "icon_id": "8387806", + "name": "数据报表", + "font_class": "shujubaobiao", + "unicode": "e69f", + "unicode_decimal": 59039 + }, + { + "icon_id": "8387807", + "name": "访客报表", + "font_class": "fangkebaobiao", + "unicode": "e6a0", + "unicode_decimal": 59040 + }, + { + "icon_id": "8387808", + "name": "账簿管理", + "font_class": "zhangbuguanli", + "unicode": "e6a1", + "unicode_decimal": 59041 + }, + { + "icon_id": "8387809", + "name": "账簿管理_子系统", + "font_class": "zhangbuguanli_zi", + "unicode": "e6a2", + "unicode_decimal": 59042 + }, + { + "icon_id": "8387811", + "name": "账簿管理_子系统", + "font_class": "zhangbuguanli_zixitong_A", + "unicode": "e6a3", + "unicode_decimal": 59043 + }, + { + "icon_id": "8387812", + "name": "合同管理", + "font_class": "hetongguanli", + "unicode": "e6a4", + "unicode_decimal": 59044 + }, + { + "icon_id": "8387816", + "name": "运营者管理", + "font_class": "yunyingzheguanli", + "unicode": "e6a5", + "unicode_decimal": 59045 + }, + { + "icon_id": "8387819", + "name": "招聘管理", + "font_class": "zhaopinguanli", + "unicode": "e6a6", + "unicode_decimal": 59046 + }, + { + "icon_id": "8387821", + "name": "工资管理", + "font_class": "gongziguanli", + "unicode": "e6a7", + "unicode_decimal": 59047 + }, + { + "icon_id": "8387824", + "name": "我的审批", + "font_class": "wodeshenpi", + "unicode": "e6a8", + "unicode_decimal": 59048 + }, + { + "icon_id": "8387827", + "name": "标准模版设置", + "font_class": "biaozhunmobanshezhi", + "unicode": "e6a9", + "unicode_decimal": 59049 + }, + { + "icon_id": "8387829", + "name": "基础设置", + "font_class": "jichushezhi", + "unicode": "e6aa", + "unicode_decimal": 59050 + }, + { + "icon_id": "8387835", + "name": "财务设置", + "font_class": "caiwushezhi", + "unicode": "e6ab", + "unicode_decimal": 59051 + }, + { + "icon_id": "8387838", + "name": "产品设置", + "font_class": "chanpinshezhi", + "unicode": "e6ac", + "unicode_decimal": 59052 + }, + { + "icon_id": "8387841", + "name": "审批设置", + "font_class": "shenpishezhi", + "unicode": "e6ad", + "unicode_decimal": 59053 + }, + { + "icon_id": "8387842", + "name": "目标管理", + "font_class": "mubiaoguanli", + "unicode": "e6ae", + "unicode_decimal": 59054 + }, + { + "icon_id": "8387843", + "name": "站点设置", + "font_class": "zhandianshezhi", + "unicode": "e6af", + "unicode_decimal": 59055 + }, + { + "icon_id": "8387856", + "name": "人事设置", + "font_class": "renshishezhi", + "unicode": "e6b0", + "unicode_decimal": 59056 + }, + { + "icon_id": "8387864", + "name": "CRM设置", + "font_class": "CRMshezhi", + "unicode": "e6b1", + "unicode_decimal": 59057 + }, + { + "icon_id": "8387868", + "name": "名片设置", + "font_class": "mingpianshezhi", + "unicode": "e6b2", + "unicode_decimal": 59058 + }, + { + "icon_id": "8387869", + "name": "网校设置", + "font_class": "wangxiaoshezhi", + "unicode": "e6b3", + "unicode_decimal": 59059 + }, + { + "icon_id": "8471135", + "name": "我的点评", + "font_class": "wodedianping", + "unicode": "e6b4", + "unicode_decimal": 59060 + }, + { + "icon_id": "8471145", + "name": "我的学生", + "font_class": "wodexuesheng", + "unicode": "e6b5", + "unicode_decimal": 59061 + }, + { + "icon_id": "8471169", + "name": "联系记录", + "font_class": "lianxijilu", + "unicode": "e6b8", + "unicode_decimal": 59064 + }, + { + "icon_id": "8471181", + "name": "投诉提问", + "font_class": "tousutiwen", + "unicode": "e6b9", + "unicode_decimal": 59065 + }, + { + "icon_id": "8471188", + "name": "培训计划", + "font_class": "peixunjihua", + "unicode": "e6ba", + "unicode_decimal": 59066 + }, + { + "icon_id": "8471193", + "name": "费用查询", + "font_class": "feiyongchaxun", + "unicode": "e6bb", + "unicode_decimal": 59067 + }, + { + "icon_id": "8471198", + "name": "学生缴费", + "font_class": "xueshengjiaofei", + "unicode": "e6bc", + "unicode_decimal": 59068 + }, + { + "icon_id": "8471207", + "name": "记账", + "font_class": "jizhang", + "unicode": "e6bd", + "unicode_decimal": 59069 + }, + { + "icon_id": "8471221", + "name": "查账", + "font_class": "chaxun", + "unicode": "e6be", + "unicode_decimal": 59070 + }, + { + "icon_id": "8471233", + "name": "查账", + "font_class": "chazhang", + "unicode": "e6bf", + "unicode_decimal": 59071 + }, + { + "icon_id": "8471236", + "name": "报表", + "font_class": "baobiao", + "unicode": "e6c0", + "unicode_decimal": 59072 + }, + { + "icon_id": "8471255", + "name": "设置", + "font_class": "shezhi", + "unicode": "e6c2", + "unicode_decimal": 59074 + }, + { + "icon_id": "8471320", + "name": "招生报表", + "font_class": "daqiajilu", + "unicode": "e6ce", + "unicode_decimal": 59086 + }, + { + "icon_id": "8471348", + "name": "打卡记录", + "font_class": "wangluobanji", + "unicode": "e6d3", + "unicode_decimal": 59091 + }, + { + "icon_id": "8471363", + "name": "网络班级", + "font_class": "wangxiaoshezhi1", + "unicode": "e6d6", + "unicode_decimal": 59094 + }, + { + "icon_id": "8471373", + "name": "小程序", + "font_class": "houtaishezhi", + "unicode": "e6d8", + "unicode_decimal": 59096 + }, + { + "icon_id": "8471401", + "name": "后台设置", + "font_class": "zhaoshengshezhi", + "unicode": "e6db", + "unicode_decimal": 59099 + }, + { + "icon_id": "8471419", + "name": "招生设置", + "font_class": "xiaoxizhongxin", + "unicode": "e6df", + "unicode_decimal": 59103 + }, + { + "icon_id": "8471685", + "name": "消息中心", + "font_class": "zhaoshengbaobiao", + "unicode": "e6e1", + "unicode_decimal": 59105 + }, + { + "icon_id": "8524999", + "name": "菜单管理", + "font_class": "caidanguanli", + "unicode": "e6e2", + "unicode_decimal": 59106 + }, + { + "icon_id": "8525001", + "name": "集团设置", + "font_class": "jituanshezhi", + "unicode": "e6e3", + "unicode_decimal": 59107 + }, + { + "icon_id": "8525011", + "name": "市场管理", + "font_class": "shichangguanli", + "unicode": "e6e4", + "unicode_decimal": 59108 + }, + { + "icon_id": "8525013", + "name": "创建系统", + "font_class": "chuangjianxitong", + "unicode": "e6e5", + "unicode_decimal": 59109 + }, + { + "icon_id": "8525045", + "name": "工单管理", + "font_class": "gongdanguanli", + "unicode": "e6e6", + "unicode_decimal": 59110 + }, + { + "icon_id": "8525057", + "name": "短信", + "font_class": "duanxin", + "unicode": "e6e7", + "unicode_decimal": 59111 + }, + { + "icon_id": "8525060", + "name": "帮助中心", + "font_class": "bangzhuzhongxin", + "unicode": "e6e8", + "unicode_decimal": 59112 + } + ] +} diff --git a/public/static/layui/font/extend/iconfont.svg b/public/static/layui/font/extend/iconfont.svg deleted file mode 100644 index b279f4f..0000000 --- a/public/static/layui/font/extend/iconfont.svg +++ /dev/null @@ -1,104 +0,0 @@ - - - - - -Created by iconfont - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/public/static/layui/font/extend/iconfont.ttf b/public/static/layui/font/extend/iconfont.ttf index 28c3385..ee039f6 100644 Binary files a/public/static/layui/font/extend/iconfont.ttf and b/public/static/layui/font/extend/iconfont.ttf differ diff --git a/public/static/layui/font/extend/iconfont.woff b/public/static/layui/font/extend/iconfont.woff index 7cd919d..1342c0b 100644 Binary files a/public/static/layui/font/extend/iconfont.woff and b/public/static/layui/font/extend/iconfont.woff differ diff --git a/public/static/layui/font/extend/iconfont.woff2 b/public/static/layui/font/extend/iconfont.woff2 index 9075266..656859e 100644 Binary files a/public/static/layui/font/extend/iconfont.woff2 and b/public/static/layui/font/extend/iconfont.woff2 differ diff --git a/public/static/layui/plugin/authtree.js b/public/static/layui/plugin/authtree.js new file mode 100644 index 0000000..69a85b3 --- /dev/null +++ b/public/static/layui/plugin/authtree.js @@ -0,0 +1,145 @@ +layui.define(['jquery', 'form'], function(exports){ + $ = layui.jquery; + form = layui.form; + + obj = { + // 渲染 + 绑定事件 + /** + * 渲染DOM并绑定事件 + * @param {[type]} dst [目标ID,如:#test1] + * @param {[type]} trees [数据,格式:{}] + * @param {[type]} inputname [上传表单名] + * @param {[type]} layfilter [lay-filter的值] + * @param {[type]} openall [默认展开全部] + * @param {[type]} opengrade [展开的节点级别] + * @param {[type]} checkboxrelated [多选是否关联节点] + * @return {[type]} selecttype [checkbox or radio] + */ + render: function(dst, trees, opt){ + var inputname = opt.inputname ? opt.inputname : 'menuids[]'; + var layfilter = opt.layfilter ? opt.layfilter : 'checkauth'; + var openall = opt.openall ? opt.openall : false; + var selecttype = opt.selecttype ? opt.selecttype : 'checkbox'; + var checkboxrelated = opt.checkboxrelated ? opt.checkboxrelated : 0; + var opengrade = opt.opengrade ? opt.opengrade : 0; + $(dst).html(obj.renderAuth(trees, 0, {inputname: inputname, layfilter: layfilter, openall: openall,selecttype:selecttype,opengrade:opengrade,checkboxrelated:checkboxrelated})); + form.render(); + + $(dst).find('.auth-single:first').unbind('click').on('click', '.layui-form-checkbox', function(){ + if(checkboxrelated==1){ + return; + } + var elem = $(this).prev(); + var checked = elem.is(':checked'); + var childs = elem.parent().next().find('input[type="checkbox"]').prop('checked', checked); + if(checked){ + /*查找child的前边一个元素,并将里边的checkbox选中状态改为true。*/ + elem.parents('.auth-child').prev().find('input[type="checkbox"]').prop('checked', true); + } + /*console.log(childs);*/ + form.render('checkbox'); + }); + + /* + $(dst).find('.auth-single:first').unbind('click').on('click', '.layui-form-radio', function(){ + obj.getRadio(dst); + }); + */ + + /*动态绑定展开事件*/ + $(dst).unbind('click').on('click', '.auth-icon', function(){ + var origin = $(this); + var child = origin.parent().parent().find('.auth-child:first'); + if(origin.is('.active')){ + /*收起*/ + origin.removeClass('active').html(''); + child.slideUp('fast'); + } else { + /*展开*/ + origin.addClass('active').html(''); + child.slideDown('fast'); + } + return false; + }) + return obj; + }, + // 递归创建格式 + renderAuth: function(tree, dept, opt){ + var inputname = opt.inputname; + var layfilter = opt.layfilter; + var openall = opt.openall; + var opengrade = opt.opengrade; + var selecttype = opt.selecttype; + var str = '
              '; + layui.each(tree, function(index, item){ + var hasChild = item.list ? 1 : 0; + // 注意:递归调用时,this的环境会改变! + var append = hasChild ? obj.renderAuth(item.list, dept+1, opt) : ''; + // '+new Array(dept * 4).join(' ')+' + if(dept<=opengrade){ + openall=true; + } + str += '
              '+(hasChild?''+(openall?'':'')+'':'')+(dept > 0 ? '├─ ':'')+'
              '+append+'
              ' + }); + str += '
              '; + return str; + }, + // 获取选中叶子结点 + getLeaf: function(dst){ + var leafs = $(dst).find('.auth-leaf').parent().find('input[type="checkbox"]:checked'); + var data = []; + leafs.each(function(index, item){ + // console.log(item); + data.push(item.value); + }); + // console.log(data); + return data; + }, + // 获取所有选中的数据 + getAll: function(dst){ + var inputs = $(dst).find('input[type="checkbox"]'); + var data = []; + inputs.each(function(index, item){ + data.push(item.value); + }); + // console.log(data); + return data; + }, + // 获取所有选中的数据 + getChecked: function(dst){ + var inputs = $(dst).find('input[type="checkbox"]:checked'); + var val = [],title=[]; + inputs.each(function(index, item){ + val.push(item.value); + title.push($(item).attr('title')); + }); + res={val:val,title:title}; + // console.log(data); + return res; + }, + // 获取未选中数据 + getNotChecked: function(dst){ + var inputs = $(dst).find('input[type="checkbox"]:not(:checked)'); + var val = [],title=[]; + inputs.each(function(index, item){ + val.push(item.value); + title.push($(item).attr('title')); + }); + res={val:val,title:title}; + // console.log(data); + return res; + }, + // 获取所有选中的radio数据 + getRadio: function(dst){ + var radios=$(dst).find('input[type="radio"]:checked'); + var res={val:'',title:''}; + var val = radios.val(); + var title=radios.attr('title'); + if(radios){ + res={val:val,title:title}; + } + return res; + } + } + exports('authtree', obj); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/dltable.js b/public/static/layui/plugin/dltable.js new file mode 100644 index 0000000..add41bf --- /dev/null +++ b/public/static/layui/plugin/dltable.js @@ -0,0 +1,2208 @@ +layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){ + "use strict"; + var $ = layui.$ + ,laytpl = layui.laytpl + ,laypage = layui.laypage + ,layer = layui.layer + ,form = layui.form + ,hint = layui.hint() + ,device = layui.device() + + //外部接口 + ,table = { + config: {//全局配置项,表格级别 + indexName: 'lay_table_index' //下标索引名 + ,cols:{//节点级别的附加字段 + isCheckName: 'lay_is_checked' //选中状态(true,false) + ,isRadio:'lay_is_radio'//单选状态(true,false) + ,isOpen:'lay_is_open'//是否展开节点 + ,isShow:'lay_is_show'//是否显示节点 + ,level:'lay_level'//节点的层级关系(不需要设置) + ,children:'children'//存放下级的变量 + } + } + /** + * 缓存数据 + * + * 结构图示 + * cache{} 缓存(对象) + * key['data']{} 全部数据缓存(对象) + * key[list][] 列表数据对象(数组) + * key[map]{} 列表数据Map对象(Map) + * key[treeList][] 树状结构的对象(数组) + * key['cla']{} 全部已初始化过的Calss对象类(注意渲染是异步执行) + * key['claIds'][] 全部已经吊用过初始化方法的表格类 + * key[claObjs]{key[tableId]} 全部已经初始化好的cla对象 + * + */ + ,cache: { + tableId:{ + data:{ + list:[]//列表数据 + ,map:{}//列表数据以idField或唯一值作为key的Map数据 + ,treeList:[]//树状数据 + } + } + ,cla:{ + claIds:{ + tableId:true + } + ,claObjs:{ + tableId:{} + } + } + ,selectcode:{//数据字典缓存 + demokey:[ + { + key:{value:''} + } + ] + } + } + ,index: layui.table ? (layui.table.index + 10000) : 0 + /** + * 设置全局项 + * @param options + * @return {table} + */ + ,set: function(options){ + var that = this; + that.config = $.extend({}, that.config, options); + return that; + } + /** + * 事件监听 + * @param events + * @param callback + * @return {*} + */ + ,on: function(events, callback){ + return layui.onevent.call(this, MOD_NAME, events, callback); + } + ,getClass:function (tableId) { + return table.cache.cla.claObjs[tableId];; + } + ,pushClass:function (tableId,that) { + table.cache.cla.claObjs[tableId]=that; + } + ,isCalss:function (tableId) { + var ids=this.cache.cla.claIds||{}; + return ids.hasOwnProperty(tableId)||false; + } + ,isClassYes:function (tableId) { + var ids=this.cache.cla.claIds||{}; + return ids[tableId]||false; + } + ,pushClassIds:function (tableId,is) { + this.cache.cla.claIds[tableId]=is; + } + ,setObj:function (tableId,key,o) { + if(!this.obj[tableId])this.obj[tableId]={}; + this.obj[tableId][key]=o; + } + ,getObj:function (tableId, key) { + return this.obj[tableId]?this.obj[tableId][key]:null; + } + /** + * 获取列表数据 + */ + ,getDataList:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.list; + } + return []; + } + /** + * 设置列表数据 + */ + ,setDataList:function (tableId, list) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.list)table.cache[tableId].data.list=[]; + table.cache[tableId].data.list=list; + } + /** + * 获取列表数据 + */ + ,getDataMap:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.map; + } + return {}; + } + /** + * 设置列表数据 + */ + ,setDataMap:function (tableId, map) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.map)table.cache[tableId].data.map={}; + table.cache[tableId].data.map=map; + } + /** + * 获取树状数据 + */ + ,getDataTreeList:function (tableId) { + if(table.cache[tableId]){ + return table.cache[tableId].data.treeList; + } + return []; + } + /** + * 设置树状数据 + */ + ,setDataTreeList:function (tableId, treeList) { + if(!table.cache[tableId])table.cache[tableId]={}; + if(!table.cache[tableId].data)table.cache[tableId].data={}; + if(!table.cache[tableId].data.treeList)table.cache[tableId].data.treeList={}; + table.cache[tableId].data.treeList=treeList; + } + /** + * 初始化 + * @param filter + * @param settings + * @return {table} + */ + ,init:function (filter, settings) { + settings = settings || {}; + var that = this + ,elemTable = filter ? $('table[lay-filter="'+ filter +'"]') : $(ELEM + '[lay-data]') + ,errorTips = 'Table element property lay-data configuration item has a syntax error: '; + //遍历数据表格 + elemTable.each(function(){ + var othis = $(this), tableData = othis.attr('lay-data'); + try{ + tableData = new Function('return '+ tableData)(); + } catch(e){ + hint.error(errorTips + tableData) + } + var cols = [], options = $.extend({ + elem: this + ,cols: [] + ,data: [] + ,skin: othis.attr('lay-skin') //风格 + ,size: othis.attr('lay-size') //尺寸 + ,even: typeof othis.attr('lay-even') === 'string' //偶数行背景 + }, table.config, settings, tableData); + + filter && othis.hide(); + + //获取表头数据 + othis.find('thead>tr').each(function(i){ + options.cols[i] = []; + $(this).children().each(function(ii){ + var th = $(this), itemData = th.attr('lay-data'); + + try{ + itemData = new Function('return '+ itemData)(); + } catch(e){ + return hint.error(errorTips + itemData) + } + + var row = $.extend({ + title: th.text() + ,colspan: th.attr('colspan') || 0 //列单元格 + ,rowspan: th.attr('rowspan') || 0 //行单元格 + }, itemData); + + if(row.colspan < 2) cols.push(row); + options.cols[i].push(row); + }); + }); + + //获取表体数据 + othis.find('tbody>tr').each(function(i1){ + var tr = $(this), row = {}; + //如果定义了字段名 + tr.children('td').each(function(i2, item2){ + var td = $(this) + ,field = td.data('field'); + if(field){ + return row[field] = td.html(); + } + }); + //如果未定义字段名 + layui.each(cols, function(i3, item3){ + var td = tr.children('td').eq(i3); + row[item3.field] = td.html(); + }); + options.data[i1] = row; + }); + table.render(options); + }); + + return that; + } + /** + * 渲染入口方法(核心入口) + */ + ,render:function (options) { + table.pushClassIds(options.id); + var inst = new Class(options); + return thisTable.call(inst); + } + /** + * 对应的表格加载完成后执行 + * @param tableId + * @param fn + */ + ,ready:function (tableId,fn) { + var is=false; + var myDate=new Date(); + function isReady() { + if(tableId){ + var that=table.getClass(tableId); + if(that&&that.hasOwnProperty('layBody')){ + fn(that); + is=true; + }else{ + var myDate2=new Date(); + var i=myDate2.getTime()-myDate.getTime(); + if(i<=(1000*10)&&!is){//大于10秒退出 + setTimeout(isReady,50); + } + } + } + } + if(tableId&&fn){ + setTimeout(isReady,50); + } + } + /** + * 获取表格选中记录 + * @param tableId + * @return {{data: Array, isAll: boolean}} + */ + ,checkStatus:function (tableId) { + var nums = 0 + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || []; + //计算全选个数 + layui.each(data, function(i, item){ + if(item.constructor === Array){ + invalidNum++; //无效数据,或已删除的 + return; + } + if(item[table.config.cols.isCheckName]){ + nums++; + arr.push(table.clearCacheKey(item)); + } + }); + return { + data: arr //选中的数据 + ,isAll: data.length ? (nums === (data.length - invalidNum)) : false //是否全选 + }; + } + /** + * 设置表格复选状态 + * @param tableId + * @param value 此值存在时为设置操作 + * @returns {*} + */ + ,setCheckStatus:function(tableId, fildName, ids){ + var retObj=null; + var that=table.getClass(tableId) + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || [] + ,childs = that.layBody.find('input[name="layTableCheckbox"]')//复选框 + ; + if(fildName&&ids){//设置选中 + var idsarr=ids.split(','); + idsarr.forEach(function (o) { + // console.log(o); + var temo=null; + data.forEach(function (e) { + var b1=e[fildName]+""; + var b2=o+""; + if(b1==b2){ + temo=e; + return; + }; + }); + if(temo){ + var v=temo[table.config.indexName]; + that.layBody.find('input[name="layTableCheckbox"][value="'+v+'"]').prop("checked",true); + that.setCheckData(v, true); + } + }); + that.syncCheckAll(); + that.renderForm('checkbox'); + } + return retObj; + } + /** + * 表格单选状态 + * @param tableId + * @param value 此值存在时为设置操作 + * @returns {*} + */ + ,radioStatus:function (tableId) { + var retObj=null; + var nums = 0 + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || []; + var v=$("input[name='"+TABLE_RADIO_ID+tableId+"']:checked").val(); + v=parseInt(v); + data.forEach(function (e) { + if(e[table.config.indexName]==v){ + retObj=e; + return; + }; + }); + return retObj; + } + /** + * 设置表格单选状态 + * @param tableId + * @param value 此值存在时为设置操作 + * @returns {*} + */ + ,setRadioStatus:function (tableId,fildName,value) { + var retObj=null; + var nums = 0 + ,invalidNum = 0 + ,arr = [] + ,data = table.getDataList(tableId) || []; + + if(fildName&&value){//设置选中 + data.forEach(function (e) { + var b1=e[fildName]+""; + var b2=value+""; + if(b1==b2){ + retObj=e; + return; + }; + }); + + if(retObj){ + var v=retObj[table.config.indexName]; + $("input:radio[name='"+TABLE_RADIO_ID+tableId+"'][value='"+v+"']").prop("checked",true); + form.render('radio'); + } + } + return retObj; + } + /** + * 清除临时Key + * @param data + * @return {*} + */ + ,clearCacheKey:function (data) { + data = $.extend({}, data); + delete data[table.config.cols.isCheckName]; + delete data[table.config.indexName]; + return data; + } + /** + * 刷新数据 + * @param id + * @param options + * @return {*} + */ + ,query:function (tableId, options) { + var that= table.getClass(tableId); + that.renderTdCss(); + that.pullData(that.page, that.loading()); + } + /** + * 此方法为整体重新渲染(重量级刷新方法) + * @param id + * @param options + */ + ,reload:function (tableId, options) { + var config = thisTable.config[tableId]; + options = options || {}; + if(!config) return hint.error('The ID option was not found in the table instance'); + if(options.data && options.data.constructor === Array) delete config.data; + return table.render($.extend(true, {}, config, options)); + } + /** + * 添加一行或多行数据 + * @param tableId 表格id + * @param index 在第几个位置插入(从0开始) + * @param data 数据 + * @returns {*} + */ + ,addRow:function (tableId, index, data) { + var that=table.getClass(tableId) + ,options=that.config + ,invalidNum = 0 + ,arr = [] + ,list = table.getDataList(tableId) || []; + //插入到父节点后面 + list.splice(index,0,data);//更新缓存 + table.restNumbers(list);//重置下标 + that.resetData(list); + //如果是树状则处理数据 + if(options.isTree) { + //处理父级 + var uo=that.treeFindUpData(data); + if(uo) { + that.treeNodeOpen(uo, true);//展开节点 + that.renderTreeConvertShowName(uo); + } + } + //生成html + var tds=that.renderTr(data,data[table.config.indexName]); + var trs=''+ tds.join('') + ''; + if(index==0){//在第一个位置插入 + var tbody=that.layBody.find('table tbody'); + $(tbody).prepend(trs); + that.layBody.find(".layui-none").remove(); + }else{ + var o=that.layBody.find('[data-index='+(index-1)+']');//父节点dom树 + $(o).after(trs); + } + that.renderForm(); + that.renderPage(that.config.page.count+1);//分页渲染 + that.restNumbers(); + } + /** + * 删除一行或多行数据 + * (如果是树状则删除自己和子节点) + * @param tableId + * @param data(1、数组;2、对象) + */ + ,delRow:function (tableId, data) { + //1、页面清除 2、缓存清除 + var that=table.getClass(tableId) + ,options=that.config + ,list=table.getDataList(tableId); + var sonList=[];//需要删除的数据 + var delIds={};//需要删除的数据map + var delDatas=[]; + var upDelDatas=[];//全部待删除节点的父节点(处理折叠) + if(!that||!data)return; + if(table.kit.isArray(data)){//是数组,删除多个 + delDatas=data; + }else{ + delDatas[0]=data; + } + delDatas.forEach(function(temo) {//记录全部父节点 + var uo=that.treeFindUpData(temo); + if(uo){ + upDelDatas.push(uo); + } + }); + sonList=options.isTree?table.treeFindSonList(that.config.id,delDatas):delDatas; + //页面元素处理 + sonList.forEach(function (temo) { + var index=temo[table.config.indexName]; + delIds[index]=index;//设置代删除的id集合 + var tr = that.layBody.find('tr[data-index="'+ index +'"]'); + tr.remove(); + }); + //数据处理 + that.restNumbers(); + var newList=[];//重构一个新的数组 + for (var i=0,len=list.length;i0){ + var temSonList=that.treeFindSonData(temo); + temSonList.forEach(function (temii) { + if(!delIds[temii[table.config.indexName]]){ + sonList.push(temii); + delIds[temii[table.config.indexName]]=temii[table.config.indexName]; + } + }); + } + sonList.push(temo); + delIds[temo[table.config.indexName]]=temo[table.config.indexName]; + }); + return sonList; + } + /** + * 获取全部需要子节点id集合 + * @param data(数组或对象) + */ + ,treeFindSonIds:function (tableId,data) { + var delIds=[]; + var sonList=table.treeFindSonList(tableId,data); + sonList.forEach(function (temo) { + delIds.push([table.config.indexName]); + }); + return delIds; + } + /** + * 获取全部的id字段集合 + * @param tableId + * @param data + * @returns {Array} + */ + ,treeFindSonIdFields:function (tableId,data) { + var idField=[]; + var that=table.getClass(tableId); + var sonList=table.treeFindSonList(tableId,data); + sonList.forEach(function (temo) { + idField.push(temo[that.config.idField]); + }); + return idField; + } + /** + * 工具方法对象 + */ + ,kit:{ + isArray:function (o) { + return Object.prototype.toString.call(o) === '[object Array]'; + } + } + } + //操作当前实例 + ,thisTable = function(){ + var that = this + ,options = that.config + ,id = options.id; + id && (thisTable.config[id] = options); + return { + reload: function(options){ + that.reload.call(that, options); + } + ,config: options + } + } + //字符常量 + ,MOD_NAME = 'dltable', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled', NONE = 'layui-none' + ,ELEM_VIEW = 'layui-table-view', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOOL = '.layui-table-tool', ELEM_PAGE = '.layui-table-page', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover' + ,TABLE_RADIO_ID='table_radio_' + ,ELEM_FILTER='.layui-table-filter' + ,TREE_ID='treeId',TREE_UPID='treeUpId',TREE_SHOW_NAME='treeShowName',TREE_KEY_MAP='tree_key_map' + //thead区域模板 + ,TPL_HEADER = function(options){ + var rowCols = '{{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}}'; + options = options || {}; + return ['
              + -
              +
              {volist name="vo.children" key="k" id="voo"} -
              +
              {notempty name="voo.children"} -
              +
              {volist name="voo.children" id="vooo"}
              @@ -110,7 +77,6 @@
              -
              {/block} @@ -127,17 +93,16 @@ form.on('submit(webform)', function (obj) { console.log(obj.field); $.ajax({ - url: '/admin/role/post_submit', + url: "/admin/role/add", data: obj.field, type: 'post', success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + parent.tableIns.reload(); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }); @@ -170,15 +135,7 @@ } form.render();//实时渲染选中和不选中的样式 }); - - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); - } - {include file="common/layui" base="base" extend="[]" callback="init" /} {/block} diff --git a/app/admin/view/role/index.html b/app/admin/view/role/index.html index 7aa142c..e50abc3 100644 --- a/app/admin/view/role/index.html +++ b/app/admin/view/role/index.html @@ -1,25 +1,22 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="body"} -
              -
              +
              +
              - +
              - {/block} @@ -28,38 +25,47 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/rule/add.html b/app/admin/view/rule/add.html index 5048bcb..86e995f 100644 --- a/app/admin/view/rule/add.html +++ b/app/admin/view/rule/add.html @@ -1,42 +1,105 @@ -{extend name="common/base"/} +{extend name="common/base" /} {block name="body"} -
              - + +

              功能菜单/节点

              + {if condition="$id eq 0"} +
              - + - + - + - + + + + + + + + + + +
              父级节点* - 父级菜单/节点* - - + {volist name=":set_recursion(get_admin_rule())" id="v"} {/volist} 节点名称* - 是否是左侧菜单* - + +
              节点验证规则菜单/节点名称* - + 附加规则操作日志名称* - + +
              菜单/节点URL + + 排序 + +
              图标 + + 如:icon-jichuguanli[查看图标]
              + {else/} + + + + + + + + + + + + + + + + + + + + + + + +
              父级菜单/节点* + + 是否左侧菜单* + + +
              菜单/节点名称* + + 操作日志名称* + +
              菜单/节点URL + + 排序 + +
              图标 + + 如:icon-jichuguanli[查看图标] +
              + {/if}
              + -
              {/block} @@ -51,31 +114,28 @@ //监听提交 form.on('submit(webform)', function (data) { + if(data.field.src!='' && data.field.module!=''){ + if(data.field.src.indexOf(data.field.module.toLowerCase()+'/')!=0){ + layer.msg('输入的菜单/节点URL与所属功能模块不匹配'); + return false; + } + } $.ajax({ - url: "/admin/rule/post_submit", + url: "/admin/rule/add", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表吗?', { - icon: 3, - title: '提示' - }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + window.setTimeout(function(){ + parent.location.reload(); + },1200); + } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/rule/index.html b/app/admin/view/rule/index.html index 41ae7a9..8fb2d7c 100644 --- a/app/admin/view/rule/index.html +++ b/app/admin/view/rule/index.html @@ -1,21 +1,11 @@ {extend name="common/base"/} - -{block name="style"} - -{/block} - {block name="body"} -
              -
              - + 添加节点点击表格内容可编辑 +
              +
              +
              -
              +
              @@ -25,57 +15,60 @@ {block name="script"} -{include file="common/layui" base="base" extend="['treeGrid']" callback="init" /} +{include file="common/layui" base="base" extend="['treeGrid','rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/search/index.html b/app/admin/view/search/index.html index 460641f..cf49087 100644 --- a/app/admin/view/search/index.html +++ b/app/admin/view/search/index.html @@ -1,8 +1,8 @@ {extend name="common/base"/} {block name="body"} -
              -
              +
              +
              diff --git a/app/admin/view/sitemap/add.html b/app/admin/view/sitemap/add.html index c2ee14f..e74d3b0 100644 --- a/app/admin/view/sitemap/add.html +++ b/app/admin/view/sitemap/add.html @@ -1,28 +1,24 @@ {extend name="common/base"/} {block name="body"} - + +

              网站地图分类

              - + - +
              分类名* - 分类名称* - - 排序 + 排序 - +
              -
              {/block} @@ -33,36 +29,26 @@ {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/sitemap/index.html b/app/admin/view/sitemap/index.html index 5598748..a89c713 100644 --- a/app/admin/view/sitemap/index.html +++ b/app/admin/view/sitemap/index.html @@ -1,8 +1,8 @@ {extend name="common/base"/} {block name="body"} -
              -
              +
              +
              @@ -14,12 +14,12 @@ {/block} @@ -27,13 +27,15 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/sitemap/sitemap_info.html b/app/admin/view/sitemap/sitemap_info.html index 9e426e4..38900c6 100644 --- a/app/admin/view/sitemap/sitemap_info.html +++ b/app/admin/view/sitemap/sitemap_info.html @@ -1,24 +1,21 @@ {extend name="common/base"/} {block name="body"} -
              +
              -
              - -
              {/block} @@ -26,12 +23,13 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/sitemap/sitemap_info_add.html b/app/admin/view/sitemap/sitemap_info_add.html index 8746e08..ddae08b 100644 --- a/app/admin/view/sitemap/sitemap_info_add.html +++ b/app/admin/view/sitemap/sitemap_info_add.html @@ -1,61 +1,46 @@ {extend name="common/base"/} {block name="body"} - + +

              网站地图内容

              - + - - + + - + - + - + - + @@ -68,10 +53,8 @@ {else/} {/notempty} - - {/block} @@ -117,30 +100,21 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/sitemap/sitemap_info_submit", + url: "/admin/sitemap/sitemap_info_add", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { - icon: 3, - title: '提示' - }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + parent.tableIns.reload(); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } {include file="common/layui" base="base" extend="[]" callback="init" /} diff --git a/app/admin/view/slide/add.html b/app/admin/view/slide/add.html index 4568f3b..3abdc99 100644 --- a/app/admin/view/slide/add.html +++ b/app/admin/view/slide/add.html @@ -1,23 +1,20 @@ {extend name="common/base"/} {block name="body"} - + +

              轮播组

              标题* - 标题* - + 排序排序
              PC端链接* - PC端链接* - - 移动端链接* + 移动端链接* - +
              PC端图片 - PC端图片
              - - + +
              移动端图片 - 移动端图片
              - - + +
              - + - - + + - + - +
              标题* - 标题* - + 标识标识
              状态* - 状态* {if condition="$id eq 0"} @@ -30,18 +27,15 @@
              备注 - 备注 - +
              -
              {/block} @@ -58,27 +52,21 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/slide/post_submit", + url: "/admin/slide/add", type: 'post', data: data.field, success: function (e) { + layer.msg(e.msg); if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); + parent.tableIns.reload(); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); } } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } diff --git a/app/admin/view/slide/index.html b/app/admin/view/slide/index.html index 01973cf..37ffc32 100644 --- a/app/admin/view/slide/index.html +++ b/app/admin/view/slide/index.html @@ -1,8 +1,8 @@ {extend name="common/base"/} {block name="body"} -
              -
              +
              +
              @@ -16,11 +16,11 @@ {/block} @@ -28,11 +28,13 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} \ No newline at end of file diff --git a/app/admin/view/slide/slide_info.html b/app/admin/view/slide/slide_info.html index 904b44c..58152e6 100644 --- a/app/admin/view/slide/slide_info.html +++ b/app/admin/view/slide/slide_info.html @@ -1,23 +1,21 @@ {extend name="common/base"/} {block name="body"} -
              +
              -
              - -
              {/block} @@ -25,13 +23,14 @@ {block name="script"} -{include file="common/layui" base="base" extend="[]" callback="init" /} +{include file="common/layui" base="base" extend="['rightpage']" callback="init" /} {/block} diff --git a/app/admin/view/slide/slide_info_add.html b/app/admin/view/slide/slide_info_add.html index 7d8b588..e5d6703 100644 --- a/app/admin/view/slide/slide_info_add.html +++ b/app/admin/view/slide/slide_info_add.html @@ -1,7 +1,8 @@ {extend name="common/base"/} {block name="body"} - + +

              幻灯片

              @@ -16,7 +17,7 @@
              + style="max-width: 120px;" />
              @@ -30,7 +31,7 @@ - + - +
              标题*
              状态*状态* {if condition="$id eq 0"} @@ -45,11 +46,9 @@ name="$slide_info.sort" }value="{$slide_info.sort}" {/notempty}>
              备注 - 备注 - +
              @@ -58,7 +57,6 @@ -
              {/block} @@ -90,27 +88,21 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/slide/slide_info_submit", + url: "/admin/slide/slide_info_add", type: 'post', data: data.field, success: function (e) { - if (e.code == 0) { - layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); - layer.close(index); - }); - } else { - layer.msg(e.msg); - } - } + layer.msg(e.msg); + if (e.code == 0) { + parent.tableIns.reload(); + setTimeout(function(){ + parent.layui.rightpage.close(); + },1000); + } + } }) return false; }); - //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); - return false; - }); } diff --git a/app/admin/view/user/edit.html b/app/admin/view/user/edit.html index 6054d0b..d7edf60 100644 --- a/app/admin/view/user/edit.html +++ b/app/admin/view/user/edit.html @@ -1,81 +1,73 @@ {extend name="common/base"/} {block name="body"} -
              + +

              编辑用户信息

              - + - + - + - + - + - + - + - - - - - - - - - + - + - + - +
              登录账号用户等级 * - {$user.username} + 用户昵称 *用户昵称 * - + 真实姓名真实姓名
              性别性别 手机号码手机号码 电子邮箱电子邮箱
              个人简介个人简介
              国家 - - 省份 - - 城市 - -
              所在企业所在企业 所在部门所在部门 所在职位所在职位
              企业地址企业地址
              -
              +
              @@ -110,13 +102,13 @@ //监听提交 form.on('submit(webform)', function (data) { $.ajax({ - url: "/admin/user/post_submit", + url: "/admin/user/edit", type: 'post', data: data.field, success: function (e) { if (e.code == 0) { layer.confirm('保存成功,返回列表页吗?', { icon: 3, title: '提示' }, function (index) { - history.back(-1); + window.location.href="/admin/user/index.html"; layer.close(index); }); } else { @@ -127,8 +119,8 @@ return false; }); //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { - history.back(-1); + $('.body-table').on('click', '[lay-event="back"]', function () { + window.location.href="/admin/user/index.html"; return false; }); diff --git a/app/admin/view/user/index.html b/app/admin/view/user/index.html index 1c45d16..ce2c444 100644 --- a/app/admin/view/user/index.html +++ b/app/admin/view/user/index.html @@ -1,8 +1,8 @@ {extend name="common/base"/} {block name="body"} -
              - +
              +
              @@ -77,6 +77,11 @@ title: '用户名', align: 'center', width: 100 + }, { + field: 'level_name', + title: '会员等级', + align: 'center', + width: 90 }, { field: 'sex', title: '性别', @@ -96,7 +101,7 @@ title: '昵称', align: 'center', width: 100 - }, { + },{ field: 'name', title: '真实姓名', align: 'center', @@ -109,24 +114,25 @@ }, { field: 'email', title: '电子邮箱', - align: 'center' + align: 'center', + minWidth: 150 },{ field: 'register_time', title: '注册时间', align: 'center', - width: 160 + width: 150 }, { field: 'status', title: '状态', toolbar: '#status', align: 'center', - width: 66 + width: 60 },{ field: 'right', title: '操作', align: 'center', toolbar: '#barDemo', - width: 136 + width: 130 } ] ] diff --git a/app/admin/view/user/log.html b/app/admin/view/user/log.html index 5985085..5bf52c3 100644 --- a/app/admin/view/user/log.html +++ b/app/admin/view/user/log.html @@ -1,10 +1,18 @@ {extend name="common/base"/} {block name="body"} -
              - +
              +
              - + +
              +
              +
              @@ -43,6 +51,11 @@ field: 'content', title: '操作描述', width: 360 + },{ + field: 'param_id', + title: '操作数据ID', + align: 'center', + width: 100 }, { field: 'param', title: '操作数据' @@ -71,7 +84,7 @@ tableIns.reload({ where: { keywords: data.field.keywords, - title_cate: data.field.title_cate + action: data.field.action }, page: { curr: 1 diff --git a/app/admin/view/user/record.html b/app/admin/view/user/record.html index 1f7f8c1..e9caed4 100644 --- a/app/admin/view/user/record.html +++ b/app/admin/view/user/record.html @@ -6,7 +6,7 @@ .latest-news .layui-timeline-title{padding-bottom:0; font-size: 14px;} .latest-news .layui-timeline-item{padding-bottom:5px;} .layui-timeline-title span{color:#999} -.panel-more{width: 100%; height:48px; line-height: 48px; text-align: center; position: absolute; bottom: 0; left:0; background: linear-gradient(rgba(225,225,225,0),rgba(225,225,225,.8));} +.panel-more{width: 100%; height:48px; line-height: 48px; text-align: center; position: absolute; bottom: 0; left:0;} .panel-more a{color:#0088FF} {/block} diff --git a/app/admin/view/user/view.html b/app/admin/view/user/view.html index dd64203..7e8c19b 100644 --- a/app/admin/view/user/view.html +++ b/app/admin/view/user/view.html @@ -1,18 +1,19 @@ {extend name="common/base"/} {block name="body"} -
              +
              +

              用户信息

              - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - -
              登录账号登录账号 {$user.username} 昵称会员等级 - {$user.nickname} + {$user.level_name} 头像头像
              @@ -20,87 +21,87 @@
              注册时间注册时间 {$user.register_time | date='Y-m-d H:i:s'} 注册IP注册IP {$user.register_ip}
              真实姓名真实姓名 {$user.name} 状态状态 {eq name="$user.status" value="1" }正常{/eq} {eq name="$user.status" value="0" }禁止登录{/eq}
              手机号码手机号码 {$user.mobile} 电子邮箱电子邮箱 {$user.email}
              所在城市昵称 - {$user.country}-{$user.province}-{$user.city} + {$user.nickname} 性别性别 {eq name="$user.sex" value="1" }男{/eq} {eq name="$user.sex" value="2" }女{/eq} {eq name="$user.sex" value="0" }未知{/eq} 生日生日 {$user.birthday | date='Y-m-d'}
              个人简介个人简介 {$user.desc}
              所在企业所在企业 {$user.company} 所在部门所在部门 {$user.depament} 所在职位所在职位 {$user.position}
              企业地址企业地址 {$user.address}
              最后登录IP + {$user.last_login_ip} + 最后登录时间 {$user.last_login_time | date='Y-m-d H:i:s'} 最后登录IP - {$user.last_login_ip} - 累计登录次数 {$user.login_num} @@ -108,7 +109,7 @@
              -
              +
              @@ -121,7 +122,7 @@ function init(layui) { var TAB = parent.layui.tab; //监听返回 - $('.body-content').on('click', '[lay-event="back"]', function () { + $('.body-table').on('click', '[lay-event="back"]', function () { TAB.sonDelete(); return false; }); diff --git a/app/common.php b/app/common.php index d1afab8..b1e87d2 100644 --- a/app/common.php +++ b/app/common.php @@ -315,54 +315,12 @@ function isRobot($except = '') { */ function add_user_log($type, $param_str = '', $param_id = 0, $param = []) { - $request = request(); - switch ($type) { - case 'login': - $title = '登录'; - break; - case 'reg': - $title = '注册'; - break; - case 'add': - $title = '新增'; - break; - case 'edit': - $title = '编辑'; - break; - case 'view': - $title = '查看'; - break; - case 'delete': - $title = '删除'; - break; - case 'down': - $title = '下载'; - break; - case 'join': - $title = '报名'; - break; - case 'sign': - $title = '签到'; - break; - case 'play': - $title = '播放'; - break; - case 'order': - $title = '下单'; - break; - case 'pay': - $title = '支付'; - break; - case 'api': - $title = 'API请求'; - break; - case 'install': - $title = '安装'; - break; - default: - $title = '未知'; - break; - } + $request = request(); + $title = '未知操作'; + $type_action = get_config('log.user_action'); + if($type_action[$type]){ + $title = $type_action[$type]; + } if ($type == 'login') { $login_user = \think\facade\Db::name('User')->where(array('id' => $param_id))->find(); if ($login_user['nickname'] == '') { @@ -400,10 +358,10 @@ function add_user_log($type, $param_str = '', $param_id = 0, $param = []) $data['content'] = $content; $data['param_id'] = $param_id; $data['param'] = json_encode($param); - $data['module'] = \think\facade\App::initialize()->http->getName(); - $data['controller'] = app('request')->controller(); - $data['function'] = app('request')->action(); - $data['ip'] = $request->ip(); + $data['module'] = strtolower(app('http')->getName()); + $data['controller'] = strtolower(app('request')->controller()); + $data['function'] = strtolower(app('request')->action()); + $data['ip'] = app('request')->ip(); $data['create_time'] = time(); \think\facade\Db::name('UserLog')->strict(false)->field(true)->insert($data); } diff --git a/app/home/controller/Login.php b/app/home/controller/Login.php index 1d736c5..84f57c0 100644 --- a/app/home/controller/Login.php +++ b/app/home/controller/Login.php @@ -39,7 +39,11 @@ class Login $str = str_replace("https://","",$str); //去掉https:// $strdomain = explode("/",$str); // 以“/”分开成数组 $domain = $strdomain[0]; //取第一个“/”以前的字符 - add_user_log('install', '系统',0,['domain'=>$domain]); + $name = '系统'; + if (!empty($_GET['name'])) { + $name = $_GET['name']; + } + add_user_log('install', $name,0,['domain'=>$domain]); if (!empty($_GET['callback'])) { return $_GET['callback'] . '("install ok!")'; // jsonp } diff --git a/app/home/controller/User.php b/app/home/controller/User.php index b345467..9e8398d 100644 --- a/app/home/controller/User.php +++ b/app/home/controller/User.php @@ -20,6 +20,7 @@ class User extends BaseController $uid = get_login_user('id'); $userInfo = Db::name('User')->where(['id' => $uid])->find(); $userInfo['showname'] = empty($userInfo['nickname']) ? $userInfo['username'] : $userInfo['nickname']; + $userInfo['level_title'] = Db::name('UserLevel')->where(['id' => $userInfo['level']])->value('title'); $userInfo['sex'] = ($userInfo['sex'] == 1) ? '男' : '女'; add_user_log('view', '个人中心'); View::assign('userInfo', $userInfo); @@ -30,6 +31,7 @@ class User extends BaseController { $uid = get_login_user('id'); $userInfo = Db::name('User')->where(['id' => $uid])->find(); + $userInfo['birthday'] = $userInfo['birthday']==0 ? '' : date('Y-m-d', $userInfo['birthday']); add_user_log('view', '个人信息'); View::assign('userInfo', $userInfo); return view(); diff --git a/app/home/view/login/index.html b/app/home/view/login/index.html index 22fa0ae..28c217c 100644 --- a/app/home/view/login/index.html +++ b/app/home/view/login/index.html @@ -184,12 +184,10 @@
              - +
              - +
              diff --git a/app/home/view/user/index.html b/app/home/view/user/index.html index 840a6d0..32914f2 100644 --- a/app/home/view/user/index.html +++ b/app/home/view/user/index.html @@ -15,7 +15,7 @@
              出生日期 - +
              ' + ,'' + ,'{{# layui.each(d.data.cols, function(i1, item1){ }}' + ,'' + ,'{{# layui.each(item1, function(i2, item2){ }}' + ,'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}' + ,'{{# if(item2.fixed === "right"){ right = true; } }}' + ,function(){ + if(options.fixed && options.fixed !== 'right'){ + return '{{# if(item2.fixed && item2.fixed !== "right"){ }}'; + } + if(options.fixed === 'right'){ + return '{{# if(item2.fixed === "right"){ }}'; + } + return ''; + }() + ,'' + ,(options.fixed ? '{{# }; }}' : '') + ,'{{# }); }}' + ,'' + ,'{{# }); }}' + ,'' + ,'
              ' + ,'
              ' + ,'{{# if(item2.type === "checkbox"){ }}' //复选框 + ,'' + ,'{{# } else { }}' + ,'{{item2.title||""}}' + ,'{{# if(!(item2.colspan > 1) && item2.sort){ }}' + ,'' + ,'{{# } }}' + ,'{{# } }}' + ,'
              ' + ,'
              '].join(''); + } + /** + * 行内过滤区域 + */ + ,TPL_FILTER = function(options){ + } + //tbody区域模板 + ,TPL_BODY = ['' + ,'' + ,'
              '].join('') + //主模板 + ,TPL_MAIN = ['
              ' + + ,'{{# if(d.data.toolbar){ }}' + ,'
              ' + ,'{{# } }}' + + ,'
              ' + ,'{{# var left, right; }}' + ,'
              ' + ,TPL_HEADER() + ,'
              ' + ,'
              ' + ,TPL_FILTER() + ,'
              ' + ,'
              ' + ,TPL_BODY + ,'
              ' + + ,'{{# if(left){ }}' + ,'
              ' + ,'
              ' + ,TPL_HEADER({fixed: true}) + ,'
              ' + ,'
              ' + ,TPL_BODY + ,'
              ' + ,'
              ' + ,'{{# }; }}' + + ,'{{# if(right){ }}' + ,'
              ' + ,'
              ' + ,TPL_HEADER({fixed: 'right'}) + ,'
              ' + ,'
              ' + ,'
              ' + ,TPL_BODY + ,'
              ' + ,'
              ' + ,'{{# }; }}' + ,'
              ' + + ,'{{# if(d.data.page){ }}' + ,'
              ' + ,'
              ' + ,'
              ' + ,'{{# } }}' + + /*,''*/ + ,'
              '].join('') + ,_WIN = $(window) + ,_DOC = $(document) + + //构造器 + ,Class = function(options){ + var that = this; + that.index = ++table.index; + that.config = $.extend({}, that.config, table.config, options); + that.render(); + table.pushClass(options.id,that); + }; + /** + * 表格行为属性(默认配置) + */ + Class.prototype.config = { + limit: 10 //每页显示的数量 + ,loading: true //请求数据时,是否显示loading + ,cellMinWidth: 60 //所有单元格默认最小宽度 + ,text: { + none: '无数据' + } + ,isFilter:false//是否开启行内过滤 + ,method:'post'//默认以post方式请求后台 + }; + //表格渲染 + Class.prototype.render = function(){ + var that = this + ,options = that.config; + options.elem = $(options.elem); + options.where = options.where || {}; + options.id = options.id || options.elem.attr('id'); + //请求参数的自定义格式 + options.request = $.extend({ + pageName: 'page' + ,limitName: 'limit' + }, options.request) + //响应数据的自定义格式 + options.response = $.extend({ + statusName: 'code' + ,statusCode: 0 + ,msgName: 'msg' + ,dataName: 'data' + ,countName: 'count' + }, options.response); + //如果 page 传入 laypage 对象 + if(typeof options.page === 'object'){ + options.limit = options.page.limit || options.limit; + options.limits = options.page.limits || options.limits; + that.page = options.page.curr = options.page.curr || 1; + delete options.page.elem; + delete options.page.jump; + } + if(!options.elem[0]) return that; + that.setArea(); //动态分配列宽高 + //开始插入替代元素 + var othis = options.elem + ,hasRender = othis.next('.' + ELEM_VIEW) + + //主容器 + ,reElem = that.elem = $(laytpl(TPL_MAIN).render({ + VIEW_CLASS: ELEM_VIEW + ,data: options + ,index: that.index //索引 + })); + options.index = that.index; + //生成替代元素 + hasRender[0] && hasRender.remove(); //如果已经渲染,则Rerender + othis.after(reElem); + that.renderTdCss(); + //各级容器 + that.layHeader = reElem.find(ELEM_HEADER); //表头 + that.layMain = reElem.find(ELEM_MAIN);//内容区域 + that.layBody = reElem.find(ELEM_BODY);//内容区域 + that.layFixed = reElem.find(ELEM_FIXED);//浮动区域 + that.layFixLeft = reElem.find(ELEM_FIXL);//左浮动 + that.layFixRight = reElem.find(ELEM_FIXR);//有浮动 + that.layTool = reElem.find(ELEM_TOOL);//工具栏区域 + that.layPage = reElem.find(ELEM_PAGE);//分页区域 + that.layFilter=reElem.find(ELEM_FILTER);//行内过滤条件区域 + that.layTool.html( + laytpl($(options.toolbar).html()||'').render(options) + ); + if(options.height) that.fullSize(); //设置body区域高度 + //如果多级表头,则填补表头高度 + if(options.cols.length > 1){ + var th = that.layFixed.find(ELEM_HEADER).find('th'); + th.height(that.layHeader.height() - 1 - parseFloat(th.css('padding-top')) - parseFloat(th.css('padding-bottom'))); + } + //渲染过滤区域 + if(options.isFilter){ + that.layFilter.html( + that.renderFilter() + ); + } + //请求数据 + that.pullData(that.page); + that.events(); + }; + //根据列类型,定制化参数 + Class.prototype.initOpts = function(item){ + var that = this, + options = that.config + ,initWidth = { + checkbox: 48 + ,space: 15 + ,numbers: 40 + }; + + //让 type 参数兼容旧版本 + if(item.checkbox) item.type = "checkbox"; + if(item.space) item.type = "space"; + if(!item.type) item.type = "normal"; + + if(item.type !== "normal"){ + item.unresize = true; + item.width = item.width || initWidth[item.type]; + } + + if(options.isFilter){//开启行内过滤 + if(item.isFilter!=false){ + item.isFilter=true; + } + } + }; + //动态分配列宽高 + Class.prototype.setArea = function(){ + var that = this, + options = that.config + ,colNums = 0 //列个数 + ,autoColNums = 0 //自动列宽的列个数 + ,autoWidth = 0 //自动列分配的宽度 + ,countWidth = 0 //所有列总宽度和 + ,cntrWidth = options.width ||function(){ //获取容器宽度 + //如果父元素宽度为0(一般为隐藏元素),则继续查找上层元素,直到找到真实宽度为止 + var getWidth = function(parent){ + var width, isNone; + parent = parent || options.elem.parent() + width = parent.width(); + try { + isNone = parent.css('display') === 'none'; + } catch(e){} + if(parent[0] && (!width || isNone)) return getWidth(parent.parent()); + return width; + }; + return getWidth(); + }(); + //统计列个数 + that.eachCols(function(){ + colNums++; + }); + //减去边框差 + cntrWidth = cntrWidth - function(){ + return (options.skin === 'line' || options.skin === 'nob') ? 2 : colNums + 1; + }(); + //遍历所有列 + layui.each(options.cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + var width; + if(!item2){ + item1.splice(i2, 1); + return; + } + that.initOpts(item2); + width = item2.width || 0; + if(item2.colspan > 1) return; + if(/\d+%$/.test(width)){ + item2.width = width = Math.floor((parseFloat(width) / 100) * cntrWidth); + } else if(item2._is_width_dev||!width){ //列宽未填写 + item2._is_width_dev=true;//采用默认宽度的列 + item2.width = width = 0; + autoColNums++; + } + countWidth = countWidth + width; + }); + }); + that.autoColNums = autoColNums; //记录自动列数 + //如果未填充满,则将剩余宽度平分。否则,给未设定宽度的列赋值一个默认宽 + (cntrWidth > countWidth && autoColNums) && ( + autoWidth = (cntrWidth - countWidth) / autoColNums + ); + layui.each(options.cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + var minWidth = item2.minWidth || options.cellMinWidth; + if(item2.colspan > 1) return; + if(item2.width === 0){ + item2.width = Math.floor(autoWidth >= minWidth ? autoWidth : minWidth); //不能低于设定的最小宽度 + } + }); + }); + + //高度铺满:full-差距值 + var th=that.getParentDivHeight(options.id); + that.fullHeightGap=0; + if(options.height){ + if(/^full-\d+$/.test(options.height)){ + that.fullHeightGap = options.height.split('-')[1]; + } + } + options.height = th - that.fullHeightGap; + + layui.each(options.cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + }) + }); + }; + /** + * 表格获取父容器高度 + * @param tableId + */ + Class.prototype.getParentDivHeight = function(tableId){ + var th=$("#"+tableId).parent().height(); + return th; + }; + //表格重载 + Class.prototype.reload = function(options){ + var that = this; + if(that.config.data && that.config.data.constructor === Array) delete that.config.data; + that.config = $.extend({}, that.config, options); + //获取行内过滤的值 + that.render(); + }; + //页码 + Class.prototype.page = 1; + /** + * 重置下标(插入删除等操作) + * 1、data-index中的下标 + * 2、tr中data的值 + * 3、下标字段的值 + * @param list + */ + Class.prototype.restNumbers=function(){ + var that = this + ,options = that.config; + var trs=that.layBody.find('table tbody tr'); + var i=0; + trs.each(function (o) { + $(this).attr("data-index",i); + $(this).find(".laytable-cell-numbers p").text(i+1); + $(this).data('index',i); + i++; + }); + } + /** + * 重置当前表格的数据(1、普通列表;2树状表格) + * 将列表数据转成树形结构和符合table展示的列表 + * @param list 列表数据 + * @param field_Id 树形结构主键字段 + * @param field_upId 树形结构上级字段 + * @returns {Array} [0]表格列表 [1]树形结构 + */ + Class.prototype.resetData=function(list) { + var that = this + ,options = that.config; + var datas=[]; + var treeList=[]; + var tableList=[]; + var map={};//列表map,fieldId为key + datas.push(tableList);//table结构 + datas.push(treeList)//tree树结构 + datas.push(map)//data数据 map结构 + if(list==null||list.length<=0)return datas; + //设置默认参数 + for (var i = 0; i < list.length; i++) { + var n = list[i]; + if(options.isTree){ + if(!n.hasOwnProperty(table.config.cols.isOpen)){//如果不存在该属性则默认为true + n[table.config.cols.isOpen]=true; + } + if(!n.hasOwnProperty(table.config.cols.isShow)){//如果不存在该属性则默认为true + n[table.config.cols.isShow]=true; + } + } + } + if(options.isTree){//树状 + var field_Id=options[TREE_ID]; + var field_upId=options[TREE_UPID]; + var rootUpId=list[0][field_upId];//根节点 + //处理树结构 + var fa = function(upId) { + var _array = []; + for (var i = 0; i < list.length; i++) { + var n = list[i]; + if (n[field_upId] === upId) { + n.children = fa(n[field_Id]); + _array.push(n); + } + } + return _array; + } + treeList=fa(rootUpId);//递归 + //处理表格结构 + var fa2=function (l,level) { + for (var i = 0; i < l.length; i++) { + var n = l[i]; + n[table.config.cols.level]=level;//设置当前层级 + tableList.push(n); + if (n.children&&n.children.length>0) { + fa2(n.children,1+level); + } + } + return; + } + fa2(treeList,1); + } + else{ + tableList=list; + } + //设置map数据集合 + tableList.forEach(function (o) { + map[o[field_Id]]=o; + }); + //设置到内存中去 + table.setDataList(that.config.id,tableList); + table.setDataTreeList(that.config.id,treeList); + table.setDataMap(that.config.id,map); + //设置isOpen 和is_show状态 + tableList.forEach(function (o) { + var uo=that.treeFindUpData(o); + if(!uo||(uo[table.config.cols.isOpen]&&uo[table.config.cols.isShow])){//没有父亲:显示;父亲打开状态(显示状态:显示;隐藏状态:隐藏) + o[table.config.cols.isShow]=true; + }else{ + o[table.config.cols.isShow]=false; + } + }); + return datas; + } + /** + * 根据id从表格数据中获取对象 + * @param data + * @param field_Id + * @param field_upId + * @returns {Array} + */ + Class.prototype.treeFindDataById=function(u_Id) { + var that = this + ,options = that.config; + var e=null; + var list=table.getDataList(that.key); + var key=options[TREE_ID]; + list.forEach(function (o) { + if(o[key]==u_Id){ + e=o; + return; + } + }); + return e; + } + /** + * 获取父节点 + * @param u_Id + */ + Class.prototype.treeFindUpData=function(o){ + var uOjb=null; + var that = this + ,options = that.config; + //处理父级 + var key=options[TREE_UPID];//父节点key名称 + var mapData=table.getDataMap(that.config.id);//获取map形式对象集合 + uOjb=mapData[o[key]]; + return uOjb; + } + /** + * 根据父id获取全部的叶子节点(递归) + * @param o 数据对象 + * @return {string} + */ + Class.prototype.treeFindSonData=function (data) { + var objs=[]; + function f(o) { + if(o.children.length>0){ + o.children.forEach(function (i) { + objs.push(i); + if(i.children.length>0){ + f(i); + } + }); + } + }f(data); + return objs; + }; + /** + * 叶子节点显示转换 + * @param o 数据 + * @param fieldName 树显示列名 + * @returns {string} + */ + Class.prototype.treeConvertShowName=function (o) { + var that = this + ,options = that.config; + var isTreeNode=(o.children&&o.children.length>0); + var temhtml='
              ' + +function () {//位移量 + var nbspHtml=""//一次位移 + for(var i=1;i"; + return nbspHtml; + }() + +function () {//图标或占位符 + var temTreeHtml=''; + var temTreeIsOpen=o[table.config.cols.isOpen]?"":""; + if(isTreeNode)temTreeHtml=''+temTreeIsOpen+' '; + return temTreeHtml; + }() + +'
              '; + return temhtml; + }; + /** + * 节点的展开或折叠 + * @param o 节点数据(树状表格) + * @param isOpen 展开(true)或折叠(false) + * + * 每个节点有两种状态, + * 1、打开状态(isOpen) 打开状态只需在点击瞬间控制,其他时候不需要变动 + * 2、显示状态(显示或隐藏) 显示状态根据父级节点控制,父级节点是显示并且打开状态的则显示,否则不显示,但不影响其打开状态 + */ + Class.prototype.treeNodeOpen=function (o,isOpen) { + var that = this + ,options = that.config + ,tr = that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]'); + o[table.config.cols.isOpen]=isOpen; + //处理树结构 + var fa = function(e) { + if(e.children&&e.children.length>0){ + var temList=e.children; + for (var i = 0; i < temList.length; i++) { + var n = temList[i]; + if(o[table.config.cols.isOpen]){//打开状态的,关闭 + if(e[table.config.cols.isOpen]&&e[table.config.cols.isShow]){//该节点显示 + var temo=that.layBody.find('tr[data-index="'+ n[table.config.indexName] +'"]'); + temo.show(); + n[table.config.cols.isShow]=true; + } + }else{ + var temo=that.layBody.find('tr[data-index="'+ n[table.config.indexName] +'"]'); + temo.hide(); + n[table.config.cols.isShow]=false; + } + fa(n); + } + } + } + fa(o); + //处理图标 + var dbClickI=tr.find('.layui-tree-head'); + if(o[table.config.cols.isOpen]){//打开状态 + dbClickI.html(''); + }else{ + dbClickI.html(''); + } + }; + //获得数据 + Class.prototype.pullData = function(curr, loadIndex){ + var that = this + ,options = that.config + ,request = options.request + ,response = options.response + ,sort = function(){ + if(typeof options.initSort === 'object'){ + that.sort(options.initSort.field, options.initSort.type); + } + }; + that.startTime = new Date().getTime(); //渲染开始时间 + if(options.url){ //Ajax请求 + var params = {}; + params[request.pageName] = curr; + params[request.limitName] = options.limit; + //行内过滤条件 + var list=that.layFilter.find("[name^='filter_']"); + layui.each(list,function (i, o) { + params[o.name]=$(o).val(); + }); + $.ajax({ + type: options.method || 'get' + ,url: options.url + ,data: $.extend(params, options.where) + ,dataType: 'json' + ,success: function(res){ + that.resetData(res.data); + res.data=table.getDataList(options.id); + if(res[response.statusName] != response.statusCode){ + that.renderForm(); + that.layMain.html('
              '+ (res[response.msgName] || '返回的数据状态异常') +'
              '); + } else { + that.renderData(res, curr, res[response.countName]), sort(); + options.time = (new Date().getTime() - that.startTime) + ' ms'; //耗时(接口请求+视图渲染) + } + loadIndex && layer.close(loadIndex); + typeof options.done === 'function' && options.done(res, curr, res[response.countName]); + + } + ,error: function(e, m){ + that.layMain.html('
              数据接口请求异常
              '); + that.renderForm(); + loadIndex && layer.close(loadIndex); + } + }); + } else if(options.data && options.data.constructor === Array){ //已知数据 + var res = {},startLimit = curr*options.limit - options.limit + res[response.dataName] = options.data.concat().splice(startLimit, options.limit); + res[response.countName] = options.data.length; + that.renderData(res, curr, options.data.length), sort(); + typeof options.done === 'function' && options.done(res, curr, res[response.countName]); + } + }; + //遍历表头 + Class.prototype.eachCols = function(callback){ + var cols = $.extend(true, [], this.config.cols) + ,arrs = [], index = 0; + + //重新整理表头结构 + layui.each(cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + //如果是组合列,则捕获对应的子列 + if(item2.colspan > 1){ + var childIndex = 0; + index++ + item2.CHILD_COLS = []; + layui.each(cols[i1 + 1], function(i22, item22){ + if(item22.PARENT_COL || childIndex == item2.colspan) return; + item22.PARENT_COL = index; + item2.CHILD_COLS.push(item22); + childIndex = childIndex + (item22.colspan > 1 ? item22.colspan : 1); + }); + } + if(item2.PARENT_COL) return; //如果是子列,则不进行追加,因为已经存储在父列中 + arrs.push(item2) + }); + }); + + //重新遍历列,如果有子列,则进入递归 + var eachArrs = function(obj){ + layui.each(obj || arrs, function(i, item){ + if(item.CHILD_COLS) return eachArrs(item.CHILD_COLS); + callback(i, item); + }); + }; + + eachArrs(); + }; + /** + * 渲染节点显示 + * @param callback + */ + Class.prototype.renderTreeConvertShowName = function(o){ + var that = this + ,options = that.config + ,m=options.elem + ,hasRender = m.next('.' + ELEM_VIEW); + var temhtml=that.treeConvertShowName(o); + var temdiv=that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]').find('td[data-field='+options[TREE_SHOW_NAME]+']').find('.layui-table-cell'); + $(temdiv).find('div').remove(); + $(temdiv).prepend(temhtml); + } + /** + * 渲染表格单元格样式(宽度样式设置) + * @param callback + */ + Class.prototype.renderTdCss = function(){ + var that = this + ,options = that.config + ,m=options.elem + ,hasRender = m.next('.' + ELEM_VIEW); + var id=that.index+'_dltable_td_style'; + hasRender.find("#"+id).remove(); + var styel=''; + hasRender.append(styel); + } + /** + * 生成单元格 + * @param obj 行数据 + * @param numbers 下标 + * @param cols 列定义数据 + * @param i3 第几列 + */ + Class.prototype.renderTrUpids=function (obj) { + var that = this + ,options = that.config; + var tree_upid_key=options[TREE_UPID]; + var upids=' upids="'+obj["upIds"]+'" '; + var u_id=' u_id="'+obj[tree_upid_key]+'" ' + var ret=options.isTree?u_id:''; + return ret; + } + /** + * 生成单元格 + * @param obj 行数据 + * @param numbers 下标 + * @param cols 列定义数据 + * @param i3 第几列 + */ + Class.prototype.renderTd=function (param) { + var that = this + ,options = that.config; + var cols=param.cols; + var obj=param.obj; + var numbers=param.numbers; + var i3=param.i3; + + var field = cols.field || i3, content = obj[field]||'' + ,cell = that.getColElem(that.layHeader, field); + + var treeImgHtml=''; + if(options.isTree){ + if(options.treeShowName==cols.field){ + treeImgHtml=that.treeConvertShowName(obj); + } + } + //td内容 + var td = ['
              ' + ,'
              '+treeImgHtml+'

              '+ function(){ + var tplData = $.extend(true, { + LAY_INDEX: numbers + }, obj); + //渲染复选框列视图 + if(cols.type === 'checkbox'){ + return ''; + } else if(cols.type === 'numbers'){ //渲染序号 + return numbers; + }else if(cols.type === 'drop'){//下拉框 + var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field); + if(rowsField&&rowsField['drop']){ + var o=dl.cache.code.get(rowsField.drop); + return dl.ui.table.drop.findDropLable(rowsField.drop,content); + } + }else if(cols.type === 'radio'){//单选 + return ''; + } + + //解析工具列模板 + if(cols.toolbar){ + return laytpl($(cols.toolbar).html()||'').render(tplData); + } + + return cols.templet ? function(){ + return typeof cols.templet === 'function' + ? cols.templet(tplData) + : laytpl($(cols.templet).html() || String(content)).render(tplData) + }() : content; + }() + ,'

              '); + layui.each(options.cols,function (i, o) { + layui.each(o, function(i2, item2){ + var field=item2.field||i2; + var minW=item2.minWidth?"data-minwidth='"+item2.minWidth+"'":""; + var rowCols=item2.colspan?'colspan="'+item2.colspan+'"':''; + var rowspan=item2.rowspan?'rowspan="'+item2.rowspan+'"':''; + var unresize=item2.unresize?'data-unresize="true"':''; + v.push(''); + + }); + }); + v.push('
              '); + v.push('
              1) { + tem='group'; + }else{ + tem=index+"-"+field; + if(item2.type !== "normal"){ + tem+=" laytable-cell-"+item2.type; + } + } + return tem; + }()+'">'); + if(!item2.isFilter||!item2.field){//不开启行内过滤或没有列名 + v.push(''); + }else{ + v.push(''); + } + v.push('
              '); + v.push(''); + return v.join(''); + }; + //找到对应的列元素 + Class.prototype.getColElem = function(parent, field){ + var that = this + ,options = that.config; + return parent.eq(0).find('.laytable-cell-'+ (options.index + '-' + field) + ':eq(0)'); + }; + //渲染表单 + Class.prototype.renderForm = function(type){ + form.render(type, 'LAY-table-'+ this.index); + } + //数据排序 + Class.prototype.sort = function(th, type, pull, formEvent){ + var that = this + ,field + ,res = {} + ,options = that.config + ,filter = options.elem.attr('lay-filter') + ,data = table.getDataList(that.key), thisData; + + //字段匹配 + if(typeof th === 'string'){ + that.layHeader.find('th').each(function(i, item){ + var othis = $(this) + ,_field = othis.data('field'); + if(_field === th){ + th = othis; + field = _field; + return false; + } + }); + } + + try { + var field = field || th.data('field'); + + //如果欲执行的排序已在状态中,则不执行渲染 + if(that.sortKey && !pull){ + if(field === that.sortKey.field && type === that.sortKey.sort){ + return; + } + } + + var elemSort = that.layHeader.find('th .laytable-cell-'+ options.index +'-'+ field).find(ELEM_SORT); + that.layHeader.find('th').find(ELEM_SORT).removeAttr('lay-sort'); //清除其它标题排序状态 + elemSort.attr('lay-sort', type || null); + that.layFixed.find('th') + } catch(e){ + return hint.error('Table modules: Did not match to field'); + } + + //记录排序索引和类型 + that.sortKey = { + field: field + ,sort: type + }; + + if(type === 'asc'){ //升序 + thisData = layui.sort(data, field); + } else if(type === 'desc'){ //降序 + thisData = layui.sort(data, field, true); + } else { //清除排序 + thisData = layui.sort(data, table.config.indexName); + delete that.sortKey; + } + + res[options.response.dataName] = thisData; + that.renderData(res, that.page, that.count, true); + + if(formEvent){ + layui.event.call(th, MOD_NAME, 'sort('+ filter +')', { + field: field + ,type: type + }); + } + }; + //请求loading + Class.prototype.loading = function(){ + var that = this + ,options = that.config; + if(options.loading && options.url){ + return layer.msg('数据请求中', { + icon: 16 + ,offset: [ + that.elem.offset().top + that.elem.height()/2 - 35 - _WIN.scrollTop() + 'px' + ,that.elem.offset().left + that.elem.width()/2 - 90 - _WIN.scrollLeft() + 'px' + ] + ,time: -1 + ,anim: -1 + ,fixed: false + }); + } + }; + //同步选中值状态 + Class.prototype.setCheckData = function(index, checked){ + var that = this + ,options = that.config + ,thisData = table.getDataList(that.key); + if(!thisData[index]) return; + if(thisData[index].constructor === Array) return; + thisData[index][table.config.cols.isCheckName] = checked; + }; + //同步全选按钮状态 + Class.prototype.syncCheckAll = function(){ + var that = this + ,options = that.config; + var list=table.getDataList(that.config.id); + if(!list)return; + var temis=true;//全选 + var checkNum=0;//选中的个数 + list.forEach(function (t) { + if(t[table.config.cols.isCheckName]){ + var checkAllElem = that.layBody.find('tr[data-index='+t[table.config.indexName]+']').find('input[name="layTableCheckbox"]'); + checkAllElem.prop('checked', true); + checkNum++; + }else{ + temis=false; + var checkAllElem = that.layBody.find('tr[data-index='+t[table.config.indexName]+']').find('input[name="layTableCheckbox"]'); + checkAllElem.prop('checked', false); + } + }); + if(temis){//设置全选 + var checkAllElem = that.layHeader.find('input[name="layTableCheckbox"]'); + checkAllElem.prop('checked', true); + } + if(checkNum 0){ + item.style.width = parseFloat(item.style.width) - 1 + 'px'; + } + that.scrollPatchWStatus = true; + }); + } + if(scollWidth && scollHeight){ + if(that.elem.find('.layui-table-patch').length<=0){ + var patchElem = $('
              ' + ,'' + ,'{{# layui.each(d.data.cols, function(i1, item1){ }}' + ,'' + ,'{{# layui.each(item1, function(i2, item2){ }}' + ,'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}' + ,'{{# if(item2.fixed === "right"){ right = true; } }}' + ,function(){ + if(options.fixed && options.fixed !== 'right'){ + return '{{# if(item2.fixed && item2.fixed !== "right"){ }}'; + } + if(options.fixed === 'right'){ + return '{{# if(item2.fixed === "right"){ }}'; + } + return ''; + }() + ,'' + ,(options.fixed ? '{{# }; }}' : '') + ,'{{# }); }}' + ,'' + ,'{{# }); }}' + ,'' + ,'
              ' + ,'
              ' + ,'{{# if(item2.type === "checkbox"){ }}' //复选框 + ,'' + ,'{{# } else { }}' + ,'{{item2.title||""}}' + ,'{{# if(!(item2.colspan > 1) && item2.sort){ }}' + ,'' + ,'{{# } }}' + ,'{{# } }}' + ,'
              ' + ,'
              '].join(''); + } + /** + * 行内过滤区域 + */ + ,TPL_FILTER = function(options){ + } + //tbody区域模板 + ,TPL_BODY = ['' + ,'' + ,'
              '].join('') + //主模板 + ,TPL_MAIN = ['
              ' + + ,'{{# if(d.data.toolbar){ }}' + ,'
              ' + ,'{{# } }}' + + ,'
              ' + ,'{{# var left, right; }}' + ,'
              ' + ,TPL_HEADER() + ,'
              ' + ,'
              ' + ,TPL_FILTER() + ,'
              ' + ,'
              ' + ,TPL_BODY + ,'
              ' + + ,'{{# if(left){ }}' + ,'
              ' + ,'
              ' + ,TPL_HEADER({fixed: true}) + ,'
              ' + ,'
              ' + ,TPL_BODY + ,'
              ' + ,'
              ' + ,'{{# }; }}' + + ,'{{# if(right){ }}' + ,'
              ' + ,'
              ' + ,TPL_HEADER({fixed: 'right'}) + ,'
              ' + ,'
              ' + ,'
              ' + ,TPL_BODY + ,'
              ' + ,'
              ' + ,'{{# }; }}' + ,'
              ' + + ,'{{# if(d.data.isPage){ }}' + ,'
              ' + ,'
              ' + ,'
              ' + ,'{{# } }}' + + /*,''*/ + ,'
              '].join('') + ,_WIN = $(window) + ,_DOC = $(document) + + //构造器 + ,Class = function(options){ + var that = this; + that.index = ++table.index; + that.config = $.extend({}, that.config, table.config, options); + that.configFirst = $.extend({}, that.config, table.config, options); + that.render(); + table.pushClass(options.id,that); + }; + /** + * 表格行为属性(默认配置) + */ + Class.prototype.config = { + limit: 10 //每页显示的数量 + ,loading: true //请求数据时,是否显示loading + ,cellMinWidth: 60 //所有单元格默认最小宽度 + ,heightRemove:[]//非固定高度情况下,不参与计算的高度 + ,text: { + none: '无数据' + } + ,isFilter:false//是否开启行内过滤 + ,method:'post'//默认以post方式请求后台 + ,radDisabledNum:0//禁止单选的记录数 + ,cheDisabledNum:0//禁止多选的记录数 + //树相关图表 + ,branch: ['', ''] //父节点 + ,leaf: '' //叶节点 + ,iconOpen:false//默认开启树节点图标 + ,isOpenDefault:false//默认展开还是折叠节点 + ,parseData:null//加载数据后的回调方法 + ,onClickRow:null//行单击事件 + ,onDblClickRow:null//行双击事件 + ,onBeforeCheck:null//复选前事件 + ,onCheck:null//复选事件 (obj 对象,checked 选中状态,isAll 是否全选) + ,onRadio:null//单选事件 () + ,isTree:true//默认为树表格 + ,isPage:false//不分页 + ,height:'100%'//默认高度100% + ,model:''//模型(''默认;'tree'树组件形式) + ,editModel:'click'//编辑模式('click':单击编辑;'dblclick':双击编辑) + }; + Class.prototype.configFirst={};//页面定义时原始参数 + //表格渲染 + Class.prototype.render = function(){ + var that = this + ,options = that.config; + options.elem = $(options.elem); + options.where = options.where || {}; + options.id = options.id || options.elem.attr('id'); + that.test(); + //请求参数的自定义格式 + options.request = $.extend({ + pageName: 'page' + ,limitName: 'limit' + }, options.request) + //响应数据的自定义格式 + options.response = $.extend({ + statusName: 'code' + ,statusCode: 0 + ,msgName: 'msg' + ,dataName: 'data' + ,countName: 'count' + }, options.response); + //如果 page 传入 laypage 对象 + if(typeof options.page === 'object'){ + options.limit = options.page.limit || options.limit; + options.limits = options.page.limits || options.limits; + that.page = options.page.curr = options.page.curr || 1; + delete options.page.elem; + delete options.page.jump; + } + if(!options.elem[0]) return that; + that.columnWidthInit();//列宽度计算 + //开始插入替代元素 + var othis = options.elem + ,hasRender = othis.next('.' + ELEM_VIEW) + //主容器 + ,reElem = that.elem = $(laytpl(TPL_MAIN).render({ + VIEW_CLASS: ELEM_VIEW + ,data: options + ,index: that.index //索引 + })); + options.index = that.index; + //生成替代元素 + hasRender[0] && hasRender.remove(); //如果已经渲染,则Rerender + othis.after(reElem); + that.renderTdCss(); + //各级容器 + that.layHeader = reElem.find(ELEM_HEADER); //表头 + that.layMain = reElem.find(ELEM_MAIN);//内容区域 + that.layBody = reElem.find(ELEM_BODY);//内容区域 + that.layFixed = reElem.find(ELEM_FIXED);//浮动区域 + that.layFixLeft = reElem.find(ELEM_FIXL);//左浮动 + that.layFixRight = reElem.find(ELEM_FIXR);//有浮动 + that.layTool = reElem.find(ELEM_TOOL);//工具栏区域 + that.layPage = reElem.find(ELEM_PAGE);//分页区域 + that.layFilter=reElem.find(ELEM_FILTER);//行内过滤条件区域 + that.layTool.html( + laytpl($(options.toolbar).html()||'').render(options) + ); + if(options.height){ + that.tableHeight();//表格高度计算 + that.resizeHeight();//高度控制 + that.renderCss(); + } + //如果多级表头,则填补表头高度 + if(options.cols.length > 1){ + var th = that.layFixed.find(ELEM_HEADER).find('th'); + th.height(that.layHeader.height() - 1 - parseFloat(th.css('padding-top')) - parseFloat(th.css('padding-bottom'))); + } + //渲染过滤区域 + if(options.isFilter){ + that.layFilter.html( + that.renderFilter() + ); + } + //请求数据 + that.pullData(that.page,that.loading()); + that.test(); + }; + //根据列类型,定制化参数 + Class.prototype.initOpts = function(item){ + var that = this, + options = that.config; + //让 type 参数兼容旧版本 + if(item.checkbox) item.type = "checkbox"; + if(item.space) item.type = "space"; + if(!item.type) item.type = "normal"; + + if(item.type !== "normal"){ + item.unresize = true; + item.width = item.width || table.config.initWidth[item.type]; + } + + if(options.isFilter){//开启行内过滤 + if(item.isFilter!=false){ + item.isFilter=true; + } + } + }; + + /** + * 表格获取父容器高度 + * @param tableId + */ + Class.prototype.getParentDivHeight = function(tableId){ + var th=$("#"+tableId).parent().height(); + return th; + }; + + /** + * 获取列定义 + * @param tableId + */ + Class.prototype.getCols = function(field){ + var that = this; + var o={}; + var cols=that.config.cols[0]; + var isInt=false; + var reg = /^[0-9]+.?[0-9]*$/; + if (reg.test(field)) {//数字 + isInt=true; + } + for(var ii in cols){ + if(isInt){ + if(ii==parseInt(field)) return cols[ii]; + }else{ + if(field==cols[ii].field)return cols[ii]; + } + } + return o; + }; + + /** + * 获取tr + * @param tableId + */ + Class.prototype.getTr = function(index){ + var that = this; + var tr = that.layBody.find('tr[data-index="'+ index +'"]') + return tr; + }; + + /** + * 获取td + * @param tableId + */ + Class.prototype.getTd = function(index,field){ + var that = this; + var tr=that.getTr(index); + var td=$(tr).find('td[data-field="'+ field +'"]'); + return td; + }; + + //表格重载 + Class.prototype.reload = function(options){ + var that = this; + if(that.config.data && that.config.data.constructor === Array) delete that.config.data; + that.config = $.extend({}, that.config, options); + that.configFirst = $.extend({}, that.config, options); + //获取行内过滤的值 + that.render(); + }; + //页码 + Class.prototype.page = 1; + /** + * 重置下标(插入删除等操作) + * 1、data-index中的下标 + * 2、tr中data的值 + * 3、下标字段的值 + * @param list + */ + Class.prototype.restNumbers=function(){ + var that = this + ,options = that.config; + var trs=that.layBody.find('table tbody tr'); + var i=0; + trs.each(function (o) { + $(this).attr("data-index",i); + $(this).find(".laytable-cell-numbers p").text(i+1); + $(this).data('index',i); + i++; + }); + } + + /** + * 初始化节点 + * 在每一次数据加载时只执行一次 + * query、reload时会执行 + * @param o + */ + Class.prototype.resetData=function(n) { + var that = this + ,options = that.config; + if(options.isTree){ + if(!n.hasOwnProperty(table.config.cols.isOpen)){//如果不存在该属性则默认为true + n[table.config.cols.isOpen]=options.isOpenDefault; + } + if(!n.hasOwnProperty(table.config.cols.isShow)){//如果不存在该属性则默认为true + n[table.config.cols.isShow]=options.isOpenDefault?true:false; + } + } + //禁止设置 + if(!n.hasOwnProperty(table.config.cols.cheDisabled)){//不存在则默认为false + n[table.config.cols.cheDisabled]=false; + } + //记录禁止多选、单选的记录数 + if(n[table.config.cols.cheDisabled])options.cheDisabledNum++; + if(n[table.config.cols.radDisabled])options.radDisabledNum++; + n.children=[]; + } + /** + * 构建map数据 + * @param list + * @return {{}} + */ + Class.prototype.resetDataMap=function(list) { + var that = this + ,options = that.config; + var field_Id=options.idField; + var map={}; + if(list){ + list.forEach(function (o) { + map[o[field_Id]]=o; + }); + } + return map; + } + Class.prototype.resetDataresetRoot=true;//是否重新确定根节点 + /** + * 确定根节点id(重新登录根节点) + */ + Class.prototype.resetDataRoot=function (list) { + var that = this + ,options = that.config; + var field_Id=options[TREE_ID]; + var field_upId=options[TREE_UPID]; + var map=table.getDataMap(that.config.id);//列表map,fieldId为key //设置map数据集合 + var rootList=table.cache[options.id].data.upIds||[];//根节点list集合 + var rootMap={};//根节点map集合 + table.cache[options.id].data.upIds=[]; + rootList=table.cache[options.id].data.upIds; + for(var i=0;i0) { + fa2(n.children,1+level); + } + } + return; + } + fa2(treeList,1); + + //设置isOpen 和is_show状态 + tableList.forEach(function (o) { + var uo=that.treeFindUpData(o); + if(!uo||(uo[table.config.cols.isOpen]&&uo[table.config.cols.isShow])){//没有父亲:显示;父亲打开状态(显示状态:显示;隐藏状态:隐藏) + o[table.config.cols.isShow]=true; + }else{ + o[table.config.cols.isShow]=false; + } + }); + return tableList; + } + + /** + * 重置当前表格的数据(1、普通列表;2树状表格) + * 将列表数据转成树形结构和符合table展示的列表 + * @param list 列表数据 + * @param field_Id 树形结构主键字段 + * @param field_upId 树形结构上级字段 + * @returns {Array} [0]表格列表 [1]树形结构 + */ + Class.prototype.resetDatas=function(list) { + //console.time("resetDatas"); + var that = this + ,options = that.config; + var field_Id=options[TREE_ID]; + var field_upId=options[TREE_UPID]; + var datas=[]; + var treeList=[]; + var tableList=list; + var map=that.resetDataMap(list);//列表map,fieldId为key //设置map数据集合 + datas.push(tableList);//table结构 + datas.push(treeList)//tree树结构 + datas.push(map)//data数据 map结构 + //设置到内存中去 + table.setDataList(that.config.id,tableList); + table.setDataTreeList(that.config.id,treeList); + table.setDataMap(that.config.id,map); + if(list==null||list.length<=0)return datas; + //设置默认参数 + for (var i = 0; i < list.length; i++) { + that.resetData(list[i]); + } + if(options.isTree){//树状 + tableList=[]; + table.setDataList(that.config.id,tableList); + var rootList=table.cache[options.id].data.upIds||[];//根节点list集合 + if(rootList.length<=0||that.resetDataresetRoot){//确定根节点 + table.cache[options.id].data.upIds=[]; + rootList=that.resetDataRoot(list); + that.resetDataresetRoot=false; + } + treeList=that.resetDataTreeList(list,rootList); + table.setDataTreeList(that.config.id,treeList);//设置树结构到缓存 + tableList=that.resetDataTableList(treeList); + table.setDataList(that.config.id,tableList);//设置数据列表结构到缓存 + } + //console.timeEnd("resetDatas"); + return datas; + } + /** + * 根据id从表格数据中获取对象 + * @param data + * @param field_Id + * @param field_upId + * @returns {Array} + */ + Class.prototype.treeFindDataById=function(u_Id) { + var that = this + ,options = that.config; + var e=null; + var list=table.getDataList(that.key); + var key=options[TREE_ID]; + list.forEach(function (o) { + if(o[key]==u_Id){ + e=o; + return; + } + }); + return e; + } + /** + * 获取父节点 + * @param u_Id + */ + Class.prototype.treeFindUpData=function(o){ + var uOjb=null; + var that = this + ,options = that.config; + //处理父级 + var key=options[TREE_UPID];//父节点key名称 + var mapData=table.getDataMap(that.config.id);//获取map形式对象集合 + uOjb=mapData[o[key]]; + return uOjb; + } + /** + * 获取全部父节点集合,返回list(不包含自己) + * @param u_Id + */ + Class.prototype.treeFindUpDatas=function(o){ + var uOjb=null; + var that = this + ,options = that.config; + var list=[]; + var temf=function (temo) { + var uo=that.treeFindUpData(temo); + if(uo){ + list.push(uo); + temf(uo); + } + }; + temf(o); + return list; + } + /** + * 根据父id获取全部的叶子节点(递归) + * @param o 数据对象 + * @return {string} + */ + Class.prototype.treeFindSonData=function (data) { + var objs=[]; + function f(o) { + if(o.children.length>0){ + o.children.forEach(function (i) { + objs.push(i); + if(i.children.length>0){ + f(i); + } + }); + } + }f(data); + return objs; + }; + /** + * 叶子节点显示转换 + * @param o 数据 + * @param fieldName 树显示列名 + * @returns {string} + */ + Class.prototype.treeConvertShowName=function (o) { + var that = this + ,options = that.config; + var isTreeNode=(o.children&&o.children.length>0); + var temhtml='
              ' + +function () {//位移量 + var nbspHtml=""//一次位移 + for(var i=1;i"; + return nbspHtml; + }() + +function () {//图标或占位符 + var temTreeHtml=''; + var temTreeIsOpen=o[table.config.cols.isOpen]?"":""; + if(isTreeNode){//父节点 + temTreeHtml=''+temTreeIsOpen+'' + +that.treeIconRender(o,true); + }else{//叶子节点 + temTreeHtml+=that.treeIconRender(o,true); + } + return temTreeHtml; + }() + +'
              '; + return temhtml; + }; + /** + * 节点的展开或折叠 + * @param o 节点数据(树状表格) + * @param isOpen 展开(true)或折叠(false) + * + * 每个节点有两种状态, + * 1、打开状态(isOpen) 打开状态只需在点击瞬间控制,其他时候不需要变动 + * 2、显示状态(显示或隐藏) 显示状态根据父级节点控制,父级节点是显示并且打开状态的则显示,否则不显示,但不影响其打开状态 + */ + Class.prototype.treeNodeOpen=function (o,isOpen) { + var that = this + ,tr = that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]'); + if(!o){ + return + } + o[table.config.cols.isOpen]=isOpen; + //处理树结构 + var fa = function(e) { + if(e.children&&e.children.length>0){ + var temList=e.children; + for (var i = 0; i < temList.length; i++) { + var n = temList[i]; + if(o[table.config.cols.isOpen]){//打开状态的,关闭 + if(e[table.config.cols.isOpen]&&e[table.config.cols.isShow]){//该节点显示 + var temo=that.layBody.find('tr[data-index="'+ n[table.config.indexName] +'"]'); + temo.css('display', ''); + n[table.config.cols.isShow]=true; + } + }else{ + var temo=that.layBody.find('tr[data-index="'+ n[table.config.indexName] +'"]'); + temo.css('display', 'none'); + n[table.config.cols.isShow]=false; + } + fa(n); + } + } + } + fa(o); + //处理图标 + that.treeIconRender(o,false); + var dbClickI=tr.find('.layui-tree-head'); + if(o[table.config.cols.isOpen]){//打开状态 + dbClickI.html(''); + }else{ + dbClickI.html(''); + } + }; + + /** + * icon渲染 + * @param o + * @param isHtml true(返回html) false(立即渲染) + */ + Class.prototype.treeIconRender=function (o,isHtml) { + var that = this + ,options = that.config + ,iconOpen=options.iconOpen + ,isTreeNode=(o.children&&o.children.length>0); + var temTreeHtml=''; + if(iconOpen){ + var temf=function () {//自定义图标 + var temhtml=''; + return temhtml; + } + if(isTreeNode){//父节点 + if((o[table.config.cols.iconOpen]||o[table.config.cols.iconClose])){ + temTreeHtml=temf(); + }else{ + temTreeHtml=''+(o[table.config.cols.isOpen]?that.config.branch[1]:that.config.branch[0])+''; + } + }else{//叶子节点 + if(o[table.config.cols.icon]){ + temTreeHtml=temf(); + }else{ + temTreeHtml+=''+that.config.leaf+''; + } + } + if(isHtml){ + return temTreeHtml; + }else{ + var temdiv=that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]').find('td[data-field='+options[TREE_SHOW_NAME]+']').find('.layui-table-cell'); + $(temdiv).find('div .layui-tree-'+o[options.idField]).remove();//节点附加div + $(temdiv).find('div').append(temTreeHtml); + } + }else{ + return temTreeHtml; + } + } + //获得数据 + Class.prototype.pullData = function(curr, loadIndex){ + var that = this + ,options = that.config + ,request = options.request + ,response = options.response + ,sort = function(){ + if(typeof options.initSort === 'object'){ + that.sort(options.initSort.field, options.initSort.type); + } + }; + that.startTime = new Date().getTime(); //渲染开始时间 + if(options.url){ //Ajax请求 + var params = {}; + params[request.pageName] = curr; + params[request.limitName] = options.limit; + that.filterRulesSet(params);//行内过滤条件 + that.sortSet(params);//排序条件 + $.ajax({ + type: options.method || 'get' + ,url: options.url + ,data: $.extend(params, options.where) + ,dataType: 'json' + ,headers:options.headers + ,success: function(res){ + if(!res[response.dataName]){//返回是未定义或null时转成[] + res[response.dataName]=[] + res[response.statusName]=0; + res[response.countName]=0; + res[response.msgName]='返回的数据状态异常'; + }; + that.resetDataresetRoot=true; + //如果有数据解析的回调,则获得其返回的数据 + if(typeof options.parseData === 'function'){ + res = options.parseData(res) || res; + } + that.resetDatas(res[response.dataName]); + res[response.dataName]=table.getDataList(options.id); + if(res[response.statusName] != response.statusCode){ + that.renderForm(); + that.layMain.html('
              '+ (res[response.msgName] || '返回的数据状态异常') +'
              '); + } else { + that.renderData(res, curr, res[response.countName]); + options.time = (new Date().getTime() - that.startTime) + ' ms'; //耗时(接口请求+视图渲染) + } + loadIndex && layer.close(loadIndex); + that.events(); + typeof options.done === 'function' && options.done(res, curr, res[response.countName]); + that.renderRowCheck(); + } + ,error: function(e, m){ + that.layMain.html('
              数据接口请求异常
              '); + that.renderForm(); + loadIndex && layer.close(loadIndex); + } + }); + } else if(options.data && options.data.constructor === Array){ //已知数据 + var res = {},startLimit = curr*options.limit - options.limit + res[response.dataName] = options.data.concat().splice(startLimit, options.limit); + res[response.countName] = options.data.length; + that.renderData(res, curr, options.data.length); + that.events(); + typeof options.done === 'function' && options.done(res, curr, res[response.countName]); + that.renderRowCheck(); + } + }; + /** + * 设置过滤条件 + */ + Class.prototype.filterRulesSet=function (p) { + var that = this; + p["filterRules"]=JSON.stringify(that.filterRules()); + } + /** + * 获取过滤条件 + * filterRules: + * [ + * {"field":"XXXX","op":"equals","value":["1"],"datatype":"array"} + * ,{"field":"XXXX","op":"contains","value":"3","datatype":"string"} + * ] + */ + Class.prototype.filterRules=function () { + var that = this; + var filterRules=[]; + //行内过滤条件 + var list=that.layFilter.find("[name^='filter_']"); + layui.each(list,function (i, o) { + if($(o).val()){ + var tem={ + "field":o.name + ,"op":"like" + ,"value":$(o).val() + ,"datatype":"string" + } + filterRules.push(tem); + } + }); + // console.log(filterRules,filterRules.toString(),JSON.stringify(filterRules)); + return filterRules; + } + + //遍历表头 + Class.prototype.eachCols = function(callback){ + var cols = $.extend(true, [], this.config.cols) + ,arrs = [], index = 0; + + //重新整理表头结构 + layui.each(cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + //如果是组合列,则捕获对应的子列 + if(item2.colspan > 1){ + var childIndex = 0; + index++ + item2.CHILD_COLS = []; + layui.each(cols[i1 + 1], function(i22, item22){ + if(item22.PARENT_COL || childIndex == item2.colspan) return; + item22.PARENT_COL = index; + item2.CHILD_COLS.push(item22); + childIndex = childIndex + (item22.colspan > 1 ? item22.colspan : 1); + }); + } + if(item2.PARENT_COL) return; //如果是子列,则不进行追加,因为已经存储在父列中 + arrs.push(item2) + }); + }); + + //重新遍历列,如果有子列,则进入递归 + var eachArrs = function(obj){ + layui.each(obj || arrs, function(i, item){ + if(item.CHILD_COLS) return eachArrs(item.CHILD_COLS); + callback(i, item); + }); + }; + + eachArrs(); + }; + /** + * 渲染节点显示 + * @param callback + */ + Class.prototype.renderTreeConvertShowName = function(o){ + var that = this + ,options = that.config + ,m=options.elem + ,hasRender = m.next('.' + ELEM_VIEW); + var temhtml=that.treeConvertShowName(o); + var temdiv=that.layBody.find('tr[data-index="'+ o[table.config.indexName] +'"]').find('td[data-field='+options[TREE_SHOW_NAME]+']').find('.layui-table-cell'); + $(temdiv).find('div').remove(); + $(temdiv).prepend(temhtml); + } + /** + * 渲染表格单元格样式(宽度样式设置) + * @param callback + */ + Class.prototype.renderTdCss = function(){ + var that = this + ,options = that.config + ,m=options.elem + ,hasRender = m.next('.' + ELEM_VIEW); + var id= that.index+"_"+MOD_NAME+'_td_style'; + hasRender.find("#"+id).remove(); + var styel=''; + hasRender.append(styel); + } + + /** + * 单元格编辑模式渲染 + */ + Class.prototype.renderTdEdit = function(index,field){ + var that = this + ,othis=$(that.getTd(index,field)) + ,options = that.config + ,field = othis.data('field') + ,editType = othis.data('edit') + ,index = othis.parents('tr').eq(0).data('index') + ,val=othis.find("div.layui-table-cell p").text() + ,data = table.getDataList(that.key)[index]; + if(editType === 'select') { //选择框 + var dropName=othis.data('drop'); + var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field); + var o=dl.cache.code.get(rowsField.drop); + var html=''; + var scv=o.syscodevaluecache; + for(var i in scv){ + var isSelected=""; + if(scv[i].scv_value==data[field]){ + isSelected="selected='selected'"; + } + //选中 + html+='' + } + var select = $(''); + othis.find('.'+ELEM_EDIT)[0] || othis.append(select); + } else { //输入框 + var input = $(''); + input[0].value = $.trim(val);// othis.data('content') || elemCell.text(); + othis.find('.'+ELEM_EDIT)[0] || othis.append(input); + input.focus(); + } + }; + + /** + * 插件内css + */ + Class.prototype.renderCss = function(){ + var that = this + ,options = that.config + ,m=options.elem + ,hasRender = m.next('.' + ELEM_VIEW); + var id=that.index+"_"+MOD_NAME+'_style'; + hasRender.find("#"+id).remove(); + var styel=''; + hasRender.append(styel); + } + + /** + * 生成单元格 + * @param obj 行数据 + * @param numbers 下标 + * @param cols 列定义数据 + * @param i3 第几列 + */ + Class.prototype.renderTrUpids=function (obj) { + var that = this + ,options = that.config; + var tree_upid_key=options[TREE_UPID]; + var upids=' upids="'+obj["upIds"]+'" '; + var u_id=' u_id="'+obj[tree_upid_key]+'" ' + var ret=options.isTree?u_id:''; + return ret; + } + /** + * 生成单元格 + * @param obj 行数据 + * @param numbers 下标 + * @param cols 列定义数据 + * @param i3 第几列 + */ + Class.prototype.renderTd=function (obj,cols,numbers,i3) { + var that = this + ,options = that.config; + var v=obj[cols.field]==null?'':String(obj[cols.field]); + + var field = cols.field || i3, content = v + ,cell = that.getColElem(that.layHeader, field); + + var treeImgHtml=''; + if(options.isTree){ + if(options.treeShowName==cols.field){ + treeImgHtml=that.treeConvertShowName(obj); + } + } + //td内容 + var td = ['' + ,'
              '+treeImgHtml+'

              '+ function(){ + var tplData = $.extend(true, {LAY_INDEX: numbers}, obj); + //渲染复选框列视图 + if(cols.type === 'checkbox'){ + return tplData[table.config.cols.cheDisabled]?'' + :''; + } else if(cols.type === 'numbers'){ //渲染序号 + return numbers; + }else if(cols.type === 'drop'){//下拉框 + var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field); + if(rowsField&&rowsField['drop']){ + var o=dl.cache.code.get(rowsField.drop); + return dl.ui.table.drop.findDropLable(rowsField.drop,content); + } + }else if(cols.type === 'radio'){//单选 + return tplData[table.config.cols.radDisabled]?'' + :''; + } + + //解析工具列模板 + if(cols.toolbar){ + return laytpl($(cols.toolbar).html()||'').render(tplData); + } + + return cols.templet ? function(){ + return typeof cols.templet === 'function' + ? cols.templet(tplData) + : laytpl($(cols.templet).html() || String(content)).render(tplData) + }() : content; + }() + ,'

              '].join(''); + return td; + } + /** + * 生成tr中的一行 + * @param obj 行数据 + * @param numbers 行号 + */ + Class.prototype.renderTr=function (obj,numbers) { + var that = this + ,options = that.config; + var tds= []; + that.eachCols(function(i3, cols){//cols列定义 + var field = cols.field || i3, content = obj[field]; + if(cols.colspan > 1) return; + var td = that.renderTd(obj,cols,numbers,i3);//td内容 + tds.push(td); + // if(item3.fixed && item3.fixed !== 'right') tds_fixed.push(td); + // if(item3.fixed === 'right') tds_fixed_r.push(td); + }); + return tds; + }; + /** + * 表格数据部分渲染入口 + * @param res + * @param curr + * @param count + * @param sort + */ + Class.prototype.renderData = function(res, curr, count, sort){ + var that = this + ,options = that.config + ,data = res[options.response.dataName] || [] + ,trs = [] + ,trs_fixed = [] + ,trs_fixed_r = [] + //渲染视图 + ,render = function(){ //后续性能提升的重点 + if(!sort && that.sortKey){ + return that.sort(that.sortKey.field, that.sortKey.sort, true); + } + + layui.each(data, function(i1, obj){ + var uo=that.treeFindUpData(obj); + var display=""; + if(!obj[table.config.cols.isShow]&&options.isTree){ + display="display: none;"; + } + var tds = [], tds_fixed = [], tds_fixed_r = [] + ,numbers = i1 + options.limit*(curr - 1) + 1; //序号 + if(obj.length === 0) return; + if(!sort){ + obj[table.config.indexName] = i1; + } + tds=that.renderTr(obj,numbers); + trs.push(''+ tds.join('') + ''); + trs_fixed.push(''+ tds_fixed.join('') + ''); + trs_fixed_r.push(''+ tds_fixed_r.join('') + ''); + }); + //if(data.length === 0) return; + that.layBody.scrollTop(0); + that.layMain.find('.'+ NONE).remove(); + that.layMain.find('tbody').html(trs.join('')); + that.layFixLeft.find('tbody').html(trs_fixed.join('')); + that.layFixRight.find('tbody').html(trs_fixed_r.join('')); + that.renderForm(); + that.haveInit ? that.scrollPatch() : setTimeout(function(){ + that.scrollPatch(); + }, 50); + that.haveInit = true; + layer.close(that.tipsIndex); + }; + that.key = options.id || options.index; + // table.cache[that.key] = data; //记录数据 + table.setDataList(that.key,data); + //显示隐藏分页栏 + that.layPage[data.length === 0 && curr == 1 ? 'addClass' : 'removeClass'](HIDE); + //排序 + if(sort){ + return render(); + } + if(data.length === 0){ + that.renderForm(); + that.layFixed.remove(); + that.layMain.find('tbody').html(''); + that.layMain.find('.'+ NONE).remove(); + return that.layMain.append('
              '+(res[options.response.msgName]?res[options.response.msgName]:options.text.none)+'
              '); + } + render(); + that.renderPage(count);//分页渲染 + //calss加载完成 + table.pushClassIds(options.id,true); + }; + /** + * 渲染分页 + */ + Class.prototype.renderPage=function (count) { + var that = this + ,options = that.config; + //同步分页状态 + if(options.isPage){ + options.page = $.extend({ + elem: 'layui-table-page' + options.index + ,count: count + ,limit: options.limit + ,limits: options.limits || [10,15,20,30,40,50,60,70,80,90] + ,groups: 3 + ,layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'] + ,prev: '' + ,next: '' + ,jump: function(obj, first){ + if(!first){ + //分页本身并非需要做以下更新,下面参数的同步,主要是因为其它处理统一用到了它们 + //而并非用的是 options.page 中的参数(以确保分页未开启的情况仍能正常使用) + that.page = obj.curr; //更新页码 + options.limit = obj.limit; //更新每页条数 + that.pullData(obj.curr, that.loading()); + } + } + }, options.page); + options.page.count = count; //更新总条数 + laypage.render(options.page); + } + }; + /** + * 过滤区域的渲染 + */ + Class.prototype.renderFilter = function(){ + var that = this + ,options = that.config + ,VIEW_CLASS=ELEM_VIEW + ,index=that.index; //索引 + var v = []; + v.push(''); + v.push(''); + layui.each(options.cols,function (i, o) { + layui.each(o, function(i2, item2){ + var field=item2.field||i2; + var minW=item2.minWidth?"data-minwidth='"+item2.minWidth+"'":""; + var rowCols=item2.colspan?'colspan="'+item2.colspan+'"':''; + var rowspan=item2.rowspan?'rowspan="'+item2.rowspan+'"':''; + var unresize=item2.unresize?'data-unresize="true"':''; + v.push(''); + + }); + }); + v.push('
              '); + v.push('
              1) { + tem='group'; + }else{ + tem=index+"-"+field; + if(item2.type !== "normal"){ + tem+=" laytable-cell-"+item2.type; + } + } + return tem; + }()+'">'); + if(!item2.isFilter||!item2.field){//不开启行内过滤或没有列名 + v.push(''); + }else{ + v.push(''); + } + v.push('
              '); + v.push(''); + return v.join(''); + }; + + /** + * 行选中渲染 + */ + Class.prototype.renderRowCheck = function(){ + var that = this + ,options = that.config + ,index=that.index; //索引 + var list=table.getDataList(options.id); + if(list){ + list.forEach(function (temo) { + var tr=that.layBody.find('tr[data-index='+temo[table.config.indexName]+']'); + if(temo[table.config.cols.isRowCheck]){ + tr.css("background-color","#ccc"); + }else{ + tr.css("background-color",""); + } + }); + } + }; + + //找到对应的列元素 + Class.prototype.getColElem = function(parent, field){ + var that = this + ,options = that.config; + return parent.eq(0).find('.laytable-cell-'+ (options.index + '-' + field) + ':eq(0)'); + }; + //渲染表单 + Class.prototype.renderForm = function(type){ + form.render(type, 'LAY-table-'+ this.index); + } + /** + * 设置排序参数 + * @param p + */ + Class.prototype.sortSet=function (p) { + var that = this; + var sort=[]; + var cols=that.config.cols[0]; + cols.forEach(function (t) { + if(t.sortType){ + var tem={ + "field":t.field + ,"sort":t.sortType + } + sort.push(tem); + } + }); + p.sort=JSON.stringify(sort); + } + /** + * 设置排序字段 + * @param th + * @param type + * @param pull + * @param formEvent + */ + Class.prototype.sort = function(th, type, pull, formEvent){ + var that = this + ,field + ,res = {} + ,options = that.config + ,filter = options.elem.attr('lay-filter') + ,data = table.getDataList(that.key), thisData; + //字段匹配 + if(typeof th === 'string'){ + that.layHeader.find('th').each(function(i, item){ + var othis = $(this) + ,_field = othis.data('field'); + if(_field === th){ + th = othis; + field = _field; + return false; + } + }); + } + try { + var field = field || th.data('field'); + //如果欲执行的排序已在状态中,则不执行渲染 + if(that.sortKey && !pull){ + if(field === that.sortKey.field && type === that.sortKey.sort){ + return; + } + } + var elemSort = that.layHeader.find('th .laytable-cell-'+ options.index +'-'+ field).find(ELEM_SORT); + //that.layHeader.find('th').find(ELEM_SORT).removeAttr('lay-sort'); //清除其它标题排序状态 + elemSort.attr('lay-sort', type || null); + that.layFixed.find('th') + } catch(e){ + return hint.error('Table modules: Did not match to field'); + } + /* //记录排序索引和类型 + that.sortKey = { + field: field + ,sort: type + }; + if(type === 'asc'){ //升序 + } else if(type === 'desc'){ //降序 + thisData = layui.sort(data, field, true); + } else { //清除排序 + thisData = layui.sort(data, table.config.indexName); + } + */ + var cols=that.getCols(field); + if(cols){ + cols.sortType=type + } + }; + //请求loading + Class.prototype.loading = function(){ + var that = this + ,options = that.config; + if(options.loading && options.url){ + return layer.msg('数据请求中', { + icon: 16 + ,offset: [ + that.elem.offset().top + that.elem.height()/2 - 35 - _WIN.scrollTop() + 'px' + ,that.elem.offset().left + that.elem.width()/2 - 90 - _WIN.scrollLeft() + 'px' + ] + ,time: -1 + ,anim: -1 + ,fixed: false + }); + } + }; + //同步选中值状态 + Class.prototype.setCheckData = function(index, checked){ + var that = this + ,options = that.config + ,thisData = table.getDataList(that.key); + if(!thisData[index]) return; + if(thisData[index].constructor === Array) return; + thisData[index][table.config.cols.isCheckName] = checked; + }; + //同步全选按钮状态 + Class.prototype.syncCheckAll = function(){ + var that = this + ,options = that.config; + var list=table.getDataList(that.config.id); + if(!list)return; + var temis=true;//全选 + var checkNum=0;//选中的个数 + list.forEach(function (t) { + if(!t[table.config.cols.cheDisabled]){ + if(t[table.config.cols.isCheckName]){ + var checkAllElem = that.layBody.find('tr[data-index='+t[table.config.indexName]+']').find('input[name="'+TABLE_CHECKBOX_ID+'"]'); + checkAllElem.prop('checked', true); + checkNum++; + }else{ + temis=false; + var checkAllElem = that.layBody.find('tr[data-index='+t[table.config.indexName]+']').find('input[name="'+TABLE_CHECKBOX_ID+'"]'); + checkAllElem.prop('checked', false); + } + } + }); + if(temis){//设置全选 + var checkAllElem = that.layHeader.find('input[name="'+TABLE_CHECKBOX_ID+'"]'); + checkAllElem.prop('checked', true); + } + if(checkNum<(list.length-options.cheDisabledNum)){ + var checkAllElem = that.layHeader.find('input[name="'+TABLE_CHECKBOX_ID+'"]'); + checkAllElem.prop('checked', false); + } + // console.time("pullData"); + // console.timeEnd("pullData"); + that.renderForm('checkbox'); + }; + //获取cssRule + Class.prototype.getCssRule = function(field, callback){ + var that = this + ,style = that.elem.find('style')[0] + ,sheet = style.sheet || style.styleSheet || {} + ,rules = sheet.cssRules || sheet.rules; + layui.each(rules, function(i, item){ + if(item.selectorText === ('.laytable-cell-'+ that.index +'-'+ field)){ + return callback(item), true; + } + }); + }; + + Class.prototype.test = function(){ + } + /** + * 窗体变化自适应 + */ + Class.prototype.resize = function(){ + var that = this; + //根据父窗体高度设置table的高度 + // 1、table自身顶级容器高度(layui-table-view) + // 2、内容区域高度(layui-table-main) + that.columnWidthInit();//列宽度计算 + that.tableHeight();//表格高度计算 + that.resizeHeight();//高度控制 + that.resizeWidth();//宽度控制 + }; + + //动态分配列宽高 + Class.prototype.setArea = function(){ + var that = this; + that.columnWidthInit();//列宽度计算 + that.tableHeight();//表格高度计算 + }; + /** + * 列宽度计算 + */ + Class.prototype.columnWidthInit = function(){ + var that = this, + options = that.config + ,colNums = 0 //列个数 + ,autoColNums = 0 //自动列宽的列个数 + ,autoWidth = 0 //自动列分配的宽度 + ,countWidth = 0 //所有列总宽度和 + ,cntrWidth = options.width ||function(){ //获取容器宽度 + //如果父元素宽度为0(一般为隐藏元素),则继续查找上层元素,直到找到真实宽度为止 + var getWidth = function(parent){ + var width, isNone; + parent = parent || options.elem.parent() + width = parent.width(); + try { + isNone = parent.css('display') === 'none'; + } catch(e){} + if(parent[0] && (!width || isNone)) return getWidth(parent.parent()); + return width; + }; + return getWidth(); + }()-17; + //统计列个数 + that.eachCols(function(){ + colNums++; + }); + //减去边框差 + cntrWidth = cntrWidth - function(){ + return (options.skin === 'line' || options.skin === 'nob') ? 2 : colNums + 1; + }(); + + //遍历所有列 + layui.each(options.cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + var width; + if(!item2){ + item1.splice(i2, 1); + return; + } + that.initOpts(item2); + width = item2.width || 0; + if(item2.colspan > 1) return; + if(/\d+%$/.test(width)){ + item2.width = width = Math.floor((parseFloat(width) / 100) * cntrWidth); + } else if(item2._is_width_dev||!width){ //列宽未填写 + item2._is_width_dev=true;//采用默认宽度的列 + item2.width = width = 0; + autoColNums++; + } + countWidth = countWidth + width; + }); + }); + that.autoColNums = autoColNums; //记录自动列数 + //如果未填充满,则将剩余宽度平分。否则,给未设定宽度的列赋值一个默认宽 + (cntrWidth > countWidth && autoColNums) && ( + autoWidth = (cntrWidth - countWidth) / autoColNums + ); + layui.each(options.cols, function(i1, item1){ + layui.each(item1, function(i2, item2){ + var minWidth = item2.minWidth || options.cellMinWidth; + if(item2.colspan > 1) return; + if(item2.width === 0){ + item2.width = Math.floor(autoWidth >= minWidth ? autoWidth : minWidth); //不能低于设定的最小宽度 + } + }); + }); + }; + /** + * 重新渲染宽度 + */ + Class.prototype.resizeWidth = function(){ + var that = this; + that.renderTdCss(); + }; + /** + * 表格高度计算 + */ + Class.prototype.tableHeight = function(){ + var that = this, + options = that.config, + optionsFirst = that.configFirst; + //确定高度 + if(!table.kit.isNumber(optionsFirst.height)){//如果非固定高度,则计算高度 + var htremove=0;//减去的高度 + if(options.heightRemove&&table.kit.isArray(options.heightRemove)){ + var htatt=options.heightRemove; + htatt.forEach(function (t) { + var temh=table.kit.isNumber(t)?t:$(t).outerHeight(true); + if(table.kit.isNumber(temh)){ + htremove+=temh; + } + }); + } + //高度铺满:full-差距值 + var th=_WIN.height()-htremove-1;//that.getParentDivHeight(options.id); + that.fullHeightGap=0; + if(options.height){ + if(/^full-\d+$/.test(options.height)){ + that.fullHeightGap = options.height.split('-')[1]; + } + } + options.height = th - that.fullHeightGap; + } + }; + /** + * 重新渲染高度 + */ + Class.prototype.resizeHeight = function(){ + var that = this + ,options = that.config + ,height = options.height, bodyHeight; + if(height < 135) height = 135; + that.elem.css('height', height-80); + //tbody区域高度 + // bodyHeight = parseFloat(height) - parseFloat(that.layHeader.height()) - 1;//原本代码 + var theader=options.isFilter?76:38;//没有行内过滤区域 + bodyHeight = parseFloat(height) - (that.config.model=="tree"?0:theader) - 1;//###注意:现在写死表头固定高度为38px,即不支持多表头方式(在tab方式下无法获取正确的高度,待处理) + if(options.toolbar){ + bodyHeight = bodyHeight - that.layTool.outerHeight(); + } + if(options.isPage){ + bodyHeight = bodyHeight - that.layPage.outerHeight() - 1; + } + that.layMain.css('height', bodyHeight-80); + }; + //获取滚动条宽度 + Class.prototype.getScrollWidth = function(elem){ + var width = 0; + if(elem){ + width = elem.offsetWidth - elem.clientWidth; + } else { + elem = document.createElement('div'); + elem.style.width = '100px'; + elem.style.height = '100px'; + elem.style.overflowY = 'scroll'; + + document.body.appendChild(elem); + width = elem.offsetWidth - elem.clientWidth; + document.body.removeChild(elem); + } + return width; + }; + //滚动条补丁 + Class.prototype.scrollPatch = function(){ + var that = this + ,layMainTable = that.layMain.children('table') + ,scollWidth = that.layMain.width() - that.layMain.prop('clientWidth') //纵向滚动条宽度 + ,scollHeight = that.layMain.height() - that.layMain.prop('clientHeight') //横向滚动条高度 + ,getScrollWidth = that.getScrollWidth(that.layMain[0]) //获取主容器滚动条宽度,如果有的话 + ,outWidth = layMainTable.outerWidth() - that.layMain.width(); //表格内容器的超出宽度 + + //如果存在自动列宽,则要保证绝对填充满,并且不能出现横向滚动条 + if(that.autoColNums && outWidth < 5 && !that.scrollPatchWStatus){ + var th = that.layHeader.eq(0).find('thead th:last-child') + ,field = th.data('field'); + that.getCssRule(field, function(item){ + var width = item.style.width || th.outerWidth(); + item.style.width = (parseFloat(width) - getScrollWidth - outWidth) + 'px'; + //二次校验,如果仍然出现横向滚动条 + if(that.layMain.height() - that.layMain.prop('clientHeight') > 0){ + item.style.width = parseFloat(item.style.width) - 1 + 'px'; + } + that.scrollPatchWStatus = true; + }); + } + if(scollWidth && scollHeight){ + if(that.elem.find('.layui-table-patch').length<=0){ + var patchElem = $('
              '); //补丁元素 + patchElem.find('div').css({ + width: scollWidth + }); + that.layHeader.eq(0).find('thead tr').append(patchElem); + //that.layFilter.find('table thead tr').append(patchElem); + } + } else { + that.layFilter.eq(0).find('.layui-table-patch').remove(); + that.layHeader.eq(0).find('.layui-table-patch').remove(); + } + //固定列区域高度 + var mainHeight = that.layMain.height() + ,fixHeight = mainHeight - scollHeight; + that.layFixed.find(ELEM_BODY).css('height', layMainTable.height() > fixHeight-80 ? fixHeight : 'auto'); + //表格宽度小于容器宽度时,隐藏固定列 + that.layFixRight[outWidth > 0 ? 'removeClass' : 'addClass'](HIDE); + //操作栏 + that.layFixRight.css('right', scollWidth - 1); + }; + //事件处理 + Class.prototype.events = function(){ + var that = this + ,options = that.config + ,_BODY = $('body') + ,dict = {} + ,th = that.layHeader.find('th') + ,bodytr=that.layBody.find('tr') + ,resizing; + //行点击事件 + bodytr.unbind('click').on('click',function (e) { + var index=$(this).attr("data-index"); + table.treeRowCheck(that.config.id,index); + }); + //行双击事件 + bodytr.unbind('dblclick').on('dblclick',function (e) { + var index=$(this).attr("data-index"); + var list=table.getDataList(that.config.id); + var o=list[index]; + typeof options.onDblClickRow === 'function' && options.onDblClickRow(index,o); + }); + //拖拽调整宽度 + th.unbind('mousemove').on('mousemove', function(e){ + var othis = $(this) + ,oLeft = othis.offset().left + ,pLeft = e.clientX - oLeft; + if(othis.attr('colspan') > 1 || othis.data('unresize') || dict.resizeStart){ + return; + } + dict.allowResize = othis.width() - pLeft <= 10; //是否处于拖拽允许区域 + _BODY.css('cursor', (dict.allowResize ? 'col-resize' : '')); + }) + th.unbind('mouseleave').on('mouseleave', function(){ + var othis = $(this); + if(dict.resizeStart) return; + _BODY.css('cursor', ''); + }) + th.unbind('mousedown').on('mousedown', function(e){ + var othis = $(this); + if(dict.allowResize){ + var field = othis.data('field'); + e.preventDefault(); + dict.resizeStart = true; //开始拖拽 + dict.offset = [e.clientX, e.clientY]; //记录初始坐标 + + that.getCssRule(field, function(item){ + var width = item.style.width || othis.outerWidth(); + dict.rule = item; + dict.ruleWidth = parseFloat(width); + dict.minWidth = othis.data('minwidth') || options.cellMinWidth; + }); + } + }); + //拖拽中 + _DOC.unbind('mousemove').on('mousemove', function(e){ + if(dict.resizeStart){ + e.preventDefault(); + if(dict.rule){ + var setWidth = dict.ruleWidth + e.clientX - dict.offset[0]; + if(setWidth < dict.minWidth) setWidth = dict.minWidth; + dict.rule.style.width = setWidth + 'px'; + layer.close(that.tipsIndex); + } + resizing = 1 + } + }) + _DOC.unbind('mouseup').on('mouseup', function(e){ + if(dict.resizeStart){ + dict = {}; + _BODY.css('cursor', ''); + that.scrollPatch(); + } + if(resizing === 2){ + resizing = null; + } + }); + //排序 + th.unbind('click').on('click', function(){//点击标题列 + var othis = $(this) + ,elemSort = othis.find(ELEM_SORT) + ,nowType = elemSort.attr('lay-sort') + ,type; + + if(!elemSort[0] || resizing === 1) return resizing = 2; + + if(nowType === 'asc'){ + type = 'desc'; + } else if(nowType === 'desc'){ + type = null; + } else { + type = 'asc'; + } + that.sort(othis, type, null, true); + table.query(that.key);//从新查询 + }) + th.find(ELEM_SORT+' .layui-edge ').unbind('click').on('click', function(e){//点击小三角形 + var othis = $(this) + ,index = othis.index() + ,field = othis.parents('th').eq(0).data('field') + layui.stope(e); + if(index === 0){ + that.sort(field, 'asc', null, true); + } else { + that.sort(field, 'desc', null, true); + } + table.query(that.key);//从新查询 + }); + if(!that.eventsinitIsRun){ + that.eventsinit(); + that.eventsinitIsRun=true; + } + //同步滚动条 + that.layMain.unbind('scroll').on('scroll', function(){ + var othis = $(this) + ,scrollLeft = othis.scrollLeft() + ,scrollTop = othis.scrollTop(); + + that.layHeader.scrollLeft(scrollLeft); + that.layFilter.scrollLeft(scrollLeft); + that.layFixed.find(ELEM_BODY).scrollTop(scrollTop); + + layer.close(that.tipsIndex); + }); + _WIN.unbind('resize').on('resize', function(){ //自适应 + that.resize(); + }); + }; + //事件处理单元格编辑(只执行一次) + Class.prototype.eventsinitIsRun=false; + //只执行一次的事件 + Class.prototype.eventsinit = function(){ + var that = this + ,options = that.config + ,ELEM_CELL = '.layui-table-cell' + ,filter = options.elem.attr('lay-filter'); + //行内过滤 + that.layFilter.on('keyup',"[name^='filter_']",function () { + that.page=1; + that.pullData(that.page, that.loading()); + }); + //行事件 + that.layBody.on('mouseenter','tr',function(){ + var othis = $(this) + ,index = othis.index(); + that.layBody.find('tr:eq('+ index +')').addClass(ELEM_HOVER) + }) + that.layBody.on('mouseleave','tr', function(){ + var othis = $(this) + ,index = othis.index(); + that.layBody.find('tr:eq('+ index +')').removeClass(ELEM_HOVER) + }); + //单元格事件 + that.layBody.on('click','td div.layui-table-cell p',function(){ + var othis = $(this).parent().parent() + ,field = othis.data('field') + ,editType = othis.data('edit') + ,index = othis.parents('tr').eq(0).data('index') + ,data = table.getDataList(that.key)[index] + ,elemCell = othis.children(ELEM_CELL); + var options = that.config; + layer.close(that.tipsIndex); + if(othis.data('off')) return; + + //显示编辑表单 + if(editType&&options.editModel=="click"){ + that.renderTdEdit(index,field); + return; + } + + //如果出现省略,则可查看更多 + var c=that.getCols(field); + + if(!table.config.initWidth[c["type"]]){ + if(elemCell.find('.layui-form-switch,.layui-form-checkbox')[0]) return; //限制不出现更多(暂时) + if(Math.round(elemCell.prop('scrollWidth')) > Math.round(elemCell.outerWidth())){ + that.tipsIndex = layer.tips([ + '
              ' + ,elemCell.html() + ,'
              ' + ,'' + ].join(''), elemCell[0], { + tips: [3, ''] + ,time: -1 + ,anim: -1 + ,maxWidth: (device.ios || device.android) ? 300 : 600 + ,isOutAnim: false + ,skin: 'layui-table-tips' + ,success: function(layero, index){ + layero.find('.layui-table-tips-c').on('click', function(){ + layer.close(index); + }); + } + }); + } + } + }); + //单元格事件 + that.layBody.on('dblclick','td div.layui-table-cell p',function(){ + var othis = $(this).parent().parent() + ,field = othis.data('field') + ,editType = othis.data('edit') + ,index = othis.parents('tr').eq(0).data('index') + ,data = table.getDataList(that.key)[index] + ,elemCell = othis.children(ELEM_CELL); + var options = that.config; + layer.close(that.tipsIndex); + if(othis.data('off')) return; + //显示编辑表单 + if(editType&&options.editModel=="dblclick"){ + that.renderTdEdit(index,field); + return; + } + }); + that.layBody.on('change','.'+ELEM_EDIT, function(){ + var othis = $(this) + ,value = this.value + ,field = othis.parent().data('field') + ,index = othis.parents('tr').eq(0).data('index') + ,data = table.getDataList(that.key)[index]; + data[field] = value; //更新缓存中的值 + layui.event.call(this, MOD_NAME, 'edit('+ filter +')', { + value: value + ,data: data + ,field: field + }); + }); + that.layBody.on('blur','.'+ELEM_EDIT, function(){//单元格失去焦点 + var templet + ,othis = $(this) + ,field = othis.parent().data('field') + ,index = othis.parents('tr').eq(0).data('index') + ,editType = othis.parent().data('edit') + ,data = table.getDataList(that.key)[index]; + var options = that.config; + that.eachCols(function(i, item){ + if(item.field == field && item.templet){ + templet = item.templet; + } + }); + var value=""; + if(editType === 'select') { //选择框 + var rowsField=dl.ui.table.drop.findFieldObj(options.cols[0],field); + if(rowsField&&rowsField['drop']){ + var o=dl.cache.code.get(rowsField.drop); + value=dl.ui.table.drop.findDropLable(rowsField.drop,this.value); + } + othis.parent().find(ELEM_CELL+' p').html( + templet ? laytpl($(templet).html() || value).render(data) : value + ); + } else {//输入框 + othis.parent().find(ELEM_CELL+' p').html( + templet ? laytpl($(templet).html() || this.value).render(data) : this.value + ); + } + othis.parent().data('content', this.value); + othis.remove(); + }); + //树形节点点击事件(隐藏展开下级节点) + that.elem.on('click','i.layui-tree-head', function(){ + var othis = $(this) + ,index = othis.parents('tr').eq(0).data('index') + ,options=that.config + ,datas=table.getDataList(that.key);//数据 + var o=datas[index]; + that.treeNodeOpen(o,!o[table.config.cols.isOpen]); + that.resize(); + }); + //复选框选择 + that.elem.on('click','input[name="'+TABLE_CHECKBOX_ID+'"]+', function(){ + var checkbox = $(this).prev() + ,childs = that.layBody.find('input[name="'+TABLE_CHECKBOX_ID+'"]') + ,index = checkbox.parents('tr').eq(0).data('index') + ,checked = checkbox[0].checked + ,obj=table.getDataList(that.config.id)[index] + ,isAll = checkbox.attr('lay-filter') === 'layTableAllChoose'; + //全选 + if(isAll){ + var list=table.getDataList(that.key); + list.forEach(function (temo) { + if(!temo[table.config.cols.cheDisabled]){//可以选择的才设置 + that.setCheckData(temo[table.config.indexName], checked); + } + }); + } else { + that.setCheckData(index, checked); + if(options.isTree){ + //处理下级 + var sonList=that.treeFindSonData(obj); + sonList.forEach(function (temo) { + if(!temo[table.config.cols.cheDisabled]){//可以选择的才设置 + that.setCheckData(temo[table.config.indexName], checked); + } + }); + + //处理上级 + var temf=function (o) { + if(o==null)return; + if(o&&o.children.length>0){ + var temis=true; + o.children.forEach(function (temo) { + if(!temo[table.config.cols.isCheckName]){ + temis=false; + } + }); + if(temis){ + that.setCheckData(o[table.config.indexName], checked); + } + + var temuo=that.treeFindUpData(o); + if(temuo){ + temf(temuo); + } + } + } + var uo=that.treeFindUpData(obj); + temf(uo); + } + } + that.syncCheckAll(); + layui.event.call(this, MOD_NAME, 'checkbox('+ filter +')', { + checked: checked + ,data: table.getDataList(that.key) ? (obj || {}) : {} + ,type: isAll ? 'all' : 'one' + }); + typeof options.onCheck === 'function' && options.onCheck(obj,checked,isAll); + }); + + //单选框选择 + that.elem.on('click','input[name="'+TABLE_RADIO_ID+'"]+', function(){ + var checkbox = $(this).prev() + ,index = checkbox.parents('tr').eq(0).data('index') + ,obj=table.getDataList(that.config.id)[index]; + typeof options.onRadio === 'function' && options.onRadio(obj); + }); + + //工具条操作事件 + that.layBody.on('click', '*[lay-event]',function(){ + var othis = $(this) + ,index = othis.parents('tr').eq(0).data('index') + ,tr = that.layBody.find('tr[data-index="'+ index +'"]') + ,ELEM_CLICK = 'layui-table-click' + ,list = table.getDataList(that.key) + ,data = table.getDataList(that.key)[index]; + layui.event.call(this, MOD_NAME, 'tool('+ filter +')', { + data: data//table.clearCacheKey(data) + ,event: othis.attr('lay-event') + ,tr: tr + ,del: function(){ + table.delRow(options.id,data); + } + ,update: function(fields){ + fields = fields || {}; + layui.each(fields, function(key, value){ + if(key in data){ + var templet, td = tr.children('td[data-field="'+ key +'"]'); + data[key] = value; + that.eachCols(function(i, item2){ + if(item2.field == key && item2.templet){ + templet = item2.templet; + } + }); + td.children(ELEM_CELL).html( + templet ? laytpl($(templet).html() || value).render(data) : value + ); + td.data('content', value); + } + }); + } + }); + tr.addClass(ELEM_CLICK).siblings('tr').removeClass(ELEM_CLICK); + }); + } + //表格重载 + thisTable.config = {}; + //自动完成渲染 + table.init(); + // layui.link('treeGrid.css'); + exports(MOD_NAME, table); +}); \ No newline at end of file diff --git a/public/static/layui/plugin/treeGrid.js b/public/static/layui/plugin/treeGrid.js new file mode 100644 index 0000000..e2e80e9 --- /dev/null +++ b/public/static/layui/plugin/treeGrid.js @@ -0,0 +1,6 @@ +/** + 码云地址:https://gitee.com/beijiyi/tree_table_treegrid_based_on_layui + 在线demo:http://beijiyi.com/ + */ +"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};layui.config({}).extend({}).define(["laytpl","laypage","layer","form"],function(e){var t=layui.$,i=layui.laytpl,a=layui.laypage,n=layui.layer,o=layui.form,r=layui.hint(),l=layui.device(),c={config:{indexName:"lay_table_index",cols:{isCheckName:"lay_is_checked",isRadio:"lay_is_radio",isOpen:"lay_is_open",isShow:"lay_is_show",level:"lay_level",children:"children",isRowCheck:"lay_is_row_check",cheDisabled:"lay_che_disabled",radDisabled:"lay_rad_disabled",iconOpen:"lay_icon_open",iconClose:"lay_icon_close",icon:"lay_icon"},initWidth:{checkbox:48,space:15,numbers:40,radio:48}},cache:{tableId:{data:{list:[],map:{},treeList:[],upIds:[]}},cla:{claIds:{tableId:!0},claObjs:{tableId:{}}},selectcode:{demokey:[{key:{value:""}}]}},index:layui.table?layui.table.index+1e4:0,set:function(e){var i=this;return i.config=t.extend({},i.config,e),i},on:function(e,t){return layui.onevent.call(this,s,e,t)},getClass:function(e){return c.cache.cla.claObjs[e]},pushClass:function(e,t){c.cache.cla.claObjs[e]=t},isCalss:function(e){return(this.cache.cla.claIds||{}).hasOwnProperty(e)||!1},isClassYes:function(e){return(this.cache.cla.claIds||{})[e]||!1},pushClassIds:function(e,t){this.cache.cla.claIds[e]=t},setObj:function(e,t,i){this.obj[e]||(this.obj[e]={}),this.obj[e][t]=i},getObj:function(e,t){return this.obj[e]?this.obj[e][t]:null},getDataList:function(e){return c.cache[e]?c.cache[e].data.list:[]},setDataList:function(e,t){c.cache[e]||(c.cache[e]={}),c.cache[e].data||(c.cache[e].data={}),c.cache[e].data.list||(c.cache[e].data.list=[]),c.cache[e].data.list=t},getDataMap:function(e){return c.cache[e]?c.cache[e].data.map:{}},setDataMap:function(e,t){c.cache[e]||(c.cache[e]={}),c.cache[e].data||(c.cache[e].data={}),c.cache[e].data.map||(c.cache[e].data.map={}),c.cache[e].data.map=t},getDataTreeList:function(e){return c.cache[e]?c.cache[e].data.treeList:[]},setDataTreeList:function(e,t){c.cache[e]||(c.cache[e]={}),c.cache[e].data||(c.cache[e].data={}),c.cache[e].data.treeList||(c.cache[e].data.treeList={}),c.cache[e].data.treeList=t},getDataRootList:function(e){return c.cache[e]?c.cache[e].data.upIds||[]:[]},setDataRootList:function(e,t){c.cache[e]||(c.cache[e]={}),c.cache[e].data||(c.cache[e].data={}),c.cache[e].data.upIds||(c.cache[e].data.upIds=[]),c.cache[e].data.upIds=t},init:function(e,i){i=i||{};var a=this,n=t(e?'table[lay-filter="'+e+'"]':f+"[lay-data]"),o="Table element property lay-data configuration item has a syntax error: ";return n.each(function(){var a=t(this),n=a.attr("lay-data");try{n=new Function("return "+n)()}catch(e){r.error(o+n)}var l=[],d=t.extend({elem:this,cols:[],data:[],skin:a.attr("lay-skin"),size:a.attr("lay-size"),even:"string"==typeof a.attr("lay-even")},c.config,i,n);e&&a.hide(),a.find("thead>tr").each(function(e){d.cols[e]=[],t(this).children().each(function(i){var a=t(this),n=a.attr("lay-data");try{n=new Function("return "+n)()}catch(e){return r.error(o+n)}var c=t.extend({title:a.text(),colspan:a.attr("colspan")||0,rowspan:a.attr("rowspan")||0},n);c.colspan<2&&l.push(c),d.cols[e].push(c)})}),a.find("tbody>tr").each(function(e){var i=t(this),a={};i.children("td").each(function(e,i){var n=t(this),o=n.data("field");if(o)return a[o]=n.html()}),layui.each(l,function(e,t){var n=i.children("td").eq(e);a[t.field]=n.html()}),d.data[e]=a}),c.render(d)}),a},render:function(e){c.pushClassIds(e.id);var t=new k(e);return d.call(t)},ready:function(e,t){function i(){if(e){var o=c.getClass(e);if(o&&o.hasOwnProperty("layBody"))t(o),a=!0;else{(new Date).getTime()-n.getTime()<=1e4&&!a&&setTimeout(i,50)}}}var a=!1,n=new Date;e&&t&&setTimeout(i,50)},checkStatus:function(e){var t=0,i=0,a=[],n=c.getDataList(e)||[];return layui.each(n,function(e,n){if(n.constructor===Array)return void i++;n[c.config.cols.isCheckName]&&(t++,a.push(c.clearCacheKey(n)))}),{data:a,isAll:!!n.length&&t===n.length-i}},setCheckStatus:function(e,t,i){var a=c.getClass(e),n=c.getDataList(e)||[];a.layBody.find('input[name="'+g+'"]');if(t&&i){i.split(",").forEach(function(e){var i=null;if(n.forEach(function(a){if(a[t]+""==e+"")return void(i=a)}),i){var o=i[c.config.indexName];a.layBody.find('input[name="'+g+'"][value="'+o+'"]').prop("checked",!0),a.setCheckData(o,!0)}}),a.syncCheckAll(),a.renderForm("checkbox")}return null},radioStatus:function(e){var t=c.getClass(e),i=null,a=c.getDataList(e)||[],n=t.layBody.find("input[name='"+y+"']:checked").val();return n=parseInt(n),a.forEach(function(e){e[c.config.indexName]==n&&(i=e)}),c.clearCacheKey(i)},setRadioStatus:function(e,t,i){var a=c.getClass(e),n=null,r=c.getDataList(e)||[];if(t&&i&&(r.forEach(function(e){if(e[t]+""==i+"")return void(n=e)}),n)){var l=n[c.config.indexName];a.layBody.find("input:radio[name='"+y+"'][value='"+l+"']").prop("checked",!0),o.render("radio")}return n},clearCacheKey:function(e){return e=t.extend({},e),delete e[c.config.cols.isCheckName],delete e[c.config.indexName],e},query:function(e,i){var a=c.getClass(e);a.renderTdCss(),a.config.data&&a.config.data.constructor===Array&&delete a.config.data,a.config=t.extend({},a.config,i),a.pullData(a.page,a.loading())},reload:function(e,i){var a=d.config[e];return i=i||{},a?(i.data&&i.data.constructor===Array&&delete a.data,c.render(t.extend(!0,{},a,i))):r.error("The ID option was not found in the table instance")},addRow:function(e,i,a){var n=c.getClass(e),o=n.config,r=[],l=c.getDataTreeList(e),d=c.getDataList(e)||[];if(n.resetData(a),d.splice(i,0,a),c.kit.restNumbers(d),c.setDataMap(e,n.resetDataMap(d)),o.isTree){var r=n.treeFindUpData(a);r?(r.children||(r.children=[]),r.children.push(a),a[c.config.cols.level]=r[c.config.cols.level]+1):(a[c.config.cols.level]=1,l.push(a))}var s=n.renderTr(a,a[c.config.indexName]),f='"+s.join("")+"";if(0==i){var u=n.layBody.find("table tbody");t(u).prepend(f),n.layBody.find(".layui-none").remove()}else{var h=n.layBody.find("[data-index="+(i-1)+"]");t(h).after(f)}n.renderForm(),o.isPage&&n.renderPage(n.config.page.count+1),n.restNumbers(),n.events(),o.isTree&&(n.treeNodeOpen(r,!0),n.renderTreeConvertShowName(r))},delRow:function(e,t){var i=c.getClass(e),a=i.config,n=c.getDataList(e),o=[],r={},l=[],d=[];if(i&&t){c.kit.isArray(t)?l=t:l[0]=t,l.forEach(function(e){var t=i.treeFindUpData(e);t&&d.push(t)}),o=a.isTree?c.treeFindSonList(i.config.id,l):l,o.forEach(function(e){var t=e[c.config.indexName];r[t]=t,i.layBody.find('tr[data-index="'+t+'"]').remove()}),i.restNumbers();for(var s=[],f=0,u=n.length;f0){i.treeFindSonData(e).forEach(function(e){o[e[c.config.indexName]]||(n.push(e),o[e[c.config.indexName]]=e[c.config.indexName])})}n.push(e),o[e[c.config.indexName]]=e[c.config.indexName]}),n},treeFindUpDatas:function(e,t){var i=c.getClass(e);return i&&t?i.treeFindUpDatas(t):[]},treeFindUpData:function(e,t){var i=c.getClass(e);return i&&t?i.treeFindUpData(t):[]},treeFindSonIds:function(e,t){var i=[];return c.treeFindSonList(e,t).forEach(function(e){i.push([c.config.indexName])}),i},treeFindSonIdFields:function(e,t){var i=[],a=c.getClass(e);return c.treeFindSonList(e,t).forEach(function(e){i.push(e[a.config.idField])}),i},treeIconRender:function(e,t){var i=c.getClass(e);return i&&t?i.treeIconRender(t,!1):[]},treeFindRowCheck:function(e){var t=[],i=c.getDataList(e);return i&&i.forEach(function(e){e[c.config.cols.isRowCheck]&&t.push(e)}),t},treeRowCheck:function(e,t){var i=c.getClass(e);if(i){var a=c.getDataList(i.config.id),n=a[t];"tree"==i.config.model&&(a.forEach(function(e){e[c.config.cols.isRowCheck]=!1}),n[c.config.cols.isRowCheck]=!0,i.layBody.find("tr").css("background-color",""),i.getTr(t).css("background-color","#ccc")),"function"==typeof i.config.onClickRow&&i.config.onClickRow(t,n)}},kit:{isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},isNumber:function(e){var t=/^\d+(\.\d+)?$/,i=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;return!(!t.test(e)&&!i.test(e))},restNumbers:function(e){if(e){var t=0;e.forEach(function(e){e[c.config.indexName]=t,t++})}}}},d=function e(){var t=this,i=t.config,a=i.id;return a&&(e.config[a]=i),{reload:function(e){t.reload.call(t,e)},config:i}},s="treeGrid",f=".layui-table",u="layui-none",h="layui-table-view",p="layui-table-edit",y="table_radio_",g="layTableCheckbox",v=function(e){return e=e||{},['',"","{{# layui.each(d.data.cols, function(i1, item1){ }}","","{{# layui.each(item1, function(i2, item2){ }}",'{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}','{{# if(item2.fixed === "right"){ right = true; } }}',function(){return e.fixed&&"right"!==e.fixed?'{{# if(item2.fixed && item2.fixed !== "right"){ }}':"right"===e.fixed?'{{# if(item2.fixed === "right"){ }}':""}(),'",e.fixed?"{{# }; }}":"","{{# }); }}","","{{# }); }}","","
              ','
              1){ }}","group","{{# } else { }}","{{d.index}}-{{item2.field || i2}}",'{{# if(item2.type !== "normal"){ }}'," laytable-cell-{{ item2.type }}","{{# } }}","{{# } }}",'" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>','{{# if(item2.type === "checkbox"){ }}','',"{{# } else { }}",'{{item2.title||""}}',"{{# if(!(item2.colspan > 1) && item2.sort){ }}",'',"{{# } }}","{{# } }}","
              ","
              "].join("")},m=['',"","
              "].join(""),b=['
              ',"{{# if(d.data.toolbar){ }}",'
              ',"{{# } }}",'
              ',"{{# var left, right; }}",'
              ',v(),"
              ",'
              ',void 0,"
              ",'
              ',m,"
              ","{{# if(left){ }}",'
              ','
              ',v({fixed:!0}),"
              ",'
              ',m,"
              ","
              ","{{# }; }}","{{# if(right){ }}",'
              ','
              ',v({fixed:"right"}),'
              ',"
              ",'
              ',m,"
              ","
              ","{{# }; }}","
              ","{{# if(d.data.isPage){ }}",'
              ','
              ',"
              ","{{# } }}","
              "].join(""),x=t(window),D=t(document),k=function(e){var i=this;i.index=++c.index,i.config=t.extend({},i.config,c.config,e),i.configFirst=t.extend({},i.config,c.config,e),i.render(),c.pushClass(e.id,i)};k.prototype.config={limit:10,loading:!0,cellMinWidth:60,heightRemove:[],text:{none:"无数据"},isFilter:!1,method:"post",radDisabledNum:0,cheDisabledNum:0,branch:["",""],leaf:"",iconOpen:!1,isOpenDefault:!1,parseData:null,onClickRow:null,onDblClickRow:null,onBeforeCheck:null,onCheck:null,onRadio:null,isTree:!0,isPage:!1,height:"100%",model:"",editModel:"click"},k.prototype.configFirst={},k.prototype.render=function(){var e=this,a=e.config;if(a.elem=t(a.elem),a.where=a.where||{},a.id=a.id||a.elem.attr("id"),e.test(),a.request=t.extend({pageName:"page",limitName:"limit"},a.request),a.response=t.extend({statusName:"code",statusCode:0,msgName:"msg",dataName:"data",countName:"count"},a.response),"object"===_typeof(a.page)&&(a.limit=a.page.limit||a.limit,a.limits=a.page.limits||a.limits,e.page=a.page.curr=a.page.curr||1,delete a.page.elem,delete a.page.jump),!a.elem[0])return e;e.columnWidthInit();var n=a.elem,o=n.next("."+h),r=e.elem=t(i(b).render({VIEW_CLASS:h,data:a,index:e.index}));if(a.index=e.index,o[0]&&o.remove(),n.after(r),e.renderTdCss(),e.layHeader=r.find(".layui-table-header"),e.layMain=r.find(".layui-table-main"),e.layBody=r.find(".layui-table-body"),e.layFixed=r.find(".layui-table-fixed"),e.layFixLeft=r.find(".layui-table-fixed-l"),e.layFixRight=r.find(".layui-table-fixed-r"),e.layTool=r.find(".layui-table-tool"),e.layPage=r.find(".layui-table-page"),e.layFilter=r.find(".layui-table-filter"),e.layTool.html(i(t(a.toolbar).html()||"").render(a)),a.height&&(e.tableHeight(),e.resizeHeight(),e.renderCss()),a.cols.length>1){var l=e.layFixed.find(".layui-table-header").find("th");l.height(e.layHeader.height()-1-parseFloat(l.css("padding-top"))-parseFloat(l.css("padding-bottom")))}a.isFilter&&e.layFilter.html(e.renderFilter()),e.pullData(e.page,e.loading()),e.test()},k.prototype.initOpts=function(e){var t=this,i=t.config;e.checkbox&&(e.type="checkbox"),e.space&&(e.type="space"),e.type||(e.type="normal"),"normal"!==e.type&&(e.unresize=!0,e.width=e.width||c.config.initWidth[e.type]),i.isFilter&&0!=e.isFilter&&(e.isFilter=!0)},k.prototype.getParentDivHeight=function(e){return t("#"+e).parent().height()},k.prototype.getCols=function(e){var t=this,i={},a=t.config.cols[0],n=!1;/^[0-9]+.?[0-9]*$/.test(e)&&(n=!0);for(var o in a)if(n){if(o==parseInt(e))return a[o]}else if(e==a[o].field)return a[o];return i},k.prototype.getTr=function(e){return this.layBody.find('tr[data-index="'+e+'"]')},k.prototype.getTd=function(e,i){var a=this,n=a.getTr(e);return t(n).find('td[data-field="'+i+'"]')},k.prototype.reload=function(e){var i=this;i.config.data&&i.config.data.constructor===Array&&delete i.config.data,i.config=t.extend({},i.config,e),i.configFirst=t.extend({},i.config,e),i.render()},k.prototype.page=1,k.prototype.restNumbers=function(){var e=this,i=(e.config,e.layBody.find("table tbody tr")),a=0;i.each(function(e){t(this).attr("data-index",a),t(this).find(".laytable-cell-numbers p").text(a+1),t(this).data("index",a),a++})},k.prototype.resetData=function(e){var t=this,i=t.config;i.isTree&&(e.hasOwnProperty(c.config.cols.isOpen)||(e[c.config.cols.isOpen]=i.isOpenDefault),e.hasOwnProperty(c.config.cols.isShow)||(e[c.config.cols.isShow]=!!i.isOpenDefault)),e.hasOwnProperty(c.config.cols.cheDisabled)||(e[c.config.cols.cheDisabled]=!1),e[c.config.cols.cheDisabled]&&i.cheDisabledNum++,e[c.config.cols.radDisabled]&&i.radDisabledNum++,e.children=[]},k.prototype.resetDataMap=function(e){var t=this,i=t.config,a=i.idField,n={};return e&&e.forEach(function(e){n[e[a]]=e}),n},k.prototype.resetDataresetRoot=!0,k.prototype.resetDataRoot=function(e){var t=this,i=t.config,a=(i.treeId,i.treeUpId),n=c.getDataMap(t.config.id),o=c.cache[i.id].data.upIds||[],r={};c.cache[i.id].data.upIds=[],o=c.cache[i.id].data.upIds;for(var l=0;l0&&e(o.children,1+i)}}(e,1),a.forEach(function(e){var i=t.treeFindUpData(e);!i||i[c.config.cols.isOpen]&&i[c.config.cols.isShow]?e[c.config.cols.isShow]=!0:e[c.config.cols.isShow]=!1}),a},k.prototype.resetDatas=function(e){var t=this,i=t.config,a=(i.treeId,i.treeUpId,[]),n=[],o=e,r=t.resetDataMap(e);if(a.push(o),a.push(n),a.push(r),c.setDataList(t.config.id,o),c.setDataTreeList(t.config.id,n),c.setDataMap(t.config.id,r),null==e||e.length<=0)return a;for(var l=0;l0&&e.children.forEach(function(e){i.push(e),e.children.length>0&&t(e)})}var i=[];return t(e),i},k.prototype.treeConvertShowName=function(e){var t=this,i=(t.config,e.children&&e.children.length>0);return'
              '+function(){for(var t="",i=1;i"+t.treeIconRender(e,!0):a+=t.treeIconRender(e,!0),a}()+"
              "},k.prototype.treeNodeOpen=function(e,t){var i=this,a=i.layBody.find('tr[data-index="'+e[c.config.indexName]+'"]');if(e){e[c.config.cols.isOpen]=t;!function t(a){if(a.children&&a.children.length>0)for(var n=a.children,o=0;o0,l="";if(!o)return l;var d=function(){var t=''};if(r?l=e[c.config.cols.iconOpen]||e[c.config.cols.iconClose]?d():'"+(e[c.config.cols.isOpen]?a.config.branch[1]:a.config.branch[0])+"":e[c.config.cols.icon]?l=d():l+='"+a.config.leaf+"",i)return l;var s=a.layBody.find('tr[data-index="'+e[c.config.indexName]+'"]').find("td[data-field="+n.treeShowName+"]").find(".layui-table-cell");t(s).find("div .layui-tree-"+e[n.idField]).remove(),t(s).find("div").append(l)},k.prototype.pullData=function(e,i){var a=this,o=a.config,r=o.request,l=o.response;if(a.startTime=(new Date).getTime(),o.url){var d={};d[r.pageName]=e,d[r.limitName]=o.limit,a.filterRulesSet(d),a.sortSet(d),t.ajax({type:o.method||"get",url:o.url,data:t.extend(d,o.where),dataType:"json",headers:o.headers,success:function(t){t[l.dataName]||(t[l.dataName]=[],t[l.statusName]=0,t[l.countName]=0,t[l.msgName]="返回的数据状态异常"),a.resetDataresetRoot=!0,"function"==typeof o.parseData&&(t=o.parseData(t)||t),a.resetDatas(t[l.dataName]),t[l.dataName]=c.getDataList(o.id),t[l.statusName]!=l.statusCode?(a.renderForm(),a.layMain.html('
              '+(t[l.msgName]||"返回的数据状态异常")+"
              ")):(a.renderData(t,e,t[l.countName]),o.time=(new Date).getTime()-a.startTime+" ms"),i&&n.close(i),a.events(),"function"==typeof o.done&&o.done(t,e,t[l.countName]),a.renderRowCheck()},error:function(e,t){a.layMain.html('
              数据接口请求异常
              '),a.renderForm(),i&&n.close(i)}})}else if(o.data&&o.data.constructor===Array){var s={},f=e*o.limit-o.limit;s[l.dataName]=o.data.concat().splice(f,o.limit),s[l.countName]=o.data.length,a.renderData(s,e,o.data.length),a.events(),"function"==typeof o.done&&o.done(s,e,s[l.countName]),a.renderRowCheck()}},k.prototype.filterRulesSet=function(e){var t=this;e.filterRules=JSON.stringify(t.filterRules())},k.prototype.filterRules=function(){var e=this,i=[],a=e.layFilter.find("[name^='filter_']");return layui.each(a,function(e,a){if(t(a).val()){var n={field:a.name,op:"like",value:t(a).val(),datatype:"string"};i.push(n)}}),i},k.prototype.eachCols=function(e){var i=t.extend(!0,[],this.config.cols),a=[],n=0;layui.each(i,function(e,t){layui.each(t,function(t,o){if(o.colspan>1){var r=0;n++,o.CHILD_COLS=[],layui.each(i[e+1],function(e,t){t.PARENT_COL||r==o.colspan||(t.PARENT_COL=n,o.CHILD_COLS.push(t),r+=t.colspan>1?t.colspan:1)})}o.PARENT_COL||a.push(o)})});!function t(i){layui.each(i||a,function(i,a){if(a.CHILD_COLS)return t(a.CHILD_COLS);e(i,a)})}()},k.prototype.renderTreeConvertShowName=function(e){var i=this,a=i.config,n=a.elem,o=(n.next("."+h),i.treeConvertShowName(e)),r=i.layBody.find('tr[data-index="'+e[c.config.indexName]+'"]').find("td[data-field="+a.treeShowName+"]").find(".layui-table-cell");t(r).find("div").remove(),t(r).prepend(o)},k.prototype.renderTdCss=function(){var e=this,t=e.config,i=t.elem,a=i.next("."+h),n=e.index+"_"+s+"_td_style";a.find("#"+n).remove();var o='";a.append(o)},k.prototype.renderTdEdit=function(e,i){var a=this,n=t(a.getTd(e,i)),o=a.config,i=n.data("field"),r=n.data("edit"),e=n.parents("tr").eq(0).data("index"),l=n.find("div.layui-table-cell p").text(),d=c.getDataList(a.key)[e];if("select"===r){var s=(n.data("drop"),dl.ui.table.drop.findFieldObj(o.cols[0],i)),f=dl.cache.code.get(s.drop),u="",h=f.syscodevaluecache;for(var y in h){var g="";h[y].scv_value==d[i]&&(g="selected='selected'"),u+=""}var v=t('");n.find("."+p)[0]||n.append(v)}else{var m=t('');m[0].value=t.trim(l),n.find("."+p)[0]||n.append(m),m.focus()}},k.prototype.renderCss=function(){var e=this,t=e.config,i=t.elem,a=i.next("."+h),n=e.index+"_"+s+"_style";a.find("#"+n).remove();var o='";a.append(o)},k.prototype.renderTrUpids=function(e){var t=this,i=t.config,a=i.treeUpId,n=(e.upIds,' u_id="'+e[a]+'" ');return i.isTree?n:""},k.prototype.renderTd=function(e,a,n,o){var r=this,l=r.config,d=null==e[a.field]?"":String(e[a.field]),s=a.field||o,f=d,u=(r.getColElem(r.layHeader,s),"");return l.isTree&&l.treeShowName==a.field&&(u=r.treeConvertShowName(e)),['",'
              '+u+'

              '+function(){var o=t.extend(!0,{LAY_INDEX:n},e);if("checkbox"===a.type)return o[c.config.cols.cheDisabled]?"":'";if("numbers"===a.type)return n;if("drop"===a.type){var r=dl.ui.table.drop.findFieldObj(l.cols[0],s);if(r&&r.drop){dl.cache.code.get(r.drop);return dl.ui.table.drop.findDropLable(r.drop,f)}}else if("radio"===a.type)return o[c.config.cols.radDisabled]?"":'';return a.toolbar?i(t(a.toolbar).html()||"").render(o):a.templet?function(){return"function"==typeof a.templet?a.templet(o):i(t(a.templet).html()||String(f)).render(o)}():f}(),"

              "].join("")},k.prototype.renderTr=function(e,t){var i=this,a=(i.config,[]);return i.eachCols(function(n,o){var r=o.field||n;e[r];if(!(o.colspan>1)){var l=i.renderTd(e,o,t,n);a.push(l)}}),a},k.prototype.renderData=function(e,t,i,a){var o=this,r=o.config,l=e[r.response.dataName]||[],d=[],s=[],f=[],h=function(){if(!a&&o.sortKey)return o.sort(o.sortKey.field,o.sortKey.sort,!0);layui.each(l,function(e,i){var n=(o.treeFindUpData(i),"");!i[c.config.cols.isShow]&&r.isTree&&(n="display: none;");var l=[],u=[],h=[],p=e+r.limit*(t-1)+1;0!==i.length&&(a||(i[c.config.indexName]=e),l=o.renderTr(i,p),d.push('"+l.join("")+""),s.push(''+u.join("")+""),f.push(''+h.join("")+""))}),o.layBody.scrollTop(0),o.layMain.find("."+u).remove(),o.layMain.find("tbody").html(d.join("")),o.layFixLeft.find("tbody").html(s.join("")),o.layFixRight.find("tbody").html(f.join("")),o.renderForm(),o.haveInit?o.scrollPatch():setTimeout(function(){o.scrollPatch()},50),o.haveInit=!0,n.close(o.tipsIndex)};return o.key=r.id||r.index,c.setDataList(o.key,l),o.layPage[0===l.length&&1==t?"addClass":"removeClass"]("layui-hide"),a?h():0===l.length?(o.renderForm(),o.layFixed.remove(),o.layMain.find("tbody").html(""),o.layMain.find("."+u).remove(),o.layMain.append('
              '+(e[r.response.msgName]?e[r.response.msgName]:r.text.none)+"
              ")):(h(),o.renderPage(i),void c.pushClassIds(r.id,!0))},k.prototype.renderPage=function(e){var i=this,n=i.config;n.isPage&&(n.page=t.extend({elem:"layui-table-page"+n.index,count:e,limit:n.limit,limits:n.limits||[10,15,20,30,40,50,60,70,80,90],groups:3,layout:["prev","page","next","skip","count","limit"],prev:'',next:'',jump:function(e,t){t||(i.page=e.curr,n.limit=e.limit,i.pullData(e.curr,i.loading()))}},n.page),n.page.count=e,a.render(n.page))},k.prototype.renderFilter=function(){var e=this,t=e.config,i=e.index,a=[];return a.push('
              '),a.push(''),layui.each(t.cols,function(e,t){layui.each(t,function(e,t){var n=t.field||e,o=t.minWidth?"data-minwidth='"+t.minWidth+"'":"",r=t.colspan?'colspan="'+t.colspan+'"':"",l=t.rowspan?'rowspan="'+t.rowspan+'"':"",c=t.unresize?'data-unresize="true"':"";a.push('")})}),a.push("
              "),a.push('
              1?e="group":(e=i+"-"+n,"normal"!==t.type&&(e+=" laytable-cell-"+t.type)),e}()+'">'),t.isFilter&&t.field?a.push(''):a.push(""),a.push("
              "),a.push("
              "),a.join("")},k.prototype.renderRowCheck=function(){var e=this,t=e.config,i=(e.index,c.getDataList(t.id));i&&i.forEach(function(t){var i=e.layBody.find("tr[data-index="+t[c.config.indexName]+"]");t[c.config.cols.isRowCheck]?i.css("background-color","#ccc"):i.css("background-color","")})},k.prototype.getColElem=function(e,t){var i=this,a=i.config;return e.eq(0).find(".laytable-cell-"+a.index+"-"+t+":eq(0)")},k.prototype.renderForm=function(e){o.render(e,"LAY-table-"+this.index)},k.prototype.sortSet=function(e){var t=this,i=[];t.config.cols[0].forEach(function(e){if(e.sortType){var t={field:e.field,sort:e.sortType};i.push(t)}}),e.sort=JSON.stringify(i)},k.prototype.sort=function(e,i,a,n){var o,l=this,d=l.config;d.elem.attr("lay-filter"),c.getDataList(l.key);"string"==typeof e&&l.layHeader.find("th").each(function(i,a){var n=t(this),r=n.data("field");if(r===e)return e=n,o=r,!1});try{var o=o||e.data("field");if(l.sortKey&&!a&&o===l.sortKey.field&&i===l.sortKey.sort)return;l.layHeader.find("th .laytable-cell-"+d.index+"-"+o).find(".layui-table-sort").attr("lay-sort",i||null),l.layFixed.find("th")}catch(e){return r.error("Table modules: Did not match to field")}var s=l.getCols(o);s&&(s.sortType=i)},k.prototype.loading=function(){var e=this,t=e.config;if(t.loading&&t.url)return n.msg("数据请求中",{icon:16,offset:[e.elem.offset().top+e.elem.height()/2-35-x.scrollTop()+"px",e.elem.offset().left+e.elem.width()/2-90-x.scrollLeft()+"px"],time:-1,anim:-1,fixed:!1})},k.prototype.setCheckData=function(e,t){var i=this,a=(i.config,c.getDataList(i.key));a[e]&&a[e].constructor!==Array&&(a[e][c.config.cols.isCheckName]=t)},k.prototype.syncCheckAll=function(){var e=this,t=e.config,i=c.getDataList(e.config.id);if(i){var a=!0,n=0;if(i.forEach(function(t){if(!t[c.config.cols.cheDisabled])if(t[c.config.cols.isCheckName]){var i=e.layBody.find("tr[data-index="+t[c.config.indexName]+"]").find('input[name="'+g+'"]');i.prop("checked",!0),n++}else{a=!1;var i=e.layBody.find("tr[data-index="+t[c.config.indexName]+"]").find('input[name="'+g+'"]');i.prop("checked",!1)}}),a){var o=e.layHeader.find('input[name="'+g+'"]');o.prop("checked",!0)}if(n1||(/\d+%$/.test(l)?n.width=l=Math.floor(parseFloat(l)/100*r):!n._is_width_dev&&l||(n._is_width_dev=!0,n.width=l=0,a++),o+=l)})}),e.autoColNums=a,r>o&&a&&(n=(r-o)/a),layui.each(t.cols,function(e,i){layui.each(i,function(e,i){var a=i.minWidth||t.cellMinWidth;i.colspan>1||0===i.width&&(i.width=Math.floor(n>=a?n:a))})})},k.prototype.resizeWidth=function(){this.renderTdCss()},k.prototype.tableHeight=function(){var e=this,i=e.config,a=e.configFirst;if(!c.kit.isNumber(a.height)){var n=0;if(i.heightRemove&&c.kit.isArray(i.heightRemove)){i.heightRemove.forEach(function(e){var i=c.kit.isNumber(e)?e:t(e).outerHeight(!0);c.kit.isNumber(i)&&(n+=i)})}var o=x.height()-n-1;e.fullHeightGap=0,i.height&&/^full-\d+$/.test(i.height)&&(e.fullHeightGap=i.height.split("-")[1]),i.height=o-e.fullHeightGap}},k.prototype.resizeHeight=function(){var e,t=this,i=t.config,a=i.height;a<135&&(a=135),t.elem.css("height",a-80);var n=i.isFilter?76:38;e=parseFloat(a)-("tree"==t.config.model?0:n)-1,i.toolbar&&(e-=t.layTool.outerHeight()),i.isPage&&(e=e-t.layPage.outerHeight()-1),t.layMain.css("height",e-80)},k.prototype.getScrollWidth=function(e){var t=0;return e?t=e.offsetWidth-e.clientWidth:(e=document.createElement("div"),e.style.width="100px",e.style.height="100px",e.style.overflowY="scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t},k.prototype.scrollPatch=function(){var e=this,i=e.layMain.children("table"),a=e.layMain.width()-e.layMain.prop("clientWidth"),n=e.layMain.height()-e.layMain.prop("clientHeight"),o=e.getScrollWidth(e.layMain[0]),r=i.outerWidth()-e.layMain.width();if(e.autoColNums&&r<5&&!e.scrollPatchWStatus){var l=e.layHeader.eq(0).find("thead th:last-child"),c=l.data("field");e.getCssRule(c,function(t){var i=t.style.width||l.outerWidth();t.style.width=parseFloat(i)-o-r+"px",e.layMain.height()-e.layMain.prop("clientHeight")>0&&(t.style.width=parseFloat(t.style.width)-1+"px"),e.scrollPatchWStatus=!0})}if(a&&n){if(e.elem.find(".layui-table-patch").length<=0){var d=t('
              ');d.find("div").css({width:a}),e.layHeader.eq(0).find("thead tr").append(d)}}else e.layFilter.eq(0).find(".layui-table-patch").remove(),e.layHeader.eq(0).find(".layui-table-patch").remove();var s=e.layMain.height(),f=s-n;e.layFixed.find(".layui-table-body").css("height",i.height()-80>f?f:"auto"),e.layFixRight[r>0?"removeClass":"addClass"]("layui-hide"),e.layFixRight.css("right",a-1)},k.prototype.events=function(){var e,i=this,a=i.config,o=t("body"),r={},l=i.layHeader.find("th"),d=i.layBody.find("tr");d.unbind("click").on("click",function(e){var a=t(this).attr("data-index");c.treeRowCheck(i.config.id,a)}),d.unbind("dblclick").on("dblclick",function(e){var n=t(this).attr("data-index"),o=c.getDataList(i.config.id),r=o[n];"function"==typeof a.onDblClickRow&&a.onDblClickRow(n,r)}),l.unbind("mousemove").on("mousemove",function(e){var i=t(this),a=i.offset().left,n=e.clientX-a;i.attr("colspan")>1||i.data("unresize")||r.resizeStart||(r.allowResize=i.width()-n<=10,o.css("cursor",r.allowResize?"col-resize":""))}),l.unbind("mouseleave").on("mouseleave",function(){t(this);r.resizeStart||o.css("cursor","")}),l.unbind("mousedown").on("mousedown",function(e){var n=t(this);if(r.allowResize){var o=n.data("field");e.preventDefault(),r.resizeStart=!0,r.offset=[e.clientX,e.clientY],i.getCssRule(o,function(e){var t=e.style.width||n.outerWidth();r.rule=e,r.ruleWidth=parseFloat(t),r.minWidth=n.data("minwidth")||a.cellMinWidth})}}),D.unbind("mousemove").on("mousemove",function(t){if(r.resizeStart){if(t.preventDefault(),r.rule){var a=r.ruleWidth+t.clientX-r.offset[0];aMath.round(s.outerWidth())&&(e.tipsIndex=n.tips(['
              ',s.html(),"
              ",''].join(""),s[0],{tips:[3,""],time:-1,anim:-1,maxWidth:l.ios||l.android?300:600,isOutAnim:!1,skin:"layui-table-tips",success:function(e,t){e.find(".layui-table-tips-c").on("click",function(){n.close(t)})}}))}}}),e.layBody.on("dblclick","td div.layui-table-cell p",function(){var i=t(this).parent().parent(),a=i.data("field"),r=i.data("edit"),l=i.parents("tr").eq(0).data("index"),d=(c.getDataList(e.key)[l],i.children(o),e.config);if(n.close(e.tipsIndex),!i.data("off"))return r&&"dblclick"==d.editModel?void e.renderTdEdit(l,a):void 0}),e.layBody.on("change","."+p,function(){var i=t(this),a=this.value,n=i.parent().data("field"),o=i.parents("tr").eq(0).data("index"),l=c.getDataList(e.key)[o];l[n]=a,layui.event.call(this,s,"edit("+r+")",{value:a,data:l,field:n})}),e.layBody.on("blur","."+p,function(){var a,n=t(this),r=n.parent().data("field"),l=n.parents("tr").eq(0).data("index"),d=n.parent().data("edit"),s=c.getDataList(e.key)[l],f=e.config;e.eachCols(function(e,t){t.field==r&&t.templet&&(a=t.templet)});var u="";if("select"===d){var h=dl.ui.table.drop.findFieldObj(f.cols[0],r);if(h&&h.drop){dl.cache.code.get(h.drop);u=dl.ui.table.drop.findDropLable(h.drop,this.value)}n.parent().find(o+" p").html(a?i(t(a).html()||u).render(s):u)}else n.parent().find(o+" p").html(a?i(t(a).html()||this.value).render(s):this.value);n.parent().data("content",this.value),n.remove()}),e.elem.on("click","i.layui-tree-head",function(){var i=t(this),a=i.parents("tr").eq(0).data("index"),n=(e.config,c.getDataList(e.key)),o=n[a];e.treeNodeOpen(o,!o[c.config.cols.isOpen]),e.resize()}),e.elem.on("click",'input[name="'+g+'"]+',function(){var i=t(this).prev(),n=(e.layBody.find('input[name="'+g+'"]'),i.parents("tr").eq(0).data("index")),o=i[0].checked,l=c.getDataList(e.config.id)[n],d="layTableAllChoose"===i.attr("lay-filter");if(d){c.getDataList(e.key).forEach(function(t){t[c.config.cols.cheDisabled]||e.setCheckData(t[c.config.indexName],o)})}else if(e.setCheckData(n,o),a.isTree){var f=e.treeFindSonData(l);f.forEach(function(t){t[c.config.cols.cheDisabled]||e.setCheckData(t[c.config.indexName],o)});var u=e.treeFindUpData(l);!function t(i){if(null!=i&&i&&i.children.length>0){var a=!0;i.children.forEach(function(e){e[c.config.cols.isCheckName]||(a=!1)}),a&&e.setCheckData(i[c.config.indexName],o);var n=e.treeFindUpData(i);n&&t(n)}}(u)}e.syncCheckAll(),layui.event.call(this,s,"checkbox("+r+")",{checked:o,data:c.getDataList(e.key)?l||{}:{},type:d?"all":"one"}),"function"==typeof a.onCheck&&a.onCheck(l,o,d)}),e.elem.on("click",'input[name="'+y+'"]+',function(){var i=t(this).prev(),n=i.parents("tr").eq(0).data("index"),o=c.getDataList(e.config.id)[n];"function"==typeof a.onRadio&&a.onRadio(o)}),e.layBody.on("click","*[lay-event]",function(){var n=t(this),l=n.parents("tr").eq(0).data("index"),d=e.layBody.find('tr[data-index="'+l+'"]'),f=(c.getDataList(e.key),c.getDataList(e.key)[l]);layui.event.call(this,s,"tool("+r+")",{data:f,event:n.attr("lay-event"),tr:d,del:function(){c.delRow(a.id,f)},update:function(a){a=a||{},layui.each(a,function(a,n){if(a in f){var r,l=d.children('td[data-field="'+a+'"]');f[a]=n,e.eachCols(function(e,t){t.field==a&&t.templet&&(r=t.templet)}),l.children(o).html(r?i(t(r).html()||n).render(f):n),l.data("content",n)}})}}),d.addClass("layui-table-click").siblings("tr").removeClass("layui-table-click")})},d.config={},c.init(),e(s,c)}); \ No newline at end of file