Commit a61bd8904b93dfe196db95927be2f3c2bf595628
1 parent
ec6cdc69e0
Exists in
master
内容模块完善
Showing 22 changed files with 503 additions and 248 deletions
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentArticlesMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentCategoriesMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentMessageTemplateMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentTagsMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentArticlesServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentTagsServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/vo/content/AricleSearchDTO.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentArticlesController.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentCategoriesController.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentMessageTemplateController.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentTagsController.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentTemplateVersionController.java
- parent/center.manager/src/main/resources/logback.xml
- parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_edit.html
- parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_list.html
- parent/center.manager/src/main/webapp/WEB-INF/views/categories/categonies_edit.html
- parent/center.manager/src/main/webapp/WEB-INF/views/categories/categonies_list.html
- parent/center.manager/src/main/webapp/WEB-INF/views/common/base_list.html
- parent/center.manager/src/main/webapp/WEB-INF/views/content/template_edit.html
- parent/center.manager/src/main/webapp/WEB-INF/views/content/template_list.html
- parent/center.manager/src/main/webapp/WEB-INF/views/tags/tags_edit.html
- parent/center.manager/src/main/webapp/WEB-INF/views/tags/tags_list.html
parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentArticlesMapper.xml
View file @
a61bd89
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | </sql> |
| 36 | 36 | |
| 37 | 37 | <select id="getArticlesPage" resultMap="BaseResultMap" parameterType="com.lyms.base.common.vo.content.AricleSearchDTO"> |
| 38 | - select ca.ID,ca.CATEGORY_ID,ca.CONTENT,ca.CONTENT_TYPE,ca.`ENABLE`,ca.INTRODUCTION,ca.LINK,ca.TITLE,ca.TYPE,group_concat(cat.TAGS_IDS ) as tagIds,cc.`NAME` as categoryName | |
| 38 | + select ca.ID,ca.CATEGORY_ID,ca.CONTENT,ca.CONTENT_TYPE,ca.`ENABLE`,ca.INTRODUCTION,ca.LINK,ca.TITLE,ca.TYPE,group_concat(cat.TAGS_IDS ) as tagIds,cc.`NAME` as categoryName,ca.STATUS as status | |
| 39 | 39 | from CONTENT_ARTICLES ca LEFT join CONTENT_ARTICLES_TAGS cat on ca.ID = cat.ARTICLES_ID left join CONTENT_CATEGORIES cc on ca.CATEGORY_ID = cc.ID |
| 40 | 40 | <where> |
| 41 | 41 | <if test="columnId !=null"> |
| 42 | 42 | |
| ... | ... | @@ -50,12 +50,17 @@ |
| 50 | 50 | and ca.TITlE like concat('%',#{title},'%') |
| 51 | 51 | </if> |
| 52 | 52 | |
| 53 | + <if test="status!=null"> | |
| 54 | + and ca.STATUS = #{status} | |
| 55 | + </if> | |
| 56 | + | |
| 53 | 57 | <if test="tagId!=null"> |
| 54 | 58 | and cat.TAGS_IDS like concat('%,',#{tagId},',%') |
| 55 | 59 | </if> |
| 56 | 60 | AND ca.IFDEL = 0 |
| 57 | 61 | </where> |
| 58 | 62 | GROUP BY ca.ID |
| 63 | + order by ca.CREATE_TIME DESC | |
| 59 | 64 | </select> |
| 60 | 65 | </mapper> |
parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentCategoriesMapper.xml
View file @
a61bd89
parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentMessageTemplateMapper.xml
View file @
a61bd89
parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentTagsMapper.xml
View file @
a61bd89
parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentArticlesServiceImpl.java
View file @
a61bd89
| ... | ... | @@ -31,23 +31,15 @@ |
| 31 | 31 | return baseMapper.deleteLogicById(id); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | + | |
| 34 | 35 | @Override |
| 35 | 36 | public Page<ContentArticles> getArticlesPage(Page<ContentArticles> page, AricleSearchDTO aricleDto) { |
| 36 | 37 | List<ContentArticles> lists = baseMapper.getArticlesPage(page, aricleDto); |
| 37 | - StringBuffer tagsBf = new StringBuffer(); | |
| 38 | 38 | for (ContentArticles ct : lists) { |
| 39 | 39 | String[] contentTags = ct.getTagIds()==null?new String[0]:ct.getTagIds().split(","); |
| 40 | - for (String s : contentTags) { | |
| 41 | - if (StrUtils.isEmpty(s)) { | |
| 42 | - continue; | |
| 43 | - } | |
| 44 | - String tagName = ContentTagsServiceImpl.getValue(s); | |
| 45 | - if (StrUtils.isNotEmpty(tagName)) { | |
| 46 | - tagsBf.append(tagName + ","); | |
| 47 | - } | |
| 48 | - } | |
| 49 | - if (StrUtils.isNotEmpty(tagsBf.toString())) { | |
| 50 | - ct.setTagIds(tagsBf.substring(0, tagsBf.length() - 1).toString()); | |
| 40 | + String tagName = ContentTagsServiceImpl.tagIdToTagName(contentTags); | |
| 41 | + if (StrUtils.isNotEmpty(tagName)) { | |
| 42 | + ct.setTagIds(tagName.substring(0, tagName.length() - 1)); | |
| 51 | 43 | } else { |
| 52 | 44 | ct.setTagIds(""); |
| 53 | 45 | } |
parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentTagsServiceImpl.java
View file @
a61bd89
| 1 | 1 | package com.lyms.base.common.service.content.impl; |
| 2 | 2 | |
| 3 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 4 | +import com.baomidou.mybatisplus.mapper.Wrapper; | |
| 3 | 5 | import com.baomidou.mybatisplus.plugins.Page; |
| 4 | 6 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| 5 | 7 | import com.lyms.base.common.dao.content.ContentTagsMapper; |
| 6 | 8 | |
| ... | ... | @@ -32,10 +34,30 @@ |
| 32 | 34 | |
| 33 | 35 | @PostConstruct |
| 34 | 36 | public void initData(){ |
| 35 | - List<ContentTags> tagsList = baseMapper.getTags(); | |
| 37 | + Wrapper wrapper = new EntityWrapper(); | |
| 38 | + wrapper.and("IFDEL",0); | |
| 39 | + wrapper.and("ENABLE",0); | |
| 40 | + List<ContentTags> tagsList = baseMapper.selectList(wrapper); | |
| 36 | 41 | for(ContentTags conTag:tagsList){ |
| 37 | 42 | tagsMap.put(conTag.getId(),conTag.getTagName()); |
| 38 | 43 | } |
| 44 | + } | |
| 45 | + | |
| 46 | + public static String tagIdToTagName(String [] tagIds){ | |
| 47 | + if(tagIds.length==0){ | |
| 48 | + return ""; | |
| 49 | + } | |
| 50 | + StringBuffer tagsBf = new StringBuffer(); | |
| 51 | + for (String s : tagIds) { | |
| 52 | + if (StrUtils.isEmpty(s)) { | |
| 53 | + continue; | |
| 54 | + } | |
| 55 | + String tagName = getValue(s); | |
| 56 | + if (StrUtils.isNotEmpty(tagName)) { | |
| 57 | + tagsBf.append(tagName + ","); | |
| 58 | + } | |
| 59 | + } | |
| 60 | + return tagsBf.toString(); | |
| 39 | 61 | } |
| 40 | 62 | |
| 41 | 63 | public static String getValue(String key){ |
parent/base.common/src/main/java/com/lyms/base/common/vo/content/AricleSearchDTO.java
View file @
a61bd89
| ... | ... | @@ -15,6 +15,10 @@ |
| 15 | 15 | */ |
| 16 | 16 | private Integer type; |
| 17 | 17 | /** |
| 18 | + * 状态 | |
| 19 | + */ | |
| 20 | + private Integer status; | |
| 21 | + /** | |
| 18 | 22 | * 标签id |
| 19 | 23 | */ |
| 20 | 24 | private String tagId; |
| ... | ... | @@ -22,6 +26,14 @@ |
| 22 | 26 | * 标题 |
| 23 | 27 | */ |
| 24 | 28 | private String title; |
| 29 | + | |
| 30 | + public Integer getStatus() { | |
| 31 | + return status; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setStatus(Integer status) { | |
| 35 | + this.status = status; | |
| 36 | + } | |
| 25 | 37 | |
| 26 | 38 | public Integer getColumnId() { |
| 27 | 39 | return columnId; |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentArticlesController.java
View file @
a61bd89
| ... | ... | @@ -58,16 +58,61 @@ |
| 58 | 58 | return "/articles/articles_edit"; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + | |
| 61 | 62 | /** |
| 62 | 63 | * 获取图文内容列表 |
| 63 | 64 | * @return |
| 64 | 65 | */ |
| 65 | 66 | @ResponseBody |
| 67 | + @RequestMapping(value = "/audit", method = { RequestMethod.POST }) | |
| 68 | + public AjaxResult audit(String id,int type,String reason,AjaxResult ajaxResult) { | |
| 69 | + String operationName = "操作"; | |
| 70 | + if(StrUtils.isNotEmpty(id)){ | |
| 71 | + ContentArticles articles = contentArticlesService.selectById(id); | |
| 72 | + if(articles!=null){ | |
| 73 | + if(type == 1){//审核 | |
| 74 | + if(articles.getStatus() == 1){//审核操作:当前状态是待审核状态 | |
| 75 | + articles.setStatus(2); | |
| 76 | + articles.setAuditorTime(new Date()); | |
| 77 | + articles.setReason(reason); | |
| 78 | + operationName = "审核"; | |
| 79 | + }else{ | |
| 80 | + return handleAjaxResult(ajaxResult, false, "当前状态不是待审核状态导致"); | |
| 81 | + } | |
| 82 | + }else if(type == 2){//发布 | |
| 83 | + if(articles.getStatus() == 2 ||articles.getStatus() == 4){//发布操作::当前状态是审核通过状态或已下线状态 | |
| 84 | + articles.setStatus(3); | |
| 85 | + operationName = "发布"; | |
| 86 | + }else{ | |
| 87 | + return handleAjaxResult(ajaxResult, false, "当前状态不是审核通过状态导致"); | |
| 88 | + } | |
| 89 | + }else if(type == 3){//下线操作:当前状态是已发布状态 | |
| 90 | + if(articles.getStatus() == 3){ | |
| 91 | + articles.setStatus(4); | |
| 92 | + operationName = "下线"; | |
| 93 | + }else{ | |
| 94 | + return handleAjaxResult(ajaxResult, false, "当前状态不是发布状态导致"); | |
| 95 | + } | |
| 96 | + }else{ | |
| 97 | + return handleAjaxResult(ajaxResult, false, "未知操作"); | |
| 98 | + } | |
| 99 | + boolean tag = contentArticlesService.updateById(articles); | |
| 100 | + return handleAjaxResult(ajaxResult, tag, operationName); | |
| 101 | + } | |
| 102 | + } | |
| 103 | + return handleAjaxResult(ajaxResult, false, operationName); | |
| 104 | + } | |
| 105 | + | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * 获取图文内容列表 | |
| 109 | + * @return | |
| 110 | + */ | |
| 111 | + @ResponseBody | |
| 66 | 112 | @RequestMapping(value = "/list", method = { RequestMethod.GET, RequestMethod.POST }) |
| 67 | 113 | public Map<String, Object> list(AricleSearchDTO aricleDto) { |
| 68 | 114 | Page<ContentArticles> page = getPage(); |
| 69 | 115 | page = contentArticlesService.getArticlesPage(page,aricleDto); |
| 70 | - | |
| 71 | 116 | return toGridData(page); |
| 72 | 117 | } |
| 73 | 118 | @RequestMapping(value = "/{ids}/delete", method = { RequestMethod.GET, RequestMethod.POST }) |
| ... | ... | @@ -133,7 +178,7 @@ |
| 133 | 178 | Map<String, Object> map = new HashMap<>(); |
| 134 | 179 | map.put("ARTICLES_ID",conArti.getId()); |
| 135 | 180 | //先删除标签关系 |
| 136 | - boolean bd = contentArticTagService.deleteByMap(map); | |
| 181 | + contentArticTagService.deleteByMap(map); | |
| 137 | 182 | //新增或修改图文信息 |
| 138 | 183 | boolean tag = contentArticlesService.insertOrUpdate(conArti); |
| 139 | 184 | //批量新增图文对应的标签 |
| ... | ... | @@ -142,7 +187,7 @@ |
| 142 | 187 | if(StrUtils.isNotEmpty(cav.getId())&&!cav.getId().equals("0")) {//更新 |
| 143 | 188 | return handleAjaxResult(ajaxResult, tag, OperationName.UPDATE); |
| 144 | 189 | }else{ |
| 145 | - return handleAjaxResult(ajaxResult, tag&&bd&&bi, OperationName.CREATE); | |
| 190 | + return handleAjaxResult(ajaxResult, tag&&bi, OperationName.CREATE); | |
| 146 | 191 | } |
| 147 | 192 | } |
| 148 | 193 | } |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentCategoriesController.java
View file @
a61bd89
| ... | ... | @@ -40,7 +40,10 @@ |
| 40 | 40 | @ResponseBody |
| 41 | 41 | @RequestMapping(value = "/selelist", method = { RequestMethod.GET, RequestMethod.POST }) |
| 42 | 42 | public AjaxResult selelist() { |
| 43 | - List<ContentCategories> lists = categorService.selectList(null); | |
| 43 | + Wrapper wrapper = new EntityWrapper(); | |
| 44 | + wrapper.and("IFDEL={0}",0); | |
| 45 | + wrapper.and("ENABLE={1}",0); | |
| 46 | + List<ContentCategories> lists = categorService.selectList(wrapper); | |
| 44 | 47 | return AjaxResult.returnSuccess(lists); |
| 45 | 48 | } |
| 46 | 49 |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentMessageTemplateController.java
View file @
a61bd89
| ... | ... | @@ -20,10 +20,7 @@ |
| 20 | 20 | import org.springframework.ui.Model; |
| 21 | 21 | import org.springframework.web.bind.annotation.*; |
| 22 | 22 | |
| 23 | -import java.util.Date; | |
| 24 | -import java.util.HashMap; | |
| 25 | -import java.util.List; | |
| 26 | -import java.util.Map; | |
| 23 | +import java.util.*; | |
| 27 | 24 | |
| 28 | 25 | /** |
| 29 | 26 | * <p> |
| 30 | 27 | |
| 31 | 28 | |
| 32 | 29 | |
| 33 | 30 | |
| 34 | 31 | |
| ... | ... | @@ -42,25 +39,26 @@ |
| 42 | 39 | //模板信息标签 |
| 43 | 40 | @Autowired |
| 44 | 41 | private ContentTemplateMessageTagsService messageTagsService; |
| 42 | + | |
| 45 | 43 | /** |
| 46 | 44 | * 跳转到列表页面 |
| 47 | 45 | * |
| 48 | 46 | * @return |
| 49 | 47 | */ |
| 50 | - @RequestMapping(value = "/toList", method = { RequestMethod.GET }) | |
| 48 | + @RequestMapping(value = "/toList", method = {RequestMethod.GET}) | |
| 51 | 49 | public String toList() { |
| 52 | - return "/content/template_list"; | |
| 50 | + return "/content/template_list"; | |
| 53 | 51 | } |
| 54 | 52 | |
| 55 | 53 | |
| 56 | - @RequestMapping(value = "/{ids}/delete", method = { RequestMethod.GET, RequestMethod.POST }) | |
| 54 | + @RequestMapping(value = "/{ids}/delete", method = {RequestMethod.GET, RequestMethod.POST}) | |
| 57 | 55 | @ResponseBody |
| 58 | 56 | public AjaxResult delete(@PathVariable String ids, AjaxResult ajaxResult) { |
| 59 | 57 | Wrapper<ContentMessageTemplate> wrapper = new EntityWrapper<>(); |
| 60 | 58 | //wrapper.where("id in ({0})",ids); |
| 61 | - wrapper.in("id",ids); | |
| 59 | + wrapper.in("id", ids); | |
| 62 | 60 | List<ContentMessageTemplate> template = messageTemplateService.selectList(wrapper); |
| 63 | - for(ContentMessageTemplate temp : template){ | |
| 61 | + for (ContentMessageTemplate temp : template) { | |
| 64 | 62 | temp.setIfdel(1); |
| 65 | 63 | temp.setModifyTime(new Date()); |
| 66 | 64 | } |
| 67 | 65 | |
| 68 | 66 | |
| 69 | 67 | |
| 70 | 68 | |
| 71 | 69 | |
| 72 | 70 | |
| 73 | 71 | |
| 74 | 72 | |
| 75 | 73 | |
| 76 | 74 | |
| 77 | 75 | |
| 78 | 76 | |
| 79 | 77 | |
| 80 | 78 | |
| ... | ... | @@ -70,91 +68,103 @@ |
| 70 | 68 | } |
| 71 | 69 | |
| 72 | 70 | /** |
| 73 | - * 跳转到编辑页面 | |
| 74 | - * | |
| 75 | - * @return | |
| 76 | - */ | |
| 77 | - @RequestMapping(value = { "/{verId}/toEdit" }, method = RequestMethod.GET) | |
| 78 | - public String toEdit(@PathVariable String verId,String id,String vName, Model model) { | |
| 79 | - model.addAttribute("verId", verId); | |
| 80 | - model.addAttribute("vName", vName); | |
| 81 | - model.addAttribute("id", id); | |
| 82 | - if(StrUtils.isNotEmpty(id)){//查询 | |
| 71 | + * 跳转到编辑页面 | |
| 72 | + * | |
| 73 | + * @return | |
| 74 | + */ | |
| 75 | + @RequestMapping(value = {"/{verId}/toEdit"}, method = RequestMethod.GET) | |
| 76 | + public String toEdit(@PathVariable String verId, String id, String vName, Model model) { | |
| 77 | + model.addAttribute("verId", verId); | |
| 78 | + model.addAttribute("vName", vName); | |
| 79 | + model.addAttribute("id", id); | |
| 80 | + if (StrUtils.isNotEmpty(id)) {//查询 | |
| 83 | 81 | ContentMessageTemplate tempInfo = messageTemplateService.selectById(id); |
| 84 | - model.addAttribute("tempInfo",tempInfo); | |
| 85 | - Map<String,Object> colMap = new HashMap<>(); | |
| 86 | - colMap.put("MESSAGE_TEMPLATE",id); | |
| 82 | + model.addAttribute("tempInfo", tempInfo); | |
| 83 | + Map<String, Object> colMap = new HashMap<>(); | |
| 84 | + colMap.put("MESSAGE_TEMPLATE", id); | |
| 87 | 85 | List<ContentTemplateMessageTags> tagList = messageTagsService.selectByMap(colMap); |
| 88 | 86 | model.addAttribute("tags", tagList); |
| 89 | 87 | } |
| 90 | 88 | return "/content/template_edit"; |
| 91 | - } | |
| 89 | + } | |
| 92 | 90 | |
| 93 | - /** | |
| 94 | - * 获取消息内容列表 | |
| 95 | - * @param msgTemp | |
| 96 | - * @return | |
| 97 | - */ | |
| 91 | + /** | |
| 92 | + * 获取消息内容列表 | |
| 93 | + * | |
| 94 | + * @param msgTemp | |
| 95 | + * @return | |
| 96 | + */ | |
| 98 | 97 | @ResponseBody |
| 99 | - @RequestMapping(value = "/list", method = { RequestMethod.GET, RequestMethod.POST }) | |
| 98 | + @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST}) | |
| 100 | 99 | public Map<String, Object> list(MsgTempSerachDTO msgTemp) { |
| 101 | - Page<ContentMessageTemplateDTO> page = getPage(); | |
| 102 | - //根据条件查询短信列表 | |
| 103 | - List<ContentMessageTemplateDTO> cmtdList = messageTemplateService.getContentMessageTemplate(page,msgTemp); | |
| 104 | - for(ContentMessageTemplateDTO ct : cmtdList){ | |
| 105 | - StringBuffer tagsBf = new StringBuffer(); | |
| 106 | - String[] contentTags = ct.getContentTagIds().split(","); | |
| 107 | - for(String s:contentTags){ | |
| 108 | - if(StrUtils.isEmpty(s)){ | |
| 109 | - continue; | |
| 100 | + if (StrUtils.isNotEmpty(msgTemp.getVerId())) { | |
| 101 | + Page<ContentMessageTemplateDTO> page = getPage(); | |
| 102 | + //根据条件查询短信列表 | |
| 103 | + List<ContentMessageTemplateDTO> cmtdList = messageTemplateService.getContentMessageTemplate(page, msgTemp); | |
| 104 | + for (ContentMessageTemplateDTO ct : cmtdList) { | |
| 105 | + String[] contentTags = ct.getContentTagIds().split(","); | |
| 106 | + String tagName = ContentTagsServiceImpl.tagIdToTagName(contentTags); | |
| 107 | + if (StrUtils.isNotEmpty(tagName.toString())) { | |
| 108 | + ct.setContentTagIds(tagName.substring(0, tagName.length() - 1).toString()); | |
| 109 | + } else { | |
| 110 | + ct.setContentTagIds(""); | |
| 110 | 111 | } |
| 111 | - String tagName = ContentTagsServiceImpl.getValue(s); | |
| 112 | - if(StrUtils.isNotEmpty(tagName)){ | |
| 113 | - tagsBf.append(tagName+","); | |
| 114 | - } | |
| 115 | 112 | } |
| 116 | - if(StrUtils.isNotEmpty(tagsBf.toString())){ | |
| 117 | - ct.setContentTagIds(tagsBf.substring(0,tagsBf.length()-1).toString()); | |
| 118 | - }else{ | |
| 119 | - ct.setContentTagIds(""); | |
| 120 | - } | |
| 121 | - System.out.println("标签名:--------------->"+ct.getContentTagIds()); | |
| 113 | + page.setRecords(cmtdList); | |
| 114 | + return toGridData(page); | |
| 115 | + }else{ | |
| 116 | + return toGridData(getPage()); | |
| 122 | 117 | } |
| 123 | - | |
| 124 | - page.setRecords(cmtdList); | |
| 125 | - return toGridData(page); | |
| 126 | 118 | } |
| 127 | - | |
| 128 | - /** | |
| 119 | + | |
| 120 | + /** | |
| 129 | 121 | * 新增消息模板信息 |
| 130 | 122 | * <p> |
| 131 | 123 | * TODO |
| 132 | - * | |
| 124 | + * | |
| 133 | 125 | * @return |
| 134 | 126 | */ |
| 135 | 127 | @RequestMapping(value = "/create", method = RequestMethod.POST) |
| 136 | 128 | @ResponseBody |
| 137 | 129 | public AjaxResult create(@ModelAttribute InContentMessageTemplateDTO contentMessage, AjaxResult ajaxResult) { |
| 138 | - ContentMessageTemplate messTemp = new ContentMessageTemplate(); | |
| 139 | - messTemp.setId(StrUtils.uuid()); | |
| 140 | - messTemp.setEnable(0); | |
| 141 | - messTemp.setIfdel(0); | |
| 142 | - messTemp.setCreateTime(new Date()); | |
| 143 | - messTemp.setKeyCode(messTemp.getId()); | |
| 144 | - messTemp.setContent(contentMessage.getContent()); | |
| 145 | - messTemp.setRichTitle(contentMessage.getRichTitle()); | |
| 146 | - messTemp.setRichText(contentMessage.getRichText()); | |
| 147 | - messTemp.setTemplateVersionId(contentMessage.getTemplateVersionId()); | |
| 130 | + ContentMessageTemplate messTemp = new ContentMessageTemplate(); | |
| 131 | + String operationName = "操作"; | |
| 132 | + if(StrUtils.isNotEmpty(contentMessage.getId())&&!contentMessage.getId().equals("0")){//更新 | |
| 133 | + messTemp = messageTemplateService.selectById(contentMessage.getId()); | |
| 134 | + if(messTemp!=null){ | |
| 135 | + messTemp.setModifyTime(new Date()); | |
| 136 | + } | |
| 137 | + operationName = "修改"; | |
| 138 | + | |
| 139 | + Map<String, Object> map = new HashMap<>(); | |
| 140 | + map.put("MESSAGE_TEMPLATE",messTemp.getId()); | |
| 141 | + //先删除标签关系 | |
| 142 | + messageTagsService.deleteByMap(map); | |
| 143 | + }else{ | |
| 144 | + messTemp.setId(StrUtils.uuid()); | |
| 145 | + messTemp.setEnable(0); | |
| 146 | + messTemp.setIfdel(0); | |
| 147 | + messTemp.setCreateTime(new Date()); | |
| 148 | + messTemp.setKeyCode(messTemp.getId()); | |
| 149 | + messTemp.setTemplateVersionId(contentMessage.getTemplateVersionId()); | |
| 150 | + operationName = "新增"; | |
| 151 | + } | |
| 152 | + messTemp.setContent(contentMessage.getContent()); | |
| 153 | + messTemp.setRichTitle(contentMessage.getRichTitle()); | |
| 154 | + messTemp.setRichText(contentMessage.getRichText()); | |
| 148 | 155 | messTemp.setIsRich(contentMessage.getIsRich()); |
| 149 | - for(String tags : contentMessage.getContentTagIds()){ | |
| 156 | + | |
| 157 | + List<ContentTemplateMessageTags> tempTags = new ArrayList<>(); | |
| 158 | + for (String tags : contentMessage.getContentTagIds()) { | |
| 150 | 159 | ContentTemplateMessageTags ctmt = new ContentTemplateMessageTags(); |
| 151 | 160 | ctmt.setId(StrUtils.uuid()); |
| 152 | 161 | ctmt.setMessageTemplate(messTemp.getId()); |
| 153 | 162 | ctmt.setTagsIds(tags); |
| 154 | - messageTagsService.insert(ctmt); | |
| 163 | + tempTags.add(ctmt); | |
| 155 | 164 | } |
| 156 | - boolean tag = messageTemplateService.insert(messTemp); | |
| 157 | - return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); | |
| 165 | + boolean tags = messageTagsService.insertBatch(tempTags); | |
| 166 | + boolean tag = messageTemplateService.insertOrUpdate(messTemp); | |
| 167 | + return handleAjaxResult(ajaxResult, tag&&tags, operationName); | |
| 158 | 168 | } |
| 159 | 169 | |
| 160 | 170 | } |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentTagsController.java
View file @
a61bd89
| ... | ... | @@ -121,9 +121,11 @@ |
| 121 | 121 | @RequestMapping(value = "/create", method = { RequestMethod.POST }) |
| 122 | 122 | public AjaxResult create(ContentTagsDTO ctd, AjaxResult ajaxResult) { |
| 123 | 123 | ContentTags cts = null; |
| 124 | + String operationName = "新增"; | |
| 124 | 125 | if(StrUtils.isNotEmpty(ctd.getId())&&!ctd.getId().equals("0")){//更新 |
| 125 | 126 | cts = contentTagsService.selectById(ctd.getId()); |
| 126 | 127 | cts.setModifyTime(new Date()); |
| 128 | + operationName = "修改"; | |
| 127 | 129 | }else{//新增 |
| 128 | 130 | cts = new ContentTags(); |
| 129 | 131 | cts.setId(StrUtils.uuid()); |
| ... | ... | @@ -143,7 +145,7 @@ |
| 143 | 145 | if(tag){ |
| 144 | 146 | ContentTagsServiceImpl.setValue(cts.getId(),cts.getTagName()); |
| 145 | 147 | } |
| 146 | - return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); | |
| 148 | + return handleAjaxResult(ajaxResult, tag, operationName); | |
| 147 | 149 | } |
| 148 | 150 | } |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentTemplateVersionController.java
View file @
a61bd89
| 1 | 1 | package com.lyms.cm.controller.content; |
| 2 | 2 | |
| 3 | -import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 4 | -import com.baomidou.mybatisplus.plugins.Page; | |
| 5 | 3 | import com.lyms.base.common.entity.content.ContentMessageTemplate; |
| 6 | 4 | import com.lyms.base.common.entity.content.ContentTemplateMessageTags; |
| 7 | 5 | import com.lyms.base.common.entity.content.ContentTemplateVersion; |
| ... | ... | @@ -23,7 +21,6 @@ |
| 23 | 21 | |
| 24 | 22 | import java.util.Date; |
| 25 | 23 | import java.util.List; |
| 26 | -import java.util.Map; | |
| 27 | 24 | |
| 28 | 25 | /** |
| 29 | 26 | * <p> |
| ... | ... | @@ -51,9 +48,8 @@ |
| 51 | 48 | */ |
| 52 | 49 | @RequestMapping(value = "/list", method = { RequestMethod.POST, RequestMethod.GET }) |
| 53 | 50 | @ResponseBody |
| 54 | - public Map<String, Object> list(Model model) { | |
| 55 | - Page<ContentTemplateVersion> page = getPage(); | |
| 56 | - EntityWrapper<ContentTemplateVersion> ew = new EntityWrapper<ContentTemplateVersion>(); | |
| 51 | + public List<ContentTemplateVersion> list(Model model) { | |
| 52 | + /*EntityWrapper<ContentTemplateVersion> ew = new EntityWrapper<ContentTemplateVersion>(); | |
| 57 | 53 | String versionId = getParameter("versionId"); |
| 58 | 54 | String searchName = getParameter("name"); |
| 59 | 55 | if (StrUtils.isNotEmpty(searchName)) { |
| ... | ... | @@ -62,10 +58,9 @@ |
| 62 | 58 | if (StrUtils.isNotEmpty(versionId)) { |
| 63 | 59 | ew.and("version_id like {0}", versionId.trim() + "%"); |
| 64 | 60 | } |
| 65 | - ew.orderBy("id"); | |
| 66 | - page = templateVersionService.selectPage(page,ew); | |
| 67 | - Map<String, Object> map = toGridData(page); | |
| 68 | - return map; | |
| 61 | + ew.orderBy("id");*/ | |
| 62 | + List<ContentTemplateVersion> tempVerList = templateVersionService.selectList(null); | |
| 63 | + return tempVerList; | |
| 69 | 64 | } |
| 70 | 65 | |
| 71 | 66 | @ResponseBody |
| ... | ... | @@ -93,7 +88,6 @@ |
| 93 | 88 | messTemp.setIfdel(ctd.getIfdel()); |
| 94 | 89 | for(int i =0;i<tagIds.length;i++) { |
| 95 | 90 | String tagId = tagIds[i]; |
| 96 | - System.out.println("tagsId前---------------->:" + tagId); | |
| 97 | 91 | if(tagId.indexOf(",")!=0){ |
| 98 | 92 | tagId = ","+tagId; |
| 99 | 93 | } |
| ... | ... | @@ -105,7 +99,6 @@ |
| 105 | 99 | ctmt.setMessageTemplate(messTemp.getId()); |
| 106 | 100 | ctmt.setTagsIds(tagId); |
| 107 | 101 | messageTagsService.insert(ctmt); |
| 108 | - System.out.println("tagsId后---------------->:" + tagId); | |
| 109 | 102 | } |
| 110 | 103 | messageTemplateService.insert(messTemp); |
| 111 | 104 | } |
parent/center.manager/src/main/resources/logback.xml
View file @
a61bd89
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | |
| 30 | 30 | <!-- 下面配置一些第三方包的日志过滤级别,用于避免刷屏 --> |
| 31 | 31 | <!-- 打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF 默认是DEBUG --> |
| 32 | - <logger name="org.springframework" level="INFO"/> | |
| 32 | + <logger name="org.springframework" level="WARN"/> | |
| 33 | 33 | <logger name="org.apache" level="DEBUG"/> |
| 34 | 34 | <logger name="org.mybatis.spring" level="DEBUG"/> |
| 35 | 35 | <logger name="org.apache.ibatis" level="DEBUG"/> |
parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_edit.html
View file @
a61bd89
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | </div> |
| 59 | 59 | <div class="hr-line-dashed"></div> |
| 60 | 60 | <div class="form-group"> |
| 61 | - <label class="col-sm-2 control-label" for="">*封面:</label> | |
| 61 | + <label class="col-sm-2 control-label">*封面:</label> | |
| 62 | 62 | <div class="col-sm-8"> |
| 63 | 63 | <div class="btn-group m-b col-sm-12 "> |
| 64 | 64 | <label class="btn btn-sm btn-info w-sm col-sm-3" |
| ... | ... | @@ -93,7 +93,7 @@ |
| 93 | 93 | <label class="col-sm-2 control-label">*标题:</label> |
| 94 | 94 | <div class="col-sm-8"> |
| 95 | 95 | <input type="text" maxlength="32" value="$!conArtic.title" name="title" |
| 96 | - class="form-control w-lg" required="" aria-required="true"> | |
| 96 | + class="form-control w-lg" required=""> | |
| 97 | 97 | </div> |
| 98 | 98 | </div> |
| 99 | 99 | <div class="form-group" id="linkContent" style="display:none"> |
| ... | ... | @@ -104,8 +104,8 @@ |
| 104 | 104 | </div> |
| 105 | 105 | <div class="form-group" id="zaiyaoContent"> |
| 106 | 106 | <label class="col-sm-2 control-label">*摘要:</label> |
| 107 | - <div class="col-sm-5"> | |
| 108 | - <input type="text" maxlength="255" value="$!conArtic.introduction" required="" id="introdu" name="introduction" class="form-control w-lg"> | |
| 107 | + <div class="col-sm-8"> | |
| 108 | + <input type="text" maxlength="1024" value="$!conArtic.introduction" required="" id="introdu" name="introduction" class="form-control w-lg"> | |
| 109 | 109 | </div> |
| 110 | 110 | </div> |
| 111 | 111 | |
| ... | ... | @@ -269,7 +269,8 @@ |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | function initSeleTags(){ |
| 272 | - if("$!tags" != "[]"){ | |
| 272 | + var tags = "$!tags"; | |
| 273 | + if(tags != "" && tags != "[]"){ | |
| 273 | 274 | #foreach($tg in $tags) |
| 274 | 275 | addSeleTags("${tg.tagsIds}".split(",")); |
| 275 | 276 | #end |
| ... | ... | @@ -286,6 +287,11 @@ |
| 286 | 287 | initCloumnData(); |
| 287 | 288 | //初始化标签数据 |
| 288 | 289 | initTagsData(); |
| 290 | + //内容类型 1:普通内容,2:专题内容 | |
| 291 | + var contentType = "$!conArtic.contentType"; | |
| 292 | + if(contentType == "2"){ | |
| 293 | + switchContent(2); | |
| 294 | + } | |
| 289 | 295 | |
| 290 | 296 | //初始化 |
| 291 | 297 | var ue = UE.getEditor('editor', { |
| ... | ... | @@ -300,7 +306,6 @@ |
| 300 | 306 | var pickImgSrc = $("#pickImage").attr("src"); |
| 301 | 307 | var content = UE.getEditor('editor').getContent(); |
| 302 | 308 | data+="&content="+content; |
| 303 | - | |
| 304 | 309 | if(pickImgSrc.indexOf("p0.jpg")==-1){ |
| 305 | 310 | data+="&image="+pickImgSrc; |
| 306 | 311 | } |
| ... | ... | @@ -308,8 +313,11 @@ |
| 308 | 313 | for(var i=1;i<seleTagNum;i++){ |
| 309 | 314 | data+="&tags["+(i-1)+"]=,"+$("#select"+i).val()+","; |
| 310 | 315 | } |
| 311 | - ajaxPost(APP.PATH + "/contentArticles/create", data); | |
| 312 | - parent.reloadGrid('dataTable'); | |
| 316 | + ajaxPost(APP.PATH + "/contentArticles/create", data,function(r){ | |
| 317 | + msg(r.message); | |
| 318 | + parent.reloadGrid('dataTable'); | |
| 319 | + parent.layer.closeAll();//关闭弹窗 | |
| 320 | + }); | |
| 313 | 321 | } |
| 314 | 322 | } |
| 315 | 323 | </script> |
parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_list.html
View file @
a61bd89
| ... | ... | @@ -5,13 +5,38 @@ |
| 5 | 5 | <form role="form" class="form-inline"> |
| 6 | 6 | <div class="row wrapper"> |
| 7 | 7 | <div class="col-sm-12"> |
| 8 | - <div class="form-group col-sm-3"> | |
| 8 | + <div class="btn-group m-b col-sm-6 "> | |
| 9 | + <label class="btn btn-sm btn-default w-sm col-sm-2" onclick="switchContent('','qbChe')"> | |
| 10 | + <i class="fa text-active statusChe" id="qbChe"></i> 全部 | |
| 11 | + </label> | |
| 12 | + <label class="btn btn-sm btn-primary w-sm col-sm-2" onclick="switchContent(1,'dshChe')"> | |
| 13 | + <i class="fa text-active statusChe" id="dshChe"></i> 待审核 | |
| 14 | + </label> | |
| 15 | + <label class="btn btn-sm btn-success w-sm col-sm-2" onclick="switchContent(2,'dfbChe')"> | |
| 16 | + <i class="fa text-active statusChe" id="dfbChe"></i> 待发布 | |
| 17 | + </label> | |
| 18 | + <label class="btn btn-sm btn-info w-sm col-sm-2" onclick="switchContent(3,'yfbChe')"> | |
| 19 | + <i class="fa text-active statusChe" id="yfbChe"></i> 已发布 | |
| 20 | + </label> | |
| 21 | + <label class="btn btn-sm btn btn-warning w-sm col-sm-2" onclick="switchContent(4,'yxxChe')"> | |
| 22 | + <i class="fa text-active statusChe" id="yxxChe"></i> 已下线 | |
| 23 | + </label> | |
| 24 | + <input type="hidden" id="status"> | |
| 25 | + </div> | |
| 26 | + </div> | |
| 27 | + <div class="col-sm-12"> | |
| 28 | + <div class="form-group col-sm-2"> | |
| 29 | + <label class="control-label">标题:</label> | |
| 30 | + <input style='width: 100%;height: 36px;' type="text" placeholder="请输入标题" id="title" class="form-control"> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + <div class="form-group col-sm-2"> | |
| 9 | 34 | <label class="control-label">所属栏目:</label> |
| 10 | 35 | <select class="form-control" style='width: 100%;height: 36px;' id="columnSeleHtml"> |
| 11 | 36 | |
| 12 | 37 | </select> |
| 13 | 38 | </div> |
| 14 | - <div class="form-group col-sm-3"> | |
| 39 | + <div class="form-group col-sm-2"> | |
| 15 | 40 | <label class="control-label">分类:</label> |
| 16 | 41 | <select class="form-control" style='width: 100%;height: 36px;' id="type"> |
| 17 | 42 | <option value>全部</option> |
| 18 | 43 | |
| 19 | 44 | |
| ... | ... | @@ -20,23 +45,17 @@ |
| 20 | 45 | <option value="3">其它</option> |
| 21 | 46 | </select> |
| 22 | 47 | </div> |
| 23 | - <div class="form-group col-sm-3" id="seleTagsHtml"> | |
| 48 | + <div class="form-group col-sm-2" id="seleTagsHtml"> | |
| 24 | 49 | <label class="control-label">标签:</label> |
| 25 | 50 | </div> |
| 26 | - <div class="form-group col-sm-3"> | |
| 27 | - <label class="control-label">标题:</label> | |
| 28 | - <input style='width: 100%;height: 36px;' type="text" placeholder="请输入标题" id="title" class="form-control"> | |
| 51 | + <div class="title-action" onclick="search();"> | |
| 52 | + <a class="btn btn-primary"><i class="fa fa-search"></i> 查询</a> | |
| 29 | 53 | </div> |
| 30 | 54 | </div> |
| 31 | 55 | </div> |
| 32 | 56 | </form> |
| 33 | 57 | </div> |
| 34 | 58 | </div> |
| 35 | - <div class="col-sm-2"> | |
| 36 | - <div class="title-action" onclick="search();"> | |
| 37 | - <a class="btn btn-primary"><i class="fa fa-search"></i> 查询</a> | |
| 38 | - </div> | |
| 39 | - </div> | |
| 40 | 59 | </div> |
| 41 | 60 | <div class="wrapper wrapper-content"> |
| 42 | 61 | <div class="row"> |
| 43 | 62 | |
| ... | ... | @@ -53,12 +72,19 @@ |
| 53 | 72 | #end |
| 54 | 73 | #override("js") |
| 55 | 74 | <script type="text/javascript"> |
| 75 | + function switchContent(num,cname) { | |
| 76 | + $(".statusChe").removeClass("fa-check"); | |
| 77 | + $("#"+cname).addClass("fa-check"); | |
| 78 | + $("#status").val(num); | |
| 79 | + search(); | |
| 80 | + } | |
| 56 | 81 | $(function(){ |
| 57 | 82 | //初始化栏目 |
| 58 | 83 | initCloumnData(); |
| 59 | 84 | //初始化标签选项 |
| 60 | 85 | initTags(); |
| 61 | - | |
| 86 | + //加载表格数据 | |
| 87 | + initData(); | |
| 62 | 88 | }) |
| 63 | 89 | function initTags(){ |
| 64 | 90 | $.get("${ctx}/contentTags/seleList", "json", function(data) { |
| 65 | 91 | |
| 66 | 92 | |
| ... | ... | @@ -99,15 +125,19 @@ |
| 99 | 125 | } |
| 100 | 126 | |
| 101 | 127 | function search(){ |
| 128 | + var status = $("#status").val(); | |
| 102 | 129 | var comId = $("#columnSeleHtml").val(); |
| 103 | 130 | var type = $("#type").val(); |
| 104 | 131 | var title = $("#title").val(); |
| 105 | 132 | var seleTagArrs = $("#seleTagArrs").val(); |
| 106 | 133 | |
| 107 | 134 | var querys = {}; |
| 108 | - if(comId!=""){ | |
| 109 | - querys.columnId = comId; | |
| 135 | + if(status!=""){ | |
| 136 | + querys.status = status; | |
| 110 | 137 | } |
| 138 | + if(comId!=""){ | |
| 139 | + querys.columnId = comId; | |
| 140 | + } | |
| 111 | 141 | if(type!=""){ |
| 112 | 142 | querys.type = type; |
| 113 | 143 | } |
| ... | ... | @@ -115,7 +145,7 @@ |
| 115 | 145 | querys.title = title; |
| 116 | 146 | } |
| 117 | 147 | if(seleTagArrs!=""){ |
| 118 | - querys.ccName = seleTagArrs; | |
| 148 | + querys.tagId = seleTagArrs; | |
| 119 | 149 | } |
| 120 | 150 | |
| 121 | 151 | var queryParams = { |
| 122 | 152 | |
| 123 | 153 | |
| 124 | 154 | |
| ... | ... | @@ -139,73 +169,159 @@ |
| 139 | 169 | function del(){ |
| 140 | 170 | goDelete("dataTable","id", APP.PATH + controllerRequestMappint + "@value@/delete"); |
| 141 | 171 | } |
| 142 | -$('#dataTable').bootstrapTable({ | |
| 143 | - url: '${ctx}/contentArticles/list', //请求后台的URL(*) | |
| 144 | - method: 'get', //请求方式(*) | |
| 145 | - striped: true, //是否显示行间隔色 | |
| 146 | - cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) | |
| 147 | - sortable: false, //是否启用排序 | |
| 148 | - sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*) | |
| 149 | - pageNumber:1, //初始化加载第一页,默认第一页 | |
| 150 | - pageSize: 50, //每页的记录行数(*) | |
| 151 | - pageList: [200], //可供选择的每页的行数(*) | |
| 152 | - strictSearch: true, | |
| 153 | - showRefresh: true, | |
| 154 | - showColumns: true, | |
| 155 | - showExport: true, | |
| 156 | - showToggle: true, | |
| 157 | - detailView: true, | |
| 158 | - onDblClickRow:function(row,ev){ | |
| 159 | - popWindow("修改图文信息", APP.PATH + controllerRequestMappint + row.id+"/toEdit?id="+row.id,850,800); | |
| 160 | - }, | |
| 161 | - clickToSelect: true, //是否启用点击选中行 | |
| 162 | - //height: 600, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 | |
| 163 | - uniqueId: "id", //每一行的唯一标识,一般为主键列 | |
| 164 | - cardView: false, //是否显示详细视图 | |
| 165 | - detailView: false, //是否显示父子表 | |
| 166 | - columns:[{ | |
| 167 | - field: 'perent', | |
| 168 | - title: '', | |
| 169 | - checkbox: true | |
| 170 | - },{ | |
| 171 | - field: 'id', | |
| 172 | - title: '', | |
| 173 | - visible: false | |
| 174 | - },{ | |
| 175 | - field: 'title', | |
| 176 | - title: '标题' | |
| 177 | - },{ | |
| 178 | - field: 'categoryName', | |
| 179 | - title: '所属栏目' | |
| 180 | - },{ | |
| 181 | - field: 'typeName', | |
| 182 | - title: '分类' | |
| 183 | - },{ | |
| 184 | - field:"tagIds", | |
| 185 | - title:"标签", | |
| 186 | - formatter:function(value,row,index){ | |
| 187 | - var tagsNames = value.split(","); | |
| 188 | - var tagsHtml = ""; | |
| 189 | - for(var i =0;i<tagsNames.length;i++){ | |
| 190 | - if((i+1)%5==1){ | |
| 191 | - tagsHtml+='<span class="badge badge-primary" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 192 | - }else if((i+1)%5==2){ | |
| 193 | - tagsHtml+='<span class="badge label-info" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 194 | - }else if((i+1)%5==3){ | |
| 195 | - tagsHtml+='<span class="badge label-success" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 196 | - }else if((i+1)%5==4){ | |
| 197 | - tagsHtml+='<span class="badge label-warning" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 172 | + | |
| 173 | +function initData(){ | |
| 174 | + $('#dataTable').bootstrapTable({ | |
| 175 | + url: '${ctx}/contentArticles/list', //请求后台的URL(*) | |
| 176 | + method: 'get', //请求方式(*) | |
| 177 | + contentType:'application/x-www-form-urlencoded', | |
| 178 | + toolbar: '#toolbar', //工具按钮用哪个容器 | |
| 179 | + striped: true, //是否显示行间隔色 | |
| 180 | + cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) | |
| 181 | + pagination: true, //是否显示分页(*) | |
| 182 | + sortable: false, //是否启用排序 | |
| 183 | + sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*) | |
| 184 | + pageNumber:1, //初始化加载第一页,默认第一页 | |
| 185 | + pageSize: 10, //每页的记录行数(*) | |
| 186 | + pageList: [10, 25, 50, 100], //可供选择的每页的行数(*) | |
| 187 | + strictSearch: true, | |
| 188 | + queryParams:function (params) { | |
| 189 | + return { | |
| 190 | + _size: params.limit, //每页记录数 | |
| 191 | + _offset: params.offset , //偏移量 | |
| 192 | + }; | |
| 193 | + }, | |
| 194 | + clickToSelect: true, //是否启用点击选中行 | |
| 195 | + uniqueId: "id", //每一行的唯一标识,一般为主键列 | |
| 196 | + cardView: false, //是否显示详细视图 | |
| 197 | + showRefresh: true, | |
| 198 | + showColumns: true, | |
| 199 | + showExport: true, | |
| 200 | + showToggle: true, | |
| 201 | + detailView: false, | |
| 202 | + onDblClickRow:function(row,ev){ | |
| 203 | + popWindow("修改图文信息", APP.PATH + controllerRequestMappint + row.id+"/toEdit?id="+row.id,850,800); | |
| 204 | + }, | |
| 205 | + columns:[{ | |
| 206 | + field: 'perent', | |
| 207 | + title: '', | |
| 208 | + checkbox: true | |
| 209 | + },{ | |
| 210 | + field: 'title', | |
| 211 | + title: '标题', | |
| 212 | + width:"20%", | |
| 213 | + },{ | |
| 214 | + field: 'categoryName', | |
| 215 | + title: '所属栏目', | |
| 216 | + width:"20%", | |
| 217 | + },{ | |
| 218 | + field: 'typeName', | |
| 219 | + title: '分类', | |
| 220 | + width:"10%", | |
| 221 | + },{ | |
| 222 | + field: 'status', | |
| 223 | + title: '审核状态', | |
| 224 | + width:"10%", | |
| 225 | + formatter:function(value,row,index){ | |
| 226 | + switch (value){ | |
| 227 | + case 1: return "待审核"; | |
| 228 | + case 2: return "待发布"; | |
| 229 | + case 3: return "已发布"; | |
| 230 | + case 4: return "已下线"; | |
| 231 | + default: return "未知"; | |
| 232 | + } | |
| 233 | + } | |
| 234 | + },{ | |
| 235 | + field:"tagIds", | |
| 236 | + title:"标签", | |
| 237 | + width:"30%", | |
| 238 | + formatter:function(value,row,index){ | |
| 239 | + var tagsNames = value.split(","); | |
| 240 | + var tagsHtml = ""; | |
| 241 | + for(var i =0;i<tagsNames.length;i++){ | |
| 242 | + if((i+1)%5==1){ | |
| 243 | + tagsHtml+='<span class="badge badge-primary" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 244 | + }else if((i+1)%5==2){ | |
| 245 | + tagsHtml+='<span class="badge label-info" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 246 | + }else if((i+1)%5==3){ | |
| 247 | + tagsHtml+='<span class="badge label-success" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 248 | + }else if((i+1)%5==4){ | |
| 249 | + tagsHtml+='<span class="badge label-warning" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 250 | + }else{ | |
| 251 | + tagsHtml+='<span class="badge label-danger" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 252 | + } | |
| 253 | + } | |
| 254 | + return tagsHtml; | |
| 255 | + } | |
| 256 | + },{ | |
| 257 | + field:"id", | |
| 258 | + title:"操作", | |
| 259 | + width:"15%", | |
| 260 | + formatter:function(value,row,index){ | |
| 261 | + if(row.status == 1){ | |
| 262 | + return "<button class='btn btn-sm btn-success m-r-xs' onclick=audit('"+row.id+"',1)>审核</button>"; | |
| 263 | + }else if(row.status == 2 ||row.status == 4){ | |
| 264 | + return "<button class='btn btn-sm btn-info m-r-xs' onclick=audit('"+row.id+"',2)>发布</button>"; | |
| 265 | + }else if(row.status == 3){ | |
| 266 | + return "<button class='btn btn-sm btn-danger m-r-xs' onclick=audit('"+row.id+"',3)>下线</button>"; | |
| 198 | 267 | }else{ |
| 199 | - tagsHtml+='<span class="badge label-danger" style="margin: 3px;">'+tagsNames[i]+'</span>'; | |
| 268 | + return ""; | |
| 200 | 269 | } |
| 201 | 270 | } |
| 202 | - return tagsHtml; | |
| 271 | + }] | |
| 272 | + }); | |
| 273 | +} | |
| 274 | +function audit(id,status){ | |
| 275 | + if(status == 1){//进入审核页面 | |
| 276 | + layer.open({ | |
| 277 | + type: 1 //Page层类型 | |
| 278 | + ,area: ['530px', '300px'] | |
| 279 | + ,title: '审核' | |
| 280 | + ,shade: 0.6 //遮罩透明度 | |
| 281 | + ,maxmin: true //允许全屏最小化 | |
| 282 | + ,anim: 2 //0-6的动画形式,-1不开启 | |
| 283 | + ,content: "<div class='col-sm-9 col-sm-offset-1'>" + | |
| 284 | + "<form action='#' class='form-horizontal m-t navbar-form navbar-left' id='validForm'>" + | |
| 285 | + "<div class='form-group'><label class='col-sm-4 control-label'>*审核意见:</label><div class='col-sm-7'>" + | |
| 286 | + "<textarea maxlength='256' cols='30%' rows='7' required name='reason'></textarea>"+ | |
| 287 | + "</div></div><div class='col-sm-offset-8'>" + | |
| 288 | + "</div></form></div>" | |
| 289 | + ,btn: ['通过','取消'] //按钮 | |
| 290 | + ,yes:function(){ | |
| 291 | + auditReas(id,1); | |
| 292 | + },btn2:function(){ | |
| 293 | + layer.msg('取消', {icon: 1}); | |
| 294 | + } | |
| 203 | 295 | } |
| 204 | - },{ | |
| 205 | - field:"createName", | |
| 206 | - title:"添加人" | |
| 207 | - }] | |
| 208 | -}); | |
| 296 | + ); | |
| 297 | + }else if(status == 2){//发布 | |
| 298 | + auditReas(id,2) | |
| 299 | + }else if(status == 3){//下线 | |
| 300 | + auditReas(id,3) | |
| 301 | + } | |
| 302 | +} | |
| 303 | +function auditReas(id,type){ | |
| 304 | + if(type==1){//审核 | |
| 305 | + if($("#validForm").valid()){ | |
| 306 | + var data = $('#validForm').serialize(); | |
| 307 | + data+="&type="+type; | |
| 308 | + data+="&id="+id; | |
| 309 | + ajaxPost( APP.PATH + controllerRequestMappint+"/audit",data,function(r){ | |
| 310 | + msg(r.message); | |
| 311 | + search(); | |
| 312 | + }); | |
| 313 | + layer.closeAll('page');//关闭弹窗 | |
| 314 | + } | |
| 315 | + }else{//其他处理{发布、上线...} | |
| 316 | + var data = {}; | |
| 317 | + data.id = id; | |
| 318 | + data.type = type; | |
| 319 | + ajaxPost( APP.PATH + controllerRequestMappint+"/audit",data,function(r){ | |
| 320 | + msg(r.message); | |
| 321 | + search(); | |
| 322 | + }); | |
| 323 | + } | |
| 324 | +} | |
| 209 | 325 | </script> |
| 210 | 326 | #end |
| 211 | 327 | #extends("/common/base_list.html") |
parent/center.manager/src/main/webapp/WEB-INF/views/categories/categonies_edit.html
View file @
a61bd89
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | <div class="form-group"> |
| 29 | 29 | <label class="col-sm-2 control-label">*栏目名称:</label> |
| 30 | 30 | <div class="col-sm-8"> |
| 31 | - <input type="text" class="form-control" required class="form-control" | |
| 31 | + <input type="text" maxlength="32" class="form-control" required class="form-control" | |
| 32 | 32 | placeholder="请填入栏目名称" value="$!conCate.name" name="name"> |
| 33 | 33 | </div> |
| 34 | 34 | </div> |
| ... | ... | @@ -238,8 +238,12 @@ |
| 238 | 238 | var content = UE.getEditor('editor').getContent(); |
| 239 | 239 | data+="&description="+content; |
| 240 | 240 | data+="&icon="+pickImgSrc; |
| 241 | - ajaxPost(APP.PATH + "/contentCategories/create", data); | |
| 242 | - parent.reloadGrid('dataTable'); | |
| 241 | + ajaxPost(APP.PATH + "/contentCategories/create", data,function(r){ | |
| 242 | + msg(r.message); | |
| 243 | + parent.reloadGrid('dataTable'); | |
| 244 | + parent.layer.closeAll();//关闭弹窗 | |
| 245 | + }); | |
| 246 | + | |
| 243 | 247 | } |
| 244 | 248 | } |
| 245 | 249 | </script> |
parent/center.manager/src/main/webapp/WEB-INF/views/categories/categonies_list.html
View file @
a61bd89
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | <div class="row"> |
| 20 | 20 | <div class="col-sm-12"> |
| 21 | 21 | <div id="toolbar"> |
| 22 | - <button class="btn btn-info " type="button" onclick="add();"><i class="fa fa-plus"></i> 新增</button> | |
| 22 | + <button class="btn btn-info " type="button" onclick="add('','','');"><i class="fa fa-plus"></i> 新增</button> | |
| 23 | 23 | <!--<button class="btn btn-info " type="button" onclick="edit();"><i class="fa fa-paste"></i> 编辑</button>--> |
| 24 | 24 | <!-- |
| 25 | 25 | <button class="btn btn-info " type="button" onclick="del();"><i class="fa fa-trash"></i> 删除</button> |
| 26 | 26 | |
| 27 | 27 | |
| ... | ... | @@ -69,13 +69,16 @@ |
| 69 | 69 | tab.bootstrapTable({ |
| 70 | 70 | columns: [{ |
| 71 | 71 | field: 'name', |
| 72 | - title: '栏目名称' | |
| 72 | + title: '栏目名称', | |
| 73 | + width: '20%' | |
| 73 | 74 | },{ |
| 74 | 75 | field: 'description', |
| 75 | - title: '栏目简介' | |
| 76 | + title: '栏目简介', | |
| 77 | + width: '40%' | |
| 76 | 78 | },{ |
| 77 | 79 | field: 'level', |
| 78 | - title: '栏目等级' | |
| 80 | + title: '栏目等级', | |
| 81 | + width: '10%' | |
| 79 | 82 | },{ |
| 80 | 83 | fileld:'id', |
| 81 | 84 | width: '20%', |
| ... | ... | @@ -87,7 +90,7 @@ |
| 87 | 90 | }], |
| 88 | 91 | url: APP.PATH + controllerRequestMappint + "list?perId="+id, //请求后台的URL(*) |
| 89 | 92 | method: 'post', |
| 90 | - showHeader:true, | |
| 93 | + showHeader:false, | |
| 91 | 94 | striped: true, //是否显示行间隔色 |
| 92 | 95 | cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
| 93 | 96 | sortable: false, //是否启用排序 |
| 94 | 97 | |
| 95 | 98 | |
| ... | ... | @@ -109,13 +112,16 @@ |
| 109 | 112 | $('#dataTable').bootstrapTable({ |
| 110 | 113 | columns: [{ |
| 111 | 114 | field: 'name', |
| 112 | - title: '栏目名称' | |
| 115 | + title: '栏目名称', | |
| 116 | + width: '20%' | |
| 113 | 117 | },{ |
| 114 | 118 | field: 'description', |
| 115 | - title: '栏目简介' | |
| 119 | + title: '栏目简介', | |
| 120 | + width: '40%' | |
| 116 | 121 | },{ |
| 117 | 122 | field: 'level', |
| 118 | - title: '栏目等级' | |
| 123 | + title: '栏目等级', | |
| 124 | + width: '10%' | |
| 119 | 125 | },{ |
| 120 | 126 | fileld:'id', |
| 121 | 127 | width: '20%', |
parent/center.manager/src/main/webapp/WEB-INF/views/common/base_list.html
View file @
a61bd89
parent/center.manager/src/main/webapp/WEB-INF/views/content/template_edit.html
View file @
a61bd89
| ... | ... | @@ -11,14 +11,15 @@ |
| 11 | 11 | <label class="col-sm-2 control-label">版本库名称:</label> |
| 12 | 12 | <div class="col-sm-9"> |
| 13 | 13 | <input type="text" name="vName" value="$!vName" disabled class="form-control"> |
| 14 | - <input type="hidden" name="id" value="$!id" disabled class="form-control"> | |
| 14 | + <input type="hidden" class="i-checks" value="$!verId" id="verId" name="templateVersionId"> | |
| 15 | + <input type="hidden" name="id" value="$!id" class="form-control"> | |
| 15 | 16 | </div> |
| 16 | 17 | </div> |
| 17 | 18 | |
| 18 | 19 | <div class="form-group"> |
| 19 | 20 | <label class="col-sm-2 control-label">*短信内容:</label> |
| 20 | 21 | <div class="col-sm-9"> |
| 21 | - <textarea class="form-control" rows="4" cols="12" name="content" id="content" required placeholder="请输入短信内容">$!tempInfo.content</textarea> | |
| 22 | + <textarea class="form-control" rows="4" maxlength="128" cols="12" name="content" id="content" required placeholder="请输入短信内容">$!tempInfo.content</textarea> | |
| 22 | 23 | </div> |
| 23 | 24 | </div> |
| 24 | 25 | <div class="form-group"> |
| ... | ... | @@ -36,12 +37,6 @@ |
| 36 | 37 | </div> |
| 37 | 38 | </label> |
| 38 | 39 | </div> |
| 39 | - <div class="form-group"> | |
| 40 | - <label class="col-sm-2 control-label"></label> | |
| 41 | - <div class="col-sm-10"> | |
| 42 | - <input type="hidden" class="i-checks" value="$!verId" name="templateVersionId"> | |
| 43 | - </div> | |
| 44 | - </div> | |
| 45 | 40 | <div class="form-group hidden" id="imageTitle"> |
| 46 | 41 | <label class="col-sm-2 control-label">标题:</label> |
| 47 | 42 | <div class="col-sm-9"> |
| ... | ... | @@ -130,7 +125,7 @@ |
| 130 | 125 | }); |
| 131 | 126 | |
| 132 | 127 | function initSeleTags(){ |
| 133 | - if("$!tags" != ""){ | |
| 128 | + if("$!tags" != "" && "$!tags" != "[]"){ | |
| 134 | 129 | #foreach($tg in $tags) |
| 135 | 130 | //alert("${tg.tagsIds}".split(",")); |
| 136 | 131 | addSeleTags("${tg.tagsIds}".split(",")); |
| 137 | 132 | |
| 138 | 133 | |
| ... | ... | @@ -159,24 +154,19 @@ |
| 159 | 154 | |
| 160 | 155 | function save(){ |
| 161 | 156 | if($('#validForm').valid()){ |
| 162 | - | |
| 163 | 157 | var data = $('#validForm').serialize(); |
| 164 | 158 | if($("#multChe:checked").val() == "on"){//图文指导 |
| 165 | 159 | data+="&isRich=1"; |
| 166 | 160 | }else{ |
| 167 | 161 | data+="&isRich=0"; |
| 168 | 162 | } |
| 169 | - | |
| 170 | 163 | for(var i=1;i<seleTagNum;i++){ |
| 171 | 164 | data+="&contentTagIds["+(i-1)+"]=,"+$("#select"+i).val()+","; |
| 172 | 165 | } |
| 173 | - if("$!id" == ""){ | |
| 174 | - data.id = $("#id").val(); | |
| 175 | - ajaxPost(APP.PATH + "/contentMessageTemplate/create",data); | |
| 176 | - }else{ | |
| 177 | - ajaxPost(APP.PATH + "/contentMessageTemplate/update",data); | |
| 178 | - } | |
| 179 | - parent.reloadGrid('dataTable'); | |
| 166 | + ajaxPost(APP.PATH + "/contentMessageTemplate/create",data,function (r) { | |
| 167 | + msg(r.message); | |
| 168 | + parent.showMessageList();//关闭弹窗 | |
| 169 | + }); | |
| 180 | 170 | |
| 181 | 171 | // $('#validForm')[0].reset(); |
| 182 | 172 | // UE.getEditor('editor').setContent(""); |
parent/center.manager/src/main/webapp/WEB-INF/views/content/template_list.html
View file @
a61bd89
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | <div class="col-sm-12"> |
| 55 | 55 | <div id="toolbar"> |
| 56 | 56 | <button class="btn btn-info " type="button" onclick="add();"><i class="fa fa-plus"></i> 新增</button> |
| 57 | - <button class="btn btn-info " type="button" onclick="edit();"><i class="fa fa-paste"></i> 编辑</button> | |
| 57 | + <!--<button class="btn btn-info " type="button" onclick="edit();"><i class="fa fa-paste"></i> 编辑</button>--> | |
| 58 | 58 | <button class="btn btn-info " type="button" onclick="del();"><i class="fa fa-trash"></i> 删除</button> |
| 59 | 59 | </div> |
| 60 | 60 | <table id="dataTable"></table> |
| ... | ... | @@ -76,7 +76,13 @@ |
| 76 | 76 | ,shade: 0.6 //遮罩透明度 |
| 77 | 77 | ,maxmin: true //允许全屏最小化 |
| 78 | 78 | ,anim: 2 //0-6的动画形式,-1不开启 |
| 79 | - ,content: "<div class='col-sm-9 col-sm-offset-1'><form action='#' class='form-horizontal m-t navbar-form navbar-left' id='validForm'><div class='form-group'><label class='col-sm-4 control-label'>版本名称:</label><div class='col-sm-5'><input type='text' class='form-control w-lg' placeholder='版本名称' id='versionName' name='versionName' aria-required='true' required></div></div><div class='col-sm-offset-12'><a onclick='saveVersion()' class='btn btn-primary navbar-btn'>提交</a></div></form></div>" | |
| 79 | + ,content: "<div class='col-sm-9 col-sm-offset-1'><form action='#' class='form-horizontal m-t navbar-form navbar-left' id='validForm'><div class='form-group'><label class='col-sm-4 control-label'>版本名称:</label><div class='col-sm-5'><input type='text' class='form-control w-lg' maxlength='10' placeholder='版本名称' id='versionName' name='versionName' aria-required='true' required></div></div><div class='col-sm-offset-12'></div></form></div>" | |
| 80 | + ,btn: ['通过','取消'] //按钮 | |
| 81 | + ,yes:function(){ | |
| 82 | + saveVersion(); | |
| 83 | + },btn2:function(){ | |
| 84 | + layer.msg('取消', {icon: 1}); | |
| 85 | + } | |
| 80 | 86 | }); |
| 81 | 87 | } |
| 82 | 88 | |
| ... | ... | @@ -115,7 +121,11 @@ |
| 115 | 121 | function saveVersion(){ |
| 116 | 122 | if($('#validForm').valid()){ |
| 117 | 123 | var data = $('#validForm').serialize(); |
| 118 | - ajaxPost(APP.PATH +'/contentTemplateVersion/create',data); | |
| 124 | + ajaxPost(APP.PATH +'/contentTemplateVersion/create',data,function(r){ | |
| 125 | + msg(r.message); | |
| 126 | + initTempVersion(); | |
| 127 | + layer.closeAll();//关闭弹窗 | |
| 128 | + }); | |
| 119 | 129 | } |
| 120 | 130 | } |
| 121 | 131 | function add() { |
| 122 | 132 | |
| 123 | 133 | |
| ... | ... | @@ -131,16 +141,21 @@ |
| 131 | 141 | var templateVer = []; |
| 132 | 142 | var version = ""; |
| 133 | 143 | function showMessageList(vId){ |
| 134 | - version = templateVer[vId]; | |
| 135 | - $("#verId").val(version.id); | |
| 136 | - $("#version").text(version.versionName); | |
| 144 | + if(vId!=null){ | |
| 145 | + version = templateVer[vId]; | |
| 146 | + }else{ | |
| 147 | + layer.closeAll();//关闭弹窗 | |
| 148 | + } | |
| 149 | + $("#verId").val(version.id); | |
| 150 | + $("#version").text(version.versionName); | |
| 137 | 151 | |
| 138 | 152 | var querys = {verId:version.id}; |
| 153 | + var queryParams = { | |
| 154 | + query:querys | |
| 155 | + } | |
| 156 | + $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 139 | 157 | |
| 140 | - var queryParams = { | |
| 141 | - query:querys | |
| 142 | - } | |
| 143 | - $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 158 | + | |
| 144 | 159 | } |
| 145 | 160 | |
| 146 | 161 | function initMsgTab(){ |
| 147 | 162 | |
| 148 | 163 | |
| ... | ... | @@ -148,18 +163,22 @@ |
| 148 | 163 | url: '${ctx}/contentMessageTemplate/list', //请求后台的URL(*) |
| 149 | 164 | method: 'get', //请求方式(*) |
| 150 | 165 | striped: true, //是否显示行间隔色 |
| 166 | + pagination: true, | |
| 151 | 167 | cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
| 152 | 168 | sortable: false, //是否启用排序 |
| 153 | 169 | sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*) |
| 154 | 170 | pageNumber:1, //初始化加载第一页,默认第一页 |
| 155 | - pageSize: 50, //每页的记录行数(*) | |
| 171 | + pageSize: 10, //每页的记录行数(*) | |
| 156 | 172 | pageList: [200], //可供选择的每页的行数(*) |
| 157 | 173 | strictSearch: true, |
| 158 | 174 | onDblClickRow:function(row,ev){ |
| 159 | 175 | popWindow("修改信息模板", APP.PATH + controllerRequestMappint + version.id+"/toEdit?id="+row.id+"&vName="+version.versionName,850,800); |
| 160 | 176 | }, |
| 161 | - queryParams:{ | |
| 162 | - verId:0 | |
| 177 | + queryParams:function (params) { | |
| 178 | + return { | |
| 179 | + _size: params.limit, //每页记录数 | |
| 180 | + _offset: params.offset , //偏移量 | |
| 181 | + }; | |
| 163 | 182 | }, |
| 164 | 183 | clickToSelect: true, //是否启用点击选中行 |
| 165 | 184 | //height: 600, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 |
| 166 | 185 | |
| ... | ... | @@ -176,10 +195,12 @@ |
| 176 | 195 | visible:false |
| 177 | 196 | },{ |
| 178 | 197 | field: 'content', |
| 179 | - title: '短信内容' | |
| 198 | + title: '短信内容', | |
| 199 | + width:"70%" | |
| 180 | 200 | },{ |
| 181 | 201 | field:'contentTagIds', |
| 182 | 202 | title:'标签', |
| 203 | + width:"30%", | |
| 183 | 204 | formatter:function(value,row,index){ |
| 184 | 205 | var tagsNames = value.split(","); |
| 185 | 206 | var tagsHtml = ""; |
| 186 | 207 | |
| 187 | 208 | |
| 188 | 209 | |
| 189 | 210 | |
| 190 | 211 | |
| ... | ... | @@ -214,31 +235,41 @@ |
| 214 | 235 | "<div class='form-group'><label class='col-sm-5 control-label'>将要复制的版本名称:</label><div class='col-sm-5'><input type='hidden' name='perId' value='"+ver+"'/>" + |
| 215 | 236 | "<input type='text' class='form-control w-lg' value='"+name+"' disabled></div></div>" + |
| 216 | 237 | "<div class='form-group'><label class='col-sm-6 control-label'>版本名称:</label><div class='col-sm-5'>" + |
| 217 | - "<input type='text' class='form-control w-lg' placeholder='版本名称' name='versionName' required></div></div>" + | |
| 218 | - "<div class='col-sm-offset-9'><a onclick='saveVersion()' class='btn btn-primary navbar-btn'>提交</a></div></form></div>" | |
| 238 | + "<input type='text' class='form-control w-lg' maxlength='10' placeholder='版本名称' name='versionName' required></div></div></form></div>" | |
| 239 | + ,btn: ['通过','取消'] //按钮 | |
| 240 | + ,yes:function(){ | |
| 241 | + saveVersion(); | |
| 242 | + },btn2:function(){ | |
| 243 | + layer.msg('取消', {icon: 1}); | |
| 244 | + } | |
| 219 | 245 | }); |
| 220 | 246 | } |
| 221 | - | |
| 222 | - $(function(){ | |
| 223 | - initTagsData(); | |
| 224 | - initMsgTab(); | |
| 247 | + //初始化短信版本 | |
| 248 | + function initTempVersion(){ | |
| 225 | 249 | //获取消息模板版本列表 |
| 226 | 250 | $.ajax({ |
| 227 | 251 | url: "${ctx}/contentTemplateVersion/list", |
| 228 | 252 | cache: false, |
| 229 | 253 | dataType: "json", |
| 230 | 254 | success: function(data){ |
| 231 | - var data = data.rows; | |
| 232 | 255 | var versionHtml = ""; |
| 233 | 256 | if(data){ |
| 234 | - templateVer = data; | |
| 257 | + templateVer = data; | |
| 235 | 258 | data.forEach(function(i,d){ |
| 236 | 259 | versionHtml+="<li onclick='showMessageList("+d+")' class='list-group-item col-sm-9'>"+i.versionName+"</li><button onclick=copyVer('"+i.id+"','"+i.versionName+"') class='col-sm-3 btn'>复制</button>"; |
| 237 | 260 | }); |
| 261 | + $("#temp_version").empty(); | |
| 238 | 262 | $("#temp_version").append(versionHtml); |
| 239 | 263 | } |
| 240 | 264 | } |
| 241 | 265 | }); |
| 266 | + | |
| 267 | + } | |
| 268 | + | |
| 269 | + $(function(){ | |
| 270 | + initTagsData(); | |
| 271 | + initMsgTab(); | |
| 272 | + initTempVersion(); | |
| 242 | 273 | }); |
| 243 | 274 | |
| 244 | 275 | </script> |
parent/center.manager/src/main/webapp/WEB-INF/views/tags/tags_edit.html
View file @
a61bd89
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | <div class="form-group"> |
| 18 | 18 | <label class="col-sm-4 control-label">*标签名称:</label> |
| 19 | 19 | <div class="col-sm-5"> |
| 20 | - <input type="text" class="form-control" required class="form-control" | |
| 20 | + <input type="text" maxlength="32" class="form-control" required class="form-control" | |
| 21 | 21 | placeholder="请填入标签名称" value="$!contentTags.tagName" name="tagName"> |
| 22 | 22 | <input type="hidden" value="$!level" name="level"/> |
| 23 | 23 | </div> |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | <div class="form-group"> |
| 27 | 27 | <label class="col-sm-4 control-label">*标签简介:</label> |
| 28 | 28 | <div class="col-sm-5"> |
| 29 | - <textarea class="form-control" rows="4" cols="12" aria-required="true" name="tagDesc" required="true" placeholder="请输入短信内容">$!contentTags.tagDesc</textarea> | |
| 29 | + <textarea class="form-control" maxlength="128" rows="4" cols="12" aria-required="true" name="tagDesc" required="true" placeholder="请输入短信内容">$!contentTags.tagDesc</textarea> | |
| 30 | 30 | </div> |
| 31 | 31 | </div> |
| 32 | 32 | |
| 33 | 33 | |
| ... | ... | @@ -50,11 +50,14 @@ |
| 50 | 50 | |
| 51 | 51 | <script type="text/javascript"> |
| 52 | 52 | function save() { |
| 53 | - | |
| 54 | 53 | if ($('#validForm').valid()) { |
| 55 | 54 | var data = $('#validForm').serialize(); |
| 56 | - ajaxPost(APP.PATH + "/contentTags/create", data); | |
| 57 | - parent.reloadGrid('dataTable'); | |
| 55 | + ajaxPost(APP.PATH + "/contentTags/create", data,function (r){ | |
| 56 | + msg(r.message); | |
| 57 | + parent.search(); | |
| 58 | + parent.layer.closeAll();//关闭弹窗 | |
| 59 | + }); | |
| 60 | + | |
| 58 | 61 | } |
| 59 | 62 | } |
| 60 | 63 | </script> |
parent/center.manager/src/main/webapp/WEB-INF/views/tags/tags_list.html
View file @
a61bd89
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | |
| 50 | 50 | function editTag(id){ |
| 51 | 51 | if(id){ |
| 52 | - popWindow("修改标签", APP.PATH + controllerRequestMappint + id + "/toEdit",800,480); | |
| 52 | + popWindow("修改标签", APP.PATH + controllerRequestMappint + id + "/toEdit?level=0",800,480); | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| ... | ... | @@ -77,7 +77,8 @@ |
| 77 | 77 | width: '20%', |
| 78 | 78 | },{ |
| 79 | 79 | field: 'tagDesc', |
| 80 | - title: '标签简介' | |
| 80 | + title: '标签简介', | |
| 81 | + width: '40%' | |
| 81 | 82 | },{ |
| 82 | 83 | field: 'level', |
| 83 | 84 | title: '栏目等级', |
| ... | ... | @@ -93,7 +94,7 @@ |
| 93 | 94 | }], |
| 94 | 95 | url: APP.PATH + controllerRequestMappint + "list?perId="+id, //请求后台的URL(*) |
| 95 | 96 | method: 'post', |
| 96 | - showHeader:true, | |
| 97 | + showHeader:false, | |
| 97 | 98 | striped: true, //是否显示行间隔色 |
| 98 | 99 | cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) |
| 99 | 100 | sortable: false, //是否启用排序 |
| ... | ... | @@ -119,7 +120,8 @@ |
| 119 | 120 | width: '20%', |
| 120 | 121 | },{ |
| 121 | 122 | field: 'tagDesc', |
| 122 | - title: '标签简介' | |
| 123 | + title: '标签简介', | |
| 124 | + width: '40%' | |
| 123 | 125 | },{ |
| 124 | 126 | field: 'level', |
| 125 | 127 | title: '栏目等级', |
| ... | ... | @@ -154,6 +156,12 @@ |
| 154 | 156 | showExport: true, |
| 155 | 157 | showToggle: true, |
| 156 | 158 | detailView: true, |
| 159 | + queryParams:function (params) { | |
| 160 | + return { | |
| 161 | + _size: params.limit, //每页记录数 | |
| 162 | + _offset: params.offset , //偏移量 | |
| 163 | + }; | |
| 164 | + }, | |
| 157 | 165 | onExpandRow: function (index, row, detail) { |
| 158 | 166 | buildTable(detail.html('<table></table>').find('table'),row.id); |
| 159 | 167 | } |