web-成就图标
This commit is contained in:
@@ -315,7 +315,7 @@ import { Plus, Picture } from '@element-plus/icons-vue';
|
||||
import { achievementApi } from '@/apis/achievement';
|
||||
import type { Achievement, UserAchievement } from '@/types';
|
||||
import { AchievementEnumHelper } from '@/types/enums/achievement-enums';
|
||||
import { PUBLIC_IMG_PATH } from '@/config';
|
||||
import { getAchievementIconUrl } from '@/utils/iconUtils';
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
@@ -393,17 +393,7 @@ function formatConditionValue(conditionType?: number, conditionValue?: number):
|
||||
}
|
||||
|
||||
// 获取图标完整路径
|
||||
function getIconUrl(icon?: string): string {
|
||||
if (!icon) return '';
|
||||
// 如果是http或https开头,直接返回
|
||||
if (icon.startsWith('http://') || icon.startsWith('https://')) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
// 否则拼接默认成就图标路径
|
||||
const path = `${PUBLIC_IMG_PATH}/achievement`;
|
||||
return icon.startsWith('/') ? `${path}${icon}` : `${path}/${icon}`;
|
||||
}
|
||||
const getIconUrl = getAchievementIconUrl;
|
||||
|
||||
// 加载成就列表
|
||||
async function loadAchievementList() {
|
||||
|
||||
@@ -321,8 +321,9 @@ const loadCrawlerList = async () => {
|
||||
|
||||
const result = await crontabApi.getTaskPage(filter, pageParam);
|
||||
if (result.success && result.dataList) {
|
||||
crawlerList.value = result.dataList;
|
||||
total.value = result.pageParam?.totalElements || 0;
|
||||
const pageDomain = result.pageDomain!;
|
||||
crawlerList.value = pageDomain.dataList!;
|
||||
total.value = pageDomain.pageParam.totalElements!;
|
||||
} else {
|
||||
ElMessage.error(result.message || '加载爬虫列表失败');
|
||||
crawlerList.value = [];
|
||||
|
||||
Reference in New Issue
Block a user