Skip to content

Commit 9128fa9

Browse files
committed
修复首页头像不显示
1 parent ce79dd6 commit 9128fa9

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

src/views/Home/Index.vue

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<div>
33
<el-card shadow="never">
44
<el-skeleton :loading="loading" animated>
5-
<el-row :gutter="20" justify="space-between">
5+
<el-row :gutter="16" justify="space-between">
66
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
77
<div class="flex items-center">
8-
<img :src="avatar" alt="" class="mr-20px h-70px w-70px rounded-[50%]" />
8+
<el-avatar :src="avatar" :size="70" class="mr-16px">
9+
<img src="@/assets/imgs/avatar.gif" alt="" />
10+
</el-avatar>
911
<div>
1012
<div class="text-20px">
1113
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
@@ -19,7 +21,7 @@
1921
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24">
2022
<div class="h-70px flex items-center justify-end lt-sm:mt-10px">
2123
<div class="px-8px text-right">
22-
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.project') }}</div>
24+
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.project') }}</div>
2325
<CountTo
2426
class="text-20px"
2527
:start-val="0"
@@ -29,7 +31,7 @@
2931
</div>
3032
<el-divider direction="vertical" />
3133
<div class="px-8px text-right">
32-
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
34+
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.toDo') }}</div>
3335
<CountTo
3436
class="text-20px"
3537
:start-val="0"
@@ -39,7 +41,7 @@
3941
</div>
4042
<el-divider direction="vertical" border-style="dashed" />
4143
<div class="px-8px text-right">
42-
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.access') }}</div>
44+
<div class="mb-16px text-14px text-gray-400">{{ t('workplace.access') }}</div>
4345
<CountTo
4446
class="text-20px"
4547
:start-val="0"
@@ -54,8 +56,8 @@
5456
</el-card>
5557
</div>
5658

57-
<el-row class="mt-5px" :gutter="20" justify="space-between">
58-
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px">
59+
<el-row class="mt-8px" :gutter="8" justify="space-between">
60+
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
5961
<el-card shadow="never">
6062
<template #header>
6163
<div class="h-3 flex justify-between">
@@ -76,11 +78,11 @@
7678
>
7779
<el-card shadow="hover">
7880
<div class="flex items-center">
79-
<Icon :icon="item.icon" :size="25" class="mr-10px" />
81+
<Icon :icon="item.icon" :size="25" class="mr-8px" />
8082
<span class="text-16px">{{ item.name }}</span>
8183
</div>
82-
<div class="mt-15px text-14px text-gray-400">{{ t(item.message) }}</div>
83-
<div class="mt-20px flex justify-between text-12px text-gray-400">
84+
<div class="mt-16px text-14px text-gray-400">{{ t(item.message) }}</div>
85+
<div class="mt-16px flex justify-between text-12px text-gray-400">
8486
<span>{{ item.personal }}</span>
8587
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
8688
</div>
@@ -90,18 +92,18 @@
9092
</el-skeleton>
9193
</el-card>
9294

93-
<el-card shadow="never" class="mt-5px">
95+
<el-card shadow="never" class="mt-8px">
9496
<el-skeleton :loading="loading" animated>
9597
<el-row :gutter="20" justify="space-between">
9698
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24">
97-
<el-card shadow="hover" class="mb-10px">
99+
<el-card shadow="hover" class="mb-8px">
98100
<el-skeleton :loading="loading" animated>
99101
<Echart :options="pieOptionsData" :height="280" />
100102
</el-skeleton>
101103
</el-card>
102104
</el-col>
103105
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
104-
<el-card shadow="hover" class="mb-10px">
106+
<el-card shadow="hover" class="mb-8px">
105107
<el-skeleton :loading="loading" animated>
106108
<Echart :options="barOptionsData" :height="280" />
107109
</el-skeleton>
@@ -111,7 +113,7 @@
111113
</el-skeleton>
112114
</el-card>
113115
</el-col>
114-
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px">
116+
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
115117
<el-card shadow="never">
116118
<template #header>
117119
<div class="h-3 flex justify-between">
@@ -120,9 +122,9 @@
120122
</template>
121123
<el-skeleton :loading="loading" animated>
122124
<el-row>
123-
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-10px">
125+
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
124126
<div class="flex items-center">
125-
<Icon :icon="item.icon" class="mr-10px" />
127+
<Icon :icon="item.icon" class="mr-8px" />
126128
<el-link type="default" :underline="false" @click="setWatermark(item.name)">
127129
{{ item.name }}
128130
</el-link>
@@ -131,7 +133,7 @@
131133
</el-row>
132134
</el-skeleton>
133135
</el-card>
134-
<el-card shadow="never" class="mt-10px">
136+
<el-card shadow="never" class="mt-8px">
135137
<template #header>
136138
<div class="h-3 flex justify-between">
137139
<span>{{ t('workplace.notice') }}</span>
@@ -141,14 +143,16 @@
141143
<el-skeleton :loading="loading" animated>
142144
<div v-for="(item, index) in notice" :key="`dynamics-${index}`">
143145
<div class="flex items-center">
144-
<img :src="avatar" alt="" class="mr-20px h-35px w-35px rounded-[50%]" />
146+
<el-avatar :src="avatar" :size="35" class="mr-16px">
147+
<img src="@/assets/imgs/avatar.gif" alt="" />
148+
</el-avatar>
145149
<div>
146150
<div class="text-14px">
147151
<Highlight :keys="item.keys.map((v) => t(v))">
148152
{{ item.type }} : {{ item.title }}
149153
</Highlight>
150154
</div>
151-
<div class="mt-15px text-12px text-gray-400">
155+
<div class="mt-16px text-12px text-gray-400">
152156
{{ formatTime(item.date, 'yyyy-MM-dd') }}
153157
</div>
154158
</div>
@@ -167,7 +171,6 @@ import { formatTime } from '@/utils'
167171
168172
import { useUserStore } from '@/store/modules/user'
169173
import { useWatermark } from '@/hooks/web/useWatermark'
170-
import avatarImg from '@/assets/imgs/avatar.gif'
171174
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
172175
import { pieOptions, barOptions } from './echarts-data'
173176
@@ -177,7 +180,7 @@ const { t } = useI18n()
177180
const userStore = useUserStore()
178181
const { setWatermark } = useWatermark()
179182
const loading = ref(true)
180-
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
183+
const avatar = userStore.getUser.avatar
181184
const username = userStore.getUser.nickname
182185
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
183186
// 获取统计数

0 commit comments

Comments
 (0)