master
msgroup 3 years ago committed by mingsoft
parent 672d554593
commit 6a59a6d7c2
  1. 47
      doc/5.2.12-up-5.3.0.sql
  2. 58
      doc/5.3.0-up-5.3.1.sql
  3. 727
      doc/mcms-5.3.0.sql
  4. 733
      doc/mcms-5.3.1.sql
  5. 10
      pom.xml
  6. 4
      src/main/java/net/mingsoft/cms/action/CategoryAction.java
  7. 33
      src/main/java/net/mingsoft/cms/action/GeneraterAction.java
  8. 9
      src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
  9. 12
      src/main/java/net/mingsoft/cms/aop/CategoryAop.java
  10. 31
      src/main/java/net/mingsoft/cms/aop/ContentAop.java
  11. 43
      src/main/java/net/mingsoft/cms/constant/e/CategoryDisplayEnum.java
  12. 220
      src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
  13. 13
      src/main/java/net/mingsoft/cms/dao/IContentDao.xml
  14. 78
      src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
  15. 13
      src/main/java/net/mingsoft/cms/entity/ContentEntity.java
  16. 60
      src/main/java/net/mingsoft/cms/upgrade/UpgradeCategory.java
  17. 22
      src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
  18. 6
      src/main/resources/application-dev.yml
  19. 12
      src/main/resources/application.yml
  20. 697
      src/main/webapp/WEB-INF/manager/cms/category/form.ftl
  21. 6
      src/main/webapp/WEB-INF/manager/cms/category/index.ftl
  22. 73
      src/main/webapp/WEB-INF/manager/cms/content/form.ftl
  23. 9
      src/main/webapp/WEB-INF/manager/cms/content/main.ftl
  24. 22
      src/main/webapp/WEB-INF/manager/cms/generate/index.ftl
  25. 2833
      src/main/webapp/WEB-INF/manager/main.ftl
  26. 5
      src/main/webapp/static/css/app.css
  27. 2257
      src/main/webapp/static/plugins/composition-api/1.4.3/vue-composition-api.js
  28. 94011
      src/main/webapp/static/plugins/echarts/5.2.2/echarts.js
  29. 2
      src/main/webapp/static/plugins/jquery/3.6.3/jquery-3.6.3.min.js
  30. 102
      src/main/webapp/static/plugins/ms/2.0/ms-el-form.umd.js
  31. 2
      src/main/webapp/static/plugins/vue-echarts/6.0.2/index.umd.min.js
  32. 2
      src/main/webapp/template/1/default/head-file.htm
  33. 2
      src/main/webapp/template/1/default/header.htm

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -17,7 +17,7 @@
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<log4j.version>2.19.0</log4j.version> <log4j.version>2.20.0</log4j.version>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>
@ -44,24 +44,24 @@
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-base</artifactId> <artifactId>ms-base</artifactId>
<version>2.1.18.3</version> <version>2.1.19</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-basic</artifactId> <artifactId>ms-basic</artifactId>
<version>2.1.18.3</version> <version>2.1.19</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mdiy</artifactId> <artifactId>ms-mdiy</artifactId>
<version>2.1.18</version> <version>2.1.19</version>
</dependency> </dependency>
<!--store入口依赖(源码不开发),如果不需要MStore可以直接去掉依赖--> <!--store入口依赖(源码不开发),如果不需要MStore可以直接去掉依赖-->
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>store-client</artifactId> <artifactId>store-client</artifactId>
<version>2.1.18</version> <version>2.1.19</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.oshi</groupId> <groupId>com.github.oshi</groupId>

@ -323,11 +323,11 @@ public class CategoryAction extends BaseAction {
} }
/** /**
* 批量更新模 * 批量更新模
* @param category 栏目实体 * @param category 栏目实体
* @return * @return
*/ */
@ApiOperation(value = "批量更新模") @ApiOperation(value = "批量更新模")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query"), @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query"),
@ApiImplicitParam(name = "dictId", value = "字典", required = true, paramType = "query") @ApiImplicitParam(name = "dictId", value = "字典", required = true, paramType = "query")

@ -26,9 +26,15 @@ package net.mingsoft.cms.action;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateException; import cn.hutool.core.date.DateException;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.ZipUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData; import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.annotation.LogAnn; import net.mingsoft.basic.annotation.LogAnn;
import net.mingsoft.basic.biz.IModelBiz; import net.mingsoft.basic.biz.IModelBiz;
@ -39,8 +45,10 @@ import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean; import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.biz.ICategoryBiz; import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.biz.IContentBiz; import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.constant.e.CategoryDisplayEnum;
import net.mingsoft.cms.constant.e.CategoryTypeEnum; import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.entity.CategoryEntity; import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.util.CmsParserUtil; import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.util.ParserUtil; import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -53,15 +61,16 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.*;
import java.io.IOException; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @ClassName: GeneraterAction * @ClassName: GeneraterAction
@ -70,7 +79,7 @@ import java.util.List;
* @date: 2018年1月31日 下午2:52:07 * @date: 2018年1月31日 下午2:52:07
* @Copyright: 2018 www.mingsoft.net Inc. All rights reserved. * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
*/ */
@ApiIgnore @ApiOperation("静态化")
@Controller("cmsGenerater") @Controller("cmsGenerater")
@RequestMapping("/${ms.manager.path}/cms/generate") @RequestMapping("/${ms.manager.path}/cms/generate")
@Scope("request") @Scope("request")
@ -127,12 +136,12 @@ public class GeneraterAction extends BaseAction {
@LogAnn(title = "生成主页", businessType = BusinessTypeEnum.UPDATE) @LogAnn(title = "生成主页", businessType = BusinessTypeEnum.UPDATE)
@ResponseBody @ResponseBody
public ResultData generateIndex(HttpServletRequest request, HttpServletResponse response) throws IOException { public ResultData generateIndex(HttpServletRequest request, HttpServletResponse response) throws IOException {
// 模文件名称 // 模文件名称
String tmpFileName = request.getParameter("url"); String tmpFileName = request.getParameter("url");
// 生成后的文件名称 // 生成后的文件名称
String generateFileName = request.getParameter("position"); String generateFileName = request.getParameter("position");
// 获取文件所在路径 首先判断用户输入的模文件是否存在 // 获取文件所在路径 首先判断用户输入的模文件是否存在
if (!FileUtil.exist(ParserUtil.buildTemplatePath())) { if (!FileUtil.exist(ParserUtil.buildTemplatePath())) {
return ResultData.build().error(getResString("template.file")); return ResultData.build().error(getResString("template.file"));
} else { } else {
@ -173,8 +182,12 @@ public class GeneraterAction extends BaseAction {
//文章列表 //文章列表
List<CategoryBean> articleIdList = null; List<CategoryBean> articleIdList = null;
// 获取栏目列表模 // 获取栏目列表模
for (CategoryEntity column : columns) { for (CategoryEntity column : columns) {
// 如果栏目被禁用则跳过
if (CategoryDisplayEnum.DISABLE.toString().equalsIgnoreCase(column.getCategoryDisplay())){
continue;
}
//如果是链接就跳过生成 //如果是链接就跳过生成
if (column.getCategoryType().equals(CategoryTypeEnum.LINK.toString())) { if (column.getCategoryType().equals(CategoryTypeEnum.LINK.toString())) {
continue; continue;
@ -255,6 +268,10 @@ public class GeneraterAction extends BaseAction {
} }
for (CategoryEntity category : categoryList) { for (CategoryEntity category : categoryList) {
// 如果栏目被禁用则跳过
if (CategoryDisplayEnum.DISABLE.toString().equalsIgnoreCase(category.getCategoryDisplay())){
continue;
}
//如果是链接就跳过生成 //如果是链接就跳过生成
if (category.getCategoryType().equals(CategoryTypeEnum.LINK.toString())) { if (category.getCategoryType().equals(CategoryTypeEnum.LINK.toString())) {
continue; continue;
@ -299,4 +316,6 @@ public class GeneraterAction extends BaseAction {
+ File.separator + position + ParserUtil.HTML_SUFFIX; + File.separator + position + ParserUtil.HTML_SUFFIX;
return "redirect:" + indexPosition; return "redirect:" + indexPosition;
} }
} }

@ -252,6 +252,12 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
params.put(ParserUtil.URL, BasicUtil.getUrl()); params.put(ParserUtil.URL, BasicUtil.getUrl());
params.put(ParserUtil.APP_DIR, BasicUtil.getApp().getAppDir()); params.put(ParserUtil.APP_DIR, BasicUtil.getApp().getAppDir());
} }
//对项目名预处理
String contextPath = BasicUtil.getContextPath();
if (StringUtils.isNotBlank(contextPath) && "/".equalsIgnoreCase(contextPath) ){
contextPath = "";
}
params.putIfAbsent(ParserUtil.CONTEXT_PATH, contextPath);
searchMap.put("pageNo", 0); searchMap.put("pageNo", 0);
// ParserUtil.read(search, map, page); // ParserUtil.read(search, map, page);
@ -268,8 +274,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
page.setPageNo(pageNo); page.setPageNo(pageNo);
//设置分页的统一链接 //设置分页的统一链接
String url = params.get(ParserUtil.URL).toString(); String url = request.getServletPath() + "?" + urlParams;
url = url + request.getServletPath() + "?" + urlParams;
String pageNoStr = "size=" + page.getSize() + "&pageNo="; String pageNoStr = "size=" + page.getSize() + "&pageNo=";
//下一页 //下一页
String nextUrl = url + pageNoStr + ((pageNo + 1 > total) ? total : pageNo + 1); String nextUrl = url + pageNoStr + ((pageNo + 1 > total) ? total : pageNo + 1);

@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import net.mingsoft.base.entity.ResultData; import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.exception.BusinessException; import net.mingsoft.basic.exception.BusinessException;
import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.cms.constant.e.CategoryDisplayEnum;
import net.mingsoft.cms.constant.e.CategoryTypeEnum; import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.dao.ICategoryDao; import net.mingsoft.cms.dao.ICategoryDao;
import net.mingsoft.cms.dao.IContentDao; import net.mingsoft.cms.dao.IContentDao;
@ -31,6 +32,7 @@ import org.springframework.stereotype.Component;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
@ -76,6 +78,15 @@ public class CategoryAop extends net.mingsoft.basic.aop.BaseAop {
throw new BusinessException("栏目不存在!"); throw new BusinessException("栏目不存在!");
} }
// 如果栏目被设置为不显示,将栏目下所有子栏目也设置为不显示
if (CategoryDisplayEnum.DISABLE.toString().equalsIgnoreCase(category.getCategoryDisplay())){
List<String> ids = categoryDao.queryChildren(category).stream().map(CategoryEntity::getId).collect(Collectors.toList());
LambdaUpdateWrapper<CategoryEntity> wrapper = new UpdateWrapper<CategoryEntity>().lambda();
wrapper.set(CategoryEntity::getCategoryDisplay,CategoryDisplayEnum.DISABLE.toString());
wrapper.in(CategoryEntity::getId,ids);
categoryDao.update(new CategoryEntity(),wrapper);
}
// 获取返回值 // 获取返回值
Object obj = pjp.proceed(pjp.getArgs()); Object obj = pjp.proceed(pjp.getArgs());
ResultData resultData = JSONUtil.toBean(JSONUtil.toJsonStr(obj), ResultData.class); ResultData resultData = JSONUtil.toBean(JSONUtil.toJsonStr(obj), ResultData.class);
@ -83,6 +94,7 @@ public class CategoryAop extends net.mingsoft.basic.aop.BaseAop {
if (parent == null) { if (parent == null) {
return resultData; return resultData;
} }
// 用于判断父级栏目之前是否是子栏目 // 用于判断父级栏目之前是否是子栏目
// 只有父节点之前为子节点 && 父栏目类型为列表 && 子栏目为列表 // 只有父节点之前为子节点 && 父栏目类型为列表 && 子栏目为列表
boolean flag = parent.getLeaf() && StringUtils.equals(parent.getCategoryType(), CategoryTypeEnum.LIST.toString()); boolean flag = parent.getLeaf() && StringUtils.equals(parent.getCategoryType(), CategoryTypeEnum.LIST.toString());

@ -99,28 +99,20 @@ public class ContentAop extends BaseAop {
return pjp.proceed(); return pjp.proceed();
} }
//查询判断该ip是否已经有浏览记录了
HistoryLogEntity historyLog = new HistoryLogEntity(); HistoryLogEntity historyLog = new HistoryLogEntity();
historyLog.setContentId(content.getId()); historyLog.setContentId(content.getId());
historyLog.setHlIp(BasicUtil.getIp()); historyLog.setHlIp(BasicUtil.getIp());
historyLog.setHlIsMobile(BasicUtil.isMobileDevice()); historyLog.setHlIsMobile(BasicUtil.isMobileDevice());
HistoryLogEntity _historyLog = (HistoryLogEntity) historyLogBiz.getEntity(historyLog); historyLog.setCreateDate(new Date());
//如果该ip该文章没有浏览记录则保存浏览记录 //保存浏览记录
//并且更新点击数 historyLogBiz.saveEntity(historyLog);
if (_historyLog == null || StringUtils.isBlank(_historyLog.getId())) { //更新点击数
historyLog.setCreateDate(new Date()); if (content.getContentHit() == null) {
historyLogBiz.saveEntity(historyLog); content.setContentHit(1);
//更新点击数 } else {
ContentEntity updateContent = new ContentEntity(); content.setContentHit(content.getContentHit() + 1);
updateContent.setId(content.getId());
if (content.getContentHit() == null) {
updateContent.setContentHit(1);
} else {
updateContent.setContentHit(content.getContentHit() + 1);
}
contentBiz.updateEntity(updateContent);
} }
contentBiz.updateById(content);
return pjp.proceed(); return pjp.proceed();
} }
@ -131,6 +123,7 @@ public class ContentAop extends BaseAop {
/** /**
* 删除文章后并删除文章对应的静态化文件 * 删除文章后并删除文章对应的静态化文件
*
* @param jp * @param jp
*/ */
@After("delete()") @After("delete()")
@ -157,8 +150,8 @@ public class ContentAop extends BaseAop {
/** /**
* @param categoryPath 栏目目录 * @param categoryPath 栏目目录
* @param contentId 文章ID * @param contentId 文章ID
* 根据文章实体删除静态文件 * 根据文章实体删除静态文件
*/ */
private void deleteHtml(String categoryPath, String contentId) { private void deleteHtml(String categoryPath, String contentId) {
// html真实路径 // html真实路径

@ -0,0 +1,43 @@
/**
* Copyright (c) 2012-present 铭软科技(mingsoft.net)
* 本软件及相关文档文件以下简称软件的版权归 铭软科技 所有
* 遵循铭软科技保密协议
*/
package net.mingsoft.cms.constant.e;
import net.mingsoft.base.constant.e.BaseEnum;
/**
* @Author: 铭飞团队
* @Description: 栏目是否显示枚举类
* @Date: Create in 2023/03/24 14:18
*/
public enum CategoryDisplayEnum implements BaseEnum {
/**
* 启用
*/
ENABLE("enable"),
/**
* 禁用
*/
DISABLE("disable");
CategoryDisplayEnum(String status) {
this.status = status;
}
private String status;
@Override
public int toInt() {
return 0;
}
@Override
public String toString() {
return status;
}
}

@ -3,98 +3,110 @@
<mapper namespace="net.mingsoft.cms.dao.ICategoryDao"> <mapper namespace="net.mingsoft.cms.dao.ICategoryDao">
<resultMap id="resultMap" type="net.mingsoft.cms.entity.CategoryEntity"> <resultMap id="resultMap" type="net.mingsoft.cms.entity.CategoryEntity">
<id column="id" property="id" /><!--编号 --> <id column="id" property="id" /><!--编号 -->
<result column="category_title" property="categoryTitle" /><!--栏目管理名称 --> <result column="category_title" property="categoryTitle" /><!--栏目管理名称 -->
<result column="category_pinyin" property="categoryPinyin" /><!--栏目管理名称 --> <result column="category_short_title" property="categoryShortTitle" /><!--副标题 -->
<result column="category_id" property="categoryId" /><!--所属栏目 --> <result column="category_pinyin" property="categoryPinyin" /><!--栏目管理名称 -->
<result column="category_type" property="categoryType" /><!--栏目管理属性 --> <result column="category_id" property="categoryId" /><!--所属栏目 -->
<result column="category_sort" property="categorySort" /><!--自定义顺序 --> <result column="category_type" property="categoryType" /><!--栏目管理属性 -->
<result column="category_list_url" property="categoryListUrl" /><!--列表模板 --> <result column="category_sort" property="categorySort" /><!--自定义顺序 -->
<result column="category_url" property="categoryUrl" /><!--内容模板 --> <result column="category_list_url" property="categoryListUrl" /><!--列表模板 -->
<result column="category_keyword" property="categoryKeyword" /><!--栏目管理关键字 --> <result column="category_url" property="categoryUrl" /><!--内容模板 -->
<result column="category_descrip" property="categoryDescrip" /><!--栏目管理描述 --> <result column="category_keyword" property="categoryKeyword" /><!--栏目管理关键字 -->
<result column="category_img" property="categoryImg" /><!--缩略图 --> <result column="category_descrip" property="categoryDescrip" /><!--栏目管理描述 -->
<result column="category_diy_url" property="categoryDiyUrl" /><!--自定义链接 --> <result column="category_display" property="categoryDisplay" /><!--栏目是否显示 -->
<result column="mdiy_model_id" property="mdiyModelId" /><!--栏目管理的内容模型id --> <result column="category_img" property="categoryImg" /><!--栏目banner图 -->
<result column="dict_id" property="dictId" /><!--字典对应编号 --> <result column="category_ico" property="categoryIco" /><!--栏目小图 -->
<result column="category_flag" property="categoryFlag" /><!--栏目属性 --> <result column="category_diy_url" property="categoryDiyUrl" /><!--自定义链接 -->
<result column="category_path" property="categoryPath" /><!--栏目路径 --> <result column="mdiy_model_id" property="mdiyModelId" /><!--文章管理的内容模型id -->
<result column="category_parent_ids" property="categoryParentIds" /><!--父类型编号 --> <result column="mdiy_category_model_id" property="mdiyCategoryModelId" /><!--栏目管理的内容模型id -->
<result column="create_by" property="createBy" /><!--创建人 --> <result column="dict_id" property="dictId" /><!--字典对应编号 -->
<result column="create_date" property="createDate" /><!--创建时间 --> <result column="category_flag" property="categoryFlag" /><!--栏目属性 -->
<result column="update_by" property="updateBy" /><!--修改人 --> <result column="category_path" property="categoryPath" /><!--栏目路径 -->
<result column="update_date" property="updateDate" /><!--修改时间 --> <result column="category_parent_ids" property="categoryParentIds" /><!--父类型编号 -->
<result column="del" property="del" /><!--删除标记 --> <result column="create_by" property="createBy" /><!--创建人 -->
<result column="top_id" property="topId" /><!--删除标记 --> <result column="create_date" property="createDate" /><!--创建时间 -->
<result column="leaf" property="leaf" /><!--删除标记 --> <result column="update_by" property="updateBy" /><!--修改人 -->
<result column="update_date" property="updateDate" /><!--修改时间 -->
<result column="del" property="del" /><!--删除标记 -->
<result column="top_id" property="topId" /><!--删除标记 -->
<result column="leaf" property="leaf" /><!--删除标记 -->
</resultMap> </resultMap>
<!--更新--> <!--更新-->
<update id="updateEntity" parameterType="net.mingsoft.cms.entity.CategoryEntity"> <update id="updateEntity" parameterType="net.mingsoft.cms.entity.CategoryEntity">
update cms_category update cms_category
<set> <set>
<if test="categoryTitle != null and categoryTitle != ''">category_title=#{categoryTitle},</if> <if test="categoryTitle != null and categoryTitle != ''">category_title=#{categoryTitle},</if>
<if test="categoryPinyin != null and categoryPinyin != ''">category_pinyin=#{categoryPinyin},</if> <if test="categoryShortTitle != null and categoryShortTitle != ''">category_short_title=#{categoryShortTitle},</if>
<if test="topId != null and topId != ''">top_id=#{topId},</if> <if test="categoryPinyin != null and categoryPinyin != ''">category_pinyin=#{categoryPinyin},</if>
<if test="leaf != null">leaf=#{leaf},</if> <if test="topId != null and topId != ''">top_id=#{topId},</if>
category_id=#{categoryId}, <if test="leaf != null">leaf=#{leaf},</if>
category_parent_ids=#{categoryParentIds}, category_id=#{categoryId},
mdiy_model_id=#{mdiyModelId}, category_parent_ids=#{categoryParentIds},
<if test="categoryType != null and categoryType != ''">category_type=#{categoryType},</if> mdiy_model_id=#{mdiyModelId},
<if test="categorySort != null">category_sort=#{categorySort},</if> mdiy_category_model_id=#{mdiyCategoryModelId},
category_list_url=#{categoryListUrl}, <if test="categoryType != null and categoryType != ''">category_type=#{categoryType},</if>
category_url=#{categoryUrl}, <if test="categorySort != null">category_sort=#{categorySort},</if>
<if test="categoryKeyword != null ">category_keyword=#{categoryKeyword},</if> category_list_url=#{categoryListUrl},
<if test="categoryDescrip != null ">category_descrip=#{categoryDescrip},</if> category_url=#{categoryUrl},
<if test="categoryImg != null and categoryImg != ''">category_img=#{categoryImg},</if> <if test="categoryKeyword != null ">category_keyword=#{categoryKeyword},</if>
<if test="categoryDiyUrl != null">category_diy_url=#{categoryDiyUrl},</if> <if test="categoryDescrip != null ">category_descrip=#{categoryDescrip},</if>
<if test="dictId != null">dict_id=#{dictId},</if> <if test="categoryImg != null and categoryImg != ''">category_img=#{categoryImg},</if>
<if test="categoryFlag != null ">category_flag=#{categoryFlag},</if> <if test="categoryDisplay != null and categoryDisplay != ''">category_display=#{categoryDisplay},</if>
<if test="categoryPath != null and categoryPath != ''">category_path=#{categoryPath},</if> <if test="categoryIco != null and categoryIco != ''">category_ico=#{categoryIco},</if>
<if test="createBy &gt; 0">create_by=#{createBy},</if> <if test="categoryDiyUrl != null">category_diy_url=#{categoryDiyUrl},</if>
<if test="createDate != null">create_date=#{createDate},</if> <if test="dictId != null">dict_id=#{dictId},</if>
<if test="updateBy &gt; 0">update_by=#{updateBy},</if> <if test="categoryFlag != null ">category_flag=#{categoryFlag},</if>
<if test="updateDate != null">update_date=#{updateDate},</if> <if test="categoryPath != null and categoryPath != ''">category_path=#{categoryPath},</if>
<if test="del != null">del=#{del},</if> <if test="createBy &gt; 0">create_by=#{createBy},</if>
</set> <if test="createDate != null">create_date=#{createDate},</if>
where id = #{id} <if test="updateBy &gt; 0">update_by=#{updateBy},</if>
</update> <if test="updateDate != null">update_date=#{updateDate},</if>
<if test="del != null">del=#{del},</if>
</set>
where id = #{id}
</update>
<!--根据id获取--> <!--根据id获取-->
<select id="getEntity" resultMap="resultMap" parameterType="int"> <select id="getEntity" resultMap="resultMap" parameterType="int">
select * from cms_category where id=#{id} select * from cms_category where id=#{id}
</select> </select>
<!--根据实体获取--> <!--根据实体获取-->
<select id="getByEntity" resultMap="resultMap" parameterType="net.mingsoft.cms.entity.CategoryEntity"> <select id="getByEntity" resultMap="resultMap" parameterType="net.mingsoft.cms.entity.CategoryEntity">
select * from cms_category select * from cms_category
<where> <where>
<if test="categoryTitle != null and categoryTitle != ''">and category_title=#{categoryTitle}</if> <if test="categoryTitle != null and categoryTitle != ''">and category_title=#{categoryTitle}</if>
<if test="categoryPinyin != null and categoryPinyin != ''">and category_pinyin=#{categoryPinyin}</if> <if test="categoryShortTitle != null and categoryShortTitle != ''">and category_short_title=#{categoryShortTitle}</if>
<if test="categoryId != null and categoryId != ''">and category_id=#{categoryId}</if> <if test="categoryPinyin != null and categoryPinyin != ''">and category_pinyin=#{categoryPinyin}</if>
<if test="categoryType != null and categoryType != ''">and category_type=#{categoryType}</if> <if test="categoryId != null and categoryId != ''">and category_id=#{categoryId}</if>
<if test="categorySort != null"> and category_sort=#{categorySort} </if> <if test="categoryType != null and categoryType != ''">and category_type=#{categoryType}</if>
<if test="categoryListUrl != null and categoryListUrl != ''">and category_list_url=#{categoryListUrl}</if> <if test="categorySort != null"> and category_sort=#{categorySort} </if>
<if test="categoryUrl != null and categoryUrl != ''">and category_url=#{categoryUrl}</if> <if test="categoryListUrl != null and categoryListUrl != ''">and category_list_url=#{categoryListUrl}</if>
<if test="categoryKeyword != null and categoryKeyword != ''">and category_keyword=#{categoryKeyword}</if> <if test="categoryUrl != null and categoryUrl != ''">and category_url=#{categoryUrl}</if>
<if test="categoryDescrip != null and categoryDescrip != ''">and category_descrip=#{categoryDescrip}</if> <if test="categoryKeyword != null and categoryKeyword != ''">and category_keyword=#{categoryKeyword}</if>
<if test="categoryImg != null and categoryImg != ''">and category_img=#{categoryImg}</if> <if test="categoryDescrip != null and categoryDescrip != ''">and category_descrip=#{categoryDescrip}</if>
<if test="categoryDiyUrl != null and categoryDiyUrl != ''">and category_diy_url=#{categoryDiyUrl}</if> <if test="categoryImg != null and categoryImg != ''">and category_img=#{categoryImg}</if>
<if test="mdiyModelId != null and mdiyModelId != ''">and mdiy_model_id=#{mdiyModelId}</if> <if test="categoryDisplay != null and categoryDisplay != ''">and category_display=#{categoryDisplay}</if>
<if test="dictId != null"> and dict_id=#{dictId} </if> <if test="categoryIco != null and categoryIco != ''">and category_ico=#{categoryIco}</if>
<if test="categoryFlag != null and categoryFlag != ''">and category_flag=#{categoryFlag}</if> <if test="categoryDiyUrl != null and categoryDiyUrl != ''">and category_diy_url=#{categoryDiyUrl}</if>
<if test="categoryPath != null and categoryPath != ''">and category_path=#{categoryPath}</if> <if test="mdiyModelId != null and mdiyModelId != ''">and mdiy_model_id=#{mdiyModelId}</if>
<if test="categoryParentIds != null and categoryParentIds != ''">and category_parent_ids=#{categoryParentIds}</if> <if test="mdiyCategoryModelId != null and mdiyCategoryModelId != ''">and mdiy_category_model_id=#{mdiyCategoryModelId}</if>
<if test="createBy &gt; 0"> and create_by=#{createBy} </if> <if test="dictId != null"> and dict_id=#{dictId} </if>
<if test="createDate != null"> and create_date=#{createDate} </if> <if test="categoryFlag != null and categoryFlag != ''">and category_flag=#{categoryFlag}</if>
<if test="updateBy &gt; 0"> and update_by=#{updateBy} </if> <if test="categoryPath != null and categoryPath != ''">and category_path=#{categoryPath}</if>
<if test="updateDate != null"> and update_date=#{updateDate} </if> <if test="categoryParentIds != null and categoryParentIds != ''">and category_parent_ids=#{categoryParentIds}</if>
<if test="del != null"> and del=#{del} </if> <if test="createBy &gt; 0"> and create_by=#{createBy} </if>
<if test="topId != null and topId != ''"> and top_id=#{topId}</if> <if test="createDate != null"> and create_date=#{createDate} </if>
<if test="leaf != null"> and leaf=#{leaf}</if> <if test="updateBy &gt; 0"> and update_by=#{updateBy} </if>
</where> <if test="updateDate != null"> and update_date=#{updateDate} </if>
</select> <if test="del != null"> and del=#{del} </if>
<if test="topId != null and topId != ''"> and top_id=#{topId}</if>
<if test="leaf != null"> and leaf=#{leaf}</if>
</where>
</select>
<!-- 模糊查询开始 --> <!-- 模糊查询开始 -->
<select id="queryChildren" resultMap="resultMap"> <select id="queryChildren" resultMap="resultMap">
@ -116,28 +128,29 @@
</select> </select>
<!--删除--> <!--删除-->
<delete id="deleteEntity" parameterType="int"> <delete id="deleteEntity" parameterType="int">
delete from cms_category where id=#{id} delete from cms_category where id=#{id}
</delete> </delete>
<!--批量删除--> <!--批量删除-->
<delete id="delete" > <delete id="delete" >
delete from cms_category delete from cms_category
<where> <where>
id in <foreach collection="ids" item="item" index="index" id in <foreach collection="ids" item="item" index="index"
open="(" separator="," close=")">#{item}</foreach> open="(" separator="," close=")">#{item}</foreach>
</where> </where>
</delete> </delete>
<!--查询全部--> <!--查询全部-->
<select id="queryAll" resultMap="resultMap"> <select id="queryAll" resultMap="resultMap">
select * from cms_category order by id desc select * from cms_category order by id desc
</select> </select>
<!--条件查询--> <!--条件查询-->
<select id="query" resultMap="resultMap"> <select id="query" resultMap="resultMap">
select * from cms_category select * from cms_category
<where> <where>
<if test="categoryTitle != null and categoryTitle != ''"> and category_title=#{categoryTitle}</if> <if test="categoryTitle != null and categoryTitle != ''"> and category_title=#{categoryTitle}</if>
<if test="categoryShortTitle != null and categoryShortTitle != ''">and category_short_title=#{categoryShortTitle}</if>
<if test="categoryPinyin != null and categoryPinyin != ''">and category_pinyin=#{categoryPinyin}</if> <if test="categoryPinyin != null and categoryPinyin != ''">and category_pinyin=#{categoryPinyin}</if>
<if test="categoryId != null and categoryId != ''"> and category_id=#{categoryId}</if> <if test="categoryId != null and categoryId != ''"> and category_id=#{categoryId}</if>
<if test="categoryType != null and categoryType != ''"> and category_type=#{categoryType}</if> <if test="categoryType != null and categoryType != ''"> and category_type=#{categoryType}</if>
@ -147,8 +160,11 @@
<if test="categoryKeyword != null and categoryKeyword != ''"> and category_keyword=#{categoryKeyword}</if> <if test="categoryKeyword != null and categoryKeyword != ''"> and category_keyword=#{categoryKeyword}</if>
<if test="categoryDescrip != null and categoryDescrip != ''"> and category_descrip=#{categoryDescrip}</if> <if test="categoryDescrip != null and categoryDescrip != ''"> and category_descrip=#{categoryDescrip}</if>
<if test="categoryImg != null and categoryImg != ''"> and category_img=#{categoryImg}</if> <if test="categoryImg != null and categoryImg != ''"> and category_img=#{categoryImg}</if>
<if test="categoryDisplay != null and categoryDisplay != ''">and category_display=#{categoryDisplay}</if>
<if test="categoryIco != null and categoryIco != ''">and category_ico=#{categoryIco}</if>
<if test="categoryDiyUrl != null and categoryDiyUrl != ''"> and category_diy_url=#{categoryDiyUrl}</if> <if test="categoryDiyUrl != null and categoryDiyUrl != ''"> and category_diy_url=#{categoryDiyUrl}</if>
<if test="mdiyModelId != null and mdiyModelId != ''"> and mdiy_model_id=#{mdiyModelId}</if> <if test="mdiyModelId != null and mdiyModelId != ''"> and mdiy_model_id=#{mdiyModelId}</if>
<if test="mdiyCategoryModelId != null and mdiyCategoryModelId != ''"> and mdiy_category_model_id=#{mdiyCategoryModelId}</if>
<if test="dictId != null"> and dict_id=#{dictId} </if> <if test="dictId != null"> and dict_id=#{dictId} </if>
<if test="categoryFlag != null and categoryFlag != ''"> and category_flag=#{categoryFlag}</if> <if test="categoryFlag != null and categoryFlag != ''"> and category_flag=#{categoryFlag}</if>
<if test="categoryPath != null and categoryPath != ''"> and category_path=#{categoryPath}</if> <if test="categoryPath != null and categoryPath != ''"> and category_path=#{categoryPath}</if>

@ -5,6 +5,7 @@
<resultMap id="resultMap" type="net.mingsoft.cms.entity.ContentEntity"> <resultMap id="resultMap" type="net.mingsoft.cms.entity.ContentEntity">
<id column="id" property="id" /><!--编号 --> <id column="id" property="id" /><!--编号 -->
<result column="content_title" property="contentTitle" /><!--文章标题 --> <result column="content_title" property="contentTitle" /><!--文章标题 -->
<result column="content_short_title" property="contentShortTitle" /><!--文章副标题 -->
<result column="category_id" property="categoryId" /><!--所属栏目 --> <result column="category_id" property="categoryId" /><!--所属栏目 -->
<result column="content_type" property="contentType" /><!--文章类型 --> <result column="content_type" property="contentType" /><!--文章类型 -->
<result column="content_display" property="contentDisplay" /><!--是否显示 --> <result column="content_display" property="contentDisplay" /><!--是否显示 -->
@ -28,6 +29,7 @@
<resultMap id="resultContentMap" type="net.mingsoft.cms.bean.ContentBean"> <resultMap id="resultContentMap" type="net.mingsoft.cms.bean.ContentBean">
<id column="id" property="id" /><!--编号 --> <id column="id" property="id" /><!--编号 -->
<result column="content_title" property="contentTitle" /><!--文章标题 --> <result column="content_title" property="contentTitle" /><!--文章标题 -->
<result column="content_short_title" property="contentShortTitle" /><!--文章副标题 -->
<result column="category_id" property="categoryId" /><!--所属栏目 --> <result column="category_id" property="categoryId" /><!--所属栏目 -->
<result column="content_type" property="contentType" /><!--文章类型 --> <result column="content_type" property="contentType" /><!--文章类型 -->
<result column="content_display" property="contentDisplay" /><!--是否显示 --> <result column="content_display" property="contentDisplay" /><!--是否显示 -->
@ -54,6 +56,7 @@
<id column="article_Id" property="articleId" /><!--编号 --> <id column="article_Id" property="articleId" /><!--编号 -->
<result column="content_update_date" property="contentUpdateDate" /><!--文章更新时间--> <result column="content_update_date" property="contentUpdateDate" /><!--文章更新时间-->
<result column="category_title" property="categoryTitle" /><!--栏目管理名称 --> <result column="category_title" property="categoryTitle" /><!--栏目管理名称 -->
<result column="content_short_title" property="contentShortTitle" /><!--文章副标题 -->
<result column="category_id" property="categoryId" /><!--所属栏目 --> <result column="category_id" property="categoryId" /><!--所属栏目 -->
<result column="category_type" property="categoryType" /><!--栏目管理属性 --> <result column="category_type" property="categoryType" /><!--栏目管理属性 -->
<result column="category_sort" property="categorySort" /><!--自定义顺序 --> <result column="category_sort" property="categorySort" /><!--自定义顺序 -->
@ -81,6 +84,7 @@
insert into cms_content insert into cms_content
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="contentTitle != null and contentTitle != ''">content_title,</if> <if test="contentTitle != null and contentTitle != ''">content_title,</if>
<if test="contentShortTitle != null and contentShortTitle != ''">content_short_title,</if>
<if test="categoryId != null and categoryId != ''">category_id,</if> <if test="categoryId != null and categoryId != ''">category_id,</if>
<if test="contentType != null ">content_type,</if> <if test="contentType != null ">content_type,</if>
<if test="contentDisplay != null and contentDisplay != ''">content_display,</if> <if test="contentDisplay != null and contentDisplay != ''">content_display,</if>
@ -102,6 +106,7 @@
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="contentTitle != null and contentTitle != ''">#{contentTitle},</if> <if test="contentTitle != null and contentTitle != ''">#{contentTitle},</if>
<if test="contentShortTitle != null and contentShortTitle != ''">#{contentShortTitle},</if>
<if test="categoryId != null and categoryId != ''">#{categoryId},</if> <if test="categoryId != null and categoryId != ''">#{categoryId},</if>
<if test="contentType != null ">#{contentType},</if> <if test="contentType != null ">#{contentType},</if>
<if test="contentDisplay != null and contentDisplay != ''">#{contentDisplay},</if> <if test="contentDisplay != null and contentDisplay != ''">#{contentDisplay},</if>
@ -128,6 +133,7 @@
update cms_content update cms_content
<set> <set>
<if test="contentTitle != null and contentTitle != ''">content_title=#{contentTitle},</if> <if test="contentTitle != null and contentTitle != ''">content_title=#{contentTitle},</if>
<if test="contentShortTitle != null and contentShortTitle != ''">content_short_title=#{contentShortTitle},</if>
<if test="categoryId != null and categoryId != ''">category_id=#{categoryId},</if> <if test="categoryId != null and categoryId != ''">category_id=#{categoryId},</if>
<if test="contentType != null ">content_type=#{contentType},</if> <if test="contentType != null ">content_type=#{contentType},</if>
<if test="contentDisplay != null and contentDisplay != ''">content_display=#{contentDisplay},</if> <if test="contentDisplay != null and contentDisplay != ''">content_display=#{contentDisplay},</if>
@ -161,6 +167,7 @@
<where> <where>
del=0 del=0
<if test="contentTitle != null and contentTitle != ''">and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if> <if test="contentTitle != null and contentTitle != ''">and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if>
<if test="contentShortTitle != null and contentShortTitle != ''">and content_short_title like CONCAT(CONCAT('%',#{contentShortTitle}),'%')</if>
<if test="categoryId != null and categoryId != ''">and category_id=#{categoryId}</if> <if test="categoryId != null and categoryId != ''">and category_id=#{categoryId}</if>
<if test="contentType != null and contentType != ''">and content_type=#{contentType}</if> <if test="contentType != null and contentType != ''">and content_type=#{contentType}</if>
<if test="contentDisplay != null and contentDisplay != ''">and content_display=#{contentDisplay}</if> <if test="contentDisplay != null and contentDisplay != ''">and content_display=#{contentDisplay}</if>
@ -219,6 +226,7 @@
<where> <where>
ct.del=0 ct.del=0
<if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if> <if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if>
<if test="contentShortTitle != null and contentShortTitle != ''"> and content_short_title like CONCAT(CONCAT('%',#{contentShortTitle}),'%')</if>
<if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in <if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set(#{categoryId},CATEGORY_PARENT_IDS)>0 and cms_category.category_type != 2))</if> (select id FROM cms_category where find_in_set(#{categoryId},CATEGORY_PARENT_IDS)>0 and cms_category.category_type != 2))</if>
<if test="contentType != null and contentType != ''"> <if test="contentType != null and contentType != ''">
@ -256,6 +264,7 @@
<where> <where>
ct.del=0 ct.del=0
<if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if> <if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if>
<if test="contentShortTitle != null and contentShortTitle != ''"> and content_short_title like CONCAT(CONCAT('%',#{contentShortTitle}),'%')</if>
<if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in <if test="categoryId != null and categoryId != ''"> and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set(#{categoryId},CATEGORY_PARENT_IDS)>0))</if> (select id FROM cms_category where find_in_set(#{categoryId},CATEGORY_PARENT_IDS)>0))</if>
<if test="contentType != null and contentType != ''"> <if test="contentType != null and contentType != ''">
@ -291,7 +300,7 @@
ct.id article_id,ct.content_img litpic,c.*,ct.update_date as content_update_date ct.id article_id,ct.content_img litpic,c.*,ct.update_date as content_update_date
FROM cms_content ct FROM cms_content ct
LEFT JOIN cms_category c ON ct.category_id = c.id LEFT JOIN cms_category c ON ct.category_id = c.id
where ct.del=0 and ct.content_display=0 where ct.del=0 and ct.content_display=0 and c.category_display='enable'
<!-- 查询子栏目数据 --> <!-- 查询子栏目数据 -->
<if test="categoryId!=null and categoryId!='' and categoryType==1"> <if test="categoryId!=null and categoryId!='' and categoryType==1">
@ -342,7 +351,7 @@
ct.id article_id,ct.content_img litpic,c.* ct.id article_id,ct.content_img litpic,c.*
FROM cms_content ct FROM cms_content ct
LEFT JOIN cms_category c ON ct.category_id = c.id LEFT JOIN cms_category c ON ct.category_id = c.id
where ct.del=0 where ct.del=0 and ct.content_display=0 and c.category_display='enable'
<!-- 查询子栏目数据 --> <!-- 查询子栏目数据 -->
<if test="categoryId!=null and categoryId!='' and categoryType==1"> <if test="categoryId!=null and categoryId!='' and categoryType==1">

@ -28,6 +28,8 @@ import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.config.MSProperties; import net.mingsoft.config.MSProperties;
import net.mingsoft.mdiy.util.ConfigUtil; import net.mingsoft.mdiy.util.ConfigUtil;
import java.io.File;
/** /**
* 分类实体 * 分类实体
* *
@ -59,6 +61,10 @@ public class CategoryEntity extends BaseEntity {
* 栏目管理名称 * 栏目管理名称
*/ */
private String categoryTitle; private String categoryTitle;
/**
* 栏目副标题
*/
private String categoryShortTitle;
/** /**
* 栏目别名 * 栏目别名
*/ */
@ -93,20 +99,34 @@ public class CategoryEntity extends BaseEntity {
*/ */
private String categoryDescrip; private String categoryDescrip;
/** /**
* 缩略 * banner
*/ */
private String categoryImg; private String categoryImg;
/**
* 栏目小图
*/
private String categoryIco;
/**
* 是否显示
*/
private String categoryDisplay;
/** /**
* 自定义链接 * 自定义链接
*/ */
private String categoryDiyUrl; private String categoryDiyUrl;
/** /**
* 栏目管理的内容模型id * 文章管理的内容模型id
*/ */
private String mdiyModelId; private String mdiyModelId;
/**
* 栏目管理的内容模型id
*/
private String mdiyCategoryModelId;
/** /**
* 字典对应编号 * 字典对应编号
*/ */
@ -287,19 +307,55 @@ public class CategoryEntity extends BaseEntity {
} }
/** /**
* 设置缩略 * 设置banner
*/ */
public void setCategoryImg(String categoryImg) { public void setCategoryImg(String categoryImg) {
this.categoryImg = categoryImg; this.categoryImg = categoryImg;
} }
/** /**
* 获取缩略 * 获取banner
*/ */
public String getCategoryImg() { public String getCategoryImg() {
return this.categoryImg; return this.categoryImg;
} }
/**
* 获取副标题
*/
public String getCategoryShortTitle() {
return categoryShortTitle;
}
/**
* 设置副标题
*/
public void setCategoryShortTitle(String categoryShortTitle) {
this.categoryShortTitle = categoryShortTitle;
}
/**
* 获取栏目小图
*/
public String getCategoryIco() {
return categoryIco;
}
/**
* 设置栏目小图
*/
public void setCategoryIco(String categoryIco) {
this.categoryIco = categoryIco;
}
public String getCategoryDisplay() {
return categoryDisplay;
}
public void setCategoryDisplay(String categoryDisplay) {
this.categoryDisplay = categoryDisplay;
}
/** /**
* 设置自定义链接 * 设置自定义链接
*/ */
@ -413,6 +469,12 @@ public class CategoryEntity extends BaseEntity {
return this.categoryFlag; return this.categoryFlag;
} }
/**
* 获取父栏目id
*/
public String getParentid(){
return this.categoryId;
}
/** /**
* 获取栏目父级Id 标签使用 * 获取栏目父级Id 标签使用
*/ */
@ -483,6 +545,14 @@ public class CategoryEntity extends BaseEntity {
this.childsize = childsize; this.childsize = childsize;
} }
public String getMdiyCategoryModelId() {
return mdiyCategoryModelId;
}
public void setMdiyCategoryModelId(String mdiyCategoryModelId) {
this.mdiyCategoryModelId = mdiyCategoryModelId;
}
/** /**
* 获取url路径 * 获取url路径
* *

@ -58,6 +58,11 @@ private static final long serialVersionUID = 1574925152617L;
* 文章标题 * 文章标题
*/ */
private String contentTitle; private String contentTitle;
/**
* 文章副标题
*/
private String contentShortTitle;
/** /**
* 所属栏目 * 所属栏目
*/ */
@ -135,6 +140,14 @@ private static final long serialVersionUID = 1574925152617L;
return this.contentTitle; return this.contentTitle;
} }
public String getContentShortTitle() {
return contentShortTitle;
}
public void setContentShortTitle(String contentShortTitle) {
this.contentShortTitle = contentShortTitle;
}
public String getCategoryId() { public String getCategoryId() {
return categoryId; return categoryId;
} }

@ -0,0 +1,60 @@
package net.mingsoft.cms.upgrade;
import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.entity.CategoryEntity;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author by 铭飞开源团队
* @Description
* @date 2020/6/19 15:58
*/
public class UpgradeCategory {
/**
* 更新栏目分类的顶级节点和叶子节点
*/
public void UpgradeCategory(){
ICategoryBiz categoryBiz = SpringUtil.getBean(ICategoryBiz.class);
List<CategoryEntity> list = categoryBiz.queryAll();
list.forEach(x->{
//将parentId第一行设为顶级节点
String topId = "0";
String parentId = x.getParentids();
if (parentId != null) {
topId = parentId.split(",")[0];
}
x.setTopId(topId);
String id = x.getId();
boolean leaf = true;
//判断是否叶子,循环查找,如果有节点的父节点中包含该节点的id则判断为否跳出循环
for (int i = 0; i< list.size(); i++) {
String pId = list.get(i).getParentids();
if (pId == null) {
continue;
}
leaf = !pId.contains(id);
//如果不是叶子就跳出循环,不需要再判断了
if (!leaf) {
break;
}
}
x.setLeaf(leaf);
//更新
Map<String, String> fields = new HashMap<>();
fields.put("leaf", x.getLeaf()?"1":"0");
fields.put("top_id", x.getTopId());
Map<String, String> where = new HashMap<>();
where.put("id", x.getId());
categoryBiz.updateBySQL("cms_category", fields, where);
});
}
}

@ -38,6 +38,7 @@ import net.mingsoft.mdiy.bean.PageBean;
import net.mingsoft.mdiy.biz.IModelBiz; import net.mingsoft.mdiy.biz.IModelBiz;
import net.mingsoft.mdiy.biz.impl.ModelBizImpl; import net.mingsoft.mdiy.biz.impl.ModelBizImpl;
import net.mingsoft.mdiy.entity.ModelEntity; import net.mingsoft.mdiy.entity.ModelEntity;
import net.mingsoft.mdiy.util.ConfigUtil;
import net.mingsoft.mdiy.util.ParserUtil; import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -82,6 +83,13 @@ public class CmsParserUtil {
map.put(ParserUtil.APP_DIR, BasicUtil.getApp().getAppDir()); map.put(ParserUtil.APP_DIR, BasicUtil.getApp().getAppDir());
} }
//对项目名预处理
String contextPath = BasicUtil.getContextPath();
if (StringUtils.isNotBlank(contextPath) && "/".equalsIgnoreCase(contextPath) ){
contextPath = "";
}
map.putIfAbsent(ParserUtil.CONTEXT_PATH, contextPath);
String content = ParserUtil.rendering(templatePath, map); String content = ParserUtil.rendering(templatePath, map);
FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath, htmlDir, map.get(ParserUtil.APP_DIR).toString()), Const.UTF8); FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath, htmlDir, map.get(ParserUtil.APP_DIR).toString()), Const.UTF8);
} }
@ -130,6 +138,13 @@ public class CmsParserUtil {
parserParams.put(ParserUtil.FIELD, column); parserParams.put(ParserUtil.FIELD, column);
//对项目名预处理
String contextPath = BasicUtil.getContextPath();
if (StringUtils.isNotBlank(contextPath) && "/".equalsIgnoreCase(contextPath) ){
contextPath = "";
}
parserParams.putIfAbsent(ParserUtil.CONTEXT_PATH, contextPath);
String columnListPath; String columnListPath;
ModelEntity contentModel = null; ModelEntity contentModel = null;
// 判断当前栏目是否有自定义模型 // 判断当前栏目是否有自定义模型
@ -204,6 +219,13 @@ public class CmsParserUtil {
parserParams.put(ParserUtil.HTML, htmlDir); parserParams.put(ParserUtil.HTML, htmlDir);
//对项目名预处理
String contextPath = BasicUtil.getContextPath();
if (StringUtils.isNotBlank(contextPath) && "/".equalsIgnoreCase(contextPath) ){
contextPath = "";
}
parserParams.putIfAbsent(ParserUtil.CONTEXT_PATH, contextPath);
Map<Object, Object> contentModelMap = new HashMap<Object, Object>(); Map<Object, Object> contentModelMap = new HashMap<Object, Object>();
ModelEntity contentModel = null; ModelEntity contentModel = null;

@ -1,7 +1,11 @@
spring: spring:
datasource: datasource:
url: jdbc:mysql://localhost:3306/mcms?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true url: jdbc:mysql://192.168.0.6:3306/mcms?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true
username: root username: root
password: root password: root
filters: wall,mergeStat filters: wall,mergeStat
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
ms:
mwebsite:
tables: cms_category,cms_content,mdiy_dict,mdiy_model,mdiy_page,role

@ -49,11 +49,11 @@ ms:
back-up: /upload_back back-up: /upload_back
multipart: multipart:
#最大上传文件大小 单位:KB #最大上传文件大小 单位:KB
max-file-size: 1024 max-file-size: 10240
#文件暂存临时目录 #文件暂存临时目录
upload-temp-dir: temp upload-temp-dir: temp
#临时文件大小 #临时文件大小
max-in-memory-size: 102400 max-in-memory-size: 10240
#总上传最大大小 单位:KB -1禁用 #总上传最大大小 单位:KB -1禁用
max-request-size: -1 max-request-size: -1
@ -65,10 +65,6 @@ ms:
circle: 10 #干扰线条数,值越大越不容易辨别 circle: 10 #干扰线条数,值越大越不容易辨别
spring: spring:
data:
elasticsearch:
repositories:
enabled: false
main: main:
allow-circular-references: true allow-circular-references: true
datasource: datasource:
@ -124,9 +120,11 @@ spring:
number_format: 0.## number_format: 0.##
mybatis-plus: mybatis-plus:
#因为IBaseDao是一个抽象类,没有实体,所以自动注入的时候不会注入,需要手动映射
mapper-locations: classpath*:/net/mingsoft/base/dao/IBaseDao.xml
global-config: global-config:
db-config: db-config:
id-type: auto id-type: auto
where-strategy: not_empty where-strategy: not_empty #防止空串及null拼接条件
configuration: configuration:
database-id: mysql database-id: mysql

@ -16,219 +16,309 @@
<el-main class="ms-container"> <el-main class="ms-container">
<el-scrollbar class="ms-scrollbar" style="height: 100%;"> <el-scrollbar class="ms-scrollbar" style="height: 100%;">
<el-form ref="form" :model="form" :rules="rules" label-width="130px" size="mini"> <el-tabs v-model="activeName" style="height: calc(100% - 10px);">
<el-row <el-tab-pane style="position:relative;" v-for="(item, index) in editableTabs" :key="index"
gutter="0" :label="item.title" :name="item.name">
justify="start" align="top"> <el-form v-if="item.title=='栏目编辑'" ref="form" :model="form" :rules="rules" label-width="130px"
<el-col span="12"> size="mini">
<el-form-item label="栏目名称" prop="categoryTitle"> <el-row
<el-input v-model="form.categoryTitle" :gutter="0"
:disabled="false" justify="start" align="top">
:style="{width: '100%'}" <el-col span="12">
:clearable="true" <el-form-item label="栏目名称" prop="categoryTitle">
placeholder="请输入栏目名称"> <el-input v-model="form.categoryTitle"
</el-input> :disabled="false"
<div class="ms-form-tip"> :style="{width: '100%'}"
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}{field.typetitle}</a> :clearable="true"
</div> placeholder="请输入栏目名称">
</el-form-item> </el-input>
</el-col> <div class="ms-form-tip">
<el-col span="12"> 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
<el-form-item label="所属栏目" prop="categoryId"> target="_blank">${'$'}{field.typetitle}</a>
<tree-select ref="tree" :props="{value: 'id',label: 'categoryTitle',children: 'children'}" </div>
:options="treeList" :style="{width:'100%'}" </el-form-item>
v-model="form.categoryId"></tree-select> </el-col>
<div class="ms-form-tip"> <el-col span="12">
不能将父级别栏目移动到自身子级栏目 <el-form-item label="所属栏目" prop="categoryId">
</div> <ms-tree-select ref="tree"
</el-form-item> :props="{value: 'id',label: 'categoryTitle',children: 'children'}"
</el-col> :options="treeList" :style="{width:'100%'}"
</el-row> v-model="form.categoryId"></ms-tree-select>
<el-row <div class="ms-form-tip">
gutter="0" 不能将父级别栏目移动到自身子级栏目
justify="start" align="top"> </div>
<el-col span="12"> </el-form-item>
<el-form-item prop="categoryType" label="栏目类型"> </el-col>
<el-radio-group v-model="form.categoryType" </el-row>
:style="{width: ''}" <el-row
:disabled="categoryTypeDisabled"> :gutter="0"
<el-radio :style="{display: true ? 'inline-block' : 'block'}" :label="item.value" justify="start" align="top">
v-for='(item, index) in categoryTypeOptions' :key="item.value + index"> <el-col span="12">
{{true? item.label : item.value}} <el-form-item label="栏目副标题" prop="categoryShortTitle">
</el-radio> <el-input v-model="form.categoryShortTitle"
</el-radio-group> :disabled="false"
<div class="ms-form-tip"> :style="{width: '100%'}"
列表:<b>列表->详情</b> 的页面,例如:<i>新闻列表、图片列表</i>,可以多篇文章<br> :clearable="true"
单篇:<b>单篇文章</b>,例如:<i>关于我们、公司介绍</i>,只能发一篇文章<br> placeholder="请输入栏目副标题">
链接:外链接,需要配合逻辑判断<b>&lt;#if&gt;</b>和<b>自定义链接</b>标签使用使用,不能发文章<br> </el-input>
修改栏目时,如果该栏目下存在文章栏目类型则不能修改 <div class="ms-form-tip">
</div> 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
</el-form-item> target="_blank">${'$'}{field.typeshorttitle}</a>
</el-col> </div>
<el-col span="12"> </el-form-item>
<el-form-item prop="mdiyModelId" label="自定义模型"> </el-col>
<el-select v-model="form.mdiyModelId" <el-col span="12">
:style="{width: '100%'}" <el-form-item label="是否显示" prop="categoryDisplay">
:filterable="false" <el-radio-group v-model="form.categoryDisplay"
:disabled="false" :style="{width: ''}"
:multiple="false" :clearable="true" :disabled="false">
placeholder="请选择自定义模型"> <el-radio :style="{display: true ? 'inline-block' : 'block'}"
<el-option v-for='item in mdiyModelIdOptions' :key="item.id" :value="item.id" :label="item.value"
:label="item.modelName"></el-option> v-for='(item, index) in categoryDisplayOptions'
</el-select> :key="item.value + index">
<div class="ms-form-tip"> {{true? item.label : item.value}}
文章字段不满足,使用<b>代码生成器</b>生成<b>自定义模型</b>来扩展,<br/> </el-radio>
大概步骤:<i>代码生成器->复制自定义模型->打开系统后台的自定义管理->选择自定义模型->导入->栏目 自定义模型 绑定</i> </el-radio-group>
</div> <div class="ms-form-tip">
</el-form-item> 选择否后需重新生成,与文章是否显示功能一致;若该栏目禁用,则所有子栏目也会被禁用,请谨慎操作;
</div>
</el-form-item>
</el-col>
</el-row>
<el-row
gutter="0"
justify="start" align="top">
<el-col span="12">
<el-form-item prop="categoryType" label="栏目类型">
<el-radio-group v-model="form.categoryType"
:style="{width: ''}"
:disabled="categoryTypeDisabled">
<el-radio :style="{display: true ? 'inline-block' : 'block'}"
:label="item.value"
v-for='(item, index) in categoryTypeOptions'
:key="item.value + index">
{{true? item.label : item.value}}
</el-radio>
</el-radio-group>
<div class="ms-form-tip">
列表:<b>列表->详情</b> 的页面,例如:<i>新闻列表、图片列表</i>,可以多篇文章<br>
单篇:<b>单篇文章</b>,例如:<i>关于我们、公司介绍</i>,只能发一篇文章<br>
链接:外链接,需要配合逻辑判断<b>&lt;#if&gt;</b>和<b>自定义链接</b>标签使用使用,不能发文章<br>
修改栏目时,如果该栏目下存在文章栏目类型则不能修改
</div>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="mdiyModelId" label="文章自定义模型">
<el-select v-model="form.mdiyModelId"
:style="{width: '100%'}"
:filterable="false"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择文章自定义模型">
<el-option v-for='item in mdiyModelListOptions' :key="item.id" :value="item.id"
:label="item.modelName"></el-option>
</el-select>
<div class="ms-form-tip">
文章字段不满足,使用<b>代码生成器</b>生成<b>自定义模型</b>来扩展,<br/>
大概步骤:<i>代码生成器->复制自定义模型->打开系统后台的自定义管理->选择自定义模型->导入->文章 自定义模型 绑定</i>
</div>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row gutter="0" justify="start" align="top" > <el-row gutter="0" justify="start" align="top">
<el-col span="12"> <el-col span="12">
<el-form-item prop="categoryListUrl" label="列表模板" v-if="form.categoryType == '1'"> <el-form-item prop="categoryListUrl" label="列表模板" v-if="form.categoryType == '1'">
<el-select v-model="form.categoryListUrl" <el-select v-model="form.categoryListUrl"
:style="{width: '100%'}" :style="{width: '100%'}"
:filterable="true" :filterable="true"
:disabled="false" :disabled="false"
:multiple="false" :clearable="true" :multiple="false" :clearable="true"
placeholder="请选择列表模板"> placeholder="请选择列表模板">
<el-option v-for='item in categoryListUrlOptions' :key="item" :value="item" <el-option v-for='item in categoryListUrlOptions' :key="item" :value="item"
:label="item"></el-option> :label="item"></el-option>
</el-select> </el-select>
<div class="ms-form-tip"> <div class="ms-form-tip">
当栏目类型为<b>列表</b>时有效,没有选择模版不会进行静态化(不会生成列表静态页) 当栏目类型为<b>列表</b>时有效,没有选择模板不会进行静态化(不会生成列表静态页)
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col span="12">
<el-form-item prop="mdiyCategoryModelId" label="栏目自定义模型">
<el-select v-model="form.mdiyCategoryModelId"
:style="{width: '100%'}"
:filterable="false"
:disabled="false"
@change="setCategoryModel"
:multiple="false" :clearable="true"
placeholder="请选择栏目自定义模型">
<el-option v-for='item in mdiyCategoryModelListOptions' :key="item.id"
:value="item.id"
:label="item.modelName"></el-option>
</el-select>
<div class="ms-form-tip">
栏目字段不满足,使用<b>代码生成器</b>生成<b>自定义模型</b>来扩展,<br/>
大概步骤:<i>代码生成器->复制自定义模型->打开系统后台的自定义管理->选择自定义模型->导入->栏目 自定义模型 绑定</i>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row
gutter="0"
justify="start" align="top">
<el-col span="12">
<el-form-item prop="categoryUrl" label="详情模板" v-if="form.categoryType != '3'">
<el-select v-model="form.categoryUrl"
:style="{width: '100%'}"
:filterable="true"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择详情模板">
<el-option v-for='item in categoryUrlOptions' :key="item" :value="item"
:label="item"></el-option>
</el-select>
<div class="ms-form-tip">
当栏目类型为<b>列表</b>时有效,没有选择模板不会进行静态化(不会生成内容静态页)
</div>
</el-form-item>
<el-form-item prop="categoryDiyUrl" label="自定义链接" v-if="form.categoryType == '3'">
<el-input
:disabled="false"
v-model="form.categoryDiyUrl"
:style="{width: '100%'}"
placeholder="请输入自定义链接">
</el-input>
<div class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
target="_blank">${'$'}{field.typeurl}</a>,自定义链接不能包含标签
</div>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item label="自定义顺序" prop="categorySort">
<el-input-number
v-model="form.categorySort"
:disabled="false"
controls-position="">
</el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="0"
justify="start" align="top">
<el-col :span="12">
<el-form-item label="生成路径" prop="categoryPinyin">
<el-input
v-model="form.categoryPinyin"
:disabled="false"
:readonly="false"
:style="{width: '100%'}"
:clearable="true"
placeholder="请输入栏目生成路径,默认栏目名称拼音全拼">
</el-input>
<div class="ms-form-tip">
默认根据栏目名称的拼音全拼,如果栏目名称含有特殊字符请手动输入
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="栏目属性" prop="categoryFlag">
<el-select v-model="form.categoryFlag"
:style="{width: '100%'}"
:filterable="false"
:disabled="false"
:multiple="true" :clearable="true"
placeholder="请选择栏目属性">
<el-option v-for='item in categoryFlagOptions' :key="item.dictValue"
:value="item.dictValue"
:label="item.dictLabel"></el-option>
</el-select>
<div class="ms-form-tip">
可以在自定义字典中管理
</div>
</el-form-item>
</el-col>
</el-row>
<el-row
gutter="0"
justify="start" align="top" >
<el-col span="12" >
<el-form-item prop="categoryUrl" label="详情模板" v-if="form.categoryType != '3'">
<el-select v-model="form.categoryUrl"
:style="{width: '100%'}"
:filterable="true"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择详情模板">
<el-option v-for='item in categoryUrlOptions' :key="item" :value="item"
:label="item"></el-option>
</el-select>
<div class="ms-form-tip">
当栏目类型为<b>列表</b>时有效,没有选择模版不会进行静态化(不会生成内容静态页)
</div>
</el-form-item>
<el-form-item prop="categoryDiyUrl" label="自定义链接" v-if="form.categoryType == '3'"> </el-row>
<el-form-item label="关键字" prop="categoryKeyword">
<el-input <el-input
type="textarea" :rows="5"
:disabled="false" :disabled="false"
v-model="form.categoryDiyUrl" v-model="form.categoryKeyword"
:style="{width: '100%'}" :style="{width: '100%'}"
placeholder="请输入自定义链接"> placeholder="关键字,有助于搜索">
</el-input> </el-input>
<div class="ms-form-tip"> <div class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}{field.typeurl}</a>,自定义链接不能包含标签 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
target="_blank">${'$'}{field.typekeyword}</a>,
用于SEO优化
</div> </div>
</el-form-item> </el-form-item>
</el-col> <el-form-item label="描述" prop="categoryDescrip">
<el-col span="12">
<el-form-item label="自定义顺序" prop="categorySort">
<el-input-number
v-model="form.categorySort"
:disabled="false"
controls-position="">
</el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter="0"
justify="start" align="top">
<el-col :span="12">
<el-form-item label="生成路径" prop="categoryPinyin">
<el-input <el-input
v-model="form.categoryPinyin" type="textarea" :rows="5"
:disabled="false" :disabled="false"
:readonly="false" v-model="form.categoryDescrip"
:style="{width: '100%'}" :style="{width: '100%'}"
:clearable="true" placeholder="栏目描述,有助于搜索">
placeholder="请输入栏目生成路径,默认栏目名称拼音全拼">
</el-input> </el-input>
<div class="ms-form-tip"> <div class="ms-form-tip">
默认根据栏目名称的拼音全拼,如果栏目名称含有特殊字符请手动输入 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
target="_blank">${'$'}{field.typedescrip}</a>
用于SEO优化
</div> </div>
</el-form-item> </el-form-item>
</el-col> <el-form-item label="banner图" prop="categoryImg">
<el-col :span="12"> <el-upload
<el-form-item label="栏目属性" prop="categoryFlag"> :file-list="form.categoryImg"
<el-select v-model="form.categoryFlag" :action="ms.manager+'/file/upload.do'"
:style="{width: '100%'}" :on-remove="categoryImghandleRemove"
:filterable="false" :style="{width:''}"
:disabled="false" :limit="1"
:multiple="true" :clearable="true" :on-exceed="categoryImghandleExceed"
placeholder="请选择栏目属性"> :disabled="false"
<el-option v-for='item in categoryFlagOptions' :key="item.dictValue" :value="item.dictValue" :data="{uploadPath:'/cms/category','isRename':true,'appId':true}"
:label="item.dictLabel"></el-option> :on-success="categoryImgSuccess"
</el-select> accept="image/*"
<div class="ms-form-tip"> list-type="picture-card">
可以在自定义字典中管理 <i class="el-icon-plus"></i>
</div> <div slot="tip" class="ms-form-tip">
只能上传1张图片
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
target="_blank"><#noparse>{@ms:file field.typelitpic/}</#noparse></a><br/>
</div>
</el-upload>
</el-form-item> </el-form-item>
</el-col> <el-form-item label="栏目小图" prop="categoryIco">
<el-upload
:file-list="form.categoryIco"
</el-row> :action="ms.manager+'/file/upload.do'"
<el-form-item label="关键字" prop="categoryKeyword" > :on-remove="categoryIcohandleRemove"
<el-input :style="{width:''}"
type="textarea" :rows="5" :limit="1"
:disabled="false" :on-exceed="categoryIcohandleExceed"
v-model="form.categoryKeyword" :disabled="false"
:style="{width: '100%'}" :data="{uploadPath:'/cms/category','isRename':true,'appId':true}"
placeholder="关键字,有助于搜索"> :on-success="categoryIcoSuccess"
</el-input> accept="image/*"
<div class="ms-form-tip"> list-type="picture-card">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}{field.typekeyword}</a>, <i class="el-icon-plus"></i>
用于SEO优化 <div slot="tip" class="ms-form-tip">
</div> 只能上传1张图片
</el-form-item> 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html"
<el-form-item label="描述" prop="categoryDescrip"> target="_blank"><#noparse>{@ms:file field.typeico/}</#noparse></a><br/>
<el-input </div>
type="textarea" :rows="5" </el-upload>
:disabled="false" </el-form-item>
v-model="form.categoryDescrip" </el-form>
:style="{width: '100%'}" <div :id="'model'+index" v-else></div>
placeholder="栏目描述,有助于搜索"> </el-tab-pane>
</el-input> </el-tabs>
<div class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}{field.typedescrip}</a>
用于SEO优化
</div>
</el-form-item>
<el-form-item label="缩略图" prop="categoryImg" >
<el-upload
:file-list="form.categoryImg"
:action="ms.manager+'/file/upload.do'"
:on-remove="categoryImghandleRemove"
:style="{width:''}"
:limit="1"
:on-exceed="categoryImghandleExceed"
:disabled="false"
:data="{uploadPath:'/cms/category','isRename':true,'appId':true}"
:on-success="categoryImgSuccess"
accept="image/*"
list-type="picture-card">
<i class="el-icon-plus"></i>
<div slot="tip" class="ms-form-tip">
只能上传1张图片
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank"><#noparse>{@ms:file field.typelitpic/}</#noparse></a><br/>
</div>
</el-upload>
</el-form-item>
</el-form>
</el-scrollbar> </el-scrollbar>
</el-main> </el-main>
</div> </div>
@ -254,6 +344,13 @@
}) })
} }
return { return {
activeName: 'form',
//自定义模型实例
model: undefined,
editableTabs: [{
title: '栏目编辑',
name: 'form'
}],
treeList: [{ treeList: [{
id: '0', id: '0',
categoryTitle: '顶级栏目', categoryTitle: '顶级栏目',
@ -262,10 +359,20 @@
categoryList: [], categoryList: [],
saveDisabled: false, saveDisabled: false,
categoryTypeDisabled: true, categoryTypeDisabled: true,
// 栏目是否显示
categoryDisplayOptions: [{
"value": "enable",
"label": "是"
}, {
"value": "disable",
"label": "否"
}],
//表单数据 //表单数据
form: { form: {
// 栏目管理名称 // 栏目管理名称
categoryTitle: '', categoryTitle: '',
// 栏目父标题
categoryShortTitle: '',
// 所属栏目 // 所属栏目
categoryId: undefined, categoryId: undefined,
// 栏目管理属性 // 栏目管理属性
@ -280,14 +387,20 @@
categoryPinyin: '', categoryPinyin: '',
// 栏目管理关键字 // 栏目管理关键字
categoryKeyword: '', categoryKeyword: '',
// 栏目是否显示
categoryDisplay: 'enable',
// 栏目管理描述 // 栏目管理描述
categoryDescrip: '', categoryDescrip: '',
// 缩略 // banner
categoryImg: [], categoryImg: [],
// 栏目小图
categoryIco: [],
// 自定义链接 // 自定义链接
categoryDiyUrl: '', categoryDiyUrl: '',
// 栏目管理的内容模型id // 文章管理的内容模型id
mdiyModelId: '', mdiyModelId: '',
// 栏目管理的内容模型id
mdiyCategoryModelId: '',
//栏目字典 //栏目字典
categoryFlag: [] categoryFlag: []
}, },
@ -297,13 +410,14 @@
}, { }, {
"value": "2", "value": "2",
"label": "单篇" "label": "单篇"
},{ }, {
"value": "3", "value": "3",
"label": "链接" "label": "链接"
}], }],
categoryListUrlOptions: [], categoryListUrlOptions: [],
categoryUrlOptions: [], categoryUrlOptions: [],
mdiyModelIdOptions: [], mdiyModelListOptions: [],
mdiyCategoryModelListOptions: [],
categoryFlagOptions: [], categoryFlagOptions: [],
rules: { rules: {
// 栏目管理名称 // 栏目管理名称
@ -315,7 +429,7 @@
"required": true, "required": true,
"message": "请选择列表模板" "message": "请选择列表模板"
}], }],
categoryPinyin:[{ categoryPinyin: [{
validator: validatorCategoryPinyin, trigger: 'blur' validator: validatorCategoryPinyin, trigger: 'blur'
}, { }, {
"pattern": /^[^[!@#$"'%^&*()_+-/~?!@#¥%…&*()——+—?》《:“‘’]+$/, "pattern": /^[^[!@#$"'%^&*()_+-/~?!@#¥%…&*()——+—?》《:“‘’]+$/,
@ -324,8 +438,8 @@
// 内容模板 // 内容模板
categoryUrl: [{ categoryUrl: [{
"required": true, "required": true,
"message": "请选择内容模板" "message": "请选择内容模板"
}] }]
} }
}; };
}, },
@ -335,13 +449,12 @@
if (n == this.form.id) { if (n == this.form.id) {
//获取当前节点的父栏目 //获取当前节点的父栏目
let parentids = _this.form.parentids; let parentids = _this.form.parentids;
if (parentids) { if (parentids) {
let parentNode = parentids.split(','); let parentNode = parentids.split(',');
//获取最近的父节点 //获取最近的父节点
_this.form.categoryId = parentNode[parentNode.length - 1]; _this.form.categoryId = parentNode[parentNode.length - 1];
} } else {
else{
//无父栏目就恢复顶级 //无父栏目就恢复顶级
_this.form.categoryId = '0'; _this.form.categoryId = '0';
} }
@ -371,7 +484,7 @@
}, },
'form.categoryTitle': function (n) { 'form.categoryTitle': function (n) {
var regu = "[[!@'\"#$%^&*()_+-/~?!@#¥%…&*()——+—?》《:“‘’]"; var regu = "[[!@'\"#$%^&*()_+-/~?!@#¥%…&*()——+—?》《:“‘’]";
this.rules.categoryPinyin = [{ this.rules.categoryPinyin = [{
"validator": this.validatorCategoryPinyin, trigger: 'blur' "validator": this.validatorCategoryPinyin, trigger: 'blur'
}, { }, {
"pattern": /^[^[!@#$"'%^&*()_+-/~?!\\、@#¥%…&*()——+—?》《:“‘’\s]+$/, "pattern": /^[^[!@#$"'%^&*()_+-/~?!\\、@#¥%…&*()——+—?》《:“‘’\s]+$/,
@ -410,23 +523,37 @@
}, },
save: function () { save: function () {
var that = this; var that = this;
var model = undefined;
if (that.form.mdiyCategoryModelId && String(that.form.mdiyCategoryModelId)!="0"){
model = ms.mdiy.model.modelForm();
}
if (model && !model.validate()) {
this.activeName = 'custom-name';
return;
}
var url = ms.manager + "/cms/category/save.do"; var url = ms.manager + "/cms/category/save.do";
if (that.form.id > 0) { if (that.form.id > 0) {
url = ms.manager + "/cms/category/update.do"; url = ms.manager + "/cms/category/update.do";
} }
//若缩略图为空则赋值为空串 // element-ui需要数组结构
if (that.form.categoryImg.length == 0){ if (that.form.categoryImg.length == 0) {
that.form.categoryImg = ""; that.form.categoryImg = [];
}
// element-ui需要数组结构
if (that.form.categoryIco.length == 0) {
that.form.categoryIco = [];
} }
this.$refs.form.validate(function (valid) { this.$refs.form[0].validate(function (valid) {
if (valid) { if (valid) {
//栏目属性为封面则不需要列表模板 //栏目属性为封面则不需要列表模板
if (that.form.categoryType == '2') { if (that.form.categoryType == '2') {
that.form.categoryListUrl = ''; that.form.categoryListUrl = '';
} }
//栏目属性为链接则不需要列表和详情模板 //栏目属性为链接则不需要列表和详情模板
if(that.form.categoryType == '3'){ if (that.form.categoryType == '3') {
that.form.categoryListUrl = ''; that.form.categoryListUrl = '';
that.form.categoryUrl = ''; that.form.categoryUrl = '';
} }
@ -452,15 +579,21 @@
} }
data.categoryImg = JSON.stringify(data.categoryImg); data.categoryImg = JSON.stringify(data.categoryImg);
data.categoryIco = JSON.stringify(data.categoryIco);
ms.http.post(url, data).then(function (data) { ms.http.post(url, data).then(function (data) {
if (data.result) { if (data.result) {
//保存时需要赋值关联ID
if (model) {
model.form.linkId = data.data.id;
model.save();
}
that.$notify({ that.$notify({
title: '成功', title: '成功',
message: '保存成功', message: '保存成功',
type: 'success', type: 'success',
duration: 1000, duration: 1000,
onClose:function (){ onClose:function (){
location.href = ms.manager + "/cms/category/index.do"; ms.util.openSystemUrl("/cms/category/index.do");
} }
}); });
} else { } else {
@ -479,16 +612,39 @@
}); });
}, },
//获取分类内容模型 //获取分类内容模型
getColumnContentModelId: function () { queryColumnContentModelList: function () {
var that = this; var that = this;
ms.http.get(ms.manager + "/mdiy/model/list.do", { ms.http.get(ms.manager + "/mdiy/model/list.do", {
modelType: 'cms' modelType: 'cms'
}).then(function (data) { }).then(function (res) {
if(data.result){ if (res.result) {
that.mdiyModelIdOptions = data.data.rows; that.mdiyModelListOptions = res.data.rows;
} }
}); });
}, },
//获取栏目内容模型
queryCategoryModelList: function () {
var that = this;
ms.http.get(ms.manager + "/mdiy/model/list.do", {
modelType: 'category'
}).then(function (res) {
if (res.result) {
that.mdiyCategoryModelListOptions = res.data.rows;
}
});
},
//设置栏目模型
setCategoryModel: function (mdiyCategoryModelId) {
var that = this;
if (mdiyCategoryModelId) {
mdiyCategoryModelId += "";
if (mdiyCategoryModelId == "0") {
mdiyCategoryModelId = null;
}
that.form.mdiyCategoryModelId = mdiyCategoryModelId;
}
that.changeModel();
},
//获取当前分类 //获取当前分类
get: function (id) { get: function (id) {
var that = this; var that = this;
@ -508,22 +664,31 @@
} else { } else {
res.data.categoryImg = []; res.data.categoryImg = [];
} }
if (res.data.categoryIco) {
res.data.categoryIco = JSON.parse(res.data.categoryIco);
res.data.categoryIco.forEach(function (value) {
value.url = ms.base + value.path;
});
} else {
res.data.categoryIco = [];
}
if (!res.data.categoryId) { if (!res.data.categoryId) {
res.data.categoryId = '0'; res.data.categoryId = '0';
} }
var mdiyModelId = res.data.mdiyModelId; var mdiyCategoryModelId = res.data.mdiyCategoryModelId;
if (mdiyModelId) { if (mdiyCategoryModelId) {
mdiyModelId += ""; mdiyCategoryModelId += "";
if (mdiyModelId == "0") { if (mdiyCategoryModelId == "0") {
mdiyModelId = null; mdiyCategoryModelId = null;
} }
res.data.mdiyModelId = mdiyModelId; res.data.mdiyCategoryModelId = mdiyCategoryModelId;
} }
that.form = res.data; //判断该分类是否存在文章,存在则不能修改栏目属性 that.form = res.data; //判断该分类是否存在文章,存在则不能修改栏目属性
that.contentList(that.form.id); that.contentList(that.form.id);
that.changeModel();
} }
}); });
}, },
@ -532,7 +697,7 @@
ms.http.post(ms.manager + "/cms/content/list.do", { ms.http.post(ms.manager + "/cms/content/list.do", {
categoryId: id categoryId: id
}).then(function (data) { }).then(function (data) {
if(data.result){ if (data.result) {
if (data.data.total > 0) { if (data.data.total > 0) {
that.categoryTypeDisabled = true; that.categoryTypeDisabled = true;
} else { } else {
@ -562,7 +727,7 @@
dictType: '栏目属性', dictType: '栏目属性',
pageSize: 99999 pageSize: 99999
}).then(function (res) { }).then(function (res) {
if(res.result){ if (res.result) {
res = res.data; res = res.data;
that.categoryFlagOptions = res.rows; that.categoryFlagOptions = res.rows;
} }
@ -570,14 +735,14 @@
}, },
//categoryImg文件上传完成回调 //categoryImg文件上传完成回调
categoryImgSuccess: function (response, file, fileList) { categoryImgSuccess: function (response, file, fileList) {
if(response.result){ if (response.result) {
this.form.categoryImg.push({ this.form.categoryImg.push({
url: file.url, url: file.url,
name: file.name, name: file.name,
path: response.data, path: response.data,
uid: file.uid uid: file.uid
}); });
}else { } else {
this.$notify({ this.$notify({
title: '失败', title: '失败',
message: response.msg, message: response.msg,
@ -603,10 +768,82 @@
if (index != -1) { if (index != -1) {
this.form.categoryImg.splice(index, 1); this.form.categoryImg.splice(index, 1);
} }
} },
//categoryIco文件上传完成回调
categoryIcoSuccess: function (response, file, fileList) {
if (response.result) {
this.form.categoryIco.push({
url: file.url,
name: file.name,
path: response.data,
uid: file.uid
});
} else {
this.$notify({
title: '失败',
message: response.msg,
type: 'warning'
});
}
},
//上传超过限制
categoryIcohandleExceed: function (files, fileList) {
this.$notify({
title: '失败',
message: '当前最多上传1个文件',
type: 'warning'
});
},
categoryIcohandleRemove: function (file, files) {
var index = -1;
index = this.form.categoryIco.findIndex(function (text) {
return text == file;
});
if (index != -1) {
this.form.categoryIco.splice(index, 1);
}
},
removeModel: function () {
var that = this;
var model = document.getElementById('model1');
var custom = document.getElementById('c_model');
if (custom) {
model.removeChild(custom);
}
that.model = undefined;
},
categoryChange: function () {
this.changeModel();
},
changeModel: function () {
var that = this;
that.editableTabs = [that.editableTabs[0]];
if (that.form) {
if (that.form.mdiyCategoryModelId) {
that.rederModel(that.form.mdiyCategoryModelId)
}
}
},
rederModel: function (modelId) {
var that = this;
that.editableTabs.push({
title: '',
name: 'custom-name'
});
ms.mdiy.model.extend("model1", {id: modelId}, {linkId: that.form.id}, true).then(function (obj) {
that.model = obj;
that.editableTabs[1].title = obj.modelName
});
},
}, },
created: function () { created: function () {
this.getColumnContentModelId(); this.queryColumnContentModelList();
this.queryCategoryModelList();
this.getTree(); this.getTree();
this.categoryListUrlOptionsGet(); this.categoryListUrlOptionsGet();
this.categoryUrlOptionsGet(); this.categoryUrlOptionsGet();
@ -616,7 +853,7 @@
this.form.categoryId = '0'; this.form.categoryId = '0';
// 判断三种状态,默认为新增状态 // 判断三种状态,默认为新增状态
this.categoryTypeDisabled = false;// 控制栏目分类是否可编辑 this.categoryTypeDisabled = false;// 控制栏目分类是否可编辑
if (this.form.id != undefined && (this.form.childId == undefined || this.form.childId == "undefined")) { if (this.form.id != undefined && (this.form.childId == undefined || this.form.childId == "undefined")) {
// 切换编辑状态,id不为空 childId 为空 // 切换编辑状态,id不为空 childId 为空
this.categoryTypeDisabled = true; this.categoryTypeDisabled = true;
this.get(this.form.id); this.get(this.form.id);

@ -333,9 +333,11 @@
//新增 //新增
save: function (id, childId) { save: function (id, childId) {
if (id) { if (id) {
location.href = this.manager + "/cms/category/form.do?id=" + id + "&childId=" + childId; // location.href = this.manager + "/cms/category/form.do?id=" + id + "&childId=" + childId;
ms.util.openSystemUrl("/cms/category/form.do?id=" + id + "&childId=" + childId);
} else { } else {
location.href = this.manager + "/cms/category/form.do"; // location.href = this.manager + "/cms/category/form.do";
ms.util.openSystemUrl("/cms/category/form.do");
} }
}, },
//重置表单 //重置表单

@ -32,7 +32,7 @@
:label="item.title" :name="item.name"> :label="item.title" :name="item.name">
<el-form v-if="item.title=='文章编辑'" ref="form" :model="form" :rules="rules" label-width="120px" <el-form v-if="item.title=='文章编辑'" ref="form" :model="form" :rules="rules" label-width="120px"
size="mini"> size="mini">
<el-row gutter="0" justify="start" align="top"> <el-row :gutter="0" justify="start" align="top">
<el-col :span="returnIsShow?'12':'24'"> <el-col :span="returnIsShow?'12':'24'">
<el-form-item label="文章标题" prop="contentTitle"> <el-form-item label="文章标题" prop="contentTitle">
<el-input v-model="form.contentTitle" <el-input v-model="form.contentTitle"
@ -65,6 +65,37 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row
gutter="0"
justify="start" align="top">
<el-col :span="returnIsShow?'12':'24'">
<el-form-item label="文章副标题" prop="contentShortTitle">
<el-input v-model="form.contentShortTitle"
:disabled="false"
:style="{width: '100%'}"
:clearable="true"
placeholder="请输入文章副标题">
</el-input>
<div class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.shorttitle}</a>
</div>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item label="文章外链接" prop="contentOutLink">
<el-input v-model="form.contentOutLink"
:disabled="false"
:style="{width: '100%'}"
:clearable="true"
placeholder="请输入文章外链接">
</el-input>
<div class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html"
target="_blank">${'$'}{field.outlink}</a> 文章外链接必须以http或者https等开头
</div>
</el-form-item>
</el-col>
</el-row>
<el-row <el-row
gutter="0" gutter="0"
justify="start" align="top"> justify="start" align="top">
@ -138,24 +169,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row
gutter="0"
justify="start" align="top">
<el-col span="12">
<el-form-item label="文章外链接" prop="contentOutLink">
<el-input v-model="form.contentOutLink"
:disabled="false"
:style="{width: '100%'}"
:clearable="true"
placeholder="请输入文章外链接">
</el-input>
<div class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html"
target="_blank">${'$'}{field.outlink}</a> 文章外链接必须以http或者https等开头
</div>
</el-form-item>
</el-col>
</el-row>
<el-row <el-row
gutter="0" gutter="0"
justify="start" align="top"> justify="start" align="top">
@ -195,7 +208,7 @@
:action="ms.manager+'/file/upload.do'" :action="ms.manager+'/file/upload.do'"
:on-remove="contentImghandleRemove" :on-remove="contentImghandleRemove"
:style="{width:''}" :style="{width:''}"
:limit="1" :limit="10"
:on-exceed="contentImghandleExceed" :on-exceed="contentImghandleExceed"
:disabled="false" :disabled="false"
:data="{uploadPath:'/cms/content','isRename':true ,'appId':true}" :data="{uploadPath:'/cms/content','isRename':true ,'appId':true}"
@ -205,7 +218,7 @@
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<div slot="tip" class="ms-form-tip"> <div slot="tip" class="ms-form-tip">
标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'{@ms:file field.litpic/}'}</a><br/> 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'{@ms:file field.litpic/}'}</a><br/>
最多上传1张图片,文章缩略图,支持jpg格式 最多上传10张图片,文章缩略图,支持jpg格式;多图情况下,{@ms:file field.litpic/}会只取第一张缩略图,其他用法参考文档arclist标签
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -270,6 +283,8 @@
form: { form: {
// 文章标题 // 文章标题
contentTitle: '', contentTitle: '',
// 文章副标题
contentShortTitle: '',
// 所属栏目 // 所属栏目
categoryId: undefined, categoryId: undefined,
// 文章类型 // 文章类型
@ -336,7 +351,11 @@
var _this = this; var _this = this;
var that = this; //自定义模型需要验证 var that = this; //自定义模型需要验证
if (this.model && !this.model.validate()) { var model = null;
if (that.currCategory.mdiyModelId && String(that.currCategory.mdiyModelId )!="0"){
model = ms.mdiy.model.modelForm();
}
if (model && !model.validate()) {
this.activeName = 'custom-name'; this.activeName = 'custom-name';
return; return;
} }
@ -347,7 +366,7 @@
} }
//若缩略图为空则赋值为空串 //若缩略图为空则赋值为空串
if (that.form.contentImg.length == 0){ if (that.form.contentImg.length == 0){
that.form.contentImg = ""; that.form.contentImg = [];
} }
this.$refs.form[0].validate(function (valid) { this.$refs.form[0].validate(function (valid) {
@ -367,9 +386,9 @@
ms.http.post(url, data).then(function (data) { ms.http.post(url, data).then(function (data) {
if (data.result) { if (data.result) {
//保存时需要赋值关联ID //保存时需要赋值关联ID
if (that.model) { if (model) {
that.model.form.linkId = data.data.id; model.form.linkId = data.data.id;
that.model.save(); model.save();
} }
that.$notify({ that.$notify({
title: '成功', title: '成功',
@ -589,7 +608,7 @@
contentImghandleExceed: function (files, fileList) { contentImghandleExceed: function (files, fileList) {
this.$notify({ this.$notify({
title: '失败', title: '失败',
message: '当前最多上传1个文件', message: '当前最多上传10个文件',
type: 'warning' type: 'warning'
}); });
}, },

@ -364,15 +364,18 @@
save: function (id) { save: function (id) {
//id有值时编辑 //id有值时编辑
if (id) { if (id) {
location.href = this.manager + "/cms/content/form.do?id=" + id; // location.href = this.manager + "/cms/content/form.do?id=" + id;
ms.util.openSystemUrl("/cms/content/form.do?id=" + id);
}else { }else {
//根据当前栏目新增时自动选中栏目 //根据当前栏目新增时自动选中栏目
var categoryId = this.form.categoryId; var categoryId = this.form.categoryId;
if (categoryId) { if (categoryId) {
location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId; // location.href = this.manager + "/cms/content/form.do?categoryId=" + this.form.categoryId;
ms.util.openSystemUrl("/cms/content/form.do?categoryId=" + this.form.categoryId);
}else { }else {
//如果栏目id没有值就单纯的新增,不自动选定栏目 //如果栏目id没有值就单纯的新增,不自动选定栏目
location.href = this.manager + "/cms/content/form.do"; // location.href = this.manager + "/cms/content/form.do";
ms.util.openSystemUrl("/cms/content/form.do");
} }
} }
}, },

@ -9,10 +9,10 @@
</style> </style>
</head> </head>
<body class="custom-body"> <body class="custom-body">
<div id="app" v-cloak> <div id="app" class="ms-index" v-cloak>
<el-form ref="form" label-width="100px" size="mini"> <el-form ref="form" label-width="100px" size="mini">
<div class="class-2" > <div class="class-2" >
<div class="class-3" > <div class="class-3 panel" >
<div class="class-4" > <div class="class-4" >
<el-form-item label="主页模板" > <el-form-item label="主页模板" >
<el-select v-model="template" <el-select v-model="template"
@ -23,7 +23,7 @@
:label="item"></el-option> :label="item"></el-option>
</el-select> </el-select>
<div class="ms-form-tip"> <div class="ms-form-tip">
一般选择<i>index.htm</i>模 一般选择<i>index.htm</i>模
</div> </div>
</el-form-item> </el-form-item>
</div> </div>
@ -37,10 +37,10 @@
</el-input> </el-input>
<div class="ms-form-tip"> <div class="ms-form-tip">
一般为index.html或default.html, 一般为index.html或default.html,
如果是<i>引导页面->首页</i>,可以手动调整主页模与主页设置,先生成引导页,再生成首页。一般default.html为引导页面index.html为主页(需要服务器容器配置好对应默认页)。<br/> 如果是<i>引导页面->首页</i>,可以手动调整主页模与主页设置,先生成引导页,再生成首页。一般default.html为引导页面index.html为主页(需要服务器容器配置好对应默认页)。<br/>
点击“预览主页”可跳转到网站首页进行预览网站首页<br/> 点击“预览主页”可跳转到网站首页进行预览网站首页<br/>
不能选择有分页标签的页面生成,例如news-list.htm、search.htm<br/> 不能选择有分页标签的页面生成,例如news-list.htm、search.htm<br/>
如果下拉没有出现模版,请检查应用设置是否绑定了模版<br/> 如果下拉没有出现模板,请检查应用设置是否绑定了模板<br/>
</div> </div>
</el-form-item> </el-form-item>
</div> </div>
@ -53,7 +53,7 @@
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div class="class-13" > <div class="class-13 panel" >
<div class="class-14" > <div class="class-14" >
<el-form-item label="文章栏目"> <el-form-item label="文章栏目">
<ms-tree-select v-model="contentSection" <ms-tree-select v-model="contentSection"
@ -96,7 +96,7 @@
</div> </div>
</div> </div>
<div class="class-23" > <div class="class-23 panel" >
<div class="class-24" > <div class="class-24" >
<el-form-item label="生成栏目"> <el-form-item label="生成栏目">
<ms-tree-select v-model="section" <ms-tree-select v-model="section"
@ -276,6 +276,14 @@
}); });
</script> </script>
<style> <style>
#app {
background-color: white;
}
#app .panel {
background-color: white;
padding: 20px 40px 20px 40px;
border: 1px solid #EBEEF5;
}
input{ input{
width: 100%!important; width: 100%!important;
} }

File diff suppressed because it is too large Load Diff

@ -161,4 +161,7 @@ textarea::-webkit-input-placeholder {
margin-bottom: unset !important; margin-bottom: unset !important;
overflow-x: hidden!important; overflow-x: hidden!important;
} }
/*上传+号位置*/
.el-upload--picture-card i {
line-height: unset !important;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -520,6 +520,20 @@ module.exports = function (it) {
}; };
/***/ }),
/***/ "22a0":
/***/ (function(module, exports, __webpack_require__) {
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".el-scrollbar .el-scrollbar__view .el-select-dropdown__item[data-v-898189e8]{height:auto;max-height:274px;padding:0;overflow:hidden;overflow-y:auto}.el-select-dropdown__item.selected[data-v-898189e8]{font-weight:400}ul li[data-v-898189e8] .el-tree .el-tree-node__content{height:auto;padding:0 20px}.el-tree-node__label[data-v-898189e8]{font-weight:400}.el-tree[data-v-898189e8] .is-current .el-tree-node__label{color:#409eff;font-weight:700}.el-tree[data-v-898189e8] .is-current .el-tree-node__children .el-tree-node__label{color:#606266;font-weight:400}", ""]);
// Exports
module.exports = exports;
/***/ }), /***/ }),
/***/ "23cb": /***/ "23cb":
@ -1734,20 +1748,6 @@ module.exports = function (argument) {
}; };
/***/ }),
/***/ "522a":
/***/ (function(module, exports, __webpack_require__) {
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".el-scrollbar .el-scrollbar__view .el-select-dropdown__item[data-v-1a21ca58]{height:auto;max-height:274px;padding:0;overflow:hidden;overflow-y:auto}.el-select-dropdown__item.selected[data-v-1a21ca58]{font-weight:400}ul li[data-v-1a21ca58] .el-tree .el-tree-node__content{height:auto;padding:0 20px}.el-tree-node__label[data-v-1a21ca58]{font-weight:400}.el-tree[data-v-1a21ca58] .is-current .el-tree-node__label{color:#409eff;font-weight:700}.el-tree[data-v-1a21ca58] .is-current .el-tree-node__children .el-tree-node__label{color:#606266;font-weight:400}", ""]);
// Exports
module.exports = exports;
/***/ }), /***/ }),
/***/ "5270": /***/ "5270":
@ -1891,22 +1891,6 @@ module.exports = function (argument) {
}; };
/***/ }),
/***/ "59bf":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("522a");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("39b28dcf", content, true, {"sourceMap":false,"shadowMode":false});
/***/ }), /***/ }),
/***/ "59ed": /***/ "59ed":
@ -2300,6 +2284,17 @@ module.exports = function buildFullPath(baseURL, requestedURL) {
}; };
/***/ }),
/***/ "8502":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ms_tree_select_vue_vue_type_style_index_0_id_898189e8_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("d964");
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ms_tree_select_vue_vue_type_style_index_0_id_898189e8_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ms_tree_select_vue_vue_type_style_index_0_id_898189e8_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
/***/ }), /***/ }),
/***/ "861d": /***/ "861d":
@ -3474,17 +3469,6 @@ module.exports = function (it) {
}; };
/***/ }),
/***/ "cc4b":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ms_tree_select_vue_vue_type_style_index_0_id_1a21ca58_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("59bf");
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ms_tree_select_vue_vue_type_style_index_0_id_1a21ca58_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ms_tree_select_vue_vue_type_style_index_0_id_1a21ca58_prod_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
/***/ }), /***/ }),
/***/ "cdce": /***/ "cdce":
@ -3667,6 +3651,22 @@ module.exports = function isAbsoluteURL(url) {
}; };
/***/ }),
/***/ "d964":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("22a0");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("e9db61a6", content, true, {"sourceMap":false,"shadowMode":false});
/***/ }), /***/ }),
/***/ "d9b5": /***/ "d9b5":
@ -6649,8 +6649,8 @@ var ms_select_component = normalizeComponent(
) )
/* harmony default export */ var ms_select = (ms_select_component.exports); /* harmony default export */ var ms_select = (ms_select_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"01ea9f4c-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/ms-tree-select.vue?vue&type=template&id=1a21ca58&scoped=true& // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"01ea9f4c-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/ms-tree-select.vue?vue&type=template&id=898189e8&scoped=true&
var ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_render = function render() { var ms_tree_selectvue_type_template_id_898189e8_scoped_true_render = function render() {
var _vm = this, var _vm = this,
_c = _vm._self._c; _c = _vm._self._c;
return _c('el-select', { return _c('el-select', {
@ -6685,9 +6685,9 @@ var ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_render = function re
} }
})], 1)], 1); })], 1)], 1);
}; };
var ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_staticRenderFns = []; var ms_tree_selectvue_type_template_id_898189e8_scoped_true_staticRenderFns = [];
// CONCATENATED MODULE: ./src/components/form/ms-tree-select.vue?vue&type=template&id=1a21ca58&scoped=true& // CONCATENATED MODULE: ./src/components/form/ms-tree-select.vue?vue&type=template&id=898189e8&scoped=true&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/ms-tree-select.vue?vue&type=script&lang=js& // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/ms-tree-select.vue?vue&type=script&lang=js&
/* harmony default export */ var ms_tree_selectvue_type_script_lang_js_ = ({ /* harmony default export */ var ms_tree_selectvue_type_script_lang_js_ = ({
@ -6768,7 +6768,7 @@ var ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_staticRenderFns = []
this.$nextTick(function () { this.$nextTick(function () {
var scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0]; var scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0];
var scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar'); var scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar');
scrollWrap.style.cssText = 'margin: 0px; max-height: none; overflow: hidden;'; scrollWrap.style.cssText = 'margin: 0px; ';
scrollBar.forEach(function (ele) { scrollBar.forEach(function (ele) {
return ele.style.width = 0; return ele.style.width = 0;
}); });
@ -6811,8 +6811,8 @@ var ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_staticRenderFns = []
}); });
// CONCATENATED MODULE: ./src/components/form/ms-tree-select.vue?vue&type=script&lang=js& // CONCATENATED MODULE: ./src/components/form/ms-tree-select.vue?vue&type=script&lang=js&
/* harmony default export */ var form_ms_tree_selectvue_type_script_lang_js_ = (ms_tree_selectvue_type_script_lang_js_); /* harmony default export */ var form_ms_tree_selectvue_type_script_lang_js_ = (ms_tree_selectvue_type_script_lang_js_);
// EXTERNAL MODULE: ./src/components/form/ms-tree-select.vue?vue&type=style&index=0&id=1a21ca58&prod&scoped=true&lang=css& // EXTERNAL MODULE: ./src/components/form/ms-tree-select.vue?vue&type=style&index=0&id=898189e8&prod&scoped=true&lang=css&
var ms_tree_selectvue_type_style_index_0_id_1a21ca58_prod_scoped_true_lang_css_ = __webpack_require__("cc4b"); var ms_tree_selectvue_type_style_index_0_id_898189e8_prod_scoped_true_lang_css_ = __webpack_require__("8502");
// CONCATENATED MODULE: ./src/components/form/ms-tree-select.vue // CONCATENATED MODULE: ./src/components/form/ms-tree-select.vue
@ -6825,11 +6825,11 @@ var ms_tree_selectvue_type_style_index_0_id_1a21ca58_prod_scoped_true_lang_css_
var ms_tree_select_component = normalizeComponent( var ms_tree_select_component = normalizeComponent(
form_ms_tree_selectvue_type_script_lang_js_, form_ms_tree_selectvue_type_script_lang_js_,
ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_render, ms_tree_selectvue_type_template_id_898189e8_scoped_true_render,
ms_tree_selectvue_type_template_id_1a21ca58_scoped_true_staticRenderFns, ms_tree_selectvue_type_template_id_898189e8_scoped_true_staticRenderFns,
false, false,
null, null,
"1a21ca58", "898189e8",
null null
) )

File diff suppressed because one or more lines are too long

@ -8,7 +8,7 @@
<meta name="description" content="{ms:global.descrip/}"> <meta name="description" content="{ms:global.descrip/}">
<script type="text/javascript" src="{ms:global.host/}/static/plugins/vue/2.6.9/vue.min.js"></script> <script type="text/javascript" src="{ms:global.host/}/static/plugins/vue/2.6.9/vue.min.js"></script>
<link rel="stylesheet" href="{ms:global.host/}/static/plugins/minireset/0.0.2/minireset.min.css"> <link rel="stylesheet" href="{ms:global.host/}/static/plugins/minireset/0.0.2/minireset.min.css">
<link rel="stylesheet" href="{ms:global.host/}/iconfont/1.0.0/iconfont.css"> <link rel="stylesheet" href="{ms:global.host/}/static/plugins/iconfont/1.0.0/iconfont.css">
<link rel="stylesheet" href="{ms:global.host/}/static/plugins/animate/4.1.0/animate.min.css"> <link rel="stylesheet" href="{ms:global.host/}/static/plugins/animate/4.1.0/animate.min.css">
<script src="{ms:global.host/}/static/plugins/element-ui/2.15.7/index.min.js"></script> <script src="{ms:global.host/}/static/plugins/element-ui/2.15.7/index.min.js"></script>
<link rel="stylesheet" href="{ms:global.host/}/static/plugins/element-ui/2.15.7/theme-chalk/index.min.css"> <link rel="stylesheet" href="{ms:global.host/}/static/plugins/element-ui/2.15.7/theme-chalk/index.min.css">

@ -4,7 +4,7 @@
<div class="body"> <div class="body">
<div class="logo"> <div class="logo">
<img title="" alt="" src="{ms:global.host/}/{@ms:file global.logo/}" class="logo-pic"> <img title="" alt="" src="{ms:global.host/}/{@ms:file global.logo/}" class="logo-pic">
<img title="" alt="" src="https://www.mingsoft.net//template/1/ms/images/1596437934982.png" class="logo-desc"> <img title="" alt="" src="https://www.mingsoft.net/static/images/logo_text.png" class="logo-desc">
</div> </div>
<div @click="switchShow([&quot;1605172743000_96378&quot;]);" class="nav-h5"> <div @click="switchShow([&quot;1605172743000_96378&quot;]);" class="nav-h5">
<i class="iconfont icon-caidan nav-h5-icon"></i> <i class="iconfont icon-caidan nav-h5-icon"></i>

Loading…
Cancel
Save