切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
5 years ago
提交
b6f230773786d662bc7c93afc6c855fc7183701e
1 个父辈
9b2ec96a
新增自定义编辑删除按钮
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
67 行增加
和
44 行删除
public/assets/js/require-backend.min.js
public/assets/js/require-table.js
public/assets/js/require-backend.min.js
查看文件 @
b6f2307
...
...
@@ -8772,6 +8772,7 @@ define('upload',['jquery', 'bootstrap', 'plupload', 'template'], function ($, un
return
$
[
NS
]
=
Validator
;
}));
/*********************************
* Themes, rules, and i18n support
* Locale: Chinese; 中文
...
...
@@ -9980,6 +9981,29 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
destroyallbtn
:
'.btn-destroyall'
,
dragsortfield
:
'weigh'
,
},
button
:
{
edit
:
{
name
:
'edit'
,
icon
:
'fa fa-pencil'
,
title
:
__
(
'Edit'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-success btn-editone'
},
del
:
{
name
:
'del'
,
icon
:
'fa fa-trash'
,
title
:
__
(
'Del'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-danger btn-delone'
},
dragsort
:
{
name
:
'dragsort'
,
icon
:
'fa fa-arrows'
,
title
:
__
(
'Drag to sort'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-primary btn-dragsort'
}
},
api
:
{
init
:
function
(
defaults
,
columnDefaults
,
locales
)
{
defaults
=
defaults
?
defaults
:
{};
...
...
@@ -10030,6 +10054,12 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
}
Toastr
.
error
(
__
(
'Unknown data format'
));
});
//当加载数据成功时
table
.
on
(
'load-success.bs.table'
,
function
(
e
,
data
)
{
if
(
typeof
data
.
rows
===
'undefined'
&&
typeof
data
.
code
!=
'undefined'
)
{
Toastr
.
error
(
data
.
msg
);
}
});
//当刷新表格时
table
.
on
(
'refresh.bs.table'
,
function
(
e
,
settings
,
data
)
{
$
(
Table
.
config
.
refreshbtn
,
toolbar
).
find
(
".fa"
).
addClass
(
"fa-spin"
);
...
...
@@ -10481,32 +10511,14 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
names
.
push
(
item
.
name
);
});
if
(
options
.
extend
.
dragsort_url
!==
''
&&
names
.
indexOf
(
'dragsort'
)
===
-
1
)
{
buttons
.
push
({
name
:
'dragsort'
,
icon
:
'fa fa-arrows'
,
title
:
__
(
'Drag to sort'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-primary btn-dragsort'
});
buttons
.
push
(
Table
.
button
.
dragsort
);
}
if
(
options
.
extend
.
edit_url
!==
''
&&
names
.
indexOf
(
'edit'
)
===
-
1
)
{
buttons
.
push
({
name
:
'edit'
,
icon
:
'fa fa-pencil'
,
title
:
__
(
'Edit'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-success btn-editone'
,
url
:
options
.
extend
.
edit_url
});
Table
.
button
.
edit
.
url
=
options
.
extend
.
edit_url
;
buttons
.
push
(
Table
.
button
.
edit
);
}
if
(
options
.
extend
.
del_url
!==
''
&&
names
.
indexOf
(
'del'
)
===
-
1
)
{
buttons
.
push
({
name
:
'del'
,
icon
:
'fa fa-trash'
,
title
:
__
(
'Del'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-danger btn-delone'
});
buttons
.
push
(
Table
.
button
.
del
);
}
return
Table
.
api
.
buttonlink
(
this
,
buttons
,
value
,
row
,
index
,
'operate'
);
}
...
...
public/assets/js/require-table.js
查看文件 @
b6f2307
...
...
@@ -72,6 +72,29 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
destroyallbtn
:
'.btn-destroyall'
,
dragsortfield
:
'weigh'
,
},
button
:
{
edit
:
{
name
:
'edit'
,
icon
:
'fa fa-pencil'
,
title
:
__
(
'Edit'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-success btn-editone'
},
del
:
{
name
:
'del'
,
icon
:
'fa fa-trash'
,
title
:
__
(
'Del'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-danger btn-delone'
},
dragsort
:
{
name
:
'dragsort'
,
icon
:
'fa fa-arrows'
,
title
:
__
(
'Drag to sort'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-primary btn-dragsort'
}
},
api
:
{
init
:
function
(
defaults
,
columnDefaults
,
locales
)
{
defaults
=
defaults
?
defaults
:
{};
...
...
@@ -122,6 +145,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
}
Toastr
.
error
(
__
(
'Unknown data format'
));
});
//当加载数据成功时
table
.
on
(
'load-success.bs.table'
,
function
(
e
,
data
)
{
if
(
typeof
data
.
rows
===
'undefined'
&&
typeof
data
.
code
!=
'undefined'
)
{
Toastr
.
error
(
data
.
msg
);
}
});
//当刷新表格时
table
.
on
(
'refresh.bs.table'
,
function
(
e
,
settings
,
data
)
{
$
(
Table
.
config
.
refreshbtn
,
toolbar
).
find
(
".fa"
).
addClass
(
"fa-spin"
);
...
...
@@ -573,32 +602,14 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
names
.
push
(
item
.
name
);
});
if
(
options
.
extend
.
dragsort_url
!==
''
&&
names
.
indexOf
(
'dragsort'
)
===
-
1
)
{
buttons
.
push
({
name
:
'dragsort'
,
icon
:
'fa fa-arrows'
,
title
:
__
(
'Drag to sort'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-primary btn-dragsort'
});
buttons
.
push
(
Table
.
button
.
dragsort
);
}
if
(
options
.
extend
.
edit_url
!==
''
&&
names
.
indexOf
(
'edit'
)
===
-
1
)
{
buttons
.
push
({
name
:
'edit'
,
icon
:
'fa fa-pencil'
,
title
:
__
(
'Edit'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-success btn-editone'
,
url
:
options
.
extend
.
edit_url
});
Table
.
button
.
edit
.
url
=
options
.
extend
.
edit_url
;
buttons
.
push
(
Table
.
button
.
edit
);
}
if
(
options
.
extend
.
del_url
!==
''
&&
names
.
indexOf
(
'del'
)
===
-
1
)
{
buttons
.
push
({
name
:
'del'
,
icon
:
'fa fa-trash'
,
title
:
__
(
'Del'
),
extend
:
'data-toggle="tooltip"'
,
classname
:
'btn btn-xs btn-danger btn-delone'
});
buttons
.
push
(
Table
.
button
.
del
);
}
return
Table
.
api
.
buttonlink
(
this
,
buttons
,
value
,
row
,
index
,
'operate'
);
}
...
...
请
注册
或
登录
后发表评论