Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
3b4afd98
Commit
3b4afd98
authored
Sep 06, 2020
by
季圣华
Browse files
优化角色分配按钮的功能
parent
37255a26
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/roleApp.html
deleted
100644 → 0
View file @
37255a26
<!DOCTYPE html>
<html>
<head>
<title>
角色对应应用
</title>
<meta
charset=
"utf-8"
>
<!-- 指定以IE8的方式来渲染 -->
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=EmulateIE8"
/>
<link
rel=
"shortcut icon"
href=
"/images/favicon.ico"
type=
"image/x-icon"
/>
<link
rel=
"stylesheet"
href=
"/js/bootstrap/css/bootstrap.min.css"
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/jsherp.css"
/>
<script
type=
"text/javascript"
src=
"/js/jquery-1.8.0.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui/themes/default/easyui.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/js/easyui/themes/icon.css"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"/css/common.css"
/>
<script
type=
"text/javascript"
src=
"/js/easyui/jquery.easyui.min.js"
></script>
<script
type=
"text/javascript"
src=
"/js/easyui/locale/easyui-lang-zh_CN.js"
></script>
<script
type=
"text/javascript"
src=
"/js/common/common.js"
></script>
</head>
<body>
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
</div>
<div>
<ul
id=
"tt"
></ul>
</div>
<script
type=
"text/javascript"
>
var
url_id
=
getUrlParam
(
'
id
'
);
//获取传值id(角色id)
var
type
=
"
RoleAPP
"
;
var
url
;
//定义链接地址
function
GetNode
(
ctype
)
{
var
node
=
$
(
'
#tt
'
).
tree
(
'
getChecked
'
);
var
cnodes
=
''
;
var
pnodes
=
''
;
var
prevNode
=
''
;
//保存上一步所选父节点
for
(
var
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
$
(
'
#tt
'
).
tree
(
'
isLeaf
'
,
node
[
i
].
target
))
{
cnodes
+=
'
[
'
+
node
[
i
].
id
+
'
]
'
;
var
pnode
=
$
(
'
#tt
'
).
tree
(
'
getParent
'
,
node
[
i
].
target
);
//获取当前节点的父节点
if
(
prevNode
!=
pnode
.
id
)
//保证当前父节点与上一次父节点不同
{
pnodes
+=
'
[
'
+
pnode
.
id
+
'
]
'
;
prevNode
=
pnode
.
id
;
//保存当前节点
}
}
}
//cnodes = cnodes.substring(0, cnodes.length - 1);
pnodes
=
pnodes
.
substring
(
0
,
pnodes
.
length
-
1
);
if
(
ctype
==
'
child
'
)
{
return
cnodes
;
}
else
{
return
pnodes
}
;
};
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/app/findRoleAPP?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
checkbox
:
true
});
$
(
"
#btnOK
"
).
click
(
function
()
{
var
id
=
checkRoleAPP
();
if
(
!
id
)
{
url
=
'
/userBusiness/add
'
;
}
else
{
url
=
'
/userBusiness/update?id=
'
+
id
;
}
$
.
messager
.
confirm
(
"
提示
"
,
"
您确定要保存吗?
"
,
function
(
data
){
$
.
ajax
({
url
:
url
,
type
:
"
post
"
,
data
:
{
info
:
JSON
.
stringify
({
type
:
type
,
keyid
:
url_id
,
value
:
GetNode
(
'
child
'
)
})
},
dataType
:
"
json
"
,
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
}
}
});
});
}
);
});
//检查记录是否存在
function
checkRoleAPP
()
{
//表示是否存在 0 = 不存在,存在就返回id
var
flag
=
0
;
//开始ajax名称检验,是否存在
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/userBusiness/checkIsValueExist
"
,
dataType
:
"
json
"
,
async
:
false
,
data
:
({
type
:
type
,
keyId
:
url_id
}),
success
:
function
(
res
)
{
if
(
res
.
data
&&
res
.
data
.
id
)
{
flag
=
res
.
data
.
id
;
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
提示
'
,
'
检查角色对应应用是否存在异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
return
flag
;
}
</script>
</body>
</html>
\ No newline at end of file
erp_web/pages/manage/roleFunctions.html
View file @
3b4afd98
...
...
@@ -20,6 +20,7 @@
<!-- 数据显示table -->
<div
style=
"padding-bottom: 10px;"
>
<a
id=
"btnOK"
class=
"easyui-linkbutton"
iconCls=
"icon-ok"
>
保存
</a>
<span>
分配功能后请继续
<b>
分配按钮
</b></span>
</div>
<div>
<ul
id=
"tt"
></ul>
...
...
@@ -58,11 +59,9 @@
else
{
return
pnodes
}
;
};
}
$
(
function
()
{
$
(
'
#tt
'
).
tree
({
url
:
'
/function/findRoleFunction?UBType=
'
+
type
+
'
&UBKeyId=
'
+
url_id
,
animate
:
true
,
...
...
@@ -93,8 +92,13 @@
async
:
false
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
self
.
parent
.
$
.
colorbox
.
close
();
$
.
messager
.
alert
(
'
提示
'
,
"
操作成功!
"
,
"
info
"
);
$
.
messager
.
confirm
(
"
提示
"
,
"
操作成功!现在继续<b>分配按钮</b>吗?
"
,
function
(
r
){
if
(
r
){
self
.
parent
.
window
.
$
(
"
#btnSetPushBtn
"
).
click
();
}
else
{
self
.
parent
.
$
.
colorbox
.
close
();
}
});
}
else
{
$
.
messager
.
alert
(
'
提示
'
,
"
操作失败!
"
,
"
error
"
);
...
...
Write
Preview
Supports
Markdown
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