Skip to content

Commit

Permalink
更新初始化配置数据,导航中的头部导航资源配置让人产生误解
Browse files Browse the repository at this point in the history
有朋友也建议资源和导航合并,这样也许更加让人可以理解一点

Signed-off-by: michael.z <mail@zhangxiao.org>
  • Loading branch information
michaelzx committed Mar 13, 2015
1 parent 41b6ee6 commit a87b14f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions database/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CREATE TABLE `cnvp_sys_nav` (

/*Data for the table `cnvp_sys_nav` */

insert into `cnvp_sys_nav`(`id`,`title`,`icon`,`url`,`target`,`pid`,`orderid`,`res_id`) values (1,'开始','icon-home',NULL,'mainFrame',0,10,1),(3,'系统','icon-cog',NULL,'mainFrame',0,10,2),(33,'组织结构','icon-sitemap',NULL,'mainFrame',3,2,48),(20,'模型生成','icon-code','Generator/model','mainFrame',2,10,82),(17,'欢迎使用','icon-send',NULL,'mainFrame',1,10,78),(18,'个人资料','icon-user',NULL,'mainFrame',1,10,79),(19,'修改密码','icon-key',NULL,'mainFrame',1,10,80),(2,'开发','icon-codepen',NULL,'mainFrame',0,10,81),(15,'12312312','312',NULL,'mainFrame',123,10,0),(21,'视图生成','icon-code','Generator/view','mainFrame',2,10,82),(22,'控制器生成','icon-code','Generator/controller','mainFrame',2,10,73),(23,'系统设置','icon-desktop',NULL,'mainFrame',3,1,3),(24,'导航菜单','icon-th-list',NULL,'mainFrame',3,6,73),(26,'文件管理','icon-file',NULL,'mainFrame',3,7,0),(25,'权限配置','icon-asterisk',NULL,'mainFrame',3,8,0),(27,'日志查询','icon-angle-double-right',NULL,'mainFrame',3,9,0),(32,'用户管理','icon-user',NULL,'mainFrame',3,3,54),(34,'角色管理','icon-group',NULL,'mainFrame',3,4,60),(35,'资源管理','icon-unlock-alt',NULL,'mainFrame',3,5,67);
insert into `cnvp_sys_nav`(`id`,`title`,`icon`,`url`,`target`,`pid`,`orderid`,`res_id`) values (1,'开始','icon-home',NULL,'mainFrame',0,10,88),(3,'系统','icon-cog',NULL,'mainFrame',0,10,89),(33,'组织结构','icon-sitemap',NULL,'mainFrame',3,2,48),(20,'模型生成','icon-code','Generator/model','mainFrame',2,10,82),(17,'欢迎使用','icon-send',NULL,'mainFrame',1,10,78),(18,'个人资料','icon-user',NULL,'mainFrame',1,10,79),(19,'修改密码','icon-key',NULL,'mainFrame',1,10,80),(2,'开发','icon-codepen',NULL,'mainFrame',0,10,90),(15,'12312312','312',NULL,'mainFrame',123,10,0),(21,'视图生成','icon-code','Generator/view','mainFrame',2,10,82),(22,'控制器生成','icon-code','Generator/controller','mainFrame',2,10,82),(23,'系统设置','icon-desktop',NULL,'mainFrame',3,1,3),(24,'导航菜单','icon-th-list',NULL,'mainFrame',3,6,73),(26,'文件管理','icon-file',NULL,'mainFrame',3,7,0),(27,'日志查询','icon-angle-double-right',NULL,'mainFrame',3,9,0),(32,'用户管理','icon-user',NULL,'mainFrame',3,3,54),(34,'角色管理','icon-group',NULL,'mainFrame',3,4,60),(35,'资源管理','icon-unlock-alt',NULL,'mainFrame',3,5,67);

/*Table structure for table `cnvp_sys_res` */

Expand All @@ -65,11 +65,11 @@ CREATE TABLE `cnvp_sys_res` (
`seq` int(11) DEFAULT '10' COMMENT '排序',
`type` tinyint(2) DEFAULT NULL COMMENT '1、actionKey;',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=88 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=91 DEFAULT CHARSET=utf8;

/*Data for the table `cnvp_sys_res` */

insert into `cnvp_sys_res`(`id`,`pid`,`cname`,`code`,`code_route`,`des`,`ak`,`seq`,`type`) values (1,0,'开始','start','start','开始',NULL,10,0),(2,0,'系统','system','system',NULL,NULL,10,0),(3,2,'系统设置','config','system:config',NULL,'/System',10,1),(47,2,'组织机构','dept','system:dept',NULL,NULL,10,0),(48,47,'首页','index','system:dept:index',NULL,'/Dept',10,1),(49,47,'抽取json数据','getlist','system:dept:getlist',NULL,'/Dept/getlist',10,1),(50,47,'创建','create','system:dept:create',NULL,'/Dept/create',10,1),(51,47,'更新','update','system:dept:update',NULL,'/Dept/update',10,1),(52,47,'删除','delete','system:dept:delete',NULL,'/Dept/delete',10,1),(53,2,'用户管理','user','system:user',NULL,NULL,10,0),(54,53,'列表','index','system:user:index',NULL,'/User',10,1),(55,53,'添加','create','system:user:create',NULL,'/User/create',10,1),(56,53,'修改','update','system:user:update',NULL,'/User/update',10,1),(57,53,'删除','delete','system:user:delete',NULL,'/User/delete',10,1),(58,53,'批量删除','deleteall','system:user:deleteall',NULL,'/User/deleteAll',10,1),(59,2,'角色管理','role','system:role',NULL,NULL,10,0),(60,59,'列表','index','system:role:index',NULL,'/Role',10,1),(61,59,'添加','create','system:role:create',NULL,'/Role/create',10,1),(62,59,'更新','update','system:role:update',NULL,'/Role/update',10,1),(63,59,'删除','delete','system:role:delete',NULL,'/Role/delete',10,1),(64,59,'批量删除','deleteAll','system:role:deleteAll',NULL,'/Role/deleteAll',10,1),(65,59,'抽取JSON数据','getlist','system:role:getlist',NULL,'/Role/getlist',10,1),(66,2,'资源管理','res','system:res',NULL,NULL,10,0),(67,66,'首页','index','system:res:index',NULL,'/Resource',10,1),(68,66,'添加','create','system:res:create',NULL,'/Role/create',10,1),(69,66,'更新','update','system:res:update',NULL,'/Resource/update',10,1),(70,66,'删除','delete','system:res:delete',NULL,'/Resource/delete',10,1),(71,66,'抽取JSON数据','getlist','system:res:getlist',NULL,'/Resource/getlist',10,1),(72,2,'导航管理','sysnav','system:sysnav',NULL,NULL,10,0),(73,72,'首页','index','system:sysnav:index',NULL,'/System/nav',10,1),(74,72,'添加','create','system:sysnav:create',NULL,'/System/nav_create',10,1),(75,72,'更新','update','system:sysnav:update',NULL,'/System/nav_update',10,1),(76,72,'删除','delete','system:sysnav:delete',NULL,'/System/nav_delete',10,1),(77,72,'保存排序','saveorder','system:sysnav:saveorder',NULL,'/System/save_order',10,1),(78,1,'欢迎使用','welcome','start:welcome',NULL,'/welcome',10,1),(79,1,'个人资料','profile','start:profile',NULL,'/profile',10,1),(80,1,'修改密码','password','start:password',NULL,'/password',10,1),(81,0,'开发','dev','dev',NULL,NULL,10,0),(82,81,'首页','index','dev:index',NULL,'/Generator',10,1),(83,81,'模型代码','model','dev:model',NULL,'/Generator/model_code',10,1),(84,81,'控制器代码','controller','dev:controller',NULL,'/Generator/controller_code',10,1),(85,81,'视图代码','view','dev:view',NULL,'/Generator/view_code',10,1),(86,59,'配置资源权限','set_res','system:role:set_res',NULL,'/Role/set_res',10,1),(87,0,'管理首页','frame','frame',NULL,'/',0,1);
insert into `cnvp_sys_res`(`id`,`pid`,`cname`,`code`,`code_route`,`des`,`ak`,`seq`,`type`) values (1,0,'开始','start','start','开始',NULL,10,0),(2,0,'系统','system','system',NULL,NULL,10,0),(3,2,'系统设置','config','system:config',NULL,'/System',10,1),(47,2,'组织机构','dept','system:dept',NULL,NULL,10,0),(48,47,'首页','index','system:dept:index',NULL,'/Dept',10,1),(49,47,'抽取json数据','getlist','system:dept:getlist',NULL,'/Dept/getlist',10,1),(50,47,'创建','create','system:dept:create',NULL,'/Dept/create',10,1),(51,47,'更新','update','system:dept:update',NULL,'/Dept/update',10,1),(52,47,'删除','delete','system:dept:delete',NULL,'/Dept/delete',10,1),(53,2,'用户管理','user','system:user',NULL,NULL,10,0),(54,53,'列表','index','system:user:index',NULL,'/User',10,1),(55,53,'添加','create','system:user:create',NULL,'/User/create',10,1),(56,53,'修改','update','system:user:update',NULL,'/User/update',10,1),(57,53,'删除','delete','system:user:delete',NULL,'/User/delete',10,1),(58,53,'批量删除','deleteall','system:user:deleteall',NULL,'/User/deleteAll',10,1),(59,2,'角色管理','role','system:role',NULL,NULL,10,0),(60,59,'列表','index','system:role:index',NULL,'/Role',10,1),(61,59,'添加','create','system:role:create',NULL,'/Role/create',10,1),(62,59,'更新','update','system:role:update',NULL,'/Role/update',10,1),(63,59,'删除','delete','system:role:delete',NULL,'/Role/delete',10,1),(64,59,'批量删除','deleteAll','system:role:deleteAll',NULL,'/Role/deleteAll',10,1),(65,59,'抽取JSON数据','getlist','system:role:getlist',NULL,'/Role/getlist',10,1),(66,2,'资源管理','res','system:res',NULL,NULL,10,0),(67,66,'首页','index','system:res:index',NULL,'/Resource',10,1),(68,66,'添加','create','system:res:create',NULL,'/Role/create',10,1),(69,66,'更新','update','system:res:update',NULL,'/Resource/update',10,1),(70,66,'删除','delete','system:res:delete',NULL,'/Resource/delete',10,1),(71,66,'抽取JSON数据','getlist','system:res:getlist',NULL,'/Resource/getlist',10,1),(72,2,'导航管理','sysnav','system:sysnav',NULL,NULL,10,0),(73,72,'首页','index','system:sysnav:index',NULL,'/System/nav',10,1),(74,72,'添加','create','system:sysnav:create',NULL,'/System/nav_create',10,1),(75,72,'更新','update','system:sysnav:update',NULL,'/System/nav_update',10,1),(76,72,'删除','delete','system:sysnav:delete',NULL,'/System/nav_delete',10,1),(77,72,'保存排序','saveorder','system:sysnav:saveorder',NULL,'/System/save_order',10,1),(78,1,'欢迎使用','welcome','start:welcome',NULL,'/welcome',10,1),(79,1,'个人资料','profile','start:profile',NULL,'/profile',10,1),(80,1,'修改密码','password','start:password',NULL,'/password',10,1),(81,0,'开发','dev','dev',NULL,NULL,10,0),(82,81,'首页','index','dev:index',NULL,'/Generator',10,1),(83,81,'模型代码','model','dev:model',NULL,'/Generator/model_code',10,1),(84,81,'控制器代码','controller','dev:controller',NULL,'/Generator/controller_code',10,1),(85,81,'视图代码','view','dev:view',NULL,'/Generator/view_code',10,1),(86,59,'配置资源权限','set_res','system:role:set_res',NULL,'/Role/set_res',10,1),(87,0,'管理首页','frame','frame',NULL,'/',0,1),(88,1,'头部导航','topnav','start:topnav',NULL,NULL,0,0),(89,2,'头部导航','topnav','system:topnav',NULL,NULL,0,0),(90,81,'头部导航','topnav','dev:topnav',NULL,NULL,0,0);

/*Table structure for table `cnvp_sys_role` */

Expand All @@ -95,11 +95,11 @@ CREATE TABLE `cnvp_sys_role_res` (
`role_id` int(11) DEFAULT NULL,
`res_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1330 DEFAULT CHARSET=utf8;
) ENGINE=MyISAM AUTO_INCREMENT=1334 DEFAULT CHARSET=utf8;

/*Data for the table `cnvp_sys_role_res` */

insert into `cnvp_sys_role_res`(`id`,`role_id`,`res_id`) values (1322,4,86),(1321,4,85),(1320,4,84),(1319,4,83),(1318,4,82),(1317,4,81),(1316,4,80),(1315,4,79),(1314,4,78),(1313,4,77),(1312,4,76),(1311,4,75),(1310,4,74),(1309,4,73),(1308,4,72),(1307,4,71),(1306,4,70),(1305,4,69),(1304,4,68),(1303,4,67),(1302,4,66),(1301,4,65),(1300,4,64),(1299,4,63),(1298,4,62),(1297,4,61),(1296,4,60),(1295,4,59),(1294,4,58),(1293,4,57),(1292,4,56),(1291,4,55),(1290,4,54),(1289,4,53),(1288,4,52),(1287,4,51),(1286,4,50),(1285,4,49),(1284,4,48),(1283,4,47),(1282,4,3),(1281,4,2),(1280,4,1),(1329,1,87),(1328,1,1),(1324,4,87);
insert into `cnvp_sys_role_res`(`id`,`role_id`,`res_id`) values (1322,4,86),(1321,4,85),(1320,4,84),(1319,4,83),(1318,4,82),(1317,4,81),(1316,4,80),(1315,4,79),(1314,4,78),(1313,4,77),(1312,4,76),(1311,4,75),(1310,4,74),(1309,4,73),(1308,4,72),(1307,4,71),(1306,4,70),(1305,4,69),(1304,4,68),(1303,4,67),(1302,4,66),(1301,4,65),(1300,4,64),(1299,4,63),(1298,4,62),(1297,4,61),(1296,4,60),(1295,4,59),(1294,4,58),(1293,4,57),(1292,4,56),(1291,4,55),(1290,4,54),(1289,4,53),(1288,4,52),(1287,4,51),(1286,4,50),(1285,4,49),(1284,4,48),(1283,4,47),(1282,4,3),(1281,4,2),(1280,4,1),(1329,1,87),(1333,1,88),(1324,4,87),(1330,1,78),(1331,1,79);

/*Table structure for table `cnvp_sys_user` */

Expand Down
7 changes: 6 additions & 1 deletion src/com/cnvp/paladin/controller/ResourceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void create(){
if(isPost()){
SysRes model =getModel(SysRes.class,"sysres");
if(model.save()){
refreshCodeRoute();
Map<String, Object> r = new HashMap<String, Object>();
r.put("success", true);
r.put("data", model.toNodeData());
Expand All @@ -37,6 +38,7 @@ public void update(){
if(isPost()){
SysRes model = getModel(SysRes.class,"sysres").set("id",id);
if(model.update()){
refreshCodeRoute();
Map<String, Object> r = new HashMap<String, Object>();
r.put("success", true);
r.put("data", model.toNodeData());
Expand Down Expand Up @@ -77,6 +79,10 @@ public void getlist(){
renderJson(nodes);
}
public void refresh(){
refreshCodeRoute();
redirect(getControllerKey());
}
private void refreshCodeRoute() {
List<SysRes> reslist = SysRes.dao.findAll();
Iterator<SysRes> it = reslist.iterator();
while (it.hasNext()) {
Expand All @@ -91,6 +97,5 @@ public void refresh(){
model.set("code_route", code_route);
model.update();
}
redirect(getControllerKey());
}
}

0 comments on commit a87b14f

Please sign in to comment.