Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
da21280b
Commit
da21280b
authored
Jan 15, 2019
by
ms-dev
Browse files
配置文件更新
parent
33bb27de
Changes
67
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/WEB-INF/manager/basic/role/index.ftl
0 → 100644
View file @
da21280b
<@
ms
.html5
>
<@ms.nav title="角色管理"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.text label="角色名" name="roleName" value="" width="240px;" placeholder="请输入角色名" />
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<@shiro.hasPermission name="role:save"><@ms.panelNavBtnAdd title="" id="addRoleBtn"/></@shiro.hasPermission>
<@shiro.hasPermission name="role:del"><@ms.panelNavBtnDel title="" id="delRoleBtn"/></@shiro.hasPermission>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="roleList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delRole" title="角色删除" >
<@ms.modalBody>删除此角色
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="删除" class="btn btn-danger rightDelete" id="deleteRoleBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@
ms
.html5
>
<
script
>
$(function()
{
$
(
"#roleList"
)
.bootstrapTable
({
url
:
"${managerPath}/basic/role/list.do"
,
contentType
:
"application/x-www-form-urlencoded"
,
queryParamsType
:
"undefined"
,
toolbar
:
"#toolbar"
,
columns
:
[
{
checkbox
:
true
,
formatter
:
function
(
value
,
row
,
index
){
//不能删除自己
if
(
"${Session.manager_session.managerRoleID}"
==
row
.roleId
){
return
{
disabled
:
true
}
;
}
}
},{
field
:
'
roleId
'
,
title
:
'编号'
,
align
:
'
center
'
,
width
:
'
80
'
,
},{
field
:
'
roleName
'
,
title
:
'角色名'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
"${Session.manager_session.managerRoleID}"
==
row
.roleId
){
return
value
;
}
else
{
var
url
=
"${managerPath}/basic/role/form.do?roleId="
+
row
.roleId
;
return
"<a href="
+
url
+
" target='_self'>"
+
value
+
"</a>"
;
}
}
}
]
})
}
)
//增加按钮
$("#addRoleBtn").click(function()
{
location
.href
=
"${managerPath}/basic/role/form.do"
;
}
)
//删除按钮
$("#delRoleBtn").click(function()
{
//获取
checkbox
选中的数据
var
rows
=
$
(
"#roleList"
)
.bootstrapTable
(
"getSelections"
)
;
//没有选中
checkbox
if
(
rows
.length
<=
0
){
<@
ms
.notify
msg
=
"请选择需要删除的记录"
type
=
"warning"
/>
}
else
{
$
(
".delRole"
)
.modal
()
;
}
}
)
$("#deleteRoleBtn").click(function()
{
var
rows
=
$
(
"#roleList"
)
.bootstrapTable
(
"getSelections"
)
;
$
(
this
)
.text
(
"正在删除..."
)
;
$
(
this
)
.attr
(
"disabled"
,
"true"
)
;
$
.ajax
({
type
:
"post"
,
url
:
"${managerPath}/basic/role/delete.do"
,
data
:
JSON
.stringify
(
rows
),
dataType
:
"json"
,
contentType
:
"application/json"
,
success
:
function
(
msg
)
{
if
(
msg
.result
==
true
)
{
<@
ms
.notify
msg
=
"删除成功"
type
=
"success"
/>
}
else
{
<@
ms
.notify
msg
=
"删除失败"
type
=
"danger"
/>
}
location
.reload
()
;
}
})
}
);
//查询功能
function search()
{
var
search
=
$
(
"form[name='searchForm']"
)
.serializeJSON
()
;
var
params
=
$
(
'#
roleList
'
)
.bootstrapTable
(
'
getOptions
'
)
;
params
.queryParams
=
function
(
params
)
{
$
.extend
(
params
,
search
)
;
return
params
;
}
$
(
"#roleList"
)
.bootstrapTable
(
'
refresh
'
,
{
query
:
$
(
"form[name='searchForm']"
)
.serializeJSON
()})
;
}
</
script
>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/category/form.ftl
0 → 100644
View file @
da21280b
<@
ms
.html5
>
<@ms.nav title="$
{
modelTitle
}
编辑" back=true>
<@ms.saveButton onclick="save()"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="categoryForm" isvalidation=true>
<@ms.hidden name="categoryId" value="$
{
categoryEntity
.categoryId
?
default
(
''
)}
"/>
<@ms.hidden name="categoryModelId" value="$
{
modelId
?
default
(
'
0
'
)}
"/>
<@ms.text label="$
{
modelTitle
}
标题" name="categoryTitle" value="$
{
categoryEntity
.categoryTitle
?
default
(
''
)}
" width="240px;" placeholder="请输入类别标题" validation=
{
"required"
:
"true"
,
"maxlength"
:
"50"
,
"data-bv-stringlength-message"
:
"类别标题长度不能超过五十个字符长度!"
,
"data-bv-notempty-message"
:
"必填项目"
}
/>
<@ms.textarea colSm="2" name="categoryDescription" label="$
{
modelTitle
}
描述" wrap="Soft" rows="3" size="" width="642px;" value="$
{
categoryEntity
.categoryDescription
?
default
(
''
)}
" placeholder="$
{
modelTitle
}
描述" validation=
{
"maxlength"
:
"50"
,
"data-bv-stringlength-message"
:
"栏目描述长度不能超过五十个字符长度!"
}
/>
<@ms.formRow label="缩略图">
<@ms.uploadImg path="category" inputName="categorySmallImg" size="15" filetype="" msg="" maxSize="1" imgs="$
{(
category
.categorySmallImg
)
?
default
(
''
)}
" />
</@ms.formRow>
</@ms.form>
</@ms.panel>
</@
ms
.html5
>
<
script
>
var url = "$
{
managerPath
}
/category/save.do";
if($("input[name = 'categoryId']").val() > 0)
{
url
=
"${managerPath}/category/update.do"
;
$
(
".btn-success"
)
.text
(
"更新"
)
;
}
//编辑按钮onclick
function save()
{
$
(
"#categoryForm"
)
.data
(
"bootstrapValidator"
)
.validate
()
;
var
isValid
=
$
(
"#categoryForm"
)
.data
(
"bootstrapValidator"
)
.isValid
()
;
if
(
!
isValid
)
{
<@
ms
.notify
msg
=
"数据提交失败,请检查数据格式!"
type
=
"warning"
/>
return
;
}
var
btnWord
=$
(
".btn-success"
)
.text
()
;
$
(
".btn-success"
)
.text
(
btnWord
+
"中..."
)
;
$
(
".btn-success"
)
.prop
(
"disabled"
,
true
)
;
$
.ajax
({
type
:
"post"
,
dataType
:
"json"
,
data
:
$
(
"form[name = 'categoryForm']"
)
.serialize
(),
url
:
url
,
success
:
function
(
status
)
{
if
(
status
.categoryId
!=
null
)
{
<@
ms
.notify
msg
=
"保存或更新成功"
type
=
"success"
/>
history
.go
(
-1
)
;
location
.reload
()
;
}
else
{
<@
ms
.notify
msg
=
"保存或更新失败!"
type
=
"danger"
/>
}
}
})
}
</
script
>
src/main/webapp/WEB-INF/manager/category/index.ftl
0 → 100644
View file @
da21280b
<@
ms
.html5
>
<@ms.nav title="$
{
modelTitle
}
"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.text label="$
{
modelTitle
}
标题" name="categoryTitle" value="" width="240px;" placeholder="请输入类别标题" validation=
{
"maxlength"
:
"50"
,
"data-bv-stringlength-message"
:
"${modelTitle}标题长度不能超过五十个字符长度!"
}
/>
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<#include "$
{
managerViewPath
}
/$
{
model
?
default
(
''
)}
/category/shiro-button.ftl"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="categoryList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delCategory" title="$
{
modelTitle
}
数据删除" >
<@ms.modalBody>删除此数据
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button class="btn btn-danger rightDelete" id="deleteCategoryBtn" value="确定"/>
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@
ms
.html5
>
<
script
>
$(function()
{
var
category
=
{
modelId
:
$
{
modelId
?
default
(
'
0
'
)},
modelTitle
:
"${modelTitle?default('0')}"
}
;
$
(
"#categoryList"
)
.bootstrapTable
({
url
:
"${managerPath}/category/list.do"
,
contentType
:
"application/x-www-form-urlencoded"
,
queryParamsType
:
"undefined"
,
queryParams
:
function
(
params
)
{
return
$
.extend
(
params
,
category
)
;
},
toolbar
:
"#toolbar"
,
columns
:
[
{
checkbox
:
true
},
{
field
:
'
categoryId
'
,
title
:
'$
{
modelTitle
}
编号'
,
align
:
'
center
'
,
width
:
'
120
'
},{
field
:
'
categoryTitle
'
,
title
:
'$
{
modelTitle
}
标题'
,
formatter
:
function
(
value
,
row
,
index
)
{
<#
include
"${managerViewPath}/${model?default('')}/category/shiro-update.ftl"
/>
}
},
{
field
:
'
categoryDescription
'
,
title
:
'$
{
modelTitle
}
描述'
}
]
})
}
)
//增加按钮
$("#addCategoryBtn").click(function()
{
location
.href
=
"${managerPath}/category/form.do?modelId=${modelId?default('0')}&modelTitle=${modelTitle?default('0')}"
;
}
)
//删除按钮
$("#delCategoryBtn").click(function()
{
//获取
checkbox
选中的数据
var
rows
=
$
(
"#categoryList"
)
.bootstrapTable
(
"getSelections"
)
;
//没有选中
checkbox
if
(
rows
.length
<=
0
){
<@
ms
.notify
msg
=
"请选择需要删除的记录"
type
=
"warning"
/>
}
else
{
$
(
".delCategory"
)
.modal
()
;
}
}
)
$("#deleteCategoryBtn").click(function()
{
var
rows
=
$
(
"#categoryList"
)
.bootstrapTable
(
"getSelections"
)
;
$
(
this
)
.text
(
"正在删除..."
)
;
$
(
this
)
.attr
(
"disabled"
,
"true"
)
;
$
.ajax
({
type
:
"post"
,
url
:
"${managerPath}/category/delete.do"
,
data
:
JSON
.stringify
(
rows
),
dataType
:
"json"
,
contentType
:
"application/json"
,
success
:
function
(
msg
)
{
if
(
msg
.result
==
true
)
{
<@
ms
.notify
msg
=
"删除成功"
type
=
"success"
/>
}
else
{
<@
ms
.notify
msg
=
"删除失败"
type
=
"danger"
/>
}
location
.reload
()
;
}
})
}
);
//查询功能
function search()
{
var
modelId
=
{
modelId
:
$
{
modelId
}}
;
var
search
=
$
(
"form[name='searchForm']"
)
.serializeJSON
()
;
var
params
=
$
(
'#
categoryList
'
)
.bootstrapTable
(
'
getOptions
'
)
;
params
.queryParams
=
function
(
params
)
{
$
.extend
(
params
,
search
,
modelId
)
;
return
params
;
}
$
(
"#categoryList"
)
.bootstrapTable
(
'
refresh
'
,
{
query
:
$
(
"form[name='searchForm']"
)
.serializeJSON
()})
;
}
</
script
>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/category/shiro-button.ftl
0 → 100644
View file @
da21280b
<@
ms
.addButton
id="addCategoryBtn"/>
<@
ms
.delButton
id="delCategoryBtn"/>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/category/shiro-update.ftl
0 → 100644
View file @
da21280b
var
url = "$
{
managerPath
}
/$
{
model
?
default
(
""
)}
/category/form.do?categoryId="+row.categoryId+"&modelId=$
{
modelId
?
default
(
'
0
'
)}
&modelTitle=$
{
modelTitle
?
default
(
'
0
'
)}
" ;
return
"<a href=" +url+ " target='_self'>" + value + "</a>";
\ No newline at end of file
src/main/webapp/WEB-INF/manager/column/form.ftl
0 → 100644
View file @
da21280b
<@
ms
.html5
>
<@ms.nav title="栏目管理" back=true>
<#if column.categoryId == 0>
<@ms.saveButton id="saveUpdate" value="保存"/>
<#else>
<@ms.updateButton id="saveUpdate" value="更新"/>
</#if>
</@ms.nav>
<@ms.panel>
<@ms.form name="columnForm" isvalidation=true action="" method="post" >
<#if column.categoryId!=0>
<@ms.hidden name="categoryId" value="$
{
column
.categoryId
?
c
?
default
(
0
)}
" />
</#if>
<@ms.text name="categoryTitle" width="200" label="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
名称" title="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
名称" placeholder="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
名称" value="$
{
column
.categoryTitle
?
default
(
''
)}
" id="" validation=
{
"data-bv-stringlength"
:
"true"
,
"required"
:
"true"
,
"data-bv-notempty-message"
:
"必填项目"
,
"data-bv-regexp"
:
"true"
,
"data-bv-regexp-regexp"
:
'^[^[!@#$%^&
*
()
_+-/~?!@#¥%…&
*
()——+—?》《:“‘’]+$'
,
"data-bv-stringlength-max"
:
"50"
,
"data-bv-regexp-message"
:
"${Session.model_title_session?default('栏目')}名称不能包含特殊字符"
,
"data-bv-stringLength-message"
:
"长度不能超过50个字符"
}
/>
<@ms.formRow label="所属栏目" width="300">
<@ms.treeInput treeId="inputTree" json="$
{
listColumn
?
default
(
''
)}
" jsonId="categoryId" jsonPid="categoryCategoryId" jsonName="categoryTitle" inputName="categoryCategoryId" inputValue="$
{
column
.categoryCategoryId
?
c
?
default
(
0
)}
" addNodesName="顶级栏目管理" buttonText="$
{
columnSuper
.categoryTitle
?
default
(
'顶级栏目管理'
)}
" clickZtreeId="clickZtreeId(event,treeId,treeNode);" expandAll="true" showIcon="true"/>
</@ms.formRow>
<@ms.text name="categorySort" width="200" label="自定义顺序" title="自定义顺序" size="5" placeholder="请输入文章顺序" value="$
{
column
.categorySort
?
c
?
default
(
0
)}
" validation=
{
"data-bv-between"
:
"true"
,
"data-bv-between-message"
:
"自定义顺序必须大于0"
,
"data-bv-between-min"
:
"0"
,
"data-bv-between-max"
:
"99999999"
,
"data-bv-notempty-message"
:
"自定义顺序不能为空"
,
"data-bv-between-message"
:
"请输入0-99999999之间的数"
,
"required"
:
"true"
,
"data-bv-notempty-message"
:
"必填项目"
}
/>
<@ms.textarea name="columnKeyword" width="600" label="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
关键字" wrap="Soft" rows="4" placeholder="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
关键字,有助于搜索" value="$
{
column
.columnKeyword
?
default
(
''
)}
" validation=
{
"data-bv-stringlength"
:
"true"
,
"data-bv-stringlength-max"
:
"200"
,
"data-bv-stringLength-message"
:
"长度不能超过200个字符"
}
/>
<@ms.textarea name="columnDescrip" width="600" label="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
描述" wrap="Soft" rows="4" placeholder="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
描述,对$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
关键字的扩展" value="$
{
column
.columnDescrip
?
default
(
''
)}
" validation=
{
"data-bv-stringlength"
:
"true"
,
"data-bv-stringlength-max"
:
"200"
,
"data-bv-stringLength-message"
:
"长度不能超过200个字符"
}
/>
<@ms.formRow label="缩略图" width="400">
<@ms.uploadImg path="column" imgs="$
{(
column
.categorySmallImg
)
?
default
(
''
)}
" inputName="categorySmallImg" size="1" msg="提示:栏目缩略图,最多可上传1张" maxSize="2" />
</@ms.formRow>
<#assign columnTypes=[
{
"id"
:
"1"
,
"name"
:
"列表"
}
,
{
"id"
:
"2"
,
"name"
:
"封面"
}
]>
<@ms.radio name="columnType" label="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
属性" list=columnTypes listKey="id" listValue="name" value="$
{
column
.columnType
?
c
?
default
(
1
)}
" />
<@ms.select name="columnContentModelId" width="200" list=[] listKey="cmId" listValue="cmTipsName" label="$
{
S
ession
.model_title_session
?
default
(
'栏目'
)}
内容模型" default="请选择" value="0"/>
<#assign columnModelUrls=[
{
"id"
:
"0"
,
"name"
:
"暂无文件"
}
]>
<@ms.select name="columnListUrl" width="300" id="columnListUrlModel" list=columnModelUrls listKey="id" listValue="name" label="列表模版" value="$
{
column
.columnListUrl
?
default
(
''
)}
" select2=true/>
<@ms.select name="columnUrl" width="300" id="columnUrlModel" default="暂无文件" list=columnModelUrls listKey="id" listValue="name" label="内容模版" value="$
{
column
.columnUrl
?
default
(
''
)}
" select2=true/>
<@ms.hidden name="modelId" value="$
{
S
ession
.model_id_session
?
default
(
'
0
'
)}
" />
</@ms.form>
</@ms.panel>
</@
ms
.html5
>
<
script
>
$(
function
(){
var columnContentModelId= "$
{
column
.columnContentModelId
?
default
(
''
)}
"
$("select[name=columnContentModelId]").find("option[value="+columnContentModelId+"]").attr("selected","selected");
<#if column.columnType == 0>
$("input:radio[name='columnType']:first").attr("checked",true);
</#if>
var columnListUrlSes = "$
{
column
.columnListUrl
?
default
(
''
)}
";
var columnUrlSes = "$
{
column
.columnUrl
?
default
(
''
)}
";
//页面加载列表模板和内容模板
$.ajax(
{
type
:
"post"
,
dataType
:
"json"
,
url
:
"${managerPath}/template/queryTemplateFileForColumn.do"
,
success
:
function
(
msg
){
$
(
"#columnListUrlModel"
)
.html
(
""
)
;
$
(
"#columnUrlModel"
)
.html
(
""
)
;
if
(
msg
.length
!=
0
){
for
(
var
i
=
0
;
i
<
msg
.length
;
i
++
){
if
(
msg
[
i
]
==
columnListUrlSes
)
{
$
(
"#columnListUrlModel"
)
.append
(
"<option selected>"
+
msg
[
i
]+
"</option>"
)
}
else
{
$
(
"#columnListUrlModel"
)
.append
(
"<option>"
+
msg
[
i
]+
"</option>"
)
}
if
(
msg
[
i
]
==
columnUrlSes
){
$
(
"#columnUrlModel"
)
.append
(
"<option selected>"
+
msg
[
i
]+
"</option>"
)
}
else
{
$
(
"#columnUrlModel"
)
.append
(
"<option>"
+
msg
[
i
]+
"</option>"
)
}
}
}
else
{
$
(
"#columnListUrlModel"
)
.append
(
"<option>暂无文件</option>"
)
;
$
(
"#columnUrlModel"
)
.append
(
"<option>暂无文件</option>"
)
;
}
<#
if
column
.columnType
==
2
>
$
(
"#columnListUrlModel"
)
.parents
(
".form-group"
)
.hide
()
;
$
(
"#columnListUrlModel"
)
.css
(
"disabled"
,
true
)
;
$
(
"#columnUrlModel"
)
.parent
()
.prev
()
.text
(
"封面模板:"
)
;
</#
if
>
}
}
);
//切换栏目属性
$("input[name='columnType']").click(function()
{
if
(
$
(
this
)
.val
()
==
2
){
$
(
"#columnListUrlModel"
)
.parents
(
".form-group"
)
.hide
()
;
$
(
"#columnListUrlModel"
)
.css
(
"disabled"
,
true
)
;
$
(
"#columnUrlModel"
)
.parent
()
.prev
()
.text
(
"封面模板:"
)
;
}
else
if
(
$
(
this
)
.val
()
==
1
){
$
(
"#columnListUrlModel"
)
.parents
(
".form-group"
)
.show
()
;
$
(
"#columnListUrlModel"
)
.css
(
"disabled"
,
false
)
;
$
(
"#columnUrlModel"
)
.parent
()
.prev
()
.text
(
"内容模板:"
)
;
}
}
);
//栏目保存提交事件
$("#saveUpdate").click(function()
{
$
(
"#columnForm"
)
.data
(
"bootstrapValidator"
)
.validate
()
;
var
isValid
=
$
(
"#columnForm"
)
.data
(
"bootstrapValidator"
)
.isValid
()
;
if
(
!
isValid
)
{
<@
ms
.notify
msg
=
"数据提交失败,请检查数据格式!"
type
=
"warning"
/>
return
;
}
if
(
$
(
"#columnListUrlModel"
)
.find
(
"option:selected"
)
.text
()
==
"暂无文件"
){
$
(
"#columnListUrlModel"
)
.find
(
"option:selected"
)
.text
(
""
)
;
}
if
(
$
(
"#columnUrlModel"
)
.find
(
"option:selected"
)
.text
()
==
"暂无文件"
){
$
(
"#columnUrlModel"
)
.find
(
"option:selected"
)
.text
(
""
)
;
}
//如果选择的是普通文章,则
if
(
$
(
"select[name=columnContentModelId]"
)
.find
(
"option:selected"
)
.val
()
==
""
){
$
(
"select[name=columnContentModelId]"
)
.find
(
"option:selected"
)
.val
(
0
)
}
var
formdata
=
$
(
"#columnForm"
)
.serialize
()
;
var
URL
=
""
;
<#
if
column
.categoryId
==
0
>
URL
=
"${managerPath}/${model?default("")}/column/save.do?modelId=${Session.model_id_session?default(0)}&modelTitle=${Session.model_title_session?default('')}"
;
<#
else
>
URL
=
"${managerPath}/${model?default("")}/column/update.do?modelId=${Session.model_id_session?default(0)}&modelTitle=${Session.model_title_session?default('')}"
;
</#
if
>
if
(
isNaN
(
$
(
"input[name=categorySort]"
)
.val
())){
<@
ms
.notify
msg
=
"自定义排序必须是数字"
type
=
"warning"
/>
$
(
"input[name=categorySort]"
)
.val
(
0
)
;
return
;
}
$
.ajax
({
type
:
"post"
,
url
:
URL
,
data
:
formdata
,
dataType
:
"json"
,
beforeSend
:
function
(){
//获取按钮值
var
bottonText
=
$
(
"#saveUpdate"
)
.text
()
.trim
()
;
//设置按钮加载状态值
$
(
"#saveUpdate"
)
.attr
(
"data-loading-text"
,
bottonText
+
"中"
)
;
//执行加载状态
$
(
"#saveUpdate"
)
.button
(
'
loading
'
)
;
},
success
:
function
(
msg
){
if
(
msg
.result
)
{
<#
if
column
.categoryId
==
0
>
<@
ms
.notify
msg
=
"保存成功"
type
=
"success"
/>
<#
else
>
<@
ms
.notify
msg
=
"更新成功"
type
=
"success"
/>
</#
if
>
var
modelId
=
$
{
S
ession
.model_id_session
?
default
(
0
)}
;
location
.href
=
"${managerPath}/${model?default("")}/column/index.do?modelId=${Session.model_id_session?default(0)}&modelTitle=${Session.model_title_session?default('')}"
;
}
else
{
<#
if
column
.categoryId
==
0
>
<@
ms
.notify
msg
=
"保存失败"
type
=
"warning"
/>
<#
else
>
<@
ms
.notify
msg
=
"更新失败"
type
=
"warning"
/>
</#
if
>
}
$
(
"#saveUpdate"
)
.button
(
'
reset
'
)
}
})
;
}
);
//获取内容模型列表
$.ajax(
{
type
:
"post"
,
url
:
"${managerPath}/mdiy/contentModel/list.do?pageSize=100"
,
dataType
:
"json"
,
contentType
:
"application/json"
,
success
:
function
(
data
)
{
for
(
var
i
=
0
;
i
<
data
.rows.length
;
i
++
){
var
value
=
data
.rows
[
i
];
var
columnContentModelId
=
$
{
column
.columnContentModelId
?
c
?
default
(
0
)}
;
if
(
columnContentModelId
==
value
.cmId
){
$
(
"select[name=columnContentModelId]"
)
.append
(
"<option value = "
+
value
.cmId
+
" selected='selected'>"
+
value
.cmTipsName
+
"</option>"
)
;
//添加<
option
>元素
}
else
{
$
(
"select[name=columnContentModelId]"
)
.append
(
"<option value = "
+
value
.cmId
+
">"
+
value
.cmTipsName
+
"</option>"
)
;
//添加<
option
>元素
}
}
}
}
)
});
//选择栏目后查询自定义模型
function
clickZtreeId(event,treeId,treeNode)
{
//栏目不能选择自己及其子栏目为父栏目的事件
<#
if
column
.categoryId
gt
0
>
var
booleanClick
=
true
;
var
nodeParam
=
zTreeObjinputTree
.getNodesByParam
(
"categoryId"
,
"${column.categoryId?c?default(0)}"
,
null
)
;
var
nodes
=
zTreeObjinputTree
.getNodesByParam
(
"categoryId"
,
treeNode
.categoryId
,
nodeParam
[
0
]
);
if
(
nodes
.length
>
0
||
treeNode
.categoryId
==
nodeParam
[
0
]
.categoryId)
{
booleanClick
=
false
;
<@
ms
.notify
msg
=
"不能选择该栏目作为父栏目"
type
=
"warning"
/>
}
return
booleanClick
;
</#
if
>
}
</
script
>
src/main/webapp/WEB-INF/manager/column/index.ftl
0 → 100644
View file @
da21280b
<@
ms
.html5
>
<@ms.nav title="栏目表管理"></@ms.nav>
<!--@ms.searchForm name="searchForm" isvalidation=true>
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm-->
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<#include "$
{
managerViewPath
}
/$
{
model
?
default
(
''
)}
/column/shiro-button.ftl"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="columnList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delColumn" title="删除栏目" >
<@ms.modalBody>删除选中栏目,如果有子栏目也会一并删除
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="确认删除?" id="deleteColumnBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@
ms
.html5
>
<
script
>
$(function()
{
$
(
"#columnList"
)
.bootstrapTable
({
url
:
"${managerPath}/${model?default('')}/column/list.do"
,
contentType
:
"application/x-www-form-urlencoded"
,
queryParamsType
:
"undefined"
,
toolbar
:
"#toolbar"
,
idField
:
'
categoryId
'
,
treeShowField
:
'
categoryTitle
'
,
parentIdField
:
'
categoryCategoryId
'
,
columns
:
[
{
checkbox
:
true
},{
field
:
'
categoryId
'
,
title
:
'编号'
,
align
:
'
center
'
},{
field
:
'
categoryTitle
'
,
title
:
'标题'
,
align
:
'
left
'
,
formatter
:
function
(
value
,
row
,
index
)
{
<#
include
"${managerViewPath}/${model?default('')}/column/shiro-update.ftl"
/>
}
},{
field
:
'
columnType
'
,
title
:
'属性'
,
align
:
'
center
'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
==
1
){
return
"列表"
;
}
else
if
(
value
==
2
){
return
"单页"
;
}
else
if
(
value
==
3
){
return
"外部链接"
;
}
}
},{
field
:
'
columnPath
'
,
title
:
'链接地址'
,
align
:
'
left
'
,
formatter
:
function
(
value
,
row
,
index
)
{
return
"{ms:global.url/}"
+
value
+
"/index.html"
;
}
},{
field
:
'
columnListUrl
'
,
title
:
'列表地址'
,
align
:
'
left
'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
value
!=
null
){
return
value
;
}
else
{
return
""
;
}
}
},{
field
:
'
columnUrl
'
,
title
:
'内容地址'
,
align
:
'
left
'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.columnType
==
1
){
return
value
;
}
else
{
return
""
;
}
}
},{
field
:
'
columnUrl
'
,
title
:
'封面地址'
,
align
:
'
left
'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.columnType
==
2
){
return
value
;
}
else
{
return
""
;
}
}
}
]
})
}
)
//增加按钮
$("#addColumnBtn").click(function()
{
location
.href
=
"${managerPath}/${model?default('')}/column/add.do?modelId=${Session.model_id_session?default(0)}&modelTitle=${Session.model_title_session?default('')}"
;
}
)
//删除按钮
$("#delColumnBtn").click(function()
{
//获取
checkbox
选中的数据
var
rows
=
$
(
"#columnList"
)
.bootstrapTable
(
"getSelections"
)
;
//没有选中
checkbox
if
(
rows
.length
<=
0
){
<@
ms
.notify
msg
=
"请选择需要删除的记录"
type
=
"warning"
/>
}
else
{
$
(
".delColumn"
)
.modal
()
;
}
}
)
$("#deleteColumnBtn").click(function()
{
var
rows
=
$
(
"#columnList"
)
.bootstrapTable
(
"getSelections"
)
;
$
(
this
)
.text
(
"正在删除..."
)
;
$
(
this
)
.attr
(
"disabled"
,
"true"
)
;
var
ids
=
[];
for
(
var
i
=
0
;
i
<
rows
.length
;
i
++
){
ids
[
i
]
=
rows
[
i
]
.categoryId
;
}
ids
.reverse
()
;
$
.ajax
({
type
:
"post"
,
url
:
"${managerPath}/${model?default('')}/column/delete.do?ids="
+
ids
,
dataType
:
"json"
,
contentType
:
"application/json"
,
success
:
function
(
msg
)
{
if
(
msg
.result
==
true
)
{
<@
ms
.notify
msg
=
"删除成功"
type
=
"success"
/>
}
else
{
<@
ms
.notify
msg
=
"删除失败"
type
=
"warning"
/>
}
location
.reload
()
;
}
})
}
);
//查询功能
function search()
{
var
search
=
$
(
"form[name='searchForm']"
)
.serializeJSON
()
;
var
params
=
$
(
'#
columnList
'
)
.bootstrapTable
(
'
getOptions
'
)
;
params
.queryParams
=
function
(
params
)
{
$
.extend
(
params
,
search
)
;
return
params
;
}
$
(
"#columnList"
)
.bootstrapTable
(
'
refresh
'
,
{
query
:
$
(
"form[name='searchForm']"
)
.serializeJSON
()})
;
}
</
script
>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/column/shiro-button.ftl
0 → 100644
View file @
da21280b
<@
ms
.addButton
id="addColumnBtn"/>
<@
ms
.delButton
id="delColumnBtn"/>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/column/shiro-update.ftl
0 → 100644
View file @
da21280b
var
url = "$
{
managerPath
}
/$
{
model
?
default
(
""
)}
/column/"+row.categoryId+"/edit.do?modelId=$
{
S
ession
.model_id_session
?
default
(
0
)}
&modelTitle=$
{
S
ession
.model_title_session
?
default
(
''
)}
";
return
"<a href=" +url+ " target='_self'>" + value + "</a>";
src/main/webapp/WEB-INF/manager/include/head-file.ftl
0 → 100644
View file @
da21280b
<
meta
charset="utf-8">
<!--浏览器小图标-->
<
link
rel="icon" href="http://cdn.mingsoft.net/global/images/ms.ico" type="x-icon">
<
script
type="text/javascript" src="https://unpkg.com/vue@2.5.21/dist/vue.js"></script>
<!--
引入样式 -->
<
link
rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!--
引入组件库 -->
<
script
src="https://unpkg.com/element-ui/lib/index.js"></script>
<!--网络请求框架-->
<
script
src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
<
script
src="https://cdn.bootcss.com/qs/6.5.2/qs.min.js"></script>
<!--铭飞-->
<
script
src="http://cdn.mingsoft.net/ms/1.0/ms.js"></script>
<
script
src="http://cdn.mingsoft.net/ms/1.0/ms.http.js"></script>
<
script
src="http://cdn.mingsoft.net/ms/1.0/ms.util.js"></script>
<
link
rel="stylesheet" href="http://cdn.mingsoft.net/ms-admin-ui/4.7.0/css/ms.css">
<
script
>
ms.manager =
{
path
:
"${managerPath}"
}
</
script
>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/include/macro.ftl
0 → 100644
View file @
da21280b
<#
include
"/include/ui/index.ftl"/>
<#
global
autoCURD=""/>
<#
macro
autoCURD>
<#local url=baseUrl?split("?")?first?split("/")?last/>
<#if url == "add.do">
<#global autoCURD="save">
<#elseif url =="edit.do">
<#global autoCURD="update">
</#if>
</#
macro
>
<@
autoCURD
/>
<#--权限控制-->
<#-
-link
:必须
type:add/del/edit/query class:样式 id,value:显示文字-->
<#
macro
auth link type="" value="" class="" id="">
<@shiro.hasPermission name="$
{
link
}
">
<#if type=="add">
<@ms.panelNavBtnAdd id="$
{
id
}
" value="$
{
value
}
" class="$
{
class
}
"/>
<#elseif type=="del">
<@ms.panelNavBtnDel id="$
{
id
}
" value="$
{
value
}
" class="$
{
class
}
"/>
<!--
<#elseif type=="edit">
<@ms.panelNavBtnDel id="$
{
id
}
" value="$
{
value
}
" class="$
{
class
}
"/>
-->
<#else>
<a href="$
{
link
}
" class="$
{
class
}
">$
{
value
}
</a>
</#if>
</@shiro.hasPermission>
</#
macro
>
<#--分页-->
<#
macro
pagehelper page displayedPages="5" edges="3" url="">
<#
if
page?exists && page.pages gt 1>
<nav class="pageNav">
<ul class="pagination pull-right" id="pagination">
<#--格式 <(上一页) 1 2 3 4 >(下一页) -->
<li class="prev <#if (page.pageNum)==1> disabled" ><a<#else> "><a href="$
{
url
}
&pageNo=$
{
page
.pageNum-1
}
" </#if> target="_self"><i class="fa fa-angle-left">上一页</i></a></li>
<#list 1..page.pages as i>
<li <#if page.pageNum==i>class="active" ><a<#else> ><a href='$
{
url
}
&pageNo=$
{
i
}
'</#if> target="_self">$
{
i
}
</a></li>
</#list>
<li class="next <#if page.pageNum == page.pages>disabled" ><a<#else> "><a href="$
{
url
}
&pageNo=$
{
page
.pageNum
+
1
}
"</#if> target="_self"><i class="fa fa-angle-right">下一页</i></a></li>
</ul>
</nav>
</#
if
>
</#
macro
>
<#--分页-->
<#
macro
showPage page displayedPages="5" edges="3">
<#
if
page?exists && page.pageCount gt 1>
<nav class="pageNav">
<ul class="pagination pull-right" id="pagination">
<#if displayedPages?has_content && edges?has_content>
<script>
$(function()
{
$
(
'#
pagination
'
)
.pagination
({
pages
:
$
{
page
.pageCount
},
cssStyle
:
'
pagination
pull-right
'
,
displayedPages
:
$
{
displayedPages
?
default
(
1
)},
hrefTextPrefix
:
"${page.linkUrl}pageNo="
,
currentPage
:
$
{
page
.pageNo
+
1
},
edges
:
<#
if
edges
?
has_content
>$
{
edges
?
default
(
3
)}
<#
else
>
3
</#
if
>
})
;
}
)
</script>
<#else>
<#--格式 <(上一页) 1 2 3 4 >(下一页) -->
<li class="prev <#if (page.pageNo+1)==1> disabled" ><a<#else> "><a href="$
{
page
.previousUrl
}
" </#if> target="_self"><i class="fa fa-angle-left">上一页</i></a></li>
<#list 1..page.pageCount as i>
<li <#if page.pageNo+1==i>class="active" ><a<#else> ><a href='$
{
page
.linkUrl
}
pageNo=$
{
i
}
'</#if> target="_self">$
{
i
}
</a></li>
</#list>
<li class="next <#if page.pageNo+1 == page.pageCount>disabled" ><a<#else> "><a href="$
{
page
.nextUrl
}
"</#if> target="_self"><i class="fa fa-angle-right">下一页</i></a></li>
</#if>
</ul>
</nav>
</#
if
>
</#
macro
>
<#
macro
method>
$
{
baseUrl
}
</#
macro
>
src/main/webapp/WEB-INF/manager/include/manager.ftl
0 → 100644
View file @
da21280b
<#--4.5.5版本该文件废弃->
<#--后台的
UI
界面通用区域定义
-->
<#
macro
html5 width="100%" style="">
<!
DOCTYPE
html>
<
html
lang="en">
<head>
<#include "$
{
managerViewPath
}
/include/macro.ftl"/>
<#include "$
{
managerViewPath
}
/include/meta.ftl"/>
</head>
<body>
<div class="ms-content">
<div class="ms-content-body" style="width:$
{
width
}
;$
{
style
}
">
<#nested/>
</div>
</div>
</body>
</
html
>
</#
macro
>
<#
macro
panel style="">
<div class="ms-content-body-panel" style="$
{
style
}
">
<#nested/>
</div>
</#
macro
>
<#--主体结构-->
<#
macro
content>
<div class="ms-content">
<#nested/>
</div>
</#
macro
>
<#--左侧菜单-->
<#
macro
contentMenu style="">
<div class="ms-content-menu" style="$
{
style
}
">
<#nested/>
</div>
</#
macro
>
<#--废弃-->
<#
macro
left>
<div class="ms-content-menu">
<#nested/>
</div>
</#
macro
>
<#--内容-->
<#
macro
contentBody width="100%" style="">
<div class="ms-content-body" style="width:$
{
width
}
;$
{
style
}
">
<#nested/>
</div>
</#
macro
>
<#--内容导航-->
<#-
-button
:格式为
map
例如:button=
{
"text"
:
标题
,
"link"
:
默认返回
}
-->
<#
macro
contentNav title="板块名称">
<div class="ms-content-body-title">
<strong>$
{
title
}
</strong>
<#nested/>
</div>
</#
macro
>
<#--搜索按钮组-->
<#
macro
searchBtnGroup size="1">
<@ms.col size="$
{
size
}
" style="text-align:right;border-top: 1px #EAEAEA solid;padding-top: 10px;">
<#nested/>
</@ms.col>
</#
macro
>
<#--
分割线-->
<#
macro
panelNav empty=false>
<div class="ms-content-body-panel-nav" <#if empty>style=" padding: 0;"</#if>>
<#nested/>
</div>
</#
macro
>
<#--列表上面导航条右侧的过滤按钮区域
右浮动 -->
<#
macro
panelNavFilter>
<div style="float:right;">
<#nested/>
</div>
</#
macro
>
<#--列表按钮组
如下拉菜单-->
<#
macro
panelNavBtnGroup role="group" btn="" >
<div class="btn-group" role="$
{
role
}
">
<#nested/>
</div>
</#
macro
>
<#--
判断按钮的传入参数是否为空值 -->
<#
macro
isPanelNavBtn class _class id _id>
<#assign _id="$
{
_
id
}
"/>
<#if id?has_content>
<#assign _id="$
{
id
}
" />
</#if>
<#assign _class="$
{
_
class
}
">
<#if class?has_content>
<#assign _class="$
{
class
}
">
</#if>
</#
macro
>
<#
macro
panelNavBtnAdd value="" icon="plus" class="default" id="addButton" onclick="" title="">
<@ms.isPanelNavBtn id="$
{
id
}
" _id="addButton" class="$
{
class
}
" _class="default"/>
<@ms.button icon="$
{
icon
}
" id="$
{
_
id
}
" value="$
{
value
}
" icon="$
{
icon
}
" class="btn btn-$
{
_
class
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
panelNavBtnDel value="" icon="trash" class="danger" id="delButton" onclick="" title="">
<@ms.isPanelNavBtn id="$
{
id
}
" _id="delButton" class="$
{
class
}
" _class="danger"/>
<@ms.button icon="$
{
icon
}
" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" class="btn btn-$
{
_
class
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
contentNavBack value="返回" icon="share-alt" class="default" onclick="javascript:history.go(-1)" title="返回">
<@ms.button value="$
{
value
}
" icon="$
{
icon
}
" onclick="$
{
onclick
}
" class="btn btn-$
{
class
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
panelNavBtnSave value="保存" icon="disk" class="default" id="saveButton" onclick="" title="保存" >
<@ms.button class="btn btn-success" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#---->
<#
macro
contentPanel style="">
<div class="ms-content-body-panel" style="$
{
style
}
">
<#nested/>
</div>
</#
macro
>
<#--整行-->
<#
macro
row>
<div class="row">
<#nested/>
</div>
</#
macro
>
<#--整列-->
<#
macro
col size="1" style="">
<div class="col-md-$
{
size
}
col-sm-$
{
size
}
" style="$
{
style
}
">
<#nested/>
</div>
</#
macro
>
<#--提示没有数据-->
<#
macro
nodata content="暂无数据" style="text-align:center">
<p class="alert alert-info" role="alert" style="$
{
style
}
">
$
{
content
}
</p>
</#
macro
>
<#--表格列表-->
<#
macro
table head="" list="" id="">
<table class="table table-hover">
<!--表格栏目属性 开始-->
<thead>
<tr>
<#if head?has_content>
<#list head as h>
<#if h?html?length gt 5 && h?html?substring(0,6)=="<th">
$
{
h
}
<#else>
<th>
$
{
h
}
</th>
</#if>
</#list>
</#if>
</tr>
</thead>
<!--表格栏目属性 结束-->
<tbody id=$
{
id
}
>
<#nested/>
</tbody>
</table>
</#
macro
>
src/main/webapp/WEB-INF/manager/include/meta.ftl
0 → 100644
View file @
da21280b
<base target="mainFrame" />
<#assign static="$
{
basePath
}
/static">
<#setting url_escaping_charset='utf-8'>
<#assign bootstrap="3.3.5">
<#assign manager_ui="4.6.4">
<#assign easyui="1.5">
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/animate/1.0.0/animate.css" media="all" />
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/iconfont/1.0.0/iconfont.css"/>
<script type="text/javascript" src="$
{
static
}
/plugins/jquery/1.9.1/jquery-1.9.1.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.serializeJSON/2.8.1/jquery.serializejson.min.js"></script>
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/ztree/3.5/zTreeStyle.css" media="all" />
<script type="text/javascript" src="$
{
static
}
/plugins/ztree/3.5/jquery.ztree.all-3.5.min.js"></script>
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/css/bootstrap.min.css" media="all" />
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/css/bootstrap-switch.css" media="all" />
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/css/bootstrapValidator.css" media="all" />
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/css/bootstrap-notify.css" media="all" />
<script type="text/javascript" src="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/js/bootstrap.min.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/js/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/js/bootstrapValidator.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/bootstrap/$
{
bootstrap
}
/js/bootstrap-notify.js"></script>
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/select2/4.0.3/css/select2.min.css" media="all" />
<script type="text/javascript" src="$
{
static
}
/plugins/select2/4.0.3/js/select2.min.js"></script>
<!--时间插件-->
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.validation/1.15.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.tmpl/1.4.2/jquery.tmpl.min.js"></script>
<!--时间插件-->
<link href="$
{
static
}
/plugins/bootstrap.daterangepicker/1.3.4/daterangepicker.css" rel="stylesheet">
<script type="text/javascript" src="$
{
static
}
/plugins/bootstrap.daterangepicker/1.3.4/moment.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/bootstrap.daterangepicker/1.3.4/daterangepicker.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.cookie/2.2.0/jquery.cookie.js"></script>
<!----上传图片--->
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.swfupload/1.0.0/swfupload.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.swfupload/1.0.0/jquery.swfupload.js"></script>
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.swfupload/1.0.0/fileprogress.js"></script>
<!--script type="text/javascript" src="$
{
static
}
/plugins/plupload/2.2.1/plupload.full.min.js"></script-->
<!--后台UI-->
<script type="text/javascript" src="$
{
static
}
/skin/manager/$
{
manager_ui
}
/js/ms.manager.js"></script>
<script type="text/javascript" src="$
{
static
}
/skin/manager/$
{
manager_ui
}
/js/ms.web.js"></script>
<!--easyUI-->
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/jquery.easyui/$
{
easyui
}
/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="$
{
static
}
/plugins/jquery.easyui/$
{
easyui
}
/themes/icon.css">
<script type="text/javascript" src="$
{
static
}
/plugins/jquery.easyui/$
{
easyui
}
/jquery.easyui.min.js"></script>
<!--bootstrap=table-->
<link rel="stylesheet" href="$
{
static
}
/plugins/bootstrap-table/1.11.1/bootstrap-table.css">
<link rel="stylesheet" href="$
{
static
}
/plugins/bootstrap-table/1.11.1/extensions/tree-column/bootstrap-table-tree-column.css">
<script src="$
{
static
}
/plugins/bootstrap-table/1.11.1/bootstrap-table.js"></script>
<script src="$
{
static
}
/plugins/bootstrap-table/1.11.1/extensions/tree-column/bootstrap-table-tree-column.min.js"></script>
<script src="$
{
static
}
/plugins//bootstrap-table/1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<!-- vue框架所需要的资源 -->
<script src="$
{
static
}
/plugins/hammerjs/2.0.8/hammer.min.js"></script>
<script src="$
{
static
}
/plugins/vue/2.3.3/vue.min.js"></script>
<link rel="stylesheet" type="text/css" href="$
{
static
}
/skin/manager/$
{
manager_ui
}
/css/ms.manager.min.css" media="all" />
<#assign skin_manager_logo="$
{
static
}
/skin/manager/$
{
manager_ui
}
/images/logo.png"/>
<#assign skin_manager_loadding="$
{
static
}
/skin/manager/$
{
manager_ui
}
/images/loading.gif"/>
<#include "$
{
managerViewPath
}
/include/macro.ftl"/>
<script>
var basePath = "$
{
basePath
}
";
var base = "$
{
base
}
";
var managerPath = "$
{
managerPath
}
";
var static = "$
{
static
}
";
$(function()
{
//启用工具提示
//
$
(
"[data-toggle='tooltip']"
)
.tooltip
()
;
//
$
(
"[data-toggle='popover']"
)
.popover
({
html
:
true
})
;
}
)
<#if manager_session?exists>
var websiteId= "$
{
manager_session
.basicId
?
default
(
'
0
'
)}
" ;
</#if>
</script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="$
{
base
}
/https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="$
{
base
}
/https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" charset="utf-8" src="$
{
base
}
/static/plugins/ueditor/1.4.3.1/ueditor.parse.js"></script>
<script type="text/javascript" charset="utf-8" src="$
{
base
}
/static/plugins/ueditor/1.4.3.1/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="$
{
base
}
/static/plugins/ueditor/1.4.3.1/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="$
{
base
}
/static/plugins/ueditor/1.4.3.1/lang/zh-cn/zh-cn.js"></script>
src/main/webapp/WEB-INF/manager/include/ui/attributes.ftl
0 → 100644
View file @
da21280b
<#
if
id?? && id!=""> id="$
{
id
}
"</#if><#rt/>
<#
if
ajaxUrl?? && ajaxUrl!=""> data-ajax-url="$
{
ajaxUrl
}
"</#if><#rt/>
<#
if
class?? && class!=""> class="$
{
class
}
"</#if><#rt/>
<#
if
style?? && style!=""> style="$
{
style
}
"</#if><#rt/>
<#
if
onclick?? && onclick!=""> onclick="$
{
onclick
}
"</#if><#rt/>
<#
rt
/>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/include/ui/button.ftl
0 → 100644
View file @
da21280b
<#--
表单相关按钮存放区域
-->
<#
macro
buttonarea id="" label="" class="form-group" style="clear: both;" size="">
<
div
class="$
{
class
}
ms-form-group"
<#if id!=""> id="$
{
id
}
"</#if><#rt/>
<#if style?? && style?string!=""> style="$
{
style
}
"</#if><#rt/>
>
<#if label!="">
<label class=" control-label text-right ms-form-label">$
{
label
}
</label>
</#if>
<div class="ms-form-control">
<#nested/><#rt/>
</div>
</
div
>
</#
macro
>
<#--
保存按钮
-->
<#
macro
savebutton value="" id="" name="" class="" style="" disabled=false
onclick
=
"" click=""
>
<button type="button" class="btn btn-success"
<#include "/include/ui/common-attributes.ftl"/><#rt/>
<#if id!=""> id="$
{
id
}
"</#if><#rt/>
>
<#if value!="">$
{
value
}
<#else>保存</#if>
</button><#rt/>
<#if click?? && click!="" && id?? && id!="">
<script>
$(function()
{
$
(
"#${id}"
)
.click
(
function
()
{
eval
(
$
{
click
})
;
})
;
}
)
</script>
</#if>
</#
macro
>
<#--
重置按钮
-->
<#
macro
resetbutton value="" id="" name="" class="" style="" size="" title="" disabled=false>
<button type="reset" class="btn reset"
<#include "/include/ui/common-attributes.ftl"/><#rt/>
>
<#if id!=""> id="$
{
id
}
"</#if><#rt/>
<#if value!="">$
{
value
}
<#else>重置</#if>
</button><#rt/>
</#
macro
>
<#
macro
button value="" id="" name="" class="btn btn-primary" style="" disabled=false
onclick
=
"" click="" url="" toggle="tooltip" target="bottom" icon="" title="" placement="bottom"
>
<button type="button"
<#include "/include/ui/common-attributes.ftl"/><#rt/>
<#if toggle!=""> data-toggle="$
{
toggle
}
"</#if><#rt/>
<#if onclick!=""> onclick="$
{
onclick
}
"</#if><#rt/>
<#if target!=""> data-target="$
{
target
}
"</#if><#rt/>
<#if id!=""> id="$
{
id
}
"</#if><#rt/>
<#if url!=""> data-ajax-url="$
{
url
}
"</#if><#rt/>
<#if placement!=""> data-placement="$
{
placement
}
"</#if><#rt/>
>
<#if value!="">$
{
value
}
<#else>按钮</#if>
<#if icon!=""> <span class="glyphicon glyphicon-$
{
icon
}
" <#if value?trim !="" >style="margin-right:5px"</#if>></span></#if>
</button><#rt/>
<#if click?? && click!="" && id?? && id!="">
<script>
$(function()
{
$
(
"#${id}"
)
.click
(
function
()
{
eval
(
$
{
click
})
;
})
;
}
)
</script>
</#if>
</#
macro
>
<#--按钮组-->
<#
macro
btnGroup value="" id="" name="" class="default" style="" size="" title="" disabled=false >
<button type="button" class="btn btn-$
{
class
}
">$
{
value
}
</button>
<button type="button" class="btn btn-$
{
class
}
dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<#nested/>
</ul>
</#
macro
>
<#--按钮组-子菜单,配合
btnGroup
使用-->
<#
macro
btnGroupLi value="" href="" class="" id="" ajaxUrl="">
<li <#include "/include/ui/attributes.ftl"/><#rt/>><#if href !="" ><a href="$
{
href
}
">$
{
value
}
</a><#else>$
{
value
}
</#if></li>
</#
macro
>
<#--添-->
<#
macro
addButton value="" icon="plus" class="default" id="addButton$
{
.now
?
date
?
string
(
'
yyyyMMddhhmmss
'
)}
" onclick="" title="添加" url="" openModal="" openModalBefor="">
<@ms.isPanelNavBtn id="$
{
id
}
" _id="addButton" class="$
{
class
}
" _class="default"/>
<#if url!="">
<@ms.button icon="$
{
icon
}
" id="$
{
id
}
" value="$
{
value
}
" icon="$
{
icon
}
" class="btn btn-$
{
_
class
}
" onclick="location.href='$
{
url
}
'" title="$
{
title
}
"/>
<#else>
<@ms.button icon="$
{
icon
}
" id="$
{
id
}
" value="$
{
value
}
" icon="$
{
icon
}
" class="btn btn-$
{
_
class
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#if>
<#if openModal!="">
<script>
$(function()
{
$
(
"#${id}"
)
.click
(
function
()
{
<#
if
openModalBefor
!=
""
>
eval
(
"${openModalBefor}()"
)
;
</#
if
>
$
(
"#${openModal}"
)
.modal
()
;
})
;
}
)
</script>
</#if>
</#
macro
>
<#--删-->
<#
macro
delButton value="" icon="trash" class="danger" id="delButton$
{
.now
?
date
?
string
(
'
yyyyMMddhhmmss
'
)}
" onclick="" title="删除" fieldName="" url="">
<#if fieldName!="">
<script>
$(function()
{
$
(
"#${id}"
)
.on
(
"click"
,
function
()
{
var
ids
=
""
;
var
params
=
""
;
var
count
=
0
;
$
(
'
input
[
name
=
"${fieldName}"
]
:
checked
'
)
.each
(
function
(){
ids
+=
$
(
this
)
.val
()
+
","
;
params
+=
"${fieldName}="
+
$
(
this
)
.val
()
+
"&"
;
count
++;
})
;
if
(
count
==
0
)
{
<@
ms
.notify
msg
=
"请选择要删除的数据!"
/>
}
else
{
$
(
'
.deleteModal
$
{
id
}
'
)
.modal
()
;
$
(
"#deleteModal${id}Num"
)
.text
(
count
)
;
$
(
'
.deleteBtn
$
{
id
}
'
)
.on
(
"click"
,
function
()
{
<#
if
onclick
?
has_content
>
eval
(
$
{
onclick
}(
ids
))
;
<#
elseif
url
?
has_content
>
$
(
this
)
.request
({
url
:
"${url}"
,
type
:
"json"
,
data
:
params
,
method
:
"post"
,
func
:
function
(
msg
)
{
if
(
msg
.result
)
{
<@
ms
.notify
msg
=
"删除成功!"
/>
location
.reload
()
;
}
else
{
<@
ms
.notify
msg
=
"删除失败!"
/>
}
}})
;
</#
if
>
})
;
}
})
;
}
)
</script>
</#if>
<@ms.isPanelNavBtn id="$
{
id
}
" _id="delButton" class="$
{
class
}
" _class="danger"/>
<!--删除提示-->
<@ms.modal modalName="deleteModal$
{
id
}
" title="删除提示!">
<@ms.modalBody>
确认删除<span style="color: red; font-size: 20px;" id="deleteModal$
{
id
}
Num"></span>条记录?
</@ms.modalBody>
<@ms.modalButton>
<@ms.button class="btn btn-danger deleteBtn$
{
id
}
" value="确定删除"/>
</@ms.modalButton>
</@ms.modal>
<@ms.button icon="$
{
icon
}
" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" class="btn btn-$
{
_
class
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
editButton value="" icon="edit" class="warning" id="editButton$
{
.now
?
date
?
string
(
'
yyyyMMddhhmmss
'
)}
" onclick="" title="编辑">
<@ms.isPanelNavBtn id="$
{
id
}
" _id="editButton" class="$
{
class
}
" _class="danger"/>
<@ms.button icon="$
{
icon
}
" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" class="btn btn-$
{
_
class
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
queryButton value="查询" icon="search" class="default" id="queryButton$
{
.now
?
date
?
string
(
'
yyyyMMddhhmmss
'
)}
" onclick="" title="查询" form="" >
<@ms.button class="btn btn-info" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
<#if onclick=="" && form!="">
<script>
$(function()
{
$
(
"#${id}"
)
.click
(
function
()
{
$
(
"#${form}"
)[
0
]
.submit();
})
}
)
</script>
</#if>
</#
macro
>
<#--返回-->
<#
macro
backButton value="返回" icon="share-alt" class="default" id="backButton$
{
.now
?
date
?
string
(
'
yyyyMMddhhmmss
'
)}
" onclick="javascript:history.go(-1)" title="返回">
<@ms.button value="$
{
value
}
" icon="$
{
icon
}
" onclick="$
{
onclick
}
" class="btn btn-$
{
class
}
" title="$
{
title
}
" id="$
{
id
}
"/>
</#
macro
>
<#--保存-->
<#
macro
saveButton value="保存" icon="floppy-saved" class="default" id="saveButton$
{
.now
?
date
?
string
(
'
yyyyMMddhhmmss
'
)}
" onclick="" title="保存" postForm="" postBefor="" postAfter="">
<@ms.button icon="$
{
icon
}
" class="btn btn-success" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
" />
<@ms.event postForm="$
{
postForm
}
" postBefor="$
{
postBefor
}
" postAfter="$
{
postBefor
}
" id="$
{
id
}
"/>
</#
macro
>
<#
macro
updateButton value="更新" icon="open" class="default" id="updateButton" onclick="" title="更新" postForm="" postBefor="" postAfter="" postForm="" postBefor="" postAfter="">
<@ms.button icon="$
{
icon
}
" class="btn btn-success" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
<@ms.event postForm="$
{
postForm
}
" postBefor="$
{
postBefor
}
" postAfter="$
{
postBefor
}
" id="$
{
id
}
"/>
</#
macro
>
<#
macro
resetButton value="重置" icon="retweet" class="warning" id="resetButton$
{
.now
?
long
}
" onclick="" title="重置" form="" >
<@ms.button icon="$
{
icon
}
" class="btn btn-warning" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
<script>
<#--优先click事件-->
<#if onclick=="">
$(function()
{
$
(
"#${id}"
)
.click
(
function
()
{
<#
if
form
!=
""
>
$
(
"#${form}"
)[
0
]
.reset();
<#
else
>
$
(
"#${id}"
)
.parents
(
"form:first"
)[
0
]
.reset();
</#
if
>
})
}
)
</#if>
</script>
</#
macro
>
<#
macro
exportButton value="导出" icon="export" class="default" id="exportButton" onclick="" title="导出" >
<@ms.button icon="$
{
icon
}
" class="btn btn-default" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
importButton value="导入" icon="import" class="warning" id="importButton" onclick="" title="导入" >
<@ms.button icon="$
{
icon
}
" class="btn btn-default" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
setingButton value="设置" icon="cog" class="warning" id="importButton" onclick="" title="设置" >
<@ms.button icon="$
{
icon
}
" class="btn btn-primary" value="$
{
value
}
" icon="$
{
icon
}
" id="$
{
id
}
" onclick="$
{
onclick
}
" title="$
{
title
}
"/>
</#
macro
>
<#
macro
event postForm="" postBefor="" postAfter="" id="">
<#if postForm!="">
<script>
$(function()
{
$
(
"#${id}"
)
.click
(
function
()
{
var
vobj
=
true
;
try
{
vobj
=
$
(
"#${postForm}"
)
.data
(
'
bootstrapValidator
'
)
.validate
()
.isValid
()
;
}
catch
(
e
){}
var
postBefor
=
true
;
<#
if
postBefor
!=
""
>
postBefor
=
eval
(
$
{
postBefor
}())
;
</#
if
>
if
(
vobj
&&
postBefor
)
{
$
(
this
)
.postForm
(
"#${postForm}"
,{
func
:
function
(
msg
)
{
if
(
msg
.result
)
{
//
history
.back
()
;
<@
ms
.notify
msg
=
"保存成功!"
type
=
"success"
/>
var
redirect
=
$
(
"#${postForm} input[name='redirect']"
)
.val
()
;
if
(
redirect
!=
""
)
{
location
.href
=
redirect
;
}
<#
if
postAfter
!=
""
>
eval
(
$
{
postAfter
}(
msg
))
;
</#
if
>
}
else
{
var
message
=
msg
.resultMsg
;
if
(
message
==
""
||
message
==
undefined
)
{
message
=
"后台验证失败"
;
}
$
(
'
.ms-notifications
'
)
.notify
({
type
:
'
warning
'
,
message
:
{
text
:
message
}
})
.show
()
;
}
}})
;
}
else
{
<@
ms
.notify
msg
=
"验证失败,请重新输入!"
/>
}
})
;
}
)
</script>
</#if>
</#
macro
>
<#--按钮组-->
<#
macro
buttonGroup role="group">
<div class="btn-group" role="$
{
role
}
">
<#nested/>
</div>
</#
macro
>
<#
macro
menuButton links name="菜单名称" class="default">
<
div
class="btn-group dropdown">
<button type="button" class="btn btn-$
{
class
}
">$
{
name
}
</button>
<button type="button" class="btn btn-$
{
class
}
dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only"></span>
</button>
<ul class="dropdown-menu">
<#list links as b>
<li><a href="javascript:$
{
b
.click
?
default
(
"void"
)}
()">$
{
b
.name
?
default
(
"菜单"
)}
</a></li>
</#list>
</ul>
</
div
>
</#
macro
>
<#
macro
switchButton name on off size="small" value="" class="" color="default" onclass="danger" offclass="primary">
<input type="checkbox" class="ms-button-switch-$
{
name
}
" data-on="$
{
onclass
}
" data-off="$
{
offclass
}
" data-size="$
{
size
}
" data-on-text="$
{
on
.text
}
" data-off-text="$
{
off
.text
}
" data-off-color="$
{
color
}
"/>
<script>
$(function()
{
<#
if
value
!=
""
>
<#
if
value
==
on
.value
?
string
>
$
(
".ms-button-switch-${name}"
)
.bootstrapSwitch
(
'
state
'
,
true
)
;
<#
else
>
$
(
".ms-button-switch-${name}"
)
.bootstrapSwitch
(
'
state
'
,
false
)
;
</#
if
>
<#
else
>
$
(
".ms-button-switch-${name}"
)
.bootstrapSwitch
(
'
state
'
,
true
)
;
</#
if
>
$
(
'
.ms-button-switch-
$
{
name
}
'
)
.on
(
'
switchChange
.bootstrapSwitch
'
,
function
(
event
,
state
)
{
if
(
state
)
{
$
(
"input[name='${name}']"
)
.val
(
'$
{
on
.value
}
'
)
;
}
else
{
$
(
"input[name='${name}']"
)
.val
(
'$
{
off
.value
}
'
)
;
}
})
;
}
)
</script>
<input type="hidden" name="$
{
name
}
" value="$
{
value
}
"/>
</#
macro
>
src/main/webapp/WEB-INF/manager/include/ui/checkboxlist-item.ftl
0 → 100644
View file @
da21280b
<label class="ms-check"><input type="checkbox"<#rt/>
value="$
{
rkey
}
"<#rt/>
<#if valueList?seq_contains(rkey)> checked="checked"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
/> $
{
rvalue
}
</label><#if hasNext> </#if>
src/main/webapp/WEB-INF/manager/include/ui/checkboxlist.ftl
0 → 100644
View file @
da21280b
<#--
4.5.5开始废弃
<
input
type="checkbox"/>
-->
<#
macro
checkboxlist
list listKey="" listValue="" valueList=[]
label="" colon=":" hasColon="true"
id="" name="" class="" style="" size="" title="" disabled=false
validation="" direction=true
width=""
labelStyle=""
help=""
>
<
div
class="form-group ms-form-group">
<#include "control.ftl"/><#rt/>
<div class="col-sm-10" <#if width!=""> style="$
{
width
}
px"</#if><#rt/>>
<#if list?is_sequence>
<#if listKey!="" && listValue!="">
<#list list as item>
<#local rkey=item[listKey]>
<#local rvalue=item[listValue]>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "checkboxlist-item.ftl"><#t/>
</#list>
<#else>
<#list list as item>
<#local rkey=item>
<#local rvalue=item>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "checkboxlist-item.ftl"><#t/>
</#list>
</#if>
<#else>
<#list list?keys as key>
<#local rkey=key/>
<#local rvalue=list[key]/>
<#local index=key_index>
<#local hasNext=key_has_next>
<#include "checkboxlist-item.ftl"><#t/>
</#list>
</#if>
</div>
</
div
>
</#
macro
>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/include/ui/common-attributes.ftl
0 → 100644
View file @
da21280b
<#
if
name!=""> name="$
{
name
}
"</#if><#rt/>
<#
if
class!=""> class="$
{
class
}
"</#if><#rt/>
<#
if
style!=""> style="$
{
style
}
"</#if><#rt/>
<#
if
title?? && title!=""> title="$
{
title
}
"</#if><#rt/>
<#
if
disabled?? && disabled> disabled="disabled"</#if><#rt/>
<#
if
maxlength?? && maxlength!=""> maxlength="$
{
maxlength
}
"</#if><#rt/>
<#
if
minlength?? && minlength!=""> minlength="$
{
minlength
}
"</#if><#rt/>
<#
if
name!=""> name="$
{
name
}
"</#if><#rt/>
<#
if
placeholder?? && placeholder!=""> placeholder="$
{
placeholder
}
"</#if><#rt/>
<#
if
validation?? && validation?has_content><#--验证框架,需要bootstrapValidator框架-->
<#list validation?keys as key>
$
{
key
}
="$
{
validation
[
key
]}
"<#rt/>
</#list>
</#
if
>
<#
if
onclick?? && onclick!=""> onclick="$
{
onclick
}
"</#if><#rt/>
<#
rt
/>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/include/ui/control.ftl
0 → 100644
View file @
da21280b
<#
if
label!="">
<#assign tmp="2">
<label <#if name?? && name!="">for="$
{
name
}
"</#if> <#if labelStyle?? && labelStyle!="">style="$
{
labelStyle
?
default
(
''
)}
"</#if> <#if colSm?? && colSm!=""><#assign tmp="$
{
colSm
}
"></#if> class="col-sm-$
{
tmp
}
control-label ">
<#if help!="">
<script>
$(function ()
{
$
(
'[
data-toggle
=
"popover"
]'
)
.popover
()
}
)
</script>
<span tabindex="0" class="glyphicon glyphicon-question-sign" data-toggle="popover" role="button" data-trigger="focus" data-container="body" data-placement="$
{
helpDirection
?
default
(
'
rigth
'
)}
" title="提示" data-content="$
{
help
}
"></span>
</#if>
$
{
label
}
</label>
</#
if
>
\ No newline at end of file
src/main/webapp/WEB-INF/manager/include/ui/date.ftl
0 → 100644
View file @
da21280b
<#--
<
input
type="text"/>
-->
<#
macro
date id="" name="" value="" begin="" end="" limit="30"
time=false single=false label="" title="" size="" width=""
class="form-control" style="" readonly="" validation="" disabled=false maxlength="" minlength="" placeholder="" ranges=true
labelStyle=""
help=""
helpDirection=""
>
<
div
class="form-group ms-form-group">
<#include "control.ftl"/><#rt/>
<div class="control-group col-sm-9 ms-from-group-input has-feedback" style="min-width:200px;<#if width!=""> width:$
{
width
}
px"</#if>"<#rt/>>
<div class="controls">
<div class="input-prepend input-group">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
<input type="text"<#rt/>
<#if id!=""> id="$
{
id
}
"<#elseif name!="">id="$
{
name
}
"</#if><#rt/>
<#if maxlength!=""> maxlength="$
{
maxlength
}
"</#if><#rt/>
<#if readonly!=""> readonly="$
{
readonly
}
"</#if><#rt/>
<#if value?? && value?string!=""> value="$
{
value
?
html
}
"</#if><#rt/>
<#include "common-attributes.ftl"/><#rt/>
/><#rt/>
</div>
</div>
</div>
</
div
>
<
script
>
var $
{
name
}
Set =
{
startDate
:
moment
()
.subtract
(
29
,
'
days
'
),
endDate
:
moment
(),
<#
if
begin
?
has_content
>
minDate
:
'$
{
begin
?
string
(
'
yyyy-MM-dd
'
)}
'
,
</#
if
>
<#
if
end
?
has_content
>
maxDate
:
'$
{
end
?
string
(
'
yyyy-MM-dd
'
)}
'
,
</#
if
>
dateLimit
:
{
days
:
$
{
limit
}
},
showDropdowns
:
true
,
showWeekNumbers
:
true
,
<#
if
time
>
timePicker
:
true
,
timePickerIncrement
:
1
,
</#
if
>
<#
if
single
>
singleDatePicker
:
true
,
</#
if
>
timePicker12Hour
:
true
,
<#
if
ranges
>
ranges
:
{
'今天'
:
[
moment
(),
moment
()
]
,
'昨天'
:
[
moment
()
.subtract
(
1
,
'
days
'
),
moment
()
.subtract
(
1
,
'
days
'
)
]
,
'最近
7
天'
:
[
moment
()
.subtract
(
6
,
'
days
'
),
moment
()
]
,
'最近
30
天'
:
[
moment
()
.subtract
(
29
,
'
days
'
),
moment
()
]
,
'当月'
:
[
moment
()
.startOf
(
'
month
'
),
moment
()
.endOf
(
'
month
'
)
]
,
'上个月'
:
[
moment
()
.subtract
(
1
,
'
month
'
)
.startOf
(
'
month
'
),
moment
()
.subtract
(
1
,
'
month
'
)
.endOf
(
'
month
'
)
]
,
},
</#
if
>
opens
:
'
left
'
,
buttonClasses
:
['
btn
btn-default
']
,
applyClass
:
'
btn-small
btn-primary
'
,
cancelClass
:
'
btn-small
'
,
format
:
'
YYYY
-MM-DD
<#
if
time
>
HH
:
mm
:
ss
</#
if
>'
,
separator
:
'至'
,
locale
:
{
applyLabel
:
'确认'
,
cancelLabel
:
'取消'
,
//
fromLabel
:
'开始时间'
,
//
toLabel
:
'结束时间'
,
customRangeLabel
:
'自定义'
,
daysOfWeek
:
['日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六']
,
monthNames
:
['一月'
,
'二月'
,
'三月'
,
'四月'
,
'五月'
,
'六月'
,
'七月'
,
'八月'
,
'九月'
,
'十月'
,
'十一月'
,
'十二月']
,
firstDay
:
1
}
}
;
var $
{
name
}
Func = function(start, end, label)
{
//
alert
(
"Callback has fired: ["
+
start
.format
(
'
MMMM
D
,
YYYY
'
)
+
" to "
+
end
.format
(
'
MMMM
D
,
YYYY
'
)
+
", label = "
+
label
+
"]"
)
;
//$
(
'#
subscribeReplyForm
'
)
.formValidation
(
'
revalidateField
'
,
"${name}"
)
;
}
$('#$
{
name
}
').daterangepicker($
{
name
}
Set, $
{
name
}
Func);
$('#$
{
name
}
').on('apply.daterangepicker', function(ev, picker)
{
//
$
(
'#$
{
name
}
'
)
.parents
(
"form:first"
)
.data
(
'
bootstrapValidator
'
)
.revalidateField
(
'<#
if
id
!=
""
>$
{
id
}
<#
elseif
name
!=
""
>$
{
name
}
</#
if
>'
)
;
}
);
</
script
>
</#
macro
>
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
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