|
|
|
@ -80,6 +80,7 @@ |
|
|
|
|
export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
id: this.$route.query.id || '', |
|
|
|
|
typeList: [], |
|
|
|
|
defaultProps: { |
|
|
|
|
children: 'children', |
|
|
|
@ -122,11 +123,10 @@ export default { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
handleId(res) |
|
|
|
|
console.log(res) |
|
|
|
|
|
|
|
|
|
this.typeList = res |
|
|
|
|
// 取首个的id和简介 |
|
|
|
|
if (!this.edited) { |
|
|
|
|
// 取首个的id和简介 |
|
|
|
|
if (res[0].children.length) { |
|
|
|
|
let item = res[0].children[0] |
|
|
|
|
this.categoryId = item.id |
|
|
|
@ -146,13 +146,18 @@ export default { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.type.setCurrentKey(this.categoryId) |
|
|
|
|
}) |
|
|
|
|
} else if (this.id) { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.defaultActive = [+this.id] |
|
|
|
|
this.$refs.type.setCurrentKey(+this.id) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.getKeyword() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 分类点击 |
|
|
|
|
typeClick (data, node) { |
|
|
|
|
console.log(data) |
|
|
|
|
this.$router.push(`/data?tab=third&id=${data.id}`).catch(e => { }) |
|
|
|
|
this.editing = false |
|
|
|
|
this.categoryId = data.id |
|
|
|
|
this.defaultActive = [data.id] |
|
|
|
@ -186,7 +191,7 @@ export default { |
|
|
|
|
this.introduceText = this.introduce |
|
|
|
|
this.editing = false |
|
|
|
|
this.edited = true |
|
|
|
|
// this.getData() |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 删除关键词 |
|
|
|
|