Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
page
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
87c505c1
authored
2018-03-29 20:07:33 +0800
by
wang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
537bd78f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
124 deletions
application/views/perm/roleEdit.php
application/views/perm/roleEdit.php
deleted
100644 → 0
View file @
537bd78
<?php
$this
->
load
->
view
(
'common/header'
);
?>
<body>
<div
class=
"panel panel-default"
>
<form
action=
"system/role/update"
id=
"edit"
>
<input
type=
"hidden"
value=
"
<?=
$id
?>
"
name=
"id"
>
<div
class=
"panel-body"
>
<div
class=
"row cl"
>
<!--<div class="form-group col-sm-3 col-md-2">
<label>所属网点</label>
<span class="form-control select-box">
<select class="select" size="1">
<option selected value>请选择</option>
</select>
</span>
</div>-->
<div
class=
"form-group col-sm-3 col-md-2"
>
<label>
角色
</label>
<input
type=
"text"
name=
"nameZh"
class=
"form-control input-text"
value=
"
<?=
$item
->
nameZh
?>
"
>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-3 col-md-2"
>
<label>
菜单权限地图
</label>
<ul
id=
"tree"
class=
"ztree"
></ul>
</div>
</div>
</div>
</div>
<div
class=
"row cl pt-20 pb-20 col-sm-12"
>
<div
class=
"col-sm-offset-4 col-sm-2"
>
<button
class=
"btn btn-primary btn-block"
onclick=
"save()"
>
保存
</button>
</div>
<div
class=
"col-sm-2"
>
<button
class=
"btn btn-warning btn-block"
onclick=
"layer_close()"
>
取消
</button>
</div>
</div>
</form>
<?php
$this
->
load
->
view
(
'common/footer'
);
?>
<script>
var setting = {
async: {
enable: true,
// url: '
<?
//=site_url('/perm/organization')?>//',
url
:
'<?=site_url('
/
perm
/
menu
')?>'
,
autoParam
:
[
"id"
]
},
check
:
{
enable
:
true
},
data
:
{
simpleData
:
{
enable
:
true
}
}
};
var
code
;
function
setCheck
()
{
var
zTree
=
$
.
fn
.
zTree
.
getZTreeObj
(
"tree"
),
type
=
{
"Y"
:
"ps"
,
"N"
:
"ps"
};
zTree
.
setting
.
check
.
chkboxType
=
type
;
}
$
(
document
)
.
ready
(
function
(){
$
.
fn
.
zTree
.
init
(
$
(
"#tree"
),
setting
);
setCheck
();
});
function
save
()
{
//获得款中的节点
var
treeObj
=
$
.
fn
.
zTree
.
getZTreeObj
(
"tree"
);
// console.log(treeObj);
var
nodes
=
treeObj
.
getCheckedNodes
(
true
);
var
menuIds
=
[];
console
.
log
(
nodes
);
$
.
each
(
nodes
,
function
(
i
,
v
)
{
menuIds
.
push
(
v
.
id
);
});
console
.
log
(
menuIds
);
var
targetUrl
=
$
(
"#edit"
)
.
attr
(
"action"
);
var
data
=
$
(
"#edit"
)
.
serializeJson
();
var
newData
=
{
nameZh
:
data
[
'nameZh'
],
id
:
data
[
'id'
],
menuIds
:
menuIds
};
$
.
ajax
({
type
:
'put'
,
url
:
apiBaseUrl
+
targetUrl
,
cache
:
false
,
data
:
JSON
.
stringify
(
newData
),
dataType
:
'json'
,
contentType
:
"application/json; charset=UTF-8"
,
success
:
function
(
data
)
{
// console.log(data);
if
(
data
.
msg
)
{
layer
.
alert
(
data
.
msg
);
}
else
if
(
data
.
code
!=
0
)
{
layer
.
alert
(
'操作失败'
);
}
else
{
layer
.
msg
(
'操作成功'
);
}
if
(
data
.
code
)
{
setTimeout
(
function
()
{
window
.
parent
.
reload
();
layer_close
();
},
500
);
}
},
error
:
function
()
{
layer
.
alert
(
"操作失败"
)
}
});
// layer_close();
}
</
script
>
</
body
>
<
html
>
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment