Merge remote-tracking branch 'origin/master'

This commit is contained in:
dong_bo0602 2021-09-01 17:05:03 +08:00
commit 88be11099f
18 changed files with 451 additions and 159 deletions

View File

@ -1,5 +1,7 @@
package com.tenlion.twoduty.controller.api.articlecontent; package com.tenlion.twoduty.controller.api.articlecontent;
import com.tenlion.twoduty.pojo.dtos.articletype.ArticleTypeDTO;
import com.tenlion.twoduty.service.articletype.IArticleTypeService;
import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.exceptions.ParamsException; import ink.wgink.exceptions.ParamsException;
@ -13,10 +15,12 @@ import com.tenlion.twoduty.pojo.dtos.articlecontent.ArticleContentDTO;
import com.tenlion.twoduty.pojo.vos.articlecontent.ArticleContentVO; import com.tenlion.twoduty.pojo.vos.articlecontent.ArticleContentVO;
import com.tenlion.twoduty.service.articlecontent.IArticleContentService; import com.tenlion.twoduty.service.articlecontent.IArticleContentService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -34,6 +38,11 @@ public class ArticleContentController extends DefaultBaseController {
@Autowired @Autowired
private IArticleContentService articleContentService; private IArticleContentService articleContentService;
@Autowired
private IArticleTypeService articleTypeService;
@ApiOperation(value = "两个责任文章内容管理分页列表(发布)", notes = "两个责任文章内容管理分页列表接口(发布)") @ApiOperation(value = "两个责任文章内容管理分页列表(发布)", notes = "两个责任文章内容管理分页列表接口(发布)")
@ -77,6 +86,40 @@ public class ArticleContentController extends DefaultBaseController {
@GetMapping("getArticleType/{articleTypeId}")
public Map<String,Object> getArticleType(@PathVariable("articleTypeId") String articleTypeId){
Map<String,Object> map = new HashMap<>();
ArticleTypeDTO articleTypeDTO = articleTypeService.get(articleTypeId);
if(articleTypeDTO != null){
map.put("ArticleTypeName",articleTypeDTO.getArticleTypeName());
if(StringUtils.isBlank(articleTypeDTO.getArticleTypeClassifyId())){
map.put("classIfIsShow","hide");
}else{
map.put("classIfIsShow","show");
map.put("classIfId",articleTypeDTO.getArticleTypeClassifyId());
}
}
return map;
}
@ApiOperation(value = "修改发布状态", notes = "修改发布状态接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "articleContentId", value = "两个责任文章内容管理ID", paramType = "path"),
@ApiImplicitParam(name = "isPublish", value = "发布状态", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updateIsPublish/{articleContentId}/{isPublish}")
@CheckRequestBodyAnnotation
public SuccessResult updateIsPublish(@PathVariable("articleContentId") String articleContentId, @PathVariable("isPublish") String isPublish) {
articleContentService.updateIsPublish(articleContentId, isPublish);
return new SuccessResult();
}
@ApiOperation(value = "新增两个责任文章内容管理", notes = "新增两个责任文章内容管理接口") @ApiOperation(value = "新增两个责任文章内容管理", notes = "新增两个责任文章内容管理接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})

View File

@ -115,6 +115,10 @@ public class DepartmentBaseController extends DefaultBaseController {
break; break;
} }
} }
return list; return list;
} }

View File

@ -35,12 +35,24 @@ public class ArticleContentRouteController extends DefaultBaseController {
@GetMapping("list/{articleTypeId}") @GetMapping("list-type/{articleTypeId}")
public ModelAndView list(@PathVariable("articleTypeId") String articleTypeId) { public ModelAndView listType(@PathVariable("articleTypeId") String articleTypeId) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
mv.addObject("articleTypeId",articleTypeId); mv.addObject("articleTypeId",articleTypeId);
mv.setViewName("articlecontent/type/list-type"); mv.setViewName("articlecontent/type/list-type");
return mv; return mv;
} }
@GetMapping("save-type")
public ModelAndView saveType() {
return new ModelAndView("articlecontent/type/save-type");
}
@GetMapping("update-type")
public ModelAndView updateType() {
return new ModelAndView("articlecontent/type/update-type");
}
} }

View File

@ -22,6 +22,8 @@ public class DepartmentSynopsisDTO {
private String departmentSynopsisId; private String departmentSynopsisId;
@ApiModelProperty(name = "departmentSynopsisContent", value = "部门简介内容") @ApiModelProperty(name = "departmentSynopsisContent", value = "部门简介内容")
private String departmentSynopsisContent; private String departmentSynopsisContent;
@ApiModelProperty(name = "departmentSynopsisPhoto", value = "部门宣传照片")
private String departmentSynopsisPhoto;
public String getDepartmentId() { public String getDepartmentId() {
return departmentId; return departmentId;
@ -47,5 +49,11 @@ public class DepartmentSynopsisDTO {
this.departmentSynopsisContent = departmentSynopsisContent; this.departmentSynopsisContent = departmentSynopsisContent;
} }
public String getDepartmentSynopsisPhoto() {
return departmentSynopsisPhoto;
}
public void setDepartmentSynopsisPhoto(String departmentSynopsisPhoto) {
this.departmentSynopsisPhoto = departmentSynopsisPhoto;
}
} }

View File

@ -35,7 +35,7 @@ public class ArticleContentVO {
@ApiModelProperty(name = "articleContentIsPublish", value = "是否发布") @ApiModelProperty(name = "articleContentIsPublish", value = "是否发布")
private String articleContentIsPublish; private String articleContentIsPublish;
@ApiModelProperty(name = "articleContentPublishTime", value = "发布时间") @ApiModelProperty(name = "articleContentPublishTime", value = "发布时间")
@CheckEmptyAnnotation(name = "发布时间", verifyType = "datetime") @CheckEmptyAnnotation(name = "发布时间", verifyType = "date")
private String articleContentPublishTime; private String articleContentPublishTime;
@ApiModelProperty(name = "articleContentOrderBy", value = "文章排序") @ApiModelProperty(name = "articleContentOrderBy", value = "文章排序")
@CheckNumberAnnotation(name = "文章排序") @CheckNumberAnnotation(name = "文章排序")

View File

@ -23,7 +23,8 @@ public class DepartmentSynopsisVO {
private String departmentSynopsisId; private String departmentSynopsisId;
@ApiModelProperty(name = "departmentSynopsisContent", value = "部门简介内容") @ApiModelProperty(name = "departmentSynopsisContent", value = "部门简介内容")
private String departmentSynopsisContent; private String departmentSynopsisContent;
@ApiModelProperty(name = "departmentSynopsisPhoto", value = "部门宣传照片")
private String departmentSynopsisPhoto;
public String getDepartmentSynopsisId() { public String getDepartmentSynopsisId() {
return departmentSynopsisId; return departmentSynopsisId;
@ -49,5 +50,11 @@ public class DepartmentSynopsisVO {
this.departmentSynopsisContent = departmentSynopsisContent; this.departmentSynopsisContent = departmentSynopsisContent;
} }
public String getDepartmentSynopsisPhoto() {
return departmentSynopsisPhoto;
}
public void setDepartmentSynopsisPhoto(String departmentSynopsisPhoto) {
this.departmentSynopsisPhoto = departmentSynopsisPhoto;
}
} }

View File

@ -19,6 +19,13 @@ import java.util.Map;
**/ **/
public interface IArticleContentService { public interface IArticleContentService {
/**
* 修改发布状态
* @param articleContentId
* @param articleContentIsPublish
*/
void updateIsPublish(String articleContentId,String articleContentIsPublish);
/** /**
* 新增两个责任文章内容管理 * 新增两个责任文章内容管理
* *

View File

@ -48,6 +48,15 @@ public class ArticleContentServiceImpl extends DefaultBaseService implements IAr
return saveReturnId(null, articleContentVO); return saveReturnId(null, articleContentVO);
} }
public void updateIsPublish(String articleContentId,String articleContentIsPublish){
Map<String,Object> params = new HashMap<String,Object>();
params.put("articleContentId",articleContentId);
params.put("articleContentIsPublish",articleContentIsPublish);
setUpdateInfo(params);
articleContentDao.update(params);
}
@Override @Override
public String saveReturnId(String token, ArticleContentVO articleContentVO) { public String saveReturnId(String token, ArticleContentVO articleContentVO) {
String articleContentId = UUIDUtil.getUUID(); String articleContentId = UUIDUtil.getUUID();

View File

@ -1,6 +1,8 @@
package com.tenlion.twoduty.service.articletype.impl; package com.tenlion.twoduty.service.articletype.impl;
import com.tenlion.twoduty.service.articlecontent.IArticleContentService;
import ink.wgink.common.base.DefaultBaseService; import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.ParamsException;
import ink.wgink.module.dictionary.pojo.dtos.DataDTO; import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
import ink.wgink.module.dictionary.service.IDataService; import ink.wgink.module.dictionary.service.IDataService;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @ClassName: ArticleTypeServiceImpl * @ClassName: ArticleTypeServiceImpl
@ -36,6 +39,8 @@ public class ArticleTypeServiceImpl extends DefaultBaseService implements IArtic
private IArticleTypeDao articleTypeDao; private IArticleTypeDao articleTypeDao;
@Autowired @Autowired
private IDataService dataService; private IDataService dataService;
@Autowired
private IArticleContentService articleContentService;
public List<DataDTO> getTypeClassIfDetails(String articleTypeId){ public List<DataDTO> getTypeClassIfDetails(String articleTypeId){
@ -84,6 +89,15 @@ public class ArticleTypeServiceImpl extends DefaultBaseService implements IArtic
@Override @Override
public void remove(String token, List<String> ids) { public void remove(String token, List<String> ids) {
List<String> myList = ids.stream().distinct().collect(Collectors.toList());
Map<String,Object> countParams = getHashMap(1);
for (String s : myList) {
countParams.put("articleTypeId",s);
Integer count = articleContentService.count(countParams);
if(count > 0){
throw new ParamsException("文章目录有发布内容,请先删除内容");
}
}
Map<String, Object> params = getHashMap(2); Map<String, Object> params = getHashMap(2);
params.put("articleTypeIds", ids); params.put("articleTypeIds", ids);
if (StringUtils.isBlank(token)) { if (StringUtils.isBlank(token)) {

View File

@ -323,7 +323,7 @@
AND AND
t1.article_content_is_publish = #{articleContentIsPublish} t1.article_content_is_publish = #{articleContentIsPublish}
</if> </if>
ORDER BY t1.article_content_order_by DESC ORDER BY t1.article_content_order_by
</select> </select>
<!-- 两个责任文章内容管理列表 --> <!-- 两个责任文章内容管理列表 -->
@ -428,6 +428,10 @@
duty_article_content t1 duty_article_content t1
WHERE WHERE
t1.is_delete = 0 t1.is_delete = 0
<if test="articleTypeId != null and articleTypeId != ''">
AND
t1.article_type_id = #{articleTypeId}
</if>
</select> </select>
</mapper> </mapper>

View File

@ -6,6 +6,7 @@
<result column="department_id" property="departmentId"/> <result column="department_id" property="departmentId"/>
<result column="department_synopsis_id" property="departmentSynopsisId"/> <result column="department_synopsis_id" property="departmentSynopsisId"/>
<result column="department_synopsis_content" property="departmentSynopsisContent"/> <result column="department_synopsis_content" property="departmentSynopsisContent"/>
<result column="department_synopsis_photo" property="departmentSynopsisPhoto"/>
</resultMap> </resultMap>
<resultMap id="departmentSynopsisBO" type="com.tenlion.twoduty.pojo.bos.departmentsynopsis.DepartmentSynopsisBO"> <resultMap id="departmentSynopsisBO" type="com.tenlion.twoduty.pojo.bos.departmentsynopsis.DepartmentSynopsisBO">
@ -36,6 +37,7 @@
department_id, department_id,
department_synopsis_id, department_synopsis_id,
department_synopsis_content, department_synopsis_content,
department_synopsis_photo,
creator, creator,
gmt_create, gmt_create,
modifier, modifier,
@ -45,6 +47,7 @@
#{departmentId}, #{departmentId},
#{departmentSynopsisId}, #{departmentSynopsisId},
#{departmentSynopsisContent}, #{departmentSynopsisContent},
#{departmentSynopsisPhoto},
#{creator}, #{creator},
#{gmtCreate}, #{gmtCreate},
#{modifier}, #{modifier},
@ -86,6 +89,9 @@
SET SET
<if test="departmentSynopsisContent != null and departmentSynopsisContent != ''"> <if test="departmentSynopsisContent != null and departmentSynopsisContent != ''">
department_synopsis_content = #{departmentSynopsisContent}, department_synopsis_content = #{departmentSynopsisContent},
</if>
<if test="departmentSynopsisPhoto != null and departmentSynopsisPhoto != ''">
department_synopsis_photo = #{departmentSynopsisPhoto},
</if> </if>
gmt_modified = #{gmtModified}, gmt_modified = #{gmtModified},
modifier = #{modifier}, modifier = #{modifier},
@ -99,6 +105,7 @@
SELECT SELECT
t1.department_id, t1.department_id,
t1.department_synopsis_content, t1.department_synopsis_content,
t1.department_synopsis_photo,
t1.department_synopsis_id t1.department_synopsis_id
FROM FROM
duty_department_synopsis t1 duty_department_synopsis t1
@ -161,7 +168,8 @@
SELECT SELECT
t1.department_id, t1.department_id,
t1.department_synopsis_id, t1.department_synopsis_id,
t1.department_synopsis_content t1.department_synopsis_content,
t1.department_synopsis_photo
FROM FROM
duty_department_synopsis t1 duty_department_synopsis t1
WHERE WHERE

View File

@ -23,6 +23,40 @@
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<input type="hidden" name="departmentId" value=""> <input type="hidden" name="departmentId" value="">
<input type="hidden" name="departmentSynopsisId" value=""> <input type="hidden" name="departmentSynopsisId" value="">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">宣传图片</label>
<div class="layui-input-block">
<input type="hidden" id="departmentSynopsisPhoto" name="departmentSynopsisPhoto">
<div class="layui-btn-container" id="departmentSynopsisPhotoFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="departmentSynopsisPhotoFileDownload" type="text/html">
{{# var fileName = 'departmentSynopsisPhoto'; }}
{{# if(d[fileName].length > 0) { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/download/false/{{item.fileId}}" align="加载失败">
</span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="departmentSynopsisPhotoRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 1) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="宣传图片" data-name="departmentSynopsisPhoto" lay-filter="departmentSynopsisPhotoUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">单位简介内容</label> <label class="layui-form-label">单位简介内容</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -118,6 +152,59 @@
} }
} }
// 初始化宣传图片上传
function initdepartmentSynopsisPhotoUploadFile() {
var files = $('#departmentSynopsisPhoto').val();
initFileList('departmentSynopsisPhoto', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(departmentSynopsisPhotoUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'image',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
}
}
});
});
form.on('button(departmentSynopsisPhotoRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
});
}
// 初始化承诺书富文本 // 初始化承诺书富文本
function initDepartmentSynopsisContentText() { function initDepartmentSynopsisContentText() {
var editor = UE.getEditor('departmentSynopsisContent', {autoHeightEnabled: false}); var editor = UE.getEditor('departmentSynopsisContent', {autoHeightEnabled: false});
@ -136,9 +223,10 @@
for(var i in data) { for(var i in data) {
dataFormData[i] = data[i] +''; dataFormData[i] = data[i] +'';
} }
initDepartmentSynopsisContentText();
form.val('dataForm', dataFormData); form.val('dataForm', dataFormData);
form.render(null, 'dataForm'); form.render(null, 'dataForm');
initDepartmentSynopsisContentText();
initdepartmentSynopsisPhotoUploadFile();
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}, function() { }, function() {

View File

@ -9,6 +9,13 @@
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/> <link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all"> <link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
.search-item .layui-form-select .layui-input {
width: 141px;
}
</style>
</head> </head>
<body> <body>
<div class="layui-fluid layui-anim layui-anim-fadein"> <div class="layui-fluid layui-anim layui-anim-fadein">
@ -26,6 +33,16 @@
<div class="layui-inline"> <div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly> <input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div> </div>
<div class="layui-inline layui-form search-item" id="articleTypeIdTemplateBox" lay-filter="articleTypeIdTemplateBox"></div>
<script id="articleTypeIdTemplate" type="text/html">
<select name="articleTypeId" id="articleTypeId">
<option value="">请选择文章目录</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.articleTypeId}}" data-classify-id="{{item.articleTypeClassifyId}}">{{item.articleTypeName}}</option>
{{# } }}
</select>
</script>
<button type="button" id="search" class="layui-btn layui-btn-sm"> <button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索 <i class="fa fa-lg fa-search"></i> 搜索
</button> </button>
@ -57,13 +74,15 @@
base: 'assets/layuiadmin/' base: 'assets/layuiadmin/'
}).extend({ }).extend({
index: 'lib/index' index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() { }).use(['index', 'table', 'laydate', 'common','form','laytpl'], function() {
var $ = layui.$; var $ = layui.$;
var $win = $(window); var $win = $(window);
var table = layui.table; var table = layui.table;
var admin = layui.admin; var admin = layui.admin;
var laytpl = layui.laytpl;
var laydate = layui.laydate; var laydate = layui.laydate;
var common = layui.common; var common = layui.common;
var form = layui.form;
var resizeTimeout = null; var resizeTimeout = null;
var tableUrl = 'api/articlecontent/listpage'; var tableUrl = 'api/articlecontent/listpage';
@ -152,10 +171,14 @@
{field: 'articleContentIsPublish', width: 180, title: '发布操作', align:'center',fixed: 'right', {field: 'articleContentIsPublish', width: 180, title: '发布操作', align:'center',fixed: 'right',
templet: function(row) { templet: function(row) {
var rowData = row[this.field]; var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { var contentId = row['articleContentId'];
return '-'; var swichHtml = "";
if(rowData == 0){
swichHtml = '<input type="checkbox" lay-filter="isPublish" value="'+contentId+'" lay-skin="switch" lay-text="发布|不发布" checked>'
}else{
swichHtml = '<input type="checkbox" lay-filter="isPublish" value="'+contentId+'" lay-skin="switch" lay-text="发布|不发布" >'
} }
return rowData; return swichHtml;
} }
}, },
] ]
@ -178,7 +201,8 @@
where: { where: {
keywords: $('#keywords').val(), keywords: $('#keywords').val(),
startTime: $('#startTime').val(), startTime: $('#startTime').val(),
endTime: $('#endTime').val() endTime: $('#endTime').val(),
articleTypeId: $('#articleTypeId').val()
}, },
page: { page: {
curr: currentPage curr: currentPage
@ -285,6 +309,41 @@
} }
} }
}); });
initArticleTypeIdTemplate();
//初始化文章目录
function initArticleTypeIdTemplate(){
top.restAjax.get(top.restAjax.path("api/articletype/list",[]),{},null,function (code,data,args) {
laytpl(document.getElementById('articleTypeIdTemplate').innerHTML).render(data, function(html) {
document.getElementById('articleTypeIdTemplateBox').innerHTML = html;
});
form.render('select', 'articleTypeIdTemplateBox');
});
}
form.on('switch(isPublish)', function(data){
var checked = data.elem.checked
var contentId = data.value;
var isPublish;
if(checked){
isPublish = 0;
}else{
isPublish = 1;
}
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/articlecontent/updateIsPublish/{articleContentId}/{isPublish}', [contentId,isPublish]), null, null, function(code, data) {
top.dialog.msg('修改成功');
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
}); });
</script> </script>
</body> </body>

View File

@ -119,7 +119,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">文章封面图片</label> <label class="layui-form-label">文章封面图片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos"> <input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos" lay-verify="photos">
<div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div> <div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="articleContentCoverPhotosFileDownload" type="text/html"> <script id="articleContentCoverPhotosFileDownload" type="text/html">
{{# var fileName = 'articleContentCoverPhotos'; }} {{# var fileName = 'articleContentCoverPhotos'; }}
@ -295,7 +295,7 @@
function initArticleContentPublishTimeDateTime() { function initArticleContentPublishTimeDateTime() {
laydate.render({ laydate.render({
elem: '#articleContentPublishTime', elem: '#articleContentPublishTime',
type: 'datetime', type: 'date',
value: '', value: '',
trigger: 'click' trigger: 'click'
}); });
@ -402,7 +402,11 @@
// 校验 // 校验
form.verify({ form.verify({
photos:function (value,item) {
if(value == ''){
return '请上传封面图片';
}
}

View File

@ -9,6 +9,11 @@
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/> <link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all"> <link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all"> <link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
.search-item .layui-form-select .layui-input {
width: 141px;
}
</style>
</head> </head>
<body> <body>
<div class="layui-fluid layui-anim layui-anim-fadein"> <div class="layui-fluid layui-anim layui-anim-fadein">
@ -27,6 +32,15 @@
<div class="layui-inline"> <div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly> <input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div> </div>
<div class="layui-inline search-item layui-form layui-hide" id="articleClassifyIdTemplateBox" lay-filter="articleClassifyIdTemplateBox"></div>
<script id="articleClassifyIdTemplate" type="text/html">
<select name="articleClassifyId" id="articleClassifyId">
<option value="">请选择文章分类</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}" >{{item.dataName}}</option>
{{# } }}
</select>
</script>
<button type="button" id="search" class="layui-btn layui-btn-sm"> <button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索 <i class="fa fa-lg fa-search"></i> 搜索
</button> </button>
@ -58,13 +72,15 @@
base: 'assets/layuiadmin/' base: 'assets/layuiadmin/'
}).extend({ }).extend({
index: 'lib/index' index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() { }).use(['index', 'table', 'laydate', 'common','form','laytpl'], function() {
var $ = layui.$; var $ = layui.$;
var $win = $(window); var $win = $(window);
var table = layui.table; var table = layui.table;
var admin = layui.admin; var admin = layui.admin;
var laydate = layui.laydate; var laydate = layui.laydate;
var laytpl = layui.laytpl;
var common = layui.common; var common = layui.common;
var form = layui.form;
var resizeTimeout = null; var resizeTimeout = null;
var tableUrl = 'api/articlecontent/listpage'; var tableUrl = 'api/articlecontent/listpage';
@ -156,10 +172,14 @@
{field: 'articleContentIsPublish', width: 180, title: '发布操作', align:'center',fixed: 'right', {field: 'articleContentIsPublish', width: 180, title: '发布操作', align:'center',fixed: 'right',
templet: function(row) { templet: function(row) {
var rowData = row[this.field]; var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { var contentId = row['articleContentId'];
return '-'; var swichHtml = "";
if(rowData == 0){
swichHtml = '<input type="checkbox" lay-filter="isPublish" value="'+contentId+'" lay-skin="switch" lay-text="发布|不发布" checked>'
}else{
swichHtml = '<input type="checkbox" lay-filter="isPublish" value="'+contentId+'" lay-skin="switch" lay-text="发布|不发布" >'
} }
return rowData; return swichHtml;
} }
}, },
] ]
@ -182,7 +202,8 @@
where: { where: {
keywords: $('#keywords').val(), keywords: $('#keywords').val(),
startTime: $('#startTime').val(), startTime: $('#startTime').val(),
endTime: $('#endTime').val() endTime: $('#endTime').val(),
articleClassifyId:$("#articleClassifyId").val()
}, },
page: { page: {
curr: currentPage curr: currentPage
@ -250,10 +271,11 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, anim: 2,
content: top.restAjax.path('route/articlecontent/type/save-type', []), content: top.restAjax.path('route/articlecontent/save-type?articleTypeId={articleTypeId}', [$("#articleTypeId").val()]),
end: function() { end: function() {
reloadTable(); reloadTable();
} }
}); });
} else if(layEvent === 'updateEvent') { } else if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) { if(checkDatas.length === 0) {
@ -268,7 +290,7 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, anim: 2,
content: top.restAjax.path('route/articlecontent/type/update-type?articleContentId={articleContentId}', [checkDatas[0].articleContentId]), content: top.restAjax.path('route/articlecontent/update-type?articleContentId={articleContentId}&articleTypeId={articleTypeId}', [checkDatas[0].articleContentId,$("#articleTypeId").val()]),
end: function() { end: function() {
reloadTable(); reloadTable();
} }
@ -289,6 +311,49 @@
} }
} }
}); });
initArticleTypeName();
function initArticleTypeName(){
top.restAjax.get(top.restAjax.path("api/articlecontent/getArticleType/{articleTypeId}",[$("#articleTypeId").val()]),{},null,function (code,data,args) {
if('show'== data.classIfIsShow){
$('#articleClassifyIdTemplateBox').removeClass("layui-hide")
initArticleClassifyIdTemplate(data.classIfId)
}
});
}
//初始化文章分类
function initArticleClassifyIdTemplate(dataParentId){
top.restAjax.get(top.restAjax.path("api/data/listallbyparentid/{dataParentId}",[dataParentId]),{},null,function (code,data,args) {
laytpl(document.getElementById('articleClassifyIdTemplate').innerHTML).render(data, function(html) {
document.getElementById('articleClassifyIdTemplateBox').innerHTML = html;
});
form.render('select', 'articleClassifyIdTemplateBox');
});
}
form.on('switch(isPublish)', function(data){
var checked = data.elem.checked
var contentId = data.value;
var isPublish;
if(checked){
isPublish = 0;
}else{
isPublish = 1;
}
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/articlecontent/updateIsPublish/{articleContentId}/{isPublish}', [contentId,isPublish]), null, null, function(code, data) {
top.dialog.msg('修改成功');
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
}); });
</script> </script>
</body> </body>

View File

@ -22,27 +22,13 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row layui-col-space10"> <blockquote class="layui-elem-quote" id="articleTypeName"></blockquote>
<div class="layui-col-md6"> <div class="layui-row layui-hide" id="classIfIdDiv">
<div class="layui-form-item">
<label class="layui-form-label">所属目录</label>
<div class="layui-input-block layui-form" id="articleTypeIdTemplateBox" lay-filter="articleTypeIdTemplateBox"></div>
<script id="articleTypeIdTemplate" type="text/html">
<select name="articleTypeId" lay-filter="articleTypeId" lay-verify="required">
<option value="">请选择</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.articleTypeId}}" data-classify-id="{{item.articleTypeClassifyId}}">{{item.articleTypeName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">文章分类</label> <label class="layui-form-label">文章分类</label>
<div class="layui-input-block layui-form" id="articleClassifyIdTemplateBox" lay-filter="articleClassifyIdTemplateBox"></div> <div class="layui-input-block layui-form" id="articleClassifyIdTemplateBox" lay-filter="articleClassifyIdTemplateBox"></div>
<script id="articleClassifyIdTemplate" type="text/html"> <script id="articleClassifyIdTemplate" type="text/html">
<select name="articleClassifyId"> <select name="articleClassifyId" lay-verify="classIfV">
<option value="">请选择</option> <option value="">请选择</option>
{{# for(var i = 0, item; item = d[i++];) { }} {{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}" >{{item.dataName}}</option> <option value="{{item.dataId}}" >{{item.dataName}}</option>
@ -51,7 +37,6 @@
</script> </script>
</div> </div>
</div> </div>
</div>
<div class="layui-row layui-col-space10"> <div class="layui-row layui-col-space10">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
@ -119,7 +104,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">文章封面图片</label> <label class="layui-form-label">文章封面图片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos"> <input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos" lay-verify="photos">
<div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div> <div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="articleContentCoverPhotosFileDownload" type="text/html"> <script id="articleContentCoverPhotosFileDownload" type="text/html">
{{# var fileName = 'articleContentCoverPhotos'; }} {{# var fileName = 'articleContentCoverPhotos'; }}
@ -184,6 +169,23 @@
var wangEditorObj = {}; var wangEditorObj = {};
var ueEditorObj = {}; var ueEditorObj = {};
var viewerObj = {}; var viewerObj = {};
var articleTypeId = top.restAjax.params(window.location.href).articleTypeId;
var classIfIsShow = 'hide';
function initArticleTypeName(){
top.restAjax.get(top.restAjax.path("api/articlecontent/getArticleType/{articleTypeId}",[articleTypeId]),{},null,function (code,data,args) {
$("#articleTypeName").text(data.ArticleTypeName);
classIfIsShow = data.classIfIsShow;
if('show'== data.classIfIsShow){
$('#classIfIdDiv').removeClass("layui-hide")
initArticleClassifyIdTemplate(data.classIfId)
}
});
}
function closeBox() { function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name)); parent.layer.close(parent.layer.getFrameIndex(window.name));
@ -295,22 +297,13 @@
function initArticleContentPublishTimeDateTime() { function initArticleContentPublishTimeDateTime() {
laydate.render({ laydate.render({
elem: '#articleContentPublishTime', elem: '#articleContentPublishTime',
type: 'datetime', type: 'date',
value: '', value: '',
trigger: 'click' trigger: 'click'
}); });
} }
//初始化文章目录
function initArticleTypeIdTemplate(){
top.restAjax.get(top.restAjax.path("api/articletype/list",[]),{},null,function (code,data,args) {
laytpl(document.getElementById('articleTypeIdTemplate').innerHTML).render(data, function(html) {
document.getElementById('articleTypeIdTemplateBox').innerHTML = html;
});
form.render('select', 'articleTypeIdTemplateBox');
});
}
//初始化文章分类 //初始化文章分类
function initArticleClassifyIdTemplate(dataParentId){ function initArticleClassifyIdTemplate(dataParentId){
top.restAjax.get(top.restAjax.path("api/data/listallbyparentid/{dataParentId}",[dataParentId]),{},null,function (code,data,args) { top.restAjax.get(top.restAjax.path("api/data/listallbyparentid/{dataParentId}",[dataParentId]),{},null,function (code,data,args) {
@ -320,14 +313,6 @@
form.render('select', 'articleClassifyIdTemplateBox'); form.render('select', 'articleClassifyIdTemplateBox');
}); });
} }
//文章分类默认初始化
function initClassifyId() {
var data = []
laytpl(document.getElementById('articleClassifyIdTemplate').innerHTML).render(data, function(html) {
document.getElementById('articleClassifyIdTemplateBox').innerHTML = html;
});
form.render('select', 'articleClassifyIdTemplateBox');
}
// 初始化文章正文富文本 // 初始化文章正文富文本
function initArticleContentContentText() { function initArticleContentContentText() {
@ -341,34 +326,17 @@
// 初始化内容 // 初始化内容
function initData() { function initData() {
initArticleTypeIdTemplate(); initArticleTypeName();
initClassifyId();
initArticleContentCoverPhotosUploadFile(); initArticleContentCoverPhotosUploadFile();
initArticleContentPublishTimeDateTime(); initArticleContentPublishTimeDateTime();
initArticleContentContentText(); initArticleContentContentText();
} }
initData(); initData();
form.on('select(articleTypeId)', function(data){
console.log(data)
var classifyId = data.elem[data.elem.selectedIndex].dataset.classifyId
if(classifyId == 'undefined'){
initClassifyId();
}else{
initArticleClassifyIdTemplate(classifyId);
}
});
// 提交表单 // 提交表单
form.on('submit(submitForm)', function(formData) { form.on('submit(submitForm)', function(formData) {
formData.field.articleTypeId = articleTypeId;
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; var loadLayerIndex;
@ -402,8 +370,18 @@
// 校验 // 校验
form.verify({ form.verify({
classIfV:function (value,item) {
if(classIfIsShow == 'show'){
if(value == ''){
return '请选择文章分类';
}
}
},
photos:function (value,item) {
if(value == ''){
return '请上传封面图片';
}
}
}); });

View File

@ -22,27 +22,13 @@
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm"> <form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-row layui-col-space10"> <blockquote class="layui-elem-quote" id="articleTypeName"></blockquote>
<div class="layui-col-md6"> <div class="layui-row layui-hide" id="classIfIdDiv">
<div class="layui-form-item">
<label class="layui-form-label">所属目录</label>
<div class="layui-input-block layui-form" id="articleTypeIdTemplateBox" lay-filter="articleTypeIdTemplateBox"></div>
<script id="articleTypeIdTemplate" type="text/html">
<select name="articleTypeId" lay-filter="articleTypeId" lay-verify="required">
<option value="">请选择</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.articleTypeId}}" data-classify-id="{{item.articleTypeClassifyId}}">{{item.articleTypeName}}</option>
{{# } }}
</select>
</script>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">文章分类</label> <label class="layui-form-label">文章分类</label>
<div class="layui-input-block layui-form" id="articleClassifyIdTemplateBox" lay-filter="articleClassifyIdTemplateBox"></div> <div class="layui-input-block layui-form" id="articleClassifyIdTemplateBox" lay-filter="articleClassifyIdTemplateBox"></div>
<script id="articleClassifyIdTemplate" type="text/html"> <script id="articleClassifyIdTemplate" type="text/html">
<select name="articleClassifyId"> <select name="articleClassifyId" lay-verify="classIfV">
<option value="">请选择</option> <option value="">请选择</option>
{{# for(var i = 0, item; item = d[i++];) { }} {{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}" >{{item.dataName}}</option> <option value="{{item.dataId}}" >{{item.dataName}}</option>
@ -51,7 +37,6 @@
</script> </script>
</div> </div>
</div> </div>
</div>
<div class="layui-row layui-col-space10"> <div class="layui-row layui-col-space10">
<div class="layui-col-md6"> <div class="layui-col-md6">
<div class="layui-form-item"> <div class="layui-form-item">
@ -119,7 +104,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">文章封面图片</label> <label class="layui-form-label">文章封面图片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos"> <input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos" lay-verify="photos">
<div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div> <div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="articleContentCoverPhotosFileDownload" type="text/html"> <script id="articleContentCoverPhotosFileDownload" type="text/html">
{{# var fileName = 'articleContentCoverPhotos'; }} {{# var fileName = 'articleContentCoverPhotos'; }}
@ -181,12 +166,25 @@
var laytpl = layui.laytpl; var laytpl = layui.laytpl;
var laydate = layui.laydate; var laydate = layui.laydate;
var articleContentId = top.restAjax.params(window.location.href).articleContentId; var articleContentId = top.restAjax.params(window.location.href).articleContentId;
var articleTypeId = top.restAjax.params(window.location.href).articleTypeId;
var classIfIsShow = 'hide';
var wangEditor = window.wangEditor; var wangEditor = window.wangEditor;
var wangEditorObj = {}; var wangEditorObj = {};
var ueEditorObj = {}; var ueEditorObj = {};
var viewerObj = {}; var viewerObj = {};
function initArticleTypeName(selectValue){
top.restAjax.get(top.restAjax.path("api/articlecontent/getArticleType/{articleTypeId}",[articleTypeId]),{},null,function (code,data,args) {
$("#articleTypeName").text(data.ArticleTypeName);
classIfIsShow = data.classIfIsShow;
if('show'== data.classIfIsShow){
$('#classIfIdDiv').removeClass("layui-hide")
initArticleClassifyIdTemplate(selectValue,data.classIfId)
}
});
}
function closeBox() { function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name)); parent.layer.close(parent.layer.getFrameIndex(window.name));
} }
@ -297,25 +295,12 @@
function initArticleContentPublishTimeDateTime() { function initArticleContentPublishTimeDateTime() {
laydate.render({ laydate.render({
elem: '#articleContentPublishTime', elem: '#articleContentPublishTime',
type: 'datetime', type: 'date',
value: '', value: '',
trigger: 'click' trigger: 'click'
}); });
} }
//初始化文章目录
function initArticleTypeIdTemplate(selectValue){
top.restAjax.get(top.restAjax.path("api/articletype/list",[]),{},null,function (code,data,args) {
laytpl(document.getElementById('articleTypeIdTemplate').innerHTML).render(data, function(html) {
document.getElementById('articleTypeIdTemplateBox').innerHTML = html;
});
form.render('select', 'articleTypeIdTemplateBox');
var selectObj = {};
selectObj['articleTypeId'] = selectValue;
form.val('dataForm', selectObj);
});
}
//初始化文章分类 //初始化文章分类
function initArticleClassifyIdTemplate(selectValue,dataParentId){ function initArticleClassifyIdTemplate(selectValue,dataParentId){
top.restAjax.get(top.restAjax.path("api/data/listallbyparentid/{dataParentId}",[dataParentId]),{},null,function (code,data,args) { top.restAjax.get(top.restAjax.path("api/data/listallbyparentid/{dataParentId}",[dataParentId]),{},null,function (code,data,args) {
@ -330,14 +315,7 @@
} }
//文章分类默认初始化
function initClassifyId() {
var data = []
laytpl(document.getElementById('articleClassifyIdTemplate').innerHTML).render(data, function(html) {
document.getElementById('articleClassifyIdTemplateBox').innerHTML = html;
});
form.render('select', 'articleClassifyIdTemplateBox');
}
// 初始化文章正文富文本 // 初始化文章正文富文本
function initArticleContentContentText() { function initArticleContentContentText() {
@ -348,15 +326,7 @@
ueEditorObj['articleContentContent'] = editor; ueEditorObj['articleContentContent'] = editor;
} }
form.on('select(articleTypeId)', function(data){
console.log(data)
var classifyId = data.elem[data.elem.selectedIndex].dataset.classifyId
if(classifyId == 'undefined'){
initClassifyId();
}else{
initArticleClassifyIdTemplate("",classifyId);
}
});
@ -373,12 +343,7 @@
form.render(null, 'dataForm'); form.render(null, 'dataForm');
initArticleContentCoverPhotosUploadFile(); initArticleContentCoverPhotosUploadFile();
initArticleContentPublishTimeDateTime(); initArticleContentPublishTimeDateTime();
initArticleTypeIdTemplate(data.articleTypeId); initArticleTypeName(data.articleClassifyId,data.articleTypeClassifyId)
if(data.articleClassifyId == ''){
initClassifyId();
}else{
initArticleClassifyIdTemplate(data.articleClassifyId,data.articleTypeClassifyId);
}
initArticleContentContentText(); initArticleContentContentText();
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
@ -425,6 +390,18 @@
// 校验 // 校验
form.verify({ form.verify({
classIfV:function (value,item) {
if(classIfIsShow == 'show'){
if(value == ''){
return '请选择文章分类';
}
}
},
photos:function (value,item) {
if(value == ''){
return '请上传封面图片';
}
}
}); });
}); });
</script> </script>

View File

@ -119,7 +119,7 @@
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">文章封面图片</label> <label class="layui-form-label">文章封面图片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos"> <input type="hidden" id="articleContentCoverPhotos" name="articleContentCoverPhotos" lay-verify="photos">
<div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div> <div class="layui-btn-container" id="articleContentCoverPhotosFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="articleContentCoverPhotosFileDownload" type="text/html"> <script id="articleContentCoverPhotosFileDownload" type="text/html">
{{# var fileName = 'articleContentCoverPhotos'; }} {{# var fileName = 'articleContentCoverPhotos'; }}
@ -297,7 +297,7 @@
function initArticleContentPublishTimeDateTime() { function initArticleContentPublishTimeDateTime() {
laydate.render({ laydate.render({
elem: '#articleContentPublishTime', elem: '#articleContentPublishTime',
type: 'datetime', type: 'date',
value: '', value: '',
trigger: 'click' trigger: 'click'
}); });
@ -425,6 +425,11 @@
// 校验 // 校验
form.verify({ form.verify({
photos:function (value,item) {
if(value == ''){
return '请上传封面图片';
}
}
}); });
}); });
</script> </script>