From d668c3825af9ff22967931d653e9b53fc732ae30 Mon Sep 17 00:00:00 2001 From: tianbj <1309855586@qq.com> Date: Fri, 29 Nov 2019 15:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/manager/cms/content/form.ftl | 32 ++++++++++++++++++- .../WEB-INF/manager/cms/content/index.ftl | 9 ++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl index abd4d362..81a86520 100644 --- a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl @@ -8,7 +8,7 @@
保存 - 返回 + 返回 @@ -193,6 +193,7 @@ UEDITOR_HOME_URL: ms.base+'/static/plugins/ueditor/1.4.3.1/' }, contentCategoryIdOptions:[], + returnIsShow:true, //表单数据 form: { // 文章标题 @@ -337,14 +338,43 @@ this.form.contentImg.splice(index, 1); } }, + //查询列表 + list: function(contentCategoryId) { + var that = this; + ms.http.post(ms.manager+"/cms/content/list.do",{ + contentCategoryId:contentCategoryId, + }).then(function(res) { + if(res.result&&res.data.total>0){ + if(res.data.rows[0].contentType){ + res.data.rows[0].contentType = res.data.rows[0].contentType.split(','); + } + if(res.data.rows[0].contentImg){ + res.data.rows[0].contentImg = JSON.parse(res.data.rows[0].contentImg); + res.data.rows[0].contentImg.forEach(function(value){ + value.url= ms.base + value.path + }) + }else{ + res.data.rows[0].contentImg=[] + } + that.form = res.data.rows[0]; + } + }).catch(function(err) { + console.log(err); + }); + }, }, created() { this.contentCategoryIdOptionsGet(); this.contentTypeOptionsGet(); this.form.id = ms.util.getParameter("id"); + this.form.contentCategoryId = ms.util.getParameter("categoryId"); if (this.form.id) { this.get(this.form.id); } + if(this.form.contentCategoryId){ + this.list(this.form.contentCategoryId); + this.returnIsShow = false; + } } }); diff --git a/src/main/webapp/WEB-INF/manager/cms/content/index.ftl b/src/main/webapp/WEB-INF/manager/cms/content/index.ftl index f358e7fb..0de0339d 100644 --- a/src/main/webapp/WEB-INF/manager/cms/content/index.ftl +++ b/src/main/webapp/WEB-INF/manager/cms/content/index.ftl @@ -34,8 +34,13 @@ }, methods:{ handleNodeClick: function(data){ - this.$el.getElementsByTagName('iframe')[0].contentWindow.window.mainVue.form.contentCategoryId = data.id; - this.$el.getElementsByTagName('iframe')[0].contentWindow.window.mainVue.list(); + if(data.categoryType == '1'){ + this.action = ms.manager +"/cms/content/main.do?categoryId="+data.id; + } else if(data.categoryType == '2'){ + this.action = ms.manager +"/cms/content/form.do?categoryId="+data.id; + } else{ + this.action = ms.manager +"/cms/content/main.do"; + } }, treeList: function(){ var that = this;