diff --git a/application/admin/controller/AuthGroup.php b/application/admin/controller/AuthGroup.php index 7e70e7f9..8073c7c4 100644 --- a/application/admin/controller/AuthGroup.php +++ b/application/admin/controller/AuthGroup.php @@ -13,7 +13,6 @@ class AuthGroup extends Base // 角色列表 public function index() { - // 设置要给模板赋值的信息 $list['webtitle'] = '角色列表'; @@ -134,16 +133,22 @@ class AuthGroup extends Base // 修改角色信息 public function edit($id) { + // 获取单位信息 + $list['data'] = AG::field('id,title,miaoshu,rules') + ->find($id); - // 获取角色信息 - $list = AG::field('id,title,miaoshu,rules') - ->get($id); - $list->rules = explode(',',$list->rules); - + // 设置页面标题 + $list['set'] = array( + 'webtitle'=>'编辑角色', + 'butname'=>'修改', + 'formpost'=>'PUT', + 'url'=>'/authgroup/'.$id, + ); + // 模板赋值 $this->assign('list',$list); - - return $this->fetch(); + // 渲染 + return $this->fetch('create'); } diff --git a/application/admin/view/auth_group/create.html b/application/admin/view/auth_group/create.html index e297d009..13dc5e88 100644 --- a/application/admin/view/auth_group/create.html +++ b/application/admin/view/auth_group/create.html @@ -16,8 +16,8 @@ *角色描述
- +
{php} @@ -27,14 +27,26 @@
{volist name="authrulelist" id="vo"}
- +
{volist name="vo.auth_cid" id="vc"}
- + {volist name="vc.auth_cid" id="vd"} - + {/volist}
{/volist} @@ -68,8 +80,8 @@ case 'midOnclick': midOnclick(id,pid,ischecked); break; - case 'btmClick': - cjgl.add('添加单位','/school/create','650','500'); + case 'btmOnclick': + btmOnclick(id,ischecked); break; }; }); @@ -79,13 +91,23 @@ function topOnclick(id,ischecked) { if(ischecked == true){ + // 更换全部子复选框样式 $('#'+id).parent().next().find('div.layui-form-checkbox').each(function(){ - $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked') + $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked'); + }); + // 全部子复选框 + $('#'+id).parent().next().find('input').each(function(){ + $(this).attr('checked',true); }); }else{ + // 更换全部子复选框样式 $('#'+id).parent().next().find('div.layui-form-checkbox').each(function(){ $(this).attr('class','layui-unselect layui-form-checkbox') }); + // 取消全部子复选框 + $('#'+id).parent().next().find('input').each(function(){ + $(this).attr('checked',false); + }); } } @@ -93,31 +115,64 @@ function midOnclick(id,pid,ischecked) { if(ischecked == true){ + + // 更换上级复选框样式 $('#'+id).parent().parent().prev().find('div.layui-form-checkbox').each(function(){ $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked') }); + // 选中上级复选框 + $('#'+id).parent().parent().prev().find('input').each(function(){ + $(this).attr('checked',true); + }); + + // 更换全部下级复选框样式 $('#'+id).siblings('div.layui-form-checkbox').each(function(){ - $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked') + $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked'); + }); + // 选中全部下级复选框 + $('#'+id).siblings('input').each(function(){ + $(this).attr('checked',true); }); }else{ - // $('#'+id).parent().parent().prev().find('div.layui-form-checkbox').each(function(){ - // $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked') - // }); + // 更换所有下级复选框样式 $('#'+id).siblings('div.layui-form-checkbox').each(function(){ $(this).attr('class','llayui-unselect layui-form-checkbox') }); - var checkboxs = $('#'+id).parent().parent().find('div.layui-form-checkbox').lenght; - - each(function(){ - $(this).attr('class','layui-unselect layui-form-checkbox layui-form-checked') + // 取消选中所有下级复选框 + $('#'+id).siblings('input').each(function(){ + $(this).attr('checked',false) }); + + // 如果所有属于上级的复框为未状态,则取消选中上级复选框 + var checkboxs = $('#'+id).parent().parent().find('div.layui-form-checked').length; + if(checkboxs == 0){ + // 更换样式 + $('#'+id).parent().parent().prev().find('div.layui-form-checkbox').each(function(){ + $(this).attr('class','layui-unselect layui-form-checkbox') + }); + // 取消选中 + $('#'+id).parent().parent().prev().find('input').each(function(){ + $(this).attr('checked',false) + }); + } } } + // 下层按钮 + function btmOnclick(id,ischecked) + { + if(ischecked == true){ + // 设置上级复选框为状态 + $('#'+id).parent().children('div.layui-form-checkbox').first().attr('class','layui-unselect layui-form-checkbox layui-form-checked'); + // 选中上级复选框 + $('#'+id).parent().children('input').first().attr('checked',true); - - - + // 设置上级的上级复选框为状态 + $('#'+id).parent().parent().prev().children('div.layui-form-checkbox').first().attr('class','layui-unselect layui-form-checkbox layui-form-checked'); + // 选中上级的上级复选框 + $('#'+id).parent().parent().prev().children('input').first().attr('checked',true); + } + } {/block} diff --git a/application/admin/view/auth_group/edit.html b/application/admin/view/auth_group/edit.html deleted file mode 100644 index 28d7e125..00000000 --- a/application/admin/view/auth_group/edit.html +++ /dev/null @@ -1,138 +0,0 @@ -{extend name="common@create" /} -{block name="formaa"} -
-
- -
- -
-
-
- -
- -
-
-
- -
- {php} - $rule = new app\admin\model\AuthRule;; - $plist = $rule->getRule(); - {/php} - {volist name="plist" id="p"} -
-
- -
- {php} - $clist = $rule->getRule($p['id']); - {/php} -
- - {volist name = "clist" id = "c"} -
-
- -
- {php} - $slist = $rule->getRule($c['id']); - {/php} -
- {volist name="slist" id="s"} - - {/volist} -
-
- {/volist} - -
-
- {/volist} - -
-
-
-
- -
-
-
-{/block} -{block name="yanzheng"} - -{/block} \ No newline at end of file diff --git a/application/system/view/category/edit1.html b/application/system/view/category/edit1.html new file mode 100644 index 00000000..47a8ea8f --- /dev/null +++ b/application/system/view/category/edit1.html @@ -0,0 +1,68 @@ +{extend name="common@create" /} +{block name="formaa"} + +
+
+ +
+ +
+
+
+ +
+ + {php} $ctp = getCategory();{/php} + + +
+
+
+ +
+ +
+
+
+
+ +
+
+
+{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/system/view/category/index1.html b/application/system/view/category/index1.html new file mode 100644 index 00000000..f2c1ab80 --- /dev/null +++ b/application/system/view/category/index1.html @@ -0,0 +1,122 @@ +{extend name="common@list" /} +{block name="topnav"} + +{/block} +{block name="bouttons"} +
+ + + + + 批量删除 + + + + + 添加类别 + + + + 共有数据:{$list.count} 条 + +
+{/block} +{block name="tables"} + + + + + + + + + + + + + +
名称父级类别排序状态操作
+ + +{/block} +{block name="myjs"} + +{/block} \ No newline at end of file