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