Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
765bfd55
Commit
765bfd55
authored
Dec 02, 2019
by
sgjj
Browse files
添加自定义模型
parent
f1a1ee7e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
765bfd55
...
...
@@ -40,6 +40,11 @@
<artifactId>
ms-basic
</artifactId>
<version>
1.0.17-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
net.mingsoft
</groupId>
<artifactId>
ms-mdiy
</artifactId>
<version>
1.0.12-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
net.mingsoft
</groupId>
<artifactId>
ms-mpeople
</artifactId>
...
...
src/main/webapp/WEB-INF/manager/cms/category/form.ftl
View file @
765bfd55
...
...
@@ -89,6 +89,23 @@
</el-form-item>
</el-col>
</el-row>
<el-row
gutter="0"
justify="start" align="top">
<el-col span="12">
<el-form-item label="自定义模型" prop="mdiyModelId">
<el-select v-model="form.mdiyModelId"
:style="
{
width
:
'
100
%'
}
"
:filterable="false"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择栏目的自定义模型">
<el-option v-for='item in mdiyModelIdOptions' :key="item.id" :value="item.id"
:label="item.modelName"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="栏目管理关键字" prop="categoryKeyword">
<el-input
type="textarea" :rows="5"
...
...
@@ -141,17 +158,6 @@
placeholder="请输入自定义链接">
</el-input>
</el-form-item>
<el-form-item label="栏目管理的内容模型id" prop="mdiyModelId">
<el-select v-model="form.mdiyModelId"
:style="
{
width
:
'
100
%'
}
"
:filterable="false"
:disabled="false"
:multiple="false" :clearable="true"
placeholder="请选择栏目管理的内容模型id">
<el-option v-for='item in mdiyModelIdOptions' :key="item.value" :value="item.value"
:label="false?item.label:item.value"></el-option>
</el-select>
</el-form-item>
</el-form>
</el-scrollbar>
</el-main>
...
...
@@ -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
()
;
...
...
src/main/webapp/WEB-INF/manager/cms/content/form.ftl
View file @
765bfd55
...
...
@@ -20,7 +20,7 @@
:label="item.title"
:name="item.name">
<el-scrollbar class="ms-scrollbar" style="height: 100%;">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" size="mini">
<el-form
v-if="item.title=='文章编辑'"
ref="form" :model="form" :rules="rules" label-width="120px" size="mini">
<el-row
gutter="0"
justify="start" align="top">
...
...
@@ -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
.c
ontentC
ategoryIdOptions.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.
categoryCm
Id
){
if
(
this
.currCategory.
mdiyModel
Id
){
ms
.http.get
(
ms
.manager
+
"/mdiy/model/get.do"
,{
id
:
this
.currCategory.
categoryCm
Id
id
:
this
.currCategory.
mdiyModel
Id
})
.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
)
;
...
...
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
View file @
765bfd55
...
...
@@ -103,7 +103,7 @@
</
html
>
<
script
>
var
ma
inVue = new Vue(
{
var in
dex
Vue = new Vue(
{
el
:
'#
main
'
,
data
:{
conditionList
:
[
...
...
@@ -124,6 +124,7 @@
{
action
:
'
and
'
,
field
:
'
update_date
'
,
el
:
'
eq
'
,
model
:
'
updateDate
'
,
name
:
'修改时间'
,
type
:
'
date
'
},
]
,
conditions
:
[]
,
contentCategoryIdOptions
:
[]
,
dataList
:
[]
,
//文章列表
selectionList
:
[]
,
//文章列表选中
total
:
0
,
//总记录数量
...
...
src/main/webapp/static/plugins/tree-select/tree.js
View file @
765bfd55
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment