切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
7 years ago
提交
ac6aa072a2a90e433b9d0adc1000f4a7820b1aa5
1 个父辈
47d2a430
新增Table.api.formatter.toggle切换
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
24 行增加
和
12 行删除
application/admin/controller/user/Rule.php
application/admin/lang/zh-cn.php
public/assets/css/backend.css
public/assets/css/backend.min.css
public/assets/js/backend/auth/rule.js
public/assets/js/backend/user/rule.js
public/assets/js/require-backend.min.js
public/assets/js/require-table.js
public/assets/less/backend.less
application/admin/controller/user/Rule.php
查看文件 @
ac6aa07
...
...
@@ -18,6 +18,7 @@ class Rule extends Backend
*/
protected
$model
=
null
;
protected
$rulelist
=
[];
protected
$multiFields
=
'ismenu,status'
;
public
function
_initialize
()
{
...
...
application/admin/lang/zh-cn.php
查看文件 @
ac6aa07
...
...
@@ -111,6 +111,7 @@ return [
'Go back'
=>
'返回首页'
,
'Jump now'
=>
'立即跳转'
,
'Click to search %s'
=>
'点击搜索 %s'
,
'Click to toggle'
=>
'点击切换'
,
'Operation completed'
=>
'操作成功!'
,
'Operation failed'
=>
'操作失败!'
,
'Unknown data format'
=>
'未知的数据格式!'
,
...
...
public/assets/css/backend.css
查看文件 @
ac6aa07
...
...
@@ -646,6 +646,9 @@ form.form-horizontal .control-label {
.bootstrap-table
.fixed-table-toolbar
.dropdown-menu
{
overflow
:
auto
;
}
.bootstrap-table
.fa-toggle-on.fa-2x
{
font-size
:
1.86em
;
}
.toolbar
{
margin-top
:
10px
;
margin-bottom
:
10px
;
...
...
public/assets/css/backend.min.css
查看文件 @
ac6aa07
此 diff 太大无法显示。
public/assets/js/backend/auth/rule.js
查看文件 @
ac6aa07
...
...
@@ -34,7 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
field
:
'ismenu'
,
title
:
__
(
'Ismenu'
),
align
:
'center'
,
formatter
:
Controller
.
api
.
formatter
.
menu
formatter
:
Table
.
api
.
formatter
.
toggle
},
{
field
:
'id'
,
...
...
@@ -117,10 +117,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
name
:
function
(
value
,
row
,
index
)
{
return
!
row
.
ismenu
||
row
.
status
==
'hidden'
?
"<span class='text-muted'>"
+
value
+
"</span>"
:
value
;
},
menu
:
function
(
value
,
row
,
index
)
{
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Toggle menu visible'
)
+
"' class='btn btn-"
+
(
value
?
"info"
:
"default"
)
+
" btn-xs btn-change' data-id='"
+
row
.
id
+
"' data-params='ismenu="
+
(
value
?
0
:
1
)
+
"'>"
+
(
value
?
__
(
'Yes'
)
:
__
(
'No'
))
+
"</a>"
;
},
icon
:
function
(
value
,
row
,
index
)
{
return
'<span class="'
+
(
!
row
.
ismenu
||
row
.
status
==
'hidden'
?
'text-muted'
:
''
)
+
'"><i class="'
+
value
+
'"></i></span>'
;
},
...
...
public/assets/js/backend/user/rule.js
查看文件 @
ac6aa07
...
...
@@ -30,7 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{
field
:
'title'
,
title
:
__
(
'Title'
),
align
:
'left'
},
{
field
:
'name'
,
title
:
__
(
'Name'
),
align
:
'left'
},
{
field
:
'remark'
,
title
:
__
(
'Remark'
)},
{
field
:
'ismenu'
,
title
:
__
(
'Ismenu'
),
formatter
:
Controller
.
api
.
formatter
.
toggle
},
{
field
:
'ismenu'
,
title
:
__
(
'Ismenu'
),
formatter
:
Table
.
api
.
formatter
.
toggle
},
{
field
:
'createtime'
,
title
:
__
(
'Createtime'
),
formatter
:
Table
.
api
.
formatter
.
datetime
,
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
sortable
:
true
,
visible
:
false
},
{
field
:
'updatetime'
,
title
:
__
(
'Updatetime'
),
formatter
:
Table
.
api
.
formatter
.
datetime
,
operate
:
'RANGE'
,
addclass
:
'datetimerange'
,
sortable
:
true
,
visible
:
false
},
{
field
:
'weigh'
,
title
:
__
(
'Weigh'
)},
...
...
@@ -60,12 +60,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
});
$
(
"input[name='row[ismenu]']:checked"
).
trigger
(
"click"
);
Form
.
api
.
bindevent
(
$
(
"form[role=form]"
));
},
formatter
:
{
toggle
:
function
(
value
,
row
,
index
)
{
//添加上btn-change可以自定义请求的URL进行数据处理
return
'<i class="fa '
+
(
value
==
0
?
'fa-toggle-off'
:
'fa-toggle-on'
)
+
' fa-2x"></i>'
;
},
}
}
};
...
...
public/assets/js/require-backend.min.js
查看文件 @
ac6aa07
...
...
@@ -9742,6 +9742,13 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
}
return
html
;
},
toggle
:
function
(
value
,
row
,
index
)
{
var
color
=
typeof
this
.
color
!==
'undefined'
?
this
.
color
:
'success'
;
var
yes
=
typeof
this
.
yes
!==
'undefined'
?
this
.
yes
:
1
;
var
no
=
typeof
this
.
no
!==
'undefined'
?
this
.
no
:
0
;
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change' data-id='"
+
row
.
id
+
"' data-params='"
+
this
.
field
+
"="
+
(
value
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
},
url
:
function
(
value
,
row
,
index
)
{
return
'<div class="input-group input-group-sm" style="width:250px;margin:0 auto;"><input type="text" class="form-control input-sm" value="'
+
value
+
'"><span class="input-group-btn input-group-sm"><a href="'
+
value
+
'" target="_blank" class="btn btn-default btn-sm"><i class="fa fa-link"></i></a></span></div>'
;
},
...
...
public/assets/js/require-table.js
查看文件 @
ac6aa07
...
...
@@ -402,6 +402,13 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
}
return
html
;
},
toggle
:
function
(
value
,
row
,
index
)
{
var
color
=
typeof
this
.
color
!==
'undefined'
?
this
.
color
:
'success'
;
var
yes
=
typeof
this
.
yes
!==
'undefined'
?
this
.
yes
:
1
;
var
no
=
typeof
this
.
no
!==
'undefined'
?
this
.
no
:
0
;
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change' data-id='"
+
row
.
id
+
"' data-params='"
+
this
.
field
+
"="
+
(
value
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
},
url
:
function
(
value
,
row
,
index
)
{
return
'<div class="input-group input-group-sm" style="width:250px;margin:0 auto;"><input type="text" class="form-control input-sm" value="'
+
value
+
'"><span class="input-group-btn input-group-sm"><a href="'
+
value
+
'" target="_blank" class="btn btn-default btn-sm"><i class="fa fa-link"></i></a></span></div>'
;
},
...
...
public/assets/less/backend.less
查看文件 @
ac6aa07
...
...
@@ -730,6 +730,9 @@ form.form-horizontal .control-label {
.bootstrap-table .fixed-table-toolbar .dropdown-menu {
overflow: auto;
}
.bootstrap-table .fa-toggle-on.fa-2x {
font-size:1.86em;
}
.toolbar {
margin-top: 10px;
...
...
请
注册
或
登录
后发表评论