|
@@ -30,6 +30,15 @@
|
|
|
<el-button style="width:100%" type="primary" size="mini" @click="updataImage">上传封面</el-button>
|
|
<el-button style="width:100%" type="primary" size="mini" @click="updataImage">上传封面</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="title">描述</div>
|
|
|
|
|
+ <div style="margin:10px">
|
|
|
|
|
+ <el-input v-model="brief" rows="4" type="textarea" placeholder="请输入描述" maxlength="500" show-word-limit></el-input>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="title">选择分类</div>
|
|
|
|
|
+ <div style="margin:10px">
|
|
|
|
|
+ <el-cascader v-model="categoryId" :props="{'label':'name','value':'id'}" :options="categoryList"
|
|
|
|
|
+ @change="changeCategoryHandle" clearable></el-cascader>
|
|
|
|
|
+ </div>
|
|
|
<ul>
|
|
<ul>
|
|
|
<div class="title">组件选择</div>
|
|
<div class="title">组件选择</div>
|
|
|
<li v-for="(val, index) in typeList" :key="index + 1" @click="clickType(val)" v-if="!val.hideShow">
|
|
<li v-for="(val, index) in typeList" :key="index + 1" @click="clickType(val)" v-if="!val.hideShow">
|
|
@@ -270,7 +279,10 @@ export default {
|
|
|
libraryExtendId: null,
|
|
libraryExtendId: null,
|
|
|
viewTitle: '',
|
|
viewTitle: '',
|
|
|
bindId: null,
|
|
bindId: null,
|
|
|
- bindType: null
|
|
|
|
|
|
|
+ bindType: null,
|
|
|
|
|
+ brief:'',
|
|
|
|
|
+ categoryList: [],
|
|
|
|
|
+ categoryId: [],
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -303,6 +315,7 @@ export default {
|
|
|
} else if (bindId) {
|
|
} else if (bindId) {
|
|
|
this.getMaterialLibraryByBindId(bindId, bindType)
|
|
this.getMaterialLibraryByBindId(bindId, bindType)
|
|
|
}
|
|
}
|
|
|
|
|
+ this.loadCategoryList()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 关闭窗口
|
|
// 关闭窗口
|
|
@@ -334,6 +347,8 @@ export default {
|
|
|
this.pic = res.data.data.pic
|
|
this.pic = res.data.data.pic
|
|
|
this.view = JSON.parse(res.data.data.libraryExtend.params)
|
|
this.view = JSON.parse(res.data.data.libraryExtend.params)
|
|
|
this.id = res.data.data.id
|
|
this.id = res.data.data.id
|
|
|
|
|
+ this.categoryId = res.data.data.categoryId
|
|
|
|
|
+ this.brief = res.data.data.brief
|
|
|
this.libraryExtendId = res.data.data.libraryExtend.id
|
|
this.libraryExtendId = res.data.data.libraryExtend.id
|
|
|
this.viewTitle = res.data.data.title
|
|
this.viewTitle = res.data.data.title
|
|
|
this.view.map(item=>{
|
|
this.view.map(item=>{
|
|
@@ -352,6 +367,8 @@ export default {
|
|
|
this.pic = res.data.data.pic
|
|
this.pic = res.data.data.pic
|
|
|
this.view = JSON.parse(res.data.data.libraryExtend.params)
|
|
this.view = JSON.parse(res.data.data.libraryExtend.params)
|
|
|
this.id = res.data.data.id
|
|
this.id = res.data.data.id
|
|
|
|
|
+ this.categoryId = res.data.data.categoryId
|
|
|
|
|
+ this.brief = res.data.data.brief
|
|
|
this.libraryExtendId = res.data.data.libraryExtend.id
|
|
this.libraryExtendId = res.data.data.libraryExtend.id
|
|
|
this.viewTitle = res.data.data.title
|
|
this.viewTitle = res.data.data.title
|
|
|
this.view.map(item=>{
|
|
this.view.map(item=>{
|
|
@@ -486,6 +503,29 @@ export default {
|
|
|
this.position()
|
|
this.position()
|
|
|
return arr;
|
|
return arr;
|
|
|
},
|
|
},
|
|
|
|
|
+ // 加载分类
|
|
|
|
|
+ loadCategoryList () {
|
|
|
|
|
+ return service.get("/material/category/list", {params: {rootCode: this.rootCode}}).then( (res)=> {
|
|
|
|
|
+ if (res.data.code !== 0) return this.$message.error(res.data.msg);
|
|
|
|
|
+ if (res.data.data) {
|
|
|
|
|
+ this.categoryList = this.initTree(res.data.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ initTree(data) {
|
|
|
|
|
+ return data.map(function (dt) {
|
|
|
|
|
+ if (dt.children) {
|
|
|
|
|
+ if (dt.children.length === 0) delete dt.children;
|
|
|
|
|
+ else dt.children = this.initTree(dt.children);
|
|
|
|
|
+ }
|
|
|
|
|
+ return dt;
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ changeCategoryHandle: function (event) {
|
|
|
|
|
+ if (event && event.length > 0) {
|
|
|
|
|
+ this.categoryId = event[event.length - 1];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 提交
|
|
// 提交
|
|
|
submit() {
|
|
submit() {
|
|
|
console.log(this.view)
|
|
console.log(this.view)
|
|
@@ -497,7 +537,9 @@ export default {
|
|
|
params: JSON.stringify(this.view)
|
|
params: JSON.stringify(this.view)
|
|
|
},
|
|
},
|
|
|
title: this.viewTitle,
|
|
title: this.viewTitle,
|
|
|
- rootCode: 'brochure'
|
|
|
|
|
|
|
+ rootCode: 'brochure',
|
|
|
|
|
+ brief:this.brief,
|
|
|
|
|
+ categoryId:this.categoryId
|
|
|
}
|
|
}
|
|
|
if (this.id) {
|
|
if (this.id) {
|
|
|
posObj.id = this.id
|
|
posObj.id = this.id
|