|
@@ -0,0 +1,336 @@
|
|
|
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
|
|
|
+<%@ taglib prefix="input" uri="/struts-tags" %>
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
|
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>编辑文章</title>
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
+ <style>
|
|
|
+ .red{color:red}
|
|
|
+ #inputForm{max-width:1200px;width:100%}
|
|
|
+ #inputForm table{width:100%;line-height:18px;margin-bottom:50px}
|
|
|
+ #inputForm th,#inputForm td{font-weight:normal;text-align:left;padding:8px 5px;border-bottom:1px solid rgb(238,238,238)}
|
|
|
+ #inputForm th{width:15%;text-align:right;white-space:nowrap;font-weight:bold}
|
|
|
+ #inputForm td input[type="text"]{width:320px;height:16px;line-height:16px}
|
|
|
+ .init-label label{margin:5px 10px;color:gray}
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<ul class="nav nav-tabs">
|
|
|
+ <li><a href="${ctx}/info/info/?publishSource=2">文章列表</a></li>
|
|
|
+ <li class="active"><a href="${ctx}/info/info/toAuditPage?id=${info.id}">审核</a></li>
|
|
|
+</ul>
|
|
|
+<form:form id="inputForm" modelAttribute="info" action="${ctx}/info/info/save?ltype=2&publishSource=2&auditFlag=1" method="post" class="form-horizontal">
|
|
|
+ <form:hidden path="id"/>
|
|
|
+ <sys:message content="${message}"/>
|
|
|
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>文章标题:</th>
|
|
|
+ <td colspan="3"><form:input path="title" htmlEscape="false" maxlength="100" class="input-xxlarge required"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>文章标签:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <form:input path="label" htmlEscape="false" maxlength="100" class="input-xxlarge required"/>
|
|
|
+ <span class="help-inline">多个标签之间请用逗号分隔开</span>
|
|
|
+ <div class="init-label"></div>
|
|
|
+ <input id="labelName" type="text" placeholder="在此处输入标签,将自动关联到文章标签" class="input-xlarge"/>
|
|
|
+ <a href="javascript:addLeable();">添加</a>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>SEO关键词:</th>
|
|
|
+ <td colspan="3"><form:input path="keyword" htmlEscape="false" maxlength="50" class="input-xxlarge required"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>发布人:</th>
|
|
|
+ <td colspan="3"><form:input path="publisher" htmlEscape="false" maxlength="50" class="input-xxlarge required"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>来源:</th>
|
|
|
+ <td colspan="3"><form:input path="source" htmlEscape="false" maxlength="50" class="input-xlarge"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>推荐语(描述):</th>
|
|
|
+ <td colspan="3"><form:textarea path="recommendContent" htmlEscape="false" maxlength="1000" class="input-xxlarge required"/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>文章内容:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <div class="detailInfoEditor" style="width:760px;">
|
|
|
+ <form:textarea path="infoContent" class="input-xlarge hide"/>
|
|
|
+ <!-- 富文本编辑器 -->
|
|
|
+ <div id="infoDetailEditor">${info.infoContent}</div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>文章分类:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <form:select path="infoType.id" class="input-small required">
|
|
|
+ <form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
|
|
|
+ </form:select>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>引导图:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <form:hidden id="nameImage" path="guidanceImage" htmlEscape="false" class="input-xlarge required"/>
|
|
|
+ <sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>商城首页图:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <form:hidden id="homePageImage" path="homePageImage" htmlEscape="false" maxlength="255" class="input-xlarge"/>
|
|
|
+ <sys:ckfinder input="homePageImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
|
|
|
+ <label style="margin-left: 20px">建议图片分辨率252px*252px</label>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>发布时间:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>审核状态:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ ${info.auditStatus eq 1?'待审核':info.auditStatus eq 2?'审核通过':'审核失败'}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>供应商:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ ${info.shopName}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>供应商:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ ${info.shopName}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>添加时间:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <c:if test="${not empty info.id}">
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>实际点赞:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ ${empty info.realPraise?0:(info.realPraise)}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${not empty info.id}">
|
|
|
+ <tr>
|
|
|
+ <th><span class="red">*</span>实际浏览量:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ ${empty info.pv?0:(info.pv)}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </c:if>
|
|
|
+ <tr>
|
|
|
+ <th><span class="red"></span>审核:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <input type="radio" name="auditStatus" value="2" onclick="updateAuditStatus(2)" ${empty info.auditStatus?'checked=checked':info.auditStatus eq 1?'checked=checked':''}> 审核通过
|
|
|
+ <input type="radio" name="auditStatus" value="3" onclick="updateAuditStatus(3)" ${info.auditStatus eq 3?'checked=checked':''}> 审核失败
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr id="failReasonDiv" style="${empty info.auditStatus or info.auditStatus ne 3?'display: none':''}">
|
|
|
+ <th><span class="red">*</span>失败原因:</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <textarea type="text" id="failReason" name="failReason" required style="width: 400px;height: 90px">${info.failReason}</textarea>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="4" style="text-align:center;">
|
|
|
+ <shiro:hasPermission name="info:info:edit">
|
|
|
+ <input id="btnSave" class="btn btn-primary" type="submit" value="保 存" onclick="checkInfo()"/>
|
|
|
+ </shiro:hasPermission>
|
|
|
+ <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+</form:form>
|
|
|
+<!-- 富文本编辑器 -->
|
|
|
+
|
|
|
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
|
|
|
+<%--<script src="https://cdn.bootcdn.net/ajax/libs/jquery-validate/1.19.3/jquery.validate.min.js"></script>--%>
|
|
|
+<script type="text/javascript" src="${ctxStatic}/jquery-validation/1.19.3/jquery.validate.js"></script>
|
|
|
+<script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
|
|
|
+<script type="text/javascript">
|
|
|
+ $(document).ready(function() {
|
|
|
+ //$("#name").focus();
|
|
|
+ $("#inputForm").validate({
|
|
|
+ ignore:"",
|
|
|
+ submitHandler: function(form){
|
|
|
+ if ($("#title").val() == '') {
|
|
|
+ alertx("请输入文章标题");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#label").val() == '') {
|
|
|
+ alertx("请输入文章标签");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#keyword").val() == '') {
|
|
|
+ alertx("请输入SEO关键词");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#publisher").val() == '') {
|
|
|
+ alertx("请输入发布人");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#pubdate").val() == '') {
|
|
|
+ alertx("请输入发布时间");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#recommendContent").val() == '') {
|
|
|
+ alertx("请输入推荐语(描述)");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#infoContent").val() == '') {
|
|
|
+ alertx("请输入文章内容");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#guidanceImage").val() == '') {
|
|
|
+ alertx("请上传引导图");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#basePraise").val() == '') {
|
|
|
+ alertx("请输入基础点赞");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($("#basePv").val() == '') {
|
|
|
+ alertx("请输入基础浏览量");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //初始化标签
|
|
|
+ $(function () {
|
|
|
+ $(".init-label label").bind("click",function(){
|
|
|
+ var label=$(this).text();
|
|
|
+ var label1=label+",";
|
|
|
+ var _label=$("#label").val()+",";
|
|
|
+ if(_label.indexOf(label1)>-1){
|
|
|
+ alert("文章标签中已包含该标签!!");
|
|
|
+ }else{
|
|
|
+ setLabel(label);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ function updateAuditStatus(auditStatus) {
|
|
|
+ var elementById = document.getElementById("failReasonDiv");
|
|
|
+ if (auditStatus === 2) {
|
|
|
+ elementById.style.cssText = "display:none";
|
|
|
+ } else {
|
|
|
+ elementById.style.cssText = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $(window).load(function () {
|
|
|
+ LabelInit();
|
|
|
+ });
|
|
|
+
|
|
|
+ //富文本框编辑
|
|
|
+ function checkInfo() {
|
|
|
+ var infoContent = infoDetailEditor.getData();
|
|
|
+ $("#infoContent").val(infoContent);
|
|
|
+ console.log(infoContent);
|
|
|
+ }
|
|
|
+
|
|
|
+ $(document).ready(function () {
|
|
|
+ //富文本框
|
|
|
+ ClassicEditor.create(document.querySelector('#infoDetailEditor'), {
|
|
|
+ ckfinder: {
|
|
|
+ uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
|
|
|
+ }
|
|
|
+ }).then(function(editor) {
|
|
|
+ window.infoDetailEditor = editor;
|
|
|
+ }).catch(function(error){
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ function LabelInit(){
|
|
|
+ var items="${fns:getDictValue('label','sys_config','')}"+",";
|
|
|
+ /* var _labels="${info.label}";
|
|
|
+ var _label=_labels.split(",");
|
|
|
+ for (var i = 0; i < _label.length; i++) {
|
|
|
+ items=items.replace(_label[i]+",","");
|
|
|
+ } */
|
|
|
+ /* var items="美白,祛斑,祛痘,补水,瘦脸,去皱,缩毛孔,减肥瘦身,提拉紧致,嫩肤,去眼袋,去法令纹,脱毛,纹眉,去黑眼圈,美白嫩肤,面部提升,祛斑祛痣,除皱,去红血丝,祛疤,祛妊娠纹,纹身,纤体塑性,纹眉"; */
|
|
|
+ var info=items.split(",");
|
|
|
+ var html='';
|
|
|
+ for (var i = 0; i < info.length; i++) {
|
|
|
+ if(''!=info[i]){
|
|
|
+ html+="<label>"+info[i]+"</label>";
|
|
|
+ if((i+1)%9==0){
|
|
|
+ html+="<br>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(".init-label").append(html);
|
|
|
+
|
|
|
+
|
|
|
+ $("#labelName").typeahead({
|
|
|
+ property : 'name',
|
|
|
+ source:function(typeahead, query){
|
|
|
+ query = $.trim(query);
|
|
|
+ if(''==query){return;}
|
|
|
+ $.ajax({
|
|
|
+ type:"POST", dataType:"JSON", async:false,
|
|
|
+ url: "${ctx}/info/infoLabel/findByName",
|
|
|
+ data:{name: query},
|
|
|
+ success:function(data){
|
|
|
+ typeahead.process(data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onselect : function(data) {
|
|
|
+ setLabel(data.name);
|
|
|
+ $("#labelName").focus(); //选择完后 回到当前输入框以便下一个动作的验证
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function setLabel(name){
|
|
|
+ if(name!=''){
|
|
|
+ var label=$("#label").val();
|
|
|
+ if(label==''){
|
|
|
+ label=name;
|
|
|
+ }else{
|
|
|
+ label=label+","+name;
|
|
|
+ }
|
|
|
+ $("#label").val(label);
|
|
|
+ $("#labelName").val("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function addLeable(){
|
|
|
+ var label=$("#labelName").val();
|
|
|
+ if(''==label){
|
|
|
+ $.jBox.tip('添加的标签不能为空!','error');
|
|
|
+ }else{
|
|
|
+ setLabel(label);
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|