Commit 4ce08c2524b8a8ed53c30734c9b397aa4edd2015
1 parent
3334aa2b18
Exists in
master
图文内容
Showing 15 changed files with 332 additions and 249 deletions
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentMessageTemplateMapper.java
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentMessageTemplateMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/service/content/ContentMessageTemplateService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentMessageTemplateServiceImpl.java
- parent/base.common/src/main/java/com/lyms/base/common/vo/content/AricleSearchDTO.java
- parent/base.common/src/main/java/com/lyms/base/common/vo/content/ContentCategoriesDTO.java
- parent/base.common/src/main/java/com/lyms/base/common/vo/content/ContentTagsDTO.java
- parent/base.common/src/main/java/com/lyms/base/common/vo/content/MsgTempSerachDTO.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/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/content/template_list.html
- parent/center.manager/src/main/webapp/WEB-INF/views/tags/tags_edit.html
parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentMessageTemplateMapper.java
View file @
4ce08c2
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.baomidou.mybatisplus.plugins.Page; |
| 5 | 5 | import com.lyms.base.common.entity.content.ContentMessageTemplate; |
| 6 | 6 | import com.lyms.base.common.vo.content.ContentMessageTemplateDTO; |
| 7 | +import com.lyms.base.common.vo.content.MsgTempSerachDTO; | |
| 7 | 8 | import org.springframework.stereotype.Repository; |
| 8 | 9 | |
| 9 | 10 | import java.io.Serializable; |
| ... | ... | @@ -21,7 +22,7 @@ |
| 21 | 22 | |
| 22 | 23 | public Integer deleteLogicById(Serializable id); |
| 23 | 24 | |
| 24 | - public List<ContentMessageTemplateDTO> getContentMessageTemplate(Page<ContentMessageTemplateDTO> page , String verId); | |
| 25 | + public List<ContentMessageTemplateDTO> getContentMessageTemplate(Page<ContentMessageTemplateDTO> page , MsgTempSerachDTO msgTemp); | |
| 25 | 26 | |
| 26 | 27 | } |
parent/base.common/src/main/java/com/lyms/base/common/dao/content/ContentMessageTemplateMapper.xml
View file @
4ce08c2
| ... | ... | @@ -26,8 +26,21 @@ |
| 26 | 26 | </sql> |
| 27 | 27 | |
| 28 | 28 | |
| 29 | - <select id="getContentMessageTemplate" resultType="com.lyms.base.common.vo.content.ContentMessageTemplateDTO"> | |
| 30 | - select m.id as id,m.CONTENT as content,t.TAGS_IDS as contentTagIds from CONTENT_MESSAGE_TEMPLATE m left join CONTENT_TEMPLATE_MESSAGE_TAGS t on m.ID = t.MESSAGE_TEMPLATE where m.TEMPLATE_VERSION_ID =#{verIds} | |
| 29 | + <select id="getContentMessageTemplate" resultType="com.lyms.base.common.vo.content.ContentMessageTemplateDTO" parameterType="com.lyms.base.common.vo.content.MsgTempSerachDTO"> | |
| 30 | + select m.id as id,m.CONTENT as content,t.TAGS_IDS as contentTagIds from CONTENT_MESSAGE_TEMPLATE m left join CONTENT_TEMPLATE_MESSAGE_TAGS t on m.ID = t.MESSAGE_TEMPLATE | |
| 31 | + <where> | |
| 32 | + <if test="verIds!=null"> | |
| 33 | + and m.TEMPLATE_VERSION_ID =#{verId} | |
| 34 | + </if> | |
| 35 | + <if test="msgContent!=null"> | |
| 36 | + and m.CONTENT LIKE concat("%",#{msgContent},"%") | |
| 37 | + </if> | |
| 38 | + <if test="tagId!=null"> | |
| 39 | + and t.TAGS_IDS LIKE concat("%,",#{verIds},",%") | |
| 40 | + </if> | |
| 41 | + </where> | |
| 42 | + | |
| 43 | + | |
| 31 | 44 | </select> |
| 32 | 45 | |
| 33 | 46 | </mapper> |
parent/base.common/src/main/java/com/lyms/base/common/service/content/ContentMessageTemplateService.java
View file @
4ce08c2
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import com.baomidou.mybatisplus.plugins.Page; |
| 4 | 4 | import com.lyms.base.common.entity.content.ContentMessageTemplate; |
| 5 | 5 | import com.lyms.base.common.vo.content.ContentMessageTemplateDTO; |
| 6 | +import com.lyms.base.common.vo.content.MsgTempSerachDTO; | |
| 6 | 7 | import com.lyms.web.service.BaseService; |
| 7 | 8 | |
| 8 | 9 | import java.io.Serializable; |
| ... | ... | @@ -24,7 +25,7 @@ |
| 24 | 25 | */ |
| 25 | 26 | public Integer deleteLogicById(Serializable id); |
| 26 | 27 | |
| 27 | - public Page<ContentMessageTemplateDTO> getContentMessageTemplate(Page<ContentMessageTemplateDTO> page, String verId); | |
| 28 | + public Page<ContentMessageTemplateDTO> getContentMessageTemplate(Page<ContentMessageTemplateDTO> page, MsgTempSerachDTO msgTemp); | |
| 28 | 29 | |
| 29 | 30 | } |
parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentMessageTemplateServiceImpl.java
View file @
4ce08c2
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.base.common.entity.content.ContentMessageTemplate; |
| 7 | 7 | import com.lyms.base.common.service.content.ContentMessageTemplateService; |
| 8 | 8 | import com.lyms.base.common.vo.content.ContentMessageTemplateDTO; |
| 9 | +import com.lyms.base.common.vo.content.MsgTempSerachDTO; | |
| 9 | 10 | import org.springframework.stereotype.Service; |
| 10 | 11 | |
| 11 | 12 | import java.io.Serializable; |
| ... | ... | @@ -27,8 +28,8 @@ |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | @Override |
| 30 | - public Page<ContentMessageTemplateDTO> getContentMessageTemplate(Page<ContentMessageTemplateDTO> page, String verId) { | |
| 31 | - List<ContentMessageTemplateDTO> lists = baseMapper.getContentMessageTemplate(page, verId); | |
| 31 | + public Page<ContentMessageTemplateDTO> getContentMessageTemplate(Page<ContentMessageTemplateDTO> page, MsgTempSerachDTO msgTemp) { | |
| 32 | + List<ContentMessageTemplateDTO> lists = baseMapper.getContentMessageTemplate(page, msgTemp); | |
| 32 | 33 | page.setRecords(lists); |
| 33 | 34 | return page; |
| 34 | 35 | } |
parent/base.common/src/main/java/com/lyms/base/common/vo/content/AricleSearchDTO.java
View file @
4ce08c2
| ... | ... | @@ -22,18 +22,6 @@ |
| 22 | 22 | * 标题 |
| 23 | 23 | */ |
| 24 | 24 | private String title; |
| 25 | - /** | |
| 26 | - * 栏目名称 | |
| 27 | - */ | |
| 28 | - private String ccName; | |
| 29 | - | |
| 30 | - public String getCcName() { | |
| 31 | - return ccName; | |
| 32 | - } | |
| 33 | - | |
| 34 | - public void setCcName(String ccName) { | |
| 35 | - this.ccName = ccName; | |
| 36 | - } | |
| 37 | 25 | |
| 38 | 26 | public Integer getColumnId() { |
| 39 | 27 | return columnId; |
parent/base.common/src/main/java/com/lyms/base/common/vo/content/ContentCategoriesDTO.java
View file @
4ce08c2
| 1 | +package com.lyms.base.common.vo.content; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotations.TableField; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * @auther yangfei | |
| 7 | + * @createTime 2017年04月27日 09时35分 | |
| 8 | + * @discription | |
| 9 | + */ | |
| 10 | +public class ContentCategoriesDTO { | |
| 11 | + /** | |
| 12 | + * 栏目名称 | |
| 13 | + */ | |
| 14 | + @TableField(value="NAME") | |
| 15 | + private String name; | |
| 16 | + /** | |
| 17 | + * 栏目图标 | |
| 18 | + */ | |
| 19 | + @TableField(value="ICON") | |
| 20 | + private String icon; | |
| 21 | + /** | |
| 22 | + * 栏目简介 | |
| 23 | + */ | |
| 24 | + private String description; | |
| 25 | + /** | |
| 26 | + * 栏目等级 | |
| 27 | + */ | |
| 28 | + private Integer level; | |
| 29 | + /** | |
| 30 | + * 父栏目ID | |
| 31 | + */ | |
| 32 | + private String perent; | |
| 33 | + | |
| 34 | + public String getName() { | |
| 35 | + return name; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setName(String name) { | |
| 39 | + this.name = name; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public String getIcon() { | |
| 43 | + return icon; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setIcon(String icon) { | |
| 47 | + this.icon = icon; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public String getDescription() { | |
| 51 | + return description; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setDescription(String description) { | |
| 55 | + this.description = description; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public Integer getLevel() { | |
| 59 | + return level; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setLevel(Integer level) { | |
| 63 | + this.level = level; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getPerent() { | |
| 67 | + return perent; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setPerent(String perent) { | |
| 71 | + this.perent = perent; | |
| 72 | + } | |
| 73 | +} |
parent/base.common/src/main/java/com/lyms/base/common/vo/content/ContentTagsDTO.java
View file @
4ce08c2
| 1 | +package com.lyms.base.common.vo.content; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * @auther 杨飞 | |
| 5 | + * @createTime 2017年04月27日 10时09分 | |
| 6 | + * @discription | |
| 7 | + */ | |
| 8 | +public class ContentTagsDTO { | |
| 9 | + /** | |
| 10 | + * 标签名称 | |
| 11 | + */ | |
| 12 | + private String tagName; | |
| 13 | + /** | |
| 14 | + * 标签简介 | |
| 15 | + */ | |
| 16 | + private String tagDesc; | |
| 17 | + /** | |
| 18 | + * 父标签ID | |
| 19 | + */ | |
| 20 | + private String perentId; | |
| 21 | + | |
| 22 | + public String getTagName() { | |
| 23 | + return tagName; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setTagName(String tagName) { | |
| 27 | + this.tagName = tagName; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public String getTagDesc() { | |
| 31 | + return tagDesc; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setTagDesc(String tagDesc) { | |
| 35 | + this.tagDesc = tagDesc; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getPerentId() { | |
| 39 | + return perentId; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setPerentId(String perentId) { | |
| 43 | + this.perentId = perentId; | |
| 44 | + } | |
| 45 | +} |
parent/base.common/src/main/java/com/lyms/base/common/vo/content/MsgTempSerachDTO.java
View file @
4ce08c2
| 1 | +package com.lyms.base.common.vo.content; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * @auther yangfei | |
| 5 | + * @createTime 2017年04月27日 13时49分 | |
| 6 | + * @discription | |
| 7 | + */ | |
| 8 | +public class MsgTempSerachDTO { | |
| 9 | + private String verId; | |
| 10 | + private String msgContent; | |
| 11 | + private String tagId; | |
| 12 | + | |
| 13 | + public String getVerId() { | |
| 14 | + return verId; | |
| 15 | + } | |
| 16 | + | |
| 17 | + public void setVerId(String verId) { | |
| 18 | + this.verId = verId; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public String getMsgContent() { | |
| 22 | + return msgContent; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public void setMsgContent(String msgContent) { | |
| 26 | + this.msgContent = msgContent; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public String getTagId() { | |
| 30 | + return tagId; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setTagId(String tagId) { | |
| 34 | + this.tagId = tagId; | |
| 35 | + } | |
| 36 | +} |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentCategoriesController.java
View file @
4ce08c2
| ... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 | import com.baomidou.mybatisplus.plugins.Page; |
| 4 | 4 | import com.lyms.base.common.entity.content.ContentCategories; |
| 5 | 5 | import com.lyms.base.common.service.content.ContentCategoriesService; |
| 6 | +import com.lyms.base.common.vo.content.ContentCategoriesDTO; | |
| 7 | +import com.lyms.constants.OperationName; | |
| 6 | 8 | import com.lyms.util.StrUtils; |
| 7 | 9 | import com.lyms.web.bean.AjaxResult; |
| 8 | 10 | import com.lyms.web.controller.BaseController; |
| ... | ... | @@ -13,6 +15,7 @@ |
| 13 | 15 | import org.springframework.web.bind.annotation.RequestParam; |
| 14 | 16 | import org.springframework.web.bind.annotation.ResponseBody; |
| 15 | 17 | |
| 18 | +import java.util.Date; | |
| 16 | 19 | import java.util.List; |
| 17 | 20 | import java.util.Map; |
| 18 | 21 | |
| ... | ... | @@ -80,8 +83,18 @@ |
| 80 | 83 | |
| 81 | 84 | @ResponseBody |
| 82 | 85 | @RequestMapping(value = "/create", method = { RequestMethod.POST }) |
| 83 | - public AjaxResult create(ContentCategories cca, AjaxResult ajaxResult) { | |
| 84 | - return null; | |
| 86 | + public AjaxResult create(ContentCategoriesDTO ccd, AjaxResult ajaxResult) { | |
| 87 | + ContentCategories ccs = new ContentCategories(); | |
| 88 | + ccs.setId(StrUtils.uuid()); | |
| 89 | + ccs.setCreateTime(new Date()); | |
| 90 | + | |
| 91 | + ccs.setName(ccd.getName()); | |
| 92 | + ccs.setIcon(ccd.getIcon()); | |
| 93 | + ccs.setDescription(ccd.getDescription()); | |
| 94 | + ccs.setPerent(ccd.getPerent()); | |
| 95 | + | |
| 96 | + boolean tag = categorService.insert(ccs); | |
| 97 | + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); | |
| 85 | 98 | } |
| 86 | 99 | } |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentMessageTemplateController.java
View file @
4ce08c2
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.base.common.service.content.ContentTemplateMessageTagsService; |
| 7 | 7 | import com.lyms.base.common.vo.content.ContentMessageTemplateDTO; |
| 8 | 8 | import com.lyms.base.common.vo.content.InContentMessageTemplateDTO; |
| 9 | +import com.lyms.base.common.vo.content.MsgTempSerachDTO; | |
| 9 | 10 | import com.lyms.constants.OperationName; |
| 10 | 11 | import com.lyms.util.StrUtils; |
| 11 | 12 | import com.lyms.web.bean.AjaxResult; |
| 12 | 13 | |
| 13 | 14 | |
| ... | ... | @@ -58,17 +59,14 @@ |
| 58 | 59 | |
| 59 | 60 | /** |
| 60 | 61 | * 获取消息内容列表 |
| 61 | - * @param verId | |
| 62 | + * @param msgTemp | |
| 62 | 63 | * @return |
| 63 | 64 | */ |
| 64 | 65 | @ResponseBody |
| 65 | 66 | @RequestMapping(value = "/list", method = { RequestMethod.GET, RequestMethod.POST }) |
| 66 | - public Map<String, Object> list(@RequestParam String verId) { | |
| 67 | + public Map<String, Object> list(MsgTempSerachDTO msgTemp) { | |
| 67 | 68 | Page<ContentMessageTemplateDTO> page = getPage(); |
| 68 | - System.out.println("verId值:"+verId); | |
| 69 | - if(StrUtils.isNotEmpty(verId)){ | |
| 70 | - page = messageTemplateService.getContentMessageTemplate(page,verId); | |
| 71 | - } | |
| 69 | + page = messageTemplateService.getContentMessageTemplate(page,msgTemp); | |
| 72 | 70 | return toGridData(page); |
| 73 | 71 | } |
| 74 | 72 |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentTagsController.java
View file @
4ce08c2
| ... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 | import com.baomidou.mybatisplus.plugins.Page; |
| 4 | 4 | import com.lyms.base.common.entity.content.ContentTags; |
| 5 | 5 | import com.lyms.base.common.service.content.ContentTagsService; |
| 6 | +import com.lyms.base.common.vo.content.ContentTagsDTO; | |
| 7 | +import com.lyms.constants.OperationName; | |
| 6 | 8 | import com.lyms.util.StrUtils; |
| 7 | 9 | import com.lyms.web.bean.AjaxResult; |
| 8 | 10 | import com.lyms.web.controller.BaseController; |
| ... | ... | @@ -13,6 +15,7 @@ |
| 13 | 15 | import org.springframework.web.bind.annotation.RequestParam; |
| 14 | 16 | import org.springframework.web.bind.annotation.ResponseBody; |
| 15 | 17 | |
| 18 | +import java.util.Date; | |
| 16 | 19 | import java.util.List; |
| 17 | 20 | import java.util.Map; |
| 18 | 21 | |
| ... | ... | @@ -73,5 +76,28 @@ |
| 73 | 76 | } |
| 74 | 77 | return toGridData(page); |
| 75 | 78 | } |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 新增标签 | |
| 82 | + * @param ctd | |
| 83 | + * @param ajaxResult | |
| 84 | + * @return | |
| 85 | + */ | |
| 86 | + @ResponseBody | |
| 87 | + @RequestMapping(value = "/create", method = { RequestMethod.POST }) | |
| 88 | + public AjaxResult create(ContentTagsDTO ctd, AjaxResult ajaxResult) { | |
| 89 | + ContentTags cts = new ContentTags(); | |
| 90 | + cts.setId(StrUtils.uuid()); | |
| 91 | + cts.setCreateTime(new Date()); | |
| 92 | + cts.setIfdel(0); | |
| 93 | + cts.setEnable(0); | |
| 94 | + | |
| 95 | + cts.setTagName(ctd.getTagName()); | |
| 96 | + cts.setTagDesc(ctd.getTagDesc()); | |
| 97 | + cts.setPerentId(ctd.getPerentId()); | |
| 98 | + boolean tag = contentTagsService.insert(cts); | |
| 99 | + return handleAjaxResult(ajaxResult, tag, OperationName.CREATE); | |
| 100 | + } | |
| 101 | + | |
| 76 | 102 | } |
parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_list.html
View file @
4ce08c2
| ... | ... | @@ -7,14 +7,14 @@ |
| 7 | 7 | <div class="col-sm-12"> |
| 8 | 8 | <div class="form-group col-sm-3"> |
| 9 | 9 | <label class="control-label">所属栏目:</label> |
| 10 | - <select class="form-control" style='width: 100%;height: 36px;' name="columnId" id="columnId"> | |
| 10 | + <select class="form-control" style='width: 100%;height: 36px;' id="columnSeleHtml"> | |
| 11 | 11 | |
| 12 | 12 | </select> |
| 13 | 13 | </div> |
| 14 | 14 | <div class="form-group col-sm-3"> |
| 15 | 15 | <label class="control-label">分类:</label> |
| 16 | - <select class="form-control" style='width: 100%;height: 36px;' name="type"> | |
| 17 | - <option value>请选择</option> | |
| 16 | + <select class="form-control" style='width: 100%;height: 36px;' id="type"> | |
| 17 | + <option value>全部</option> | |
| 18 | 18 | <option value="1">孕期</option> |
| 19 | 19 | <option value="2">育儿</option> |
| 20 | 20 | <option value="3">其它</option> |
| ... | ... | @@ -22,7 +22,6 @@ |
| 22 | 22 | </div> |
| 23 | 23 | <div class="form-group col-sm-3" id="seleTagsHtml"> |
| 24 | 24 | <label class="control-label">标签:</label> |
| 25 | - | |
| 26 | 25 | </div> |
| 27 | 26 | <div class="form-group col-sm-3"> |
| 28 | 27 | <label class="control-label">标题:</label> |
| ... | ... | @@ -66,7 +65,7 @@ |
| 66 | 65 | function initTags(){ |
| 67 | 66 | $.get("${ctx}/contentTags/seleList", "json", function(data) { |
| 68 | 67 | if (data.success) { |
| 69 | - var optionHtml="<option>请选择</option>"; | |
| 68 | + var optionHtml="<option value=''>全部</option>"; | |
| 70 | 69 | data.data.forEach(function(d, i) { |
| 71 | 70 | optionHtml += '<option value="'+d.id+'">' + d.tagName + '</option>'; |
| 72 | 71 | }); |
| 73 | 72 | |
| 74 | 73 | |
| 75 | 74 | |
| ... | ... | @@ -91,21 +90,38 @@ |
| 91 | 90 | function initCloumnData(){ |
| 92 | 91 | $.getJSON("${ctx}/contentCategories/selelist", function(data) { |
| 93 | 92 | if (data.success) { |
| 94 | - var columnList = "<option value=''>请选择</option>"; | |
| 93 | + var columnList = "<option value=''>全部</option>"; | |
| 95 | 94 | data.data.forEach(function(d, i) { |
| 96 | 95 | columnList += "<option value='"+d.id+"'>" + d.name + "</option>"; |
| 97 | 96 | }); |
| 98 | - $("#columnList").empty(); | |
| 99 | - $("#columnList").append(columnList); | |
| 97 | + $("#columnSeleHtml").empty(); | |
| 98 | + $("#columnSeleHtml").append(columnList); | |
| 100 | 99 | } |
| 101 | 100 | }); |
| 102 | 101 | } |
| 103 | 102 | |
| 104 | 103 | function search(){ |
| 104 | + var comId = $("#columnSeleHtml").val(); | |
| 105 | + var type = $("#type").val(); | |
| 106 | + var title = $("#title").val(); | |
| 107 | + var seleTagArrs = $("#seleTagArrs").val(); | |
| 108 | + | |
| 109 | + var querys = {}; | |
| 110 | + if(comId!=""){ | |
| 111 | + querys.columnId = comId; | |
| 112 | + } | |
| 113 | + if(type!=""){ | |
| 114 | + querys.type = type; | |
| 115 | + } | |
| 116 | + if(title!=""){ | |
| 117 | + querys.title = title; | |
| 118 | + } | |
| 119 | + if(seleTagArrs!=""){ | |
| 120 | + querys.ccName = seleTagArrs; | |
| 121 | + } | |
| 122 | + | |
| 105 | 123 | var queryParams = { |
| 106 | - query:{ | |
| 107 | - name: $("#nameSearch").val() | |
| 108 | - } | |
| 124 | + query:querys | |
| 109 | 125 | } |
| 110 | 126 | $('#dataTable').bootstrapTable('refresh', queryParams ); |
| 111 | 127 | } |
| ... | ... | @@ -116,6 +132,11 @@ |
| 116 | 132 | if(id){ |
| 117 | 133 | fullWindow("修改标签", APP.PATH + controllerRequestMappint + id + "/toEdit"); |
| 118 | 134 | } |
| 135 | +} | |
| 136 | + | |
| 137 | +function add(){ | |
| 138 | + fullWindow("添加图文内容", APP.PATH + controllerRequestMappint + "/toEdit"); | |
| 139 | + | |
| 119 | 140 | } |
| 120 | 141 | |
| 121 | 142 | function del(){ |
parent/center.manager/src/main/webapp/WEB-INF/views/categories/categonies_edit.html
View file @
4ce08c2
| ... | ... | @@ -19,17 +19,18 @@ |
| 19 | 19 | <div class="col-sm-5"> |
| 20 | 20 | <input type="text" class="form-control" disabled class="form-control" |
| 21 | 21 | placeholder="无" name=""> |
| 22 | + <input type="text" name="perent"/> | |
| 22 | 23 | </div> |
| 23 | 24 | </div> |
| 24 | 25 | <div class="form-group"> |
| 25 | 26 | <label class="col-sm-2 control-label">*栏目名称:</label> |
| 26 | 27 | <div class="col-sm-5"> |
| 27 | - <input type="text" class="form-control" class="form-control" | |
| 28 | - placeholder="请填入栏目名称" name=""> | |
| 28 | + <input type="text" class="form-control" required class="form-control" | |
| 29 | + placeholder="请填入栏目名称" name="name"> | |
| 29 | 30 | </div> |
| 30 | 31 | </div> |
| 31 | 32 | <div class="form-group"> |
| 32 | - <label class="col-sm-2 control-label" for="">*栏目icon:</label> | |
| 33 | + <label class="col-sm-2 control-label" for="">栏目icon:</label> | |
| 33 | 34 | <div class="col-sm-5"> |
| 34 | 35 | <div class="col-sm-12 no-padder" id="container"> |
| 35 | 36 | <div data-multiple="false" |
| ... | ... | @@ -48,7 +49,7 @@ |
| 48 | 49 | <div class="form-group" id="zhengwenConent"> |
| 49 | 50 | <label class="col-sm-2 control-label">栏目简介:</label> |
| 50 | 51 | <div class="col-sm-5"> |
| 51 | - <script id="editor" name="richText" type="text/plain"></script> | |
| 52 | + <script id="editor" type="text/plain"></script> | |
| 52 | 53 | </div> |
| 53 | 54 | </div> |
| 54 | 55 | |
| ... | ... | @@ -230,11 +231,10 @@ |
| 230 | 231 | var data = $('#validForm').serialize(); |
| 231 | 232 | var pickImgSrc = $("#pickImage").attr("src"); |
| 232 | 233 | var content = UE.getEditor('editor').getContent(); |
| 233 | - data+="&content="+content; | |
| 234 | - data+="&image="+pickImgSrc; | |
| 235 | - //data+"&" | |
| 236 | - //ajaxPost(APP.PATH + "/contentMessageTemplate/create", data); | |
| 237 | - //parent.reloadGrid('dataTable'); | |
| 234 | + data+="&description="+content; | |
| 235 | + data+="&icon="+pickImgSrc; | |
| 236 | + ajaxPost(APP.PATH + "/contentCategories/create", data); | |
| 237 | + parent.reloadGrid('dataTable'); | |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | 240 | </script> |
parent/center.manager/src/main/webapp/WEB-INF/views/content/template_list.html
View file @
4ce08c2
| ... | ... | @@ -30,12 +30,11 @@ |
| 30 | 30 | <div class="col-sm-10"> |
| 31 | 31 | <div style="padding-top:30px;"> |
| 32 | 32 | <form role="form" class="form-inline"> |
| 33 | - | |
| 34 | 33 | <div class="form-group"> |
| 35 | - <label for="exampleInputName2">短信内容:</label> | |
| 36 | - <input type="text" class="form-control" id="exampleInputName2" placeholder="短信内容"> | |
| 34 | + <label for="msgContent">短信内容:</label> | |
| 35 | + <input type="text" class="form-control" id="msgContent" placeholder="短信内容"> | |
| 37 | 36 | </div> |
| 38 | - <div class="form-group"> | |
| 37 | + <div class="form-group" style="margin-left: 20px;"> | |
| 39 | 38 | <label>标签:</label> |
| 40 | 39 | <select class="form-control m-b" id="searchTags" style="margin-bottom: 0;"> |
| 41 | 40 | |
| ... | ... | @@ -69,8 +68,7 @@ |
| 69 | 68 | #end |
| 70 | 69 | #override("js") |
| 71 | 70 | <script type="text/javascript"> |
| 72 | -var controllerRequestMappint = "/contentMessageTemplate/"; | |
| 73 | - | |
| 71 | + var controllerRequestMappint = "/contentMessageTemplate/"; | |
| 74 | 72 | function addVer(){ |
| 75 | 73 | layer.open({ |
| 76 | 74 | type: 1 //Page层类型 |
| ... | ... | @@ -83,6 +81,24 @@ |
| 83 | 81 | }); |
| 84 | 82 | } |
| 85 | 83 | |
| 84 | + function search(){ | |
| 85 | + var msgContent = $("#msgContent").val(); | |
| 86 | + var searchTags = $("#searchTags").val(); | |
| 87 | + | |
| 88 | + var querys = {}; | |
| 89 | + if(msgContent!=""){ | |
| 90 | + querys.columnId = msgContent; | |
| 91 | + } | |
| 92 | + if(searchTags!=""){ | |
| 93 | + querys.type = searchTags; | |
| 94 | + } | |
| 95 | + | |
| 96 | + var queryParams = { | |
| 97 | + query:querys | |
| 98 | + } | |
| 99 | + $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 100 | + } | |
| 101 | + | |
| 86 | 102 | function initTagsData(){ |
| 87 | 103 | $.get("${ctx}/contentTags/seleList", "json", function(data) { |
| 88 | 104 | if (data.success) { |
| 89 | 105 | |
| 90 | 106 | |
| 91 | 107 | |
| 92 | 108 | |
| 93 | 109 | |
| ... | ... | @@ -115,42 +131,27 @@ |
| 115 | 131 | |
| 116 | 132 | var templateVer = []; |
| 117 | 133 | function showMessageList(vId){ |
| 118 | - | |
| 119 | 134 | var version = templateVer[vId]; |
| 120 | - console.log(version); | |
| 121 | 135 | $("#verId").val(version.id); |
| 122 | 136 | $("#version").text(version.versionName); |
| 123 | - | |
| 137 | + | |
| 138 | + var msgContent = $("#msgContent").val(); | |
| 139 | + var searchTags = $("#searchTags").val(); | |
| 140 | + | |
| 141 | + var querys = {verId:version.id}; | |
| 142 | + if(msgContent!=""){ | |
| 143 | + querys.columnId = msgContent; | |
| 144 | + } | |
| 145 | + if(searchTags!=""){ | |
| 146 | + querys.type = searchTags; | |
| 147 | + } | |
| 124 | 148 | var queryParams = { |
| 125 | - query:{ | |
| 126 | - verId:version.id | |
| 127 | - } | |
| 149 | + query:querys | |
| 128 | 150 | } |
| 129 | - $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 130 | - } | |
| 131 | - | |
| 132 | - $(function(){ | |
| 133 | - initTagsData(); | |
| 151 | + $('#dataTable').bootstrapTable('refresh', queryParams ); | |
| 152 | + } | |
| 134 | 153 | |
| 135 | - //获取消息模板版本列表 | |
| 136 | - $.ajax({ | |
| 137 | - url: "${ctx}/contentTemplateVersion/list", | |
| 138 | - cache: false, | |
| 139 | - dataType: "json", | |
| 140 | - success: function(data){ | |
| 141 | - var data = data.rows; | |
| 142 | - var versionHtml = ""; | |
| 143 | - if(data){ | |
| 144 | - templateVer = data; | |
| 145 | - data.forEach(function(i,d){ | |
| 146 | - versionHtml+="<li onclick='showMessageList("+d+")' class='list-group-item'>"+i.versionName+"</li>"; | |
| 147 | - }); | |
| 148 | - $("#temp_version").append(versionHtml); | |
| 149 | - } | |
| 150 | - } | |
| 151 | - }); | |
| 152 | - | |
| 153 | - | |
| 154 | + function initMsgTab(){ | |
| 154 | 155 | $('#dataTable').bootstrapTable({ |
| 155 | 156 | url: '${ctx}/contentMessageTemplate/list', //请求后台的URL(*) |
| 156 | 157 | method: 'get', //请求方式(*) |
| ... | ... | @@ -162,6 +163,9 @@ |
| 162 | 163 | pageSize: 999, //每页的记录行数(*) |
| 163 | 164 | pageList: [999], //可供选择的每页的行数(*) |
| 164 | 165 | strictSearch: true, |
| 166 | + queryParams:{ | |
| 167 | + verId:0 | |
| 168 | + }, | |
| 165 | 169 | clickToSelect: true, //是否启用点击选中行 |
| 166 | 170 | //height: 600, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 |
| 167 | 171 | uniqueId: "id", //每一行的唯一标识,一般为主键列 |
| 168 | 172 | |
| ... | ... | @@ -179,7 +183,31 @@ |
| 179 | 183 | field: 'content', |
| 180 | 184 | title: '短信内容' |
| 181 | 185 | }]}); |
| 186 | + | |
| 187 | + } | |
| 188 | + | |
| 189 | + $(function(){ | |
| 190 | + initTagsData(); | |
| 191 | + initMsgTab(); | |
| 192 | + //获取消息模板版本列表 | |
| 193 | + $.ajax({ | |
| 194 | + url: "${ctx}/contentTemplateVersion/list", | |
| 195 | + cache: false, | |
| 196 | + dataType: "json", | |
| 197 | + success: function(data){ | |
| 198 | + var data = data.rows; | |
| 199 | + var versionHtml = ""; | |
| 200 | + if(data){ | |
| 201 | + templateVer = data; | |
| 202 | + data.forEach(function(i,d){ | |
| 203 | + versionHtml+="<li onclick='showMessageList("+d+")' class='list-group-item'>"+i.versionName+"</li>"; | |
| 204 | + }); | |
| 205 | + $("#temp_version").append(versionHtml); | |
| 206 | + } | |
| 207 | + } | |
| 208 | + }); | |
| 182 | 209 | }); |
| 210 | + | |
| 183 | 211 | </script> |
| 184 | 212 | #end |
| 185 | 213 | #extends("/common/base_list.html") |
parent/center.manager/src/main/webapp/WEB-INF/views/tags/tags_edit.html
View file @
4ce08c2
| ... | ... | @@ -5,10 +5,6 @@ |
| 5 | 5 | height: 36px; |
| 6 | 6 | } |
| 7 | 7 | </style> |
| 8 | - | |
| 9 | - | |
| 10 | - | |
| 11 | - | |
| 12 | 8 | <div class="ibox float-e-margins"> |
| 13 | 9 | <div class="ibox-content"> |
| 14 | 10 | <div class="col-sm-12"> |
| 15 | 11 | |
| 16 | 12 | |
| ... | ... | @@ -19,21 +15,22 @@ |
| 19 | 15 | <div class="col-sm-3"> |
| 20 | 16 | <input type="text" class="form-control" disabled class="form-control" |
| 21 | 17 | placeholder="无" name=""> |
| 18 | + <input type="text" name="perentId"/> | |
| 22 | 19 | </div> |
| 23 | 20 | </div> |
| 24 | 21 | <div class="hr-line-dashed"></div> |
| 25 | 22 | <div class="form-group"> |
| 26 | 23 | <label class="col-sm-4 control-label">*标签名称:</label> |
| 27 | 24 | <div class="col-sm-3"> |
| 28 | - <input type="text" class="form-control" class="form-control" | |
| 29 | - placeholder="请填入标签名称" name=""> | |
| 25 | + <input type="text" class="form-control" required class="form-control" | |
| 26 | + placeholder="请填入标签名称" name="tagName"> | |
| 30 | 27 | </div> |
| 31 | 28 | </div> |
| 32 | 29 | <div class="hr-line-dashed"></div> |
| 33 | 30 | <div class="form-group"> |
| 34 | 31 | <label class="col-sm-4 control-label">*标签简介:</label> |
| 35 | 32 | <div class="col-sm-3"> |
| 36 | - <textarea class="form-control" rows="4" cols="12" aria-required="true" name="content" required="true" placeholder="请输入短信内容"></textarea> | |
| 33 | + <textarea class="form-control" rows="4" cols="12" aria-required="true" name="tagDesc" required="true" placeholder="请输入短信内容"></textarea> | |
| 37 | 34 | </div> |
| 38 | 35 | </div> |
| 39 | 36 | |
| 40 | 37 | |
| 41 | 38 | |
| ... | ... | @@ -55,171 +52,13 @@ |
| 55 | 52 | </div> |
| 56 | 53 | #end #extends("/common/base_list.html") |
| 57 | 54 | |
| 58 | -<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/ueditor/ueditor.config.js"></script> | |
| 59 | -<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/ueditor/ueditor.all.min.js"></script> | |
| 60 | -<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/ueditor/lang/zh-cn/zh-cn.js"></script> | |
| 61 | -<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/plupload/js/moxie.js"></script> | |
| 62 | -<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/plupload/js/plupload.dev.js"></script> | |
| 63 | -<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/plupload/js/i18n/zh_CN.js"></script> | |
| 64 | -<script type="text/javascript" src="${ctx}/static/js/plugins/qiniu/qiniu.min.js"></script> | |
| 65 | - | |
| 66 | 55 | <script type="text/javascript"> |
| 67 | - | |
| 68 | - function switchContent(num) { | |
| 69 | - if (num == 1) {//普通内容 | |
| 70 | - $("#commonCon").addClass("fa-check"); | |
| 71 | - $("#specialCon").removeClass("fa-check"); | |
| 72 | - | |
| 73 | - $("#zaiyaoContent").show(); | |
| 74 | - $("#zhengwenConent").show(); | |
| 75 | - $("#linkContent").hide(); | |
| 76 | - | |
| 77 | - | |
| 78 | - } else { | |
| 79 | - $("#commonCon").removeClass("fa-check"); | |
| 80 | - $("#specialCon").addClass("fa-check"); | |
| 81 | - | |
| 82 | - $("#zaiyaoContent").hide(); | |
| 83 | - $("#zhengwenConent").hide(); | |
| 84 | - $("#linkContent").show(); | |
| 85 | - } | |
| 86 | - } | |
| 87 | - | |
| 88 | - function initUpload(){ | |
| 89 | - var uploader = Qiniu.uploader({ | |
| 90 | - runtimes: 'html5,flash,html4', //上传模式,依次退化 | |
| 91 | - browse_button: 'pickfiles', //上传选择的点选按钮,**必需** | |
| 92 | - uptoken_url: "${ctx}/ueditor/uploadGetToken", //Ajax请求upToken的Url,**强烈建议设置**(服务端提供) | |
| 93 | - //uptoken:"hZgfmtYjqtz1UC96gy4uatu5FmyvtoPULkUB9QgA:J51SWS11RoS_0JhE_4LaU_YAWj4=:eyJzY29wZSI6Im1vbW15YmFieSIsImRlYWRsaW5lIjoxNDkzMDA2ODY3fQ==", | |
| 94 | - // uptoken : '<Your upload token>', //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成 | |
| 95 | - unique_names: true, // 默认 false,key为文件名。若开启该选项,SDK为自动生成上传成功后的key(文件名)。 | |
| 96 | - // save_key: true, // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`,则开启,SDK会忽略对key的处理 | |
| 97 | - domain: 'http://img1.healthbaby.com.cn/', //bucket 域名,下载资源时用到,**必需** | |
| 98 | - get_new_uptoken: false, //设置上传文件的时候是否每次都重新获取新的token | |
| 99 | - container: 'container', //上传区域DOM ID,默认是browser_button的父元素, | |
| 100 | - max_file_size: '100mb', //最大文件体积限制 | |
| 101 | - flash_swf_url: '${ctx}/js/plugins/plupload/Moxie.swf', //引入flash,相对路径 | |
| 102 | - max_retries: 3, //上传失败最大重试次数 | |
| 103 | - dragdrop: false, //开启可拖曳上传 | |
| 104 | - chunk_size: '4mb', //分块上传时,每片的体积 | |
| 105 | - auto_start: true, //选择文件后自动上传,若关闭需要自己绑定事件触发上传 | |
| 106 | - init: { | |
| 107 | - 'FilesAdded': function(up, files) { | |
| 108 | - plupload.each(files, function(file) { | |
| 109 | - // var progress = new FileProgress(file, 'fsUploadProgress'); | |
| 110 | - // progress.setStatus("等待..."); | |
| 111 | - // progress.bindUploadCancel(up); | |
| 112 | - }); | |
| 113 | - }, | |
| 114 | - 'BeforeUpload': function(up, file) { | |
| 115 | - // var progress = new FileProgress(file, 'fsUploadProgress'); | |
| 116 | - // var chunk_size = plupload.parseSize(this.getOption('chunk_size')); | |
| 117 | - // if (up.runtime === 'html5' && chunk_size) { | |
| 118 | - // progress.setChunkProgess(chunk_size); | |
| 119 | - // } | |
| 120 | - }, | |
| 121 | - 'UploadProgress': function(up, file) { | |
| 122 | - // var progress = new FileProgress(file, 'fsUploadProgress'); | |
| 123 | - // var chunk_size = plupload.parseSize(this.getOption('chunk_size')); | |
| 124 | - // progress.setProgress(file.percent + "%", file.speed, chunk_size); | |
| 125 | - }, | |
| 126 | - 'FileUploaded': function(up, file, info) { | |
| 127 | - // 每个文件上传成功后,处理相关的事情 | |
| 128 | - // 其中 info 是文件上传成功后,服务端返回的json,形式如 | |
| 129 | - // { | |
| 130 | - // "hash": "Fh8xVqod2MQ1mocfI4S4KpRL6D98", | |
| 131 | - // "key": "gogopher.jpg" | |
| 132 | - // } | |
| 133 | - // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html | |
| 134 | - | |
| 135 | - //var progress = new FileProgress(err.file, 'fsUploadProgress'); | |
| 136 | - // progress.setError(); | |
| 137 | - // progress.setStatus(errTip); | |
| 138 | - | |
| 139 | - var domain = up.getOption('domain'); | |
| 140 | - | |
| 141 | - var res = JSON.parse(info); | |
| 142 | - var sourceLink = domain + res.key; //获取上传成功后的文件的Url+ | |
| 143 | - | |
| 144 | - $("#pickImage").attr("src",sourceLink); | |
| 145 | - }, | |
| 146 | - 'Error': function(up, err, errTip) { | |
| 147 | - //上传出错时,处理相关的事情 | |
| 148 | - }, | |
| 149 | - 'UploadComplete': function() { | |
| 150 | - //队列文件处理完毕后,处理相关的事情 | |
| 151 | - }, | |
| 152 | - 'Key': function(up, file) { | |
| 153 | - var key = ""; | |
| 154 | - return key | |
| 155 | - } | |
| 156 | - } | |
| 157 | - }); | |
| 158 | - | |
| 159 | - } | |
| 160 | - | |
| 161 | - $(function() { | |
| 162 | - //初始化图片上传插件 | |
| 163 | - initUpload(); | |
| 164 | - //初始化 | |
| 165 | - var ue = UE.getEditor('editor', { | |
| 166 | - initialFrameHeight : 200, | |
| 167 | - initialFrameWidth : "100%" | |
| 168 | - }); | |
| 169 | - $.getJSON("${ctx}/contentCategories/selelist", function(data) { | |
| 170 | - if (data.success) { | |
| 171 | - var columnList = "<option value=''>请选择</option>"; | |
| 172 | - data.data.forEach(function(d, i) { | |
| 173 | - columnList += "<option value='"+d.id+"'>" + d.name + "</option>"; | |
| 174 | - }); | |
| 175 | - $("#columnList").empty(); | |
| 176 | - $("#columnList").append(columnList); | |
| 177 | - } | |
| 178 | - }); | |
| 179 | - | |
| 180 | - $.get("${ctx}/contentTags/list", "json", function(data) { | |
| 181 | - if (data.success) { | |
| 182 | - var seleHtml = ""; | |
| 183 | - data.data.forEach(function(d, i) { | |
| 184 | - seleHtml += '<option value="'+d.id+'">' + d.tagName + '</option>'; | |
| 185 | - }); | |
| 186 | - | |
| 187 | - $("#select6").empty(); | |
| 188 | - $("#select6").append(seleHtml); | |
| 189 | - | |
| 190 | - $('#select6').selectator({ | |
| 191 | - prefix : 'selectator_', // CSS class prefix | |
| 192 | - height : 'auto', // auto or element | |
| 193 | - useDimmer : false, // dims the screen when option list is visible | |
| 194 | - useSearch : true, // if false, the search boxes are removed and | |
| 195 | - // `showAllOptionsOnFocus` is forced to true | |
| 196 | - keepOpen : true, // if true, then the dropdown will not close when | |
| 197 | - // selecting options, but stay open until losing focus | |
| 198 | - showAllOptionsOnFocus : true, // shows all options if input box is empty | |
| 199 | - selectFirstOptionOnSearch : true, // selects the topmost option on every search | |
| 200 | - searchCallback : function(value) { | |
| 201 | - }, // Callback function when enter is pressed and | |
| 202 | - // no option is active in multi select box | |
| 203 | - labels : { | |
| 204 | - search : 'Search...' // Placeholder text in search box in single select box | |
| 205 | - } | |
| 206 | - }); | |
| 207 | - | |
| 208 | - } | |
| 209 | - }); | |
| 210 | - }); | |
| 211 | - | |
| 212 | 56 | function save() { |
| 213 | 57 | |
| 214 | 58 | if ($('#validForm').valid()) { |
| 215 | 59 | var data = $('#validForm').serialize(); |
| 216 | - var pickImgSrc = $("#pickImage").attr("src"); | |
| 217 | - var content = UE.getEditor('editor').getContent(); | |
| 218 | - data+="&content="+content; | |
| 219 | - data+="&image="+pickImgSrc; | |
| 220 | - //data+"&" | |
| 221 | - //ajaxPost(APP.PATH + "/contentMessageTemplate/create", data); | |
| 222 | - //parent.reloadGrid('dataTable'); | |
| 60 | + ajaxPost(APP.PATH + "/contentTags/create", data); | |
| 61 | + parent.reloadGrid('dataTable'); | |
| 223 | 62 | } |
| 224 | 63 | } |
| 225 | 64 | </script> |