Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
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
yaru
fgqyxxlr
Commits
f48b9ff9
Commit
f48b9ff9
authored
Apr 03, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化js方法
parent
9312fe6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
+23
-6
No files found.
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
View file @
f48b9ff9
...
...
@@ -41,6 +41,7 @@
};
var
options
=
$
.
extend
(
defaults
,
options
);
$
.
table
.
_option
=
options
;
$
.
table
.
initEvent
();
$
(
'#'
+
options
.
id
).
bootstrapTable
({
url
:
options
.
url
,
// 请求后台的URL(*)
contentType
:
"application/x-www-form-urlencoded"
,
// 编码类型
...
...
@@ -104,10 +105,8 @@
return
{
rows
:
[],
total
:
0
};
}
},
// 当所有数据被加载时触发
onLoadSuccess
:
function
(
data
)
{
// 浮动提示框特效
$
(
"[data-toggle='tooltip']"
).
tooltip
();
// 初始化事件
initEvent
:
function
(
data
)
{
// 触发行点击事件 加载成功事件
$
(
"#"
+
$
.
table
.
_option
.
id
).
on
(
"check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table load-success.bs.table"
,
function
()
{
// 工具栏按钮控制
...
...
@@ -118,13 +117,18 @@
// 绑定选中事件、取消事件、全部选中、全部取消
$
(
"#"
+
$
.
table
.
_option
.
id
).
on
(
"check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table"
,
function
(
e
,
rows
)
{
// 复选框分页保留保存选中数组
var
row
s
=
$
.
common
.
isEmpty
(
$
.
table
.
_option
.
uniqueId
)
?
$
.
table
.
selectFirstColumns
()
:
$
.
table
.
selectColumns
(
$
.
table
.
_option
.
uniqueId
);
var
row
Ids
=
$
.
table
.
affectedRowIds
(
rows
);
if
(
$
.
common
.
isNotEmpty
(
$
.
table
.
_option
.
rememberSelected
)
&&
$
.
table
.
_option
.
rememberSelected
)
{
func
=
$
.
inArray
(
e
.
type
,
[
'check'
,
'check-all'
])
>
-
1
?
'union'
:
'difference'
;
selectionIds
=
_
[
func
](
selectionIds
,
rows
);
selectionIds
=
_
[
func
](
selectionIds
,
row
Id
s
);
}
});
},
// 当所有数据被加载时触发
onLoadSuccess
:
function
(
data
)
{
// 浮动提示框特效
$
(
"[data-toggle='tooltip']"
).
tooltip
();
},
// 表格销毁
destroy
:
function
(
tableId
)
{
var
currentId
=
$
.
common
.
isEmpty
(
tableId
)
?
$
.
table
.
_option
.
id
:
tableId
;
...
...
@@ -277,6 +281,19 @@
}
return
$
.
common
.
uniqueFn
(
rows
);
},
// 获取当前页选中或者取消的行ID
affectedRowIds
:
function
(
rows
)
{
var
column
=
$
.
common
.
isEmpty
(
$
.
table
.
_option
.
uniqueId
)
?
$
.
table
.
_option
.
columns
[
1
].
field
:
$
.
table
.
_option
.
uniqueId
;
var
rowIds
;
if
(
$
.
isArray
(
rows
))
{
rowIds
=
$
.
map
(
rows
,
function
(
row
)
{
return
row
[
column
];
});
}
else
{
rowIds
=
[
rows
[
column
]];
}
return
rowIds
;
},
// 查询表格首列值
selectFirstColumns
:
function
()
{
var
rows
=
$
.
map
(
$
(
'#'
+
$
.
table
.
_option
.
id
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
...
...
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