Skip to content

Commit 5240fe2

Browse files
committed
feat:优化首页的说明
1 parent 8157939 commit 5240fe2

File tree

2 files changed

+85
-57
lines changed

2 files changed

+85
-57
lines changed

src/views/Home/Index.vue

Lines changed: 83 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,16 @@
8383
:sm="24"
8484
:xs="24"
8585
>
86-
<el-card shadow="hover" class="mr-5px mt-5px">
86+
<el-card
87+
shadow="hover"
88+
class="mr-5px mt-5px cursor-pointer"
89+
@click="handleProjectClick(item.message)"
90+
>
8791
<div class="flex items-center">
88-
<Icon :icon="item.icon" :size="25" class="mr-8px" />
92+
<Icon :icon="item.icon" :size="25" class="mr-8px" :style="{ color: item.color }" />
8993
<span class="text-16px">{{ item.name }}</span>
9094
</div>
91-
<div class="mt-12px text-9px text-gray-400">{{ t(item.message) }}</div>
95+
<div class="mt-12px text-12px text-gray-400">{{ t(item.message) }}</div>
9296
<div class="mt-12px flex justify-between text-12px text-gray-400">
9397
<span>{{ item.personal }}</span>
9498
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span>
@@ -131,8 +135,8 @@
131135
<el-row>
132136
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-8px">
133137
<div class="flex items-center">
134-
<Icon :icon="item.icon" class="mr-8px" />
135-
<el-link type="default" :underline="false" @click="setWatermark(item.name)">
138+
<Icon :icon="item.icon" class="mr-8px" :style="{ color: item.color }" />
139+
<el-link type="default" :underline="false" @click="handleShortcutClick(item.url)">
136140
{{ item.name }}
137141
</el-link>
138142
</div>
@@ -180,10 +184,12 @@ import { useUserStore } from '@/store/modules/user'
180184
import { useWatermark } from '@/hooks/web/useWatermark'
181185
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
182186
import { pieOptions, barOptions } from './echarts-data'
187+
import { useRouter } from 'vue-router'
183188
184189
defineOptions({ name: 'Home' })
185190
186191
const { t } = useI18n()
192+
const router = useRouter()
187193
const userStore = useUserStore()
188194
const { setWatermark } = useWatermark()
189195
const loading = ref(true)
@@ -212,45 +218,51 @@ const getProject = async () => {
212218
const data = [
213219
{
214220
name: 'ruoyi-vue-pro',
215-
icon: 'akar-icons:github-fill',
216-
message: 'https://github.com/YunaiV/ruoyi-vue-pro',
221+
icon: 'simple-icons:springboot',
222+
message: 'github.com/YunaiV/ruoyi-vue-pro',
217223
personal: 'Spring Boot 单体架构',
218-
time: new Date()
224+
time: new Date('2025-01-02'),
225+
color: '#6DB33F'
219226
},
220227
{
221228
name: 'yudao-ui-admin-vue3',
222-
icon: 'logos:vue',
223-
message: 'https://github.com/yudaocode/yudao-ui-admin-vue3',
224-
personal: 'Vue3 + element-plus',
225-
time: new Date()
229+
icon: 'ep:element-plus',
230+
message: 'github.com/yudaocode/yudao-ui-admin-vue3',
231+
personal: 'Vue3 + element-plus 管理后台',
232+
time: new Date('2025-02-03'),
233+
color: '#409EFF'
226234
},
227235
{
228-
name: 'yudao-ui-admin-vben',
229-
icon: 'logos:vue',
230-
message: 'https://github.com/yudaocode/yudao-ui-admin-vben',
231-
personal: 'Vue3 + vben(antd)',
232-
time: new Date()
236+
name: 'yudao-ui-mall-uniapp',
237+
icon: 'icon-park-outline:mall-bag',
238+
message: 'github.com/yudaocode/yudao-ui-mall-uniapp',
239+
personal: 'Vue3 + uniapp 商城手机端',
240+
time: new Date('2025-03-04'),
241+
color: '#ff4d4f'
233242
},
234243
{
235244
name: 'yudao-cloud',
236-
icon: 'akar-icons:github',
237-
message: 'https://github.com/YunaiV/yudao-cloud',
245+
icon: 'material-symbols:cloud-outline',
246+
message: 'github.com/YunaiV/yudao-cloud',
238247
personal: 'Spring Cloud 微服务架构',
239-
time: new Date()
248+
time: new Date('2025-04-05'),
249+
color: '#1890ff'
240250
},
241251
{
242-
name: 'yudao-ui-mall-uniapp',
243-
icon: 'logos:vue',
244-
message: 'https://github.com/yudaocode/yudao-ui-admin-uniapp',
245-
personal: 'Vue3 + uniapp',
246-
time: new Date()
252+
name: 'yudao-ui-admin-vben',
253+
icon: 'devicon:antdesign',
254+
message: 'github.com/yudaocode/yudao-ui-admin-vben',
255+
personal: 'Vue3 + vben5(antd) 管理后台',
256+
time: new Date('2025-05-06'),
257+
color: '#e18525'
247258
},
248259
{
249-
name: 'yudao-ui-admin-vue2',
250-
icon: 'logos:vue',
251-
message: 'https://github.com/yudaocode/yudao-ui-admin-vue2',
252-
personal: 'Vue2 + element-ui',
253-
time: new Date()
260+
name: 'yudao-ui-admin-uniapp',
261+
icon: 'ant-design:mobile',
262+
message: 'github.com/yudaocode/yudao-ui-admin-uniapp',
263+
personal: 'Vue3 + uniapp 管理手机端',
264+
time: new Date('2025-06-01'),
265+
color: '#2979ff'
254266
}
255267
]
256268
projects = Object.assign(projects, data)
@@ -262,26 +274,26 @@ const getNotice = async () => {
262274
const data = [
263275
{
264276
title: '系统支持 JDK 8/17/21,Vue 2/3',
265-
type: '通知',
266-
keys: ['通知', '8', '17', '21', '2', '3'],
277+
type: '技术兼容性',
278+
keys: ['JDK', 'Vue'],
267279
date: new Date()
268280
},
269281
{
270282
title: '后端提供 Spring Boot 2.7/3.2 + Cloud 双架构',
271-
type: '公告',
272-
keys: ['公告', 'Boot', 'Cloud'],
283+
type: '架构灵活性',
284+
keys: ['Boot', 'Cloud'],
273285
date: new Date()
274286
},
275287
{
276288
title: '全部开源,个人与企业可 100% 直接使用,无需授权',
277-
type: '通知',
278-
keys: ['通知', '无需授权'],
289+
type: '开源免授权',
290+
keys: ['无需授权'],
279291
date: new Date()
280292
},
281293
{
282-
title: '国内使用最广泛的快速开发平台,超 300+ 人贡献',
283-
type: '公告',
284-
keys: ['公告', '最广泛'],
294+
title: '国内使用最广泛的快速开发平台,远超 10w+ 企业使用',
295+
type: '广泛企业认可',
296+
keys: ['最广泛', '10w+'],
285297
date: new Date()
286298
}
287299
]
@@ -294,34 +306,40 @@ let shortcut = reactive<Shortcut[]>([])
294306
const getShortcut = async () => {
295307
const data = [
296308
{
297-
name: 'Github',
298-
icon: 'akar-icons:github-fill',
299-
url: 'github.io'
309+
name: '首页',
310+
icon: 'ion:home-outline',
311+
url: '/',
312+
color: '#1fdaca'
300313
},
301314
{
302-
name: 'Vue',
303-
icon: 'logos:vue',
304-
url: 'vuejs.org'
315+
name: '商城中心',
316+
icon: 'ep:shop',
317+
url: '/mall/home',
318+
color: '#ff6b6b'
305319
},
306320
{
307-
name: 'Vite',
308-
icon: 'vscode-icons:file-type-vite',
309-
url: 'https://vitejs.dev/'
321+
name: 'AI 大模型',
322+
icon: 'tabler:ai',
323+
url: '/ai/chat',
324+
color: '#7c3aed'
310325
},
311326
{
312-
name: 'Angular',
313-
icon: 'logos:angular-icon',
314-
url: 'github.io'
327+
name: 'ERP 系统',
328+
icon: 'simple-icons:erpnext',
329+
url: '/erp/home',
330+
color: '#3fb27f'
315331
},
316332
{
317-
name: 'React',
318-
icon: 'logos:react',
319-
url: 'github.io'
333+
name: 'CRM 系统',
334+
icon: 'simple-icons:civicrm',
335+
url: '/crm/backlog',
336+
color: '#4daf1bc9'
320337
},
321338
{
322-
name: 'Webpack',
323-
icon: 'logos:webpack',
324-
url: 'github.io'
339+
name: 'IoT 物联网',
340+
icon: 'fa-solid:hdd',
341+
url: '/iot/home',
342+
color: '#1a73e8'
325343
}
326344
]
327345
shortcut = Object.assign(shortcut, data)
@@ -387,5 +405,13 @@ const getAllApi = async () => {
387405
loading.value = false
388406
}
389407
408+
const handleProjectClick = (message: string) => {
409+
window.open(`https://${message}`, '_blank')
410+
}
411+
412+
const handleShortcutClick = (url: string) => {
413+
router.push(url)
414+
}
415+
390416
getAllApi()
391417
</script>

src/views/Home/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type Project = {
1010
message: string
1111
personal: string
1212
time: Date | number | string
13+
color: string
1314
}
1415

1516
export type Notice = {
@@ -23,6 +24,7 @@ export type Shortcut = {
2324
name: string
2425
icon: string
2526
url: string
27+
color: string
2628
}
2729

2830
export type RadarData = {

0 commit comments

Comments
 (0)