切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
7 years ago
提交
b7300ea55866aeeb5f169b6dc5bfb5704fbfa039
1 个父辈
8756cf38
修复表格在多个列头时buttons的事件可能不响应的BUG
移除表格按钮columnIndex,增加fieldIndex属性
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
84 行增加
和
30 行删除
public/assets/js/backend.js
public/assets/js/require-backend.min.js
public/assets/js/require-table.js
public/assets/js/backend.js
查看文件 @
b7300ea
...
...
@@ -113,12 +113,26 @@ define(['fast', 'moment'], function (Fast, Moment) {
$
(
document
).
on
(
'click'
,
'.btn-dialog,.dialogit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{});
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
column
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
field
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
var
tableOptions
=
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'getOptions'
);
if
(
tableOptions
)
{
var
button
=
tableOptions
.
columns
[
0
][
options
.
columnIndex
][
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
callback
===
'function'
)
{
options
.
callback
=
button
.
callback
;
var
columnObj
=
null
;
$
.
each
(
tableOptions
.
columns
,
function
(
i
,
columns
)
{
$
.
each
(
columns
,
function
(
j
,
column
)
{
if
(
typeof
column
.
fieldIndex
!==
'undefined'
&&
column
.
fieldIndex
===
options
.
fieldIndex
)
{
columnObj
=
column
;
return
false
;
}
});
if
(
columnObj
)
{
return
false
;
}
});
if
(
columnObj
)
{
var
button
=
columnObj
[
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
callback
===
'function'
)
{
options
.
callback
=
button
.
callback
;
}
}
}
}
...
...
@@ -159,15 +173,29 @@ define(['fast', 'moment'], function (Fast, Moment) {
var
error
=
typeof
options
.
error
===
'function'
?
options
.
error
:
null
;
delete
options
.
success
;
delete
options
.
error
;
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
column
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
field
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
var
tableOptions
=
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'getOptions'
);
if
(
tableOptions
)
{
var
button
=
tableOptions
.
columns
[
0
][
options
.
columnIndex
][
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
success
===
'function'
)
{
success
=
button
.
success
;
}
if
(
button
&&
typeof
button
.
error
===
'function'
)
{
error
=
button
.
error
;
var
columnObj
=
null
;
$
.
each
(
tableOptions
.
columns
,
function
(
i
,
columns
)
{
$
.
each
(
columns
,
function
(
j
,
column
)
{
if
(
typeof
column
.
fieldIndex
!==
'undefined'
&&
column
.
fieldIndex
===
options
.
fieldIndex
)
{
columnObj
=
column
;
return
false
;
}
});
if
(
columnObj
)
{
return
false
;
}
});
if
(
columnObj
)
{
var
button
=
columnObj
[
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
success
===
'function'
)
{
success
=
button
.
success
;
}
if
(
button
&&
typeof
button
.
error
===
'function'
)
{
error
=
button
.
error
;
}
}
}
}
...
...
public/assets/js/require-backend.min.js
查看文件 @
b7300ea
...
...
@@ -6911,12 +6911,26 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
$
(
document
).
on
(
'click'
,
'.btn-dialog,.dialogit'
,
function
(
e
)
{
var
that
=
this
;
var
options
=
$
.
extend
({},
$
(
that
).
data
()
||
{});
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
column
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
field
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
var
tableOptions
=
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'getOptions'
);
if
(
tableOptions
)
{
var
button
=
tableOptions
.
columns
[
0
][
options
.
columnIndex
][
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
callback
===
'function'
)
{
options
.
callback
=
button
.
callback
;
var
columnObj
=
null
;
$
.
each
(
tableOptions
.
columns
,
function
(
i
,
columns
)
{
$
.
each
(
columns
,
function
(
j
,
column
)
{
if
(
typeof
column
.
fieldIndex
!==
'undefined'
&&
column
.
fieldIndex
===
options
.
fieldIndex
)
{
columnObj
=
column
;
return
false
;
}
});
if
(
columnObj
)
{
return
false
;
}
});
if
(
columnObj
)
{
var
button
=
columnObj
[
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
callback
===
'function'
)
{
options
.
callback
=
button
.
callback
;
}
}
}
}
...
...
@@ -6957,15 +6971,29 @@ define('backend',['fast', 'moment'], function (Fast, Moment) {
var
error
=
typeof
options
.
error
===
'function'
?
options
.
error
:
null
;
delete
options
.
success
;
delete
options
.
error
;
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
column
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
if
(
typeof
options
.
tableId
!==
'undefined'
&&
typeof
options
.
field
Index
!==
'undefined'
&&
typeof
options
.
buttonIndex
!==
'undefined'
)
{
var
tableOptions
=
$
(
"#"
+
options
.
tableId
).
bootstrapTable
(
'getOptions'
);
if
(
tableOptions
)
{
var
button
=
tableOptions
.
columns
[
0
][
options
.
columnIndex
][
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
success
===
'function'
)
{
success
=
button
.
success
;
}
if
(
button
&&
typeof
button
.
error
===
'function'
)
{
error
=
button
.
error
;
var
columnObj
=
null
;
$
.
each
(
tableOptions
.
columns
,
function
(
i
,
columns
)
{
$
.
each
(
columns
,
function
(
j
,
column
)
{
if
(
typeof
column
.
fieldIndex
!==
'undefined'
&&
column
.
fieldIndex
===
options
.
fieldIndex
)
{
columnObj
=
column
;
return
false
;
}
});
if
(
columnObj
)
{
return
false
;
}
});
if
(
columnObj
)
{
var
button
=
columnObj
[
'buttons'
][
options
.
buttonIndex
];
if
(
button
&&
typeof
button
.
success
===
'function'
)
{
success
=
button
.
success
;
}
if
(
button
&&
typeof
button
.
error
===
'function'
)
{
error
=
button
.
error
;
}
}
}
}
...
...
@@ -10005,9 +10033,8 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
var
options
=
table
?
table
.
bootstrapTable
(
'getOptions'
)
:
{};
var
html
=
[];
var
url
,
classname
,
icon
,
text
,
title
,
extend
;
var
columnIndex
=
options
.
columns
[
0
].
findIndex
(
function
(
element
)
{
return
element
===
column
;
});
var
fieldIndex
=
column
.
fieldIndex
;
$
.
each
(
buttons
,
function
(
i
,
j
)
{
if
(
type
===
'operate'
)
{
if
(
j
.
name
===
'dragsort'
&&
typeof
row
[
Table
.
config
.
dragsortfield
]
===
'undefined'
)
{
...
...
@@ -10028,7 +10055,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
refresh
=
j
.
refresh
?
'data-refresh="'
+
j
.
refresh
+
'"'
:
''
;
confirm
=
j
.
confirm
?
'data-confirm="'
+
j
.
confirm
+
'"'
:
''
;
extend
=
j
.
extend
?
j
.
extend
:
''
;
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
(
refresh
?
refresh
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-
column-index="'
+
column
Index
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
(
refresh
?
refresh
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-
field-index="'
+
field
Index
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
}
});
return
html
.
join
(
' '
);
...
...
public/assets/js/require-table.js
查看文件 @
b7300ea
...
...
@@ -432,9 +432,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
var
options
=
table
?
table
.
bootstrapTable
(
'getOptions'
)
:
{};
var
html
=
[];
var
url
,
classname
,
icon
,
text
,
title
,
extend
;
var
columnIndex
=
options
.
columns
[
0
].
findIndex
(
function
(
element
)
{
return
element
===
column
;
});
var
fieldIndex
=
column
.
fieldIndex
;
$
.
each
(
buttons
,
function
(
i
,
j
)
{
if
(
type
===
'operate'
)
{
if
(
j
.
name
===
'dragsort'
&&
typeof
row
[
Table
.
config
.
dragsortfield
]
===
'undefined'
)
{
...
...
@@ -455,7 +454,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
refresh
=
j
.
refresh
?
'data-refresh="'
+
j
.
refresh
+
'"'
:
''
;
confirm
=
j
.
confirm
?
'data-confirm="'
+
j
.
confirm
+
'"'
:
''
;
extend
=
j
.
extend
?
j
.
extend
:
''
;
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
(
refresh
?
refresh
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-
column-index="'
+
column
Index
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
html
.
push
(
'<a href="'
+
url
+
'" class="'
+
classname
+
'" '
+
(
confirm
?
confirm
+
' '
:
''
)
+
(
refresh
?
refresh
+
' '
:
''
)
+
extend
+
' title="'
+
title
+
'" data-table-id="'
+
(
table
?
table
.
attr
(
"id"
)
:
''
)
+
'" data-
field-index="'
+
field
Index
+
'" data-row-index="'
+
index
+
'" data-button-index="'
+
i
+
'"><i class="'
+
icon
+
'"></i>'
+
(
text
?
' '
+
text
:
''
)
+
'</a>'
);
}
});
return
html
.
join
(
' '
);
...
...
请
注册
或
登录
后发表评论