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 = [];
|
||||
|
||||
@@ -134,7 +134,7 @@ import { Trophy, Check, InfoFilled, Calendar, Star, Present } from '@element-plu
|
||||
import { achievementApi } from '@/apis/achievement';
|
||||
import type { AchievementVO } from '@/types';
|
||||
import { AchievementEnumHelper } from '@/types/enums/achievement-enums';
|
||||
import { PUBLIC_IMG_PATH } from '@/config';
|
||||
import { getAchievementIconUrl } from '@/utils/iconUtils';
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
@@ -215,16 +215,7 @@ function formatDate(dateStr?: string): string {
|
||||
}
|
||||
|
||||
// 获取图标完整路径
|
||||
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;
|
||||
|
||||
// 筛选成就
|
||||
function filterAchievements() {
|
||||
|
||||
@@ -54,12 +54,9 @@ import {userProfileApi} from '@/apis/usercenter/profile'
|
||||
import defaultAvatarImg from '@/assets/imgs/default-avatar.png';
|
||||
import maleIcon from '@/assets/imgs/male.svg';
|
||||
import femaleIcon from '@/assets/imgs/female.svg';
|
||||
import V1Icon from '@/assets/imgs/v1.svg';
|
||||
import V2Icon from '@/assets/imgs/v2.svg';
|
||||
import V3Icon from '@/assets/imgs/v3.svg';
|
||||
import V4Icon from '@/assets/imgs/v4.svg';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { getLevelIconUrl } from '@/utils/iconUtils';
|
||||
|
||||
const router = useRouter();
|
||||
const userInfo = ref<UserVO>();
|
||||
@@ -68,13 +65,8 @@ const userInfo = ref<UserVO>();
|
||||
const defaultAvatar = defaultAvatarImg;
|
||||
|
||||
const levelIcon = computed(() => {
|
||||
switch(userInfo.value?.level){
|
||||
case 1: return V1Icon;
|
||||
case 2: return V2Icon;
|
||||
case 3: return V3Icon;
|
||||
case 4: return V4Icon;
|
||||
}
|
||||
return V1Icon;
|
||||
const level = userInfo.value?.level || 1;
|
||||
return getLevelIconUrl(level);
|
||||
});
|
||||
|
||||
function handleEdit() {
|
||||
|
||||
Reference in New Issue
Block a user