|
|
|
@ -22,7 +22,7 @@ |
|
|
|
|
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input> |
|
|
|
|
<div class="field"> |
|
|
|
|
<p class="label">数据源</p> |
|
|
|
|
<el-input style="width: 250px" placeholder="请输入数据源" v-model="source" type="text"></el-input> |
|
|
|
|
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<div class="btns" v-if="editing"> |
|
|
|
@ -64,7 +64,7 @@ export default { |
|
|
|
|
defaultActive: [], |
|
|
|
|
editing: false, |
|
|
|
|
introduce: '', |
|
|
|
|
source: '', |
|
|
|
|
dataSource: '', |
|
|
|
|
introduceText: '', |
|
|
|
|
categoryId: '', |
|
|
|
|
keywordList: [], |
|
|
|
@ -98,6 +98,7 @@ export default { |
|
|
|
|
|
|
|
|
|
this.typeList = res |
|
|
|
|
// 取首个的id和简介 |
|
|
|
|
this.dataSource = res[0].dataSource |
|
|
|
|
if(res[0].children.length){ |
|
|
|
|
let item = res[0].children[0] |
|
|
|
|
this.categoryId = item.id |
|
|
|
@ -118,6 +119,7 @@ export default { |
|
|
|
|
this.categoryId = data.id |
|
|
|
|
this.introduceText = data.introduce |
|
|
|
|
this.introduce = data.introduce |
|
|
|
|
this.dataSource = data.dataSource |
|
|
|
|
this.getKeyword() |
|
|
|
|
}, |
|
|
|
|
getKeyword(){ |
|
|
|
@ -134,7 +136,8 @@ export default { |
|
|
|
|
confirmEdit(){ |
|
|
|
|
this.$post(this.api.updateCategory,{ |
|
|
|
|
id: this.categoryId, |
|
|
|
|
introduce: this.introduce |
|
|
|
|
introduce: this.introduce, |
|
|
|
|
dataSource: this.dataSource |
|
|
|
|
}).then(res => { |
|
|
|
|
this.$message.success(this.introduceText ? '编辑成功' : '新增成功') |
|
|
|
|
this.introduceText = this.introduce |
|
|
|
|