From 765bfd55e5c25b8660c71b5c6d5ec15619b5644c Mon Sep 17 00:00:00 2001
From: sgjj <995959152@qq.com>
Date: Mon, 2 Dec 2019 14:24:25 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89?=
=?UTF-8?q?=E6=A8=A1=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 5 +++
.../WEB-INF/manager/cms/category/form.ftl | 40 +++++++++++++------
.../WEB-INF/manager/cms/content/form.ftl | 19 +++++----
.../WEB-INF/manager/cms/content/main.ftl | 3 +-
.../webapp/static/plugins/tree-select/tree.js | 2 +-
5 files changed, 47 insertions(+), 22 deletions(-)
diff --git a/pom.xml b/pom.xml
index e113a67c..4858a17d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,11 @@
ms-basic
1.0.17-SNAPSHOT
+
+ net.mingsoft
+ ms-mdiy
+ 1.0.12-SNAPSHOT
+
net.mingsoft
ms-mpeople
diff --git a/src/main/webapp/WEB-INF/manager/cms/category/form.ftl b/src/main/webapp/WEB-INF/manager/cms/category/form.ftl
index b82d7376..9d31d1fd 100644
--- a/src/main/webapp/WEB-INF/manager/cms/category/form.ftl
+++ b/src/main/webapp/WEB-INF/manager/cms/category/form.ftl
@@ -89,6 +89,23 @@
+
+
+
+
+
+
+
+
+
-
-
-
-
-
@@ -259,7 +265,16 @@
}
})
},
-
+ //获取分类内容模型
+ getColumnContentModelId: function () {
+ var that = this;
+ ms.http.get(ms.manager + "/mdiy/model/list.do",{modelType:'zdymx_wz'}).then(
+ function (data) {
+ that.mdiyModelIdOptions = data.rows;
+ }).catch(function (err) {
+ console.log(err);
+ });
+ },
//获取当前分类
get(id) {
var that = this;
@@ -325,6 +340,7 @@
},
},
created() {
+ this.getColumnContentModelId();
this.getTree()
this.categoryListUrlOptionsGet();
this.categoryUrlOptionsGet();
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 364f3c61..1b7efd8f 100644
--- a/src/main/webapp/WEB-INF/manager/cms/content/form.ftl
+++ b/src/main/webapp/WEB-INF/manager/cms/content/form.ftl
@@ -20,7 +20,7 @@
:label="item.title"
:name="item.name">
-
+
@@ -240,6 +240,7 @@
contentDetails: '',
},
contentTypeOptions: [],
+ categoryIdOptions: [],
contentDisplayOptions: [{"value": "0", "label": "是"}, {"value": "1", "label": "否"}],
rules: {
// 文章标题
@@ -254,7 +255,7 @@
computed:{
currCategory(){
var that = this;
- return this.contentCategoryIdOptions.find(function(value){
+ return this.categoryIdOptions.find(function(value){
return value.id===that.form.contentCategoryId
})
},
@@ -271,7 +272,7 @@
if (that.form.id > 0) {
url = ms.manager + "/cms/content/update.do";
}
- this.$refs.form.validate((valid) => {
+ this.$refs.form[0].validate((valid) => {
if (valid) {
that.saveDisabled = true;
var data = JSON.parse(JSON.stringify(that.form));
@@ -281,7 +282,7 @@
if (data.result) {
//保存时需要赋值关联ID
if(that.model){
- that.model.form.linkId = data.id;
+ that.model.form.linkId = data.data.id;
that.model.save()
}
that.$notify({
@@ -322,9 +323,9 @@
that.editableTabs = [that.editableTabs[0]];
this.removeModel();
if(this.currCategory){
- if(this.currCategory.categoryCmId){
+ if(this.currCategory.mdiyModelId){
ms.http.get(ms.manager + "/mdiy/model/get.do",{
- id:this.currCategory.categoryCmId
+ id:this.currCategory.mdiyModelId
}).then(function (data) {
if(data.id){
that.rederModel(data,JSON.parse(data.modelJson))
@@ -359,7 +360,7 @@
title:modelEntity.modelName,
modelId:modelEntity.id,
form:{
- linkId:that.id
+ linkId:that.form.id
},
}
})
@@ -385,8 +386,8 @@
} else {
res.data.contentImg = []
}
- that.changeModel();
that.form = res.data;
+ that.changeModel();
}
}).catch(function (err) {
console.log(err);
@@ -398,6 +399,8 @@
ms.http.get(ms.manager + "/cms/category/list.do", {pageSize: 9999}).then(function (res) {
if (res.result) {
that.contentCategoryIdOptions = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
+ that.categoryIdOptions = res.data.rows
+ that.changeModel();
}
}).catch(function (err) {
console.log(err);
diff --git a/src/main/webapp/WEB-INF/manager/cms/content/main.ftl b/src/main/webapp/WEB-INF/manager/cms/content/main.ftl
index ab9c82a8..ee26b156 100644
--- a/src/main/webapp/WEB-INF/manager/cms/content/main.ftl
+++ b/src/main/webapp/WEB-INF/manager/cms/content/main.ftl
@@ -103,7 +103,7 @@