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
cd4672a3
"doc/mcms-5.2.1.sql" did not exist on "55b338db4e865bf259de2b6fb2bae55c36854633"
Commit
cd4672a3
authored
Jan 15, 2019
by
killfen
Browse files
配置优化
parent
da21280b
Changes
24
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
cd4672a3
...
...
@@ -6,7 +6,7 @@
<groupId>
net.mingsoft
</groupId>
<artifactId>
mcms
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
mcms
</name>
<name>
mcms
1
</name>
<packaging>
war
</packaging>
<properties>
<java.version>
1.8
</java.version>
...
...
src/main/resources/application.yml
View file @
cd4672a3
...
...
@@ -17,21 +17,18 @@ spring:
multipart
:
max-request-size
:
100MB
freemarker
:
allow-request-override
:
false
allow-session-override
:
false
cache
:
false
suffix
:
.ftl
charset
:
UTF-8
check-template-location
:
true
content-type
:
text/html
enabled
:
true
expose-request-attributes
:
false
expose-session-attributes
:
false
allow-request-override
:
true
allow-session-override
:
true
expose-request-attributes
:
true
expose-session-attributes
:
true
expose-spring-macro-helpers
:
true
prefer-file-system-access
:
true
suffix
:
.ftl
template-loader-path
:
classpath:/WEB-INF/manager/
template-loader-path
:
classpath:/WEB-INF/manager
settings
:
template_update_delay
:
0
template_update_delay
:
1
default_encoding
:
UTF-8
classic_compatible
:
true
date_format
:
yyyy-MM-dd
...
...
@@ -56,7 +53,7 @@ ms:
manager
:
path
:
/ms
view
:
#已过期
path
:
path
:
/WEB-INF/manager
session
:
timeout
:
1800000
#会话超时, 单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms
validation.interval
:
120000
#会话清理间隔时间, 单位:毫秒,2m=120000ms
...
...
src/main/webapp/WEB-INF/manager/basic/index.ftl
View file @
cd4672a3
<!
DOCTYPE
html>
<
html
lang="en">
<
head
>
<#
include
"
$
{
managerViewPath
}
/include/meta.ftl"/> <!--调用head内样式信息-->
<#
include
"/include/meta.ftl"/> <!--调用head内样式信息-->
<
script
type="text/javascript" src="$
{
base
}
/jquery/zTree_v3/jquery.ztree.all-3.5.min.js"></script>
<
link
rel="stylesheet" href="$
{
base
}
/jquery/zTree_v3/zTreeStyle.css" type="text/css">
</
head
>
...
...
src/main/webapp/WEB-INF/manager/category/index.ftl
View file @
cd4672a3
...
...
@@ -10,7 +10,7 @@
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<#include "
$
{
managerViewPath
}
/$
{
model
?
default
(
''
)}
/category/shiro-button.ftl"/>
<#include "/$
{
model
?
default
(
''
)}
/category/shiro-button.ftl"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
...
...
@@ -56,7 +56,7 @@
field
:
'
categoryTitle
'
,
title
:
'$
{
modelTitle
}
标题'
,
formatter
:
function
(
value
,
row
,
index
)
{
<#
include
"
${managerViewPath}
/${model?default('')}/category/shiro-update.ftl"
/>
<#
include
"/${model?default('')}/category/shiro-update.ftl"
/>
}
},
{
field
:
'
categoryDescription
'
,
...
...
src/main/webapp/WEB-INF/manager/column/index.ftl
View file @
cd4672a3
...
...
@@ -9,7 +9,7 @@
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<#include "
$
{
managerViewPath
}
/$
{
model
?
default
(
''
)}
/column/shiro-button.ftl"/>
<#include "/$
{
model
?
default
(
''
)}
/column/shiro-button.ftl"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
...
...
@@ -53,7 +53,7 @@
title
:
'标题'
,
align
:
'
left
'
,
formatter
:
function
(
value
,
row
,
index
)
{
<#
include
"
${managerViewPath}
/${model?default('')}/column/shiro-update.ftl"
/>
<#
include
"/${model?default('')}/column/shiro-update.ftl"
/>
}
},{
field
:
'
columnType
'
,
...
...
src/main/webapp/WEB-INF/manager/include/macro.ftl
View file @
cd4672a3
<#
include
"/include/ui/index.ftl"/>
<#
include
"/include/manager.ftl"/>
<#
global
autoCURD=""/>
<#
macro
autoCURD>
<#local url=baseUrl?split("?")?first?split("/")?last/>
...
...
@@ -8,7 +9,7 @@
<#global autoCURD="update">
</#if>
</#
macro
>
<@
autoCURD
/>
<@
ms
.
autoCURD
/>
<#--权限控制-->
<#-
-link
:必须
type:add/del/edit/query class:样式 id,value:显示文字-->
...
...
src/main/webapp/WEB-INF/manager/include/manager.ftl
View file @
cd4672a3
...
...
@@ -4,8 +4,8 @@
<!
DOCTYPE
html>
<
html
lang="en">
<head>
<#include "
$
{
managerViewPath
}
/include/macro.ftl"/>
<#include "
$
{
managerViewPath
}
/include/meta.ftl"/>
<#include "/include/macro.ftl"/>
<#include "/include/meta.ftl"/>
</head>
<body>
<div class="ms-content">
...
...
src/main/webapp/WEB-INF/manager/include/meta.ftl
View file @
cd4672a3
...
...
@@ -71,7 +71,7 @@
<#include "
$
{
managerViewPath
}
/include/macro.ftl"/>
<#include "/include/macro.ftl"/>
<script>
var basePath = "$
{
basePath
}
";
var base = "$
{
base
}
";
...
...
src/main/webapp/WEB-INF/manager/include/ui/button.ftl
View file @
cd4672a3
<#--
表单相关按钮存放区域
-->
<#
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
>
<#--
表单相关按钮存放区域
-->
<#
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.ftl
View file @
cd4672a3
...
...
@@ -12,7 +12,7 @@
help=""
>
<
div
class="form-group ms-form-group">
<#include "control.ftl"/><#rt/>
<#include "
/include/ui/
control.ftl"/><#rt/>
<div class="col-sm-10" <#if width!=""> style="$
{
width
}
px"</#if><#rt/>>
<#if list?is_sequence>
<#if listKey!="" && listValue!="">
...
...
@@ -21,7 +21,7 @@
<#local rvalue=item[listValue]>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "checkboxlist-item.ftl"><#t/>
<#include "
/include/ui/
checkboxlist-item.ftl"><#t/>
</#list>
<#else>
<#list list as item>
...
...
@@ -29,7 +29,7 @@
<#local rvalue=item>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "checkboxlist-item.ftl"><#t/>
<#include "
/include/ui/
checkboxlist-item.ftl"><#t/>
</#list>
</#if>
<#else>
...
...
@@ -38,7 +38,7 @@
<#local rvalue=list[key]/>
<#local index=key_index>
<#local hasNext=key_has_next>
<#include "checkboxlist-item.ftl"><#t/>
<#include "
/include/ui/
checkboxlist-item.ftl"><#t/>
</#list>
</#if>
</div>
...
...
src/main/webapp/WEB-INF/manager/include/ui/date.ftl
View file @
cd4672a3
...
...
@@ -9,7 +9,7 @@
helpDirection=""
>
<
div
class="form-group ms-form-group">
<#include "control.ftl"/><#rt/>
<#include "
/include/ui/
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">
...
...
@@ -19,7 +19,7 @@
<#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/>
<#include "
/include/ui/
common-attributes.ftl"/><#rt/>
/><#rt/>
</div>
</div>
...
...
src/main/webapp/WEB-INF/manager/include/ui/editor.ftl
View file @
cd4672a3
...
...
@@ -4,7 +4,7 @@
<#-
-content
:初始化内容-->
<#
macro
editor name label="" content="" validation="" width="100%" height="480" labelStyle="" appId="" help="" helpDirection="" colSm="">
<
div
class="form-group ms-form-group">
<#include "control.ftl"/><#rt/>
<#include "
/include/ui/
control.ftl"/><#rt/>
<div class="ms-form-control ms-from-group-input col-sm-9 has-feedback">
<script type="text/plain" id="editor_$
{
name
}
" name="$
{
name
}
" style="width:$
{
width
}
px;height:$
{
height
}
px">$
{
content
?
default
(
''
)}
</script>
<script type="text/javascript">
...
...
src/main/webapp/WEB-INF/manager/include/ui/file.ftl
View file @
cd4672a3
...
...
@@ -7,13 +7,13 @@
id="" name="" class="" style="" size="" title="" disabled="" tabindex="" accesskey="" labelStyle=""
onclick="" ondblclick="" onmousedown="" onmouseup="" onmouseover="" onmousemove="" onmouseout="" onfocus="" onblur="" onkeypress="" onkeydown="" onkeyup="" onselect="" onchange=""
>
<#
include
"control.ftl"/><#rt/>
<#
include
"
/include/ui/
control.ftl"/><#rt/>
<
input
type="file"<#rt/>
<#
if
id!=""> id="$
{
id
}
"</#if><#rt/>
<#
if
accept!=""> accept="$
{
accept
}
"</#if><#rt/>
<#
if
value!=""> value="$
{
value
}
"</#if><#rt/>
<#
include
"common-attributes.ftl"/><#rt/>
<#
include
"scripting-events.ftl"/><#rt/>
<#
include
"
/include/ui/
common-attributes.ftl"/><#rt/>
<#
include
"
/include/ui/
scripting-events.ftl"/><#rt/>
/>
<#
include
"control-close.ftl"/><#rt/>
<#
include
"
/include/ui/
control-close.ftl"/><#rt/>
</#
macro
>
src/main/webapp/WEB-INF/manager/include/ui/index.ftl
View file @
cd4672a3
...
...
@@ -9,7 +9,6 @@
<#
include
"/include/ui/editor.ftl"/>
<#
include
"/include/ui/time.ftl"/>
<#
include
"/include/ui/tree.ftl"/>
<#
include
"/include/manager.ftl"/>
<#
include
"/include/ui/page.ftl"/>
<#
include
"/include/ui/table.ftl"/>
<#
include
"/include/ui/modal.ftl"/>
...
...
src/main/webapp/WEB-INF/manager/include/ui/input.ftl
View file @
cd4672a3
...
...
@@ -92,7 +92,7 @@
<#local rvalue=item[listValue]>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "radio-item.ftl"><#t/>
<#include "
/include/ui/
radio-item.ftl"><#t/>
</#list>
<#else>
<#list list as item>
...
...
@@ -100,7 +100,7 @@
<#local rvalue=item>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "radio-item.ftl"><#t/>
<#include "
/include/ui/
radio-item.ftl"><#t/>
</#list>
</#if>
<#else>
...
...
@@ -109,7 +109,7 @@
<#local rvalue=list[key]/>
<#local index=key_index>
<#local hasNext=key_has_next>
<#include "radio-item.ftl"><#t/>
<#include "
/include/ui/
radio-item.ftl"><#t/>
</#list>
</#if>
</div>
...
...
src/main/webapp/WEB-INF/manager/include/ui/page.ftl
View file @
cd4672a3
...
...
@@ -3,8 +3,8 @@
<!
DOCTYPE
html>
<
html
lang="en">
<head>
<#include "
$
{
managerViewPath
}
/include/macro.ftl"/>
<#include "
$
{
managerViewPath
}
/include/meta.ftl"/>
<#include "/include/macro.ftl"/>
<#include "/include/meta.ftl"/>
</head>
<body>
<div class="ms-content">
...
...
src/main/webapp/WEB-INF/manager/include/ui/radio-item.ftl
View file @
cd4672a3
...
...
@@ -3,5 +3,5 @@
<#if onclick?? && onclick!=""> onclick="$
{
onclick
}
"</#if><#rt/>
<#
if
disabled?? && disabled> disabled="disabled" </#if><#rt/>
<#
if
(rkey?string=="" && (!value?? || value?string=="")) || (value?? && value?string!="" && value?string==rkey?string)> checked="checked"</#if><#rt/>
<#
include
"common-attributes.ftl"/><#rt/>
<#
include
"
/include/ui/
common-attributes.ftl"/><#rt/>
/>
$
{
rvalue
}
</label> <#if hasNext> </#if>
src/main/webapp/WEB-INF/manager/include/ui/time.ftl
View file @
cd4672a3
...
...
@@ -8,7 +8,7 @@
helpDirection=""
>
<
div
class="form-group ms-form-group">
<#include "control.ftl"/><#rt/>
<#include "
/include/ui/
control.ftl"/><#rt/>
<div class="control-group col-sm-9 ms-from-group-input" style="min-widht:200px;<#if width!="">width:$
{
width
}
px</#if>"<#rt/>>
<div class="controls">
<div class="input-prepend input-group date" <#if id!=""> id="$
{
id
}
"<#elseif name!="">id="$
{
name
}
"</#if><#rt/>
...
...
@@ -18,7 +18,7 @@
<#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/>/>
<#include "
/include/ui/
common-attributes.ftl"/><#rt/>/>
</div>
</div>
</div>
...
...
src/main/webapp/WEB-INF/manager/include/ui/tree.ftl
View file @
cd4672a3
...
...
@@ -267,7 +267,7 @@
<#
elseif
type=="default"> <#--默认调用方式在4.5.5将废弃-->
<!--
初始化样式开始 -->
<div class="form-group ms-form-group ">
<#include "control.ftl"/><#rt/>
<#include "
/include/ui/
control.ftl"/><#rt/>
<div class="ms-form-control <#if label!="">col-sm-9</#if>">
<ul class="ztree" id="treeDome$
{
treeId
}
">
</ul>
...
...
src/main/webapp/WEB-INF/manager/index.ftl
View file @
cd4672a3
...
...
@@ -3,8 +3,8 @@
<
head
>
<
title
><#
if
app?has_content>$
{
app
.basicTitle
}
<#else>MS</#if>管理系统</title>
<
link
rel="bookmark" href="favicon.ico"/>
<#
include
"
$
{
managerViewPath
}
/include/macro.ftl"/>
<#
include
"
$
{
managerViewPath
}
/include/meta.ftl"/>
<#
include
"/include/macro.ftl"/>
<#
include
"/include/meta.ftl"/>
<
script
src="http://cdn.mingsoft.net/model/4.6.0/ms.mstore.client.min.js"></script>
</
head
>
<
script
type="text/javascript">
...
...
Prev
1
2
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