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
b0b04bce
Commit
b0b04bce
authored
Jan 24, 2018
by
zfcaa
Committed by
zfc
Jan 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑4
parent
d73e0781
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
14 deletions
+59
-14
Auth.php
application/index/controller/Auth.php
+30
-2
auth_rule_box.html
application/index/view/auth/auth_rule_box.html
+2
-2
role_edit.html
application/index/view/auth/role_edit.html
+3
-3
auth_rule_box.js
public/resource/js/auth_rule_box.js
+1
-1
role_edit.js
public/resource/js/role_edit.js
+18
-1
auth_rule_index_template_tpl.html
public/resource/template/auth_rule_index_template_tpl.html
+2
-2
auth_template_tpl.html
public/resource/template/auth_template_tpl.html
+3
-3
No files found.
application/index/controller/Auth.php
View file @
b0b04bce
...
...
@@ -102,7 +102,7 @@ class Auth extends Basic
$data
[
'msg'
]
=
''
;
$title
=
$group_id
?
'编辑'
:
'新增'
;
$table
=
New
AuthGroup
();
$info
=
$table
->
find
();
if
(
empty
(
$group_id
))
{
$data
=
input
(
'post.'
);
...
...
@@ -126,6 +126,7 @@ class Auth extends Basic
}
}
else
{
$info
=
$table
->
where
(
"id=
{
$group_id
}
"
)
->
find
();
return
$this
->
response
(
200
,
$title
,
$info
);
...
...
@@ -236,7 +237,7 @@ class Auth extends Basic
}
//编辑权限窗口
public
function
AuthRuleBox
(){
public
function
AuthRuleBox
(
$id
=
0
){
return
view
(
'auth_rule_box'
);
}
//分类列表
...
...
@@ -252,6 +253,33 @@ class Auth extends Basic
//prt(collection($data['list'])->toArray());//转化arr
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
//新增编辑权限
public
function
updateAuthRule
(
$group_id
=
0
){
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$title
=
$group_id
?
'编辑'
:
'新增'
;
$table
=
New
AuthGroup
();
if
(
IS_POST
)
{
$data
=
input
(
'post.'
);
$id
=
isset
(
$data
[
'id'
])
&&
$data
[
'id'
]
>
0
?
$data
[
'id'
]
:
false
;
//新增或者编辑数据
if
(
$table
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
101
,
'失败'
);
}
}
else
{
$info
=
$table
->
findById
(
$group_id
);
return
$this
->
response
(
200
,
$title
,
$info
);
}
}
...
...
application/index/view/auth/auth_rule_box.html
View file @
b0b04bce
...
...
@@ -26,7 +26,7 @@
<div
class=
"form-group item_title "
>
<label
class=
"col-md-2 control-label"
for=
"title"
>
标题
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
value=
"
仪表盘
"
name=
"title"
class=
"form-control"
>
<input
type=
"text"
value=
""
name=
"title"
class=
"form-control"
>
</div>
<div
class=
"col-md-5 help-block"
><i
class=
"fa fa-info-circle color-info1"
></i>
用于后台显示的配置标题
</div></div>
...
...
@@ -73,7 +73,7 @@
<div
class=
"form-group item_name "
>
<label
class=
"col-md-2 control-label"
for=
"name"
>
链接
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
value=
"
admin/dashboard/index
"
name=
"name"
class=
"form-control"
>
<input
type=
"text"
value=
""
name=
"name"
class=
"form-control"
>
</div>
<div
class=
"col-md-5 help-block"
><i
class=
"fa fa-info-circle color-info1"
></i>
链接
</div></div>
...
...
application/index/view/auth/role_edit.html
View file @
b0b04bce
...
...
@@ -14,20 +14,20 @@
<div
class=
"builder formbuilder-box panel-body bg-color-fff"
>
<div
class=
"row"
>
<div
class=
"col-md-7"
>
<form
action=
"/index/addA
U
th"
method=
"post"
class=
"form-builder form-horizontal"
>
<form
action=
"/index/addA
u
th"
method=
"post"
class=
"form-builder form-horizontal"
>
<fieldset>
<!-- <input type="hidden" name="id" value="3">-->
<div
class=
"form-group"
>
<label
for=
"title"
class=
"col-md-2 control-label"
>
名称:
</label>
<div
class=
"col-md-10"
>
<input
type=
"text"
class=
"form-control"
name=
"title"
placeholder=
"创建的角色名称"
value=
"
普通用户
"
>
<input
type=
"text"
class=
"form-control"
name=
"title"
placeholder=
"创建的角色名称"
value=
""
>
<span
class=
"material-input"
></span>
</div>
</div>
<div
class=
"form-group item_description"
>
<label
for=
"description"
class=
"col-md-2 control-label"
>
描述:
</label>
<div
class=
"col-md-10"
>
<textarea
name=
"description"
class=
"form-control"
length=
"120"
rows=
"5"
>
这是普通用户的权限
</textarea>
<textarea
id=
"description"
name=
"description"
class=
"form-control"
length=
"120"
rows=
"5"
>
</textarea>
<span
class=
"material-input"
></span>
</div>
</div>
...
...
public/resource/js/auth_rule_box.js
View file @
b0b04bce
...
...
@@ -9,7 +9,7 @@ define (['doT', 'text!temp/auth_rule_box_template_tpl.html', 'css!style/home.css
event
:
function
()
{
},
getList
:
function
(
pageNo
){
getList
:
function
(){
$
.
ajax
({
url
:
'/index/AuthClass.html'
,
type
:
'GET'
,
...
...
public/resource/js/role_edit.js
View file @
b0b04bce
...
...
@@ -15,11 +15,28 @@ define (['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css','pagina
},
getList
:
function
(){
//ajax
$
(
"input[name = title]"
).
val
(
"1111"
);
var
id
=
getUrlParam
(
'id'
);
$
.
ajax
({
url
:
'/index/addAuth/group_id/'
+
id
,
type
:
'post'
,
async
:
true
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"input[name = title]"
).
val
(
data
.
data
.
title
);
$
(
"#description"
).
val
(
data
.
data
.
description
);
}
})
}
}
return
Role
;
});
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
decodeURI
(
window
.
location
.
search
).
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
}
public/resource/template/auth_rule_index_template_tpl.html
View file @
b0b04bce
...
...
@@ -3,7 +3,7 @@
[
%
for
(
var
item
in
it
){
%
]
<
tr
>
<
td
><
div
class
=
"icheckbox_minimal-blue"
style
=
""
aria
-
checked
=
"false"
aria
-
disabled
=
"false"
>
<
input
type
=
"checkbox"
name
=
"ids[]"
value
=
"1"
class
=
"ids"
style
=
""
>
<
!--<
input
type
=
"checkbox"
name
=
"ids[]"
value
=
"1"
class
=
"ids"
style
=
""
>--
>
<
/div
>
<
/td
>
<
td
>
[
%=
it
[
item
][
"id"
]
%
]
<
/td
>
...
...
@@ -15,7 +15,7 @@
<
td
>
[
%=
it
[
item
][
"status"
]
%
]
<
/td
>
<!--<
td
><
span
class
=
"fa fa-check text-success"
><
/span></
td
>-->
<
td
>
<
a
style
=
"margin-right:6px;"
href
=
"/index/authRuleBox
.html
/group_id/[%= it[item]['id'] %]"
class
=
"btn btn-primary btn-xs"
title
=
"编辑"
>
编辑
<
/a
>
<
a
style
=
"margin-right:6px;"
href
=
"/index/authRuleBox/group_id/[%= it[item]['id'] %]"
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
>
...
...
public/resource/template/auth_template_tpl.html
View file @
b0b04bce
...
...
@@ -11,9 +11,9 @@
<
/td
>
<
td
>
[
%=
it
[
item
][
"status"
]
%
]
<
/td
>
<
td
>
<
a
title
=
"编辑"
class
=
"btn btn-success btn-xs"
href
=
"/admin.php/index/roleedit?id=[%= it[item]['id']%]
.html
"
style
=
"margin-right:6px;"
>
编辑
<
/a
>
<
a
title
=
"权限分配"
class
=
"btn btn-info btn-xs"
href
=
"/admin.php/index/access?id=[%= it[item]['id']%]
.html
"
style
=
"margin-right:6px;"
>
权限分配
<
/a
>
<
a
title
=
"成员授权"
class
=
"btn btn-primary btn-xs"
href
=
"/admin.php/index/accessUser?id=[%= it[item]['id']%]
.html
"
style
=
"margin-right:6px;"
>
成员授权
<
/a
>
<
a
title
=
"编辑"
class
=
"btn btn-success btn-xs"
href
=
"/admin.php/index/roleedit?id=[%= it[item]['id']%]"
style
=
"margin-right:6px;"
>
编辑
<
/a
>
<
a
title
=
"权限分配"
class
=
"btn btn-info btn-xs"
href
=
"/admin.php/index/access?id=[%= it[item]['id']%]"
style
=
"margin-right:6px;"
>
权限分配
<
/a
>
<
a
title
=
"成员授权"
class
=
"btn btn-primary btn-xs"
href
=
"/admin.php/index/accessUser?id=[%= it[item]['id']%]"
style
=
"margin-right:6px;"
>
成员授权
<
/a
>
<
/td
>
<
/tr
>
[
%
}
%
]
...
...
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