Commit a480376d authored by ms-dev's avatar ms-dev

优化结构

parent cd4672a3
......@@ -5,6 +5,7 @@ import java.util.Map;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -14,54 +15,53 @@ import org.apache.shiro.mgt.SecurityManager;
@Configuration
public class ShiroConfiguration {
@Value("${ms.manager.path}")
private String managerPath;
@Bean
public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// 必须设置 SecurityManager
shiroFilterFactoryBean.setSecurityManager(securityManager);
// setLoginUrl 如果不设置值,默认会自动寻找Web工程根目录下的"/login.jsp"页面 或 "/login" 映射
shiroFilterFactoryBean.setLoginUrl("/notLogin");
// 设置无权限时跳转的 url;
shiroFilterFactoryBean.setUnauthorizedUrl("/notRole");
public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// 必须设置 SecurityManager
shiroFilterFactoryBean.setSecurityManager(securityManager);
// setLoginUrl 如果不设置值,默认会自动寻找Web工程根目录下的"/login.jsp"页面 或 "/login" 映射
shiroFilterFactoryBean.setLoginUrl(managerPath+"/login.do");
// 设置无权限时跳转的 url;
shiroFilterFactoryBean.setUnauthorizedUrl(managerPath+"/404.do");
// 设置拦截器
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
//游客,开发权限
filterChainDefinitionMap.put("/guest/**", "anon");
//用户,需要角色权限 “user”
filterChainDefinitionMap.put("/user/**", "roles[user]");
//管理员,需要角色权限 “admin”
filterChainDefinitionMap.put("/admin/**", "roles[admin]");
//开放登陆接口
filterChainDefinitionMap.put("/ms/login.do", "anon");
filterChainDefinitionMap.put("/ms/checkLogin.do", "anon");
//其余接口一律拦截
//主要这行代码必须放在所有权限设置的最后,不然会导致所有 url 都被拦截
filterChainDefinitionMap.put("/**", "anon");
// 设置拦截器
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
// 游客,开发权限
filterChainDefinitionMap.put("/static/**", "anon");
filterChainDefinitionMap.put("/html/**", "anon");
// 开放登陆接口
filterChainDefinitionMap.put(managerPath+"/login.do", "anon");
filterChainDefinitionMap.put(managerPath+"/checkLogin.do", "anon");
// 其余接口一律拦截
// 主要这行代码必须放在所有权限设置的最后,不然会导致所有 url 都被拦截
filterChainDefinitionMap.put(managerPath+"/**", "authc");
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;
}
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;
}
/**
* 注入 securityManager
*/
@Bean
public SecurityManager securityManager() {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
// 设置realm.
securityManager.setRealm(customRealm());
return securityManager;
}
/**
* 注入 securityManager
*/
@Bean
public SecurityManager securityManager() {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
// 设置realm.
securityManager.setRealm(customRealm());
return securityManager;
}
/**
* 自定义身份认证 realm;
* <p>
* 必须写这个类,并加上 @Bean 注解,目的是注入 CustomRealm,
* 否则会影响 CustomRealm类 中其他类的依赖注入
*/
@Bean
public BaseAuthRealm customRealm() {
return new BaseAuthRealm();
}
/**
* 自定义身份认证 realm;
* <p>
* 必须写这个类,并加上 @Bean 注解,目的是注入 CustomRealm, 否则会影响 CustomRealm类 中其他类的依赖注入
*/
@Bean
public BaseAuthRealm customRealm() {
return new BaseAuthRealm();
}
}
\ No newline at end of file
#服务配置
server:
#端口
port: 8081
tomcat:
max-http-header-size: 10240 #单位:字节
#项目名称
servlet.context-path: /ms-mcms
# slf4j日志配置
logging:
# 配置级别
level:
#分包配置级别,即不同的目录下可以使用不同的级别
net.mingsoft: trace
#铭飞配置
ms:
manager:
path: /ms
view-path: /WEB-INF/manager
#session配置
session:
timeout: 1800000 #会话超时, 单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms
validation-interval: 120000 #会话清理间隔时间, 单位:毫秒,2m=120000ms
#上传配置
upload:
path: /upload
denied: exe
allowed: jpg
max-size: 1
memory-size: 4096
#spring配置
spring:
profiles:
active: dev
......@@ -39,29 +67,4 @@ spring:
mybatis:
mapper-locations: classpath*:**/dao/*.xml
configuration:
database-id: mysql
# slf4j日志配置
logging:
# 配置级别
level:
#分包配置级别,即不同的目录下可以使用不同的级别
net.mingsoft: trace
com.mingsoft: trace
ms:
manager:
path: /ms
view: #已过期
path: /WEB-INF/manager
session:
timeout: 1800000 #会话超时, 单位:毫秒, 20m=1200000ms, 30m=1800000ms, 60m=3600000ms
validation.interval: 120000 #会话清理间隔时间, 单位:毫秒,2m=120000ms
upload:
path: /upload
denied: exe
allowed: jpg
max:
size: 1
memory:
size: 4096
\ No newline at end of file
database-id: mysql
\ No newline at end of file
<@ms.html5>
<@ms.nav title="应用设置">
<@shiro.hasPermission name="app:update"><@ms.saveButton title="" postForm="appForm"/></@shiro.hasPermission>
</@ms.nav>
<@ms.panel>
<@ms.form isvalidation=true name="appForm" action="${managerPath}/app/update.do">
<@ms.hidden name="appId" value="${app.appId?default(0)}" />
<@ms.text name="appName" width="500" label="网站标题" value="${app.appName?default('')}" title="网站标题" placeholder="请输入网站标题" validation={"maxlength":"50","required":"true", "data-bv-notempty-message":"必填项目","data-bv-stringlength-message":"网站标题在50个字符以内!"}/>
<!--网站Logo,暂时不兼容-->
<@ms.formRow label="网站Logo" help="提示:文章缩略图,支持jpg,png格式">
<@ms.uploadImg path="app" inputName="appLogo" size="1" maxSize="1" imgs="${app.appLogo!('')}"/>
</@ms.formRow>
<@ms.checkbox name="appMobileStyle" width="200" list=[{"id":"m","value":"启用"}] listKey="id" listValue="value" valueList=["${app.appMobileStyle!('')}"] label="启用移动端"
help="启用后手机用户访问网站会显示手机版网页,前提是网站必需提供移动端皮肤,相关教程:<a href='http://ms.ming-soft.com/mbbs/13086/detail.do' target='_blank'>铭飞移动端开发教程</a>"/>
<@ms.select name="appStyle" width="300" id="appStyle" label="模板风格" />
<@ms.textarea name="appKeyword" label="关键字" value="${app.appKeyword?default('')}" rows="4" placeholder="请输入关键字"/>
<@ms.textarea name="appDescription" label="描述" value="${app.appDescription?default('')}" rows="4" placeholder="请输入站点描述"/>
<@ms.textarea name="appCopyright" label="版权信息" value="${app.appCopyright?default('')}" rows="4" placeholder="请输入版权信息"/>
</@ms.form>
</@ms.panel>
</@ms.html5>
<script>
$(function(){
<#if app.appId != 0>
ms.get("${managerPath}/template/queryAppTemplateSkin.do",null,function(msg){
if(msg.fileName != null && msg.fileName.length != 0){
//清空默认信息
$("#appStyle").html("");
for(var i=0; i<msg.fileName.length; i++){
if ("${app.appStyle?default('')}"==msg.fileName[i]) {
$("#appStyle").append("<option value="+msg.fileName[i]+" selected>"+msg.fileName[i]+"</option>")
} else {
$("#appStyle").append("<option value="+msg.fileName[i]+">"+msg.fileName[i]+"</option>")
}
}
}else{
$(".appStyle").append("<option>暂无模版</option>");
}
});
</#if>
});
</script>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="基础内容更新">
<@ms.saveButton postForm="basicForm"/>
</@ms.nav>
<@ms.panel>
<#assign basicTitle="">
<#assign basicId="0">
<#assign basicDescription="">
<#assign action="${managerPath}/basic/save.do">
<#if basic?has_content>
<#assign basicTitle="${basic.basicTitle?default('')}">
<#assign basicDescription="${basic.basicDescription?default('')}">
<#assign basicId="${basic.basicId}">
<#assign action="${managerPath}/basic/update.do">
</#if>
<@ms.form action="${action}" name="basicForm" redirect="${managerPath}/basic/${categoryId?default('0')}/list.do">
<@ms.hidden name="basicId" value="${basicId?default('')}"/>
<@ms.hidden name="basicCategoryId" value="${categoryId?default('0')}"/>
<@ms.text label="标题" name="basicTitle" value="${basicTitle?default('')}" size="33" style="width:40%" maxlength="120" />
<@ms.textarea label="描述" name="basicDescription" value="${basicDescription?default('')}" cols="110" rows="5" maxlength="1000" />
</@ms.form>
</@ms.panel>
</@ms.html5>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="基础内容管理"></@ms.nav>
<@ms.panel>
<@ms.searchForm name="basicForm" action="${managerPath}/basic/${categoryId?default(0)}/list.do">
<@ms.text label="关键字" name="keyword" placeholder="输入关键字" value="${keyword?default('')}"/>
<@ms.searchFormButton>
<@ms.queryButton form="basicForm"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panelNav>
<@ms.addButton url="${managerPath}/basic/add.do?categoryId=${categoryId?default(0)}&categoryTitle=${categoryTitle?default(0)}"/>
<@ms.delButton fieldName="basicId" onclick="remove"/>
</@ms.panelNav>
<@ms.table head=['编号,100',"标题"]
filed=["basicId","basicTitle"]
listItem="basicList"
id="basicId"
checkbox="basicId"
editField=["basicTitle"]
editJs="edit"
/>
<#if page?has_content>
<@ms.showPage page=page/>
</#if>
</@ms.panel>
</@ms.html5>
<script>
function edit(id) {
location.href = base+"${baseManager}/basic/"+id+"/edit.do";
}
function remove(ids) {
ms.post("${managerPath}/basic/allDelete.do","basicIds="+ids,function(msg){
if(msg.result){
location.reload();
}
});
}
</script>
<@ms.html5>
<@ms.nav title="省市县镇村数据编辑" back=true>
<@ms.saveButton onclick="save()"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="cityForm" isvalidation=true>
<@ms.hidden name="id" value="${cityEntity.id?default('')}"/>
</@ms.form>
</@ms.panel>
</@ms.html5>
<script>
var url = "${managerPath}/basic/city/save.do";
if($("input[name = 'id']").val() > 0){
url = "${managerPath}/basic/city/update.do";
$(".btn-success").text("更新");
}
//编辑按钮onclick
function save() {
$("#cityForm").data("bootstrapValidator").validate();
var isValid = $("#cityForm").data("bootstrapValidator").isValid();
if(!isValid) {
<@ms.notify msg= "数据提交失败,请检查数据格式!" type= "warning" />
return;
}
var btnWord =$(".btn-success").text();
$(".btn-success").text(btnWord+"中...");
$(".btn-success").prop("disabled",true);
$.ajax({
type:"post",
dataType:"json",
data:$("form[name = 'cityForm']").serialize(),
url:url,
success: function(status) {
if(status.result == true) {
<@ms.notify msg="保存或更新成功" type= "success" />
location.href = "${managerPath}/basic/city/index.do";
}
else{
<@ms.notify msg= "保存或更新失败!" type= "danger" />
location.href= "${managerPath}/basic/city/index.do";
}
}
})
}
</script>
<@ms.html5>
<@ms.nav title="省市县镇村数据管理"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.text label="省" name="provinceName" value="" width="240px;" placeholder="请输入省/直辖市/自治区级名称" />
<@ms.text label="市" name="cityName" value="" width="240px;" placeholder="请输入市级名称" />
<@ms.text label="县" name="countyName" value="" width="240px;" placeholder="请输入县/区级名称" />
<@ms.text label="镇" name="townName" value="" width="240px;" placeholder="请输入街道/镇级名称" />
<@ms.text label="村" name="villageName" value="" width="240px;" placeholder="请输入村委会名称" />
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="cityList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delCity" title="授权数据删除" >
<@ms.modalBody>删除此授权
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="确认删除?" id="deleteCityBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
$("#cityList").bootstrapTable({
url:"${managerPath}/basic/city/list.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
toolbar: "#toolbar",
columns: [{ checkbox: true},
{
field: 'provinceName',
title: '省/直辖市/自治区级名称',
align: 'center'
},{
field: 'cityName',
title: '市级名称',
align: 'center'
},{
field: 'countyName',
title: '县/区级名称',
align: 'center'
},{
field: 'townName',
title: '街道/镇级名称',
align: 'center'
},{
field: 'villageName',
title: '村委会名称',
align: 'center'
}]
})
})
//增加按钮
$("#addCityBtn").click(function(){
location.href ="${managerPath}/basic/city/form.do";
})
//删除按钮
$("#delCityBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#cityList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delCity").modal();
}
})
$("#deleteCityBtn").click(function(){
var rows = $("#cityList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
$.ajax({
type: "post",
url: "${managerPath}/basic/city/delete.do",
data: JSON.stringify(rows),
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "danger" />
}
location.reload();
}
})
});
//查询功能
function search(){
var search = $("form[name='searchForm']").serializeJSON();
var params = $('#cityList').bootstrapTable('getOptions');
params.queryParams = function(params) {
$.extend(params,search);
return params;
}
$("#cityList").bootstrapTable('refresh', {query:$("form[name='searchForm']").serializeJSON()});
}
</script>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="基础文件表编辑" back=true>
<#if fileEntity.id??>
<@ms.updateButton onclick="saveOrUpdate()"/>
<#else>
<@ms.saveButton onclick="saveOrUpdate()"/>
</#if>
</@ms.nav>
<@ms.panel>
<@ms.form name="fileForm" isvalidation=true>
<@ms.hidden name="id" value="${(fileEntity.id)?default('')}"/>
<@ms.text label="文件分类编号" name="categoryId" value="${(fileEntity.categoryId)?default('')}" width="240px;" placeholder="请输入文件分类编号" validation={"data-bv-between":"true","required":"true", "data-bv-between-message":"文件分类编号必须大于0小于9999999999","data-bv-between-min":"0", "data-bv-between-max":"9999999999","data-bv-notempty-message":"必填项目"}/>
<@ms.text label="文件名称" name="fileName" value="${(fileEntity.fileName)?default('')}" width="240px;" placeholder="请输入文件名称" validation={"required":"true","maxlength":"50","data-bv-stringlength-message":"文件名称长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="文件链接" name="fileUrl" value="${(fileEntity.fileUrl)?default('')}" width="240px;" placeholder="请输入文件链接" validation={"required":"true","maxlength":"50","data-bv-stringlength-message":"文件链接长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="文件大小" name="fileSize" value="${(fileEntity.fileSize)?default('')}" width="240px;" placeholder="请输入文件大小" validation={"data-bv-between":"true","required":"true", "data-bv-between-message":"文件大小必须大于0小于9999999999","data-bv-between-min":"0", "data-bv-between-max":"9999999999","data-bv-notempty-message":"必填项目"}/>
<@ms.text label="文件详情Json数据" name="fileJson" value="${(fileEntity.fileJson)?default('')}" width="240px;" placeholder="请输入文件详情Json数据" validation={"required":"true","maxlength":"50","data-bv-stringlength-message":"文件详情Json数据长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="文件类型:图片、音频、视频等" name="fileType" value="${(fileEntity.fileType)?default('')}" width="240px;" placeholder="请输入文件类型:图片、音频、视频等" validation={"required":"true","maxlength":"50","data-bv-stringlength-message":"文件类型:图片、音频、视频等长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="子业务" name="isChild" value="${(fileEntity.isChild)?default('')}" width="240px;" placeholder="请输入子业务" validation={"required":"true","maxlength":"50","data-bv-stringlength-message":"子业务长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
</@ms.form>
</@ms.panel>
</@ms.html5>
<script>
var logoClass = "glyphicon-floppy-saved";
var url = "${managerPath}/basic/file/save.do";
if($("input[name = 'id']").val() > 0){
logoClass = "glyphicon-open";
url = "${managerPath}/basic/file/update.do";
}
//编辑按钮onclick
function saveOrUpdate() {
$("#fileForm").data("bootstrapValidator").validate();
var isValid = $("#fileForm").data("bootstrapValidator").isValid();
if(!isValid) {
<@ms.notify msg= "数据提交失败,请检查数据格式!" type= "warning" />
return;
}
var btnWord =$(".btn-success").text();
$(".btn-success").text(btnWord+"中...");
$(".btn-success").prop("disabled",true);
$.ajax({
type:"post",
dataType:"json",
data:$("form[name = 'fileForm']").serialize(),
url:url,
success: function(data) {
if(data.id > 0) {
<@ms.notify msg="保存或更新成功" type= "success" />
location.href = "${managerPath}/basic/file/index.do";
}
else{
$(".btn-success").html(btnWord+"<span class='glyphicon " + logoClass + "' style='margin-right:5px'></span>");
$(".btn-success").text(btnWord);
$(".btn-success").removeAttr("disabled");
$('.ms-notifications').offset({top:43}).notify({
type:'danger',
message: { text:data.resultMsg }
}).show();
}
}
})
}
</script>
<@ms.html5>
<@ms.nav title="基础文件表管理"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNavBtnGroup>
<@shiro.hasPermission name="file:save"><@ms.panelNavBtnAdd id="addFileBtn" title=""/></@shiro.hasPermission>
<@shiro.hasPermission name="file:del"><@ms.panelNavBtnDel id="delFileBtn" title=""/></@shiro.hasPermission>
</@ms.panelNavBtnGroup>
</div>
<table id="fileList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delFile" title="基础文件表数据删除" >
<@ms.modalBody>删除此基础文件表
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="确认" class="btn btn-danger rightDelete" id="deleteFileBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
$("#fileList").bootstrapTable({
url:"${managerPath}/basic/file/list.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
toolbar: "#toolbar",
columns: [{ checkbox: true},
{
field: 'id',
title: '文件编号',
width:'11',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'categoryId',
title: '文件分类编号',
width:'11',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'appId',
title: 'APP编号',
width:'11',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'fileName',
title: '文件名称',
width:'200',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'fileUrl',
title: '文件链接',
width:'500',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'fileSize',
title: '文件大小',
width:'11',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'fileJson',
title: '文件详情Json数据',
width:'500',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'fileType',
title: '文件类型:图片、音频、视频等',
width:'50',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'isChild',
title: '子业务',
width:'50',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'updateDate',
title: '更新时间',
width:'0',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'updateBy',
title: '更新者',
width:'11',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'createBy',
title: '创建者',
width:'11',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'createDate',
title: '创建时间',
width:'0',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
},
{
field: 'del',
title: '删除标记',
width:'1',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/file/form.do?id="+row.id;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
}
]
})
})
//增加按钮
$("#addFileBtn").click(function(){
location.href ="${managerPath}/basic/file/form.do";
})
//删除按钮
$("#delFileBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#fileList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delFile").modal();
}
})
$("#deleteFileBtn").click(function(){
var rows = $("#fileList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
$.ajax({
type: "post",
url: "${managerPath}/basic/file/delete.do",
data: JSON.stringify(rows),
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "danger" />
}
location.reload();
}
})
});
//查询功能
function search(){
var search = $("form[name='searchForm']").serializeJSON();
var params = $('#fileList').bootstrapTable('getOptions');
params.queryParams = function(params) {
$.extend(params,search);
return params;
}
$("#fileList").bootstrapTable('refresh', {query:$("form[name='searchForm']").serializeJSON()});
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<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>
<style>
.container{margin:0;padding:0;width:auto}
hr{margin-top:9px;margin-bottom:9px;padding:0;}
.rowpadding3{padding-bottom: 3px;}
.ms-button-group{padding:0px 0px 8px 0px}
.row {margin-left:0;margin-right:0}
.form-horizontal .form-group{margin-left:0;margin-right:0}
.form-group{overflow: hidden;}
.bs-example>.dropdown>.dropdown-menu {position: static;margin-bottom: 5px;clear: left;}
.bs-example>.dropdown>.dropdown-toggle {float: left;}
.padding-zero{padding:0;}
.link-style a:hover{color:#000;}
.link-style a:visited{color:#000;}
.form-inline .form-group {display: inline-block;margin-bottom: 0;vertical-align: middle;}
#tableArticle .updateArticle {cursor: pointer;}
#menuBtn{margin:0}
#menuContent {
overflow: auto;
max-height: 240px;
display: none;
z-index: 999;
position: absolute;
float: left;
padding: 5px 0;
margin: 2px 0 0;
background-color: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
}
select, option,#menuBtn{
cursor: pointer;
background: white;
}
.selColumn{min-width:173px; height:34px;}
.categoryTree{border-right:1px solid #eeeeee;padding:0;}
</style>
<script>
</script>
<body>
<!----------------------------------- bootstarp 布局容器 开始-------------------------------->
<div class="container-fluid link-style">
<div class="row">
<div class="col-md-2 categoryTree">
<ul id="categoryTree" class="ztree" style="margin-top:0; width:100%;margin-left:-9px">
</div>
<!--右侧内容编辑区域开始-->
<div class="col-md-10" style="margin-top:0;padding:0;margin:0">
<!--------内容 部分 开始-------->
<div class="row" style="margin-top:0; width:100%;;padding:0 0 0 10px;margin:0">
<iframe src="${managerPath}/basic/0/list.do" style="width:100%;maring:0;padding:0;border:none;height:100%" id="listFrame" target="listFrame" ></iframe>
</div>
<!--内容部分结束-->
</div>
<!--右侧内容编辑区域结束-->
</div>
</div>
<!--引用弹出框插件-->
<@warnModal modalName="Model"/>
<!--JQ特效部分-->
<script>
$(function(){
$(".categoryTree").height($(document).height());
$("#listFrame").height($(document).height());
//zTree框架
var setting = {
callback: {
onClick: function(event, treeId, treeNode) {
if(treeNode.id>0) {
$("#listFrame").attr("src","${managerPath}/basic/"+treeNode.id+"/list.do?categoryTitle="+encodeURIComponent(treeNode.name));
}
}
},
view: {
dblClickExpand: dblClickExpand
},
data: {
simpleData: {
enable: true
}
}
};
function dblClickExpand(treeId, treeNode) {
return treeNode.level > 0;
}
$(document).ready(function(){
$.fn.zTree.init($("#categoryTree"), setting, zNodes);
});
//获取栏目节点列表
var listColumn=${listCategory};
var zNodes = new Array();
//遍历节点,添加到数字中
for( var i = 0 ; i < listColumn.length; i++){
zNodes[i] = { id:listColumn[i].categoryId, pId:listColumn[i].categoryCategoryId,name:listColumn[i].categoryTitle, open:false};
}
});
</script>
</body>
</html>
<@ms.html5>
<@ms.nav title="管理员管理"></@ms.nav>
<style>
.select2-container .select2-container--default {
height: 34px;
}
.select2-container .select2-selection--single{
font: inherit;
border: 1px solid #ccc;
display: block;
height: 34px;
padding: 0px 3px;
font-size: 14px;
color: rgb(85, 85, 85);
}
</style>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<@shiro.hasPermission name="manager:save"><@ms.panelNavBtnAdd title="" id="addManagerBtn"/></@shiro.hasPermission>
<@shiro.hasPermission name="manager:del"><@ms.panelNavBtnDel title="" id="delManagerBtn"/></@shiro.hasPermission>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="managerList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delManager" title="管理员删除" >
<@ms.modalBody>删除此管理员
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="删除" class="btn btn-danger rightDelete" id="deleteManagerBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
<@ms.modal id="addManager" title="管理员编辑" resetFrom=true>
<@ms.modalBody>
<@ms.form name="managerForm" isvalidation=true action="${managerPath}/basic/manager/save.do" redirect="${managerPath}/basic/manager/index.do">
<@ms.hidden name="managerId" value="0"/>
<@ms.text label="管理员名" name="managerName" value="" width="240px;" placeholder="请输入管理员名" validation={"required":"true","minlength":"3","maxlength":"12","data-bv-stringlength-message":"管理员用户名长度为3~12个字符!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="管理员昵称" name="managerNickName" value="" width="240px;" placeholder="请输入管理员昵称" validation={"required":"true","maxlength":"15","data-bv-stringlength-message":"管理员昵称长度不能超过十五个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="管理员密码" name="managerPassword" value="" width="240px;" placeholder="请输入管理员密码" validation={"minlength":"6","maxlength":"20","data-bv-stringlength-message":"管理员密码长度为6~20个字符!"}/>
<@ms.select id="managerRoleID" name="managerRoleID" label="角色编号"/>
</@ms.form>
</@ms.modalBody>
<@ms.modalButton>
<@ms.saveButton id= "saveOrUpdate"/>
</@ms.modalButton>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
//加载选择角色列表
$("#managerRoleID").request({url:"${managerPath}/basic/role/list.do",type:"json",method:"post",func:function(msg) {
var managerArr = msg.rows;
$("#managerRoleID").val(null).trigger("change");
if(managerArr.length != 0 && ($("#managerRoleID").val() == null)){
for(var i=0; i<managerArr.length; i++){
$("#managerRoleID").append($("<option>").val(managerArr[i].roleId).text(managerArr[i].roleName));
$("#managerRoleID").select2({width: "210px"}).val(managerArr[i].roleId).trigger("change");
}
} else if($("#managerRoleID").val()<0) {
$("#managerRoleID").append("<option>暂无角色</option>");
}
//使用select2插件
$("#managerRoleID").select2({width: "210px"});
}});
$("#managerList").bootstrapTable({
url:"${managerPath}/basic/manager/query.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
toolbar: "#toolbar",
columns: [{ checkbox: true,
formatter: function (value, row, index){
//不能删除自己
if("${Session.manager_session.managerName}" == row.managerName){
return {disabled : true};
}
}
},{
field: 'managerName',
title: '账号',
align: 'center',
formatter:function(value,row,index) {
if(row.managerId == 0){
return value;
}else{
<@shiro.hasPermission name="manager:update">
return "<a onclick='updateSearch("+row.managerId+")' style='cursor:pointer;text-decoration:none;' >" + value + "</a>";
</@shiro.hasPermission>
<@shiro.lacksPermission name="manager:update">
return value;
</@shiro.lacksPermission>
}
}
}, {
field: 'managerNickName',
title: '昵称'
}, {
field: 'managerPassword',
title: '密码'
}, {
field: 'roleName',
title: '角色名称'
}, {
field: 'managerTime',
title: '创建时间',
align: 'center'
} ]
})
})
//增加按钮
$("#addManagerBtn").click(function(){
$('#managerForm').attr("${managerPath}/basic/manager/save.do");
$(".addManager").modal();
})
var url = "${managerPath}/basic/manager/save.do";
if($("input[name = 'managerId']").val() > 0){
url = "${managerPath}/basic/manager/update.do";
$(".btn-success").text("更新");
}
//保存按钮
$("#saveOrUpdate").click(function(){
$("#managerForm").data("bootstrapValidator").validate();
var isValid = $("#managerForm").data("bootstrapValidator").isValid();
if(!isValid) {
<@ms.notify msg= "数据提交失败,请检查数据格式!" type= "warning" />
return;
}
$(this).text("正在保存...");
$(this).attr("disabled","true");
var managerEntity = $('#managerForm').serialize();
var url = $('#managerForm').attr("action");
$.ajax({
type: "post",
url:url,
data: managerEntity,
dataType:"json",
success:function(data){
if(data.managerId > 0){
<@ms.notify msg= "保存或更新成功" type= "success" />
location.reload();
}else {
$('.ms-notifications').offset({top:43}).notify({
type:'warning',
message: { text:data.resultMsg }
}).show();
$("#saveOrUpdate").removeAttr("disabled");
$("#saveOrUpdate").text("保存");
}
}
});
})
//删除按钮
$("#delManagerBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#managerList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delManager").modal();
}
})
$("#deleteManagerBtn").click(function(){
var rows = $("#managerList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
$.ajax({
type: "post",
url: "${managerPath}/basic/manager/delete.do",
data: JSON.stringify(rows),
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "danger" />
}
location.reload();
}
})
});
//表单赋值
function updateSearch(managerId){
$(this).request({url:"${managerPath}/basic/manager/get.do?managerId="+managerId,func:function(manager) {
if (manager.managerId > 0) {
$("#managerForm").attr("action","${managerPath}/basic/manager/update.do");
$("#managerForm input[name='managerName']").val(manager.managerName);
$("#managerForm input[name='managerId']").val(manager.managerId);
$("#managerForm input[name='managerNickName']").val(manager.managerNickName);
$("#managerRoleID").select2({width: "210px"}).val(manager.managerRoleID).trigger("change");
$("#managerForm select[name='managerRoleID']").val(manager.managerRoleID);
$("#addManager").modal();
}
}});
}
</script>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="通用用户与信息一对多表编辑" back=true>
<@ms.saveButton onclick="save()"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="peopleForm" isvalidation=true>
<@ms.hidden name="bpId" value="${peopleEntity.bpId?default('')}"/>
<@ms.number label="信息编号" name="bpBasicId" value="${peopleEntity.bpBasicId?default('')}" width="240px;" placeholder="请输入信息编号" validation={"required":"false","maxlength":"50","data-bv-stringlength-message":"信息编号长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.number label="用户编号" name="bpPeopleId" value="${peopleEntity.bpPeopleId?default('')}" width="240px;" placeholder="请输入用户编号" validation={"required":"false","maxlength":"50","data-bv-stringlength-message":"用户编号长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.text label="创建时间" name="bpDatetime" value="${peopleEntity.bpDatetime?string('yyyy-MM-dd')}" width="240px;"/>
</@ms.form>
</@ms.panel>
</@ms.html5>
<script>
var url = "${managerPath}/basic/people/save.do";
if($("input[name = 'bpId']").val() > 0){
url = "${managerPath}/basic/people/update.do";
$(".btn-success").text("更新");
}
//编辑按钮onclick
function save() {
$("#peopleForm").data("bootstrapValidator").validate();
var isValid = $("#peopleForm").data("bootstrapValidator").isValid();
if(!isValid) {
<@ms.notify msg= "数据提交失败,请检查数据格式!" type= "warning" />
return;
}
var btnWord =$(".btn-success").text();
$(".btn-success").text(btnWord+"中...");
$(".btn-success").prop("disabled",true);
$.ajax({
type:"post",
dataType:"json",
data:$("form[name = 'peopleForm']").serialize(),
url:url,
success: function(status) {
if(status.result == true) {
<@ms.notify msg="保存或更新成功" type= "success" />
location.href = "${managerPath}/basic/people/index.do";
}
else{
<@ms.notify msg= "保存或更新失败!" type= "danger" />
location.href= "${managerPath}/basic/people/index.do";
}
}
})
}
</script>
<@ms.html5>
<@ms.nav title="通用用户与信息一对多表管理"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<@ms.addButton id="addPeopleBtn"/>
<@ms.delButton id="delPeopleBtn"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="peopleList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delPeople" title="授权数据删除" >
<@ms.modalBody>删除此授权
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="确认删除?" id="deletePeopleBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
$("#peopleList").bootstrapTable({
url:"${managerPath}/basic/people/list.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
toolbar: "#toolbar",
columns: [{ checkbox: true},
{
field: 'bpId',
title: '',
width:'10',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/people/form.do?bpId="+row.bpId;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
}, {
field: 'bpBasicId',
title: '信息编号',
width:'10',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/people/form.do?bpBasicId="+row.bpBasicId;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
}, {
field: 'bpPeopleId',
title: '用户编号',
width:'10',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/people/form.do?bpPeopleId="+row.bpPeopleId;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
}, {
field: 'bpDatetime',
title: '创建时间',
width:'19',
align: 'center',
formatter:function(value,row,index) {
var url = "${managerPath}/basic/people/form.do?bpDatetime="+row.bpDatetime;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
} ]
})
})
//增加按钮
$("#addPeopleBtn").click(function(){
location.href ="${managerPath}/basic/people/form.do";
})
//删除按钮
$("#delPeopleBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#peopleList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delPeople").modal();
}
})
$("#deletePeopleBtn").click(function(){
var rows = $("#peopleList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
$.ajax({
type: "post",
url: "${managerPath}/basic/people/delete.do",
data: JSON.stringify(rows),
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "danger" />
}
location.reload();
}
})
});
//查询功能
function search(){
var search = $("form[name='searchForm']").serializeJSON();
var params = $('#peopleList').bootstrapTable('getOptions');
params.queryParams = function(params) {
$.extend(params,search);
return params;
}
$("#peopleList").bootstrapTable('refresh', {query:$("form[name='searchForm']").serializeJSON()});
}
</script>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="角色设置" back=true>
<@ms.saveButton id="save"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="columnForm" isvalidation=true >
<@ms.text name="roleName" label="角色名称:" title="角色名称" value="${roleEntity.roleName?default('')}" width="300" validation={"required":"true","maxlength":"30","data-bv-notempty-message":"请填写角色名称"}/>
<@ms.formRow label="权限管理:">
<div>
<table id="modelList"
data-show-export="true"
data-method="post"
data-side-pagination="server">
</table>
</div>
</@ms.formRow>
</@ms.form>
</@ms.panel>
</@ms.html5>
<script>
$(function(){
//数据初始化
$("#modelList").bootstrapTable({
url:"${managerPath}/model/modelList.do?roleId=${roleEntity.roleId?default('')}",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
idField: 'modelId',
treeShowField: 'modelTitle',
parentIdField: 'modelModelId',
columns: [
{
field: 'modelTitle',
title: '模块标题',
width: '200'
},{
field: 'attribute',
title: '功能权限',
formatter:function(value,row,index) {
var attribute = "";
for(var i=0;i<row.modelChildList.length;i++){
var modelId = row.modelChildList[i].modelId;
var str = "<label style=' margin-top: 3px; margin-right: 20px;' class='ms-check'><input type='checkbox' data-ids='"+row.modelChildList[i].modelParentIds+"' value='"+modelId+"' name='attribute'/> "+row.modelChildList[i].modelTitle+"</label>"
if(row.modelChildList[i].chick == 1){
str = "<label style=' margin-top: 3px; margin-right: 20px;' class='ms-check'><input type='checkbox' checked='checked' data-ids='"+row.modelChildList[i].modelParentIds+"' value='"+modelId+"' name='attribute'/> "+ row.modelChildList[i].modelTitle+"</label>";
}
if(attribute == ""){
attribute = str;
}else{
attribute = attribute+str;
}
}
return attribute;
}
}]
})
})
//保存操作
$("#save").click(function(){
$("#columnForm").data("bootstrapValidator").validate();
var isValid = $("#columnForm").data("bootstrapValidator").isValid();
if(!isValid) {
<@ms.notify msg= "数据提交失败,请检查数据格式!" type= "warning" />
return;
}
var roleName = $("input[name=roleName]").val();
var roleId = "${roleEntity.roleId?default('')}";
var oldRoleName = "${roleEntity.roleName?default('')}";
var ids=[];
$("input[name=attribute]").each(function () {
if($(this).is(':checked')){
var modelId = $(this).val();
var modelModelIds = $(this).attr("data-ids");
ids.push(modelId);
if(modelModelIds!="") {
var parentIds = modelModelIds.split(",");
for(var i=0;i<parentIds.length;i++){
if(parentIds[i]!="") {
if($.inArray(parentIds[i], ids) == -1){
ids.push(parentIds[i]);
}
}
}
}
}
});
if(roleName == "" || roleName == null){
<@ms.notify msg= '角色名不能为空' type= "warning" />
}else{
$.ajax({
type:"post",
url:"${managerPath}/basic/role/saveOrUpdateRole.do",
dataType: "json",
data:{ids:ids,roleName:roleName,roleId:roleId,oldRoleName:oldRoleName},
success:function(data){
if(data.result == false) {
$('.ms-notifications').offset({top:43}).notify({
type:'warning',
message: { text:data.resultMsg }
}).show();
}else {
<@ms.notify msg= "操作成功" type= "success" />
location.href= "${managerPath}/basic/role/index.do";
}
}
});
}
})
</script>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="角色管理"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.text label="角色名" name="roleName" value="" width="240px;" placeholder="请输入角色名" />
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<@shiro.hasPermission name="role:save"><@ms.panelNavBtnAdd title="" id="addRoleBtn"/></@shiro.hasPermission>
<@shiro.hasPermission name="role:del"><@ms.panelNavBtnDel title="" id="delRoleBtn"/></@shiro.hasPermission>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="roleList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delRole" title="角色删除" >
<@ms.modalBody>删除此角色
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="删除" class="btn btn-danger rightDelete" id="deleteRoleBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
$("#roleList").bootstrapTable({
url:"${managerPath}/basic/role/list.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
toolbar: "#toolbar",
columns: [{ checkbox: true,
formatter: function (value, row, index){
//不能删除自己
if("${Session.manager_session.managerRoleID}" == row.roleId){
return {disabled : true};
}
}
},{
field: 'roleId',
title: '编号',
align: 'center',
width: '80',
},{
field: 'roleName',
title: '角色名',
formatter:function(value,row,index) {
if("${Session.manager_session.managerRoleID}" == row.roleId){
return value ;
}else{
var url = "${managerPath}/basic/role/form.do?roleId="+row.roleId;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
}
}
}]
})
})
//增加按钮
$("#addRoleBtn").click(function(){
location.href ="${managerPath}/basic/role/form.do";
})
//删除按钮
$("#delRoleBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#roleList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delRole").modal();
}
})
$("#deleteRoleBtn").click(function(){
var rows = $("#roleList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
$.ajax({
type: "post",
url: "${managerPath}/basic/role/delete.do",
data: JSON.stringify(rows),
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "danger" />
}
location.reload();
}
})
});
//查询功能
function search(){
var search = $("form[name='searchForm']").serializeJSON();
var params = $('#roleList').bootstrapTable('getOptions');
params.queryParams = function(params) {
$.extend(params,search);
return params;
}
$("#roleList").bootstrapTable('refresh', {query:$("form[name='searchForm']").serializeJSON()});
}
</script>
\ No newline at end of file
<@ms.html5>
<@ms.nav title="${modelTitle}编辑" back=true>
<@ms.saveButton onclick="save()"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="categoryForm" isvalidation=true>
<@ms.hidden name="categoryId" value="${categoryEntity.categoryId?default('')}"/>
<@ms.hidden name="categoryModelId" value="${modelId?default('0')}"/>
<@ms.text label="${modelTitle}标题" name="categoryTitle" value="${categoryEntity.categoryTitle?default('')}" width="240px;" placeholder="请输入类别标题" validation={"required":"true","maxlength":"50","data-bv-stringlength-message":"类别标题长度不能超过五十个字符长度!", "data-bv-notempty-message":"必填项目"}/>
<@ms.textarea colSm="2" name="categoryDescription" label="${modelTitle}描述" wrap="Soft" rows="3" size="" width="642px;" value="${categoryEntity.categoryDescription?default('')}" placeholder="${modelTitle}描述" validation={"maxlength":"50","data-bv-stringlength-message":"栏目描述长度不能超过五十个字符长度!"}/>
<@ms.formRow label="缩略图">
<@ms.uploadImg path="category" inputName="categorySmallImg" size="15" filetype="" msg="" maxSize="1" imgs="${(category.categorySmallImg)?default('')}" />
</@ms.formRow>
</@ms.form>
</@ms.panel>
</@ms.html5>
<script>
var url = "${managerPath}/category/save.do";
if($("input[name = 'categoryId']").val() > 0){
url = "${managerPath}/category/update.do";
$(".btn-success").text("更新");
}
//编辑按钮onclick
function save() {
$("#categoryForm").data("bootstrapValidator").validate();
var isValid = $("#categoryForm").data("bootstrapValidator").isValid();
if(!isValid) {
<@ms.notify msg= "数据提交失败,请检查数据格式!" type= "warning" />
return;
}
var btnWord =$(".btn-success").text();
$(".btn-success").text(btnWord+"中...");
$(".btn-success").prop("disabled",true);
$.ajax({
type:"post",
dataType:"json",
data:$("form[name = 'categoryForm']").serialize(),
url:url,
success: function(status) {
if(status.categoryId != null) {
<@ms.notify msg="保存或更新成功" type= "success" />
history.go(-1);
location.reload();
}
else{
<@ms.notify msg= "保存或更新失败!" type= "danger" />
}
}
})
}
</script>
<@ms.html5>
<@ms.nav title="${modelTitle}"></@ms.nav>
<@ms.searchForm name="searchForm" isvalidation=true>
<@ms.text label="${modelTitle}标题" name="categoryTitle" value="" width="240px;" placeholder="请输入类别标题" validation={"maxlength":"50","data-bv-stringlength-message":"${modelTitle}标题长度不能超过五十个字符长度!"}/>
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm>
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<#include "/${model?default('')}/category/shiro-button.ftl"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="categoryList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-pagination="true"
data-page-size="10"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delCategory" title="${modelTitle}数据删除" >
<@ms.modalBody>删除此数据
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button class="btn btn-danger rightDelete" id="deleteCategoryBtn" value="确定"/>
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
var category = {modelId:${modelId?default('0')},modelTitle:"${modelTitle?default('0')}"};
$("#categoryList").bootstrapTable({
url:"${managerPath}/category/list.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
queryParams:function(params) {
return $.extend(params,category);
},
toolbar: "#toolbar",
columns: [{ checkbox: true},
{
field: 'categoryId',
title: '${modelTitle}编号',
align: 'center',
width:'120'
},{
field: 'categoryTitle',
title: '${modelTitle}标题',
formatter:function(value,row,index) {
<#include "/${model?default('')}/category/shiro-update.ftl"/>
}
}, {
field: 'categoryDescription',
title: '${modelTitle}描述'
} ]
})
})
//增加按钮
$("#addCategoryBtn").click(function(){
location.href ="${managerPath}/category/form.do?modelId=${modelId?default('0')}&modelTitle=${modelTitle?default('0')}";
})
//删除按钮
$("#delCategoryBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#categoryList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delCategory").modal();
}
})
$("#deleteCategoryBtn").click(function(){
var rows = $("#categoryList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
$.ajax({
type: "post",
url: "${managerPath}/category/delete.do",
data: JSON.stringify(rows),
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "danger" />
}
location.reload();
}
})
});
//查询功能
function search(){
var modelId = {modelId:${modelId}};
var search = $("form[name='searchForm']").serializeJSON();
var params = $('#categoryList').bootstrapTable('getOptions');
params.queryParams = function(params) {
$.extend(params,search,modelId);
return params;
}
$("#categoryList").bootstrapTable('refresh', {query:$("form[name='searchForm']").serializeJSON()});
}
</script>
\ No newline at end of file
<@ms.addButton id="addCategoryBtn"/>
<@ms.delButton id="delCategoryBtn"/>
\ No newline at end of file
var url = "${managerPath}/${model?default("")}/category/form.do?categoryId="+row.categoryId+"&modelId=${modelId?default('0')}&modelTitle=${modelTitle?default('0')}" ;
return "<a href=" +url+ " target='_self'>" + value + "</a>";
\ No newline at end of file
This diff is collapsed.
<@ms.html5>
<@ms.nav title="栏目表管理"></@ms.nav>
<!--@ms.searchForm name="searchForm" isvalidation=true>
<@ms.searchFormButton>
<@ms.queryButton onclick="search()"/>
</@ms.searchFormButton>
</@ms.searchForm-->
<@ms.panel>
<div id="toolbar">
<@ms.panelNav>
<@ms.buttonGroup>
<#include "/${model?default('')}/column/shiro-button.ftl"/>
</@ms.buttonGroup>
</@ms.panelNav>
</div>
<table id="columnList"
data-show-refresh="true"
data-show-columns="true"
data-show-export="true"
data-method="post"
data-side-pagination="server">
</table>
</@ms.panel>
<@ms.modal modalName="delColumn" title="删除栏目" >
<@ms.modalBody>删除选中栏目,如果有子栏目也会一并删除
<@ms.modalButton>
<!--模态框按钮组-->
<@ms.button value="确认删除?" id="deleteColumnBtn" />
</@ms.modalButton>
</@ms.modalBody>
</@ms.modal>
</@ms.html5>
<script>
$(function(){
$("#columnList").bootstrapTable({
url:"${managerPath}/${model?default('')}/column/list.do",
contentType : "application/x-www-form-urlencoded",
queryParamsType : "undefined",
toolbar: "#toolbar",
idField: 'categoryId',
treeShowField: 'categoryTitle',
parentIdField: 'categoryCategoryId',
columns: [
{
checkbox: true
},{
field: 'categoryId',
title: '编号',
align: 'center'
},{
field: 'categoryTitle',
title: '标题',
align: 'left',
formatter:function(value,row,index) {
<#include "/${model?default('')}/column/shiro-update.ftl"/>
}
},{
field: 'columnType',
title: '属性',
align: 'center',
formatter:function(value,row,index) {
if(value == 1){
return "列表";
}else if(value == 2){
return "单页";
}else if(value == 3){
return "外部链接";
}
}
},{
field: 'columnPath',
title: '链接地址',
align: 'left',
formatter:function(value,row,index) {
return "{ms:global.url/}"+value+"/index.html";
}
},{
field: 'columnListUrl',
title: '列表地址',
align: 'left',
formatter:function(value,row,index) {
if(value != null){
return value;
}else{
return "";
}
}
},{
field: 'columnUrl',
title: '内容地址',
align: 'left',
formatter:function(value,row,index) {
if(row.columnType == 1){
return value;
}else{
return "";
}
}
},{
field: 'columnUrl',
title: '封面地址',
align: 'left',
formatter:function(value,row,index) {
if(row.columnType == 2){
return value;
}else{
return "";
}
}
}]
})
})
//增加按钮
$("#addColumnBtn").click(function(){
location.href ="${managerPath}/${model?default('')}/column/add.do?modelId=${Session.model_id_session?default(0)}&modelTitle=${Session.model_title_session?default('')}";
})
//删除按钮
$("#delColumnBtn").click(function(){
//获取checkbox选中的数据
var rows = $("#columnList").bootstrapTable("getSelections");
//没有选中checkbox
if(rows.length <= 0){
<@ms.notify msg="请选择需要删除的记录" type="warning"/>
}else{
$(".delColumn").modal();
}
})
$("#deleteColumnBtn").click(function(){
var rows = $("#columnList").bootstrapTable("getSelections");
$(this).text("正在删除...");
$(this).attr("disabled","true");
var ids = [];
for(var i=0;i<rows.length;i++){
ids[i] = rows[i].categoryId;
}
ids.reverse();
$.ajax({
type: "post",
url: "${managerPath}/${model?default('')}/column/delete.do?ids="+ids,
dataType: "json",
contentType: "application/json",
success:function(msg) {
if(msg.result == true) {
<@ms.notify msg= "删除成功" type= "success" />
}else {
<@ms.notify msg= "删除失败" type= "warning" />
}
location.reload();
}
})
});
//查询功能
function search(){
var search = $("form[name='searchForm']").serializeJSON();
var params = $('#columnList').bootstrapTable('getOptions');
params.queryParams = function(params) {
$.extend(params,search);
return params;
}
$("#columnList").bootstrapTable('refresh', {query:$("form[name='searchForm']").serializeJSON()});
}
</script>
\ No newline at end of file
<@ms.addButton id="addColumnBtn"/>
<@ms.delButton id="delColumnBtn"/>
\ No newline at end of file
var url = "${managerPath}/${model?default("")}/column/"+row.categoryId+"/edit.do?modelId=${Session.model_id_session?default(0)}&modelTitle=${Session.model_title_session?default('')}";
return "<a href=" +url+ " target='_self'>" + value + "</a>";
<meta charset="utf-8">
<!--浏览器小图标-->
<link rel="icon" href="http://cdn.mingsoft.net/global/images/ms.ico" type="x-icon">
<script type="text/javascript" src="https://unpkg.com/vue@2.5.21/dist/vue.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<!--网络请求框架-->
<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
<script src="https://cdn.bootcss.com/qs/6.5.2/qs.min.js"></script>
<!--铭飞-->
<script src="http://cdn.mingsoft.net/ms/1.0/ms.js"></script>
<script src="http://cdn.mingsoft.net/ms/1.0/ms.http.js"></script>
<script src="http://cdn.mingsoft.net/ms/1.0/ms.util.js"></script>
<link rel="stylesheet" href="http://cdn.mingsoft.net/ms-admin-ui/4.7.0/css/ms.css">
<script>
ms.manager = {
path: "${managerPath}"
}
</script>
\ No newline at end of file
<#include "/include/ui/index.ftl"/>
<#include "/include/manager.ftl"/>
<#global autoCURD=""/>
<#macro autoCURD>
<#local url=baseUrl?split("?")?first?split("/")?last/>
<#if url == "add.do">
<#global autoCURD="save">
<#elseif url =="edit.do">
<#global autoCURD="update">
</#if>
</#macro>
<@ms.autoCURD/>
<#--权限控制-->
<#--link:必须 type:add/del/edit/query class:样式 id,value:显示文字-->
<#macro auth link type="" value="" class="" id="">
<@shiro.hasPermission name="${link}">
<#if type=="add">
<@ms.panelNavBtnAdd id="${id}" value="${value}" class="${class}"/>
<#elseif type=="del">
<@ms.panelNavBtnDel id="${id}" value="${value}" class="${class}"/>
<!--
<#elseif type=="edit">
<@ms.panelNavBtnDel id="${id}" value="${value}" class="${class}"/>
-->
<#else>
<a href="${link}" class="${class}">${value}</a>
</#if>
</@shiro.hasPermission>
</#macro>
<#--分页-->
<#macro pagehelper page displayedPages="5" edges="3" url="">
<#if page?exists && page.pages gt 1>
<nav class="pageNav">
<ul class="pagination pull-right" id="pagination">
<#--格式 <(上一页) 1 2 3 4 >(下一页) -->
<li class="prev <#if (page.pageNum)==1> disabled" ><a<#else> "><a href="${url}&pageNo=${page.pageNum-1}" </#if> target="_self"><i class="fa fa-angle-left">上一页</i></a></li>
<#list 1..page.pages as i>
<li <#if page.pageNum==i>class="active" ><a<#else> ><a href='${url}&pageNo=${i}'</#if> target="_self">${i}</a></li>
</#list>
<li class="next <#if page.pageNum == page.pages>disabled" ><a<#else> "><a href="${url}&pageNo=${page.pageNum+1}"</#if> target="_self"><i class="fa fa-angle-right">下一页</i></a></li>
</ul>
</nav>
</#if>
</#macro>
<#--分页-->
<#macro showPage page displayedPages="5" edges="3">
<#if page?exists && page.pageCount gt 1>
<nav class="pageNav">
<ul class="pagination pull-right" id="pagination">
<#if displayedPages?has_content && edges?has_content>
<script>
$(function(){
$('#pagination').pagination({
pages: ${page.pageCount},
cssStyle: 'pagination pull-right',
displayedPages: ${displayedPages?default(1)},
hrefTextPrefix:"${page.linkUrl}pageNo=",
currentPage:${page.pageNo+1},
edges:<#if edges?has_content>${edges?default(3)}<#else>3</#if>
});
})
</script>
<#else>
<#--格式 <(上一页) 1 2 3 4 >(下一页) -->
<li class="prev <#if (page.pageNo+1)==1> disabled" ><a<#else> "><a href="${page.previousUrl}" </#if> target="_self"><i class="fa fa-angle-left">上一页</i></a></li>
<#list 1..page.pageCount as i>
<li <#if page.pageNo+1==i>class="active" ><a<#else> ><a href='${page.linkUrl}pageNo=${i}'</#if> target="_self">${i}</a></li>
</#list>
<li class="next <#if page.pageNo+1 == page.pageCount>disabled" ><a<#else> "><a href="${page.nextUrl}"</#if> target="_self"><i class="fa fa-angle-right">下一页</i></a></li>
</#if>
</ul>
</nav>
</#if>
</#macro>
<#macro method>
${baseUrl}
</#macro>
<#--4.5.5版本该文件废弃->
<#--后台的UI界面通用区域定义 -->
<#macro html5 width="100%" style="">
<!DOCTYPE html>
<html lang="en">
<head>
<#include "/include/macro.ftl"/>
<#include "/include/meta.ftl"/>
</head>
<body>
<div class="ms-content">
<div class="ms-content-body" style="width:${width};${style}">
<#nested/>
</div>
</div>
</body>
</html>
</#macro>
<#macro panel style="">
<div class="ms-content-body-panel" style="${style}">
<#nested/>
</div>
</#macro>
<#--主体结构-->
<#macro content>
<div class="ms-content">
<#nested/>
</div>
</#macro>
<#--左侧菜单-->
<#macro contentMenu style="">
<div class="ms-content-menu" style="${style}">
<#nested/>
</div>
</#macro>
<#--废弃-->
<#macro left>
<div class="ms-content-menu">
<#nested/>
</div>
</#macro>
<#--内容-->
<#macro contentBody width="100%" style="">
<div class="ms-content-body" style="width:${width};${style}">
<#nested/>
</div>
</#macro>
<#--内容导航-->
<#--button:格式为map 例如:button={"text":标题,"link":默认返回}-->
<#macro contentNav title="板块名称">
<div class="ms-content-body-title">
<strong>${title}</strong>
<#nested/>
</div>
</#macro>
<#--搜索按钮组-->
<#macro searchBtnGroup size="1">
<@ms.col size="${size}" style="text-align:right;border-top: 1px #EAEAEA solid;padding-top: 10px;">
<#nested/>
</@ms.col>
</#macro>
<#-- 分割线-->
<#macro panelNav empty=false>
<div class="ms-content-body-panel-nav" <#if empty>style=" padding: 0;"</#if>>
<#nested/>
</div>
</#macro>
<#--列表上面导航条右侧的过滤按钮区域 右浮动 -->
<#macro panelNavFilter>
<div style="float:right;">
<#nested/>
</div>
</#macro>
<#--列表按钮组 如下拉菜单-->
<#macro panelNavBtnGroup role="group" btn="" >
<div class="btn-group" role="${role}">
<#nested/>
</div>
</#macro>
<#-- 判断按钮的传入参数是否为空值 -->
<#macro isPanelNavBtn class _class id _id>
<#assign _id="${_id}"/>
<#if id?has_content>
<#assign _id="${id}" />
</#if>
<#assign _class="${_class}">
<#if class?has_content>
<#assign _class="${class}">
</#if>
</#macro>
<#macro panelNavBtnAdd value="" icon="plus" class="default" id="addButton" onclick="" title="">
<@ms.isPanelNavBtn id="${id}" _id="addButton" class="${class}" _class="default"/>
<@ms.button icon="${icon}" id="${_id}" value="${value} " icon="${icon}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/>
</#macro>
<#macro panelNavBtnDel value="" icon="trash" class="danger" id="delButton" onclick="" title="">
<@ms.isPanelNavBtn id="${id}" _id="delButton" class="${class}" _class="danger"/>
<@ms.button icon="${icon}" value="${value} " icon="${icon}" id="${id}" class="btn btn-${_class}" onclick="${onclick}" title="${title}"/>
</#macro>
<#macro contentNavBack value="返回" icon="share-alt" class="default" onclick="javascript:history.go(-1)" title="返回">
<@ms.button value="${value}" icon="${icon}" onclick="${onclick}" class="btn btn-${class}" title="${title}"/>
</#macro>
<#macro panelNavBtnSave value="保存" icon="disk" class="default" id="saveButton" onclick="" title="保存" >
<@ms.button class="btn btn-success" value="${value} " icon="${icon}" id="${id}" onclick="${onclick}" title="${title}"/>
</#macro>
<#---->
<#macro contentPanel style="">
<div class="ms-content-body-panel" style="${style}">
<#nested/>
</div>
</#macro>
<#--整行-->
<#macro row>
<div class="row">
<#nested/>
</div>
</#macro>
<#--整列-->
<#macro col size="1" style="">
<div class="col-md-${size} col-sm-${size}" style="${style}">
<#nested/>
</div>
</#macro>
<#--提示没有数据-->
<#macro nodata content="暂无数据" style="text-align:center">
<p class="alert alert-info" role="alert" style="${style}">
${content}
</p>
</#macro>
<#--表格列表-->
<#macro table head="" list="" id="">
<table class="table table-hover">
<!--表格栏目属性 开始-->
<thead>
<tr>
<#if head?has_content>
<#list head as h>
<#if h?html?length gt 5 && h?html?substring(0,6)=="&lt;th">
${h}
<#else>
<th>
${h}
</th>
</#if>
</#list>
</#if>
</tr>
</thead>
<!--表格栏目属性 结束-->
<tbody id=${id}>
<#nested/>
</tbody>
</table>
</#macro>
<base target="mainFrame" />
<#assign static="${basePath}/static">
<#setting url_escaping_charset='utf-8'>
<#assign bootstrap="3.3.5">
<#assign manager_ui="4.6.4">
<#assign easyui="1.5">
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="${static}/plugins/animate/1.0.0/animate.css" media="all" />
<link rel="stylesheet" type="text/css" href="${static}/plugins/iconfont/1.0.0/iconfont.css"/>
<script type="text/javascript" src="${static}/plugins/jquery/1.9.1/jquery-1.9.1.js"></script>
<script type="text/javascript" src="${static}/plugins/jquery.serializeJSON/2.8.1/jquery.serializejson.min.js"></script>
<link rel="stylesheet" type="text/css" href="${static}/plugins/ztree/3.5/zTreeStyle.css" media="all" />
<script type="text/javascript" src="${static}/plugins/ztree/3.5/jquery.ztree.all-3.5.min.js"></script>
<link rel="stylesheet" type="text/css" href="${static}/plugins/bootstrap/${bootstrap}/css/bootstrap.min.css" media="all" />
<link rel="stylesheet" type="text/css" href="${static}/plugins/bootstrap/${bootstrap}/css/bootstrap-switch.css" media="all" />
<link rel="stylesheet" type="text/css" href="${static}/plugins/bootstrap/${bootstrap}/css/bootstrapValidator.css" media="all" />
<link rel="stylesheet" type="text/css" href="${static}/plugins/bootstrap/${bootstrap}/css/bootstrap-notify.css" media="all" />
<script type="text/javascript" src="${static}/plugins/bootstrap/${bootstrap}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${static}/plugins/bootstrap/${bootstrap}/js/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="${static}/plugins/bootstrap/${bootstrap}/js/bootstrapValidator.js"></script>
<script type="text/javascript" src="${static}/plugins/bootstrap/${bootstrap}/js/bootstrap-notify.js"></script>
<link rel="stylesheet" type="text/css" href="${static}/plugins/select2/4.0.3/css/select2.min.css" media="all" />
<script type="text/javascript" src="${static}/plugins/select2/4.0.3/js/select2.min.js"></script>
<!--时间插件-->
<script type="text/javascript" src="${static}/plugins/jquery.validation/1.15.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="${static}/plugins/jquery.tmpl/1.4.2/jquery.tmpl.min.js"></script>
<!--时间插件-->
<link href="${static}/plugins/bootstrap.daterangepicker/1.3.4/daterangepicker.css" rel="stylesheet">
<script type="text/javascript" src="${static}/plugins/bootstrap.daterangepicker/1.3.4/moment.js"></script>
<script type="text/javascript" src="${static}/plugins/bootstrap.daterangepicker/1.3.4/daterangepicker.js"></script>
<script type="text/javascript" src="${static}/plugins/jquery.cookie/2.2.0/jquery.cookie.js"></script>
<!----上传图片--->
<script type="text/javascript" src="${static}/plugins/jquery.swfupload/1.0.0/swfupload.js"></script>
<script type="text/javascript" src="${static}/plugins/jquery.swfupload/1.0.0/jquery.swfupload.js"></script>
<script type="text/javascript" src="${static}/plugins/jquery.swfupload/1.0.0/fileprogress.js"></script>
<!--script type="text/javascript" src="${static}/plugins/plupload/2.2.1/plupload.full.min.js"></script-->
<!--后台UI-->
<script type="text/javascript" src="${static}/skin/manager/${manager_ui}/js/ms.manager.js"></script>
<script type="text/javascript" src="${static}/skin/manager/${manager_ui}/js/ms.web.js"></script>
<!--easyUI-->
<link rel="stylesheet" type="text/css" href="${static}/plugins/jquery.easyui/${easyui}/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${static}/plugins/jquery.easyui/${easyui}/themes/icon.css">
<script type="text/javascript" src="${static}/plugins/jquery.easyui/${easyui}/jquery.easyui.min.js"></script>
<!--bootstrap=table-->
<link rel="stylesheet" href="${static}/plugins/bootstrap-table/1.11.1/bootstrap-table.css">
<link rel="stylesheet" href="${static}/plugins/bootstrap-table/1.11.1/extensions/tree-column/bootstrap-table-tree-column.css">
<script src="${static}/plugins/bootstrap-table/1.11.1/bootstrap-table.js"></script>
<script src="${static}/plugins/bootstrap-table/1.11.1/extensions/tree-column/bootstrap-table-tree-column.min.js"></script>
<script src="${static}/plugins//bootstrap-table/1.11.0/locale/bootstrap-table-zh-CN.min.js"></script>
<!-- vue框架所需要的资源 -->
<script src="${static}/plugins/hammerjs/2.0.8/hammer.min.js"></script>
<script src="${static}/plugins/vue/2.3.3/vue.min.js"></script>
<link rel="stylesheet" type="text/css" href="${static}/skin/manager/${manager_ui}/css/ms.manager.min.css" media="all" />
<#assign skin_manager_logo="${static}/skin/manager/${manager_ui}/images/logo.png"/>
<#assign skin_manager_loadding="${static}/skin/manager/${manager_ui}/images/loading.gif"/>
<#include "/include/macro.ftl"/>
<script>
var basePath = "${basePath}";
var base = "${base}";
var managerPath = "${managerPath}";
var static = "${static}";
$(function() {
//启用工具提示
// $("[data-toggle='tooltip']").tooltip();
// $("[data-toggle='popover']").popover({html:true});
})
<#if manager_session?exists>
var websiteId= "${manager_session.basicId?default('0')}" ;
</#if>
</script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="${base}/https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="${base}/https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" charset="utf-8" src="${base}/static/plugins/ueditor/1.4.3.1/ueditor.parse.js"></script>
<script type="text/javascript" charset="utf-8" src="${base}/static/plugins/ueditor/1.4.3.1/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${base}/static/plugins/ueditor/1.4.3.1/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="${base}/static/plugins/ueditor/1.4.3.1/lang/zh-cn/zh-cn.js"></script>
<#if id?? && id!=""> id="${id}"</#if><#rt/>
<#if ajaxUrl?? && ajaxUrl!=""> data-ajax-url="${ajaxUrl}"</#if><#rt/>
<#if class?? && class!=""> class="${class}"</#if><#rt/>
<#if style?? && style!=""> style="${style}"</#if><#rt/>
<#if onclick?? && onclick!=""> onclick="${onclick}"</#if><#rt/>
<#rt/>
\ No newline at end of file
This diff is collapsed.
<label class="ms-check"><input type="checkbox"<#rt/>
value="${rkey}"<#rt/>
<#if valueList?seq_contains(rkey)> checked="checked"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
/> ${rvalue}</label><#if hasNext> </#if>
<#--
4.5.5开始废弃
<input type="checkbox"/>
-->
<#macro checkboxlist
list listKey="" listValue="" valueList=[]
label="" colon=":" hasColon="true"
id="" name="" class="" style="" size="" title="" disabled=false
validation="" direction=true
width=""
labelStyle=""
help=""
>
<div class="form-group ms-form-group">
<#include "/include/ui/control.ftl"/><#rt/>
<div class="col-sm-10" <#if width!=""> style="${width}px"</#if><#rt/>>
<#if list?is_sequence>
<#if listKey!="" && listValue!="">
<#list list as item>
<#local rkey=item[listKey]>
<#local rvalue=item[listValue]>
<#local index=item_index>
<#local hasNext=item_has_next>
<#include "/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>
\ No newline at end of file
<#if name!=""> name="${name}"</#if><#rt/>
<#if class!=""> class="${class}"</#if><#rt/>
<#if style!=""> style="${style}"</#if><#rt/>
<#if title?? && title!=""> title="${title}"</#if><#rt/>
<#if disabled?? && disabled> disabled="disabled"</#if><#rt/>
<#if maxlength?? && maxlength!=""> maxlength="${maxlength}"</#if><#rt/>
<#if minlength?? && minlength!=""> minlength="${minlength}"</#if><#rt/>
<#if name!=""> name="${name}"</#if><#rt/>
<#if placeholder?? && placeholder!=""> placeholder="${placeholder}"</#if><#rt/>
<#if validation?? && validation?has_content><#--验证框架,需要bootstrapValidator框架-->
<#list validation?keys as key>
${key}="${validation[key]}"<#rt/>
</#list>
</#if>
<#if onclick?? && onclick!=""> onclick="${onclick}"</#if><#rt/>
<#rt/>
\ No newline at end of file
<#if label!="">
<#assign tmp="2">
<label <#if name?? && name!="">for="${name}"</#if> <#if labelStyle?? && labelStyle!="">style="${labelStyle?default('')}"</#if> <#if colSm?? && colSm!=""><#assign tmp="${colSm}"></#if> class="col-sm-${tmp} control-label ">
<#if help!="">
<script>
$(function () {
$('[data-toggle="popover"]').popover()
})
</script>
<span tabindex="0" class="glyphicon glyphicon-question-sign" data-toggle="popover" role="button" data-trigger="focus" data-container="body" data-placement="${helpDirection?default('rigth')}" title="提示" data-content="${help}"></span>
</#if>
${label}
</label>
</#if>
\ No newline at end of file
<#--
<input type="text"/>
-->
<#macro date id="" name="" value="" begin="" end="" limit="30"
time=false single=false label="" title="" size="" width=""
class="form-control" style="" readonly="" validation="" disabled=false maxlength="" minlength="" placeholder="" ranges=true
labelStyle=""
help=""
helpDirection=""
>
<div class="form-group ms-form-group">
<#include "/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">
<span class="add-on input-group-addon"><i class="glyphicon glyphicon-calendar fa fa-calendar"></i></span>
<input type="text"<#rt/>
<#if id!=""> id="${id}"<#elseif name!="">id="${name}"</#if><#rt/>
<#if maxlength!=""> maxlength="${maxlength}"</#if><#rt/>
<#if readonly!=""> readonly="${readonly}"</#if><#rt/>
<#if value?? && value?string!=""> value="${value?html}"</#if><#rt/>
<#include "/include/ui/common-attributes.ftl"/><#rt/>
/><#rt/>
</div>
</div>
</div>
</div>
<script>
var ${name}Set = {
startDate: moment().subtract(29, 'days'),
endDate: moment(),
<#if begin?has_content>minDate: '${begin?string('yyyy-MM-dd')}',</#if>
<#if end?has_content>maxDate: '${end?string('yyyy-MM-dd')}',</#if>
dateLimit: { days: ${limit} },
showDropdowns: true,
showWeekNumbers: true,
<#if time>
timePicker: true,
timePickerIncrement: 1,
</#if>
<#if single>singleDatePicker: true,</#if>
timePicker12Hour: true,
<#if ranges>
ranges: {
'今天': [moment(), moment()],
'昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'最近7天': [moment().subtract(6, 'days'), moment()],
'最近30天': [moment().subtract(29, 'days'), moment()],
'当月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
},
</#if>
opens: 'left',
buttonClasses: ['btn btn-default'],
applyClass: 'btn-small btn-primary',
cancelClass: 'btn-small',
format: 'YYYY-MM-DD<#if time> HH:mm:ss</#if>',
separator: '至',
locale: {
applyLabel: '确认',
cancelLabel: '取消',
//fromLabel: '开始时间',
//toLabel: '结束时间',
customRangeLabel: '自定义',
daysOfWeek: ['日', '一', '二', '三', '四', '五','六'],
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
firstDay: 1
}
};
var ${name}Func = function(start, end, label) {
//alert("Callback has fired: [" + start.format('MMMM D, YYYY') + " to " + end.format('MMMM D, YYYY') + ", label = " + label + "]");
//$('#subscribeReplyForm').formValidation('revalidateField', "${name}");
}
$('#${name}').daterangepicker(${name}Set, ${name}Func);
$('#${name}').on('apply.daterangepicker', function(ev, picker) {
// $('#${name}').parents("form:first").data('bootstrapValidator').revalidateField('<#if id!="">${id}<#elseif name!="">${name}</#if>');
});
</script>
</#macro>
<#--简易编辑器-->
<#--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 "/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">
//实例化编辑器
//建议使用工厂方法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 "/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 "/include/ui/common-attributes.ftl"/><#rt/>
<#include "/include/ui/scripting-events.ftl"/><#rt/>
/>
<#include "/include/ui/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/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 "/include/ui/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 "/include/ui/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 "/include/ui/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 "/include/macro.ftl"/>
<#include "/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 "/include/ui/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 "/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/>
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 "/include/ui/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.
This diff is collapsed.
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.
<!DOCTYPE html>
<html lang="en">
<head>
<META HTTP-EQUIV="Refresh" CONTENT="120">
</head>
<body>
***><***
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<@ms.html5>
<@ms.nav title="编辑模版文件" back=true>
<@ms.savebutton id="update" value="修改"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="form" id="editFileForm">
<!--文件名称-->
<@ms.text label="文件名称" value="${name?default('')}" readonly="readonly"/>
<@ms.hidden value="${fileName}" name="fileName" />
<!--文件内容-->
<@ms.textarea name="fileContent" label="文件内容" wrap="Soft" rows="21" size="" value="${fileContent}"/>
<@ms.hidden id="fileName" value="${fileName}" />
<@ms.hidden id="fileNamePrefix" value="${fileNamePrefix}" />
</@ms.form>
</@ms.panel>
</@ms.html5>
<script type="text/javascript">
$(function () {
//修改文件
$("#update").on("click",function(){
var formData = $("#editFileForm").serialize();
var URL=base+"${baseManager}/template/writeFileContent.do"
var oldFileName = $("#fileName").val();
var fileNamePrefix = $("#fileNamePrefix").val();
$(this).text("修改中");
$(this).attr("disabled",true);
$(this).request({url:URL,type:"json",method:"post",data:formData+"&oldFileName="+oldFileName+"&fileNamePrefix="+fileNamePrefix,func:function(msg) {
//回调处理方式
if(msg.result){
<@ms.notify msg= "修改模版文件成功" type= "success" />
} else {
<@ms.notify msg= "修改模版文件失败" type= "warning" />
}
var fileNameUrl = $(".fileNamePrefix").val();
$("#update").text("修改");
$("#update").attr("disabled",false);
}});
});
});
</script>
Markdown is supported
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