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
b63cf9ea
Commit
b63cf9ea
authored
May 05, 2019
by
qiankunpingtai
Browse files
修改角色管理js效率低下的问题
parent
148306b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/manage/role.html
View file @
b63cf9ea
...
...
@@ -123,10 +123,17 @@
{
field
:
'
id
'
,
width
:
35
,
align
:
"
center
"
,
checkbox
:
true
},
{
title
:
'
角色名称
'
,
field
:
'
name
'
,
width
:
200
},
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
130
,
formatter
:
function
(
value
,
rec
)
{
title
:
'
操作
'
,
field
:
'
op
'
,
align
:
"
center
"
,
width
:
130
,
formatter
:
function
(
value
,
rec
,
index
)
{
/**
* create by: qiankunpingtai
* create time: 2019/5/5 10:30
* website:https://qiankunpingtai.cn
* description:
* 修改效率低下的js实现
*/
var
str
=
''
;
var
rowInfo
=
rec
.
id
+
'
AaBb
'
+
rec
.
name
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editRole(
\'
'
+
rowInfo
+
'
\'
);"/> <a onclick="editRole(
\'
'
+
rowInfo
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
//
var rowInfo = rec.id + 'AaBb' + rec.name;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editRole(
\'
'
+
index
+
'
\'
);"/> <a onclick="editRole(
\'
'
+
index
+
'
\'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a>
'
;
str
+=
'
<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteRole(
'
+
rec
.
id
+
'
);"/> <a onclick="deleteRole(
'
+
rec
.
id
+
'
);" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a>
'
;
return
str
;
}
...
...
@@ -318,18 +325,18 @@
});
//编辑信息
function
editRole
(
roleTotalInfo
)
{
var
roleInfo
=
roleTotalInfo
.
split
(
"
AaBb
"
);
function
editRole
(
index
)
{
// var roleInfo = roleTotalInfo.split("AaBb");
var
rowsdata
=
$
(
"
#tableData
"
).
datagrid
(
"
getRows
"
)[
index
];
$
(
"
#name
"
).
focus
().
val
(
rowsdata
.
name
);
$
(
"
#name
"
).
focus
().
val
(
roleInfo
[
1
]);
oldName
=
roleInfo
[
1
];
oldName
=
rowsdata
.
name
;
$
(
'
#roleDlg
'
).
dialog
(
'
open
'
).
dialog
(
'
setTitle
'
,
'
<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑角色信息
'
);
$
(
"
.window-mask
"
).
css
({
width
:
webW
,
height
:
webH
});
roleID
=
ro
leInfo
[
0
]
;
roleID
=
ro
wsdata
.
id
;
//焦点在名称输入框==定焦在输入文字后面
$
(
"
#name
"
).
val
(
""
).
focus
().
val
(
ro
leInfo
[
1
]
);
url
=
'
/role/update?id=
'
+
ro
leInfo
[
0
]
;
$
(
"
#name
"
).
val
(
""
).
focus
().
val
(
ro
wsdata
.
name
);
url
=
'
/role/update?id=
'
+
ro
wsdata
.
id
;
}
//检查名称是否存在 ++ 重名无法提示问题需要跟进
...
...
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