parent
da21280bb3
commit
cd4672a3dd
24 changed files with 379 additions and 472 deletions
@ -1,333 +1,333 @@ |
|||||||
<#-- |
<#-- |
||||||
表单相关按钮存放区域 |
表单相关按钮存放区域 |
||||||
--> |
--> |
||||||
<#macro buttonarea id="" label="" class="form-group" style="clear: both;" size=""> |
<#macro buttonarea id="" label="" class="form-group" style="clear: both;" size=""> |
||||||
<div class="${class} ms-form-group" |
<div class="${class} ms-form-group" |
||||||
<#if id!=""> id="${id}"</#if><#rt/> |
<#if id!=""> id="${id}"</#if><#rt/> |
||||||
<#if style?? && style?string!=""> style="${style}"</#if><#rt/> |
<#if style?? && style?string!=""> style="${style}"</#if><#rt/> |
||||||
> |
> |
||||||
<#if label!=""> |
<#if label!=""> |
||||||
<label class=" control-label text-right ms-form-label">${label}</label> |
<label class=" control-label text-right ms-form-label">${label}</label> |
||||||
</#if> |
</#if> |
||||||
<div class="ms-form-control"> |
<div class="ms-form-control"> |
||||||
<#nested/><#rt/> |
<#nested/><#rt/> |
||||||
</div> |
</div> |
||||||
</div> |
</div> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#-- |
<#-- |
||||||
保存按钮 |
保存按钮 |
||||||
--> |
--> |
||||||
<#macro savebutton value="" id="" name="" class="" style="" disabled=false |
<#macro savebutton value="" id="" name="" class="" style="" disabled=false |
||||||
onclick="" click="" |
onclick="" click="" |
||||||
> |
> |
||||||
<button type="button" class="btn btn-success" |
<button type="button" class="btn btn-success" |
||||||
<#include "/include/ui/common-attributes.ftl"/><#rt/> |
<#include "/include/ui/common-attributes.ftl"/><#rt/> |
||||||
<#if id!=""> id="${id}"</#if><#rt/> |
<#if id!=""> id="${id}"</#if><#rt/> |
||||||
> |
> |
||||||
<#if value!="">${value}<#else>保存</#if> |
<#if value!="">${value}<#else>保存</#if> |
||||||
</button><#rt/> |
</button><#rt/> |
||||||
<#if click?? && click!="" && id?? && id!=""> |
<#if click?? && click!="" && id?? && id!=""> |
||||||
<script> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").click(function() { |
$("#${id}").click(function() { |
||||||
eval(${click}); |
eval(${click}); |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
</#if> |
</#if> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#-- |
<#-- |
||||||
重置按钮 |
重置按钮 |
||||||
--> |
--> |
||||||
<#macro resetbutton value="" id="" name="" class="" style="" size="" title="" disabled=false> |
<#macro resetbutton value="" id="" name="" class="" style="" size="" title="" disabled=false> |
||||||
<button type="reset" class="btn reset" |
<button type="reset" class="btn reset" |
||||||
<#include "/include/ui/common-attributes.ftl"/><#rt/> |
<#include "/include/ui/common-attributes.ftl"/><#rt/> |
||||||
> |
> |
||||||
<#if id!=""> id="${id}"</#if><#rt/> |
<#if id!=""> id="${id}"</#if><#rt/> |
||||||
<#if value!="">${value}<#else>重置</#if> |
<#if value!="">${value}<#else>重置</#if> |
||||||
</button><#rt/> |
</button><#rt/> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#macro button value="" id="" name="" class="btn btn-primary" style="" disabled=false |
<#macro button value="" id="" name="" class="btn btn-primary" style="" disabled=false |
||||||
onclick="" click="" url="" toggle="tooltip" target="bottom" icon="" title="" placement="bottom" |
onclick="" click="" url="" toggle="tooltip" target="bottom" icon="" title="" placement="bottom" |
||||||
> |
> |
||||||
<button type="button" |
<button type="button" |
||||||
<#include "/include/ui/common-attributes.ftl"/><#rt/> |
<#include "/include/ui/common-attributes.ftl"/><#rt/> |
||||||
<#if toggle!=""> data-toggle="${toggle}"</#if><#rt/> |
<#if toggle!=""> data-toggle="${toggle}"</#if><#rt/> |
||||||
<#if onclick!=""> onclick="${onclick}"</#if><#rt/> |
<#if onclick!=""> onclick="${onclick}"</#if><#rt/> |
||||||
<#if target!=""> data-target="${target}"</#if><#rt/> |
<#if target!=""> data-target="${target}"</#if><#rt/> |
||||||
<#if id!=""> id="${id}"</#if><#rt/> |
<#if id!=""> id="${id}"</#if><#rt/> |
||||||
<#if url!=""> data-ajax-url="${url}"</#if><#rt/> |
<#if url!=""> data-ajax-url="${url}"</#if><#rt/> |
||||||
<#if placement!=""> data-placement="${placement}"</#if><#rt/> |
<#if placement!=""> data-placement="${placement}"</#if><#rt/> |
||||||
|
|
||||||
> |
> |
||||||
<#if value!="">${value}<#else>按钮</#if> |
<#if value!="">${value}<#else>按钮</#if> |
||||||
<#if icon!=""> <span class="glyphicon glyphicon-${icon}" <#if value?trim !="" >style="margin-right:5px"</#if>></span></#if> |
<#if icon!=""> <span class="glyphicon glyphicon-${icon}" <#if value?trim !="" >style="margin-right:5px"</#if>></span></#if> |
||||||
|
|
||||||
</button><#rt/> |
</button><#rt/> |
||||||
<#if click?? && click!="" && id?? && id!=""> |
<#if click?? && click!="" && id?? && id!=""> |
||||||
<script> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").click(function() { |
$("#${id}").click(function() { |
||||||
eval(${click}); |
eval(${click}); |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
</#if> |
</#if> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<#--按钮组--> |
<#--按钮组--> |
||||||
<#macro btnGroup value="" id="" name="" class="default" style="" size="" title="" disabled=false > |
<#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}">${value}</button> |
||||||
<button type="button" class="btn btn-${class} dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
<button type="button" class="btn btn-${class} dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
||||||
<span class="caret"></span> |
<span class="caret"></span> |
||||||
<span class="sr-only">Toggle Dropdown</span> |
<span class="sr-only">Toggle Dropdown</span> |
||||||
</button> |
</button> |
||||||
<ul class="dropdown-menu" role="menu"> |
<ul class="dropdown-menu" role="menu"> |
||||||
<#nested/> |
<#nested/> |
||||||
</ul> |
</ul> |
||||||
</#macro> |
</#macro> |
||||||
<#--按钮组-子菜单,配合btnGroup使用--> |
<#--按钮组-子菜单,配合btnGroup使用--> |
||||||
<#macro btnGroupLi value="" href="" class="" id="" ajaxUrl=""> |
<#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> |
<li <#include "/include/ui/attributes.ftl"/><#rt/>><#if href !="" ><a href="${href}">${value}</a><#else>${value}</#if></li> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<#--添--> |
<#--添--> |
||||||
<#macro addButton value="" icon="plus" class="default" id="addButton${.now?date?string('yyyyMMddhhmmss')}" onclick="" title="添加" url="" openModal="" openModalBefor=""> |
<#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"/> |
<@ms.isPanelNavBtn id="${id}" _id="addButton" class="${class}" _class="default"/> |
||||||
<#if url!=""> |
<#if url!=""> |
||||||
<@ms.button icon="${icon}" id="${id}" value="${value} " icon="${icon}" class="btn btn-${_class}" onclick="location.href='${url}'" title="${title}"/> |
<@ms.button icon="${icon}" id="${id}" value="${value} " icon="${icon}" class="btn btn-${_class}" onclick="location.href='${url}'" title="${title}"/> |
||||||
<#else> |
<#else> |
||||||
<@ms.button icon="${icon}" id="${id}" value="${value} " icon="${icon}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/> |
<@ms.button icon="${icon}" id="${id}" value="${value} " icon="${icon}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/> |
||||||
</#if> |
</#if> |
||||||
<#if openModal!=""> |
<#if openModal!=""> |
||||||
<script> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").click(function() { |
$("#${id}").click(function() { |
||||||
<#if openModalBefor!=""> |
<#if openModalBefor!=""> |
||||||
eval("${openModalBefor}()"); |
eval("${openModalBefor}()"); |
||||||
</#if> |
</#if> |
||||||
$("#${openModal}").modal(); |
$("#${openModal}").modal(); |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
</#if> |
</#if> |
||||||
</#macro> |
</#macro> |
||||||
<#--删--> |
<#--删--> |
||||||
<#macro delButton value="" icon="trash" class="danger" id="delButton${.now?date?string('yyyyMMddhhmmss')}" onclick="" title="删除" fieldName="" url=""> |
<#macro delButton value="" icon="trash" class="danger" id="delButton${.now?date?string('yyyyMMddhhmmss')}" onclick="" title="删除" fieldName="" url=""> |
||||||
<#if fieldName!=""> |
<#if fieldName!=""> |
||||||
<script> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").on("click",function() { |
$("#${id}").on("click",function() { |
||||||
var ids = ""; |
var ids = ""; |
||||||
var params = ""; |
var params = ""; |
||||||
var count = 0; |
var count = 0; |
||||||
$('input[name="${fieldName}"]:checked').each(function(){ |
$('input[name="${fieldName}"]:checked').each(function(){ |
||||||
ids += $(this).val() + ","; |
ids += $(this).val() + ","; |
||||||
params += "${fieldName}=" + $(this).val() + "&"; |
params += "${fieldName}=" + $(this).val() + "&"; |
||||||
count ++; |
count ++; |
||||||
}); |
}); |
||||||
if (count == 0) { |
if (count == 0) { |
||||||
<@ms.notify msg="请选择要删除的数据!"/> |
<@ms.notify msg="请选择要删除的数据!"/> |
||||||
} else { |
} else { |
||||||
$('.deleteModal${id}').modal(); |
$('.deleteModal${id}').modal(); |
||||||
$("#deleteModal${id}Num").text(count); |
$("#deleteModal${id}Num").text(count); |
||||||
|
|
||||||
$('.deleteBtn${id}').on("click",function() { |
$('.deleteBtn${id}').on("click",function() { |
||||||
<#if onclick?has_content> |
<#if onclick?has_content> |
||||||
eval(${onclick}(ids)); |
eval(${onclick}(ids)); |
||||||
<#elseif url?has_content> |
<#elseif url?has_content> |
||||||
$(this).request({url:"${url}",type:"json",data:params,method:"post",func:function(msg) { |
$(this).request({url:"${url}",type:"json",data:params,method:"post",func:function(msg) { |
||||||
if (msg.result) { |
if (msg.result) { |
||||||
<@ms.notify msg="删除成功!"/> |
<@ms.notify msg="删除成功!"/> |
||||||
location.reload(); |
location.reload(); |
||||||
} else { |
} else { |
||||||
<@ms.notify msg="删除失败!"/> |
<@ms.notify msg="删除失败!"/> |
||||||
} |
} |
||||||
}}); |
}}); |
||||||
</#if> |
</#if> |
||||||
}); |
}); |
||||||
|
|
||||||
} |
} |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
</#if> |
</#if> |
||||||
<@ms.isPanelNavBtn id="${id}" _id="delButton" class="${class}" _class="danger"/> |
<@ms.isPanelNavBtn id="${id}" _id="delButton" class="${class}" _class="danger"/> |
||||||
|
|
||||||
<!--删除提示--> |
<!--删除提示--> |
||||||
<@ms.modal modalName="deleteModal${id}" title="删除提示!"> |
<@ms.modal modalName="deleteModal${id}" title="删除提示!"> |
||||||
<@ms.modalBody> |
<@ms.modalBody> |
||||||
确认删除<span style="color: red; font-size: 20px;" id="deleteModal${id}Num"></span>条记录? |
确认删除<span style="color: red; font-size: 20px;" id="deleteModal${id}Num"></span>条记录? |
||||||
</@ms.modalBody> |
</@ms.modalBody> |
||||||
<@ms.modalButton> |
<@ms.modalButton> |
||||||
<@ms.button class="btn btn-danger deleteBtn${id}" value="确定删除"/> |
<@ms.button class="btn btn-danger deleteBtn${id}" value="确定删除"/> |
||||||
</@ms.modalButton> |
</@ms.modalButton> |
||||||
</@ms.modal> |
</@ms.modal> |
||||||
|
|
||||||
<@ms.button icon="${icon}" value="${value} " icon="${icon}" id="${id}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/> |
<@ms.button icon="${icon}" value="${value} " icon="${icon}" id="${id}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#macro editButton value="" icon="edit" class="warning" id="editButton${.now?date?string('yyyyMMddhhmmss')}" onclick="" title="编辑"> |
<#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.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}"/> |
<@ms.button icon="${icon}" value="${value} " icon="${icon}" id="${id}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#macro queryButton value="查询" icon="search" class="default" id="queryButton${.now?date?string('yyyyMMddhhmmss')}" onclick="" title="查询" form="" > |
<#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}"/> |
<@ms.button class="btn btn-info" value="${value} " icon="${icon}" id="${id}" onclick="${onclick}" title="${title}"/> |
||||||
<#if onclick=="" && form!=""> |
<#if onclick=="" && form!=""> |
||||||
<script> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").click(function() { |
$("#${id}").click(function() { |
||||||
$("#${form}")[0].submit(); |
$("#${form}")[0].submit(); |
||||||
}) |
}) |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
</#if> |
</#if> |
||||||
</#macro> |
</#macro> |
||||||
<#--返回--> |
<#--返回--> |
||||||
<#macro backButton value="返回" icon="share-alt" class="default" id="backButton${.now?date?string('yyyyMMddhhmmss')}" onclick="javascript:history.go(-1)" title="返回"> |
<#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}"/> |
<@ms.button value="${value}" icon="${icon}" onclick="${onclick}" class="btn btn-${class}" title="${title}" id="${id}"/> |
||||||
</#macro> |
</#macro> |
||||||
<#--保存--> |
<#--保存--> |
||||||
<#macro saveButton value="保存" icon="floppy-saved" class="default" id="saveButton${.now?date?string('yyyyMMddhhmmss')}" onclick="" title="保存" postForm="" postBefor="" postAfter=""> |
<#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.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}"/> |
<@ms.event postForm="${postForm}" postBefor="${postBefor}" postAfter="${postBefor}" id="${id}"/> |
||||||
</#macro> |
</#macro> |
||||||
<#macro updateButton value="更新" icon="open" class="default" id="updateButton" onclick="" title="更新" postForm="" postBefor="" postAfter="" postForm="" postBefor="" postAfter=""> |
<#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.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}"/> |
<@ms.event postForm="${postForm}" postBefor="${postBefor}" postAfter="${postBefor}" id="${id}"/> |
||||||
</#macro> |
</#macro> |
||||||
<#macro resetButton value="重置" icon="retweet" class="warning" id="resetButton${.now?long}" onclick="" title="重置" form="" > |
<#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}"/> |
<@ms.button icon="${icon}" class="btn btn-warning" value="${value} " icon="${icon}" id="${id}" onclick="${onclick}" title="${title}"/> |
||||||
<script> |
<script> |
||||||
<#--优先click事件--> |
<#--优先click事件--> |
||||||
<#if onclick==""> |
<#if onclick==""> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").click(function() { |
$("#${id}").click(function() { |
||||||
<#if form!=""> |
<#if form!=""> |
||||||
$("#${form}")[0].reset(); |
$("#${form}")[0].reset(); |
||||||
<#else> |
<#else> |
||||||
$("#${id}").parents("form:first")[0].reset(); |
$("#${id}").parents("form:first")[0].reset(); |
||||||
</#if> |
</#if> |
||||||
}) |
}) |
||||||
}) |
}) |
||||||
</#if> |
</#if> |
||||||
</script> |
</script> |
||||||
</#macro> |
</#macro> |
||||||
<#macro exportButton value="导出" icon="export" class="default" id="exportButton" onclick="" title="导出" > |
<#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}"/> |
<@ms.button icon="${icon}" class="btn btn-default" value="${value} " icon="${icon}" id="${id}" onclick="${onclick}" title="${title}"/> |
||||||
</#macro> |
</#macro> |
||||||
<#macro importButton value="导入" icon="import" class="warning" id="importButton" onclick="" title="导入" > |
<#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}"/> |
<@ms.button icon="${icon}" class="btn btn-default" value="${value} " icon="${icon}" id="${id}" onclick="${onclick}" title="${title}"/> |
||||||
</#macro> |
</#macro> |
||||||
<#macro setingButton value="设置" icon="cog" class="warning" id="importButton" onclick="" title="设置" > |
<#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}"/> |
<@ms.button icon="${icon}" class="btn btn-primary" value="${value} " icon="${icon}" id="${id}" onclick="${onclick}" title="${title}"/> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#macro event postForm="" postBefor="" postAfter="" id=""> |
<#macro event postForm="" postBefor="" postAfter="" id=""> |
||||||
<#if postForm!=""> |
<#if postForm!=""> |
||||||
<script> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
$("#${id}").click(function() { |
$("#${id}").click(function() { |
||||||
var vobj = true; |
var vobj = true; |
||||||
try { |
try { |
||||||
vobj = $("#${postForm}").data('bootstrapValidator').validate().isValid(); |
vobj = $("#${postForm}").data('bootstrapValidator').validate().isValid(); |
||||||
} catch (e){} |
} catch (e){} |
||||||
|
|
||||||
var postBefor = true; |
var postBefor = true; |
||||||
<#if postBefor!=""> |
<#if postBefor!=""> |
||||||
postBefor = eval(${postBefor}()); |
postBefor = eval(${postBefor}()); |
||||||
</#if> |
</#if> |
||||||
if(vobj && postBefor) { |
if(vobj && postBefor) { |
||||||
|
|
||||||
$(this).postForm("#${postForm}",{func:function(msg) { |
$(this).postForm("#${postForm}",{func:function(msg) { |
||||||
if (msg.result) { |
if (msg.result) { |
||||||
//history.back(); |
//history.back(); |
||||||
<@ms.notify msg="保存成功!" type="success"/> |
<@ms.notify msg="保存成功!" type="success"/> |
||||||
var redirect = $("#${postForm} input[name='redirect']").val(); |
var redirect = $("#${postForm} input[name='redirect']").val(); |
||||||
if (redirect!="") { |
if (redirect!="") { |
||||||
location.href=redirect; |
location.href=redirect; |
||||||
} |
} |
||||||
<#if postAfter!=""> |
<#if postAfter!=""> |
||||||
eval(${postAfter}(msg)); |
eval(${postAfter}(msg)); |
||||||
</#if> |
</#if> |
||||||
|
|
||||||
}else{ |
}else{ |
||||||
var message = msg.resultMsg; |
var message = msg.resultMsg; |
||||||
if (message=="" || message==undefined) { |
if (message=="" || message==undefined) { |
||||||
message="后台验证失败"; |
message="后台验证失败"; |
||||||
} |
} |
||||||
$('.ms-notifications').notify({ |
$('.ms-notifications').notify({ |
||||||
type:'warning', |
type:'warning', |
||||||
message: { text:message } |
message: { text:message } |
||||||
}).show(); |
}).show(); |
||||||
} |
} |
||||||
}}); |
}}); |
||||||
} else { |
} else { |
||||||
<@ms.notify msg="验证失败,请重新输入!" /> |
<@ms.notify msg="验证失败,请重新输入!" /> |
||||||
|
|
||||||
} |
} |
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
</#if> |
</#if> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#--按钮组--> |
<#--按钮组--> |
||||||
<#macro buttonGroup role="group"> |
<#macro buttonGroup role="group"> |
||||||
<div class="btn-group" role="${role}"> |
<div class="btn-group" role="${role}"> |
||||||
<#nested/> |
<#nested/> |
||||||
</div> |
</div> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#macro menuButton links name="菜单名称" class="default"> |
<#macro menuButton links name="菜单名称" class="default"> |
||||||
<div class="btn-group dropdown"> |
<div class="btn-group dropdown"> |
||||||
<button type="button" class="btn btn-${class}">${name}</button> |
<button type="button" class="btn btn-${class}">${name}</button> |
||||||
<button type="button" class="btn btn-${class} dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
<button type="button" class="btn btn-${class} dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> |
||||||
<span class="caret"></span> |
<span class="caret"></span> |
||||||
<span class="sr-only"></span> |
<span class="sr-only"></span> |
||||||
</button> |
</button> |
||||||
<ul class="dropdown-menu"> |
<ul class="dropdown-menu"> |
||||||
<#list links as b> |
<#list links as b> |
||||||
<li><a href="javascript:${b.click?default("void")}()">${b.name?default("菜单")}</a></li> |
<li><a href="javascript:${b.click?default("void")}()">${b.name?default("菜单")}</a></li> |
||||||
</#list> |
</#list> |
||||||
</ul> |
</ul> |
||||||
</div> |
</div> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
<#macro switchButton name on off size="small" value="" class="" color="default" onclass="danger" offclass="primary"> |
<#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}"/> |
<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> |
<script> |
||||||
$(function() { |
$(function() { |
||||||
<#if value!=""> |
<#if value!=""> |
||||||
<#if value==on.value?string> |
<#if value==on.value?string> |
||||||
$(".ms-button-switch-${name}").bootstrapSwitch('state', true); |
$(".ms-button-switch-${name}").bootstrapSwitch('state', true); |
||||||
<#else> |
<#else> |
||||||
$(".ms-button-switch-${name}").bootstrapSwitch('state', false); |
$(".ms-button-switch-${name}").bootstrapSwitch('state', false); |
||||||
</#if> |
</#if> |
||||||
<#else> |
<#else> |
||||||
$(".ms-button-switch-${name}").bootstrapSwitch('state', true); |
$(".ms-button-switch-${name}").bootstrapSwitch('state', true); |
||||||
</#if> |
</#if> |
||||||
|
|
||||||
$('.ms-button-switch-${name}').on('switchChange.bootstrapSwitch', function(event, state) { |
$('.ms-button-switch-${name}').on('switchChange.bootstrapSwitch', function(event, state) { |
||||||
if (state) { |
if (state) { |
||||||
$("input[name='${name}']").val('${on.value}'); |
$("input[name='${name}']").val('${on.value}'); |
||||||
} else { |
} else { |
||||||
$("input[name='${name}']").val('${off.value}'); |
$("input[name='${name}']").val('${off.value}'); |
||||||
} |
} |
||||||
}); |
}); |
||||||
|
|
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
<input type="hidden" name="${name}" value="${value}"/> |
<input type="hidden" name="${name}" value="${value}"/> |
||||||
</#macro> |
</#macro> |
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,90 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
||||||
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" |
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" |
|
||||||
id="WebApp_ID" version="3.0"> |
|
||||||
<display-name>mybatis</display-name> |
|
||||||
<context-param> |
|
||||||
<param-name>contextConfigLocation</param-name> |
|
||||||
<param-value>classpath:spring-mvc.xml,classpath:spring-mybatis.xml,classpath:spring-shiro.xml</param-value> |
|
||||||
</context-param> |
|
||||||
<filter> |
|
||||||
<description>字符集过滤器</description> |
|
||||||
<filter-name>encodingFilter</filter-name> |
|
||||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> |
|
||||||
<init-param> |
|
||||||
<description>字符集编码</description> |
|
||||||
<param-name>encoding</param-name> |
|
||||||
<param-value>UTF-8</param-value> |
|
||||||
</init-param> |
|
||||||
</filter> |
|
||||||
<filter-mapping> |
|
||||||
<filter-name>encodingFilter</filter-name> |
|
||||||
<url-pattern>/*</url-pattern> |
|
||||||
</filter-mapping> |
|
||||||
<listener> |
|
||||||
<description>spring监听器</description> |
|
||||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
|
||||||
</listener> |
|
||||||
<!-- 防止spring内存溢出监听器 --> |
|
||||||
<listener> |
|
||||||
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> |
|
||||||
</listener> |
|
||||||
<!-- spring mvc servlet --> |
|
||||||
<servlet> |
|
||||||
<description>spring mvc servlet</description> |
|
||||||
<servlet-name>springMvc</servlet-name> |
|
||||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
|
||||||
<init-param> |
|
||||||
<description>spring mvc 配置文件</description> |
|
||||||
<param-name>contextConfigLocation</param-name> |
|
||||||
<param-value>classpath:spring-mvc.xml</param-value> |
|
||||||
</init-param> |
|
||||||
<load-on-startup>1</load-on-startup> |
|
||||||
</servlet> |
|
||||||
<servlet-mapping> |
|
||||||
<servlet-name>springMvc</servlet-name> |
|
||||||
<url-pattern>*.do</url-pattern> |
|
||||||
</servlet-mapping> |
|
||||||
<!-- Apache Shiro --> |
|
||||||
<filter> |
|
||||||
<filter-name>shiroFilter</filter-name> |
|
||||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> |
|
||||||
<init-param> |
|
||||||
<param-name>targetFilterLifecycle</param-name> |
|
||||||
<param-value>true</param-value> |
|
||||||
</init-param> |
|
||||||
</filter> |
|
||||||
<filter-mapping> |
|
||||||
<filter-name>shiroFilter</filter-name> |
|
||||||
<url-pattern>/*</url-pattern> |
|
||||||
</filter-mapping> |
|
||||||
<welcome-file-list> |
|
||||||
<welcome-file>index</welcome-file> |
|
||||||
<welcome-file>default.html</welcome-file> |
|
||||||
<welcome-file>default.htm</welcome-file> |
|
||||||
<welcome-file>index.htm</welcome-file> |
|
||||||
<welcome-file>index.html</welcome-file> |
|
||||||
<welcome-file>login.do</welcome-file> |
|
||||||
</welcome-file-list> |
|
||||||
<!-- 配置session超时时间,单位分钟 --> |
|
||||||
<error-page> |
|
||||||
<error-code>404</error-code> |
|
||||||
<location>/error/404.do</location> |
|
||||||
</error-page> |
|
||||||
<error-page> |
|
||||||
<error-code>500</error-code> |
|
||||||
<location>/error/500.do</location> |
|
||||||
</error-page> |
|
||||||
<error-page> |
|
||||||
<error-code>405</error-code> |
|
||||||
<location>/error/405.do</location> |
|
||||||
</error-page> |
|
||||||
<error-page> |
|
||||||
<error-code>504</error-code> |
|
||||||
<location>/error/504.do</location> |
|
||||||
</error-page> |
|
||||||
<session-config> |
|
||||||
<session-timeout>15</session-timeout> |
|
||||||
</session-config> |
|
||||||
</web-app> |
|
||||||
Loading…
Reference in new issue