diff --git a/zheng-cms/zheng-cms-admin/src/main/java/com/zheng/cms/admin/controller/manage/CmsArticleController.java b/zheng-cms/zheng-cms-admin/src/main/java/com/zheng/cms/admin/controller/manage/CmsArticleController.java index 3ebed940..6e031eac 100644 --- a/zheng-cms/zheng-cms-admin/src/main/java/com/zheng/cms/admin/controller/manage/CmsArticleController.java +++ b/zheng-cms/zheng-cms-admin/src/main/java/com/zheng/cms/admin/controller/manage/CmsArticleController.java @@ -7,7 +7,10 @@ import com.zheng.cms.common.constant.CmsResult; import com.zheng.cms.common.constant.CmsResultConstant; import com.zheng.cms.dao.model.CmsArticle; import com.zheng.cms.dao.model.CmsArticleExample; +import com.zheng.cms.dao.model.CmsTopic; +import com.zheng.cms.dao.model.CmsTopicExample; import com.zheng.cms.rpc.api.CmsArticleService; +import com.zheng.cms.rpc.api.CmsTopicService; import com.zheng.common.base.BaseController; import com.zheng.common.validator.LengthValidator; import com.zheng.common.validator.NotNullValidator; @@ -19,6 +22,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; @@ -40,6 +44,9 @@ public class CmsArticleController extends BaseController { @Autowired private CmsArticleService cmsArticleService; + @Autowired + private CmsTopicService cmsTopicService; + @ApiOperation(value = "文章首页") @RequiresPermissions("cms:article:read") @RequestMapping(value = "/index", method = RequestMethod.GET) @@ -73,7 +80,11 @@ public class CmsArticleController extends BaseController { @ApiOperation(value = "新增文章") @RequiresPermissions("cms:article:create") @RequestMapping(value = "/create", method = RequestMethod.GET) - public String create() { + public String create(ModelMap modelMap) { + CmsTopicExample cmsTopicExample = new CmsTopicExample(); + cmsTopicExample.setOrderByClause("ctime desc"); + List cmsTopics = cmsTopicService.selectByExample(cmsTopicExample); + modelMap.put("cmsTopics", cmsTopics); return "/manage/article/create"; } diff --git a/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/create.jsp b/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/create.jsp index e158c9e0..b810f154 100644 --- a/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/create.jsp +++ b/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/create.jsp @@ -50,11 +50,23 @@ +
+
+
+ +
+
+
- +
@@ -62,15 +74,7 @@
- -
-
- -
-
-
- - +
diff --git a/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/index.jsp b/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/index.jsp index 9aaa3229..7fa90313 100644 --- a/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/index.jsp +++ b/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/index.jsp @@ -54,6 +54,7 @@ $(function() { columns: [ {field: 'ck', checkbox: true}, {field: 'articleId', title: '编号', sortable: true, align: 'center'}, + {field: 'topicId', title: '所属专题'}, {field: 'title', title: '标题'}, {field: 'author', title: '作者'}, {field: 'description', title: '描述'}, @@ -107,6 +108,7 @@ function createAction() { content: 'url:${basePath}/manage/article/create', onContentReady: function () { initMaterialInput(); + $('select').select2(); } }); } @@ -135,6 +137,7 @@ function updateAction() { content: 'url:${basePath}/manage/article/update/' + rows[0].articleId, onContentReady: function () { initMaterialInput(); + $('select').select2(); } }); } diff --git a/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/update.jsp b/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/update.jsp index d014ad81..72295fae 100644 --- a/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/update.jsp +++ b/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/jsp/manage/article/update.jsp @@ -50,6 +50,14 @@ +
+
+
+ + +
+
+
@@ -66,14 +74,6 @@
-
-
-
- - -
-
-