parent
a1450f4715
commit
3624771362
2 changed files with 784 additions and 153 deletions
@ -1,161 +1,631 @@ |
||||
<@ms.html5> |
||||
<@ms.nav title="静态化"></@ms.nav> |
||||
<@ms.panel> |
||||
<p class="alert alert-info" role="alert"> |
||||
<span class="glyphicon glyphicon-pushpin text-lef "></span> |
||||
<a class="alert-link text-lef" style="margin-left: 12px;"> |
||||
更新主页,如果系统存在引导页面可以手动修改主页位置文件名,default.html引导页面index.html主页。 |
||||
</a><br/> |
||||
<span class="glyphicon glyphicon-pushpin text-lef "></span> |
||||
<a class="alert-link text-lef" style="margin-left: 12px;"> |
||||
更新栏目列表,推荐使用指定栏目更新。系统提示“更新中...”请不要刷新页面或点击其他菜单。 |
||||
</a><br/> |
||||
<span class="glyphicon glyphicon-pushpin text-lef "></span> |
||||
<a class="alert-link text-lef" style="margin-left: 12px;"> |
||||
根据时间与栏目类型生成文章 |
||||
</a> |
||||
</p> |
||||
<@ms.form name="generateIndex"> |
||||
<@ms.formRow label="选择主页模板" width="300"> |
||||
<select class="form-control" id="select_id"></select> |
||||
<input type="hidden" name="url"/> |
||||
</@ms.formRow> |
||||
<@ms.text id="position" label="选择主页位置 " width="300" value="index" placeholder="输入主页位置" name="position" help="注:主页位置htm文件名一般为index.html或default.html"/> |
||||
<div class="form-group ms-form-group"><div class="col-sm-2"></div><div class="col-sm-9 ms-from-group-input ms-form-input"> |
||||
<@shiro.hasPermission name="cms:generate:index"> |
||||
<@ms.button class="btn btn-primary" id="updateIndex" value="生成主页" /> |
||||
<@ms.panelNavBtnSave title="" id="viewIndex" value="预览主页" /> |
||||
</@shiro.hasPermission> |
||||
<html xmlns="http://www.w3.org/1999/html"> |
||||
<head> |
||||
<title>静态化</title> |
||||
<#include "../../include/head-file.ftl"> |
||||
<style> |
||||
[v-cloak]{ |
||||
display: none; |
||||
} |
||||
</style> |
||||
</head> |
||||
<body class="custom-body"> |
||||
<div id="app" v-cloak> |
||||
<div class="class-1" > |
||||
<el-alert style="line-height: 22px;padding: 20px;" |
||||
title="" |
||||
type="success" |
||||
:closable="false" |
||||
show-icon> |
||||
更新主页,如果系统存在引导页面可以手动修改主页位置文件名,default.html引导页面index.html主页。<br/> |
||||
更新栏目列表,推荐使用指定栏目更新。系统提示“更新中...”请不要刷新页面或点击其他菜单。<br/> |
||||
根据时间与栏目类型生成文章 |
||||
</el-alert> |
||||
</div> |
||||
<el-form ref="form" label-width="90px" size="mini"> |
||||
<div class="class-2" > |
||||
<div class="class-3" > |
||||
<div class="class-4" > |
||||
<el-form-item label="主题模板"> |
||||
<el-select v-model="template" |
||||
:style="{width: '100%'}" |
||||
:filterable="false" |
||||
:disabled="false" |
||||
:multiple="true" :clearable="true" |
||||
placeholder="请选择主题模板"> |
||||
<el-option v-for='item in templateOptions' :key="item.dictValue" :value="item.dictValue" |
||||
:label="item.dictLabel"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="class-7" > |
||||
<el-form-item> |
||||
<template slot='label'> |
||||
<el-popover slot="label" placement="top-start" title="提示" width="200" trigger="hover" content="主页位置htm文件名一般为index.html或default.html"> |
||||
<i class="el-icon-question" slot="reference"></i> |
||||
</el-popover>主页位置 |
||||
</template> |
||||
<el-input v-model="position" |
||||
:disabled="false" |
||||
:style="{width: '100%'}" |
||||
:clearable="true" |
||||
placeholder="请输入主页位置"> |
||||
</el-input> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="class-10" > |
||||
<el-form-item> |
||||
<el-button type="primary">生成主页</el-button> |
||||
<el-button plain>预览主页</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
<div class="class-13" > |
||||
<div class="class-14" > |
||||
<el-form-item label="文章栏目"> |
||||
<el-select v-model="contentSection" |
||||
:style="{width: '100%'}" |
||||
:filterable="false" |
||||
:disabled="false" |
||||
:multiple="true" :clearable="true" |
||||
placeholder="请选择文章栏目"> |
||||
<el-option v-for='item in templateOptions' :key="item.dictValue" :value="item.dictValue" |
||||
:label="item.dictLabel"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="class-17" > |
||||
<el-form-item> |
||||
<template slot='label'> |
||||
<el-popover slot="label" placement="top-start" title="提示" width="200" trigger="hover" content="指定时间需要小于生成文章的发布时间"> |
||||
<i class="el-icon-question" slot="reference"></i> |
||||
</el-popover>指定时间 |
||||
</template> |
||||
<el-date-picker |
||||
v-model="time" |
||||
placeholder="请选择指定时间" |
||||
start-placeholder="" |
||||
end-placeholder="" |
||||
:readonly="false" |
||||
:disabled="false" |
||||
:editable="true" |
||||
:clearable="true" |
||||
format="yyyy-MM-dd" |
||||
value-format="yyyy-MM-dd" |
||||
:style="{width:'100%'}" |
||||
type="date"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="class-20" > |
||||
<el-form-item> |
||||
<el-button type="primary">生成文章</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
<div class="class-23" > |
||||
<div class="class-24" > |
||||
<el-form-item label="生成栏目"> |
||||
<el-select v-model="section" |
||||
:style="{width: '100%'}" |
||||
:filterable="false" |
||||
:disabled="false" |
||||
:multiple="true" :clearable="true" |
||||
placeholder="请选择生成栏目"> |
||||
<el-option v-for='item in templateOptions' :key="item.dictValue" :value="item.dictValue" |
||||
:label="item.dictLabel"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
</@ms.form> |
||||
<!--选择更新的栏目--> |
||||
<@ms.form name="generateColumn"> |
||||
<@ms.formRow label="选择要生成栏目" width="300"> |
||||
<#if list?has_content> |
||||
<@ms.treeInput treeId="inputTree" json="${list?default('')}" jsonId="categoryId" jsonPid="categoryCategoryId" jsonName="categoryTitle" buttonText="选择更新的栏目" addNodesName="所有栏目" inputName="columnId" showIcon="true" expandAll="true" /> |
||||
<#else> |
||||
<@ms.treeInput treeId="errorTree" buttonText="暂无数据" /> |
||||
</#if> |
||||
</@ms.formRow> |
||||
<div class="form-group ms-form-group"><div class="col-sm-2"></div><div class="col-sm-9 ms-from-group-input ms-form-input"> |
||||
<@shiro.hasPermission name="cms:generate:column"> |
||||
<@ms.button class="btn btn-primary" id="updateColumn" value="生成栏目" /> |
||||
</@shiro.hasPermission> |
||||
</div></div> |
||||
</@ms.form> |
||||
<@ms.form name="generateArticle"> |
||||
<@ms.formRow label="文章栏目" width="300"> |
||||
<#if list?has_content> |
||||
<@ms.treeInput treeId="inputTreee" json="${list?default('')}" jsonId="categoryId" jsonPid="categoryCategoryId" jsonName="categoryTitle" addNodesName="所有栏目" buttonText="选择更新的栏目" inputName="articleId" showIcon="true" expandAll="true" /> |
||||
<#else> |
||||
<@ms.treeInput treeId="errorTree" buttonText="暂无数据" /> |
||||
</#if> |
||||
</@ms.formRow> |
||||
<@ms.date name="dateTime" label="指定时间" single=true readonly="readonly" width="300" value="${now?string('yyyy-MM-dd')}" validation={"required":"true", "data-bv-notempty-message":"必填项目"} placeholder="点击该框选择时间段" /> |
||||
<div class="form-group ms-form-group"><div class="col-sm-2"></div><div class="col-sm-9 ms-from-group-input ms-form-input"> |
||||
<@shiro.hasPermission name="cms:generate:article"> |
||||
<@ms.button class="btn btn-primary" id="updateArticle" value="生成文章" /> |
||||
</@shiro.hasPermission> |
||||
</div></div> |
||||
</@ms.form> |
||||
</@ms.panel> |
||||
</@ms.html5> |
||||
|
||||
<!--点击进行按钮提交--> |
||||
<div class="class-30" > |
||||
<el-form-item> |
||||
<el-button type="primary">生成栏目</el-button> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</body> |
||||
</html> |
||||
<script> |
||||
$(function(){ |
||||
var URL="${managerPath}/template/queryTemplateFileForColumn.do"; |
||||
var DATA = ""; |
||||
$(this).request({url:URL,data:DATA,type:"json",method:"get",func:function(msg) { |
||||
if(msg.length==0){ |
||||
$("#select_id").append("<option value='' >暂无文件</option>") |
||||
} |
||||
for(var i = 0;i<msg.length;i++){ |
||||
$("#select_id").append("<option value="+msg[i]+">"+msg[i]+"</option>"); |
||||
//如果存在index.html |
||||
if(msg[i]=="index.html" || msg[i]=="index.htm"){ |
||||
$("#select_id").find("option[value='"+msg[i]+"']").attr("selected",true); |
||||
} |
||||
} |
||||
}}); |
||||
}) |
||||
|
||||
//点击一键更新主页时,进行主页更新 |
||||
$("#updateIndex").click(function(){ |
||||
//选择的主页模板名称和主页位置 |
||||
var url = $("#select_id").val(); |
||||
var position =$("input[name='position']").val(); |
||||
//封装ajax请求参数 |
||||
var URL="${managerPath}/cms/generate//generateIndex.do"; |
||||
var DATA = "url="+url+"&position="+position; |
||||
$(this).html("更新中..").attr("disabled", "disabled"); |
||||
$(this).request({url:URL,data:DATA,type:"json",method:"post",func:function(msg) { |
||||
$("#updateIndex").html("更新主页").removeAttr("disabled"); |
||||
if(msg.result){ |
||||
<@ms.notify msg="更新成功" type="success"/> |
||||
}else{ |
||||
$('.ms-notifications').offset({top:43}).notify({ |
||||
type:'warning', |
||||
message: { text:msg.resultMsg } |
||||
}).show(); |
||||
} |
||||
$("#updateIndex").html("更新主页") |
||||
}}); |
||||
}); |
||||
//点击预览时,进行预览 |
||||
$("#viewIndex").click(function(){ |
||||
var position =$("input[name='position']").val(); |
||||
window.open("${managerPath}/cms/generate/"+position+"/viewIndex.do"); |
||||
}); |
||||
</script> |
||||
var app = new Vue({ |
||||
el: '#app', |
||||
watch:{ |
||||
|
||||
<!--点击生成栏目按钮--> |
||||
<script> |
||||
$("#updateColumn").click(function() { |
||||
var columnId = 0; |
||||
if($("input[name='columnId']").val() !="" && $("input[name='columnId']").val().length>0){ |
||||
columnId = $("input[name='columnId']").val(); |
||||
} |
||||
var URL="${managerPath}/cms/generate/"+columnId+"/genernateColumn.do"; |
||||
$(this).html("更新中..").attr("disabled", "disabled"); |
||||
$(this).request({url:URL,data:columnId,type:"json",method:"post",func:function(msg) { |
||||
$("#updateColumn").html("更新栏目").removeAttr("disabled"); |
||||
//回调处理方式 |
||||
if(msg.result){ |
||||
<@ms.notify msg="更新成功" type="success"/> |
||||
}else{ |
||||
$('.ms-notifications').offset({top:43}).notify({ |
||||
type:'warning', |
||||
message: { text:msg.resultMsg } |
||||
}).show(); |
||||
} |
||||
}}); |
||||
}); |
||||
</script> |
||||
}, |
||||
data: { |
||||
template:'',//主题模板 |
||||
templateOptions:[], |
||||
position:'', //位置 |
||||
contentSection:'', //文章栏目 |
||||
section:'', //栏目 |
||||
time:'', |
||||
|
||||
}, |
||||
methods: { |
||||
}, |
||||
created(){ |
||||
|
||||
<!--点击生成文章按钮--> |
||||
<script> |
||||
$("#updateArticle").click(function() { |
||||
var articleId = 0; |
||||
if($("input[name='articleId']").val() !="" ){ |
||||
articleId = $("input[name='articleId']").val(); |
||||
} |
||||
var URL="${managerPath}/cms/generate/" + articleId + "/generateArticle.do"; |
||||
var DATA = "dateTime=" + $("input[name='dateTime']").val(); |
||||
$(this).html("更新中..").attr("disabled", "disabled"); |
||||
|
||||
$(this).request({url:URL,data:DATA,type:"json",method:"post",func:function(msg) { |
||||
$("#updateArticle").html("更新文档").removeAttr("disabled"); |
||||
//回调处理方式 |
||||
if(msg.result){ |
||||
<@ms.notify msg="更新成功" type="success"/> |
||||
}else{ |
||||
$('.ms-notifications').offset({top:43}).notify({ |
||||
type:'warning', |
||||
message: { text:msg.resultMsg } |
||||
}).show(); |
||||
} |
||||
}}); |
||||
}); |
||||
}) |
||||
</script> |
||||
<style> |
||||
input{ |
||||
width: 100%!important; |
||||
} |
||||
.class-1 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
max-width:100%; |
||||
background-color:#FFFFFF; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
width:100%; |
||||
background-repeat:no-repeat; |
||||
padding: 14px; |
||||
} |
||||
.class-2 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
height:500px; |
||||
max-width:100%; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
width:100%; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-3 |
||||
{ |
||||
color:#333333; |
||||
padding:20px; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
height:200px; |
||||
max-width:100%; |
||||
background-color:#FFFFFF; |
||||
flex-direction:column; |
||||
display:flex; |
||||
justify-content:end; |
||||
margin: 12px 6px 12px 12px; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:100%; |
||||
padding-left:20px; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-4 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-5 |
||||
{ |
||||
color:#333333; |
||||
word-wrap:break-word; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
font-size:14px; |
||||
line-height:1.4; |
||||
} |
||||
.class-6 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#606266; |
||||
padding-right:15px; |
||||
box-sizing:boredr-box; |
||||
outline:none; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:40px; |
||||
margin-left:20px; |
||||
animation-duration:1s; |
||||
background:none; |
||||
width:320px; |
||||
font-size:12px; |
||||
line-height:40px; |
||||
padding-left:15px; |
||||
} |
||||
.class-7 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
border-width:1px; |
||||
border-style:none; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-8 |
||||
{ |
||||
color:#333333; |
||||
word-wrap:break-word; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
font-size:14px; |
||||
line-height:1.4; |
||||
} |
||||
.class-9 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#606266; |
||||
padding-right:15px; |
||||
box-sizing:boredr-box; |
||||
outline:none; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:40px; |
||||
margin-left:20px; |
||||
animation-duration:1s; |
||||
background:none; |
||||
width:320px; |
||||
font-size:12px; |
||||
line-height:40px; |
||||
padding-left:15px; |
||||
} |
||||
.class-10 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
border-width:1px; |
||||
border-style:none; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-11 |
||||
{ |
||||
cursor:pointer; |
||||
color:#ffffff; |
||||
box-sizing:border-box; |
||||
height:34px; |
||||
background-color:#0099ff; |
||||
text-align:center; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:98px; |
||||
line-height:34px; |
||||
font-size:14px; |
||||
} |
||||
.class-12 |
||||
{ |
||||
cursor:pointer; |
||||
border-color:#0099FF; |
||||
color:#0099FF; |
||||
box-sizing:border-box; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:34px; |
||||
background-color:#FFFFFF; |
||||
text-align:center; |
||||
display:inline-block; |
||||
margin-left:10px; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:98px; |
||||
line-height:34px; |
||||
font-size:14px; |
||||
} |
||||
.class-13 |
||||
{ |
||||
color:#333333; |
||||
padding:20px; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
height:200px; |
||||
max-width:100%; |
||||
background-color:#FFFFFF; |
||||
flex-direction:column; |
||||
display:flex; |
||||
justify-content:end; |
||||
margin: 12px 6px; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:100%; |
||||
padding-left:20px; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-14 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-15 |
||||
{ |
||||
color:#333333; |
||||
word-wrap:break-word; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
font-size:14px; |
||||
line-height:1.4; |
||||
} |
||||
.class-16 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#606266; |
||||
padding-right:15px; |
||||
box-sizing:boredr-box; |
||||
outline:none; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:40px; |
||||
margin-left:20px; |
||||
animation-duration:1s; |
||||
background:none; |
||||
width:320px; |
||||
font-size:12px; |
||||
line-height:40px; |
||||
padding-left:15px; |
||||
} |
||||
.class-17 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
border-width:1px; |
||||
border-style:none; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-18 |
||||
{ |
||||
color:#333333; |
||||
word-wrap:break-word; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
font-size:14px; |
||||
line-height:1.4; |
||||
} |
||||
.class-19 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#606266; |
||||
padding-right:15px; |
||||
box-sizing:boredr-box; |
||||
outline:none; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:40px; |
||||
margin-left:20px; |
||||
animation-duration:1s; |
||||
background:none; |
||||
width:320px; |
||||
font-size:12px; |
||||
line-height:40px; |
||||
padding-left:15px; |
||||
} |
||||
.class-20 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-21 |
||||
{ |
||||
cursor:pointer; |
||||
color:#ffffff; |
||||
box-sizing:border-box; |
||||
height:34px; |
||||
background-color:#0099ff; |
||||
text-align:center; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:98px; |
||||
line-height:34px; |
||||
font-size:14px; |
||||
} |
||||
.class-22 |
||||
{ |
||||
cursor:pointer; |
||||
border-color:#0099FF; |
||||
color:#0099FF; |
||||
box-sizing:border-box; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:34px; |
||||
background-color:#FFFFFF; |
||||
text-align:center; |
||||
display:inline-block; |
||||
margin-left:10px; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:98px; |
||||
line-height:34px; |
||||
font-size:14px; |
||||
} |
||||
.class-23 |
||||
{ |
||||
color:#333333; |
||||
padding:20px; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
height:200px; |
||||
max-width:100%; |
||||
background-color:#FFFFFF; |
||||
flex-direction:column; |
||||
display:flex; |
||||
justify-content:end; |
||||
margin: 12px 12px 12px 6px; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:100%; |
||||
padding-left:20px; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-24 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-25 |
||||
{ |
||||
color:#333333; |
||||
word-wrap:break-word; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
font-size:14px; |
||||
line-height:1.4; |
||||
} |
||||
.class-26 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#606266; |
||||
padding-right:15px; |
||||
box-sizing:boredr-box; |
||||
outline:none; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:40px; |
||||
margin-left:20px; |
||||
animation-duration:1s; |
||||
background:none; |
||||
width:320px; |
||||
font-size:12px; |
||||
line-height:40px; |
||||
padding-left:15px; |
||||
} |
||||
.class-27 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
border-width:1px; |
||||
border-style:none; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-28 |
||||
{ |
||||
color:#333333; |
||||
word-wrap:break-word; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
font-size:14px; |
||||
line-height:1.4; |
||||
} |
||||
.class-29 |
||||
{ |
||||
border-color:#EEEEEE; |
||||
color:#606266; |
||||
padding-right:15px; |
||||
box-sizing:boredr-box; |
||||
outline:none; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:40px; |
||||
margin-left:20px; |
||||
animation-duration:1s; |
||||
background:none; |
||||
width:320px; |
||||
font-size:12px; |
||||
line-height:40px; |
||||
padding-left:15px; |
||||
} |
||||
.class-30 |
||||
{ |
||||
color:#333333; |
||||
outline:none; |
||||
outline-offset:-1px; |
||||
max-width:100%; |
||||
align-items:center; |
||||
flex-direction:row; |
||||
display:flex; |
||||
animation-duration:1s; |
||||
background-repeat:no-repeat; |
||||
} |
||||
.class-31 |
||||
{ |
||||
cursor:pointer; |
||||
color:#ffffff; |
||||
box-sizing:border-box; |
||||
height:34px; |
||||
background-color:#0099ff; |
||||
text-align:center; |
||||
display:inline-block; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:98px; |
||||
line-height:34px; |
||||
font-size:14px; |
||||
} |
||||
.class-32 |
||||
{ |
||||
cursor:pointer; |
||||
border-color:#0099FF; |
||||
color:#0099FF; |
||||
box-sizing:border-box; |
||||
border-width:1px; |
||||
border-style:solid; |
||||
height:34px; |
||||
background-color:#FFFFFF; |
||||
text-align:center; |
||||
display:inline-block; |
||||
margin-left:10px; |
||||
animation-duration:1s; |
||||
border-radius:4px; |
||||
width:98px; |
||||
line-height:34px; |
||||
font-size:14px; |
||||
} |
||||
.el-select, |
||||
.el-input, |
||||
.el-form-item, |
||||
.el-date-editor{ |
||||
width: 100%; |
||||
} |
||||
</style> |
||||
@ -0,0 +1,161 @@ |
||||
<@ms.html5> |
||||
<@ms.nav title="静态化"></@ms.nav> |
||||
<@ms.panel> |
||||
<p class="alert alert-info" role="alert"> |
||||
<span class="glyphicon glyphicon-pushpin text-lef "></span> |
||||
<a class="alert-link text-lef" style="margin-left: 12px;"> |
||||
更新主页,如果系统存在引导页面可以手动修改主页位置文件名,default.html引导页面index.html主页。 |
||||
</a><br/> |
||||
<span class="glyphicon glyphicon-pushpin text-lef "></span> |
||||
<a class="alert-link text-lef" style="margin-left: 12px;"> |
||||
更新栏目列表,推荐使用指定栏目更新。系统提示“更新中...”请不要刷新页面或点击其他菜单。 |
||||
</a><br/> |
||||
<span class="glyphicon glyphicon-pushpin text-lef "></span> |
||||
<a class="alert-link text-lef" style="margin-left: 12px;"> |
||||
根据时间与栏目类型生成文章 |
||||
</a> |
||||
</p> |
||||
<@ms.form name="generateIndex"> |
||||
<@ms.formRow label="选择主页模板" width="300"> |
||||
<select class="form-control" id="select_id"></select> |
||||
<input type="hidden" name="url"/> |
||||
</@ms.formRow> |
||||
<@ms.text id="position" label="选择主页位置 " width="300" value="index" placeholder="输入主页位置" name="position" help="注:主页位置htm文件名一般为index.html或default.html"/> |
||||
<div class="form-group ms-form-group"><div class="col-sm-2"></div><div class="col-sm-9 ms-from-group-input ms-form-input"> |
||||
<@shiro.hasPermission name="cms:generate:index"> |
||||
<@ms.button class="btn btn-primary" id="updateIndex" value="生成主页" /> |
||||
<@ms.panelNavBtnSave title="" id="viewIndex" value="预览主页" /> |
||||
</@shiro.hasPermission> |
||||
</div> |
||||
</div> |
||||
</@ms.form> |
||||
<!--选择更新的栏目--> |
||||
<@ms.form name="generateColumn"> |
||||
<@ms.formRow label="选择要生成栏目" width="300"> |
||||
<#if list?has_content> |
||||
<@ms.treeInput treeId="inputTree" json="${list?default('')}" jsonId="categoryId" jsonPid="categoryCategoryId" jsonName="categoryTitle" buttonText="选择更新的栏目" addNodesName="所有栏目" inputName="columnId" showIcon="true" expandAll="true" /> |
||||
<#else> |
||||
<@ms.treeInput treeId="errorTree" buttonText="暂无数据" /> |
||||
</#if> |
||||
</@ms.formRow> |
||||
<div class="form-group ms-form-group"><div class="col-sm-2"></div><div class="col-sm-9 ms-from-group-input ms-form-input"> |
||||
<@shiro.hasPermission name="cms:generate:column"> |
||||
<@ms.button class="btn btn-primary" id="updateColumn" value="生成栏目" /> |
||||
</@shiro.hasPermission> |
||||
</div></div> |
||||
</@ms.form> |
||||
<@ms.form name="generateArticle"> |
||||
<@ms.formRow label="文章栏目" width="300"> |
||||
<#if list?has_content> |
||||
<@ms.treeInput treeId="inputTreee" json="${list?default('')}" jsonId="categoryId" jsonPid="categoryCategoryId" jsonName="categoryTitle" addNodesName="所有栏目" buttonText="选择更新的栏目" inputName="articleId" showIcon="true" expandAll="true" /> |
||||
<#else> |
||||
<@ms.treeInput treeId="errorTree" buttonText="暂无数据" /> |
||||
</#if> |
||||
</@ms.formRow> |
||||
<@ms.date name="dateTime" label="指定时间" single=true readonly="readonly" width="300" value="${now?string('yyyy-MM-dd')}" validation={"required":"true", "data-bv-notempty-message":"必填项目"} placeholder="点击该框选择时间段" /> |
||||
<div class="form-group ms-form-group"><div class="col-sm-2"></div><div class="col-sm-9 ms-from-group-input ms-form-input"> |
||||
<@shiro.hasPermission name="cms:generate:article"> |
||||
<@ms.button class="btn btn-primary" id="updateArticle" value="生成文章" /> |
||||
</@shiro.hasPermission> |
||||
</div></div> |
||||
</@ms.form> |
||||
</@ms.panel> |
||||
</@ms.html5> |
||||
|
||||
<!--点击进行按钮提交--> |
||||
<script> |
||||
$(function(){ |
||||
var URL="${managerPath}/template/queryTemplateFileForColumn.do"; |
||||
var DATA = ""; |
||||
$(this).request({url:URL,data:DATA,type:"json",method:"get",func:function(msg) { |
||||
if(msg.length==0){ |
||||
$("#select_id").append("<option value='' >暂无文件</option>") |
||||
} |
||||
for(var i = 0;i<msg.length;i++){ |
||||
$("#select_id").append("<option value="+msg[i]+">"+msg[i]+"</option>"); |
||||
//如果存在index.html |
||||
if(msg[i]=="index.html" || msg[i]=="index.htm"){ |
||||
$("#select_id").find("option[value='"+msg[i]+"']").attr("selected",true); |
||||
} |
||||
} |
||||
}}); |
||||
}) |
||||
|
||||
//点击一键更新主页时,进行主页更新 |
||||
$("#updateIndex").click(function(){ |
||||
//选择的主页模板名称和主页位置 |
||||
var url = $("#select_id").val(); |
||||
var position =$("input[name='position']").val(); |
||||
//封装ajax请求参数 |
||||
var URL="${managerPath}/cms/generate//generateIndex.do"; |
||||
var DATA = "url="+url+"&position="+position; |
||||
$(this).html("更新中..").attr("disabled", "disabled"); |
||||
$(this).request({url:URL,data:DATA,type:"json",method:"post",func:function(msg) { |
||||
$("#updateIndex").html("更新主页").removeAttr("disabled"); |
||||
if(msg.result){ |
||||
<@ms.notify msg="更新成功" type="success"/> |
||||
}else{ |
||||
$('.ms-notifications').offset({top:43}).notify({ |
||||
type:'warning', |
||||
message: { text:msg.resultMsg } |
||||
}).show(); |
||||
} |
||||
$("#updateIndex").html("更新主页") |
||||
}}); |
||||
}); |
||||
//点击预览时,进行预览 |
||||
$("#viewIndex").click(function(){ |
||||
var position =$("input[name='position']").val(); |
||||
window.open("${managerPath}/cms/generate/"+position+"/viewIndex.do"); |
||||
}); |
||||
</script> |
||||
|
||||
<!--点击生成栏目按钮--> |
||||
<script> |
||||
$("#updateColumn").click(function() { |
||||
var columnId = 0; |
||||
if($("input[name='columnId']").val() !="" && $("input[name='columnId']").val().length>0){ |
||||
columnId = $("input[name='columnId']").val(); |
||||
} |
||||
var URL="${managerPath}/cms/generate/"+columnId+"/genernateColumn.do"; |
||||
$(this).html("更新中..").attr("disabled", "disabled"); |
||||
$(this).request({url:URL,data:columnId,type:"json",method:"post",func:function(msg) { |
||||
$("#updateColumn").html("更新栏目").removeAttr("disabled"); |
||||
//回调处理方式 |
||||
if(msg.result){ |
||||
<@ms.notify msg="更新成功" type="success"/> |
||||
}else{ |
||||
$('.ms-notifications').offset({top:43}).notify({ |
||||
type:'warning', |
||||
message: { text:msg.resultMsg } |
||||
}).show(); |
||||
} |
||||
}}); |
||||
}); |
||||
</script> |
||||
|
||||
<!--点击生成文章按钮--> |
||||
<script> |
||||
$("#updateArticle").click(function() { |
||||
var articleId = 0; |
||||
if($("input[name='articleId']").val() !="" ){ |
||||
articleId = $("input[name='articleId']").val(); |
||||
} |
||||
var URL="${managerPath}/cms/generate/" + articleId + "/generateArticle.do"; |
||||
var DATA = "dateTime=" + $("input[name='dateTime']").val(); |
||||
$(this).html("更新中..").attr("disabled", "disabled"); |
||||
|
||||
$(this).request({url:URL,data:DATA,type:"json",method:"post",func:function(msg) { |
||||
$("#updateArticle").html("更新文档").removeAttr("disabled"); |
||||
//回调处理方式 |
||||
if(msg.result){ |
||||
<@ms.notify msg="更新成功" type="success"/> |
||||
}else{ |
||||
$('.ms-notifications').offset({top:43}).notify({ |
||||
type:'warning', |
||||
message: { text:msg.resultMsg } |
||||
}).show(); |
||||
} |
||||
}}); |
||||
}); |
||||
</script> |
||||
Loading…
Reference in new issue