Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
6435afd8
Commit
6435afd8
authored
Jan 24, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限3
parent
76774be4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
192 additions
and
7 deletions
+192
-7
Auth.php
application/index/controller/Auth.php
+9
-3
auth_rule_index.html
application/index/view/auth/auth_rule_index.html
+91
-0
index.html
application/index/view/auth/index.html
+1
-1
navigation.html
application/index/view/global/navigation.html
+1
-1
AuthRule.php
application/model/AuthRule.php
+12
-1
route.php
application/route.php
+2
-1
auth_rule_index.js
public/resource/js/auth_rule_index.js
+45
-0
auth_rule_index_template_tpl.html
public/resource/template/auth_rule_index_template_tpl.html
+31
-0
No files found.
application/index/controller/Auth.php
View file @
6435afd8
...
...
@@ -210,8 +210,13 @@ class Auth extends Basic
parent
::
setStatus
(
$model
);
}
//权限表界面
public
function
authRuleIndex
(){
return
view
(
'auth_rule_index'
);
}
//权限列表
public
function
authList
(){
public
function
auth
Rule
List
(){
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
...
...
@@ -225,10 +230,11 @@ class Auth extends Basic
$where
=
'a.status=1'
;
$order
=
'a.pid asc,a.sort asc'
;
$join
=
[[
'auth_rule b'
,
' a.pid=b.id'
,
'left'
]];
$list
=
$table
->
authList
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'list'
]
=
$table
->
authRuleList
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'total'
]
=
$table
->
getTotal
(
'status=1'
);
// prt($list);//转化arr
//prt(collection($list)->toArray());//转化arr
return
$this
->
response
(
200
,
'成功'
,
$
list
);
return
$this
->
response
(
200
,
'成功'
,
$
data
);
}
...
...
application/index/view/auth/auth_rule_index.html
0 → 100644
View file @
6435afd8
{layout name="global/frame_tpl" /}
<!--关联js元素-->
<input
type=
"hidden"
class=
"page-load"
id=
"auth_rule_index"
/>
<!--关联js元素-->
<style>
.ids
{
position
:
absolute
;
top
:
-20%
;
left
:
-20%
;
display
:
block
;
width
:
140%
;
height
:
140%
;
margin
:
0px
;
padding
:
0px
;
background
:
rgb
(
255
,
255
,
255
)
none
repeat
scroll
0%
0%
;
border
:
0px
none
;
opacity
:
0
;}
ins
{
position
:
absolute
;
top
:
-20%
;
left
:
-20%
;
display
:
block
;
width
:
140%
;
height
:
140%
;
margin
:
0px
;
padding
:
0px
;
background
:
rgb
(
255
,
255
,
255
)
none
repeat
scroll
0%
0%
;
border
:
0px
none
;
opacity
:
0
;}
</style>
<div
id=
"pjax-container"
class=
"content-wrapper"
style=
"min-height: 1426px; width: 1035px; float: left; margin-left: 20px;"
>
<section
class=
"content-header"
>
<!-- 面包屑导航 -->
<ol
class=
"breadcrumb"
>
<li><a
href=
"#"
><i
class=
"fa fa-dashboard"
></i>
</a><a
href=
"/admin.php/admin/dashboard/index.html"
>
首页
</a></li>
<li
class=
"active"
>
规则管理
</li>
</ol>
</section>
<!--内容-->
<section
class=
"content"
>
<div
class=
"box box-solid"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
规则管理
</h3>
<div
class=
"box-tools pull-right"
>
<button
onclick=
"javascript:location.reload();"
class=
"btn btn-box-tool f16"
type=
"button"
><i
class=
"fa fa-refresh"
></i></button>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"builder listbuilder-box"
>
<div
class=
"builder-toolbar mt-10 mb-20"
>
<div
class=
"row"
>
<div
class=
"col-xs-12 col-sm-12 button-list clearfix"
>
<!-- 工具栏按钮 -->
<!--<div class="form-group">-->
<a
href=
"/admin.php/admin/auth/ruleedit/pid/0.html"
class=
"btn btn-primary btn-sm"
title=
"新增"
>
新增
</a>
<a
href=
"/admin.php/admin/auth/setstatus/status/resume/model/auth_rule.html"
model=
"auth_rule"
class=
"btn btn-success ajax-post confirm btn-sm"
target-form=
"ids"
title=
"启用"
>
启用
</a>
<a
href=
"/admin.php/admin/auth/setstatus/status/forbid/model/auth_rule.html"
model=
"auth_rule"
class=
"btn btn-warning ajax-post confirm btn-sm"
target-form=
"ids"
title=
"禁用"
>
禁用
</a>
<a
href=
"/admin.php/admin/auth/setstatus/status/delete/model/auth_rule.html"
model=
"auth_rule"
class=
"btn btn-danger ajax-post confirm btn-sm"
target-form=
"ids"
title=
"删除"
>
删除
</a>
<!--<a onclick="move_menuparent()" title="<i class="fa fa-exchange"></i> 移动位置" class="btn btn-info btn-sm" target-form="ids"><i class="fa fa-exchange"></i> 移动位置</a> -->
<!--<a model="auth_rule" href="/admin.php/admin/auth/rule_sort/pid/0.html" class="btn btn-info btn-sm" name="排序" title="<i class="fa fa-sort"></i> 排序"><i class="fa fa-sort"></i> 排序</a> -->
<!--<!– </div>–>-->
</div>
</div>
<!--row-->
</div>
<!-- 数据列表 -->
<div
class=
"builder-container"
>
<div
class=
"row"
>
<div
class=
"builder-table col-sm-12"
>
<table
class=
"table table-responsive table-bordered table-hover dataTable"
>
<thead>
<tr>
<th
width=
"50"
class=
"checkbox-toggle"
><div
class=
"icheckbox_minimal-blue"
style=
"position: relative;"
aria-checked=
"false"
aria-disabled=
"false"
><input
type=
"checkbox"
class=
"check-all"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"
><ins
class=
"iCheck-helper"
style=
"position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"
></ins></div>
<!-- <span class="checkbox-toggle" style="color:#ddd;font-size:23px;cursor:pointer;"><i class="fa fa-square-o"></i></span> -->
</th>
<th>
ID
</th>
<th>
名称
</th>
<th>
上级菜单
</th>
<th>
URL
</th>
<th>
来源标识
</th>
<th>
排序
</th>
<th>
菜单
</th>
<th>
状态
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody
id=
"auth_rule_list"
>
</tbody>
</table>
<!-- 列表底部按钮 -->
<!--<div class="form-group">-->
<!-- </div>-->
<div
class=
"paginations"
id=
"pagediv"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
application/index/view/auth/index.html
View file @
6435afd8
{layout name="global/frame_tpl" /}
<h4>
权限
管理
</h4>
<h4>
角色
管理
</h4>
<a
href=
"/index/roleedit"
>
添加角色
</a>
...
...
application/index/view/global/navigation.html
View file @
6435afd8
...
...
@@ -37,7 +37,7 @@
<a
href=
"/admin.php/index/auth.html"
>
角色管理
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/auth
List
.html"
>
权限管理
</a>
<a
href=
"/admin.php/index/auth
RuleIndex
.html"
>
权限管理
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/houseList.html"
>
商铺列表
</a>
...
...
application/model/AuthRule.php
View file @
6435afd8
...
...
@@ -27,7 +27,18 @@ class AuthRule extends Model
*
*
*/
public
function
authList
(
$p
=
1
,
$pageSize
=
20
,
$order_
=
''
,
$field
=
''
,
$join
=
''
,
$where
=
''
){
/**
* 记录总数
*
* @param $params
* @return int|string
*/
public
function
getTotal
(
$params
)
{
return
$this
->
where
(
$params
)
->
count
();
}
public
function
authRuleList
(
$p
=
1
,
$pageSize
=
20
,
$order_
=
''
,
$field
=
''
,
$join
=
''
,
$where
=
''
){
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
$join
)
...
...
application/route.php
View file @
6435afd8
...
...
@@ -82,7 +82,8 @@ Route::group('index', [
'addAuth'
=>
[
'index/auth/addAuth'
,
[
'method'
=>
'post'
]],
//添加角色
'accessLook'
=>
[
'index/auth/accessLook'
,
[
'method'
=>
'post'
]],
//查看编辑角色权限
'setStatus'
=>
[
'index/auth/setStatus'
,
[
'method'
=>
'post'
]],
//设置角色的状态
'authList'
=>
[
'index/auth/authList'
,
[
'method'
=>
'get'
]],
//权限列表
'authRuleIndex'
=>
[
'index/auth/authRuleIndex'
,
[
'method'
=>
'get'
]],
//权限列表界面
'authRuleList'
=>
[
'index/auth/authRuleList'
,
[
'method'
=>
'get'
]],
//权限列表
'accessUser'
=>
[
'index/auth/accessUser'
,
[
'method'
=>
'get'
]],
//成员授权
'BusinessDistrict'
=>
[
'index/BusinessDistrict/index'
,
[
'method'
=>
'get'
]],
//商圈列表
'editBusinessDistrict'
=>
[
'index/BusinessDistrict/edit'
,
[
'method'
=>
'get | post'
]],
//编辑商圈
...
...
public/resource/js/auth_rule_index.js
0 → 100644
View file @
6435afd8
define
([
'doT'
,
'text!temp/auth_rule_index_template_tpl.html'
,
'css!style/home.css'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
authRule
=
{
pageNo
:
1
,
pageSize
:
15
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
authRule
.
getList
();
authRule
.
event
();
},
event
:
function
()
{
},
getList
:
function
(
pageNo
){
authRule
.
pageNo
=
pageNo
;
var
params
=
{};
params
.
pageNo
=
authRule
.
pageNo
;
params
.
pageSize
=
authRule
.
pageSize
;
$
.
ajax
({
url
:
'/index/AuthRulelist.html'
,
type
:
'GET'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'auth_rule_index_tpl'
).
innerHTML
;
var
doTempl
=
doT
.
template
(
temp
);
$
(
"#auth_rule_list"
).
html
(
doTempl
(
data
.
data
.
list
));
/*分页代码*/
$
(
"#pagediv"
).
pagination
({
length
:
data
.
data
.
total
,
current
:
pageNo
,
every
:
authRule
.
pageSize
,
onClick
:
function
(
el
)
{
authRule
.
getList
(
el
.
num
.
current
);
}
});
}
})
}
}
return
authRule
;
});
\ No newline at end of file
public/resource/template/auth_rule_index_template_tpl.html
0 → 100644
View file @
6435afd8
<script
id=
"auth_rule_index_tpl"
type=
"text/template"
>
[
%
if
(
it
)
{
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
>
<
td
><
div
class
=
"icheckbox_minimal-blue"
style
=
"position: relative;"
aria
-
checked
=
"false"
aria
-
disabled
=
"false"
>
<
input
type
=
"checkbox"
name
=
"ids[]"
value
=
"1"
class
=
"ids"
style
=
""
>
<
ins
class
=
"iCheck-helper "
style
=
""
>
<
/ins
>
<
/div
>
<
/td
>
<
td
>
[
%=
it
[
item
][
"id"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"title"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"name2"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"depend_flag"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"sort"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"is_menu"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"status"
]
%
]
<
/td
>
<
td
><
span
class
=
"fa fa-check text-success"
><
/span></
td
>
<
td
>
<
a
style
=
"margin-right:6px;"
href
=
""
class
=
"btn btn-primary btn-xs"
title
=
"编辑"
>
编辑
<
/a
>
<
a
style
=
"margin-right:6px;"
href
=
""
class
=
"btn btn-warning btn-xs ajax-get confirm"
title
=
"禁用"
>
禁用
<
/a
>
<
/td
>
<
/tr
>
[
%
}
%
]
[
%
}
else
{
%
]
<
tr
>
<
td
colspan
=
"8"
style
=
"text-align:center;"
>
暂无数据
<
/td
>
<
/tr
>
[
%
}
%
]
</script>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment