serv\web-侧边栏 标签统一

This commit is contained in:
2025-10-27 16:21:00 +08:00
parent e50de4a277
commit 5fa4e1cd42
47 changed files with 1933 additions and 1307 deletions

View File

@@ -68,8 +68,8 @@
import { ref, onMounted } from 'vue';
import { ElButton, ElInput, ElTable, ElTableColumn, ElTag, ElPagination, ElMessage } from 'element-plus';
import { useRouter } from 'vue-router';
import { resourceApi, resourceCategoryApi } from '@/apis/resource'
import type { PageParam, ResourceSearchParams, Resource, ResourceCategory } from '@/types';
import { resourceApi, resourceTagApi } from '@/apis/resource'
import type { PageParam, ResourceSearchParams, Resource, Tag } from '@/types';
import { ArticleShowView } from '@/views/article';
import { ArticleStatus } from '@/types/enums';
@@ -86,7 +86,7 @@ const total = ref<number>(0);
const articles = ref<Resource[]>([]);
const showViewDialog = ref(false);
const currentArticle = ref<any>(null);
const categoryList = ref<ResourceCategory[]>([]);
const categoryList = ref<Tag[]>([]); // 改为使用Tag类型tagType=1表示文章分类
onMounted(() => {
loadArticles();
@@ -95,7 +95,8 @@ onMounted(() => {
async function loadCategories() {
try {
const res = await resourceCategoryApi.getCategoryList();
// 使用新的标签API获取文章分类标签tagType=1
const res = await resourceTagApi.getTagsByType(1); // 1 = 文章分类标签
if (res.success && res.dataList) {
categoryList.value = res.dataList;
}