切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
8 years ago
提交
3a29ac2e4ace3282c3080bc8a8e0a8db4b34207b
1 个父辈
cbfc382d
修复特殊字段导致生成Model的错误
修复Toastr在首页弹出位置的错误 移除Category的diyname字段 移动统计代码到index.js文件中,去除视图中的统计代码
隐藏空白字符变更
内嵌
并排对比
正在显示
12 个修改的文件
包含
50 行增加
和
27 行删除
application/admin/command/Crud.php
application/admin/view/category/add.html
application/admin/view/category/edit.html
application/admin/view/index/index.html
public/assets/css/backend.css
public/assets/css/backend.min.css
public/assets/js/backend.js
public/assets/js/backend/category.js
public/assets/js/backend/example/bootstraptable.js
public/assets/js/backend/index.js
public/assets/js/require-backend.min.js
public/assets/less/backend.less
application/admin/command/Crud.php
查看文件 @
3a29ac2
...
...
@@ -548,6 +548,10 @@ class Crud extends Command
protected function getAttr(&$getAttr, $field, $itemArr = '', $inputType = '')
{
if (preg_match("/[_\-]+/", $field))
{
return;
}
if (!in_array($inputType, ['
datetime
', '
select
', '
multiple
', '
checkbox
', '
radio
']))
return;
$attrField = ucfirst($field);
...
...
@@ -595,6 +599,10 @@ EOD;
protected function setAttr(&
$setAttr
,
$field
,
$itemArr
= '',
$inputType
= '')
{
if (preg_match("
/
[
_\
-
]
+/
",
$field
))
{
return;
}
if (
$inputType
!= 'datetime')
return;
$field
= ucfirst(
$field
);
...
...
@@ -614,6 +622,10 @@ EOD;
protected function appendAttr(&
$appendAttrList
,
$field
)
{
if (preg_match("
/
[
_\
-
]
+/
",
$field
))
{
return;
}
$appendAttrList
[] = <<<EOD
'
{
$field
}
_text'
EOD;
...
...
application/admin/view/category/add.html
查看文件 @
3a29ac2
...
...
@@ -14,10 +14,6 @@
<input
type=
"text"
class=
"form-control"
id=
"nickname"
name=
"row[nickname]"
value=
""
required=
"required"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"diyname"
class=
"control-label"
>
{:__('Diyname')}:
</label>
<input
type=
"text"
class=
"form-control"
id=
"diyname"
name=
"row[diyname]"
value=
""
required=
"required"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"keywords"
class=
"control-label"
>
{:__('Keywords')}:
</label>
<input
type=
"text"
class=
"form-control"
id=
"keywords"
name=
"row[keywords]"
value=
""
/>
</div>
...
...
application/admin/view/category/edit.html
查看文件 @
3a29ac2
...
...
@@ -14,10 +14,6 @@
<input
type=
"text"
class=
"form-control"
id=
"nickname"
name=
"row[nickname]"
value=
"{$row.nickname}"
required=
"required"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"diyname"
class=
"control-label"
>
{:__('Diyname')}:
</label>
<input
type=
"text"
class=
"form-control"
id=
"diyname"
name=
"row[diyname]"
value=
"{$row.diyname}"
required=
"required"
/>
</div>
<div
class=
"form-group"
>
<label
for=
"keywords"
class=
"control-label"
>
{:__('Keywords')}:
</label>
<input
type=
"text"
class=
"form-control"
id=
"keywords"
name=
"row[keywords]"
value=
"{$row.keywords}"
/>
</div>
...
...
application/admin/view/index/index.html
查看文件 @
3a29ac2
...
...
@@ -2,17 +2,6 @@
<html
lang=
"{$config.language}"
>
<head>
{include file="common/meta" /}
<script>
//此处为FastAdmin的统计代码,正式使用请移除
var
_hmt
=
_hmt
||
[];
(
function
()
{
var
hm
=
document
.
createElement
(
"script"
);
hm
.
src
=
"https://hm.baidu.com/hm.js?58347d769d009bcf6074e9a0ab7ba05e"
;
var
s
=
document
.
getElementsByTagName
(
"script"
)[
0
];
s
.
parentNode
.
insertBefore
(
hm
,
s
);
})();
</script>
</head>
<body
class=
"hold-transition skin-green sidebar-mini fixed"
id=
"tabs"
>
<div
class=
"wrapper"
>
...
...
public/assets/css/backend.css
查看文件 @
3a29ac2
...
...
@@ -73,6 +73,10 @@ body {
.searchit
{
border-bottom
:
1px
dashed
#3c8dbc
;
}
.toast-top-right-index
{
top
:
62px
;
right
:
12px
;
}
/*
* RIBBON
*/
...
...
public/assets/css/backend.min.css
查看文件 @
3a29ac2
此 diff 太大无法显示。
public/assets/js/backend.js
查看文件 @
3a29ac2
...
...
@@ -347,6 +347,9 @@ define(['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'moment'], function ($
init
:
function
()
{
//公共代码
//配置Toastr的参数
if
(
Config
.
controllername
==
'index'
)
{
Backend
.
config
.
toastr
.
positionClass
=
"toast-top-right-index"
;
}
Toastr
.
options
=
Backend
.
config
.
toastr
;
//点击包含.btn-dialog的元素时弹出dialog
$
(
document
).
on
(
'click'
,
'.btn-dialog,.dialogit'
,
function
(
e
)
{
...
...
public/assets/js/backend/category.js
查看文件 @
3a29ac2
...
...
@@ -26,6 +26,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
{
field
:
'id'
,
title
:
'ID'
},
{
field
:
'name'
,
title
:
__
(
'Name'
),
align
:
'left'
},
{
field
:
'nickname'
,
title
:
__
(
'Nickname'
)},
{
field
:
'type'
,
title
:
__
(
'Type'
)},
{
field
:
'flag'
,
title
:
__
(
'Flag'
),
formatter
:
Table
.
api
.
formatter
.
flag
},
{
field
:
'weigh'
,
title
:
__
(
'Weigh'
)},
{
field
:
'status'
,
title
:
__
(
'Status'
),
formatter
:
Table
.
api
.
formatter
.
status
},
...
...
public/assets/js/backend/example/bootstraptable.js
查看文件 @
3a29ac2
...
...
@@ -24,13 +24,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{
field
:
'id'
,
title
:
'ID'
,
operate
:
false
},
//使用Table.api.formatter.search可直接响应搜索
{
field
:
'username'
,
title
:
__
(
'Username'
),
formatter
:
Table
.
api
.
formatter
.
search
},
{
field
:
'title'
,
title
:
__
(
'Title'
)},
{
field
:
'title'
,
title
:
__
(
'Title'
),
operate
:
'LIKE %...%'
,
placeholder
:
'模糊搜索,*表示任意字符'
,
style
:
'width:200px'
,
process
:
function
(
value
,
arg
)
{
return
value
.
replace
(
/
\*
/g
,
'%'
);
}
},
{
field
:
'url'
,
title
:
__
(
'Url'
),
align
:
'left'
,
formatter
:
Controller
.
api
.
formatter
.
url
},
//点击IP时同时执行搜索此IP
{
field
:
'ip'
,
title
:
__
(
'IP'
),
events
:
Controller
.
api
.
events
.
ip
,
formatter
:
Controller
.
api
.
formatter
.
ip
},
//点击IP时同时执行搜索此IP,同时普通搜索使用下拉列表的形式
{
field
:
'ip'
,
title
:
__
(
'IP'
),
searchList
:
[
'127.0.0.1'
,
'127.0.0.2'
],
events
:
Controller
.
api
.
events
.
ip
,
formatter
:
Controller
.
api
.
formatter
.
ip
},
//browser是一个不存在的字段
//通过formatter来渲染数据,同时为它添加上事件
{
field
:
'browser'
,
title
:
__
(
'Browser'
),
operate
:
false
,
events
:
Controller
.
api
.
events
.
browser
,
formatter
:
Controller
.
api
.
formatter
.
browser
},
//启用时间段搜索
{
field
:
'createtime'
,
title
:
__
(
'Create time'
),
formatter
:
Table
.
api
.
formatter
.
datetime
,
operate
:
'BETWEEN'
,
type
:
'datetime'
,
addclass
:
'datetimepicker'
,
data
:
'data-date-format="YYYY-MM-DD HH:mm:ss"'
},
//我们向操作栏额外添加上一个详情按钮,并保留已有的编辑和删除控制,同时为这个按钮添加上点击事件
{
field
:
'operate'
,
title
:
__
(
'Operate'
),
events
:
Controller
.
api
.
events
.
operate
,
formatter
:
Controller
.
api
.
formatter
.
operate
}
...
...
public/assets/js/backend/index.js
查看文件 @
3a29ac2
...
...
@@ -14,6 +14,12 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
e
.
stopPropagation
();
});
//此处为FastAdmin的统计代码,正式使用请移除
var
s
=
document
.
createElement
(
"script"
);
s
.
type
=
"text/javascript"
;
s
.
src
=
"https://hm.baidu.com/hm.js?58347d769d009bcf6074e9a0ab7ba05e"
;
$
(
"head"
).
append
(
s
);
//读取FastAdmin的更新信息
$
.
ajax
({
url
:
'http://demo.fastadmin.net/index/index/news'
,
...
...
public/assets/js/require-backend.min.js
查看文件 @
3a29ac2
...
...
@@ -6663,7 +6663,7 @@ define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'moment'], f
});
},
addtabs
:
function
(
url
,
title
,
icon
)
{
var
dom
=
"
.sidebar-menu li
a[url='{url}']"
var
dom
=
"a[url='{url}']"
var
leftlink
=
top
.
window
.
$
(
dom
.
replace
(
/
\{
url
\}
/
,
url
));
if
(
leftlink
.
size
()
>
0
)
{
leftlink
.
trigger
(
"click"
);
...
...
@@ -6690,7 +6690,7 @@ define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'moment'], f
var
id
=
Math
.
floor
(
new
Date
().
valueOf
()
*
Math
.
random
());
icon
=
typeof
icon
!=
'undefined'
?
icon
:
'fa fa-circle-o'
;
title
=
typeof
title
!=
'undefined'
?
title
:
''
;
top
.
window
.
$
(
"<a />"
).
append
(
'<i class="'
+
icon
+
'"></i> <span>'
+
title
+
'</span>'
).
prop
(
"href"
,
url
).
attr
({
url
:
url
,
addtabs
:
id
}).
appendTo
(
top
.
window
.
document
.
body
).
trigger
(
"click"
);
top
.
window
.
$
(
"<a />"
).
append
(
'<i class="'
+
icon
+
'"></i> <span>'
+
title
+
'</span>'
).
prop
(
"href"
,
url
).
attr
({
url
:
url
,
addtabs
:
id
}).
a
ddClass
(
"hide"
).
a
ppendTo
(
top
.
window
.
document
.
body
).
trigger
(
"click"
);
}
}
}
...
...
@@ -6764,6 +6764,9 @@ define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'moment'], f
init
:
function
()
{
//公共代码
//配置Toastr的参数
if
(
Config
.
controllername
==
'index'
)
{
Backend
.
config
.
toastr
.
positionClass
=
"toast-top-right-index"
;
}
Toastr
.
options
=
Backend
.
config
.
toastr
;
//点击包含.btn-dialog的元素时弹出dialog
$
(
document
).
on
(
'click'
,
'.btn-dialog,.dialogit'
,
function
(
e
)
{
...
...
@@ -10939,9 +10942,9 @@ define('form',['jquery', 'bootstrap', 'backend', 'toastr', 'upload', 'validator'
stopOnError
:
true
,
valid
:
function
(
ret
)
{
//验证通过提交表单
Form
.
api
.
submit
(
form
,
onBeforeSubmit
,
function
(
data
)
{
Form
.
api
.
submit
(
$
(
ret
)
,
onBeforeSubmit
,
function
(
data
)
{
if
(
typeof
onAfterSubmit
==
'function'
)
{
if
(
!
onAfterSubmit
.
call
(
form
,
data
))
{
if
(
!
onAfterSubmit
.
call
(
$
(
ret
)
,
data
))
{
return
false
;
}
}
...
...
@@ -11102,7 +11105,7 @@ define('form',['jquery', 'bootstrap', 'backend', 'toastr', 'upload', 'validator'
$
(
document
).
on
(
'click'
,
".fachoose"
,
function
()
{
var
multiple
=
$
(
this
).
data
(
"multiple"
)
?
$
(
this
).
data
(
"multiple"
)
:
false
;
var
mimetype
=
$
(
this
).
data
(
"mimetype"
)
?
$
(
this
).
data
(
"mimetype"
)
:
''
;
Backend
.
api
.
open
(
"general/attachment/select?callback=refreshchoose&element_id="
+
$
(
this
).
attr
(
"id"
)
+
"&multiple="
+
multiple
+
"&mimetype="
+
mimetype
,
__
(
'Choose'
));
Backend
.
api
.
open
(
"general/attachment/select?callback=refreshchoose&element_id="
+
$
(
this
).
attr
(
"id"
)
+
"&multiple="
+
multiple
+
"&mimetype="
+
mimetype
,
__
(
'Choose'
));
return
false
;
});
...
...
public/assets/less/backend.less
查看文件 @
3a29ac2
...
...
@@ -97,6 +97,11 @@ body {
border-bottom:1px dashed @link-color;
}
.toast-top-right-index{
top:62px;
right:12px;
}
/*
* RIBBON
*/
...
...
请
注册
或
登录
后发表评论