Commit 03141b5e by lijiabin

【需求 20331】 chore: 增加标签类型

parent 3f98e5d2
......@@ -10,6 +10,10 @@ export const useTagsStore = defineStore('tags', () => {
// 关联场景相关的标签
const relatedScenariosTagList = ref<TagItemDto[]>([])
// 年度主推关键词标签
const yearRecommendTagList = ref<TagItemDto[]>([])
let isLoading = false
const fetchAllTagList = async () => {
......@@ -17,8 +21,10 @@ export const useTagsStore = defineStore('tags', () => {
isLoading = true
try {
const { data } = await getTagList()
console.log(data, 'data')
tagList.value = data.filter((i) => i.type === 'culture')
relatedScenariosTagList.value = data.filter((i) => i.type === 'related_scenarios')
yearRecommendTagList.value = data.filter((i) => i.type === 'year_recommend')
console.log(tagList.value, 'tagList')
} catch (error) {
console.error(error)
......@@ -29,5 +35,5 @@ export const useTagsStore = defineStore('tags', () => {
// 手动调用一次
fetchAllTagList()
return { tagList, fetchAllTagList, relatedScenariosTagList }
return { tagList, fetchAllTagList, relatedScenariosTagList, yearRecommendTagList }
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment