fix: 规范模版、规范接口、修复issues BUG

master
mingsoft 4 years ago
parent af449b4c8c
commit f78bbc93bd
  1. 83
      src/main/java/net/mingsoft/basic/action/web/EditorAction.java
  2. 134
      src/main/java/net/mingsoft/cms/action/CategoryAction.java
  3. 86
      src/main/java/net/mingsoft/cms/action/ContentAction.java
  4. 27
      src/main/java/net/mingsoft/cms/action/web/CategoryAction.java
  5. 34
      src/main/java/net/mingsoft/cms/action/web/ContentAction.java
  6. 8
      src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
  7. 2
      src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
  8. 29
      src/main/java/net/mingsoft/cms/dao/IContentDao.xml
  9. 54
      src/main/java/net/mingsoft/config/WebConfig.java
  10. 2
      src/main/webapp/WEB-INF/manager/cms/content/form.ftl
  11. 896
      src/main/webapp/WEB-INF/manager/index.ftl
  12. 2
      src/main/webapp/template/1/default/about.htm
  13. 60
      src/main/webapp/template/1/default/index.htm
  14. 443
      src/main/webapp/template/1/default/message.htm
  15. 44
      src/main/webapp/template/1/default/nav.htm
  16. 1189
      src/main/webapp/template/1/default/news-detail.htm
  17. 2
      src/main/webapp/template/1/default/news-list.htm
  18. 2
      src/main/webapp/template/1/default/product-detail.htm
  19. 2
      src/main/webapp/template/1/default/product-list.htm
  20. 2
      src/main/webapp/template/1/default/search.htm

@ -1,83 +0,0 @@
/**
* The MIT License (MIT)
* Copyright (c) 2012-2022 铭软科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package net.mingsoft.basic.action.web;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mingsoft.ueditor.MsUeditorActionEnter;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.config.MSProperties;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 临时修复百度编辑器上传会在下一版本合并
*
* @author 铭软开发团队
* @date 2019年7月16日
* 历史修订 2022-1-21 新增normalize(),
* editor()方法过滤非法上传路径
*/
@ApiIgnore
@Controller("ueAction")
@RequestMapping("/static/plugins/ueditor/{version}/jsp")
public class EditorAction {
@ResponseBody
@RequestMapping(value = "editor", method = {RequestMethod.GET, RequestMethod.POST})
public String editor(HttpServletRequest request, HttpServletResponse response, String jsonConfig) {
String uploadFloderPath = MSProperties.upload.path;
String rootPath = BasicUtil.getRealPath(uploadFloderPath);
jsonConfig = jsonConfig.replace("{ms.upload}", "/" + uploadFloderPath);
//过滤非法上传路径
Map<String, Object> map = (Map<String, Object>) JSONObject.parse(jsonConfig);
String imagePathFormat = (String) map.get("imagePathFormat");
imagePathFormat = FileUtil.normalize(imagePathFormat);
String filePathFormat = (String) map.get("filePathFormat");
filePathFormat = FileUtil.normalize(filePathFormat);
String videoPathFormat = (String) map.get("videoPathFormat");
videoPathFormat = FileUtil.normalize(videoPathFormat);
map.put("imagePathFormat", imagePathFormat);
map.put("filePathFormat", filePathFormat);
map.put("videoPathFormat", videoPathFormat);
jsonConfig = JSONObject.toJSONString(map);
MsUeditorActionEnter actionEnter = new MsUeditorActionEnter(request, rootPath, jsonConfig, BasicUtil.getRealPath(""));
String json = actionEnter.exec();
Map jsonMap = JSON.parseObject(json,Map.class);
jsonMap.put("url","/".concat(uploadFloderPath).concat(jsonMap.get("url")+""));
return JSONObject.toJSONString(jsonMap);
}
}

@ -42,12 +42,9 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -70,44 +67,26 @@ public class CategoryAction extends BaseAction {
/**
* 返回主界面index
* @return
*/
@GetMapping("/index")
public String index(HttpServletResponse response,HttpServletRequest request){
public String index(){
return "/cms/category/index";
}
/**
* 查询分类列表
* @param category 分类实体
* 查询分类列表接口
* @param category 栏目实体
* @return
*/
@ApiOperation(value = "查询分类列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryType", value = "栏目管理属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categorySort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryUrl", value = "内容模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryImg", value = "缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required =false,paramType="query"),
@ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDatetime", value = "类别发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "dictId", value = "字典对应编号", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping(value="/list",method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) {
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) {
BasicUtil.startPage();
List categoryList = categoryBiz.query(category);
return ResultData.build().success(new EUListBean(categoryList,(int) BasicUtil.endPage(categoryList).getTotal()));
@ -115,9 +94,11 @@ public class CategoryAction extends BaseAction {
/**
* 返回编辑界面category_form
* @param category 栏目
* @return
*/
@GetMapping("/form")
public String form(@ModelAttribute CategoryEntity category, HttpServletResponse response, HttpServletRequest request, ModelMap model){
public String form(@ModelAttribute CategoryEntity category, ModelMap model){
model.addAttribute("appId", BasicUtil.getApp().getAppId());
return "/cms/category/form";
}
@ -130,7 +111,7 @@ public class CategoryAction extends BaseAction {
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
@GetMapping("/get")
@ResponseBody
public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model){
public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category){
if(category.getId()==null) {
return ResultData.build().error();
}
@ -138,41 +119,36 @@ public class CategoryAction extends BaseAction {
return ResultData.build().success(_category);
}
@ApiOperation(value = "保存分类列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =true,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryType", value = "栏目管理属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categorySort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryUrl", value = "内容模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryImg", value = "缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required =false,paramType="query"),
@ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDatetime", value = "类别发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "dictId", value = "字典对应编号", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
/**
* 保存分类
* @param category 分类实体
*/
@ApiOperation(value = "保存分类列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =true,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryType", value = "栏目管理属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categorySort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryUrl", value = "内容模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryImg", value = "缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required =false,paramType="query"),
@ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDatetime", value = "类别发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "dictId", value = "字典对应编号", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required =false,paramType="query"),
})
@PostMapping("/save")
@ResponseBody
@LogAnn(title = "保存分类", businessType = BusinessTypeEnum.INSERT)
@RequiresPermissions("cms:category:save")
public ResultData save(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request) {
public ResultData save(@ModelAttribute @ApiIgnore CategoryEntity category) {
//验证栏目管理名称的值是否合法
if(StringUtil.isBlank(category.getCategoryTitle())){
return ResultData.build().error(getResString("err.empty", this.getResString("category.title")));
@ -202,19 +178,26 @@ public class CategoryAction extends BaseAction {
}
/**
* @param categorys 分类实体
* 批量删除分类列表接口
* @param categorys
* @return
*/
@ApiOperation(value = "批量删除分类列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "categorys", value = "删除的栏目集合", allowMultiple = true, dataType = "CategoryEntity", required = true)
})
@PostMapping("/delete")
@ResponseBody
@LogAnn(title = "删除分类", businessType = BusinessTypeEnum.DELETE)
@RequiresPermissions("cms:category:del")
public ResultData delete(@RequestBody List<CategoryEntity> categorys, HttpServletResponse response, HttpServletRequest request) {
public ResultData delete(@RequestBody List<CategoryEntity> categorys) {
for(int i = 0;i<categorys.size();i++){
categoryBiz.delete(categorys.get(i).getId());
}
return ResultData.build().success();
}
/**
* 更新分类列表
* @param category 分类实体
@ -238,19 +221,12 @@ public class CategoryAction extends BaseAction {
@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@PostMapping("/update")
@ResponseBody
@LogAnn(title = "更新分类", businessType = BusinessTypeEnum.UPDATE)
@RequiresPermissions("cms:category:update")
public ResultData update(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response,
HttpServletRequest request) {
public ResultData update(@ModelAttribute @ApiIgnore CategoryEntity category) {
//验证栏目管理名称的值是否合法
if(StringUtil.isBlank(category.getCategoryTitle())){
return ResultData.build().error(getResString("err.empty", this.getResString("category.title")));
@ -307,10 +283,19 @@ public class CategoryAction extends BaseAction {
return ResultData.build().success(category);
}
/**
* 验证拼音
* @param category 栏目
* @return
*/
@ApiOperation(value = "验证拼音")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query"),
@ApiImplicitParam(name = "categoryPinyin", value = "栏目管拼音", required =true,paramType="query"),
})
@GetMapping("/verifyPingYin")
@ResponseBody
public ResultData verifyPingYin(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model){
public ResultData verifyPingYin(@ModelAttribute @ApiIgnore CategoryEntity category){
int count = categoryBiz.count(Wrappers.<CategoryEntity>lambdaQuery()
.ne(StrUtil.isNotBlank(category.getId()), CategoryEntity::getId, category.getId())
.eq(CategoryEntity::getCategoryPinyin, category.getCategoryPinyin()));
@ -321,7 +306,16 @@ public class CategoryAction extends BaseAction {
return ResultData.build().success();
}
/**
* 批量更新模版
* @param category 栏目实体
* @return
*/
@ApiOperation(value = "批量更新模版")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query"),
@ApiImplicitParam(name = "dictId", value = "字典", required =true,paramType="query")
})
@GetMapping("/updateTemplate")
@ResponseBody
@RequiresPermissions("cms:category:update")
@ -343,7 +337,15 @@ public class CategoryAction extends BaseAction {
return ResultData.build().success();
}
/**
* 复制栏目
* @param category 栏目实体
* @return
*/
@ApiOperation(value = "复制栏目")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
})
@GetMapping("/copyCategory")
@ResponseBody
@RequiresPermissions("cms:category:save")

@ -85,14 +85,15 @@ public class ContentAction extends BaseAction {
* 返回主界面index
*/
@GetMapping("/index")
public String index(HttpServletResponse response,HttpServletRequest request){
public String index(){
return "/cms/content/index";
}
/**
* 返回主界面main
*/
@GetMapping("/main")
public String main(HttpServletResponse response,HttpServletRequest request){
public String main(){
return "/cms/content/main";
}
@ -109,23 +110,10 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "contentImg", value = "文章缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "appid", value = "文章管理的应用id", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@PostMapping("/list")
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) {
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content) {
BasicUtil.startPage();
List contentList = contentBiz.query(content);
return ResultData.build().success(new EUListBean(contentList,(int) BasicUtil.endPage(contentList).getTotal()));
@ -135,7 +123,7 @@ public class ContentAction extends BaseAction {
* 返回编辑界面content_form
*/
@GetMapping("/form")
public String form(@ModelAttribute ContentEntity content, HttpServletResponse response, HttpServletRequest request, ModelMap model){
public String form(@ModelAttribute ContentEntity content, ModelMap model){
model.addAttribute("appId", BasicUtil.getApp().getAppId());
return "/cms/content/form";
}
@ -144,17 +132,18 @@ public class ContentAction extends BaseAction {
* 获取文章
* @param content 文章实体
*/
@ApiOperation(value = "获取文章列表接口")
@ApiOperation(value = "获取文章详情接口")
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
@GetMapping("/get")
@ResponseBody
public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model){
public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content){
if(content.getId()==null) {
return ResultData.build().error();
}
ContentEntity _content = contentBiz.getById(content.getId());
return ResultData.build().success(_content);
}
/**
* 获取文章
* @param content 文章实体
@ -174,39 +163,33 @@ public class ContentAction extends BaseAction {
return ResultData.build().success(list.size() > 0 ? list.get(0) : null);
}
@ApiOperation(value = "保存文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "contentTitle", value = "文章标题", required =true,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "contentType", value = "文章类型", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDisplay", value = "是否显示", required =false,paramType="query"),
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =true,paramType="query"),
@ApiImplicitParam(name = "contentSort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "contentImg", value = "文章缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "appid", value = "文章管理的应用id", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
/**
* 保存文章
* @param content 文章实体
*/
@ApiOperation(value = "保存文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "contentTitle", value = "文章标题", required =true,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "contentType", value = "文章类型", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDisplay", value = "是否显示", required =false,paramType="query"),
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =true,paramType="query"),
@ApiImplicitParam(name = "contentSort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "contentImg", value = "文章缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
})
@PostMapping("/save")
@ResponseBody
@LogAnn(title = "保存文章", businessType = BusinessTypeEnum.INSERT)
@RequiresPermissions("cms:content:save")
public ResultData save(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response, HttpServletRequest request) {
public ResultData save(@ModelAttribute @ApiIgnore ContentEntity content) {
//验证文章标题的值是否合法
if(StringUtil.isBlank(content.getContentTitle())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.title")));
@ -235,11 +218,15 @@ public class ContentAction extends BaseAction {
* @param contents 文章实体
*/
@ApiOperation(value = "批量删除文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "contents", value = "文章集合", allowMultiple = true, dataType = "ContentEntity", required = true)
})
@PostMapping("/delete")
@ResponseBody
@LogAnn(title = "删除文章", businessType = BusinessTypeEnum.DELETE)
@RequiresPermissions("cms:content:del")
public ResultData delete(@RequestBody List<ContentEntity> contents, HttpServletResponse response, HttpServletRequest request) {
public ResultData delete(@RequestBody List<ContentEntity> contents) {
List<String> ids = new ArrayList<>();
for(int i = 0;i<contents.size();i++){
ids.add(contents.get(i).getId());
@ -260,6 +247,7 @@ public class ContentAction extends BaseAction {
contentBiz.removeByIds(ids);
return ResultData.build().success();
}
/**
* 更新文章列表
* @param content 文章实体
@ -280,20 +268,12 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "appid", value = "文章管理的应用id", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@PostMapping("/update")
@ResponseBody
@LogAnn(title = "更新文章", businessType = BusinessTypeEnum.UPDATE)
@RequiresPermissions("cms:content:update")
public ResultData update(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response,
HttpServletRequest request) {
public ResultData update(@ModelAttribute @ApiIgnore ContentEntity content) {
//验证文章标题的值是否合法
if(StringUtil.isBlank(content.getContentTitle())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.title")));

@ -66,31 +66,10 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@ApiOperation(value = "查询分类列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryType", value = "栏目管理属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categorySort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryUrl", value = "内容模板", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryImg", value = "缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required =false,paramType="query"),
@ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryDatetime", value = "类别发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "dictId", value = "字典对应编号", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@RequestMapping(value="/list",method = {RequestMethod.GET, RequestMethod.POST})
@PostMapping(value="/list")
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model,BindingResult result) {
public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) {
BasicUtil.startPage();
List categoryList = categoryBiz.query(category);
return ResultData.build().success(new EUListBean(categoryList,(int)BasicUtil.endPage(categoryList).getTotal()));
@ -105,7 +84,7 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
@GetMapping("/get")
@ResponseBody
public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model){
public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category){
if(category.getId()==null) {
return ResultData.build().error();
}

@ -69,8 +69,9 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
private IHistoryLogBiz historyLogBiz;
/**
* 查询文章列表
* @param content 文章实体
* 查询文章列表接口
* @param content 文章
* @return
*/
@ApiOperation(value = "查询文章列表接口")
@ApiImplicitParams({
@ -81,23 +82,10 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "contentImg", value = "文章缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "appid", value = "文章管理的应用id", required =false,paramType="query"),
@ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"),
@ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"),
@ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"),
@ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"),
@ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"),
@ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"),
})
@PostMapping("/list")
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) {
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content) {
BasicUtil.startPage();
List contentList = contentBiz.query(content);
return ResultData.build().success(new EUListBean(contentList,(int)BasicUtil.endPage(contentList).getTotal()));
@ -105,14 +93,15 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
/**
* 获取文章
* @param content 文章实体
* 获取文章列表接口
* @param content 文章
* @return
*/
@ApiOperation(value = "获取文章列表接口")
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
@GetMapping("/get")
@ResponseBody
public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model){
public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content){
if(content.getId()==null) {
return ResultData.build().error();
}
@ -120,11 +109,16 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
return ResultData.build().success(_content);
}
/**
* 查看文章点击数
* @param contentId 文章编号
* @return
*/
@ApiOperation(value = "查看文章点击数")
@ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path")
@GetMapping(value = "/{contentId}/hit")
@ResponseBody
public String hit(@PathVariable @ApiIgnore String contentId, HttpServletRequest request, HttpServletResponse response){
public String hit(@PathVariable @ApiIgnore String contentId) {
if(StringUtils.isEmpty(contentId)){
return "document.write(0)";
}

@ -151,10 +151,10 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
map.put(k, v.toString().replaceAll("('|\"|\\\\)", "\\\\$1"));
});
//获取栏目编号
int typeId = BasicUtil.getInt(ParserUtil.TYPE_ID, 0);
String typeId = BasicUtil.getString(ParserUtil.TYPE_ID);
int size = BasicUtil.getInt("size", 10);
ContentBean contentBean = new ContentBean();
contentBean.setCategoryId(String.valueOf(typeId));
contentBean.setCategoryId(typeId);
//获取文章总数
List<CategoryBean> columnArticles = contentBiz.queryIdsByCategoryIdForParser(contentBean);
//判断栏目下是否有文章
@ -203,7 +203,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
@ResponseBody
public String view(String orderby, String order, HttpServletRequest req, HttpServletResponse resp) {
//参数文章编号
ContentEntity article = (ContentEntity) contentBiz.getEntity(BasicUtil.getInt(ParserUtil.ID));
ContentEntity article = contentBiz.getById(BasicUtil.getString(ParserUtil.ID));
if (ObjectUtil.isNull(article)) {
throw new BusinessException(this.getResString("err.empty", this.getResString("id")));
}
@ -219,7 +219,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
//用于详情上下页获取当前文章列表对应的分类,根据文章查询只能获取自身分类
String typeId = BasicUtil.getString(ParserUtil.TYPE_ID, article.getCategoryId());
//根据文章编号查询栏目详情模版
CategoryEntity column = (CategoryEntity) categoryBiz.getEntity(Integer.parseInt(typeId));
CategoryEntity column = categoryBiz.getById(typeId);
//解析后的内容
String content = "";
Map map = BasicUtil.assemblyRequestMap();

@ -106,7 +106,7 @@
</if>
and
(
find_in_set('${id}',CATEGORY_PARENT_IDS)>0
find_in_set(#{id},CATEGORY_PARENT_IDS)>0
or id=#{id}
)
and del=0

@ -63,7 +63,6 @@
<result column="category_img" property="categoryImg" /><!--缩略图 -->
<result column="category_diy_url" property="categoryDiyUrl" /><!--自定义链接 -->
<result column="mdiy_model_id" property="mdiyModelId" /><!--栏目管理的内容模型id -->
<result column="category_datetime" property="categoryDatetime" /><!--类别发布时间 -->
<result column="dict_id" property="dictId" /><!--字典对应编号 -->
<result column="category_flag" property="categoryFlag" /><!--栏目属性 -->
<result column="category_path" property="categoryPath" /><!--栏目路径 -->
@ -182,25 +181,25 @@
</select>
<!--删除-->
<!--删除 防止脏数据-->
<delete id="deleteEntity" parameterType="int">
update cms_content set del=1 where id=#{id}
delete from cms_content where id=#{id}
</delete>
<!--删除-->
<!--删除 防止脏数据-->
<delete id="deleteEntityByCategoryIds" >
update cms_content set del=1
delete from cms_content
<where>
category_id in <foreach collection="ids" item="item" index="index"
category_id in <foreach collection="ids" item="item" index="index"
open="(" separator="," close=")">#{item}</foreach>
</where>
</delete>
<!--批量删除-->
<delete id="delete" >
update cms_content set del=1
delete from cms_content
<where>
id in <foreach collection="ids" item="item" index="index"
id in <foreach collection="ids" item="item" index="index"
open="(" separator="," close=")">#{item}</foreach>
</where>
</delete>
@ -218,12 +217,12 @@
ct.del=0
<if test="contentTitle != null and contentTitle != ''"> and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')</if>
<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 != ''">
and
<foreach item="item" index="index" collection="contentType.split(',')" open="(" separator="or"
close=")">
FIND_IN_SET('${item}',ct.content_type)>0
FIND_IN_SET(#{item},ct.content_type)>0
</foreach>
</if>
<if test="contentDisplay != null and contentDisplay != ''"> and content_display=#{contentDisplay}</if>
@ -257,7 +256,7 @@
<!-- 查询子栏目数据 -->
<if test="categoryId!=null and categoryId!='' and categoryType==1">
and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)>0))
(select id FROM cms_category where find_in_set(#{categoryId},CATEGORY_PARENT_IDS)>0))
</if>
<if test="categoryId!=null and categoryId!='' and categoryType==2">
and ct.category_id=#{categoryId}
@ -308,7 +307,7 @@
left join cms_category c
ON a.category_id
= c.id
<if test="tableName!=null and tableName!='' and diyMap!=null">left join ${tableName} d on d.link_id=a.id
<if test="tableName!=null and tableName!='' and diyList!=null">left join ${tableName} d on d.link_id=a.id
</if>
<where>
a.del=0
@ -326,7 +325,7 @@
</if>
<if test="map.content_type!=null">
and <foreach item="item" index="index" collection="map.content_type.split(',')" open="(" separator="or" close=")">
FIND_IN_SET('${item}',a.content_type)>0
FIND_IN_SET(#{item},a.content_type)>0
</foreach>
</if>
<if test="map.content_description!=null">
@ -347,10 +346,10 @@
and a.content_datetime &lt; to_date(#{map.content_datetime_end}, 'yyyy-mm-dd hh24:mi:ss')
</if>
</if>
<if test="tableName!=null and tableName!='' and diyMap!=null">
<if test="tableName!=null and tableName!='' and diyList!=null">
<foreach item="item" index="index" collection="diyList" open=""
separator="" close="">
and d.${field.key} like CONCAT(CONCAT('%',#{item.value}),'%')
and d.${item.key} like CONCAT(CONCAT('%',#{item.value}),'%')
</foreach>
</if>
</where>

@ -21,12 +21,20 @@
package net.mingsoft.config;
import cn.hutool.core.util.StrUtil;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.mingsoft.basic.filter.XSSEscapeFilter;
import net.mingsoft.basic.interceptor.ActionInterceptor;
import net.mingsoft.mdiy.biz.IConfigBiz;
import net.mingsoft.mdiy.entity.ConfigEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
@ -41,6 +49,7 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -52,6 +61,8 @@ import java.util.concurrent.TimeUnit;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired(required = false)
private IConfigBiz configBiz;
@Bean
public ActionInterceptor actionInterceptor() {
@ -84,19 +95,20 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String uploadMapping = MSProperties.upload.mapping;
String uploadFloderPath = MSProperties.upload.path;
String uploadFolderPath = MSProperties.upload.path;
String template = MSProperties.upload.template;
String htmlDir = MSProperties.htmlDir;
registry.addResourceHandler(uploadMapping).addResourceLocations(File.separator + uploadFloderPath + File.separator, "file:" + uploadFloderPath + File.separator);
registry.addResourceHandler("/template/**").addResourceLocations(File.separator + template + File.separator, "file:" + template + File.separator);
// 上传路径映射 这里的映射不能使用File.separator Windows会存在映射问题
registry.addResourceHandler(uploadMapping).addResourceLocations("/" + uploadFolderPath + "/", "file:" + uploadFolderPath + "/");
registry.addResourceHandler("/" + template + "/**").addResourceLocations("/" + template + "/", "file:" + template + "/");
registry.addResourceHandler("/"+htmlDir+"/**").addResourceLocations("/"+htmlDir+"/", "file:"+htmlDir+"/");
//三种映射方式 webapp下、当前目录下、jar内
registry.addResourceHandler("/app/**").addResourceLocations("/app/", "file:app/", "classpath:/app/");
registry.addResourceHandler("/static/**").addResourceLocations("/static/", "file:static/", "classpath:/static/", "classpath:/META-INF/resources/");
registry.addResourceHandler("/api/**").addResourceLocations("/api/", "file:api/", "classpath:/api/");
if (new File(uploadFloderPath).isAbsolute()) {
if (new File(uploadFolderPath).isAbsolute()) {
//如果指定了绝对路径,上传的文件都映射到uploadMapping下
registry.addResourceHandler(uploadMapping).addResourceLocations("file:" + uploadFloderPath + File.separator
registry.addResourceHandler(uploadMapping).addResourceLocations("file:" + uploadFolderPath + "/"
//映射其他路径文件
//,file:F://images
);
@ -117,19 +129,27 @@ public class WebConfig implements WebMvcConfigurer {
//XSS过滤器
@Bean
public FilterRegistrationBean xssFilterRegistration() {
public FilterRegistrationBean xssFilterRegistration(@Value("${ms.xss.xssEnable:false}") boolean xssEnable,
@Value("${ms.xss.filterUrl}") String filterUrl,
@Value("${ms.xss.excludeUrl}") String excludeUrl) {
XSSEscapeFilter xssFilter = new XSSEscapeFilter();
Map<String, String> initParameters = new HashMap();
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setName("XSSFilter");
registration.addUrlPatterns("/*");
registration.setOrder(Ordered.HIGHEST_PRECEDENCE);
xssFilter.includes.add(".*/search.do");
Map<String, String> initParameters = new HashMap();
boolean enable = true;
registration.addUrlPatterns(new String[]{"/*"});
registration.setOrder(-2147483648);
xssFilter.includes.add("/**");
xssFilter.excludes.add(MSProperties.manager.path + "/**");
if (filterUrl != null && StrUtil.isNotBlank(filterUrl.toString())) {
xssFilter.includes.addAll(Arrays.asList(filterUrl.toString().split(",")));
}
if (excludeUrl != null && StrUtil.isNotBlank(excludeUrl.toString())) {
xssFilter.excludes.addAll(Arrays.asList(excludeUrl.toString().split(",")));
}
initParameters.put("isIncludeRichText", "false");
registration.setInitParameters(initParameters);
registration.setFilter(xssFilter);
registration.setEnabled(enable);
registration.setEnabled(xssEnable);
return registration;
}
@ -184,5 +204,15 @@ public class WebConfig implements WebMvcConfigurer {
return pool;
}
public Map getMap(String configName) {
if (!StringUtils.isEmpty(configName) && !StringUtils.isEmpty(configName)) {
ConfigEntity configEntity = new ConfigEntity();
configEntity.setConfigName(configName);
configEntity = (ConfigEntity)this.configBiz.getOne(new QueryWrapper(configEntity));
return configEntity != null && !StringUtils.isEmpty(configEntity.getConfigData()) ? (Map) JSON.parseObject(configEntity.getConfigData(), HashMap.class) : null;
} else {
return null;
}
}
}

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>文章1</title>
<title>文章</title>
<#include "../../include/head-file.ftl">
<script src="${base}/static/mdiy/index.js"></script>
</head>

@ -1,819 +1,97 @@
<!-- 主页 -->
<!DOCTYPE html>
<html>
<head>
<title>${app.appName}</title>
<#include '/include/head-file.ftl'/>
<script src="${base}/static/plugins/ms/2.0/ms-manager.umd.js"></script>
<script src="${base}/static/plugins/sockjs/1.4.0/sockjs.min.js"></script>
<script src="${base}/static/plugins/stomp/2.3.3/stomp.min.js"></script>
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
<script src="https://cdn.mingsoft.net/platform/ms-store.umd.min.js"></script>
<style>
.to-ele {
font-size: 18px;
margin: -2px 9px 0px 3px
}
</style>
<meta charset="UTF-8">
<script src="https://unpkg.com/vue@next"></script>
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
<!-- import JavaScript -->
<script src="https://unpkg.com/element-plus"></script>
</head>
<body>
<#include 'reset-password.ftl'/>
<div id="app" class="index" :class="theme">
<el-container>
<!--左侧菜单-->
<el-aside class="ms-admin-menu-aside" v-cloak>
<el-scrollbar style="height:100%">
<el-menu :default-active="asideMenuActive" class="el-menu-vertical-demo"
text-color="rgba(255,255,255,1)" active-text-color="rgba(255,255,255,1)"
:collapse="collapseMenu" :unique-opened='true' ref='menu'>
<div class="ms-admin-logo" :style="{display: 'flex','padding-left': (collapseMenu?'5px':'22px')}">
<img :src="ms.base+'/static/images/logo.png'"/>
<div class="class-1" v-show="!collapseMenu">
<div class="class-2">v</div>
5.2.7
</div>
</div>
<el-submenu :popper-class="['ms-admin-menu-aside-submenu',theme]" :index="menu.id+''"
:data-index="menu.id+''" v-for="(menu,i) in asideMenuList" :key='i'>
<template slot="title">
<i class='ms-admin-icon iconfont' :class="menu.modelIcon"></i>
<span>{{menu.modelTitle}}</span>
</template>
<!-- 子菜单 -->
<el-menu-item :index="sub.id+''" :data-index="sub.id"
v-for="(sub,index) in getSubMenu(menu.id)"
:key='sub.modelId' v-text="sub.modelTitle"
@click.self='open(sub)'></el-menu-item>
</el-submenu>
<!-- 当没有菜单显示时显示提示图片 -->
<img v-if="asideMenuList.length==0&&!state.menu" src="${base}/static/images/tip.png" />
<!-- 收缩按钮 -->
</el-menu>
</el-scrollbar>
</el-aside>
<#--右侧内容-->
<el-container class="ms-admin-container" v-cloak>
<!--头部-->
<el-header class="ms-admin-header" v-cloak>
<#--展示合并菜单-->
<div class="ms-admin-header-menu-shrink" @click="collapseMenu = !collapseMenu">
<i class="iconfont"
:class="collapseMenu?'icon-liebiaoxiangyou':'icon-shousuo'"></i>
</div>
<!--头部menu-->
<el-menu menu-trigger="hover" class="ms-admin-header-menu" :default-active="headMenuActive"
mode="horizontal">
<el-submenu style="height: 100%;">
<template slot="title">
<i class="iconfont icon-gezi" style="font-size: 17px;margin-right:8PX"></i>
<span>功能大全</span>
</template>
<div class="ms-admin-header-menu-all">
<li class="ms-admin-header-menu-all-item" v-for="(item,index) of parentMenuList"
:key='index' @click='openMenu(item,index)'>
<i class="iconfont" :class="item.modelIcon" style="padding-right: 4px"></i>
<div style="width:80px">{{item.modelTitle}}</div>
<div style="float: right;width: 18px;">
<template>
<i v-if="markList.find(function(x) {
return x.id == item.id
})!=undefined" @click="cancelMarkMenu(item)"
class='el-icon-star-on'></i>
<i v-else class='el-icon-star-off '
@click="markMenu(item)"></i>
</template>
</div>
</li>
</div>
</el-submenu>
</el-menu>
<!--头部右侧-->
<div class="ms-admin-header-right">
<!-- 主题切换 -->
<ms-switch-theme :theme.sync="theme"></ms-switch-theme>
<!-- 设置 -->
<ms-manager-icon :manager="managerInfo">
<template slot="reset-password">
<el-menu-item
style="display: flex;align-items: center" @click.native='openModal'>
<i class="el-icon-key"></i>
<span slot="title">修改密码</span>
</el-menu-item>
</template>
</ms-manager-icon>
<!--mstore按钮-->
<ms-store ref="storec" client="${client}"></ms-store>
</div>
</el-header>
<!--内容-->
<el-main class="ms-admin-main">
<!--选项卡-->
<el-tabs class="ms-admin-tabs" v-model="currentTab" type="card" closable @tab-remove="closeTab"
@tab-click='tabClick'>
<el-tab-pane v-for="(item, index) in editableTabs" :key="index" :label="item.modelTitle"
:name="item.id"
:data-id='item.id' :data-modelId='item.modelId'>
<keep-alive>
<iframe :src='item.modelUrl.indexOf("http")>-1?item.modelUrl:(item.isStore?item.modelUrl:ms.manager+"/"+item.modelUrl+(item.modelUrl.indexOf("?")==-1?"?":"&"))'
:ref="item.id" class="ms-loading"></iframe>
</keep-alive>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</el-container>
<div id="app">
<el-table :data="tableData" style="width: 100%">
<el-table-column fixed prop="date" label="Date" width="150" > </el-table-column>
<el-table-column prop="name" label="Name" width="120" > </el-table-column>
<el-table-column prop="state" label="State" width="120" > </el-table-column>
<el-table-column prop="city" label="City" width="120" > </el-table-column>
<el-table-column prop="address" label="Address" width="600" > </el-table-column>
<el-table-column prop="zip" label="Zip" width="120" > </el-table-column>
<el-table-column fixed="right" label="Operations" width="120">
</el-table-column>
</el-table>
<el-button type="text" @click="visible = true"
>click to open the Dialog</el-button
>
<el-dialog
v-model="visible"
title="Tips"
width="30%"
>
<span>This is a message</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">Cancel</el-button>
<el-button type="primary" @click="visible = false"
>Confirm</el-button
>
</span>
</template>
</el-dialog>
</div>
</body>
</html>
<script>
var indexVue = new Vue({
el: "#app",
data: {
code: '',
menuList: [], //菜单接口数据
asideMenuList: [], //侧边菜单
parentMenuList: [], //一级菜单
subMenuList: [], //二级菜单 所有
unreadTotal: 0,//未读消息数量
messageList: [],//消息列表
mainParentMenuList: [], //头部菜单显示主要的选项
loginDown: false, //登录下拉
asideMenuActive: "", //左侧选中菜单
headMenuActive: '', //头部菜单激活
editableTabsValue: '',
messageTypeList: [],
editableTabs: [{"modelTitle": "工作台","id": "0", "modelUrl": "main.do"}], //当前打开的tab页面
shortcutMenu: false, //快捷菜单显示状态
collapseMenu: false, //菜单折叠,false不折叠
currentTab: '0', //当前激活tab的name,初始值为工作台id
tabIndex: 1,
// 已标记菜单列表
markList: [],
//登录用户信息
managerInfo: {
managerName: '', //账号
managerNickName: '',
},
mstore: {},
//主题
theme: localStorage.getItem("theme") || 'ms-theme-light',
callbackFun: {},
//数据加载状态
state: {
menu: true
}
},
computed: {
messageType: function (type) {
var that = this
return function (type) {
var dict = that.messageTypeList.find(function (x) {
return x.dictValue == type;
});
if (dict) {
return dict.dictLabel;
}
return '';
}
}
},
watch: {
menuList: function (n, o) {
var that = this;
n && n.forEach(function (item, index) {
item.modelId ? that.subMenuList.push(item) : that.parentMenuList.push(item)
})
},
parentMenuList: function (n, o) {
var that = this
this.mainParentMenuList = n.slice(0, 5);
this.asideMenuList = n.filter(function (f) {
return that.markList.find(
function (x) {
return x.id == f.id
}) != undefined
})
},
editableTabs: {
handler: function (n, o) {
if (n.length) {
var that = this;
if (!document.querySelector('.el-icon-refresh')) {
var i = document.createElement('i');
i.className = "el-icon-refresh ms-admin-refresh"
i.title = "点击刷新当前页"
i.addEventListener('click', function () {
var index = null
Object.keys(that.$refs).forEach(function (item, i) {
item.indexOf(that.currentTab) > -1 ? index = i : ''
}, that)
if(that.$refs[Object.keys(that.$refs)[index]][0].contentDocument!=null) {
that.$refs[Object.keys(that.$refs)[index]][0].contentDocument.location.reload(true)
}
})
document.querySelector('.el-tabs__header').insertBefore(i, document.querySelector('.el-tabs__nav-wrap'))
}
} else {
if (document.querySelector('.ms-admin-refresh')) {
document.querySelector('.el-tabs__header').removeChild(document.querySelector('.ms-admin-refresh'))
}
}
},
deep: true
}
},
methods: {
markMenu: function (item) {
var menu = {
title: item.modelTitle,
icon: item.modelIcon,
id: item.id
}
this.markList.push(menu);
localStorage.setItem("markList", JSON.stringify(this.markList))
this.callbackFun();
},
cancelMarkMenu: function (item) {
var index = this.markList.findIndex(function (x) {
return x.id == item.id
});
this.markList.splice(index, 1);
localStorage.setItem("markList", JSON.stringify(this.markList))
this.callbackFun();
},
// 打开修改密码模态框
openModal: function () {
var that = this
if(event.target.innerText.indexOf('修改密码') > -1 ){
resetPasswordVue.resetPasswordForm.managerName = that.managerInfo.managerName
resetPasswordVue.isShow = true
} else {
this.exitSystem();
}
},
// 菜单列表
list: function () {
var that = this;
ms.http.get(ms.manager + "/model/list.do")
.then(function (data) {
that.menuList = data.data.rows
var menuIdList = that.menuList.map(function(menuItem){
return menuItem.id
})
that.state.menu = false
that.markList = that.markList.filter(function(markItem){
return menuIdList.includes(markItem.id)
})
localStorage.setItem("markList", JSON.stringify(that.markList))
}, function (err) {
that.$notify({
title: '错误',
message: err,
type: 'error'
});
that.state.menu = false
}).catch(function(err){
that.state.menu = false
})
},
// 菜单打开页面
open: function (sub) {
var that = this
var result = '';
result = this.editableTabs.some(function (item, index) {
return item.id == sub.id
})
if (sub.syncStoreUrl) {
//sub.modelUrl = "http://store.web.i.mingsoft.net/#/?client=localhost:8080//ms";
sub.modelUrl = sub.syncStoreUrl;
sub.modelTitle = 'MStore';
sub.id = 'MStore';
sub.isStore = true;
!result ? this.editableTabs.push(sub) : ""
} else {
!result ? this.editableTabs.push(sub) : ""
}
this.currentTab = sub.id;
this.headMenuActive = sub.modelId
this.$nextTick(function () {
that.asideMenuActive = sub.id;
})
// 处理其他逻辑
setTimeout(function () {
if (document.querySelector('.el-tabs__nav-prev')) {
document.querySelector('.el-tabs__nav-wrap').style.padding = '0 40px'
} else {
document.querySelector('.el-tabs__nav-wrap').style.padding = '0'
}
}, 16)
},
tabClick: function (tab) {
this.asideMenuActive = tab.$el.dataset.id
this.headMenuActive = tab.$el.dataset.modelId
},
// 获取当前菜单的子菜单
getSubMenu: function (id) {
var result = [];
var that = this;
that.subMenuList && that.subMenuList.forEach(function (item) {
item.modelId == id ? result.push(item) : ''
})
return result;
},
//关闭tab标签页
closeTab: function (targetName) {
var that = this;
// 关闭的面板是当前激活面板
if (that.currentTab == targetName) {
var modelId = null
that.editableTabs.forEach(function (tab, index, arr) {
if (tab.id == targetName) {
modelId = arr[index].modelId
var nextTab = arr[index + 1] || arr[index - 1];
if (nextTab) {
that.currentTab = nextTab.id
that.asideMenuActive = nextTab.id
that.headMenuActive = nextTab.modelId
}
}
})
}
// 去掉关闭的tab
that.editableTabs = that.editableTabs.filter(function (tab) {
return tab.id !== targetName
})
// 关闭左侧父菜单
if (that.editableTabs.length) {
var result = that.editableTabs.every(function (item) {
return item.modelId !== modelId
})
if (result) {
that.asideMenuList.forEach(function (menu, index, arr) {
if (menu.id == modelId) {
var flag = false;
that.markList.forEach(function (item, index, array) {
if (item.title == menu.modelTitle) {
flag = true;
}
})
if (!flag) {
arr.splice(index, 1);
}
}
})
}
} else {
that.asideMenuList = []
}
// 判断是否出现左右箭头
setTimeout(function () {
if (document.querySelector('.el-tabs__nav-prev')) {
document.querySelector('.el-tabs__nav-wrap').style.padding = '0 40px'
} else {
document.querySelector('.el-tabs__nav-wrap').style.padding = '0'
}
}, 16)
},
openParentMenuInId: function (id) {
var data = this.parentMenuList.find(function (menu) {
return menu.id == id
})
data && this.openMenu(data)
},
// 头部导航打开菜单
openMenu: function (menu, index) {
this.asideMenuList.some(function (item, index) {
return item.id == menu.id
}) || this.asideMenuList.push(menu)
// this.getSubMenu(menu.id)[0] && this.$refs.menu.open(this.getSubMenu(menu.id)[0].modelTitle);
var children = [];
this.menuList.forEach(function (tab) {
if (tab.modelId == menu.id) {
children.push(tab)
}
})
this.currentTab = children[0] && children[0].id;
this.open(children[0]);
var that = this;
setTimeout(function () {
that.shortcutMenu = false
}, 50)
that.$nextTick(function () {
that.$refs.menu.open(String(menu.id))
})
},
managerGet: function () {
var that = this;
ms.http.get(ms.manager + "/basic/manager/get.do")
.then(function (data) {
that.managerInfo = data.data
}, function (err) {
that.$notify({
title: '错误',
message: err,
type: 'error'
});
})
},
addCallBackFun: function (fun) {
this.callbackFun = fun;
var app = Vue.createApp({
data: function() {
return {
visible: false,
tableData: [
{
date: '2016-05-03',
name: 'Tom',
state: 'California',
city: 'Los Angeles',
address: 'No. 189, Grove St, Los Angeles',
zip: 'CA 90036',
tag: 'Home',
},
{
date: '2016-05-02',
name: 'Tom',
state: 'California',
city: 'Los Angeles',
address: 'No. 189, Grove St, Los Angeles',
zip: 'CA 90036',
tag: 'Office',
},
{
date: '2016-05-04',
name: 'Tom',
state: 'California',
city: 'Los Angeles',
address: 'No. 189, Grove St, Los Angeles',
zip: 'CA 90036',
tag: 'Home',
},
{
date: '2016-05-01',
name: 'Tom',
state: 'California',
city: 'Los Angeles',
address: 'No. 189, Grove St, Los Angeles',
zip: 'CA 90036',
tag: 'Office',
},
]
}
},
created: function () {
var markList = localStorage.getItem("markList");
if (markList) {
this.markList = JSON.parse(markList)
}
localStorage.setItem("markList", JSON.stringify(this.markList))
},
mounted: function () {
// this.getMessage();
//this.dictList();
//setInterval(this.getMessage,3000)
// 菜单列表
this.list();
//获取登录用户信息
this.managerGet();
},
})
}
});
app.use(ElementPlus).mount("#app");
</script>
<style>
.ms-admin-logo {
display: flex;
align-items: center;
overflow: hidden;
}
.ms-admin-logo img {
padding: 14px 0;
width: 50px;
}
.ms-admin-logo > div {
display: flex;
align-items: center;
}
.ms-admin-logo > div span {
margin-top: -6px;
position: absolute;
margin-left: 10px;
font-size: 12px;
}
.ms-admin-logo .iconfont {
color: #fff;
margin-left: auto;
margin-right: 20px;
cursor: pointer;
}
.ms-admin-header-right {
margin-left: auto;
min-width: 200px;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 0;
line-height: 1;
}
.ms-admin-header-menu-shrink {
width: 64px;
display: flex;
justify-content: center;
align-items: center;
line-height: 50px;
border-right: 1px solid rgba(238, 238, 238, 1);
cursor: pointer;
}
.ms-admin-header-menu-shrink:hover {
background: rgba(250, 250, 250, 0.2);
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 180px;
height: 100vh;
}
.el-menu--collapse {
height: 100vh;
}
.ms-admin-menu-aside {
width: auto !important;
height: 100vh;
position: relative;
overflow: visible;
}
.ms-admin-menu-aside .ms-admin-menu .el-menu--inline .is-active {
border-left: 2px solid #0099ff;
}
.ms-admin-menu-aside .ms-menu-expand i {
font-weight: bolder;
font-size: 14px;
color: #333;
position: absolute;
transform: rotate(90deg);
right: 40%;
}
.ms-admin-menu-aside .ms-menu-expand::before {
border-color: transparent transparent #eee;
border-style: none solid solid;
border-width: 0 30px 22px;
content: "";
display: block;
height: 0;
left: -10px;
width: 30px;
}
.ms-admin-menu-aside .el-submenu__title,
.ms-admin-menu-aside .el-menu-item {
color: rgba(255, 255, 255, 1);
height: 40px;
line-height: 40px;
}
.ms-admin-menu-aside .el-submenu__title i {
color: inherit;
}
.ms-admin-menu-aside .el-submenu__title .iconfont {
font-size: 19px !important;
}
.ms-admin-menu-aside .el-submenu.is-active .el-submenu__title {
color: rgba(255, 255, 255, 1) !important;
}
.ms-admin-header {
display: flex;
padding: 0;
background-color: rgba(255, 255, 255, 1);
height: 50px !important;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 1;
}
.ms-admin-header .ms-admin-header-menu {
border-bottom: none;
position: relative;
}
.ms-admin-header .ms-admin-header-menu > .ms-admin-menu-item > * {
height: 50px !important;
line-height: 50px !important;
border-bottom: none !important;
font-size: 1em;
}
.ms-admin-header .ms-admin-header-menu .ms-admin-shortcut-menu > li {
margin: 0;
padding: 0 20px;
text-align: left;
display: -webkit-inline-box;
display: inline-block;
height: 50px;
line-height: 50px;
font-weight: normal;
font-size: 14px;
color: #333;
}
.ms-admin-header .ms-admin-header-menu .ms-admin-shortcut-menu > li:hover {
cursor: pointer;
color: #0099ff;
}
.ms-admin-header-menu .el-submenu__title {
height: 50px !important;
line-height: 50px !important;
display: flex;
align-items: center;
}
.ms-admin-header-menu .el-submenu__title:hover {
background-color: #F2F6FC !important;
color: #409EFF !important;
}
.ms-admin-header-menu .el-submenu__title:hover i {
color: #409EFF !important;
}
.ms-admin-header-menu .el-submenu__icon-arrow {
margin-top: 4px !important;
}
.ms-admin-header-menu-item .el-menu-item:hover {
background-color: #F2F6FC !important;
color: #409EFF !important;
}
.ms-admin-header-menu-item .el-menu-item:hover i {
color: #409EFF !important;
}
.ms-admin-header-menu-all {
width: 560px;
height: auto;
background: rgba(255, 255, 255, 1);
border-radius: 2px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
line-height: 40px;
}
.ms-admin-header-menu-all .iconfont {
font-size: 17px;
}
.ms-admin-header-menu-all .ms-admin-header-menu-all-item {
display: flex;
width: 25%;
justify-content: center;
align-items: center;
cursor: pointer;
}
.ms-admin-header-menu-all .ms-admin-header-menu-all-item .el-icon-star-on {
color: #ccc;
font-size: 17px;
margin-left: -1px;
margin-top: 1px;
}
.ms-admin-header-menu-all .ms-admin-header-menu-all-item .el-icon-star-on:hover {
color: rgba(64, 158, 255, 1);
}
.ms-admin-header-menu-all .ms-admin-header-menu-all-item .el-icon-star-off {
color: #ccc;
}
.ms-admin-header-menu-all .ms-admin-header-menu-all-item .el-icon-star-off:hover {
color: rgba(64, 158, 255, 1);
}
.ms-admin-header-menu-all .ms-admin-header-menu-all-item:hover {
color: rgba(64, 158, 255, 1);
}
.ms-admin-menu-aside-submenu .el-menu-item {
line-height: 40px;
height: 40px;
}
.el-submenu__title * {
vertical-align: top;
}
.ms-admin-login-theme .el-dropdown-menu__item {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.el-tabs__nav .el-tabs__item:nth-child(1) span {
display: none;
}
.el-tabs__item.is-active {
background-color: rgba(255, 255, 255, 1);
}
.el-menu {
border-right: 0px;
}
.ms-admin-logo .class-1 {
color: white;
padding-top: 8px;
color: #FFFFFF;
word-wrap: break-word;
font-family: MicrosoftYaHei-Bold;
font-weight: bold;
font-style: italic;
}
.ms-admin-logo .class-2 {
font-size: 12px;
font-weight: normal;
}
.top-operate-select .el-menu--popup {
width: 162px;
min-width: 162px;
}
.ms-admin-container {
height: auto;
}
.ms-admin-container > .ms-admin-main {
padding: 0;
background-color: #fff;
z-index: 0;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs {
height: calc(100vh - 50px);
display: flex;
flex-direction: column;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__content {
height: 100%;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__content .el-tab-pane {
height: 100%;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__header {
background: #fafafa;
margin-bottom: 0;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__header .el-tabs__nav-scroll .el-tabs__nav {
border-left: none;
border-radius: 0;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .ms-admin-refresh {
float: right;
width: 40px;
height: 40px;
text-align: center;
border-left: 1px solid #e6e6e6;
cursor: pointer;
position: relative;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .ms-admin-refresh::before {
position: absolute;
left: 34%;
top: 50%;
transform: translateY(-50%);
color: #999;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__nav-next,
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__nav-prev {
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__nav-next {
border-left: 1px solid #e6e6e6;
}
.ms-admin-container > .ms-admin-main .ms-admin-tabs .el-tabs__nav-prev {
border-right: 1px solid #e6e6e6;
}
.ms-admin-container > .ms-admin-main iframe {
width: 100%;
height: 100%;
border: none !important;
}
</style>
</html>

@ -6,7 +6,7 @@
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<#include "header.htm" />
<div class="news">
<div class="body">
<div class="left">

@ -2,11 +2,12 @@
<head>
<meta charset="utf-8">
<title>{ms:global.name/}</title>
<script src="/static/mdiy/index.js"></script>
<#include "head-file.htm" />
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<#include "header.htm" />
<div class="ms-banner">
<swiper class="ms-vue-awesome-swiper" :options="{
slidesPerView : 1,
@ -99,7 +100,33 @@ var app = new Vue({
el: '#app',
watch:{
},
data: {
data:function() {
return {
loading:false,
saveDisabled: false,
verifCode: ms.base + "/code",
//表单数据
form: {
// 姓名
leaveName:'',
// 电话
leavePhone:'',
// 留言内容
textareaMsg:''
},
rules:{
rand_code: [{
required: true,
message: '验证码不能为空',
trigger: 'blur'
}, {
min: 4,
max: 4,
message: '请输入4位验证码',
trigger: 'blur'
}]
},
}
},
methods: {
switchShow:function(arr){
@ -111,8 +138,37 @@ var app = new Vue({
}
})
},
save: function() {
var that = this;
that.saveDisabled = true;
that.formModel.save(function(res) {
if (res.result) {
that.$notify({
title: '成功',
type: 'success',
message: '保存成功!'
});
} else {
that.$notify({
title: '失败',
message: res.msg,
type: 'warning'
});
}
that.saveDisabled = false;
});
},
code: function () {
this.verifCode = ms.base + "/code?t=" + (new Date).getTime();
}
},
created(){
var that = this;
URLS["post"].formURL["save"] = "/mdiy/formData/save.do";
ms.mdiy.model.post("formModel", { "modelName": "留言版" }).then(function(obj) {
that.formModel = obj;
});
}
})
</script>

@ -1,443 +0,0 @@
<html>
<head>
<meta charset="utf-8">
<title>{ms:global.name/}</title>
<#include "head-file.htm" />
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<div class="news">
<div class="body">
<div class="left">
<span class="title"> 分类名称 </span>
<span class="sub-title-sel"> 分类名称 </span>
<span class="sub-title"> 分类名称 </span>
</div>
<div class="right">
<div class="ms-channel-path">
<span class="ms-channel-path-label"> 当前位置: </span>
<a href="/" class="ms-channel-path-index"> 首页 </a> {ms:channel type="path"}
<i class="iconfont icon-youjiantou"></i>
<a href="{ms:global.url/}${field.typelink}" class="ms-channel-path-link"> ${field.typetitle} </a> {/ms:channel}
</div>
<div class="message-body">
<!--输入框-start-->
<input class="ms-input">
<!--输入框-end-->
<!--输入框-start-->
<input class="ms-input">
<!--输入框-end-->
<div>
提交
</div>
</div>
</div>
</div>
</div>
<#include "footer.htm" />
</div>
<script>
var app = new Vue({
el: '#app',
watch:{
},
data: {
},
methods: {
switchShow:function(arr){
var that = this
arr.forEach(function(x){
let e = that.$el.querySelector("#key_"+x)
if(e){
e.style.display=e.style.display=='none'?'flex':'none'
}
})
},
},
created(){
}
})
</script>
<style>
body {
background-color:#fff;
box-sizing:border-box;
font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Segoe UI", "Helvetica Neue", "PingFang SC", "Noto Sans", "Noto Sans CJK SC", "Microsoft YaHei", 微软雅黑, sans-serif;
moz-box-sizing:border-box;
webkit-box-sizing:border-box;
}
.news
{
align-items:flex-start;
flex-direction:row;
display:flex;
padding-right:0px;
box-sizing:border-box;
justify-content:center;
padding-bottom:0px;
flex-wrap:nowrap;
width:100%;
margin-bottom:0px;
padding-top:0px;
padding-left:0px;
margin-top:0px;
}
.news .body
{
padding-bottom:20px;
flex-wrap:nowrap;
flex-direction:row;
display:flex;
padding-right:0px;
width:1200px;
box-sizing:border-box;
padding-top:20px;
padding-left:0px;
}
.news .body .left
{
padding-bottom:0px;
flex-wrap:nowrap;
flex-direction:column;
display:flex;
padding-right:0px;
width:200px;
box-sizing:border-box;
padding-top:0px;
padding-left:0px;
height:100%;
}
.news .body .left .title
{
border-bottom-color:#C0C4CC;
color:#C0C4CC;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
border-bottom-style:dashed;
padding-top:10px;
border-bottom-width:1px;
padding-left:10px;
height:40px;
}
.news .body .left .sub-title-sel
{
background-color:#F2F6FC;
color:#409EFF;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
padding-top:10px;
padding-left:10px;
margin-top:2px;
height:40px;
}
.news .body .left .sub-title
{
color:#5F5F5F;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
padding-top:10px;
padding-left:10px;
margin-top:0px;
height:40px;
}
.news .body .right
{
padding-bottom:0px;
flex-wrap:nowrap;
flex-direction:column;
display:flex;
padding-right:20px;
width:1000px;
margin-bottom:0px;
box-sizing:border-box;
padding-top:0px;
padding-left:20px;
margin-top:0px;
height:100%;
}
.news .body .right .ms-channel-path
{
margin-right:auto;
align-items:center;
flex-wrap:nowrap;
flex-direction:row;
display:flex;
width:100%;
margin-bottom:10px;
box-sizing:border-box;
padding-left:0px;
margin-top:10px;
height:30px;
margin-left:auto;
}
.news .body .right .ms-channel-path span
{
color:#909399;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
}
.news .body .right .ms-channel-path .ms-channel-path-index
{
cursor:pointer;
color:#000;
font-size:16PX;
text-decoration:none;
margin-bottom:0px;
margin-top:0px;
}
.news .body .right .ms-channel-path >i
{
}
.news .body .right .ms-channel-path .ms-channel-path-link
{
cursor:pointer;
color:#000;
font-size:16PX;
text-decoration:none;
margin-bottom:0px;
margin-top:0px;
}
.news .body .right .message-body
{
align-items:center;
flex-direction:column;
display:flex;
padding-right:0px;
box-sizing:border-box;
margin-left:0px;
border-top-left-radius:0px;
margin-right:0px;
padding-bottom:0px;
flex-wrap:nowrap;
border-bottom-left-radius:0px;
width:100%;
border-bottom-right-radius:0px;
margin-bottom:0px;
border-top-right-radius:0px;
padding-top:0px;
padding-left:0px;
margin-top:0px;
}
.news .body .right .message-body .ms-input
{
border-color:#DCDFE6;
background-color:#FFFFFF;
align-items:center;
flex-direction:row;
display:flex;
padding-right:4px;
box-sizing:border-box;
justify-content:space-between;
border-top-left-radius:2px;
padding-bottom:0px;
flex-wrap:nowrap;
border-bottom-left-radius:2px;
border-width:1px;
width:250px;
border-bottom-right-radius:2px;
border-top-right-radius:2px;
margin-bottom:4px;
padding-top:0px;
border-style:solid;
padding-left:4px;
height:30px;
}
.news .body .right .message-body .ms-input span
{
color:#DCDFE6;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
padding-right:0px;
border-top-left-radius:0px;
padding-bottom:0px;
border-bottom-left-radius:0px;
border-bottom-right-radius:0px;
border-top-right-radius:0px;
font-size:14PX;
padding-top:0px;
padding-left:0px;
}
.news .body .right .message-body div
{
cursor:pointer;
background-color:#0099ff;
color:#FFFFFF;
text-align:center;
display:inline-block;
box-sizing:border-box;
border-top-left-radius:4px;
border-bottom-left-radius:4px;
width:138px;
border-bottom-right-radius:4px;
line-height:45px;
font-size:16px;
border-top-right-radius:4px;
height:45px;
}
@media (max-width: 768px){
.news
{
align-items:center;
flex-direction:row;
display:flex;
padding-right:0px;
box-sizing:border-box;
justify-content:center;
padding-bottom:0px;
flex-wrap:nowrap;
width:100%;
margin-bottom:0px;
padding-top:0px;
padding-left:0px;
margin-top:0px;
}
.news .body
{
padding-bottom:20px;
flex-wrap:nowrap;
flex-direction:column;
display:flex;
padding-right:0px;
width:100%;
box-sizing:border-box;
padding-top:20px;
padding-left:0px;
}
.news .body .left
{
padding-bottom:0px;
flex-wrap:nowrap;
flex-direction:column;
display:flex;
padding-right:0px;
width:100%;
box-sizing:border-box;
padding-top:0px;
padding-left:0px;
height:100%;
}
.news .body .left .title
{
border-bottom-color:#C0C4CC;
color:#C0C4CC;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
border-bottom-style:dashed;
padding-top:10px;
border-bottom-width:1px;
padding-left:10px;
height:40px;
}
.news .body .left .sub-title-sel
{
background-color:#F2F6FC;
color:#409EFF;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
padding-top:10px;
padding-left:10px;
margin-top:2px;
height:40px;
}
.news .body .left .sub-title
{
color:#5F5F5F;
text-align:left;
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:16PX;
padding-top:10px;
padding-left:10px;
margin-top:0px;
height:40px;
}
.news .body .right
{
padding-bottom:0px;
flex-wrap:nowrap;
flex-direction:column;
display:flex;
padding-right:0px;
width:100%;
margin-bottom:0px;
box-sizing:border-box;
padding-top:0px;
padding-left:0px;
margin-top:0px;
}
.news .body .right .ms-channel-path
{
align-items:center;
flex-direction:row;
display:flex;
box-sizing:border-box;
margin-left:auto;
margin-right:auto;
flex-wrap:nowrap;
width:100%;
margin-bottom:10px;
padding-top:0px;
padding-left:0px;
margin-top:10px;
height:30px;
}
.news .body .right .ms-channel-path span
{
flex-direction:row;
word-wrap:break-word;
display:inline-block;
font-size:14PX;
}
.news .body .right .ms-channel-path .ms-channel-path-index
{
cursor:pointer;
color:#000;
font-size:14PX;
text-decoration:none;
margin-bottom:0px;
margin-top:0px;
}
.news .body .right .ms-channel-path .ms-channel-path-link
{
cursor:pointer;
color:#000;
font-size:14PX;
text-decoration:none;
margin-bottom:0px;
margin-top:0px;
}
.news .body .right .message-body
{
margin-right:0px;
padding-bottom:0px;
flex-wrap:nowrap;
flex-direction:column;
display:flex;
width:100%;
box-sizing:border-box;
margin-bottom:0px;
padding-top:0px;
margin-top:0px;
height:300px;
margin-left:0px;
}
}</style>
</body>
</html>

@ -1,44 +0,0 @@
<#assign ids=field.parentids>
<#assign typeid=field.typeid>
<div class="ms-nav">
<div class="body">
<div class="logo">
<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">
</div>
<div @click="switchShow([&quot;1605172743000_96378&quot;]);" class="nav-h5">
<i class="iconfont icon-caidan nav-h5-icon"></i>
<div id="key_1605172743000_96378" class="nav-h5-body" style="display: none">
<a href="{ms:global.host/}" class="nav-h5-item"> 首页 </a>
{ms:channel flag='nav' type='top'}
<a href="<#if field.type==3>{ms:global.url/}${field.typeurl}<#else>{ms:global.url/}${field.typelink}</#if>" class="nav-h5-item <#if typeid==field.typeid || (ids?has_content && ids?index_of('${field.typeid}') gt -1)> sel</#if>">
${field.typetitle}
</a>
{/ms:channel}
</div>
</div>
<div class="nav-item">
<a href="{ms:global.host/}" class="item"> 首页 </a>
{ms:channel flag='nav' type='top'}
<a href="<#if field.type==3>{ms:global.url/}${field.typeurl}<#else>{ms:global.url/}${field.typelink}</#if>" class="item<#if typeid==field.typeid || (ids?has_content && ids?index_of('${field.typeid}') gt -1)> sel</#if>">
${field.typetitle}
</a>
{/ms:channel}
</div>
<div class="nav-search">
<!--搜索-start-->
<form id="searchDataForm" action="{ms:global.host/}/mcms/search.do" method="post" class="ms-search-input">
<div class="ms-search-input-div">
<!--输入框 - start -->
<input class="ms-input" name="content_title" placeholder="输入搜索关键字">
<!--输入框 -end -->
</div>
<div class="ms-search-button" onclick="document.getElementById('searchDataForm').submit();">
<i class="iconfont icon-fangdajing"></i>
</div>
</form>
<!--搜索-end-->
</div>
</div>
</div>

File diff suppressed because it is too large Load Diff

@ -6,7 +6,7 @@
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<#include "header.htm" />
<div class="news">
<div class="body">
<div class="left">

@ -6,7 +6,7 @@
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<#include "header.htm" />
<div class="content">
<div class="body">
<div class="left">

@ -6,7 +6,7 @@
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<#include "header.htm" />
<div class="content">
<div class="body">

@ -6,7 +6,7 @@
</head>
<body>
<div id="app" v-cloak>
<#include "nav.htm" />
<#include "header.htm" />
<div class="search">
<div class="body">
<span> 关键字 <span style="color: red">{ms:search.content_title/}</span> </span>

Loading…
Cancel
Save