Commit da21280b authored by ms-dev's avatar ms-dev
Browse files

配置文件更新

parent 33bb27de
<#--简易编辑器-->
<#--name:输入框名称-->
<#--width\height:编辑器的宽度高度-->
<#--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/>
<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">
//实例化编辑器
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
// var ue = UE.getEditor('editor_${name}');
var URL = window.UEDITOR_HOME_URL || "${base}/static/plugins/ueditor/1.4.3.1/";
var ue = UE.getEditor('editor_${name}', {
imageScaleEnabled :true,
// 服务器统一请求接口路径
serverUrl: URL + "jsp/msController.jsp?jsonConfig=%7BvideoUrlPrefix:'${base}',fileUrlPrefix:'${base}',imageUrlPrefix:'${base}',imagePathFormat:'/upload/${appId?default(0)}/editor/%7Btime%7D',filePathFormat:'/upload/${appId?default(0)}/editor/%7Btime%7D',videoPathFormat:'/upload/${appId?default(0)}/editor/%7Btime%7D'%7D",
autoHeightEnabled: true,
autoFloatEnabled: false,
scaleEnabled: true,
compressSide:0,
maxImageSideLength:2000,
maximumWords: 80000,
});
//重新设置编辑器的style
ue.ready(function () {
$(".edui-editor-bottomContainer").height(30);
});
</script>
</div>
</div>
</#macro>
<#--简易编辑器-->
<#--inputName:输入框名称-->
<#--width\height:编辑器的宽度高度-->
<#--content:初始化内容-->
<#macro smallUedit inputName width height content>
<script type="text/plain" id="editor_${inputName}" name="${inputName}">${content?default('')}</script>
<div class="editor-bottom-bar">
当前已输入
<span class="char_count">
0
</span>
个字符, 您还可以输入
<span class="char_remain">
80000
</span>
个字符。
</div>
<style>
.editor-bottom-bar {
white-space: nowrap;
border: 1px solid #ccc;
line-height: 20px;
font-size: 12px;
text-align: right;
margin-right: 5px;
color: #aaa;
border-top: 0;
width: ${width}px;
}
</style>
<script type="text/javascript">
var charLimit = 80000;
window.editor_${inputName} = new UE.ui.Editor({
initialFrameWidth : ${width},
initialFrameHeight : ${height}
});
window.editor_${inputName}.render("editor_${inputName}");
function computeChar() {
var len = editor_${inputName}.getContent().length;
if (len > charLimit) {
$(".editor-bottom-bar").html("<span style='color:red;'>你输入的字符个数("
+ len + ")已经超出最大允许值!</span>")
} else {
$(".editor-bottom-bar").html("当前已输入<span class='char_count'>" + len
+ "</span>个字符, 您还可以输入<span class='char_remain'>"
+ (charLimit - len) + "</span>个字符。")
}
}
window.editor_${inputName}.addListener("keyup", function(type, evt) {
computeChar()
})
</script>
</#macro>
<#--
<input type="file"/>
-->
<#macro file
accept="" value=""
label="" noHeight="false" required="false" colspan="" width="100" help="" helpPosition="2" colon=":" hasColon="true"
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/>
<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 "control-close.ftl"/><#rt/>
</#macro>
<#--
<form></form>
name:表单名称
id:表单id
action:提交地址
method:提交方式
-->
<#macro form name id="" target=""
action="" method="post" enctype=""
class="form-horizontal" style="display:none; width:100%; background-color: white;" isvalidation=false tooltip=false
redirect=""
>
<form<#rt/>
role="form"<#rt/>
method="${method}"<#rt/>
action="${action}"<#rt/>
<#if target!="">target="${target}" <#else> target="_self"</#if><#rt/>
<#if id!=""> id="${id}"<#else> id="${name}"</#if><#rt/>
<#if enctype!=""> enctype="${enctype}"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
>
<@ms.hidden name="redirect" value="${redirect}"/>
<#nested/><#rt/>
<script>
$(function() {
var id = "${name}";
<#if id?? && id!="">id="${id}"</#if>
$('#'+id).fadeIn("slow");
<#if isvalidation>
$('#'+id).bootstrapValidator({
<#if tooltip>
container: 'tooltip',
</#if>
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
}
});
</#if>
//$("#${name} .form-group>div.radio").siblings("i.form-control-feedback").clone().prependTo($("#${name} .form-group>div.radio"));
//$("#${name} .form-group>div.radio").siblings("i.form-control-feedback").remove();
<#if !class?has_content>
$("#${name} .form-group>label").removeClass("col-sm-2");
$("#${name} .form-group>div").removeClass("col-sm-9");
var width = $("#${name} .form-group>div.ms-from-group-input").width();
//$("#${name} .form-group>div.ms-from-group-input>:input").unwrap().parent().width(width);
$("#${name} .form-group>div.ms-from-group-input").addClass("has-feedback").parent().width(width);
//$("#${name} .form-group label").removeClass("checkbox-inline").removeClass("radio-inline");
//$("#${name} .has-feedback .form-control-feedback").css({top:"25px"});
<#elseif class?index_of("searchForm") gt -1>
$("#${name} .form-group>label").removeClass("col-sm-3");
$("#${name} .form-group>div").removeClass("col-sm-9");
$("#${name} .form-group>label").addClass("col-sm-4");
$("#${name} .form-group>div").addClass("col-sm-8");
$("#${name} .ms-form-group").addClass("col-sm-4");
$("#${name}").show();
</#if>
})
</script>
</form>
</#macro>
<#macro searchForm name id="" target=""
action="" method="post" enctype=""
class="searchForm form-inline" style="display:none; background-color: white;" isvalidation=false tooltip=true >
<@ms.form name="${name}" id="${id}" action="${action}" style="display:none;background-color: white;" isvalidation=true class="${class}" tooltip=true>
<#nested/><#rt/>
</@ms.form>
<div class="search-form-div"></div>
<script type="text/javascript">
$(function(){
//收缩筛选
var clickTimes = 1;
var searchFormheight = $("#searchForm").height();
//初始化顶住筛选部分的空白div
$(".search-form-div").height(searchFormheight + 15);
var _height = parseInt(searchFormheight)-26;
$("#searchForm").find(".close").click(function(){
var obj = $(this);
if (clickTimes % 2 == 1) {
//空白div与筛选同时往上缩
$(".search-form-div").animate({height:"0px"},"slow");
$("#searchForm").animate({top:"-"+_height+"px"},"slow");
obj.find("span").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
} else {
//空白div与筛选同时展开
$(".search-form-div").animate({height:searchFormheight+15+"px"},"slow");
$("#searchForm").animate({top:"46px"},"slow");
obj.find("span").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
}
clickTimes++
})
})
</script>
</#macro>
<#macro searchFormButton close="">
<div class="bottom" style="clear:both">
<div class="close"><span class="glyphicon glyphicon-chevron-up"></span></div>
<@ms.resetButton/>
<#nested/><#rt/>
</div>
</#macro>
<#--自定义行-->
<#macro formRow label=" " class="form-control" colSm="" groupClass="form-group" width="" labelStyle="" help="" style="" >
<div class="${groupClass}">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-9 ms-from-group-input" style="line-height:30px;<#if width!=""> width:${width}px;</#if>${style}"<#rt/>>
<#nested/>
</div>
</div>
</#macro>
<#--
<input type="text"/>
-->
<#macro fromgroup id="" size="" label="" style="">
<div class="form-group ms-form-group" style="${style}" help="">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="ms-form-control">
<#nested/><#rt/>
</div>
</div>
</#macro>
<#include "/include/ui/input.ftl"/>
<#include "/include/ui/input-tree.ftl"/>
<#include "/include/ui/select.ftl"/>
<#include "/include/ui/textarea.ftl"/>
<#include "/include/ui/file.ftl"/>
<#include "/include/ui/button.ftl"/>
<#include "/include/ui/form.ftl"/>
<#include "/include/ui/date.ftl"/>
<#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"/>
<#include "/include/ui/upload.ftl"/>
\ No newline at end of file
<#-- 树形控件,以input下拉框的形式显示(官网:http://www.ztree.me/v3/main.php#_zTreeInfo) -->
<#-- treeId(必须):树形加载和控制区域的ID,一张页面同时加载多个树形时必须用该值进行区分 -->
<#-- json(必须):需要加载成树形的数据,数据结构为:[{categoryId:1,categoryCategoryId:0,categoryTitle:""},{categoryId:2,categoryCategoryId:1,categoryTitle:""}] -->
<#-- jsonId(必须):json数据中ID名称,如:categoryId -->
<#-- jsonPid(必须):json数据中关联的父ID,如:categoryCategoryId -->
<#-- jsonName(必须):json数据中需要显示的数据名称,如:categoryTitle -->
<#-- rootName:顶级根节点,直接传入根节点名称即可。如:顶级分类 -->
<#-- name(必须):隐藏input框的name与id值,用于保存选中数据的ID -->
<#-- value:隐藏input框的val默认值,适用用于加载初始化数据 -->
<#-- text:选择框加载的默认提示信息 -->
<#-- parent:是否可以选择父节点,false默认不允许,true允许 -->
<#-- expandAll:控制节点数据显示的时候是全部展开还是全部折叠(true[默认]:全部展开,false:全部折叠)。 -->
<#-- showIcon:是否显示文件夹图标,true(默认):显示;false:不显示 -->
<#-- required:是否是必选项,true(默认)必选 false -->
<#-- onclick: 选择节点后触发的事件,会注入event,treeId,treeNode三个参数,参考ztree官方文档-->
<#macro inputTree treeId json jsonId jsonPid jsonName name text
rootName="" value="" parent=false onclick="" expandAll="true" showIcon="true"
required=true >
<!-- css样式开始 -->
<style type="text/css">
.ztree${treeId}{width:100%;max-height: 240px;overflow:auto;}
.ztree${treeId} li a{padding:0}
#${treeId} i{right:0}
</style>
<!-- css样式结束 -->
<!-- 初始化样式开始 -->
<div class="dropdown" id="${treeId}">
<button id="treeLabel${treeId}" class="form-control dropdown-toggle" data-toggle="dropdown" aria-expanded="true" style="text-align:left">
${text?default('请选择')}
</button>
<input type="text" style="position: absolute;height:0;border: none;" <#if name?has_content>name="${name}" id="${name}"</#if> value="${value?default(0)}"
<#if required && validation?? && validation?has_content><#--验证框架,需要bootstrapValidator框架-->
<#list validation?keys as key>
${key}="${validation[key]}"<#rt/>
</#list>
<#elseif required>
data-bv-between="true" data-bv-between-message="请选择!" data-bv-between-min="1" data-bv-between-max="99998" required data-bv-notempty-message="请选择分类"
</#if>
/>
<ul class="ztree ztree${treeId} dropdown-menu" role="menu" id="tree${treeId}" aria-labelledby="treeLabel${treeId}">
</ul>
</div>
<!-- 初始化样式结束 -->
<!-- js操作方法开始 input -->
<script>
//初始化树形数据
var zNodes${treeId} = <#if json?has_content>${json}<#else>[]</#if>;
//初始化树形结构
var setting${treeId} = {
view:{//控制视图
fontCss:{"white-space":"normal","display":"initial","word-break":"break-all"},
showIcon:${showIcon},//是否显示节点文件夹图标
showLine:true,//是否显示借点连接线
expandSpeed:"",//折叠时的动画速度,参考jquery中动画效果的speed参数,三种预定速度之一的字符串("slow", "normal", or "fast")
},
data: {//控制显示数据
simpleData: {
enable: true,//是否采用简单数据模式 (Array)
idKey:"${jsonId}",//节点ID名称
pIdKey:"${jsonPid}",//父节点ID名称
},
key:{
name:"${jsonName}",//节点数据保存节点名称的属性名称。
}
},
callback: {//控制获取选择的节点数据
beforeClick:<#if !parent>beforeClick${treeId}<#else>null</#if>,//用于捕获单击节点之前的事件回调函数,并且根据返回值确定是否允许单击操作
onClick:getZtreeId${treeId},//用于捕获节点被点击的事件回调函数
},
check:{//控制节点的选中方式(暂时未启用,根据后期需求再做调整)
autoCheckTrigger:true,//是否触发自动勾选
enable:false,//节点上是否显示选择框,false:不显示,true:显示。
chkStyle:"checkbox",//勾选框类型(checkbox[默认值] radio)
chkboxType:{"Y":"ps","N":"ps"},//设置勾选关联关系
},
};
var zTreeObj${treeId}="";
$(function(){
//自定义顶级栏目
<#if rootName?has_content>
zNodes${treeId}[zNodes${treeId}.length] = {${jsonName}:"${rootName}",${jsonId}:0,${jsonPid}:0};
</#if>
//加载树形
$.fn.zTree.init($("#tree${treeId}"),setting${treeId},zNodes${treeId});
//zTree内部函数对象,主要用户调用zTree内部方法
zTreeObj${treeId} = $.fn.zTree.getZTreeObj("tree${treeId}");
//展开(true)/折叠(false)全部节点(zTree内部方法)
zTreeObj${treeId}.expandAll(${expandAll});
//加载默认节点
<#if value?has_content>
var nodes = zTreeObj${treeId}.getNodeByParam("${jsonId}",${value},null)
if (nodes!=null) {
zTreeObj${treeId}.selectNode(nodes);
$("#treeLabel${treeId}").text(nodes.${jsonName});
}
</#if>
//当属性为折叠时,控制下拉菜单的开启和关闭
<#if expandAll = "false">
$("body").on("click",function(e) {
e = window.event || e; // 兼容IE7
//获取当前点击事件对象
var objZtree = $(e.srcElement||e.target);
//获取当前点击事件ID,并对点击的子节点ID进行切割获取自定义ID
var objZtreeId = objZtree.attr("id");
//当用户点击选择框时还原下拉框属性
if(objZtreeId != undefined && objZtreeId.split("_")[0] == "treeLabel${treeId}"){
$("#tree${treeId}").attr("style","");
return ;
}
//切割获取到的ID判断点击事件是否产生在下拉框
if(objZtreeId != undefined && objZtreeId.split("_")[0] == "tree${treeId}"){
$("#tree${treeId}").attr("style","display:block");
}else{
$("#tree${treeId}").attr("style","display:none");
}
});
</#if>
});
<#if !parent>
//对节点选择进行限制,用户只能选择子节点
function beforeClick${treeId}(treeId,treeNode) {
var check = (treeNode && !treeNode.isParent);
if (!check){
<@ms.notify msg="请选择该分类的子分类!" />
};
return check;
}
</#if>
//获取树形中选中的值,将选择值加载到隐藏框中
function getZtreeId${treeId}(event,treeId,treeNode){
var booleanClick = true;
//用于捕获节点被点击的事件回调函数
<#if onclick?has_content>
booleanClick=${onclick}(event,treeId,treeNode);
</#if>
if(booleanClick==false){
return;
}
//将用户选择数据ID加载到隐藏框
$("#${treeId} input[name='${name}']").val(treeNode.${jsonId});
<#if required>
$("form:first").bootstrapValidator('revalidateField', '${name}');
</#if>
//将用户选择数据的名称加载到输入框
$("#treeLabel${treeId}").text(treeNode.${jsonName});
}
</script>
<!-- js操作方法结束 -->
</#macro>
\ No newline at end of file
<#--
<input type="text"/>
-->
<#macro text id="" name="" value="" label="" title="" colSm=""
class="form-control" style="" readonly="" disabled=false maxlength="" minlength=""
validation="" size="" width="" placeholder="" groupClass="form-group" onclick="" onchange="" labelStyle="" autocomplete="off" help="" helpDirection="">
<div class="${groupClass} ms-form-group">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-9 ms-from-group-input ms-form-input" style="<#if width!="">width:${width}px;</#if>${style}"<#rt/>>
<input type="text" autocomplete="${autocomplete}"<#rt/>
<#if id!=""> id="${id}"</#if><#rt/>
<#if maxlength!=""> maxlength="${maxlength}"</#if><#rt/>
<#if size!=""> maxlesizength="${size}"</#if><#rt/>
<#if readonly!=""> readonly="${readonly}"</#if><#rt/>
<#if value?? && value?string!=""> value="${value?html}"</#if><#rt/>
<#if onchange?? && onchange!=""> onchange="${onchange}"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl" /><#rt/>
/><#rt/>
</div>
</div>
</#macro>
<#--数字输入框-->
<#macro number id="" name="" value="" label="" title="" min=0 max=200 isFloat=false colSm=""
class="form-control" style="" readonly="" disabled=false maxlength="10" minlength=""
validation="" size="" width="150" placeholder="" groupClass="form-group" onclick="" onchange="" labelStyle="" autocomplete="off" help="" helpDirection="">
<#assign reg="^-?\\d+$">
<#if isFloat>
<#assign reg="^\\d+(\\.\\d+)?$">
</#if>
<@ms.text
id="${id}" name="${name}" value="${value}" label="${label}" title="${title}"
class="${class}" style="${style}" readonly="${readonly}"
maxlength="${maxlength}"
minlength="${minlength}"
size="${size}" width="${width}" placeholder="${placeholder}" groupClass="${groupClass}" onclick="${onclick}" onchange="${onchange}" labelStyle="${labelStyle}"
autocomplete="${autocomplete}" help="${help}" helpDirection="${helpDirection}"
validation={"data-bv-between":"true","data-bv-between-message":"必须大于等于${min}且小于等于${max}","data-bv-between-min":"${min}"
,"data-bv-between-max":"${max}","data-bv-regexp":"true","data-bv-regexp-regexp":"${reg}","data-bv-regexp-message":"请输入数字"}/>
</#macro>
<#--
<input type="password"/>
-->
<#macro password
id="" name="" value="" label="" title="" colSm=""
class="form-control" style="" readonly="" disabled=false maxlength="" minlength=""
validation="" size="" width="" placeholder="" groupClass="form-group" onclick="" onchange="" labelStyle="" autocomplete="off" help="" helpDirection="">
<div class="form-group ms-form-group">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="ms-form-control ms-from-group-input col-sm-9" <#if width!=""> style="width:${width}px"</#if><#rt/>>
<input type="password" autocomplete="${autocomplete}"<#rt/>
<#if id!=""> id="${id}"</#if><#rt/>
<#if maxlength!=""> maxlength="${maxlength}"</#if><#rt/>
<#if readonly!=""> readonly="${readonly}"</#if><#rt/>
<#if value!=""> value="${value}"</#if><#rt/>
<#if onchange?? && onchange!=""> onchange="${onchange}"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
/>
</div>
</div>
</#macro>
<#--
<input type="hidden"/>
-->
<#macro hidden
id="" name="" value=""
>
<input type="hidden"<#rt/>
<#if id!=""> id="${id}"</#if><#rt/>
<#if name!=""> name="${name}"</#if><#rt/>
<#if value?string!=""> value="${value}"</#if><#rt/>
/>
</#macro>
<#--
<input type="radio"/>
-->
<#macro radio
name list listKey="" listValue="" value="" width="" colSm=""
help="" helpPosition="2" colon=":" hasColon="true"
label="" class="" style="" disabled=false direction=false validation="" size="" labelStyle="" onclick="" help="" helpDirection="">
<div class="form-group ms-form-group _${name}Div">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-9 ms-from-group-input " style="margin-top:7px<#if width!=""> ;width:${width}px</#if>"<#rt/>>
<#if list?is_sequence><#--LIST-->
<#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 "radio-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 "radio-item.ftl"><#t/>
</#list>
</#if>
<#else>
<#list list?keys as key><#--MAP-->
<#local rkey=key/>
<#local rvalue=list[key]/>
<#local index=key_index>
<#local hasNext=key_has_next>
<#include "radio-item.ftl"><#t/>
</#list>
</#if>
</div>
</div>
<script>
$(function() {
<#if direction>
$("._${name}Div .ms-radio").width("100%");
</#if>
})
</script>
</#macro>
<#--
<input type="checkbox"/>
-->
<#macro checkbox
list listKey="" listValue="" valueList=[] colSm=""
label="" colon=":" hasColon="true"
id="" name="" class="" style="" size="" title="" disabled=false
validation="" direction=true
width=""
labelStyle=""
help=""
helpDirection=""
>
<div class="form-group ms-form-group _${name}Div">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-9 ms-from-group-input " style="margin-top:7px<#if width!=""> ;width:${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 "/include/ui/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 "/include/ui/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 "/include/ui/checkboxlist-item.ftl"><#t/>
</#list>
</#if>
</div>
</div>
<script>
$(function() {
<#if direction>
//$("._${name}Div label.ms-checkbox").removeClass("checkbox").addClass("checkbox-inline");
<#else>
//$("._${name}Div label.ms-checkbox").removeClass("checkbox-inline").addClass("checkbox");
</#if>
})
</script>
</#macro>
<#--
<input type="checkbox"/>
4.5.5废弃
-->
<#macro checkboxlist
list listKey="" listValue="" valueList=[] colSm=""
label="" colon=":" hasColon="true"
id="" name="" class="" style="" size="" title="" disabled=false
validation="" direction=true
width=""
labelStyle=""
help=""
helpDirection=""
>
<div class="form-group ms-form-group">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-9" <#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 "/include/ui/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 "/include/ui/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 "/include/ui/checkboxlist-item.ftl"><#t/>
</#list>
</#if>
</div>
</div>
</#macro>
<#--模态框按钮区域 废弃-->
<#macro modalButtonarea>
<div class="modal-footer">
<#nested/>
</div>
</#macro>
<#--警告的模态框-->
<#macro warn modalName>
<div id="warn${modalName}Dialog" class="modal fade ${modalName}" tabindex="-1" data-focus-on="input:first">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title" id="warn${modalName}Title">警告!</h4>
</div>
<div class="modal-body" id="warn${modalName}Body">
<#nested/>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
<button type="button" id="warn${modalName}Ok" class="btn btn-primary right" >确定</button>
</div>
</div>
</div>
</div>
</#macro>
<#--模块框 modalName废弃属性-->
<#macro modal id="" title="标题" style="" height="300" resetFrom=true modalName="" size="S">
<#if style!="">
<#assign _style="${style}">
<#elseif size=="S">
<#assign _style="width:450px;height:150px;">
<#elseif size=="M">
<#assign _style="width:600px;height:500px;">
<#elseif size=="L">
<#assign _style="width:900px;height:650px;">
</#if>
<div class="modal fade ${modalName}${id}" id="${modalName}${id}" >
<div class="modal-dialog" style="${_style};">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="${modalName}${id}Title">
${title}
</h4>
</div>
<#nested/>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
<#if resetFrom>
$(function(){
$('#${modalName}${id}').on('hide.bs.modal', function (event) {
if ($("#${modalName}${id} form").length>0) {
$("#${modalName}${id} form").data('bootstrapValidator').resetForm(true);
$("#${modalName}${id} form")[0].reset();
}
})
});
</#if>
</script>
</#macro>
<#--模态框内容 height属性废弃, 直接在style里面修改-->
<#macro modalBody style="" height="">
<div class="modal-body" style="${style}">
<#nested/>
</div>
</#macro>
<#--模态框按钮区域-->
<#macro modalButton>
<div class="modal-footer">
<#nested/>
</div>
</#macro>
<#--通用弹窗-->
<#--modalName:弹出窗的名称-->
<#--调用方法open弹出窗口名称,例如:窗口名称 abc ,调用openabc('展示内容','标题')-->
<#--注意使用的时候,message的内容只能是id或字符串对象-->
<#macro modalDialog modalName>
<div class="modal fade" id="${modalName}Dialog" style="overflow-y: hidden;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="${modalName}Title">
</h4>
</div>
<!--startprint-->
<div class="modal-body" id="${modalName}Body">
</div>
<!--添加其他信息-
<div class="modal-footer" id="${modalName}Footer">
</div>
-->
<!--endprint-->
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
function open${modalName}(message,title) {
if (title) {
$("#${modalName}Title").html(title);
}
try {
if (message) {
message.show();
}
} catch(e){
<@ms.notify msg= "文本" type= "warning" />
}
$("#${modalName}Body ").html(message);
$('#${modalName}Dialog').modal();
}
function close${modalName}() {
$('#warn${modalName}Dialog').modal('hide');
}
</script>
</#macro>
<#--通用警告弹窗-->
<#--warnModal:弹出窗的名称-->
<#--调用方法open弹出窗口名称,例如:窗口名称 abc ,调用openabc('展示内容','标题','点击确定按钮之后回调方法,如果没有则不会显示确认按钮')-->
<#macro warnModal modalName>
<div id="warn${modalName}Dialog" class="modal fade" tabindex="-1" data-focus-on="input:first">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title" id="warn${modalName}Title">警告!</h4>
</div>
<div class="modal-body" id="warn${modalName}Body">
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
<button type="button" id="warn${modalName}Ok" class="btn btn-primary right" style="display:none">确定</button>
</div>
</div>
</div>
</div>
<script>
function warn${modalName}(message,title,func) {
if (title) {
$("#warn${modalName}Title").html(title);
}
if(func) {
$("#warn${modalName}Ok ").show();
$("#warn${modalName}Ok ").one("click",function(){
eval(func);
});
}
$("#warn${modalName}Body ").html(message);
$('#warn${modalName}Dialog').modal();
}
function closewarn${modalName}() {
$('#warn${modalName}Dialog').modal('hide');
}
</script>
</#macro>
<#--后台的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 class='notifications ms-notifications top-right'></div>
</div>
</div>
</body>
</html>
</#macro>
<#macro nav title="板块名称" back=false style="">
<div class="ms-content-body-title" style="${style}">
<strong>${title}</strong>
<#nested/>
<#if back>
<@ms.backButton/>
</#if>
</div>
</#macro>
<#--面板-->
<#macro panel style="">
<div class="ms-content-body-panel" style="${style}">
<#nested/>
</div>
</#macro>
<#--面板导航-->
<#macro panelNav empty=false>
<div class="ms-content-body-panel-nav" <#if empty>style=" padding: 0;"</#if>>
<#nested/>
</div>
</#macro>
<#--提示-->
<#macro notify msg="提示信息" type="warning">
$('.ms-notifications').offset({top:43}).notify({
type:'${type}',
message: { text:'${msg}' }
}).show();
</#macro>
\ No newline at end of file
<label class="ms-radio" style="padding-right:10px"><input type="radio"<#rt/>
value="${rkey}"<#rt/>
<#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/>
/> ${rvalue} </label> <#if hasNext> </#if>
<#--
<select><option></option></select>
-->
<#macro select
list=[] value="" multiple=false listKey="" listValue="" listDeep=""
label="" validation="" colon=":" hasColon="true" readonly=""
id="" name="" class="form-control" style="" size="" title="" disabled=false
labelStyle=""
width=""
help=""
helpDirection=""
default=""
defaultValue=""
select2=false
>
<div class="form-group ms-form-group">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-9 ms-form-control ms-from-group-input" <#if width!=""> style="width:${width}px"</#if><#rt/>>
<select<#rt/>
<#if id!=""> id="${id}"</#if><#rt/>
<#if multiple>multiple="multiple"</#if><#rt/>
<#if readonly!=""> readonly="${readonly}"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
><#rt/>
<#if default?has_content>
<option value="<#if value?has_content>${value}</#if>">${default}</option>
</#if>
<#if list?is_sequence><#--LIST-->
<#if listKey!="" && listValue!="">
<#list list as item>
<#local rkey=item[listKey]>
<#local rvalue=item[listValue]>
<option value="${rkey}" <#if rkey?string==value?string> selected="selected"</#if>>${rvalue}</option><#rt/>
</#list>
<#else>
<#list list as item>
<option value="${item}" <#if item?string==value?string> selected="selected"</#if>>${item}</option><#rt/>
</#list>
</#if>
<#else>
<#list list?keys as key>
<#local rkey=key/>
<#local rvalue=list[key]/>
<option value="${rkey}" <#if rkey?string==value?string> selected="selected"</#if>>${rvalue}</option><#rt/>
</#list>
</#if>
</select>
</div>
</div>
<#if select2>
<script>
$(function() {
$("select[name='${name}']").select2({width: "${width}px"});
$("select[name='${name}']").select2().val("${value}").trigger("change");;
})
</script>
</#if>
</#macro>
<#macro select2 name list value="" multiple=false listKey="" listValue="" listDeep="" default="请选择"
label="" validation="" colon=":" hasColon="true" readonly=""
class="form-control" style="" size="" title="" disabled=false
labelStyle=""
width=""
>
<select id="${name}" name="${name}">
<option></option>
</select>
<script>
$(function() {
$("#${name}").select2():
})
</script>
</#macro>
<#--表格列表-->
<#--head:表格头部标题,数值格式-->
<#--head:表格头部标题-->
<#macro table head="" filed="" listItem="" editField="" editJs="" checkbox="" id="" dateformat="yyyy-MM-dd">
<script>
<#if checkbox?has_content>
$(function() {
$("input[name='allCheck${checkbox}']").on("click",function(){
if(this.checked){
$("input[name='${checkbox}']").each(function(){
this.checked=true;
});
}else{
$("input[name='${checkbox}']").each(function(){this.checked=false;});
}
});
})
</#if>
</script>
<table class="table table-hover">
<!--表格栏目属性 开始-->
<thead>
<tr>
<#if checkbox?has_content>
<th class="text-center" width="10">
<input type="checkbox" name="allCheck${checkbox}">
</th>
</#if>
<#if head?has_content>
<#list head as h>
<#if h?html?length gt 5 && h?html?substring(0,6)=="&lt;th">
${h}
<#elseif h?contains(",") && h?split(",")[1]?eval gt 0>
<th width="${h?split(",")[1]}">
${h?split(",")[0]}
</th>
<#else>
<th>
${h}
</th>
</#if>
</#list>
</#if>
</tr>
<#if filed?has_content && listItem?has_content>
<#list listItem?eval as item>
<tr>
<#if checkbox?has_content >
<td>
<input type="checkbox" name="${checkbox}" value="${item[checkbox]}">
</td>
</#if>
<#list filed as f>
<td>
<#if editField?seq_contains(f)>
<a href="javascript:${editJs}(${item[checkbox]})">${item[f]}</a>
<#else>
<#if item[f]?has_content && item[f]?is_date>
${item[f]?string(dateformat)}
<#else>
${item[f]?default('-')}
</#if>
</#if>
</td>
</#list>
</tr>
</#list>
<#if listItem?eval?size==0>
<tr>
<td colspan="${filed?size+1}"><@ms.nodata content="暂无数据" /></td>
</tr>
</#if>
</#if>
</thead>
<!--表格栏目属性 结束-->
<tbody id=${id}>
<#nested/>
</tbody>
</table>
</#macro>
\ No newline at end of file
<#--
<textarea name="textarea"></textarea>
-->
<#macro textarea
name
wrap="soft"
readonly=""
cols=""
rows=""
value=""
label=""
title=""
required="false"
id=""
class="form-control"
style=""
size=""
disabled=false
maxlength=""
placeholder=""
validation=""
labelStyle=""
width=""
help=""
helpDirection=""
colSm=""
>
<div class="form-group ms-form-group">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="ms-form-control ms-from-group-input col-sm-9" style="<#if width!="">width:${width}px;</#if>"<#rt/>>
<textarea<#rt/>
<#if id!=""> id="${id}"</#if><#rt/>
<#if wrap!=""> wrap="${wrap}"</#if><#rt/>
<#if readonly!=""> readonly="${readonly}"</#if><#rt/>
<#if cols!=""> cols="${cols}"</#if><#rt/>
<#if rows!=""> rows="${rows}"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
><#if value?? && value!="">${value!?html}</#if></textarea>
</div>
</div>
</#macro>
<#--
<input type="t"/>
-->
<#macro time id="" name="" value=""
label="" title="" size="" labelStyle="" width=""
class="form-control" style="" readonly="" disabled=false maxlength="" minlength="" placeholder="" validation=""
help=""
helpDirection=""
>
<div class="form-group ms-form-group">
<#include "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/>
data-date="" data-date-format="hh:ii" data-link-format="hh:ii">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-time"></i></span>
<input type="text"<#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/>/>
</div>
</div>
</div>
</div>
<script>
$(function(){
$('#${name}').datetimepicker({
language: 'cn',
todayBtn: 1,
autoclose: true,
todayHighlight: 1,
format: 'hh:ii',
startView: 1,
minView: 0,
maxView: 1,
forceParse: 0,
});
});
</script>
</#macro>
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<html lang="zh">
<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"/>
<script src="http://cdn.mingsoft.net/model/4.6.0/ms.mstore.client.min.js"></script>
</head>
<script type="text/javascript">
$(function(){
var menuJson=${modelList};
$('.dropdown-toggle').dropdown();
//加载头部菜单
manager.topMenu.initMenu(menuJson);
//点击头部菜单从左侧显示当前菜单子菜单
$(".ms-menu-list").delegate(".ms-menu-detail","click",function(){
manager.topMenu.showChildMenu($(this),menuJson);
});
//获取管理员帐号
$("#editLoginPassword").click(function() {
$.ajax({
type: "post",
dataType: "json",
url: "${managerPath}/editPassword.do",
success: function(msg){
var json =JSON.parse(msg.resultMsg);
$(".editLoginPassword input[name='managerName']").val(json);
//$(".editLoginPassword").modal();
}
});
});
//修改密码
$("#editLoginPasswordButton").click(function() {
var vobj = $("#updatePasswordFrom").data('bootstrapValidator').validate();
if(vobj.isValid()){
$(this).postForm("#updatePasswordFrom",{func:function(data) {
if(data.result){
alert("密码修改成功!");
location.reload();
}else{
alert(data.resultMsg);
}
}});
} else {
alert("表单验证失败");
}
});
//退出系统
$("#loginOutBtn").click(function() {
//$(this).request({func:function(data) {
// location.reload();
//}});
window.location.href="${managerPath}/logout"
});
$(".ms-menu-child li a").each(function() {
var tag = "?";
if ($(this).data("url").indexOf("?") > 0) {
tag="&";
}
$(this).data("url", "${managerPath}/"+$(this).data("url")+tag+"modelId="+$(this).data("id")+"&modelTitle="+encodeURI($(this).data("title")));
});
});
</script>
<body class="over-hide theme-index" >
<!--顶部开始 -->
<div class="ms-top">
<!--头部LOGO-->
<div class="ms-top-logo">
<img src="${skin_manager_logo}"/>
<!--span class="slideMenu">
<span class="icon iconfont icon-open">&#xe823;</span>
<span class="icon iconfont icon-close" style="display: none;">&#xe80d;</span>
</span-->
</div>
<!--头部一级菜单-->
<div class="ms-top-menu">
<div class="menu-default">
<#noparse>
<script id="ms-menu-list-tmpl" type="text/x-jquery-tmpl">
{{if modelModelId==0}}
<li data-model-id="${modelId}" data-model-icon="${modelIcon}" class="ms-menu-detail">${modelTitle}</li>
{{/if}}
</script>
</#noparse>
<ul class="ms-menu-list">
</ul>
<span class="glyphicon glyphicon-menu-hamburger openMenu"></span>
</div>
</div>
<!--头部用户信息/进入MStore-->
<div class="ms-top-user">
<div class="dropdown">
<div id="dLabel" class="ms-top-info" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-user"></span>
${Session.manager_session.managerName}
<span class="caret"></span>
</div>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li role="presentation" data-toggle="modal" data-target="#editLoginPassword">
<a role="menuitem" tabindex="-1"><span class="glyphicon glyphicon-cog"></span> 修改密码</a>
</li>
<li role="presentation" data-toggle="modal" data-target="#loginOut">
<a role="menuitem" tabindex="-1"><span class="glyphicon glyphicon-off"></span> 退出</a>
</li>
</ul>
</div>
<div class="ms-top-mstore" data-toggle="tooltip" data-placement="bottom" title="点击进入Mstore">
<span class="glyphicon glyphicon-th-large animated"></span>
<span class="mstore-update"></span>
</div>
</div>
</div>
<#noparse>
<script id="ms-menu-tmpl" type="text/x-jquery-tmpl">
{{if modelModelId==0}}
<div class="ms-menu-parent" data-model-id="${modelId}">
<div class="ms-menu-parent-header ms-menu-parent-active">
<div class="ms-menu-parent-title" data-flag="true">
<i class="icon iconfont icon-logo">${modelIcon}</i>
${modelTitle}
</div>
<span class="closeMenu">×</span>
</div>
<ul class="ms-menu-child child-list${modelId}" id="tab-tools">
</ul>
</div>
{{/if}}
</script>
<script id="ms-menu-child-tmpl" type="text/x-jquery-tmpl">
<li><a style="cursor: pointer;" data-title='${modelTitle}' data-url='${modelUrl}' data-id='${modelId}'><!--span class="caret"></span-->${modelTitle}</a></li>
</script>
</#noparse>
<!--左边菜单开始-->
<div class="ms-menu-div">
<div class="slideMenu">
<span class="icon iconfont icon-open">&#xe823;</span>
<span class="icon iconfont icon-close" style="display: none;">&#xe80d;</span>
</div>
</div>
<div class="ms-menu">
<div class="ms-menu-none"></div>
<!--span class="slideMenu glyphicon glyphicon-tasks"></span-->
</div>
<!--左边菜单结束-->
<!--右边开始-->
<div class="ms-content">
<div class="wellcome">
<h2>欢迎进入MS系统</h2>
<p>欢迎加群: 221335098 或到
<a href="http://ms.mingsoft.net/mbbs/main.do" target="_blank" style="text-decoration: none;">官方论坛进行技术交流</a>
</p>
</div>
<div class="easyui-tabs">
</div>
</div>
<!--右边结束-->
<!--修改登录密码模态框-->
<@ms.modal id="editLoginPassword" title="修改密码">
<@ms.modalBody>
<@ms.form isvalidation=true name="updatePasswordFrom" action="${managerPath}/updatePassword.do">
<@ms.text name="managerName" width="280" label="账号:" title="managerName" value="" readonly="readonly" validation={"required":"true", "data-bv-notempty-message":"必填项目"} />
<@ms.password width="280" name="oldManagerPassword" label="旧密码:" title="managerPassword" validation={"required":"true","minlength":"6","maxlength":"20","data-bv-notempty-message":"必填项目","data-bv-stringlength-message":"6-20个字符以内!"}/>
<@ms.password width="280" name="newManagerPassword" label="新密码:" title="managerPassword" validation={"required":"true", "minlength":"6","maxlength":"20", "data-bv-notempty-message":"必填项目","data-bv-stringlength-message":"6-20个字符以内!"}/>
</@ms.form>
</@ms.modalBody>
<@ms.modalButton>
<@ms.savebutton value="更新密码" id="editLoginPasswordButton"/>
</@ms.modalButton>
</@ms.modal>
<@ms.modal id="loginOut" title="退出提示!">
<@ms.modalBody>
确认退出?
</@ms.modalBody>
<@ms.modalButton>
<@ms.button value="确认退出" id="loginOutBtn" url="${managerPath}/loginOut.do"/>
</@ms.modalButton>
</@ms.modal>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<title>铭飞MCMS</title>
<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" />
<style>
body{ height: 100%;}
</style>
</head>
<body>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment