作者 Karson

新增Cxselect联动插件

新增后台上传头像功能
新增全局捕捉管理员日志
新增多个开发示例(联表、联动、跳转等)
新增Backend.api.addtabs方法,用于无刷新快速切换
新增面包屑导航显示
新增全局Config变量,无需再引入Config模块

修复刷新当前页URL出现编码的问题
修复Nice-validator的加载问题,现已默认加载中文语言
修复当管理员密码为空时导致无法登录的BUG
修复管理员列表显示非自己组别管理BUG
修复无法执行typeahead查找BUG
修复二级目录下cdnurl值未自适应的问题

移除高级搜索插件,使用普通搜索替代
移除require-config,使用全局Config替代
合并backend-func.css和backend.css为单一文件
JS和控制器中移除后台登录每日一图,改在视图中直接输出
正在显示 80 个修改的文件 包含 2276 行增加1551 行删除

要显示太多修改。

为保证性能只显示 80 of 80+ 个文件。

<?php
namespace app\admin\behavior;
use think\Config;
class AdminLog
{
public function run(&$params)
{
if (request()->isPost())
{
\app\admin\model\AdminLog::record();
}
}
}
... ...
... ... @@ -4,7 +4,7 @@
官网: http://www.fastadmin.net
演示: http://demo.fastadmin.net
Date: 04/15/2017 00:15:20 AM
Date: 05/21/2017 14315:20 AM
*/
SET FOREIGN_KEY_CHECKS = 0;
... ... @@ -35,7 +35,7 @@ CREATE TABLE `fa_admin` (
-- Records of `fa_admin`
-- ----------------------------
BEGIN;
INSERT INTO `fa_admin` VALUES ('1', 'admin', 'Admin', '075eaec83636846f51c152f29b98a2fd', 's4f3', '/assets/img/avatar.png', 'admin@fastadmin.net', '0', '1492185129', '1492186163', '1492185129', '6780cd73-f650-4627-9371-60d3739f4e77', 'normal'), ('2', 'admin2', 'admin2', '9a28ce07ce875fbd14172a9ca5357d3c', '2dHDmj', '/assets/img/avatar.png', 'admin2@fastadmin.net', '0', '0', '1492186163', '1492186163', '', 'normal'), ('3', 'admin3', 'admin3', '1c11f945dfcd808a130a8c2a8753fe62', 'WOKJEn', '/assets/img/avatar.png', 'admin3@fastadmin.net', '0', '0', '1492186201', '1492186201', '', 'normal'), ('4', 'admin22', 'admin22', '1c1a0aa0c3c56a8c1a908aab94519648', 'Aybcn5', '/assets/img/avatar.png', 'admin22@fastadmin.net', '0', '0', '1492186240', '1492186240', '', 'normal'), ('5', 'admin32', 'admin32', 'ade94d5d7a7033afa7d84ac3066d0a02', 'FvYK0u', '/assets/img/avatar.png', 'admin32@fastadmin.net', '0', '0', '1492186263', '1492186263', '', 'normal');
INSERT INTO `fa_admin` VALUES ('1', 'admin', 'Admin', '075eaec83636846f51c152f29b98a2fd', 's4f3', '/assets/img/avatar.png', 'admin@fastadmin.net', '0', '0', '1492186163', '1495347600', '', 'normal'), ('2', 'admin2', 'admin2', '9a28ce07ce875fbd14172a9ca5357d3c', '2dHDmj', '/assets/img/avatar.png', 'admin2@fastadmin.net', '0', '0', '1492186163', '1492186163', '', 'normal'), ('3', 'admin3', 'admin3', '1c11f945dfcd808a130a8c2a8753fe62', 'WOKJEn', '/assets/img/avatar.png', 'admin3@fastadmin.net', '0', '0', '1492186201', '1492186201', '', 'normal'), ('4', 'admin22', 'admin22', '1c1a0aa0c3c56a8c1a908aab94519648', 'Aybcn5', '/assets/img/avatar.png', 'admin22@fastadmin.net', '0', '0', '1492186240', '1492186240', '', 'normal'), ('5', 'admin32', 'admin32', 'ade94d5d7a7033afa7d84ac3066d0a02', 'FvYK0u', '/assets/img/avatar.png', 'admin32@fastadmin.net', '0', '0', '1492186263', '1492186263', '', 'normal');
COMMIT;
-- ----------------------------
... ... @@ -49,10 +49,12 @@ CREATE TABLE `fa_admin_log` (
`url` varchar(100) NOT NULL DEFAULT '' COMMENT '操作页面',
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '日志标题',
`content` text NOT NULL COMMENT '内容',
`ip` varchar(50) NOT NULL DEFAULT '' COMMENT 'IP',
`useragent` varchar(255) NOT NULL DEFAULT '' COMMENT 'User-Agent',
`createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '操作时间',
PRIMARY KEY (`id`),
KEY `name` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='管理员日志表';
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='管理员日志表';
-- ----------------------------
-- Table structure for `fa_article`
... ... @@ -96,7 +98,14 @@ CREATE TABLE `fa_attachment` (
`sha1` varchar(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码',
PRIMARY KEY (`id`),
UNIQUE KEY `sha1` (`sha1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='附件表';
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='附件表';
-- ----------------------------
-- Records of `fa_attachment`
-- ----------------------------
BEGIN;
INSERT INTO `fa_attachment` VALUES ('1', '/uploads/20170520/81c791c0b84edf167b233a7917119399.jpg', '500', '356', 'jpg', '0', '120891', 'image/jpeg', '', '1495270641', '1495270641', '1495270641', '92be279c3cf306b65b8ac46964d7986552ee5449'), ('2', '/uploads/20170520/85aae95c4373e792d422b4c6a453d07b.jpg', '600', '401', 'jpg', '0', '86257', 'image/jpeg', '', '1495270673', '1495270673', '1495270673', '8a3fa16c5623af5134fc5f063e40962920785b59'), ('3', '/uploads/20170520/a67cfec11b4dd895eedc33a58aaa8bba.jpg', '420', '315', 'jpg', '0', '19076', 'image/jpeg', '', '1495270783', '1495270783', '1495270784', 'b2a30fc250d462ad7a450c43019279268f741a7c'), ('4', '/uploads/20170520/cbd11475b0cd64d7d02956070226e964.jpg', '500', '333', 'jpg', '0', '31768', 'image/jpeg', '', '1495270790', '1495270790', '1495270790', '99925d7cd560d32b6b1d6c03abe71f5496f3a216'), ('5', '/uploads/20170520/a82004ccabbacff58213459013bd2458.jpg', '500', '334', 'jpg', '0', '41465', 'image/jpeg', '', '1495270810', '1495270810', '1495270810', '2748fb122e5e42b37abae578bf9244476b31b29a'), ('6', '/uploads/20170520/6c3618d7d4c03a00931f091677d0bb98.jpg', '600', '401', 'jpg', '0', '52952', 'image/jpeg', '', '1495270817', '1495270817', '1495270817', 'd9ad6ac645fdf8bcc2bf7a519d4e54acedb54861'), ('7', '/uploads/20170520/0bc9cd023e0de3c943f29eafa8ae5da9.jpg', '510', '397', 'jpg', '0', '43517', 'image/jpeg', '', '1495270866', '1495270866', '1495270866', 'c2b810bceded447d30ed556a4429da8cb78dfd11'), ('8', '/uploads/20170520/0a67e00f5dc18d3b4098617be6e8fb4a.jpg', '500', '333', 'jpg', '0', '97654', 'image/jpeg', '', '1495271110', '1495271110', '1495271110', 'df39da0f5bff78e72bee7aec2c60161b3239f6e1'), ('9', '/uploads/20170520/5fa1f64bc1bc4c0e0279591df3ec9699.jpg', '600', '511', 'jpg', '0', '76951', 'image/jpeg', '', '1495271716', '1495271716', '1495271716', '53c4a8c3c40c3f5b79ea8d9b99719fac522bf1ef'), ('10', '/uploads/20170520/fdb91b442e627cb3a8388386ca14e03d.jpg', '510', '364', 'jpg', '0', '41151', 'image/jpeg', '', '1495273057', '1495273057', '1495273057', '600fca07ebfc7769c880e2fb4c19bad26f04d1dd');
COMMIT;
-- ----------------------------
-- Table structure for `fa_auth_group`
... ... @@ -161,13 +170,13 @@ CREATE TABLE `fa_auth_rule` (
UNIQUE KEY `name` (`name`) USING BTREE,
KEY `pid` (`pid`),
KEY `weigh` (`weigh`)
) ENGINE=InnoDB AUTO_INCREMENT=10491 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表';
) ENGINE=InnoDB AUTO_INCREMENT=10537 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='节点表';
-- ----------------------------
-- Records of `fa_auth_rule`
-- ----------------------------
BEGIN;
INSERT INTO `fa_auth_rule` VALUES ('10400', 'file', '0', '/admin/dashboard', '控制台', 'fa fa-dashboard', '', '用于展示当前系统中的统计数据、统计报表及重要实时数据\r\n', '1', '1491655325', '1492184975', '0', 'normal'), ('10401', 'file', '10400', '/admin/dashboard/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10402', 'file', '10400', '/admin/dashboard/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10403', 'file', '10400', '/admin/dashboard/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10404', 'file', '10400', '/admin/dashboard/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10405', 'file', '10400', '/admin/dashboard/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10406', 'file', '0', '/admin/page', '单页管理', 'fa fa-tags', '', '用于管理普通的单页面,通常用于关于我们、联系我们、商务合作等单一页面\r\n', '1', '1491655325', '1494259768', '0', 'normal'), ('10407', 'file', '10406', '/admin/page/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10408', 'file', '10406', '/admin/page/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10409', 'file', '10406', '/admin/page/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10410', 'file', '10406', '/admin/page/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10411', 'file', '10406', '/admin/page/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10412', 'file', '0', '/admin/auth', '权限管理', 'fa fa-group', '', '', '1', '1491655325', '1494259815', '0', 'normal'), ('10413', 'file', '10412', '/admin/auth/admin', '管理员管理', 'fa fa-users', '', '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', '1', '1491655325', '1491655325', '0', 'normal'), ('10414', 'file', '10413', '/admin/auth/admin/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10415', 'file', '10413', '/admin/auth/admin/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10416', 'file', '10413', '/admin/auth/admin/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10417', 'file', '10413', '/admin/auth/admin/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10418', 'file', '10413', '/admin/auth/admin/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10419', 'file', '10412', '/admin/auth/group', '角色组', 'fa fa-group', '', '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员', '1', '1491655325', '1491655325', '0', 'normal'), ('10420', 'file', '10419', '/admin/auth/group/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10421', 'file', '10419', '/admin/auth/group/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10422', 'file', '10419', '/admin/auth/group/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10423', 'file', '10419', '/admin/auth/group/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10424', 'file', '10419', '/admin/auth/group/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10425', 'file', '10412', '/admin/auth/rule', '规则管理', 'fa fa-list', '', '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点', '1', '1491655325', '1491655325', '0', 'normal'), ('10426', 'file', '10425', '/admin/auth/rule/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10427', 'file', '10425', '/admin/auth/rule/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10428', 'file', '10425', '/admin/auth/rule/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10429', 'file', '10425', '/admin/auth/rule/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10430', 'file', '10425', '/admin/auth/rule/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10431', 'file', '0', '/admin/general', '常规管理', 'fa fa-cog', '', '', '1', '1491655325', '1494259697', '0', 'normal'), ('10432', 'file', '10431', '/admin/general/attachment', '附件管理', 'fa fa-circle-o\r', '', '主要用于管理上传到又拍云的数据或上传至本服务的上传数据\r', '1', '1491655325', '1491655325', '0', 'normal'), ('10433', 'file', '10432', '/admin/general/attachment/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10434', 'file', '10432', '/admin/general/attachment/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10435', 'file', '10432', '/admin/general/attachment/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10436', 'file', '10432', '/admin/general/attachment/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10437', 'file', '10432', '/admin/general/attachment/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10438', 'file', '10431', '/admin/general/configvalue', '基本配置', 'fa fa-cog', '', '用于管理一些字典数据,通常以键值格式进行录入,保存的数据格式为JSON', '1', '1491655325', '1491655325', '0', 'normal'), ('10439', 'file', '10438', '/admin/general/configvalue/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10440', 'file', '10438', '/admin/general/configvalue/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10441', 'file', '10438', '/admin/general/configvalue/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10442', 'file', '10438', '/admin/general/configvalue/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10443', 'file', '10438', '/admin/general/configvalue/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10444', 'file', '10431', '/admin/general/crontab', '定时任务', 'fa fa-tasks', '', '类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell', '1', '1491655325', '1491655325', '0', 'normal'), ('10445', 'file', '10444', '/admin/general/crontab/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10446', 'file', '10444', '/admin/general/crontab/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10447', 'file', '10444', '/admin/general/crontab/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10448', 'file', '10444', '/admin/general/crontab/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10449', 'file', '10444', '/admin/general/crontab/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10450', 'file', '10431', '/admin/general/database', '数据库管理', 'fa fa-database', '', '可在线进行一些简单的数据库表优化或修复,查看表结构和数据。也可以进行SQL语句的操作', '1', '1491655325', '1491655325', '0', 'normal'), ('10451', 'file', '10450', '/admin/general/database/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10452', 'file', '10450', '/admin/general/database/query', 'SQL查询', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10453', 'file', '10450', '/admin/general/database/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10454', 'file', '10450', '/admin/general/database/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10455', 'file', '10450', '/admin/general/database/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10456', 'file', '10450', '/admin/general/database/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10457', 'file', '10431', '/admin/general/profile', '个人配置', 'fa fa-user\r', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10458', 'file', '10457', '/admin/general/profile/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10459', 'file', '10457', '/admin/general/profile/update', '更新个人信息', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10460', 'file', '10457', '/admin/general/profile/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10461', 'file', '10457', '/admin/general/profile/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10462', 'file', '10457', '/admin/general/profile/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10463', 'file', '10457', '/admin/general/profile/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10464', 'file', '0', '/admin/wechat', '微信管理', 'fa fa-wechat', '', '', '1', '1491655325', '1494259718', '0', 'normal'), ('10465', 'file', '10464', '/admin/wechat/autoreply', '微信自动回复管理', 'fa fa-circle-o\r', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10466', 'file', '10465', '/admin/wechat/autoreply/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10467', 'file', '10465', '/admin/wechat/autoreply/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10468', 'file', '10465', '/admin/wechat/autoreply/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10469', 'file', '10465', '/admin/wechat/autoreply/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10470', 'file', '10465', '/admin/wechat/autoreply/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10471', 'file', '10464', '/admin/wechat/config', '配置管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10472', 'file', '10471', '/admin/wechat/config/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10473', 'file', '10471', '/admin/wechat/config/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10474', 'file', '10471', '/admin/wechat/config/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10475', 'file', '10471', '/admin/wechat/config/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10476', 'file', '10471', '/admin/wechat/config/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10477', 'file', '10464', '/admin/wechat/menu', '菜单管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10478', 'file', '10477', '/admin/wechat/menu/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10479', 'file', '10477', '/admin/wechat/menu/edit', '修改', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10480', 'file', '10477', '/admin/wechat/menu/sync', '同步', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10481', 'file', '10477', '/admin/wechat/menu/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10482', 'file', '10477', '/admin/wechat/menu/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10483', 'file', '10477', '/admin/wechat/menu/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10484', 'file', '10464', '/admin/wechat/response', '资源管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '0', 'normal'), ('10485', 'file', '10484', '/admin/wechat/response/select', '选择素材', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10486', 'file', '10484', '/admin/wechat/response/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10487', 'file', '10484', '/admin/wechat/response/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10488', 'file', '10484', '/admin/wechat/response/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10489', 'file', '10484', '/admin/wechat/response/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10490', 'file', '10484', '/admin/wechat/response/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '0', 'normal'), ('10491', 'file', '0', '/admin/category', '分类管理', 'fa fa-list\r', '', '用于统一管理网站的所有分类,分类可进行无限级分类\r', '1', '1494259006', '1494259006', '0', 'normal'), ('10492', 'file', '10491', '/admin/category/index', '查看', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10493', 'file', '10491', '/admin/category/add', '添加', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10494', 'file', '10491', '/admin/category/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10495', 'file', '10491', '/admin/category/del', '删除', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal'), ('10496', 'file', '10491', '/admin/category/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '0', 'normal');
INSERT INTO `fa_auth_rule` VALUES ('10400', 'file', '0', '/admin/dashboard', '控制台', 'fa fa-dashboard', '', '用于展示当前系统中的统计数据、统计报表及重要实时数据\r\n', '1', '1491655325', '1492184975', '137', 'normal'), ('10401', 'file', '10400', '/admin/dashboard/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '136', 'normal'), ('10402', 'file', '10400', '/admin/dashboard/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '135', 'normal'), ('10403', 'file', '10400', '/admin/dashboard/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '134', 'normal'), ('10404', 'file', '10400', '/admin/dashboard/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '133', 'normal'), ('10405', 'file', '10400', '/admin/dashboard/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '132', 'normal'), ('10406', 'file', '0', '/admin/page', '单页管理', 'fa fa-tags', '', '用于管理普通的单页面,通常用于关于我们、联系我们、商务合作等单一页面\r\n', '1', '1491655325', '1494259768', '73', 'normal'), ('10407', 'file', '10406', '/admin/page/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '130', 'normal'), ('10408', 'file', '10406', '/admin/page/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '129', 'normal'), ('10409', 'file', '10406', '/admin/page/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '128', 'normal'), ('10410', 'file', '10406', '/admin/page/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '127', 'normal'), ('10411', 'file', '10406', '/admin/page/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '126', 'normal'), ('10412', 'file', '0', '/admin/auth', '权限管理', 'fa fa-group', '', '', '1', '1491655325', '1494259815', '46', 'normal'), ('10413', 'file', '10412', '/admin/auth/admin', '管理员管理', 'fa fa-users', '', '一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成', '1', '1491655325', '1491655325', '124', 'normal'), ('10414', 'file', '10413', '/admin/auth/admin/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '123', 'normal'), ('10415', 'file', '10413', '/admin/auth/admin/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '122', 'normal'), ('10416', 'file', '10413', '/admin/auth/admin/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '121', 'normal'), ('10417', 'file', '10413', '/admin/auth/admin/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '120', 'normal'), ('10418', 'file', '10413', '/admin/auth/admin/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '119', 'normal'), ('10419', 'file', '10412', '/admin/auth/group', '角色组', 'fa fa-group', '', '角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员', '1', '1491655325', '1491655325', '118', 'normal'), ('10420', 'file', '10419', '/admin/auth/group/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '117', 'normal'), ('10421', 'file', '10419', '/admin/auth/group/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '116', 'normal'), ('10422', 'file', '10419', '/admin/auth/group/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '115', 'normal'), ('10423', 'file', '10419', '/admin/auth/group/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '114', 'normal'), ('10424', 'file', '10419', '/admin/auth/group/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '113', 'normal'), ('10425', 'file', '10412', '/admin/auth/rule', '规则管理', 'fa fa-list', '', '规则通常对应一个控制器的方法,同时左侧的菜单栏数据也从规则中体现,通常建议通过控制台进行生成规则节点', '1', '1491655325', '1491655325', '112', 'normal'), ('10426', 'file', '10425', '/admin/auth/rule/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '111', 'normal'), ('10427', 'file', '10425', '/admin/auth/rule/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '110', 'normal'), ('10428', 'file', '10425', '/admin/auth/rule/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '109', 'normal'), ('10429', 'file', '10425', '/admin/auth/rule/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '108', 'normal'), ('10430', 'file', '10425', '/admin/auth/rule/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '107', 'normal'), ('10431', 'file', '0', '/admin/general', '常规管理', 'fa fa-cog', '', '', '1', '1491655325', '1494259697', '131', 'normal'), ('10432', 'file', '10431', '/admin/general/attachment', '附件管理', 'fa fa-circle-o\r', '', '主要用于管理上传到又拍云的数据或上传至本服务的上传数据\r', '1', '1491655325', '1491655325', '80', 'normal'), ('10433', 'file', '10432', '/admin/general/attachment/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '104', 'normal'), ('10434', 'file', '10432', '/admin/general/attachment/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '103', 'normal'), ('10435', 'file', '10432', '/admin/general/attachment/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '102', 'normal'), ('10436', 'file', '10432', '/admin/general/attachment/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '101', 'normal'), ('10437', 'file', '10432', '/admin/general/attachment/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '100', 'normal'), ('10438', 'file', '10431', '/admin/general/configvalue', '基本配置', 'fa fa-cog', '', '用于管理一些字典数据,通常以键值格式进行录入,保存的数据格式为JSON', '1', '1491655325', '1491655325', '105', 'normal'), ('10439', 'file', '10438', '/admin/general/configvalue/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '98', 'normal'), ('10440', 'file', '10438', '/admin/general/configvalue/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '97', 'normal'), ('10441', 'file', '10438', '/admin/general/configvalue/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '96', 'normal'), ('10442', 'file', '10438', '/admin/general/configvalue/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '95', 'normal'), ('10443', 'file', '10438', '/admin/general/configvalue/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '94', 'normal'), ('10444', 'file', '10431', '/admin/general/crontab', '定时任务', 'fa fa-tasks', '', '类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell', '1', '1491655325', '1491655325', '99', 'normal'), ('10445', 'file', '10444', '/admin/general/crontab/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '92', 'normal'), ('10446', 'file', '10444', '/admin/general/crontab/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '91', 'normal'), ('10447', 'file', '10444', '/admin/general/crontab/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '90', 'normal'), ('10448', 'file', '10444', '/admin/general/crontab/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '89', 'normal'), ('10449', 'file', '10444', '/admin/general/crontab/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '88', 'normal'), ('10450', 'file', '10431', '/admin/general/database', '数据库管理', 'fa fa-database', '', '可在线进行一些简单的数据库表优化或修复,查看表结构和数据。也可以进行SQL语句的操作', '1', '1491655325', '1491655325', '93', 'normal'), ('10451', 'file', '10450', '/admin/general/database/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '86', 'normal'), ('10452', 'file', '10450', '/admin/general/database/query', 'SQL查询', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '85', 'normal'), ('10453', 'file', '10450', '/admin/general/database/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '84', 'normal'), ('10454', 'file', '10450', '/admin/general/database/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '83', 'normal'), ('10455', 'file', '10450', '/admin/general/database/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '82', 'normal'), ('10456', 'file', '10450', '/admin/general/database/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '81', 'normal'), ('10457', 'file', '10431', '/admin/general/profile', '个人配置', 'fa fa-user\r', '', '', '1', '1491655325', '1491655325', '87', 'normal'), ('10458', 'file', '10457', '/admin/general/profile/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '79', 'normal'), ('10459', 'file', '10457', '/admin/general/profile/update', '更新个人信息', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '78', 'normal'), ('10460', 'file', '10457', '/admin/general/profile/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '77', 'normal'), ('10461', 'file', '10457', '/admin/general/profile/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '76', 'normal'), ('10462', 'file', '10457', '/admin/general/profile/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '75', 'normal'), ('10463', 'file', '10457', '/admin/general/profile/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '74', 'normal'), ('10464', 'file', '0', '/admin/wechat', '微信管理', 'fa fa-wechat', '', '', '1', '1491655325', '1494259718', '40', 'normal'), ('10465', 'file', '10464', '/admin/wechat/autoreply', '微信自动回复管理', 'fa fa-circle-o\r', '', '', '1', '1491655325', '1491655325', '72', 'normal'), ('10466', 'file', '10465', '/admin/wechat/autoreply/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '71', 'normal'), ('10467', 'file', '10465', '/admin/wechat/autoreply/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '70', 'normal'), ('10468', 'file', '10465', '/admin/wechat/autoreply/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '69', 'normal'), ('10469', 'file', '10465', '/admin/wechat/autoreply/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '68', 'normal'), ('10470', 'file', '10465', '/admin/wechat/autoreply/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '67', 'normal'), ('10471', 'file', '10464', '/admin/wechat/config', '配置管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '66', 'normal'), ('10472', 'file', '10471', '/admin/wechat/config/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '65', 'normal'), ('10473', 'file', '10471', '/admin/wechat/config/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '64', 'normal'), ('10474', 'file', '10471', '/admin/wechat/config/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '63', 'normal'), ('10475', 'file', '10471', '/admin/wechat/config/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '62', 'normal'), ('10476', 'file', '10471', '/admin/wechat/config/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '61', 'normal'), ('10477', 'file', '10464', '/admin/wechat/menu', '菜单管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '60', 'normal'), ('10478', 'file', '10477', '/admin/wechat/menu/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '59', 'normal'), ('10479', 'file', '10477', '/admin/wechat/menu/edit', '修改', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '58', 'normal'), ('10480', 'file', '10477', '/admin/wechat/menu/sync', '同步', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '57', 'normal'), ('10481', 'file', '10477', '/admin/wechat/menu/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '56', 'normal'), ('10482', 'file', '10477', '/admin/wechat/menu/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '55', 'normal'), ('10483', 'file', '10477', '/admin/wechat/menu/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '54', 'normal'), ('10484', 'file', '10464', '/admin/wechat/response', '资源管理', 'fa fa-list-alt', '', '', '1', '1491655325', '1491655325', '53', 'normal'), ('10485', 'file', '10484', '/admin/wechat/response/select', '选择素材', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '52', 'normal'), ('10486', 'file', '10484', '/admin/wechat/response/add', '添加', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '51', 'normal'), ('10487', 'file', '10484', '/admin/wechat/response/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '50', 'normal'), ('10488', 'file', '10484', '/admin/wechat/response/index', '查看', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '49', 'normal'), ('10489', 'file', '10484', '/admin/wechat/response/del', '删除', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '48', 'normal'), ('10490', 'file', '10484', '/admin/wechat/response/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1491655325', '1491655325', '47', 'normal'), ('10491', 'file', '0', '/admin/category', '分类管理', 'fa fa-list\r', '', '用于统一管理网站的所有分类,分类可进行无限级分类\r', '1', '1494259006', '1494259006', '106', 'normal'), ('10492', 'file', '10491', '/admin/category/index', '查看', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '45', 'normal'), ('10493', 'file', '10491', '/admin/category/add', '添加', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '44', 'normal'), ('10494', 'file', '10491', '/admin/category/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '43', 'normal'), ('10495', 'file', '10491', '/admin/category/del', '删除', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '42', 'normal'), ('10496', 'file', '10491', '/admin/category/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1494259006', '1494259006', '41', 'normal'), ('10497', 'file', '0', '/admin/example', '示例管理', 'fa fa-magic', '', '', '1', '1495273225', '1495273469', '125', 'normal'), ('10498', 'file', '10497', '/admin/example/bootstraptable', '表格完整示例', 'fa fa-table', '', '在使用Bootstrap-table中的常用方式,更多使用方式可查看:http://bootstrap-table.wenzhixin.net.cn/zh-cn/', '1', '1495273225', '1495273225', '39', 'normal'), ('10499', 'file', '10498', '/admin/example/bootstraptable/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '38', 'normal'), ('10500', 'file', '10498', '/admin/example/bootstraptable/detail', '详情', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '37', 'normal'), ('10501', 'file', '10498', '/admin/example/bootstraptable/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '36', 'normal'), ('10502', 'file', '10498', '/admin/example/bootstraptable/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '35', 'normal'), ('10503', 'file', '10498', '/admin/example/bootstraptable/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '34', 'normal'), ('10504', 'file', '10498', '/admin/example/bootstraptable/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273225', '1495273225', '33', 'normal'), ('10505', 'file', '10497', '/admin/example/colorbadge', '彩色角标', 'fa fa-table', '', '在JS端控制角标的显示与隐藏,请注意左侧菜单栏角标的数值变化', '1', '1495273229', '1495273229', '32', 'normal'), ('10506', 'file', '10505', '/admin/example/colorbadge/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '31', 'normal'), ('10507', 'file', '10505', '/admin/example/colorbadge/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '30', 'normal'), ('10508', 'file', '10505', '/admin/example/colorbadge/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '29', 'normal'), ('10509', 'file', '10505', '/admin/example/colorbadge/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '28', 'normal'), ('10510', 'file', '10505', '/admin/example/colorbadge/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273229', '1495273229', '27', 'normal'), ('10511', 'file', '10497', '/admin/example/controllerjump', '控制器间跳转', 'fa fa-table', '', 'FastAdmin支持在控制器间跳转,点击后将切换到另外一个TAB中,无需刷新当前页面', '1', '1495273234', '1495273234', '26', 'normal'), ('10512', 'file', '10511', '/admin/example/controllerjump/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '25', 'normal'), ('10513', 'file', '10511', '/admin/example/controllerjump/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '24', 'normal'), ('10514', 'file', '10511', '/admin/example/controllerjump/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '23', 'normal'), ('10515', 'file', '10511', '/admin/example/controllerjump/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '22', 'normal'), ('10516', 'file', '10511', '/admin/example/controllerjump/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273234', '1495273234', '21', 'normal'), ('10517', 'file', '10497', '/admin/example/cxselect', '多级联动', 'fa fa-table', '', 'FastAdmin使用了jQuery-cxselect实现多级联动,更多文档请参考https://github.com/karsonzhang/cxSelect<br >', '1', '1495273239', '1495273239', '20', 'normal'), ('10518', 'file', '10517', '/admin/example/cxselect/index', 'index', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '19', 'normal'), ('10519', 'file', '10517', '/admin/example/cxselect/city', 'city', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '18', 'normal'), ('10520', 'file', '10517', '/admin/example/cxselect/category', 'category', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '17', 'normal'), ('10521', 'file', '10517', '/admin/example/cxselect/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '16', 'normal'), ('10522', 'file', '10517', '/admin/example/cxselect/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '15', 'normal'), ('10523', 'file', '10517', '/admin/example/cxselect/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '14', 'normal'), ('10524', 'file', '10517', '/admin/example/cxselect/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273239', '1495273239', '13', 'normal'), ('10525', 'file', '10497', '/admin/example/multitable', '多表格示例', 'fa fa-table', '', '当一个页面上存在多个Bootstrap-table时该如何控制按钮和表格', '1', '1495273245', '1495273245', '12', 'normal'), ('10526', 'file', '10525', '/admin/example/multitable/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '11', 'normal'), ('10527', 'file', '10525', '/admin/example/multitable/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '10', 'normal'), ('10528', 'file', '10525', '/admin/example/multitable/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '9', 'normal'), ('10529', 'file', '10525', '/admin/example/multitable/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '8', 'normal'), ('10530', 'file', '10525', '/admin/example/multitable/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273245', '1495273245', '7', 'normal'), ('10531', 'file', '10497', '/admin/example/relationmodel', '多模型关联', 'fa fa-table', '', '当使用到关联模型时需要重载index方法', '1', '1495273250', '1495273250', '6', 'normal'), ('10532', 'file', '10531', '/admin/example/relationmodel/index', '查看', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '5', 'normal'), ('10533', 'file', '10531', '/admin/example/relationmodel/add', '添加', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '4', 'normal'), ('10534', 'file', '10531', '/admin/example/relationmodel/edit', '编辑', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '3', 'normal'), ('10535', 'file', '10531', '/admin/example/relationmodel/del', '删除', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '2', 'normal'), ('10536', 'file', '10531', '/admin/example/relationmodel/multi', '批量更新', 'fa fa-circle-o', '', '', '0', '1495273250', '1495273250', '1', 'normal');
COMMIT;
-- ----------------------------
... ... @@ -180,7 +189,7 @@ CREATE TABLE `fa_category` (
`type` varchar(30) NOT NULL DEFAULT '' COMMENT '栏目类型',
`name` varchar(30) NOT NULL DEFAULT '',
`nickname` varchar(50) NOT NULL DEFAULT '',
`flag` set('h','i','r') NOT NULL DEFAULT '',
`flag` set('hot','index','recommend') NOT NULL DEFAULT '',
`image` varchar(100) NOT NULL DEFAULT '' COMMENT '图片',
`keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
... ... @@ -192,7 +201,14 @@ CREATE TABLE `fa_category` (
PRIMARY KEY (`id`),
KEY `weigh` (`weigh`,`id`),
KEY `pid` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='分类表';
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='分类表';
-- ----------------------------
-- Records of `fa_category`
-- ----------------------------
BEGIN;
INSERT INTO `fa_category` VALUES ('1', '0', 'page', '官方新闻', 'news', 'recommend', '', '', '', 'news', '1495262190', '1495262190', '0', 'normal'), ('2', '0', 'page', '移动应用', 'mobileapp', 'hot', '', '', '', 'mobileapp', '1495262244', '1495262244', '0', 'normal'), ('3', '2', 'page', '微信公众号', 'wechatpublic', 'index', '', '', '', 'wechatpublic', '1495262288', '1495262288', '0', 'normal'), ('4', '2', 'page', 'Android开发', 'android', 'recommend', '', '', '', 'android', '1495262317', '1495262317', '0', 'normal'), ('5', '0', 'default', '软件产品', 'software', 'recommend', '', '', '', 'software', '1495262336', '1495262336', '0', 'normal'), ('6', '5', 'page', '网站建站', 'website', 'recommend', '', '', '', 'website', '1495262357', '1495262357', '0', 'normal'), ('7', '5', 'page', '企业管理软件', 'company', 'index', '', '', '', 'company', '1495262391', '1495262391', '0', 'normal'), ('8', '6', 'page', 'PC端', 'website-pc', 'recommend', '', '', '', 'website-pc', '1495262424', '1495262424', '0', 'normal'), ('9', '6', 'page', '移动端', 'website-mobile', 'recommend', '', '', '', 'website-mobile', '1495262456', '1495262456', '0', 'normal'), ('10', '7', 'page', 'CRM系统 ', 'company-crm', 'recommend', '', '', '', 'company-crm', '1495262487', '1495262487', '0', 'normal'), ('11', '7', 'page', 'SASS平台软件', 'company-sass', 'recommend', '', '', '', 'company-sass', '1495262515', '1495262515', '0', 'normal');
COMMIT;
-- ----------------------------
-- Table structure for `fa_configvalue`
... ... @@ -237,7 +253,7 @@ CREATE TABLE `fa_crontab` (
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
`status` enum('completed','expired','hidden','normal') NOT NULL DEFAULT 'normal' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='定时任务表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='定时任务表';
-- ----------------------------
-- Table structure for `fa_page`
... ... @@ -248,7 +264,7 @@ CREATE TABLE `fa_page` (
`category_id` int(10) NOT NULL DEFAULT '0' COMMENT '分类ID',
`title` varchar(50) NOT NULL DEFAULT '' COMMENT '标题',
`keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字',
`flag` set('h','i','s') NOT NULL DEFAULT '' COMMENT '标志',
`flag` set('hot','index','recommend') NOT NULL DEFAULT '' COMMENT '标志',
`image` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
`content` text NOT NULL COMMENT '内容',
`icon` varchar(50) NOT NULL DEFAULT '' COMMENT '图标',
... ... @@ -259,7 +275,7 @@ CREATE TABLE `fa_page` (
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
`status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='单页表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='单页表';
-- ----------------------------
-- Table structure for `fa_test`
... ... @@ -293,7 +309,7 @@ CREATE TABLE `fa_test` (
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
`status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='测试表';
-- ----------------------------
-- Table structure for `fa_user`
... ... @@ -343,7 +359,7 @@ CREATE TABLE `fa_user_signin` (
`createtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='会员签到表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='会员签到表';
-- ----------------------------
-- Table structure for `fa_user_third`
... ... @@ -432,7 +448,7 @@ CREATE TABLE `fa_wechat_context` (
`updatetime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `openid` (`openid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信上下文表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信上下文表';
-- ----------------------------
-- Table structure for `fa_wechat_response`
... ... @@ -450,7 +466,7 @@ CREATE TABLE `fa_wechat_response` (
`status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`),
UNIQUE KEY `event` (`eventkey`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信资源表';
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信资源表';
-- ----------------------------
-- Records of `fa_wechat_response`
... ...
... ... @@ -31,7 +31,7 @@ class Menu extends Command
$this->model = new AuthRule();
$adminPath = dirname(__DIR__) . DS;
//控制器名
$controller = $input->getOption('controller') ? : '';
$controller = $input->getOption('controller') ?: '';
if (!$controller)
{
throw new Exception("please input controller name");
... ... @@ -129,21 +129,19 @@ class Menu extends Command
$controllerArr[$key] = ucfirst($controllerArr[$key]);
$classSuffix = Config::get('controller_suffix') ? ucfirst(Config::get('url_controller_layer')) : '';
$className = "\\app\\admin\\controller\\" . implode("\\", $controllerArr) . $classSuffix;
if (version_compare(PHP_VERSION, '7.0.0', '<'))
{
$pathArr = $controllerArr;
array_unshift($pathArr, '', 'application', 'admin', 'controller');
$classFile = ROOT_PATH . implode(DS, $pathArr) . $classSuffix . ".php";
$classContent = file_get_contents($classFile);
$uniqueName = uniqid("FastAdmin") . $classSuffix;
$classContent = str_replace("class " . $controllerArr[$key] . $classSuffix . " ", 'class ' . $uniqueName . ' ', $classContent);
$classContent = preg_replace("/namespace\s(.*);/", 'namespace ' . __NAMESPACE__ . ";", $classContent);
//临时的类文件
$tempClassFile = __DIR__ . DS . $uniqueName . ".php";
file_put_contents($tempClassFile, $classContent);
$className = "\\app\\admin\\command\\" . $uniqueName;
}
$pathArr = $controllerArr;
array_unshift($pathArr, '', 'application', 'admin', 'controller');
$classFile = ROOT_PATH . implode(DS, $pathArr) . $classSuffix . ".php";
$classContent = file_get_contents($classFile);
$uniqueName = uniqid("FastAdmin") . $classSuffix;
$classContent = str_replace("class " . $controllerArr[$key] . $classSuffix . " ", 'class ' . $uniqueName . ' ', $classContent);
$classContent = preg_replace("/namespace\s(.*);/", 'namespace ' . __NAMESPACE__ . ";", $classContent);
//临时的类文件
$tempClassFile = __DIR__ . DS . $uniqueName . ".php";
file_put_contents($tempClassFile, $classContent);
$className = "\\app\\admin\\command\\" . $uniqueName;
//反射机制调用类的注释和方法名
$reflector = new ReflectionClass($className);
... ... @@ -181,16 +179,20 @@ class Menu extends Command
}
//过滤掉其它字符
$controllerTitle = trim(preg_replace(array('/^\/\*\*(.*)[\n\r\t]/u', '/[\s]+\*\//u', '/\*\s@(.*)/u', '/[\s|\*]+/u'), '', $classComment));
//导入中文语言包
\think\Lang::load(dirname(__DIR__) . DS . 'lang/zh-cn.php');
//先定入菜单的数据
$pid = 0;
$name = "/admin";
foreach (explode('/', $controller) as $k => $v)
{
$name .= '/' . strtolower($v);
$title = (!isset($controllerArr[$k + 1]) ? $controllerTitle : ucfirst($v));
$title = (!isset($controllerArr[$k + 1]) ? $controllerTitle : '');
$icon = (!isset($controllerArr[$k + 1]) ? $controllerIcon : 'fa fa-list');
$remark = (!isset($controllerArr[$k + 1]) ? $controllerRemark : '');
$title = $title ? $title : ucfirst($v);
$title = $title ? $title : __(ucfirst($v) . ' manager');
$rulemodel = $this->model->get(['name' => $name]);
if (!$rulemodel)
{
... ...
... ... @@ -2,7 +2,7 @@
{%config%}
,
optimizeCss: "standard",
optimize: "none",
optimize: "none", //可使用uglify|closure|none
removeCombined: false,
baseUrl: "{%jsBasePath%}", //JS文件所在的基础目录
name: "{%jsBaseName%}", //来源文件,不包含后缀
... ...
... ... @@ -140,12 +140,10 @@ function build_heading($title = NULL, $content = NULL)
{
if (is_null($title) && is_null($content))
{
$path = request()->pathinfo();
$path = $path[0] == '/' ? $path : '/' . $path;
// 根据当前的URI自动匹配父节点的标题和备注
$path = Auth::instance()->getRequestUri();
$data = Db::name('auth_rule')->where('id', 'IN', function($query) use($path)
{
$query->name('auth_rule')->where('name', $path)->field('pid');
})->find();
$data = Db::name('auth_rule')->where('name', $path)->field('title,remark')->find();
if ($data)
{
$title = $data['title'];
... ...
... ... @@ -3,7 +3,6 @@
namespace app\admin\controller;
use app\common\controller\Backend;
use fast\Http;
use fast\Random;
use fast\Tree;
use RecursiveDirectoryIterator;
... ... @@ -20,7 +19,7 @@ use think\Lang;
class Ajax extends Backend
{
protected $noNeedLogin = ['dailybg', 'lang'];
protected $noNeedLogin = ['lang'];
protected $noNeedRight = ['*'];
protected $layout = '';
... ... @@ -29,8 +28,8 @@ class Ajax extends Backend
*/
public function typeahead()
{
$search = $this->_request->getRequest("search");
$field = $this->_request->getRequest("field");
$search = $this->request->get("search");
$field = $this->request->get("field");
$field = str_replace(['row[', ']'], '', $field);
if (substr($field, -3) !== '_id' && substr($field, -4) !== '_ids')
{
... ... @@ -50,11 +49,12 @@ class Ajax extends Backend
break;
}
$searchlist = Db::table($field)
->orWhere($searchfield, 'like', "%{$search}%")
->orWhere('id', 'like', "%{$search}%")
$searchlist = Db::name($field)
->whereOr($searchfield, 'like', "%{$search}%")
->whereOr('id', 'like', "%{$search}%")
->limit(10)
->select("id,{$searchfield} AS name");
->field("id,{$searchfield} AS name")
->select();
foreach ($searchlist as $k => &$v)
{
... ... @@ -81,54 +81,6 @@ class Ajax extends Backend
}
/**
* 每日一图
*/
public function dailybg()
{
//采用Infinty的图片
$this->code = 1;
$this->data = [
'url' => 'http://img.infinitynewtab.com/wallpaper/' . (date("Ymd") % 4000) . '.jpg'
];
return;
//采用Bing每日一图
$ret = Http::sendRequest("http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1", [], 'GET');
if ($ret['ret'])
{
$json = json_decode($ret['msg'], TRUE);
if ($json && isset($json['images'][0]))
{
$url = $json['images'][0]['url'];
$startdate = $json['images'][0]['startdate'];
$enddate = $json['images'][0]['enddate'];
$copyright = $json['images'][0]['copyright'];
$url = substr($url, 0, 4) != 'http' ? 'http://cn.bing.com' . $url : $url;
$title = '';
$intro = '';
$ret = Http::sendRequest("http://cn.bing.com/cnhp/coverstory/", [], 'GET');
if ($ret['ret'])
{
$info = json_decode($ret['msg'], TRUE);
if (isset($info['title']))
{
$title = $info['title'];
$intro = $info['para1'];
}
}
$this->code = 1;
$this->data = [
'title' => $title,
'intro' => $intro,
'url' => $url,
'startdate' => $startdate,
'enddate' => $enddate,
'copyright' => $copyright,
];
}
}
}
/**
* 读取角色权限树
*/
public function roletree()
... ... @@ -374,4 +326,51 @@ class Ajax extends Backend
$this->code = 1;
}
/**
* 读取分类数据
*/
public function category()
{
$type = $this->request->get('type');
$pid = $this->request->get('pid');
$where = ['status' => 'normal'];
if ($type)
{
$where['type'] = $type;
}
if ($pid)
{
$where['pid'] = $pid;
}
$categorylist = Db::name('category')->where($where)->field('id as value,name')->order('weigh desc,id desc')->select();
$this->code = 1;
$this->data = $categorylist;
return;
}
/**
* 读取省市区数据
*/
public function area()
{
$province = $this->request->get('province');
$city = $this->request->get('city');
$where = ['pid' => 0, 'level' => 1];
if ($province)
{
$where['pid'] = $province;
$where['level'] = 2;
}
if ($city)
{
$where['pid'] = $city;
$where['level'] = 3;
}
$provincelist = Db::name('area')->where($where)->field('id as value,name')->select();
$this->code = 1;
$this->data = $provincelist;
return;
}
}
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\auth;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use fast\Random;
use fast\Tree;
... ... @@ -47,6 +46,37 @@ class Admin extends Backend
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax())
{
$childrenAdminIds = model('AuthGroupAccess')
->field('uid')
->where('group_id', 'in', $this->childrenIds)
->column('uid');
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->where('id', 'in', $childrenAdminIds)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->where('id', 'in', $childrenAdminIds)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
/**
* 添加
*/
public function add()
... ... @@ -61,7 +91,6 @@ class Admin extends Backend
$params['password'] = md5(md5($params['password']) . $params['salt']);
$admin = $this->model->create($params);
AdminLog::record(__('Add'), $this->model->getLastInsID());
$group = $this->request->post("group/a");
//过滤不允许的组别,避免越权
... ... @@ -99,8 +128,11 @@ class Admin extends Backend
$params['salt'] = Random::alnum();
$params['password'] = md5(md5($params['password']) . $params['salt']);
}
else
{
unset($params['password'], $params['salt']);
}
$row->save($params);
AdminLog::record(__('Edit'), $ids);
// 先移除所有权限
model('AuthGroupAccess')->where('uid', $row->id)->delete();
... ... @@ -142,8 +174,7 @@ class Admin extends Backend
{
// 避免越权删除管理员
$childrenGroupIds = $this->childrenIds;
$adminList = $this->model->where('id', 'in', $ids)->where('id', 'in', function($query) use($childrenGroupIds)
{
$adminList = $this->model->where('id', 'in', $ids)->where('id', 'in', function($query) use($childrenGroupIds) {
$query->name('auth_group_access')->where('group_id', 'in', $childrenGroupIds)->field('uid');
})->select();
if ($adminList)
... ... @@ -156,7 +187,6 @@ class Admin extends Backend
$deleteIds = array_diff($deleteIds, [$this->auth->id]);
if ($deleteIds)
{
AdminLog::record(__('Del'), $deleteIds);
$this->model->destroy($deleteIds);
model('AuthGroupAccess')->where('uid', 'in', $deleteIds)->delete();
$this->code = 1;
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\auth;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use fast\Tree;
... ... @@ -106,7 +105,6 @@ class Group extends Backend
if ($params)
{
$this->model->create($params);
AdminLog::record(__('Add'), $this->model->getLastInsID());
$this->code = 1;
}
... ... @@ -154,7 +152,6 @@ class Group extends Backend
if ($params)
{
$row->save($params);
AdminLog::record(__('Edit'), $ids);
$this->code = 1;
}
... ... @@ -209,7 +206,6 @@ class Group extends Backend
$count = $this->model->where('id', 'in', $ids)->delete();
if ($count)
{
AdminLog::record(__('Del'), $ids);
$this->code = 1;
}
}
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\auth;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use fast\Tree;
use think\Cache;
... ... @@ -70,7 +69,6 @@ class Rule extends Backend
return;
}
$this->model->create($params);
AdminLog::record(__('Add'), $this->model->getLastInsID());
Cache::rm('__menu__');
$this->code = 1;
}
... ... @@ -100,7 +98,6 @@ class Rule extends Backend
return;
}
$row->save($params);
AdminLog::record(__('Edit'), $ids);
Cache::rm('__menu__');
$this->code = 1;
}
... ... @@ -128,7 +125,6 @@ class Rule extends Backend
$count = $this->model->where('id', 'in', $delIds)->delete();
if ($count)
{
AdminLog::record(__('Del'), $ids);
Cache::rm('__menu__');
$this->code = 1;
}
... ...
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 表格完整示例
*
* @icon fa fa-table
* @remark 在使用Bootstrap-table中的常用方式,更多使用方式可查看:http://bootstrap-table.wenzhixin.net.cn/zh-cn/
*/
class Bootstraptable extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax())
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL);
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
/**
* 详情
*/
public function detail($ids)
{
$row = $this->model->get(['id' => $ids]);
if (!$row)
$this->error(__('No Results were found'));
$this->view->assign("row", $row->toArray());
return $this->view->fetch();
}
}
... ...
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 彩色角标
*
* @icon fa fa-table
* @remark 在JS端控制角标的显示与隐藏,请注意左侧菜单栏角标的数值变化
*/
class Colorbadge extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
}
... ...
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 控制器间跳转
*
* @icon fa fa-table
* @remark FastAdmin支持在控制器间跳转,点击后将切换到另外一个TAB中,无需刷新当前页面
*/
class Controllerjump extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
}
... ...
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 多级联动
*
* @icon fa fa-table
* @remark FastAdmin使用了jQuery-cxselect实现多级联动,更多文档请参考https://github.com/karsonzhang/cxSelect
*/
class Cxselect extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
}
}
... ...
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 多表格示例
*
* @icon fa fa-table
* @remark 当一个页面上存在多个Bootstrap-table时该如何控制按钮和表格
*/
class Multitable extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
}
/**
* 查看
*/
public function index()
{
return $this->view->fetch();
}
}
... ...
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 多模型关联
*
* @icon fa fa-table
* @remark 当使用到关联模型时需要重载index方法
*/
class Relationmodel extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax())
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with("Admin")
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with("Admin")
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
}
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\general;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
/**
... ... @@ -76,7 +75,6 @@ class Configvalue extends Backend
$params['content'] = array_combine($fieldarr, $valuearr);
}
$this->model->save($params);
AdminLog::record(__('Add'), $this->model->getLastInsID());
$this->code = 1;
}
... ... @@ -119,7 +117,6 @@ class Configvalue extends Backend
$params['content'] = array_combine($fieldarr, $valuearr);
}
$row->save($params);
AdminLog::record(__('Edit'), $ids);
$this->code = 1;
}
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\general;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use think\Db;
use think\Debug;
... ... @@ -60,7 +59,6 @@ class Database extends Backend
if (in_array($do_action, array('doquery', 'optimizeall', 'repairall')))
{
AdminLog::record(__('query'), ['table' => $tablename, 'action' => $do_action, 'sql' => $this->request->post('sqlquery')]);
$this->$do_action();
}
else if (count($tablename) == 0)
... ... @@ -69,7 +67,6 @@ class Database extends Backend
}
else
{
AdminLog::record(__('query'), ['table' => $tablename, 'action' => $do_action]);
foreach ($tablename as $table)
{
$this->$do_action($table);
... ...
... ... @@ -52,7 +52,7 @@ class Profile extends Backend
{
$this->code = -1;
$params = $this->request->post("row/a");
$params = array_filter(array_intersect_key($params, array_flip(array('email', 'nickname', 'password'))));
$params = array_filter(array_intersect_key($params, array_flip(array('email', 'nickname', 'password', 'avatar'))));
unset($v);
if (isset($params['password']))
{
... ... @@ -62,7 +62,6 @@ class Profile extends Backend
if ($params)
{
model('admin')->where('id', $this->auth->id)->update($params);
AdminLog::record(__('Update'), $params);
//因为个人资料面板读取的Session显示,修改自己资料后同时更新Session
$admin = Session::get('admin');
$admin_id = $admin ? $admin->id : 0;
... ...
... ... @@ -2,10 +2,8 @@
namespace app\admin\controller\wechat;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use app\common\model\WechatResponse;
use think\Db;
/**
* 微信自动回复管理
... ... @@ -28,7 +26,7 @@ class Autoreply extends Backend
*/
public function edit($ids = NULL)
{
$row = Db::table($this->table)->where('id', $ids)->get();
$row = $this->model->get(['id' => $ids]);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isPost())
... ... @@ -38,7 +36,6 @@ class Autoreply extends Backend
if ($params)
{
$row->save($params);
AdminLog::record(__('Edit'), $ids);
$this->code = 1;
}
return;
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\wechat;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use app\common\model\Configvalue;
... ... @@ -55,7 +54,6 @@ class Config extends Backend
$this->obj['config'][] = $this->request->post('row/a');
$this->wechatcfg->content = $this->obj;
$this->wechatcfg->save();
AdminLog::record(__('Add'), $this->request->post('row/a'));
$this->code = 1;
return;
}
... ... @@ -86,7 +84,6 @@ class Config extends Backend
$this->wechatcfg->content = $this->obj;
$this->wechatcfg->save();
$this->code = 1;
AdminLog::record(__('Edit'), $ids);
return;
}
$this->view->assign("row", $row);
... ... @@ -111,7 +108,6 @@ class Config extends Backend
}
$this->wechatcfg->content = $this->obj;
$this->wechatcfg->save();
AdminLog::record(__('Del'), $ids);
$this->code = 1;
}
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\wechat;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use app\common\model\Configvalue;
use app\common\model\WechatResponse;
... ... @@ -53,7 +52,6 @@ class Menu extends Backend
$content['menu'] = $menu;
$this->wechatcfg->content = $content;
$this->wechatcfg->save();
AdminLog::record(__('Edit'), $ids);
$this->code = 1;
return;
}
... ... @@ -71,7 +69,6 @@ class Menu extends Backend
$ret = $app->menu->add($this->wechatcfg->content['menu']);
if ($ret->errcode == 0)
{
AdminLog::record(__('Sync'), $this->wechatcfg->content['menu']);
$this->code = 1;
}
else
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\controller\wechat;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
use fast\service\Wechat;
... ... @@ -45,7 +44,6 @@ class Response extends Backend
if ($params)
{
$this->model->save($params);
AdminLog::record(__('Add'), $this->model->getLastInsID());
$this->code = 1;
$this->content = $params;
}
... ... @@ -74,7 +72,6 @@ class Response extends Backend
if ($params)
{
$row->save($params);
AdminLog::record(__('Edit'), $ids);
$this->code = 1;
}
return;
... ...
... ... @@ -55,6 +55,7 @@ return [
'Hot' => '热门',
'Recommend' => '推荐',
'Dashboard' => '控制台',
'Upload' => '上传',
'Code' => '编号',
'Message' => '内容',
'Line' => '行号',
... ... @@ -72,7 +73,6 @@ return [
'Parent' => '父级',
'Params' => '参数',
'Permission' => '权限',
'Advance search' => '高级搜索',
'Check all' => '选中全部',
'Expand all' => '展开全部',
'Begin time' => '开始时间',
... ... @@ -84,9 +84,11 @@ return [
'Operation failed' => '操作失败!',
'Unknown data format' => '未知的数据格式!',
'Network error' => '网络错误!',
'Issues & Wiki' => '问题交流',
'Advanced search' => '高级搜索',
'Auth manager' => '权限管理',
'General manager' => '常规管理',
'Example manager' => '测试管理',
'Common search' => '普通搜索',
'Search %s' => '搜索 %s',
'%d second%s ago' => '%d秒前',
'%d minute%s ago' => '%d分钟前',
'%d hour%s ago' => '%d小时前',
... ...
... ... @@ -13,6 +13,7 @@ class Auth extends \fast\Auth
{
protected $requestUri = '';
protected $breadcrumb = [];
public function __construct()
{
... ... @@ -204,6 +205,27 @@ class Auth extends \fast\Auth
}
/**
* 获得面包屑导航
* @param string $path
* @return array
*/
public function getBreadCrumb($path = '')
{
if ($this->breadcrumb || !$path)
return $this->breadcrumb;
$path_rule_id = 0;
foreach ($this->rules as $rule)
{
$path_rule_id = $rule['name'] == $path ? $rule['id'] : $path_rule_id;
}
if ($path_rule_id)
{
$this->breadcrumb = Tree::instance()->init($this->rules)->getParents($path_rule_id, true);
}
return $this->breadcrumb;
}
/**
* 获取左侧菜单栏
*
* @param array $params URL对应的badge数据
... ...
... ... @@ -2,7 +2,6 @@
namespace app\admin\library\traits;
use app\admin\model\AdminLog;
trait Backend
{
... ... @@ -49,7 +48,6 @@ trait Backend
$v = substr($k, -4) == 'time' && !is_numeric($v) ? strtotime($v) : $v;
}
$this->model->create($params);
AdminLog::record(__('Add'), $this->model->getLastInsID());
$this->code = 1;
}
... ... @@ -78,7 +76,6 @@ trait Backend
$v = substr($k, -4) == 'time' && !is_numeric($v) ? strtotime($v) : $v;
}
$row->save($params);
AdminLog::record(__('Edit'), $ids);
$this->code = 1;
}
... ... @@ -99,7 +96,6 @@ trait Backend
$count = $this->model->where('id', 'in', $ids)->delete();
if ($count)
{
AdminLog::record(__('Del'), $ids);
$this->code = 1;
}
}
... ... @@ -125,7 +121,6 @@ trait Backend
$count = $this->model->where('id', 'in', $ids)->update($values);
if ($count)
{
AdminLog::record(__('Multi'), $ids);
$this->code = 1;
}
}
... ...
... ... @@ -13,19 +13,39 @@ class AdminLog extends Model
protected $createTime = 'createtime';
protected $updateTime = '';
public static function record($title, $content = '', $username = '')
public static function record($title = '')
{
$admin = \think\Session::get('admin');
$admin_id = $admin ? $admin->id : 0;
$content = !is_scalar($content) ? json_encode($content) : $content . '';
$username = $username ? $username : ($admin ? $admin->username : __(''));
$username = $admin ? $admin->username : __('Unknown');
$content = request()->param();
foreach ($content as $k => $v)
{
if (is_string($v) && strlen($v) > 200)
{
unset($content[$k]);
}
}
$title = [];
$breadcrumb = \app\admin\library\Auth::instance()->getBreadcrumb();
foreach ($breadcrumb as $k => $v)
{
$title[] = $v['title'];
}
self::create([
'title' => $title,
'content' => $content,
'url' => request()->url(),
'admin_id' => $admin_id,
'username' => $username
'title' => implode(' ', $title),
'content' => json_encode($content),
'url' => request()->url(),
'admin_id' => $admin_id,
'username' => $username,
'useragent' => request()->server('HTTP_USER_AGENT'),
'ip' => request()->ip()
]);
}
public function admin()
{
return $this->belongsTo('Admin', 'admin_id')->setEagerlyType(0);
}
}
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 应用行为扩展定义文件
return [
// 应用结束
'app_end' => [
'app\\admin\\behavior\\AdminLog',
],
];
... ...
... ... @@ -8,25 +8,25 @@
<div class="form-group">
<label for="username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="text" class="form-control" id="username" name="row[username]" value="" pattern="[A-Za-z0-9_]{3,}" required="required" />
<input type="text" class="form-control" id="username" name="row[username]" value="" data-rule="required;username" />
</div>
</div>
<div class="form-group">
<label for="email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="email" class="form-control" id="email" name="row[email]" value="" required="required" />
<input type="email" class="form-control" id="email" name="row[email]" value="" data-rule="required;email" />
</div>
</div>
<div class="form-group">
<label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="text" class="form-control" id="nickname" name="row[nickname]" value="" required="required" />
<input type="text" class="form-control" id="nickname" name="row[nickname]" value="" data-rule="required" />
</div>
</div>
<div class="form-group">
<label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="password" class="form-control" id="password" name="row[password]" value="" required="required" />
<input type="password" class="form-control" id="password" name="row[password]" value="" data-rule="required" />
</div>
</div>
<div class="form-group">
... ...
... ... @@ -8,19 +8,19 @@
<div class="form-group">
<label for="username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="text" class="form-control" id="username" name="row[username]" value="{$row.username}" pattern="[A-Za-z0-9_]{3,}" required="required" />
<input type="text" class="form-control" id="username" name="row[username]" value="{$row.username}" data-rule="required;username" />
</div>
</div>
<div class="form-group">
<label for="email" class="control-label col-xs-12 col-sm-2">{:__('Email')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="email" class="form-control" id="email" name="row[email]" value="{$row.email}" required="required" />
<input type="email" class="form-control" id="email" name="row[email]" value="{$row.email}" data-rule="required;email" />
</div>
</div>
<div class="form-group">
<label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="text" class="form-control" id="nickname" name="row[nickname]" value="{$row.nickname}" required="required" />
<input type="text" class="form-control" id="nickname" name="row[nickname]" value="{$row.nickname}" data-rule="required" />
</div>
</div>
<div class="form-group">
... ...
... ... @@ -42,7 +42,7 @@
</div>
<div class="form-group">
<label for="c-flag" class="control-label">{:__('Flag')}:</label>
{:build_select('row[flag]', 'h,i,s', null, ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
{:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], null, ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
</div>
<div class="form-group">
<label for="content" class="control-label">{:__('Status')}:</label>
... ...
... ... @@ -42,7 +42,7 @@
</div>
<div class="form-group">
<label for="c-flag" class="control-label">{:__('Flag')}:</label>
{:build_select('row[flag]', 'h,i,s', $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
{:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
</div>
<div class="form-group">
<label for="content" class="control-label">{:__('Status')}:</label>
... ...
... ... @@ -83,7 +83,7 @@
<!-- 账号信息下拉框 -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="__CDN__{$admin.avatar}" class="user-image" alt="User Image">
<img src="__CDN__{$admin.avatar}" class="user-image" alt="{$admin.nickname}">
<span class="hidden-xs">{$admin.nickname}</span>
</a>
<ul class="dropdown-menu">
... ... @@ -113,7 +113,7 @@
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="{:rtrim(url('general.profile/'),'/')}" class="btn btn-default btn-flat">{:__('Profile')}</a>
<a href="general/profile" class="btn btn-default btn-flat addtabsit">{:__('Profile')}</a>
</div>
<div class="pull-right">
<a href="{:url('index/logout')}" class="btn btn-default btn-flat">{:__('Logout')}</a>
... ...
... ... @@ -3,7 +3,7 @@
<!-- Sidebar user panel -->
<div class="user-panel hidden-xs">
<div class="pull-left image">
<img src="__CDN__{$admin.avatar}" class="img-circle" />
<a href="general/profile" class="addtabsit"><img src="__CDN__{$admin.avatar}" class="img-circle" /></a>
</div>
<div class="pull-left info">
<p>{$admin.nickname}</p>
... ...
... ... @@ -13,8 +13,6 @@
<![endif]-->
<script type="text/javascript">
var require = {
config: {
'config': {$config|json_encode}
}
config: {$config|json_encode}
};
</script>
\ No newline at end of file
... ...
<table class="table table-striped">
<thead>
<tr>
<th>标题</th>
<th>内容</th>
</tr>
</thead>
<tbody>
{volist name="row" id="vo" }
<tr>
<td>{$key}</td>
<td>{$vo}</td>
</tr>
{/volist}
</tbody>
</table>
<div class="hide layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="reset" class="btn btn-primary btn-embossed btn-close">{:__('Close')}</button>
</div>
</div>
\ No newline at end of file
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('delete')}
<div class="dropdown btn-group">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> <?= __('More') ?></a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('delete')}
</div>
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('delete')}
</div>
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<style>#cxselect-example textarea{margin:10px 0;}</style>
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding" id="cxselect-example">
<form id="cxselectform" action="">
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><b>省市区联动</b>(通过AJAX读取数据)</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-9">
<div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
<select class="province form-control" name="province" data-url="ajax/area"></select>
<select class="city form-control" name="city" data-url="ajax/area"></select>
<select class="area form-control" name="area" data-url="ajax/area"></select>
</div>
</div>
<div class="col-xs-3 text-right">
<h6><label class="label label-primary"><i class="fa fa-pencil"></i> 增加</label></h6>
</div>
<div class="col-xs-12">
<textarea class="form-control" rows="8">
</textarea>
</div>
</div>
<div class="row">
<div class="col-xs-9">
<div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
<select class="province form-control" name="province" data-url="ajax/area">
<option value="1964" selected>广东省</option>
</select>
<select class="city form-control" name="city" data-url="ajax/area">
<option value="1988" selected>深圳市</option>
</select>
<select class="area form-control" name="area" data-url="ajax/area">
<option value="1991" selected>南山区</option>
</select>
</div>
</div>
<div class="col-xs-3 text-right">
<h6><label class="label label-success"><i class="fa fa-edit"></i> 修改</label></h6>
</div>
<div class="col-xs-12">
<textarea class="form-control" rows="8">
</textarea>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><b>类别联动</b>(Ajax读取数据)</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-9">
<div class="form-inline" data-toggle="cxselect" data-selects="first,second">
<select class="first form-control" name="first" data-url="ajax/category?type=page&pid=5"></select>
<select class="second form-control" name="second" data-url="ajax/category" data-query-name="pid"></select>
</div>
</div>
<div class="col-xs-3 text-right">
<h6><label class="label label-primary"><i class="fa fa-pencil"></i> 增加</label></h6>
</div>
<div class="col-xs-12">
<textarea class="form-control" rows="8">
</textarea>
</div>
</div>
<div class="row">
<div class="col-xs-9">
<div class="form-inline" data-toggle="cxselect" data-selects="first,second">
<select class="first form-control" name="first" data-url="ajax/category?type=page&pid=5">
<option value="6" selected>网站建站</option>
</select>
<select class="second form-control" name="second" data-url="ajax/category" data-query-name="pid">
<option value="9" selected>移动端</option>
</select>
</div>
</div>
<div class="col-xs-3 text-right">
<h6><label class="label label-success"><i class="fa fa-edit"></i> 修改</label></h6>
</div>
<div class="col-xs-12">
<textarea class="form-control" rows="8">
</textarea>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><b>省市区联动</b>(通过JSON渲染数据)</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-9">
<!--由于在初始化中修改了默认值,所以这里需要修改-jsonSpace/jsonValue/jsonName的值-->
<div class="form-inline" data-toggle="cxselect" data-url="__CDN__/assets/libs/jquery-cxselect/js/cityData.min.json"
data-selects="province,city,area" data-json-space="" data-json-name="n" data-json-value="">
<select class="province form-control" name="province"></select>
<select class="city form-control" name="city"></select>
<select class="area form-control" name="area"></select>
</div>
</div>
<div class="col-xs-3 text-right">
<h6><label class="label label-primary"><i class="fa fa-pencil"></i> 增加</label></h6>
</div>
<div class="col-xs-12">
<textarea class="form-control" rows="8">
</textarea>
</div>
</div>
<div class="row">
<div class="col-xs-9">
<!--由于在初始化中修改了默认值,所以这里需要修改-jsonSpace/jsonValue/jsonName的值-->
<div class="form-inline" data-toggle="cxselect" data-url="__CDN__/assets/libs/jquery-cxselect/js/cityData.min.json"
data-selects="province,city,area" data-json-space="" data-json-name="n" data-json-value="">
<select class="province form-control" data-first-title="选择省">
<option value="">请选择</option>
<option value="浙江省" selected>浙江省</option>
</select>
<select class="city form-control" data-first-title="选择市">
<option value="">请选择</option>
<option value="杭州市" selected>杭州市</option>
</select>
<select class="area form-control" data-first-title="选择地区">
<option value="">请选择</option>
<option value="西湖区" selected>西湖区</option>
</select>
</div>
</div>
<div class="col-xs-3 text-right">
<h6><label class="label label-success"><i class="fa fa-edit"></i> 修改</label></h6>
</div>
<div class="col-xs-12">
<textarea class="form-control" rows="8">
</textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div class="row">
<div class="col-md-6">
<div id="toolbar1" class="toolbar">
{:build_toolbar()}
<div class="dropdown btn-group">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table1" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
<div class="col-md-6">
<div id="toolbar2" class="toolbar">
{:build_toolbar()}
<div class="dropdown btn-group">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table2" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('delete')}
</div>
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<style>
.profile-avatar-container {
position:relative;
width:100px;margin:0 auto;
}
.profile-avatar-container .profile-user-img{
width:100px;
height:100px;
}
.profile-avatar-container .profile-avatar-text {
display:none;
}
.profile-avatar-container:hover .profile-avatar-text {
display:block;
position:absolute;
height:100px;
width:100px;
background:#444;
opacity: .6;
color: #fff;
top:0;
left:0;
line-height: 100px;
text-align: center;
}
.profile-avatar-container button{
position:absolute;
top:0;left:0;width:100px;height:100px;opacity: 0;
}
</style>
<div class="row animated fadeInRight">
<div class="col-md-4">
<div class="box box-success">
... ... @@ -5,28 +35,42 @@
{:__('Profile')}
</div>
<div class="panel-body">
<form id="update-form" role="form" data-toggle="validator" method="POST" action="{:url('general.profile/update')}">
<div class="form-group">
<label for="username" class="control-label">{:__('Username')}:</label>
<input type="text" class="form-control" name="row[username]" value="{$admin.username}" disabled />
</div>
<div class="form-group">
<label for="email" class="control-label">{:__('Email')}:</label>
<input type="text" class="form-control" name="row[email]" value="{$admin.email}" />
</div>
<div class="form-group">
<label for="nickname" class="control-label">{:__('Nickname')}:</label>
<input type="text" class="form-control" name="row[nickname]" value="{$admin.nickname}" required="required" />
</div>
<div class="form-group">
<label for="password" class="control-label">{:__('Password')}:</label>
<input type="text" class="form-control" placeholder="{:__('Leave password blank if dont want to change')}" name="row[password]" value=""/>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success">{:__('Submit')}</button>
<button type="reset" class="btn btn-default">{:__('Reset')}</button>
</div>
<input type="hidden" id="c-avatar" name="row[avatar]" value="{$admin.avatar}" />
<div class="box-body box-profile">
<div class="profile-avatar-container">
<img class="profile-user-img img-responsive img-circle plupload" src="{$admin.avatar}" alt="">
<div class="profile-avatar-text img-circle">{:__('Click to edit')}</div>
<button id="plupload-avatar" class="plupload" data-input-id="c-avatar" data-after-upload="changeavatar"><i class="fa fa-upload"></i> {:__('Upload')}</button>
</div>
<h3 class="profile-username text-center">{$admin.username}</h3>
<p class="text-muted text-center">{$admin.email}</p>
<div class="form-group">
<label for="username" class="control-label">{:__('Username')}:</label>
<input type="text" class="form-control" name="row[username]" value="{$admin.username}" disabled />
</div>
<div class="form-group">
<label for="email" class="control-label">{:__('Email')}:</label>
<input type="text" class="form-control" name="row[email]" value="{$admin.email}" data-rule="required;email" />
</div>
<div class="form-group">
<label for="nickname" class="control-label">{:__('Nickname')}:</label>
<input type="text" class="form-control" name="row[nickname]" value="{$admin.nickname}" data-rule="required" />
</div>
<div class="form-group">
<label for="password" class="control-label">{:__('Password')}:</label>
<input type="text" class="form-control" placeholder="{:__('Leave password blank if dont want to change')}" name="row[password]" value=""/>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success">{:__('Submit')}</button>
<button type="reset" class="btn btn-default">{:__('Reset')}</button>
</div>
</div>
</form>
</div>
</div>
... ...
... ... @@ -6,6 +6,8 @@
<style type="text/css">
body {
color:#999;
background:url('http://img.infinitynewtab.com/wallpaper/{:date("Ymd")%4000}.jpg');
background-size:cover;
}
.login-panel{margin-top:150px;}
.login-screen {
... ... @@ -72,12 +74,12 @@
{:token()}
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></div>
<input type="text" class="form-control" id="pd-form-username" placeholder="" name="username" autocomplete="off" required="required" value="admin" />
<input type="text" class="form-control" id="pd-form-username" placeholder="" name="username" autocomplete="off" value="admin" />
</div>
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
<input type="password" class="form-control" id="pd-form-password" placeholder="" name="password" autocomplete="off" required="required" value="123456" />
<input type="password" class="form-control" id="pd-form-password" placeholder="" name="password" autocomplete="off" value="123456" />
</div>
<div class="form-group">
... ...
... ... @@ -20,13 +20,13 @@
<!-- RIBBON -->
<div id="ribbon">
<ol class="breadcrumb pull-left">
<li><a href="#"><i class="fa fa-dashboard"></i> {:__('Dashboard')}</a></li>
<li>{$title|default=''}</li>
<li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> {:__('Dashboard')}</a></li>
</ol>
<ol class="breadcrumb pull-right">
{foreach $breadcrumb as $vo}
<li>{$vo.title}</li>
{/foreach}
</ol>
<div class="shortcut pull-right">
<a href="javascript:;" id="search" onclick="$('.search input').focus();"><i class="fa fa-search"></i> <span class="hidden-mobile">{:__('Search')}</span></a>
<a href="javascript:;" id="refresh" onclick="location.reload();"><i class="fa fa-refresh"></i> <span class="hidden-mobile">{:__('Refresh')}</span></a>
</div>
</div>
<!-- END RIBBON -->
{/if}
... ...
... ... @@ -20,7 +20,7 @@
<div class="form-group">
<label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[flag]', 'h,i,s', null, ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
{:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], null, ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
</div>
</div>
<div class="form-group">
... ...
... ... @@ -21,7 +21,7 @@
<div class="form-group">
<label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[flag]', 'h,i,s', $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
{:build_select('row[flag]', ['recommend'=>__('Recommend'), 'index'=>__('Index'), 'hot'=>__('Hot')], $row['flag'], ['id'=>'c-flag','class'=>'form-control selectpicker','required'=>''])}
</div>
</div>
<div class="form-group">
... ...
<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-category_id" class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_category_select('row[category_id]', 'test', '0', ['id' => 'c-category_id'])}
</div>
</div>
<div class="form-group">
<label for="c-category_ids" class="control-label col-xs-12 col-sm-2">{:__('Category_ids')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_category_select('row[category_ids]', 'test', '', ['id' => 'c-category_ids','required' => '','multiple' => ''])}
</div>
</div>
<div class="form-group">
<label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" class="form-control typeahead" name="row[user_id]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label for="c-user_ids" class="control-label col-xs-12 col-sm-2">{:__('User_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_ids" required="" class="form-control tagsinput" name="row[user_ids]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-week" class="control-label col-xs-12 col-sm-2">{:__('Week')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[week]', ['monday' => __('Monday'),'tuesday' => __('Tuesday'),'wednesday' => __('Wednesday')], '', ['id' => 'c-week','required' => '','class' => 'form-control selectpicker'])}
</div>
</div>
<div class="form-group">
<label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[flag][]', ['hot' => __('Hot'),'index' => __('Index'),'recommend' => __('Recommend')], '', ['id' => 'c-flag','required' => '','class' => 'form-control selectpicker','multiple' => ''])}
</div>
</div>
<div class="form-group">
<label for="c-genderdata" class="control-label col-xs-12 col-sm-2">{:__('Genderdata')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[genderdata]', ['male' => __('Male'),'female' => __('Female')], 'male')}
</div>
</div>
<div class="form-group">
<label for="c-hobbydata" class="control-label col-xs-12 col-sm-2">{:__('Hobbydata')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_checkboxs('row[hobbydata][]', ['music' => __('Music'),'reading' => __('Reading'),'swimming' => __('Swimming')], '')}
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" required="" class="form-control" name="row[title]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" required="" class="form-control summernote" rows="5" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="form-inline">
<input id="c-image" required="" class="form-control" size="50" name="row[image]" type="text" value="">
<span><button id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image"data-mimetype="image/*"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-attachfile" class="control-label col-xs-12 col-sm-2">{:__('Attachfile')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="form-inline">
<input id="c-attachfile" required="" class="form-control" size="50" name="row[attachfile]" type="text" value="">
<span><button id="plupload-attachfile" class="btn btn-danger plupload" data-input-id="c-attachfile"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" required="" class="form-control" name="row[keywords]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" required="" class="form-control " rows="5" name="row[description]" cols="50"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-price" class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
</div>
</div>
<div class="form-group">
<label for="c-views" class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-views" class="form-control" name="row[views]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label for="c-startdate" class="control-label col-xs-12 col-sm-2">{:__('Startdate')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-startdate" required="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[startdate]" type="text" value="{:date('Y-m-d')}">
</div>
</div>
<div class="form-group">
<label for="c-activitydate" class="control-label col-xs-12 col-sm-2">{:__('Activitydate')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-activitydate" required="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[activitydate]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label for="c-year" class="control-label col-xs-12 col-sm-2">{:__('Year')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-year" required="" class="form-control datetimepicker" data-date-format="YYYY" data-use-current="true" name="row[year]" type="text" value="{:date('Y')}">
</div>
</div>
<div class="form-group">
<label for="c-times" class="control-label col-xs-12 col-sm-2">{:__('Times')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-times" required="" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[times]" type="text" value="{:date('H:i:s')}">
</div>
</div>
<div class="form-group">
<label for="c-refreshtime" class="control-label col-xs-12 col-sm-2">{:__('Refreshtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-refreshtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refreshtime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[status]', ['normal' => __('Normal'),'hidden' => __('Hidden')], 'normal')}
</div>
</div>
<div class="form-group hide layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-category_id" class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_category_select('row[category_id]', 'test', $row.category_id, ['id' => 'c-category_id'])}
</div>
</div>
<div class="form-group">
<label for="c-category_ids" class="control-label col-xs-12 col-sm-2">{:__('Category_ids')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_category_select('row[category_ids]', 'test', $row.category_ids, ['id' => 'c-category_ids','required' => '','multiple' => ''])}
</div>
</div>
<div class="form-group">
<label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" class="form-control typeahead" name="row[user_id]" type="number" value="{$row.user_id}">
</div>
</div>
<div class="form-group">
<label for="c-user_ids" class="control-label col-xs-12 col-sm-2">{:__('User_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_ids" required="" class="form-control tagsinput" name="row[user_ids]" type="text" value="{$row.user_ids}">
</div>
</div>
<div class="form-group">
<label for="c-week" class="control-label col-xs-12 col-sm-2">{:__('Week')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[week]', ['monday' => __('Monday'),'tuesday' => __('Tuesday'),'wednesday' => __('Wednesday')], $row.week, ['id' => 'c-week','required' => '','class' => 'form-control selectpicker'])}
</div>
</div>
<div class="form-group">
<label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[flag][]', ['hot' => __('Hot'),'index' => __('Index'),'recommend' => __('Recommend')], $row.flag, ['id' => 'c-flag','required' => '','class' => 'form-control selectpicker','multiple' => ''])}
</div>
</div>
<div class="form-group">
<label for="c-genderdata" class="control-label col-xs-12 col-sm-2">{:__('Genderdata')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[genderdata]', ['male' => __('Male'),'female' => __('Female')], $row.genderdata)}
</div>
</div>
<div class="form-group">
<label for="c-hobbydata" class="control-label col-xs-12 col-sm-2">{:__('Hobbydata')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_checkboxs('row[hobbydata][]', ['music' => __('Music'),'reading' => __('Reading'),'swimming' => __('Swimming')], $row.hobbydata)}
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" required="" class="form-control" name="row[title]" type="text" value="{$row.title}">
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" required="" class="form-control summernote" rows="5" name="row[content]" cols="50">{$row.content}</textarea>
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="form-inline">
<input id="c-image" required="" class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
<span><button id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image"data-mimetype="image/*"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-attachfile" class="control-label col-xs-12 col-sm-2">{:__('Attachfile')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="form-inline">
<input id="c-attachfile" required="" class="form-control" size="50" name="row[attachfile]" type="text" value="{$row.attachfile}">
<span><button id="plupload-attachfile" class="btn btn-danger plupload" data-input-id="c-attachfile"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" required="" class="form-control" name="row[keywords]" type="text" value="{$row.keywords}">
</div>
</div>
<div class="form-group">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" required="" class="form-control " rows="5" name="row[description]" cols="50">{$row.description}</textarea>
</div>
</div>
<div class="form-group">
<label for="c-price" class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price}">
</div>
</div>
<div class="form-group">
<label for="c-views" class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-views" class="form-control" name="row[views]" type="number" value="{$row.views}">
</div>
</div>
<div class="form-group">
<label for="c-startdate" class="control-label col-xs-12 col-sm-2">{:__('Startdate')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-startdate" required="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[startdate]" type="text" value="{$row.startdate}">
</div>
</div>
<div class="form-group">
<label for="c-activitydate" class="control-label col-xs-12 col-sm-2">{:__('Activitydate')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-activitydate" required="" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[activitydate]" type="text" value="{$row.activitydate}">
</div>
</div>
<div class="form-group">
<label for="c-year" class="control-label col-xs-12 col-sm-2">{:__('Year')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-year" required="" class="form-control datetimepicker" data-date-format="YYYY" data-use-current="true" name="row[year]" type="text" value="{$row.year}">
</div>
</div>
<div class="form-group">
<label for="c-times" class="control-label col-xs-12 col-sm-2">{:__('Times')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-times" required="" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[times]" type="text" value="{$row.times}">
</div>
</div>
<div class="form-group">
<label for="c-refreshtime" class="control-label col-xs-12 col-sm-2">{:__('Refreshtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-refreshtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refreshtime]" type="text" value="{$row.refreshtime|datetime}">
</div>
</div>
<div class="form-group">
<label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh}">
</div>
</div>
<div class="form-group">
<label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[status]', ['normal' => __('Normal'),'hidden' => __('Hidden')], $row.status)}
</div>
</div>
<div class="form-group hide layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar()}
<div class="dropdown btn-group">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover" width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -9,7 +9,8 @@ class Common
public function run(&$params)
{
$cdnurl = str_replace('/index.php', '', $params->root());
$cdnurl = str_replace($_SERVER['SCRIPT_NAME'], '', $params->root());
// 如果未设置__CDN__则自动匹配得出
if (!Config::get('view_replace_str.__CDN__'))
{
... ... @@ -20,6 +21,11 @@ class Common
{
Config::set('site.cdnurl', $cdnurl);
}
// 如果未设置cdnurl则自动匹配得出
if (!Config::get('upload.cdnurl'))
{
Config::set('upload.cdnurl', $cdnurl);
}
// 如果是调试模式将version置为当前的时间戳可避免缓存
if (!Config::get('app_debug'))
{
... ...
... ... @@ -84,16 +84,8 @@ class Backend extends Controller
// 非选项卡时重定向
if (!IS_AJAX && !IS_ADDTABS && $controllername != 'index' && $actionname == 'index')
{
$url = $this->request->baseUrl();
$start = stripos($url, 'index.php');
$start = $start !== false ? $start : 0;
$url = substr($url, 0, $start + 9) . str_replace('.', '/', substr($url, $start + 9));
// 如果是域名部署则加上前缀
if (Config::get('url_domain_deploy'))
{
$url = rtrim(url('/'), '/') . $url;
}
header("location:" . url('index/index#!' . urlencode($url), '', false));
$url = $this->request->url();
$this->redirect('index/index', [], 302, ['referer' => $url]);
exit;
}
... ... @@ -120,6 +112,12 @@ class Backend extends Controller
}
}
}
// 设置面包屑导航数据
$breadcrumb = $this->auth->getBreadCrumb($path);
array_pop($breadcrumb);
$this->view->breadcrumb = $breadcrumb;
// 如果有使用模板布局
if ($this->layout)
{
... ... @@ -138,8 +136,10 @@ class Backend extends Controller
'actionname' => $actionname,
'jsname' => 'backend/' . str_replace('.', '/', $controllername),
'moduleurl' => url("/{$modulename}", '', false),
'language' => $lang
'language' => $lang,
'referer' => Session::get("referer")
];
Lang::load(APP_PATH . $modulename . '/lang/' . $lang . '/' . str_replace('.', '/', $controllername) . '.php');
$this->assign('site', Config::get("site"));
... ... @@ -177,9 +177,27 @@ class Backend extends Controller
}
$where[] = "(" . implode(' OR ', $searchlist) . ")";
}
$table = '';
if (!empty($this->model))
{
$class = get_class($this->model);
$name = basename(str_replace('\\', '/', $class));
$table = $this->model->db(false)->getTable($name);
$table = $table . ".";
}
if (stripos($sort, ".") === false)
{
$sort = $table . $sort;
}
foreach ($filter as $k => $v)
{
$sym = isset($op[$k]) ? $op[$k] : '=';
if (stripos($k, ".") === false)
{
$k = $table . $k;
}
$sym = isset($op[$k]) ? $op[$k] : $sym;
switch ($sym)
{
case '=':
... ...
... ... @@ -29,7 +29,6 @@ class Category Extends Model
'default' => __('Default'),
'page' => __('Page'),
'article' => __('Article'),
'block' => __('Block'),
];
return $typelist;
}
... ...
... ... @@ -38,7 +38,7 @@ class User extends Frontend
{
$url = $this->request->get('url', '/');
if ($this->user->check())
$this->error(__('You are already logged in'), $url);
$this->error(__('You\'ve logged in, do not login again'), $url);
if ($this->request->isPost())
{
$username = $this->request->post('username');
... ... @@ -77,7 +77,7 @@ class User extends Frontend
{
$url = $this->request->get('url', '/');
if ($this->user->check())
$this->error(__('You are already logged in'), $url);
$this->error(__('You\'ve logged in, do not login again'), $url);
if ($this->request->isPost())
{
$account = $this->request->post('account');
... ...
... ... @@ -92,6 +92,9 @@ return [
'Please enter your username' => '请输入你的用户名',
'Please enter your password' => '请输入你的密码',
'Please login first' => '请登录后操作',
'Sign up successful' => '注册成功',
'Logged in successful' => '登录成功',
'Logout successful' => '注销成功',
'You\'ve logged in, do not login again' => '你已经登录,无需重复登录',
'Username or password can not be empty' => '用户名密码不能为空',
'Username is incorrect' => '用户名不正确',
... ...
... ... @@ -10,7 +10,7 @@
</div>
<div class="page-header"><h3>组件</h3></div>
<div class="row">
<div class="row" id="component-list">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<a href="{:url('index/user/login')}"><img style="height: 200px; width: 100%; display: block;" src="__CDN__/assets/img/third.jpg" data-holder-rendered="true"></a>
... ...
<!DOCTYPE html>
<html lang="en">
<html lang="{$config.language}">
<head>
<meta charset="utf-8">
<title>FastAdmin</title>
... ... @@ -16,14 +16,15 @@
<![endif]-->
<script type="text/javascript">
var require = {
config: {
'config': {$config|json_encode}
}
config: {$config | json_encode}
};
</script>
<style>
html{height:100%;overflow:auto;-webkit-overflow-scrolling: touch;}
body{padding:70px 0;}
body{padding:70px 0 0 0;}
footer {margin-top:20px;font-size:14px;padding:25px 0;background:#f4f6f6;}
.footer-link ul li a{margin-top:10px;line-height: 25px;}
#component-list .caption p {font-size:13px;line-height:20px;}
</style>
<script>
... ... @@ -44,7 +45,7 @@
</div>
<ul class="nav navbar-nav pull-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">更多示例 <span class="caret"></span></a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">你好!{:$user->id?$user->nickname:'游客'} <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a id="userindex" href="{:url('user/index')}">会员中心</a></li>
<li><a id="thirdlogin" href="{:url('user/login')}">第三方登录</a></li>
... ... @@ -61,6 +62,41 @@
{__CONTENT__}
<footer>
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="footer-link">
<ul class="list-inline">
<li><a href="http://www.fastadmin.net">关于我们</a></li>
<li><a href="http://doc.fastadmin.net">帮助文档</a></li>
<li><a href="https://git.oschina.net/karson/fastadmin">Git@OSC</a></li>
<li><a href="https://github.com/karsonzhang/fastadmin" class="">Github</a></li>
<li><a href="http://www.fastadmin.net/#donate" class="">打赏</a></li>
<li><a href="http://www.fastadmin.net/#contact" class="">联系我们</a></li>
<li><a href="http://demo.fastadmin.net/" class="">在线演示</a></li>
</ul>
</div>
<div class="pull-left">
<p>
<span class="text-muted"><a href="http://www.miitbeian.gov.cn/" target="_blank">粤ICP备15054802号-4</a></span>
</p>
<span class="small"></span>
<p>
Copyright © fastadmin.net 2017-2018 All rights reserved
</p>
</div>
<div class="pull-right hidden-xs hidden-sm">
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</footer>
<script src="__CDN__/assets/js/require.js" data-main="__CDN__/assets/js/require-frontend{$Think.config.app_debug?'':'.min'}.js?v={$site.version}"></script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<head>
<title>会员中心</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="__CDN__/assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="__CDN__/assets/css/fastadmin.min.css" rel="stylesheet" />
<link href="__CDN__/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<html lang="{$config.language}">
<head>
<title>会员中心</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="__CDN__/assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="__CDN__/assets/css/fastadmin.min.css" rel="stylesheet" />
<link href="__CDN__/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
<script src="__CDN__/assets/js/html5shiv.js"></script>
<script src="__CDN__/assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="row tips">
<div class="col-xs-12">
<div class="box box-gray">
<div class="box-body">
{__CONTENT__}
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
<script src="__CDN__/assets/js/html5shiv.js"></script>
<script src="__CDN__/assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="row tips">
<div class="col-xs-12">
<div class="box box-gray">
<div class="box-body">
{__CONTENT__}
</div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@
<div class="row">
<div class="col-xs-12">
{if $user->check()}
<div class="alert alert-dismissable alert-warning clearfix">
<div class="alert alert-dismissable bg-gray-light clearfix">
<div class="pull-left"><img class="img-responsive img-circle" style="width:100px;" src="/assets/img/avatar.png" /></div>
<div class="pull-left text-left" style="margin-left:15px;">
<p>
... ...
... ... @@ -38,6 +38,7 @@
"devDependencies": {
"dragsort": "https://github.com/karsonzhang/dragsort.git",
"jquery-addtabs": "https://github.com/karsonzhang/jquery-addtabs.git",
"jquery-cxselect": "https://github.com/karsonzhang/cxSelect.git#",
"jqcron": "https://github.com/karsonzhang/jqcron.git#"
}
}
... ...
... ... @@ -40,6 +40,7 @@ class Auth
* @var object 对象实例
*/
protected static $instance;
protected $rules = [];
/**
* 当前请求实例
... ... @@ -179,7 +180,7 @@ class Auth
->view($auth_group, 'id,pid,name,rules', "{$auth_group_access}.group_id={$auth_group}.id", 'LEFT')
->where("{$auth_group_access}.uid='{$uid}' and {$auth_group}.status='normal'")
->select();
$groups[$uid] = $user_groups ? : [];
$groups[$uid] = $user_groups ?: [];
return $groups[$uid];
}
... ... @@ -208,7 +209,7 @@ class Auth
$_rulelist[$uid] = [];
return [];
}
// 筛选条件
$where = [
'status' => 'normal'
... ... @@ -218,10 +219,11 @@ class Auth
$where['id'] = ['in', $ids];
}
//读取用户组所有权限规则
$rules = Db::name($this->config['auth_rule'])->where($where)->field('id,condition,name,ismenu')->select();
$this->rules = Db::name($this->config['auth_rule'])->where($where)->field('id,pid,condition,icon,name,title,ismenu')->select();
//循环规则,判断结果。
$rulelist = []; //
foreach ($rules as $rule)
foreach ($this->rules as $rule)
{
//超级管理员无需验证condition
if (!empty($rule['condition']) && !in_array('*', $ids))
... ...
body {
background: #f1f4f6;
}
.selection {
position: absolute;
border: 1px solid #8B9;
background-color: #BEC;
}
.main-header .logo,
.main-header .navbar {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.main-header .navbar {
position: relative;
}
.main-header .navbar .sidebar-toggle {
position: absolute;
width: 45px;
text-align: center;
}
.main-header .navbar #nav {
position: absolute;
left: 45px;
}
.main-header .navbar .navbar-custom-menu {
position: absolute;
right: 0;
}
.note-dialog .modal {
z-index: 1060;
}
.bootstrap-dialog .modal-dialog {
/*width: 70%;*/
max-width: 885px;
}
#header {
background: #fff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.05);
}
.content-wrapper {
position: relative;
}
.tab-addtabs {
overflow: hidden;
}
.tab-addtabs .tab-pane {
height: 100%;
width: 100%;
}
.tab-addtabs.ios-iframe-fix .tab-pane {
-webkit-overflow-scrolling: touch;
overflow: auto;
}
.common-search-table {
min-height: 20px;
padding: 15px;
margin-bottom: 15px;
background-color: #f5f5f5;
}
/*
* RIBBON
*/
#ribbon {
overflow: hidden;
padding: 15px 15px 0 15px;
position: relative;
}
#ribbon a {
color: #777 !important;
text-decoration: none !important;
}
#ribbon .breadcrumb {
display: inline-block;
margin: 0;
padding: 0;
background: none;
vertical-align: top;
}
#ribbon .breadcrumb > .active,
#ribbon .breadcrumb li:last-child {
color: #aaa;
}
#ribbon .shortcut a {
margin-left: 10px;
}
.is-dialog #main {
background: #fff;
}
.is-dialog form label {
font-weight: normal;
}
/*panel扩展描述样式*/
.panel-intro {
margin-bottom: 0;
border: none;
}
.panel-intro .panel-heading {
padding: 15px;
padding-bottom: 0;
background: #e8edf0;
border-color: #e8edf0;
position: relative;
}
.panel-intro .panel-heading .panel-lead {
margin-bottom: 15px;
}
.panel-intro .panel-heading .panel-lead em {
display: block;
font-weight: bold;
font-style: normal;
}
.panel-intro .panel-heading .panel-title {
height: 25px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-intro .panel-heading .panel-control {
height: 42px;
position: absolute;
top: 8px;
right: 8px;
}
.panel-intro .panel-heading .panel-control .fa {
font-size: 14px;
}
.panel-intro .panel-heading .nav-tabs {
border-bottom: 0;
margin-bottom: 0;
}
.panel-intro .panel-heading .nav-tabs > li > a {
margin-right: 4px;
color: #95a5a6;
background-color: #d8e0e6;
border: 1px solid #e8edf0;
border-bottom-color: transparent;
}
.panel-intro .panel-heading .nav-tabs > li > a:hover,
.panel-intro .panel-heading .nav-tabs > li > a:focus {
border: 1px solid #e8edf0;
color: #7b8a8b;
background-color: #c9d4dc;
}
.panel-intro .panel-heading .nav-tabs > li.active > a,
.panel-intro .panel-heading .nav-tabs > li.active > a:hover,
.panel-intro .panel-heading .nav-tabs > li.active > a:focus {
color: #7b8a8b;
background-color: #ffffff;
border-bottom-color: transparent;
cursor: default;
}
/*单表格*/
.panel-tabs .panel-heading {
padding: 12px 15px 12px 15px;
}
.panel-tabs .panel-heading .panel-lead {
margin-bottom: 0px;
}
/*选项卡*/
.panel-nav .panel-heading {
padding: 0px;
padding-bottom: 0;
background: #f1f4f6;
border-color: #f1f4f6;
}
.panel-nav .nav-tabs > li > a {
padding: 12px 15px;
background-color: #e8edf0;
border: 1px solid #f1f4f6;
}
.panel-nav .nav-tabs > li > a:hover,
.panel-nav .nav-tabs > li > a:focus {
border: 1px solid #e8edf0;
background-color: #e8edf0;
}
.panel-nav .nav-tabs > li.active > a,
.panel-nav .nav-tabs > li.active > a:hover,
.panel-nav .nav-tabs > li.active > a:focus {
border-color: #f1f4f6;
border-bottom-color: transparent;
}
/*顶栏addtabs*/
.nav-addtabs {
border: none;
}
.nav-addtabs.disable-top-badge > li > a > .pull-right-container {
display: none;
}
.nav-addtabs > li {
margin: 0;
}
.nav-addtabs > li > a {
height: 49px;
line-height: 49px;
padding: 0 15px;
border-radius: 0;
border: none;
border-right: 1px solid rgba(0, 0, 0, 0.05);
margin: 0;
color: #95a5a6;
}
.nav-addtabs > li > a:hover,
.nav-addtabs > li > a:focus {
border: none;
color: #2c3e50;
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.nav-addtabs > li > a i {
margin-right: 3px;
}
.nav-addtabs > li.active > a {
height: 49px;
line-height: 49px;
padding: 0 15px;
border-radius: 0;
border: none;
border-right: 1px solid rgba(0, 0, 0, 0.05);
background: #f1f4f6;
color: #2c3e50;
overflow: hidden;
}
.nav-addtabs > li.active > a:hover,
.nav-addtabs > li.active > a:focus {
border: none;
color: #2c3e50;
border-right: 1px solid rgba(0, 0, 0, 0.05);
background: #f1f4f6;
}
.nav-addtabs > li .close-tab {
font-size: 10px;
position: absolute;
right: 5px;
top: 50%;
margin-top: -7px;
z-index: 100;
cursor: hand;
cursor: pointer;
color: #fff;
display: none;
}
.nav-addtabs .open > a:hover,
.nav-addtabs .open > a:focus {
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.nav-addtabs ul li {
position: relative;
}
.nav-addtabs li:hover > .close-tab {
display: block;
}
.sidebar-menu.show-submenu .treeview-menu {
display: block;
}
.sidebar-menu > li .badge {
margin-top: 0;
}
#treeview .jstree-container-ul .jstree-node {
display: block;
clear: both;
}
#treeview .jstree-leaf:not(:first-child) {
float: left;
background: none;
margin-left: 0;
width: 80px;
clear: none;
}
#treeview .jstree-leaf {
float: left;
margin-left: 0;
padding-left: 24px;
width: 80px;
clear: none;
color: #777;
}
#treeview .jstree-leaf > .jstree-icon,
#treeview .jstree-leaf .jstree-themeicon {
display: none;
}
#treeview .jstree-last {
background-image: url("../img/32px.png");
background-position: -292px -4px;
background-repeat: repeat-y;
}
#treeview .jstree-children:before,
#treeview .jstree-children:after {
content: " ";
display: table;
}
#treeview .jstree-children:after {
clear: both;
}
#treeview .jstree-children:before,
#treeview .jstree-children:after {
content: " ";
display: table;
}
#treeview .jstree-children:after {
clear: both;
}
#treeview .jstree-themeicon {
display: none;
}
/*去除bootstrap-table的边框*/
.fixed-table-container {
border: none!important;
}
.note-editor .note-editing-area .note-editable {
display: block !important;
}
.pjax-loader-bar .progress {
position: fixed;
top: 0;
left: 0;
height: 2px;
background: #77b6ff;
box-shadow: 0 0 10px rgba(119, 182, 255, 0.7);
-webkit-transition: width 0.4s ease;
transition: width 0.4s ease;
}
.dropdown-menu.text-left a,
.dropdown-menu.text-left li {
text-align: left!important;
}
.bootstrap-table .fixed-table-toolbar .dropdown-menu {
overflow: visible;
}
.bootstrap-table table tbody tr:first-child td .bs-checkbox {
vertical-align: middle;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
overflow: auto;
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-webkit-background-clip: padding-box;
-moz-border-radius: 0 6px 6px 6px;
-moz-background-clip: padding;
border-radius: 0 6px 6px 6px;
background-clip: padding-box;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-webkit-background-clip: padding-box;
-moz-border-radius: 6px 0 6px 6px;
-moz-background-clip: padding;
border-radius: 6px 0 6px 6px;
background-clip: padding-box;
}
/*重写toast的几个背景色*/
.toast-primary {
background-color: #48c9b0!important;
}
.toast-success {
background-color: #2ecc71!important;
}
.toast-error {
background-color: #e74c3c!important;
}
.toast-info {
background-color: #5dade2!important;
}
.toast-warning {
background-color: #f1c40f!important;
}
.toast-inverse {
background-color: #34495e!important;
}
.toast-default {
background-color: #bdc3c7!important;
}
.layui-layer-title {
background: #2c3e50!important;
color: #fff!important;
}
/*避免出现多滚动条*/
.layui-layer-noborder {
border: none!important;
box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important;
}
.layui-layer-moves {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.layui-layer-iframe {
overflow: hidden!important;
}
.layui-layer-iframe .layui-layer-content {
-webkit-overflow-scrolling: touch;
overflow-y: hidden!important;
overflow: hidden;
}
/*自定义底部灰色操作区*/
.layui-layer-btn {
text-align: center!important;
padding: 10px!important;
background: #ecf0f1;
}
.layui-layer-footer {
padding: 8px 20px;
background-color: #ecf0f1;
height: auto;
text-align: inherit!important;
}
.layui-layer-btn a {
background-color: #95a5a6!important;
border-color: #95a5a6!important;
color: #fff!important;
}
.layui-layer-btn .layui-layer-btn0 {
background-color: #18bc9c!important;
border-color: #18bc9c!important;
}
.layui-layer-setwin {
top: 10px!important;
}
.layui-layer-setwin > a {
background: none!important;
}
.layui-layer-setwin > a cite {
display: none;
}
.layui-layer-setwin > a:after {
content: "\e625";
font-family: iconfont;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
position: absolute;
font-size: 18px;
color: #fff;
margin: 0;
z-index: 1;
}
.layui-layer-setwin > a:hover {
text-decoration: none!important;
background: none!important;
}
.layui-layer-setwin > a:focus {
text-decoration: none!important;
}
.layui-layer-setwin .layui-layer-min:after {
content: "\e625";
}
.layui-layer-setwin .layui-layer-max:after {
content: "\e623";
}
.layui-layer-setwin .layui-layer-maxmin:after {
content: "\e624";
}
.layui-layer-setwin .layui-layer-close1:after {
content: "\e626";
}
.layui-layer-setwin .layui-layer-close2,
.layui-layer-setwin .layui-layer-close2:hover {
background: url('../libs/layer/build/skin/default/icon.png') no-repeat -149px -31px !important;
}
.layui-layer-setwin .layui-layer-close2:after,
.layui-layer-setwin .layui-layer-close2:hover:after {
display: none;
}
/*手机版样式*/
@media (max-width: 480px) {
.nav-addtabs {
display: none;
}
}
/*平板样式*/
/*# sourceMappingURL=backend-func.css.map */
\ No newline at end of file
... ... @@ -5,4 +5,527 @@
@import url("../libs/font-awesome/css/font-awesome.min.css");
@import url("../libs/toastr/toastr.min.css");
@import url("../libs/layer/build/skin/default/layer.css");
@import url("../css/backend-func.css");
\ No newline at end of file
@import url("../libs/bootstrap-table/dist/bootstrap-table.min.css");
@import url("../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css");
@import url("../libs/nice-validator/dist/jquery.validator.css");
body {
background: #f1f4f6;
}
.selection {
position: absolute;
border: 1px solid #8B9;
background-color: #BEC;
}
.main-header .logo,
.main-header .navbar {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.main-header .navbar {
position: relative;
}
.main-header .navbar .sidebar-toggle {
position: absolute;
width: 45px;
text-align: center;
}
.main-header .navbar #nav {
position: absolute;
left: 45px;
}
.main-header .navbar .navbar-custom-menu {
position: absolute;
right: 0;
}
.note-dialog .modal {
z-index: 1060;
}
.bootstrap-dialog .modal-dialog {
/*width: 70%;*/
max-width: 885px;
}
#header {
background: #fff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.05);
}
.content-wrapper {
position: relative;
}
.tab-addtabs {
overflow: hidden;
}
.tab-addtabs .tab-pane {
height: 100%;
width: 100%;
}
.tab-addtabs.ios-iframe-fix .tab-pane {
-webkit-overflow-scrolling: touch;
overflow: auto;
}
.common-search-table {
min-height: 20px;
padding: 15px;
margin-bottom: 15px;
background-color: #f5f5f5;
}
.searchit {
border-bottom: 1px dashed #3c8dbc;
}
/*
* RIBBON
*/
#ribbon {
overflow: hidden;
padding: 15px 15px 0 15px;
position: relative;
}
#ribbon a {
color: #777 !important;
text-decoration: none !important;
}
#ribbon .breadcrumb {
display: inline-block;
margin: 0;
padding: 0;
background: none;
vertical-align: top;
}
#ribbon .breadcrumb > .active,
#ribbon .breadcrumb li {
color: #aaa;
}
#ribbon .shortcut a {
margin-left: 10px;
}
.is-dialog #main {
background: #fff;
}
.is-dialog form label {
font-weight: normal;
}
.user-panel > .image img {
width: 45px;
height: 45px;
}
/*panel扩展描述样式*/
.panel-intro {
margin-bottom: 0;
border: none;
}
.panel-intro > .panel-heading {
padding: 15px;
padding-bottom: 0;
background: #e8edf0;
border-color: #e8edf0;
position: relative;
}
.panel-intro > .panel-heading .panel-lead {
margin-bottom: 15px;
}
.panel-intro > .panel-heading .panel-lead em {
display: block;
font-weight: bold;
font-style: normal;
}
.panel-intro > .panel-heading .panel-title {
height: 25px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-intro > .panel-heading .panel-control {
height: 42px;
position: absolute;
top: 8px;
right: 8px;
}
.panel-intro > .panel-heading .panel-control .fa {
font-size: 14px;
}
.panel-intro > .panel-heading .nav-tabs {
border-bottom: 0;
margin-bottom: 0;
}
.panel-intro > .panel-heading .nav-tabs > li > a {
margin-right: 4px;
color: #95a5a6;
background-color: #d8e0e6;
border: 1px solid #e8edf0;
border-bottom-color: transparent;
}
.panel-intro > .panel-heading .nav-tabs > li > a:hover,
.panel-intro > .panel-heading .nav-tabs > li > a:focus {
border: 1px solid #e8edf0;
color: #7b8a8b;
background-color: #c9d4dc;
}
.panel-intro > .panel-heading .nav-tabs > li.active > a,
.panel-intro > .panel-heading .nav-tabs > li.active > a:hover,
.panel-intro > .panel-heading .nav-tabs > li.active > a:focus {
color: #7b8a8b;
background-color: #ffffff;
border-bottom-color: transparent;
cursor: default;
}
/*单表格*/
.panel-tabs .panel-heading {
padding: 12px 15px 12px 15px;
}
.panel-tabs .panel-heading .panel-lead {
margin-bottom: 0px;
}
/*选项卡*/
.panel-nav .panel-heading {
padding: 0px;
padding-bottom: 0;
background: #f1f4f6;
border-color: #f1f4f6;
}
.panel-nav .nav-tabs > li > a {
padding: 12px 15px;
background-color: #e8edf0;
border: 1px solid #f1f4f6;
}
.panel-nav .nav-tabs > li > a:hover,
.panel-nav .nav-tabs > li > a:focus {
border: 1px solid #e8edf0;
background-color: #e8edf0;
}
.panel-nav .nav-tabs > li.active > a,
.panel-nav .nav-tabs > li.active > a:hover,
.panel-nav .nav-tabs > li.active > a:focus {
border-color: #f1f4f6;
border-bottom-color: transparent;
}
/*顶栏addtabs*/
.nav-addtabs {
border: none;
}
.nav-addtabs.disable-top-badge > li > a > .pull-right-container {
display: none;
}
.nav-addtabs > li {
margin: 0;
}
.nav-addtabs > li > a {
height: 49px;
line-height: 49px;
padding: 0 15px;
border-radius: 0;
border: none;
border-right: 1px solid rgba(0, 0, 0, 0.05);
margin: 0;
color: #95a5a6;
}
.nav-addtabs > li > a:hover,
.nav-addtabs > li > a:focus {
border: none;
color: #2c3e50;
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.nav-addtabs > li > a i {
margin-right: 3px;
}
.nav-addtabs > li.active > a {
height: 49px;
line-height: 49px;
padding: 0 15px;
border-radius: 0;
border: none;
border-right: 1px solid rgba(0, 0, 0, 0.05);
background: #f1f4f6;
color: #2c3e50;
overflow: hidden;
}
.nav-addtabs > li.active > a:hover,
.nav-addtabs > li.active > a:focus {
border: none;
color: #2c3e50;
border-right: 1px solid rgba(0, 0, 0, 0.05);
background: #f1f4f6;
}
.nav-addtabs > li .close-tab {
font-size: 10px;
position: absolute;
right: 5px;
top: 50%;
margin-top: -7px;
z-index: 100;
cursor: hand;
cursor: pointer;
color: #fff;
display: none;
}
.nav-addtabs .open > a:hover,
.nav-addtabs .open > a:focus {
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.nav-addtabs ul li {
position: relative;
}
.nav-addtabs li:hover > .close-tab {
display: block;
}
.sidebar-menu.show-submenu .treeview-menu {
display: block;
}
.sidebar-menu > li .badge {
margin-top: 0;
}
#treeview .jstree-container-ul .jstree-node {
display: block;
clear: both;
}
#treeview .jstree-leaf:not(:first-child) {
float: left;
background: none;
margin-left: 0;
width: 80px;
clear: none;
}
#treeview .jstree-leaf {
float: left;
margin-left: 0;
padding-left: 24px;
width: 80px;
clear: none;
color: #777;
}
#treeview .jstree-leaf > .jstree-icon,
#treeview .jstree-leaf .jstree-themeicon {
display: none;
}
#treeview .jstree-last {
background-image: url("../img/32px.png");
background-position: -292px -4px;
background-repeat: repeat-y;
}
#treeview .jstree-children:before,
#treeview .jstree-children:after {
content: " ";
display: table;
}
#treeview .jstree-children:after {
clear: both;
}
#treeview .jstree-children:before,
#treeview .jstree-children:after {
content: " ";
display: table;
}
#treeview .jstree-children:after {
clear: both;
}
#treeview .jstree-themeicon {
display: none;
}
/*去除bootstrap-table的边框*/
.fixed-table-container {
border: none!important;
}
.note-editor .note-editing-area .note-editable {
display: block !important;
}
.pjax-loader-bar .progress {
position: fixed;
top: 0;
left: 0;
height: 2px;
background: #77b6ff;
box-shadow: 0 0 10px rgba(119, 182, 255, 0.7);
-webkit-transition: width 0.4s ease;
transition: width 0.4s ease;
}
.dropdown-menu.text-left a,
.dropdown-menu.text-left li {
text-align: left!important;
}
.bootstrap-table .fixed-table-toolbar .dropdown-menu {
overflow: visible;
}
.bootstrap-table table tbody tr:first-child td .bs-checkbox {
vertical-align: middle;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
overflow: auto;
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-webkit-background-clip: padding-box;
-moz-border-radius: 0 6px 6px 6px;
-moz-background-clip: padding;
border-radius: 0 6px 6px 6px;
background-clip: padding-box;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-webkit-background-clip: padding-box;
-moz-border-radius: 6px 0 6px 6px;
-moz-background-clip: padding;
border-radius: 6px 0 6px 6px;
background-clip: padding-box;
}
/*重写toast的几个背景色*/
.toast-primary {
background-color: #48c9b0!important;
}
.toast-success {
background-color: #18bc9c!important;
}
.toast-error {
background-color: #e74c3c!important;
}
.toast-info {
background-color: #5dade2!important;
}
.toast-warning {
background-color: #f1c40f!important;
}
.toast-inverse {
background-color: #34495e!important;
}
.toast-default {
background-color: #bdc3c7!important;
}
#toast-container > div,
#toast-container > div:hover {
-webkit-box-shadow: 0 0 3px #eee;
-moz-box-shadow: 0 0 3px #eee;
box-shadow: 0 0 3px #eee;
}
.layui-layer-title {
background: #2c3e50!important;
color: #fff!important;
}
/*避免出现多滚动条*/
.layui-layer-noborder {
border: none!important;
box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important;
}
.layui-layer-moves {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.layui-layer-iframe {
overflow: hidden!important;
}
.layui-layer-iframe .layui-layer-content {
-webkit-overflow-scrolling: touch;
overflow-y: hidden!important;
overflow: hidden;
}
/*自定义底部灰色操作区*/
.layui-layer-btn {
text-align: center!important;
padding: 10px!important;
background: #ecf0f1;
}
.layui-layer-footer {
padding: 8px 20px;
background-color: #ecf0f1;
height: auto;
text-align: inherit!important;
}
.layui-layer-btn a {
background-color: #95a5a6!important;
border-color: #95a5a6!important;
color: #fff!important;
}
.layui-layer-btn .layui-layer-btn0 {
background-color: #18bc9c!important;
border-color: #18bc9c!important;
}
.layui-layer-setwin {
top: 10px!important;
}
.layui-layer-setwin > a {
background: none!important;
}
.layui-layer-setwin > a cite {
display: none;
}
.layui-layer-setwin > a:after {
content: "\e625";
font-family: iconfont;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
position: absolute;
font-size: 18px;
color: #fff;
margin: 0;
z-index: 1;
}
.layui-layer-setwin > a:hover {
text-decoration: none!important;
background: none!important;
}
.layui-layer-setwin > a:focus {
text-decoration: none!important;
}
.layui-layer-setwin .layui-layer-min:after {
content: "\e625";
}
.layui-layer-setwin .layui-layer-max:after {
content: "\e623";
}
.layui-layer-setwin .layui-layer-maxmin:after {
content: "\e624";
}
.layui-layer-setwin .layui-layer-close1:after {
content: "\e626";
}
.layui-layer-setwin .layui-layer-close2,
.layui-layer-setwin .layui-layer-close2:hover {
background: url('../libs/layer/build/skin/default/icon.png') no-repeat -149px -31px !important;
}
.layui-layer-setwin .layui-layer-close2:after,
.layui-layer-setwin .layui-layer-close2:hover:after {
display: none;
}
@media (min-width: 768px) {
.form-inline .form-control {
padding-right: 20px;
}
}
/*手机版样式*/
@media (max-width: 480px) {
.nav-addtabs {
display: none;
}
}
/*平板样式*/
/*# sourceMappingURL=backend.css.map */
\ No newline at end of file
... ...
body {
background: #f1f4f6;
}
.selection {
position: absolute;
border: 1px solid #8B9;
background-color: #BEC;
}
.note-dialog .modal {
z-index: 1060;
}
.bootstrap-dialog .modal-dialog {
/*width: 70%;*/
max-width: 885px;
}
#header {
background: #fff;
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.05);
}
.content-wrapper {
position: relative;
}
.tab-addtabs {
overflow: hidden;
}
.tab-addtabs .tab-pane {
height: 100%;
width: 100%;
}
/*
* RIBBON
*/
#ribbon {
overflow: hidden;
padding: 15px 15px 0 15px;
position: relative;
}
#ribbon a {
color: #777 !important;
text-decoration: none !important;
}
#ribbon .breadcrumb {
display: inline-block;
margin: 0;
padding: 0;
background: none;
vertical-align: top;
}
#ribbon .breadcrumb > .active,
#ribbon .breadcrumb li:last-child {
color: #aaa;
}
#ribbon .shortcut a {
margin-left: 10px;
}
.is-dialog #main {
background: #fff;
}
.is-dialog form label {
font-weight: normal;
}
/*panel扩展描述样式*/
.panel-intro {
margin-bottom: 0;
border: none;
}
.panel-intro .panel-heading {
padding: 15px;
padding-bottom: 0;
background: #e8edf0;
border-color: #e8edf0;
position: relative;
}
.panel-intro .panel-heading .panel-lead {
margin-bottom: 15px;
}
.panel-intro .panel-heading .panel-lead em {
display: block;
font-weight: bold;
font-style: normal;
}
.panel-intro .panel-heading .panel-title {
height: 25px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.panel-intro .panel-heading .panel-control {
height: 42px;
position: absolute;
top: 8px;
right: 8px;
}
.panel-intro .panel-heading .panel-control .fa {
font-size: 14px;
}
.panel-intro .panel-heading .nav-tabs {
border-bottom: 0;
margin-bottom: 0;
}
.panel-intro .panel-heading .nav-tabs > li > a {
margin-right: 4px;
color: #95a5a6;
background-color: #d8e0e6;
border: 1px solid #e8edf0;
border-bottom-color: transparent;
}
.panel-intro .panel-heading .nav-tabs > li > a:hover,
.panel-intro .panel-heading .nav-tabs > li > a:focus {
border: 1px solid #e8edf0;
color: #7b8a8b;
background-color: #c9d4dc;
}
.panel-intro .panel-heading .nav-tabs > li.active > a,
.panel-intro .panel-heading .nav-tabs > li.active > a:hover,
.panel-intro .panel-heading .nav-tabs > li.active > a:focus {
color: #7b8a8b;
background-color: #ffffff;
border-bottom-color: transparent;
cursor: default;
}
/*单表格*/
.panel-tabs .panel-heading {
padding: 12px 15px 12px 15px;
}
.panel-tabs .panel-heading .panel-lead {
margin-bottom: 0px;
}
/*选项卡*/
.panel-nav .panel-heading {
padding: 0px;
padding-bottom: 0;
background: #f1f4f6;
border-color: #f1f4f6;
}
.panel-nav .nav-tabs > li > a {
padding: 12px 15px;
background-color: #e8edf0;
border: 1px solid #f1f4f6;
}
.panel-nav .nav-tabs > li > a:hover,
.panel-nav .nav-tabs > li > a:focus {
border: 1px solid #e8edf0;
background-color: #e8edf0;
}
.panel-nav .nav-tabs > li.active > a,
.panel-nav .nav-tabs > li.active > a:hover,
.panel-nav .nav-tabs > li.active > a:focus {
border-color: #f1f4f6;
border-bottom-color: transparent;
}
/*顶栏addtabs*/
.nav-addtabs {
border: none;
}
.nav-addtabs > li {
margin: 0;
}
.nav-addtabs > li > a {
height: 49px;
line-height: 49px;
padding: 0 15px;
border-radius: 0;
border: none;
border-right: 1px solid rgba(0, 0, 0, 0.05);
margin: 0;
color: #95a5a6;
}
.nav-addtabs > li > a:hover,
.nav-addtabs > li > a:focus {
border: none;
color: #2c3e50;
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.nav-addtabs > li > a i {
margin-right: 3px;
}
.nav-addtabs > li.active > a {
height: 49px;
line-height: 49px;
padding: 0 15px;
border-radius: 0;
border: none;
border-right: 1px solid rgba(0, 0, 0, 0.05);
background: #f1f4f6;
color: #2c3e50;
overflow: hidden;
}
.nav-addtabs > li.active > a:hover,
.nav-addtabs > li.active > a:focus {
border: none;
color: #2c3e50;
border-right: 1px solid rgba(0, 0, 0, 0.05);
background: #f1f4f6;
}
.nav-addtabs > li .close-tab {
font-size: 10px;
position: absolute;
right: 5px;
top: 50%;
margin-top: -7px;
z-index: 100;
cursor: hand;
cursor: pointer;
color: #fff;
display: none;
}
.nav-addtabs .open > a:hover,
.nav-addtabs .open > a:focus {
border-right: 1px solid rgba(0, 0, 0, 0.05);
}
.nav-addtabs ul li {
position: relative;
}
.nav-addtabs li:hover > .close-tab {
display: block;
}
#treeview .jstree-container-ul .jstree-node {
display: block;
clear: both;
}
#treeview .jstree-leaf:not(:first-child) {
float: left;
background: none;
margin-left: 0;
width: 80px;
clear: none;
color: #BBBDC3;
}
#treeview .jstree-leaf {
float: left;
margin-left: 0;
padding-left: 24px;
width: 80px;
clear: none;
color: #ccc;
}
#treeview .jstree-leaf > .jstree-icon,
#treeview .jstree-leaf .jstree-themeicon {
display: none;
}
#treeview .jstree-last {
background-image: url("../img/32px.png");
background-position: -292px -4px;
background-repeat: repeat-y;
}
#treeview .jstree-children:before,
#treeview .jstree-children:after {
content: " ";
display: table;
}
#treeview .jstree-children:after {
clear: both;
}
#treeview .jstree-children:before,
#treeview .jstree-children:after {
content: " ";
display: table;
}
#treeview .jstree-children:after {
clear: both;
}
#treeview .jstree-themeicon {
display: none;
}
/*去除bootstrap-table的边框*/
.fixed-table-container {
border: none!important;
}
.pjax-loader-bar .progress {
position: fixed;
top: 0;
left: 0;
height: 2px;
background: #77b6ff;
box-shadow: 0 0 10px rgba(119, 182, 255, 0.7);
-webkit-transition: width 0.4s ease;
transition: width 0.4s ease;
}
.dropdown-menu.text-left a,
.dropdown-menu.text-left li {
text-align: left!important;
}
.bootstrap-table .fixed-table-toolbar .dropdown-menu {
overflow: visible;
}
.bootstrap-table table tbody tr:first-child td .bs-checkbox {
vertical-align: middle;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
overflow: auto;
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
-webkit-border-radius: 0 6px 6px 6px;
-webkit-background-clip: padding-box;
-moz-border-radius: 0 6px 6px 6px;
-moz-background-clip: padding;
border-radius: 0 6px 6px 6px;
background-clip: padding-box;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-webkit-background-clip: padding-box;
-moz-border-radius: 6px 0 6px 6px;
-moz-background-clip: padding;
border-radius: 6px 0 6px 6px;
background-clip: padding-box;
}
/*重写toast的几个背景色*/
.toast-primary {
background-color: #48c9b0!important;
}
.toast-success {
background-color: #2ecc71!important;
}
.toast-error {
background-color: #e74c3c!important;
}
.toast-info {
background-color: #5dade2!important;
}
.toast-warning {
background-color: #f1c40f!important;
}
.toast-inverse {
background-color: #34495e!important;
}
.toast-default {
background-color: #bdc3c7!important;
}
.layui-layer-title {
background: #2c3e50!important;
color: #fff!important;
}
/*避免出现多滚动条*/
.layui-layer-noborder {
border: none!important;
box-shadow: 1px 1px 50px rgba(0, 0, 0, 0.3) !important;
}
.layui-layer-moves {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.layui-layer-iframe {
overflow: hidden!important;
}
.layui-layer-iframe .layui-layer-content {
-webkit-overflow-scrolling: touch;
overflow-y: hidden!important;
overflow: hidden;
}
/*自定义底部灰色操作区*/
.layui-layer-btn {
text-align: center!important;
padding: 10px!important;
background: #ecf0f1;
}
.layui-layer-footer {
padding: 8px 20px;
background-color: #ecf0f1;
height: auto;
text-align: inherit!important;
}
.layui-layer-btn a {
background-color: #95a5a6!important;
border-color: #95a5a6!important;
color: #fff!important;
}
.layui-layer-btn .layui-layer-btn0 {
background-color: #18bc9c!important;
border-color: #18bc9c!important;
}
.layui-layer-setwin {
top: 10px!important;
}
.layui-layer-setwin > a {
background: none!important;
}
.layui-layer-setwin > a cite {
display: none;
}
.layui-layer-setwin > a:after {
content: "\e625";
font-family: iconfont;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
position: absolute;
font-size: 18px;
color: #fff;
margin: 0;
z-index: 1;
}
.layui-layer-setwin > a:hover {
text-decoration: none!important;
background: none!important;
}
.layui-layer-setwin > a:focus {
text-decoration: none!important;
}
.layui-layer-setwin .layui-layer-min:after {
content: "\e625";
}
.layui-layer-setwin .layui-layer-max:after {
content: "\e623";
}
.layui-layer-setwin .layui-layer-maxmin:after {
content: "\e624";
}
.layui-layer-setwin .layui-layer-close1:after {
content: "\e626";
}
/*手机版样式*/
@media (max-width: 480px) {
.nav-addtabs {
display: none;
}
}
/*平板样式*/
/*# sourceMappingURL=frontend-func.css.map */
\ No newline at end of file
... ... @@ -5,4 +5,4 @@
@import url("../libs/font-awesome/css/font-awesome.min.css");
@import url("../libs/toastr/toastr.min.css");
@import url("../libs/layer/build/skin/default/layer.css");
@import url("../css/frontend-func.css");
\ No newline at end of file
/*# sourceMappingURL=frontend.css.map */
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($, undefined, Toastr, Layer, Lang, Config) {
define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'moment'], function ($, undefined, Toastr, Layer, Lang, Moment) {
var Backend = {
config: {
//toastr默认配置
... ... @@ -7,7 +7,7 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-center",
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
... ... @@ -234,13 +234,46 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($
badgeList[$url] = $nums > 0 ? '<small class="' + $class + ' pull-right bg-' + $color + '">' + $nums + '</small>' : '';
});
$.each(badgeList, function (k, v) {
var anchor = $(".treeview li a[addtabs][url='" + k + "']");
var anchor = top.window.$(".treeview li a[addtabs][url='" + k + "']");
if (anchor) {
$(".pull-right-container", anchor).html(v);
$(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v);
top.window.$(".pull-right-container", anchor).html(v);
top.window.$(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v);
}
});
},
addtabs: function (url, title, icon) {
var dom = ".sidebar-menu li a[url='{url}']"
var leftlink = top.window.$(dom.replace(/\{url\}/, url));
if (leftlink.size() > 0) {
leftlink.trigger("click");
} else {
url = Backend.api.fixurl(url);
leftlink = top.window.$(dom.replace(/\{url\}/, url));
if (leftlink.size() > 0) {
var event = leftlink.parent().hasClass("active") ? "dblclick" : "click";
leftlink.trigger(event);
} else {
var baseurl = url.substr(0, url.indexOf("?") > -1 ? url.indexOf("?") : url.length);
leftlink = top.window.$(dom.replace(/\{url\}/, baseurl));
//能找到相对地址
if (leftlink.size() > 0) {
icon = typeof icon != 'undefined' ? icon : leftlink.find("i").attr("class");
title = typeof title != 'undefined' ? title : leftlink.find("span:first").text();
leftlink.trigger("fa.event.toggleitem");
}
var navnode = $(".nav-tabs ul li a[node-url='" + url + "']");
if (navnode.size() > 0) {
navnode.trigger("click");
} else {
//追加新的tab
var id = Math.floor(new Date().valueOf() * Math.random());
icon = typeof icon != 'undefined' ? icon : 'fa fa-circle-o';
title = typeof title != 'undefined' ? title : '';
top.window.$("<a />").append('<i class="' + icon + '"></i> <span>' + title + '</span>').prop("href", url).attr({url: url, addtabs: id}).appendTo(top.window.document.body).trigger("click");
}
}
}
},
success: function (options, callback) {
var type = typeof options === 'function';
if (type) {
... ... @@ -309,13 +342,17 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($
},
init: function () {
//公共代码
//配置Toastr的参数
Toastr.options = Backend.config.toastr;
//点击包含.btn-dialog的元素时弹出dialog
$(document).on('click', '.btn-dialog', function (e) {
$(document).on('click', '.btn-dialog,.dialogit', function (e) {
Backend.api.open(Backend.api.fixurl($(this).attr('href')), $(this).attr('title'));
e.preventDefault();
});
//支持data-bind-url方式进行渲染select元素
$(document).on('click', '.btn-addtabs,.addtabsit', function (e) {
Backend.api.addtabs($(this).attr("href"), $(this).attr("title"));
e.preventDefault();
});
}
};
//将Layer暴露到全局中去
... ... @@ -326,9 +363,9 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($
window.__ = Backend.lang;
//将Backend渲染至全局,以便于在子框架中调用
window.Backend = Backend;
//Toastr定义
Toastr.options = Backend.config.toastr;
//将Moment方法暴露到全局中去
window.Moment = Moment;
Backend.init();
return Backend;
});
\ No newline at end of file
... ...
... ... @@ -33,7 +33,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
{field: 'ismenu', title: __('Ismenu'), align: 'left'},
{field: 'weigh', title: __('Weigh')},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status},
{field: 'id', title: '<a href="javascript:;" class="btn btn-primary btn-xs btn-toggle"><i class="fa fa-chevron-down"></i></a>', formatter: Controller.api.formatter.subnode},
{field: 'id', title: '<a href="javascript:;" class="btn btn-primary btn-xs btn-toggle"><i class="fa fa-chevron-down"></i></a>', operate: false, formatter: Controller.api.formatter.subnode},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
... ... @@ -93,7 +93,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
Form.api.bindevent($("form[role=form]"));
$(document).on('click', ".btn-search-icon", function () {
if (iconlist.length == 0) {
$.get(requirejs.s.contexts._.config.config.config.site.cdnurl + "/assets/libs/font-awesome/less/variables.less", function (ret) {
$.get(Config.site.cdnurl + "/assets/libs/font-awesome/less/variables.less", function (ret) {
var exp = /fa-var-(.*):/ig;
var result;
while ((result = exp.exec(ret)) != null) {
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'example/bootstraptable/index',
add_url: '',
edit_url: '',
del_url: 'example/bootstraptable/del',
multi_url: '',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
columns: [
[
{field: 'state', checkbox: true, },
{field: 'id', title: 'ID', operate: false},
//使用Table.api.formatter.search可直接响应搜索
{field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
{field: 'title', title: __('Title')},
{field: 'url', title: __('Url'), align: 'left', formatter: Controller.api.formatter.url},
//点击IP时同时执行搜索此IP
{field: 'ip', title: __('IP'), events: Controller.api.events.ip, formatter: Controller.api.formatter.ip},
//browser是一个不存在的字段
//通过formatter来渲染数据,同时为它添加上事件
{field: 'browser', title: __('Browser'), operate: false, events: Controller.api.events.browser, formatter: Controller.api.formatter.browser},
{field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD HH:mm:ss"'},
//我们向操作栏额外添加上一个详情按钮,并保留已有的编辑和删除控制,同时为这个按钮添加上点击事件
{field: 'operate', title: __('Operate'), events: Controller.api.events.operate, formatter: Controller.api.formatter.operate}
],
],
//禁用默认搜索
search: false,
//启用普通表单搜索
commonSearch: true,
//可以控制是否默认显示搜索单表,false则隐藏,默认为true
searchFormVisible: true
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
},
formatter: {
url: function (value, row, index) {
return '<div class="input-group input-group-sm" style="width:250px;"><input type="text" class="form-control input-sm" value="' + value + '"><span class="input-group-btn input-group-sm"><a href="' + value + '" target="_blank" class="btn btn-default btn-sm"><i class="fa fa-link"></i></a></span></div>';
},
ip: function (value, row, index) {
return '<a class="btn btn-xs btn-ip bg-success"><i class="fa fa-map-marker"></i> ' + value + '</a>';
},
browser: function (value, row, index) {
//这里我们直接使用row的数据
return '<a class="btn btn-xs btn-browser">' + row.useragent.split(" ")[0] + '</a>';
},
operate: function (value, row, index) {
//返回字符串加上Table.api.formatter.operate的结果
//默认需要按需显示排序/编辑/删除按钮,则需要在Table.api.formatter.operate将table传入
//传入了table以后如果edit_url为空则不显示编辑按钮,如果del_url为空则不显显删除按钮
return '<a class="btn btn-info btn-xs btn-detail">' + __('Detail') + '</a> '
+ Table.api.formatter.operate(value, row, index, $("#table"));
},
},
events: {
ip: {
'click .btn-ip': function (e, value, row, index) {
var options = $("#table").bootstrapTable('getOptions');
//这里我们手动将数据填充到表单然后提交
$("#commonSearchContent_" + options.idTable + " form input[name='ip']").val(value);
$("#commonSearchContent_" + options.idTable + " form").trigger('submit');
Toastr.info("执行了自定义搜索操作");
}
},
browser: {
'click .btn-browser': function (e, value, row, index) {
Layer.alert("该行数据为: <code>" + JSON.stringify(row) + "</code>");
}
},
operate: $.extend({
'click .btn-detail': function (e, value, row, index) {
Backend.api.open('example/bootstraptable/detail/ids/' + row['id'], __('Detail'));
}
}, Table.api.events.operate)
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'example/colorbadge/index',
add_url: '',
edit_url: '',
del_url: 'example/colorbadge/del',
multi_url: '',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
columns: [
[
{field: 'state', checkbox: true, },
{field: 'id', title: 'ID'},
{field: 'title', title: __('Title')},
{field: 'ip', title: __('IP')},
{field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
],
onLoadSuccess: function (data) {
// 在表格第次加载成功后,刷新左侧菜单栏彩色小角标,支持一次渲染多个
// 如果需要在进入后台即显示左侧的彩色小角标,请使用服务端渲染方式,详情修改application/admin/controller/Index.php
Backend.api.sidebar({
'example/colorbadge': data.total
});
Toastr.info("左侧角标已经刷新成功");
}
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Form.api.bindevent($("form[role=form]"));
},
edit: function () {
Form.api.bindevent($("form[role=form]"));
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'example/controllerjump/index',
add_url: '',
edit_url: '',
del_url: 'example/controllerjump/del',
multi_url: '',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
columns: [
[
{field: 'state', checkbox: true, },
{field: 'id', title: 'ID'},
{field: 'admin_id', title: __('Admin_id')},
{field: 'title', title: __('Title')},
{field: 'ip', title: __('IP'), formatter: Controller.api.formatter.ip},
{field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Form.api.bindevent($("form[role=form]"));
},
edit: function () {
Form.api.bindevent($("form[role=form]"));
},
api: {
formatter: {
ip: function (value, row, index) {
//这里手动构造URL
url = "example/bootstraptable?" + this.field + "=" + value;
//方式一,直接返回class带有addtabsit的链接,这可以方便自定义显示内容
return '<a href="' + url + '" class="label label-success addtabsit" title="' + __("Search %s", value) + '">' + __('Search %s', value) + '</a>';
//方式二,直接调用Table.api.formatter.addtabs
return Table.api.formatter.addtabs(value, row, index, url);
}
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
$("#cxselect-example .col-xs-12").each(function () {
$("textarea", this).val($(this).prev().prev().html().replace(/[ ]{2}/g, ''));
});
//这里需要手动为Form绑定上元素事件
Form.api.bindevent($("form#cxselectform"));
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init();
// 表格1
var table1 = $("#table1").bootstrapTable({
url: 'general/configvalue/index',
extend: {
index_url: 'general/configvalue/index',
add_url: 'general/configvalue/add',
edit_url: 'general/configvalue/edit',
del_url: 'general/configvalue/del',
multi_url: 'general/configvalue/multi',
table: 'configvalue',
},
toolbar: '#toolbar1',
sortName: 'weigh',
search: false,
columns: [
[
{field: 'state', checkbox: true, },
{field: 'id', title: 'ID'},
{field: 'name', title: __('Name')},
{field: 'weigh', title: __('Weigh')},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格1绑定事件
Table.api.bindevent(table1);
// 表格2
var table2 = $("#table2").bootstrapTable({
url: 'general/crontab/index',
extend: {
index_url: 'general/crontab/index',
add_url: 'general/crontab/add',
edit_url: 'general/crontab/edit',
del_url: 'general/crontab/del',
multi_url: 'general/crontab/multi',
table: 'crontab',
},
toolbar: '#toolbar2',
sortName: 'weigh',
search: false,
columns: [
[
{field: 'state', checkbox: true, },
{field: 'id', title: 'ID'},
{field: 'type', title: __('Type')},
{field: 'title', title: __('Title')},
{field: 'maximums', title: __('Maximums')},
{field: 'executes', title: __('Executes')},
{field: 'begintime', title: __('Begin time'), formatter: Table.api.formatter.datetime},
{field: 'endtime', title: __('End time'), formatter: Table.api.formatter.datetime},
{field: 'executetime', title: __('Execute time'), formatter: Table.api.formatter.datetime},
{field: 'weigh', title: __('Weigh')},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格2绑定事件
Table.api.bindevent(table2);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
},
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'example/relationmodel/index',
add_url: '',
edit_url: '',
del_url: 'example/relationmodel/del',
multi_url: '',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
columns: [
[
{field: 'state', checkbox: true, },
{field: 'id', title: 'ID', operate: '='},
{field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'},
{field: 'admin.avatar', title: __('Avatar'), operate: false, formatter: Table.api.formatter.image},
{field: 'admin.username', title: __('Username'), operate: '='},
{field: 'admin.nickname', title: __('Nickname'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'},
{field: 'ip', title: __('IP'), operate: '='},
{field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
],
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Form.api.bindevent($("form[role=form]"));
},
edit: function () {
Form.api.bindevent($("form[role=form]"));
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'form', 'table', 'config'], function ($, undefined, Backend, Form, Table, Config) {
define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
var Controller = {
index: function () {
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function ($, undefined, Backend, Table, Form, Upload) {
var Controller = {
index: function () {
... ... @@ -26,8 +26,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
[
{field: 'id', title: 'ID'},
{field: 'title', title: __('Title')},
{field: 'content', title: __('Content'), align: 'left'},
{field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
{field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url},
{field: 'ip', title: __('ip')},
{field: 'username', title: __('Userame')},
{field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime},
]
... ... @@ -39,8 +39,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Form.api.bindevent($("#update-form"), null, function () {
$("input[name='row[password]']").val('');
var url = Config.upload.cdnurl + $("#c-avatar").val();
top.window.$(".user-panel .image img,.user-menu > a > img,.user-header > img").prop("src", url);
return true;
});
Upload.api.custom.changeavatar = function (response) {
var url = Config.upload.cdnurl + response.url;
$(".profile-user-img").prop("src", url);
};
console.log(Upload);
}
};
return Controller;
... ...
define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], function ($, undefined, Backend, undefined, AdminLTE, Form, Validator) {
define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], function ($, undefined, Backend, undefined, AdminLTE, Form) {
var Controller = {
index: function () {
//窗口大小改变,修正主窗体最小高度
... ... @@ -83,7 +83,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], f
});
//切换左侧sidebar显示隐藏
$(document).on("click", ".sidebar-menu li > a", function (e) {
$(document).on("click fa.event.toggleitem", ".sidebar-menu li > a", function (e) {
$(".sidebar-menu li").removeClass("active");
//当外部触发隐藏的a时,触发父辈a的事件
if (!$(this).closest("ul").is(":visible")) {
... ... @@ -141,11 +141,10 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], f
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
$(".tab-addtabs").addClass("ios-iframe-fix");
}
if (location.hash.indexOf("#!") === 0) {
var url = decodeURIComponent(location.hash.substring(2));
//刷新页面后将左侧对应的LI展开
$("ul.sidebar-menu a[href='" + url + "']").trigger("click");
if (Config.referer) {
//刷新页面后跳到到刷新前的页面
Backend.api.addtabs(Config.referer);
} else {
$("ul.sidebar-menu li.active a").trigger("click");
}
... ... @@ -205,7 +204,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], f
$("body").addClass(cls);
store('skin', cls);
var cssfile = requirejs.s.contexts._.config.config.config.upload.cdnurl + "/assets/css/skins/" + cls + ".css";
var cssfile = Config.upload.cdnurl + "/assets/css/skins/" + cls + ".css";
$('head').append('<link rel="stylesheet" href="' + cssfile + '" type="text/css" />');
}
return false;
... ... @@ -323,26 +322,8 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'validator'], f
$(window).resize();
},
login: function () {
$("#login-form").validator({
timely: 2, theme: 'yellow_right_effect',
fields: {
username: "required",
password: "required",
},
valid: function (form) {
form.submit();
}
});
$.ajax({
url: 'ajax/dailybg',
dataType: 'json',
success: function (ret) {
if (ret.code === 1) {
$("body").css("background", "url(" + ret.data.url + ")");
$("body").css("background-size", "cover");
}
}
Form.api.bindevent($("#login-form"), null, function () {
location.href = Backend.api.fixurl("index/index");
});
}
};
... ...
... ... @@ -25,7 +25,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'state', checkbox: true},
{field: 'id', title: __('Id'), operate: false},
{field: 'category_id', title: __('Category_id'), operate: '='},
{field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '标题,模糊搜索,*表示任意字符', style: 'width:200px',
{field: 'title', title: __('Title'),
operate: 'LIKE %...%',
placeholder: '标题,模糊搜索,*表示任意字符',
style: 'width:200px',
process: function (value, arg) {
return value.replace(/\*/g, '%'); //仅演示用法
}
... ... @@ -37,9 +40,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'views', title: __('Views'), operate: false},
{field: 'comments', title: __('Comments'), operate: false},
{field: 'weigh', title: __('Weigh'), operate: false},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {'normal': '正常', 'hidden': '隐藏'}, style: 'min-width:100px;'},
{field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {'normal': __('Normal'), 'hidden': __('Hidden')}, style: 'min-width:100px;'},
{field: 'createtime', title: __('Create Time'), formatter: Table.api.formatter.datetime, operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker', data: 'data-date-format="YYYY-MM-DD"'},
{field: 'operate', title: __('Operate'), events: Table.api.events.operate, formatter: Table.api.formatter.operate}
{field: 'operate', title: __('Operate'), events: Controller.api.events.operate, formatter: Controller.api.formatter.operate}
]
],
//普通搜索
... ... @@ -80,6 +83,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
},
});
Form.api.bindevent($("form[role=form]"));
},
formatter: {
operate: function (value, row, index) {
return '<a class="btn btn-info btn-xs btn-detail">' + __('Detail') + '</a> ' + Table.api.formatter.operate(value, row, index);
},
},
events: {
operate: $.extend({
'click .btn-detail': function (e, value, row, index) {
Backend.api.open("page/detail/" + value, __('Detail'));
}
}, Table.api.events.operate)
}
}
};
... ...
/**
* @author: aperez <aperez@datadec.es>
* @version: v2.0.0
*
* @update Dennis Hernández <http://djhvscf.github.io/Blog>
*/
!function ($) {
'use strict';
var firstLoad = false;
var sprintf = $.fn.bootstrapTable.utils.sprintf;
var showAvdSearch = function (pColumns, that) {
var searchTitle = that.options.formatAdvancedSearch();
if (!$("#avdSearchModal" + "_" + that.options.idTable).hasClass("modal")) {
var vModal = sprintf("<div id=\"avdSearchModal%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">", "_" + that.options.idTable);
vModal += "<div class=\"modal-dialog modal-xs\">";
vModal += " <div class=\"modal-content\">";
vModal += " <div class=\"modal-header\">";
vModal += " <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" >&times;</button>";
vModal += sprintf(" <h4 class=\"modal-title\">%s</h4>", searchTitle);
vModal += " </div>";
vModal += " <div class=\"modal-body modal-body-custom\">";
vModal += sprintf(" <div class=\"container-fluid\" id=\"avdSearchModalContent%s\" style=\"padding-right: 0px;padding-left: 0px;\" >", "_" + that.options.idTable);
vModal += " </div>";
vModal += " </div>";
vModal += " <div class=\"modal-footer\">";
vModal += createFormBtn(that).join('');
vModal += " </div>";
vModal += " </div>";
vModal += " </div>";
vModal += "</div>";
$("body").append($(vModal));
var vFormAvd = createFormAvd(pColumns, that),
timeoutId = 0;
;
$('#avdSearchModalContent' + "_" + that.options.idTable).append(vFormAvd.join(''));
if (that.options.sidePagination != 'server' || !that.options.url) {
$('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
that.onColumnAdvancedSearch(event);
}, that.options.searchTimeOut);
});
} else {
}
// 提交搜索
$("#btnSubmitAvd" + "_" + that.options.idTable).click(function (event) {
that.onColumnAdvancedSearch();
});
// 重置搜索
$("#btnResetAvd" + "_" + that.options.idTable).click(function () {
$("#avdSearchModal" + "_" + that.options.idTable + " form")[0].reset();
that.onColumnAdvancedSearch();
});
$("#avdSearchModal" + "_" + that.options.idTable).modal();
} else {
$("#avdSearchModal" + "_" + that.options.idTable).modal();
}
};
var createFormAvd = function (pColumns, that) {
var htmlForm = [];
var opList = ['=', '>', '>=', '<', '<=', '!=', 'LIKE', 'LIKE %...%', 'NOT LIKE', 'IN(...)', 'NOT IN(...)', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL'];
var selectList = [];
for (var i = 0; i < opList.length; i++) {
selectList.push("<option value='" + opList[i] + "'>" + opList[i] + "</option>");
}
var selectHtml = selectList.join('');
htmlForm.push(sprintf('<form class="form-horizontal" id="%s" action="%s" >', that.options.idForm, that.options.actionForm));
for (var i in pColumns) {
var vObjCol = pColumns[i];
if (!vObjCol.checkbox && vObjCol.field != 'operate' && vObjCol.visible && vObjCol.searchable) {
htmlForm.push('<div class="form-group">');
htmlForm.push(sprintf('<label class="col-sm-3 control-label">%s</label>', vObjCol.title));
if (that.options.sidePagination == 'server' && that.options.url) {
htmlForm.push('<div class="col-sm-2">');
htmlForm.push(sprintf('<select class="form-control" name="field-%s" data-name="%s">%s</select>', vObjCol.field, vObjCol.field, selectHtml));
htmlForm.push('</div>');
}
htmlForm.push('<div class="col-sm-6">');
if (vObjCol.searchList) {
if (typeof vObjCol.searchList == 'function') {
htmlForm.push(vObjCol.searchList.call(this, vObjCol));
} else {
var isArray = vObjCol.searchList.constructor === Array;
var searchList = [];
searchList.push(sprintf('<option value="">%s</option>', $.fn.bootstrapTable.locales.formatAdvancedChoose()));
$.each(vObjCol.searchList, function (key, value) {
searchList.push("<option value='" + (isArray ? value : key) + "'>" + value + "</option>");
});
htmlForm.push(sprintf('<select class="form-control" name="%s">%s</select>', vObjCol.field, searchList.join('')));
}
} else {
htmlForm.push(sprintf('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">', vObjCol.field, vObjCol.title, vObjCol.field));
}
htmlForm.push('</div>');
htmlForm.push('</div>');
}
}
htmlForm.push('</form>');
return htmlForm;
};
var createFormBtn = function (that) {
var htmlBtn = [];
var searchSubmit = that.options.formatAdvancedSubmitButton();
var searchReset = that.options.formatAdvancedResetButton();
var searchClose = that.options.formatAdvancedCloseButton();
htmlBtn.push('<div class="form-group">');
htmlBtn.push('<div class="col-sm-12 text-center">');
if (that.options.sidePagination == 'server' && that.options.url) {
htmlBtn.push(sprintf('<button type="button" id="btnSubmitAvd%s" class="btn btn-success" >%s</button> ', "_" + that.options.idTable, searchSubmit));
htmlBtn.push(sprintf('<button type="button" id="btnResetAvd%s" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchReset));
} else {
htmlBtn.push(sprintf('<button type="button" id="btnCloseAvd%s" data-dismiss="modal" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchClose));
}
htmlBtn.push('</div>');
htmlBtn.push('</div>');
return htmlBtn;
};
$.extend($.fn.bootstrapTable.defaults, {
advancedSearch: false,
idForm: 'advancedSearch',
actionForm: '',
idTable: undefined,
onColumnAdvancedSearch: function (field, text) {
return false;
}
});
$.extend($.fn.bootstrapTable.defaults.icons, {
advancedSearchIcon: 'glyphicon-search'
});
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
});
$.extend($.fn.bootstrapTable.locales, {
formatAdvancedSearch: function () {
return 'Advanced search';
},
formatAdvancedSubmitButton: function () {
return "Submit";
},
formatAdvancedResetButton: function () {
return "Reset";
},
formatAdvancedCloseButton: function () {
return "Close";
},
formatAdvancedChoose: function () {
return "Choose";
}
});
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
var BootstrapTable = $.fn.bootstrapTable.Constructor,
_initToolbar = BootstrapTable.prototype.initToolbar,
_load = BootstrapTable.prototype.load,
_initSearch = BootstrapTable.prototype.initSearch;
BootstrapTable.prototype.initToolbar = function () {
_initToolbar.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.search) {
return;
}
if (!this.options.advancedSearch) {
return;
}
if (!this.options.idTable) {
return;
}
var that = this,
html = [];
html.push(sprintf('<div class="columns columns-%s btn-group pull-%s" role="group">', this.options.buttonsAlign, this.options.buttonsAlign));
html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="advancedSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatAdvancedSearch()));
html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.advancedSearchIcon))
html.push('</button></div>');
that.$toolbar.prepend(html.join(''));
that.$toolbar.find('button[name="advancedSearch"]')
.off('click').on('click', function () {
showAvdSearch(that.columns, that);
});
};
BootstrapTable.prototype.load = function (data) {
_load.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.advancedSearch) {
return;
}
if (typeof this.options.idTable === 'undefined') {
return;
} else {
if (!firstLoad) {
var height = parseInt($(".bootstrap-table").height());
height += 10;
$("#" + this.options.idTable).bootstrapTable("resetView", {height: height});
firstLoad = true;
}
}
};
BootstrapTable.prototype.initSearch = function () {
_initSearch.apply(this, Array.prototype.slice.apply(arguments));
if (!this.options.advancedSearch) {
return;
}
var that = this;
var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
this.data = fp ? $.grep(this.data, function (item, i) {
for (var key in fp) {
var fval = fp[key].toLowerCase();
var value = item[key];
value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
that.header.formatters[$.inArray(key, that.header.fields)],
[value, item, i], value);
if (!($.inArray(key, that.header.fields) !== -1 &&
(typeof value === 'string' || typeof value === 'number') &&
(value + '').toLowerCase().indexOf(fval) !== -1)) {
return false;
}
}
return true;
}) : this.data;
};
BootstrapTable.prototype.onColumnAdvancedSearch = function (event) {
if (typeof event == 'undefined') {
var op = {};
var filter = {};
$("#avdSearchModalContent_" + this.options.idTable + " select").each(function () {
var name = $(this).data("name");
var sym = $(this).val();
var obj = $("[name='" + name + "']");
if (obj.size() == 0)
return true;
var value = obj.size() > 1 ? $("[name='" + name + "']:checked").val() : obj.val();
if (value == '' && sym.indexOf("NULL") == -1) {
return true;
}
op[name] = sym;
filter[name] = value;
});
// 追加查询关键字
this.options.pageNumber = 1;
this.options.queryParams = function (params) {
return {
search: params.search,
sort: params.sort,
order: params.order,
filter: JSON.stringify(filter),
op: JSON.stringify(op),
offset: params.offset,
limit: params.limit,
};
};
this.refresh({query: {filter: JSON.stringify(filter), op: JSON.stringify(op)}});
} else {
var text = $.trim($(event.currentTarget).val());
var $field = $(event.currentTarget)[0].id;
if ($.isEmptyObject(this.filterColumnsPartial)) {
this.filterColumnsPartial = {};
}
if (text) {
this.filterColumnsPartial[$field] = text;
} else {
delete this.filterColumnsPartial[$field];
}
this.options.pageNumber = 1;
this.onSearch(event);
// this.updatePagination();
this.trigger('column-advanced-search', $field, text);
}
};
}(jQuery);