-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62e4da0
commit 7bd1e47
Showing
12 changed files
with
8,007 additions
and
117 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script setup lang="ts"> | ||
defineOptions({ | ||
name: 'SoybeanAvatar' | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="size-72px rd-1/2 overflow-hidden"> | ||
<img src="@/assets/imgs/soybean.jpg" class="size-full" /> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { createReusableTemplate } from '@vueuse/core'; | ||
import { $t } from '@/locales'; | ||
defineOptions({ | ||
name: 'CardData' | ||
}); | ||
interface CardData { | ||
key: string; | ||
title: string; | ||
value: number; | ||
unit: string; | ||
color: { | ||
start: string; | ||
end: string; | ||
}; | ||
icon: string; | ||
} | ||
const cardData = computed<CardData[]>(() => [ | ||
{ | ||
key: 'visitCount', | ||
title: $t('page.home.visitCount'), | ||
value: 9725, | ||
unit: '', | ||
color: { | ||
start: '#ec4786', | ||
end: '#b955a4' | ||
}, | ||
icon: 'ant-design:bar-chart-outlined' | ||
}, | ||
{ | ||
key: 'turnover', | ||
title: $t('page.home.turnover'), | ||
value: 1026, | ||
unit: '$', | ||
color: { | ||
start: '#865ec0', | ||
end: '#5144b4' | ||
}, | ||
icon: 'ant-design:money-collect-outlined' | ||
}, | ||
{ | ||
key: 'downloadCount', | ||
title: $t('page.home.downloadCount'), | ||
value: 970925, | ||
unit: '', | ||
color: { | ||
start: '#56cdf3', | ||
end: '#719de3' | ||
}, | ||
icon: 'carbon:document-download' | ||
}, | ||
{ | ||
key: 'dealCount', | ||
title: $t('page.home.dealCount'), | ||
value: 9527, | ||
unit: '', | ||
color: { | ||
start: '#fcbc25', | ||
end: '#f68057' | ||
}, | ||
icon: 'ant-design:trademark-circle-outlined' | ||
} | ||
]); | ||
interface GradientBgProps { | ||
gradientColor: string; | ||
} | ||
const [DefineGradientBg, GradientBg] = createReusableTemplate<GradientBgProps>(); | ||
function getGradientColor(color: CardData['color']) { | ||
return `linear-gradient(to bottom right, ${color.start}, ${color.end})`; | ||
} | ||
</script> | ||
|
||
<template> | ||
<NCard :bordered="false" class="card-wrapper"> | ||
<!-- define component start: GradientBg --> | ||
<DefineGradientBg v-slot="{ $slots, gradientColor }"> | ||
<div class="px-16px pt-8px pb-4px rd-8px text-white" :style="{ backgroundImage: gradientColor }"> | ||
<component :is="$slots.default" /> | ||
</div> | ||
</DefineGradientBg> | ||
<!-- define component end: GradientBg --> | ||
|
||
<NGrid cols="s:1 m:2 l:4" responsive="screen" :x-gap="16" :y-gap="16"> | ||
<NGi v-for="item in cardData" :key="item.key"> | ||
<GradientBg :gradient-color="getGradientColor(item.color)" class="flex-1"> | ||
<h3 class="text-16px">{{ item.title }}</h3> | ||
<div class="flex justify-between pt-12px"> | ||
<SvgIcon :icon="item.icon" class="text-32px" /> | ||
<CountTo | ||
:prefix="item.unit" | ||
:start-value="1" | ||
:end-value="item.value" | ||
class="text-30px text-white dark:text-dark" | ||
/> | ||
</div> | ||
</GradientBg> | ||
</NGi> | ||
</NGrid> | ||
</NCard> | ||
</template> | ||
|
||
<style scoped></style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { $t } from '@/locales'; | ||
import { useAppStore } from '@/store/modules/app'; | ||
import { useAuthStore } from '@/store/modules/auth'; | ||
defineOptions({ | ||
name: 'HeaderBanner' | ||
}); | ||
const appStore = useAppStore(); | ||
const authStore = useAuthStore(); | ||
const gap = computed(() => (appStore.isMobile ? 0 : 16)); | ||
interface StatisticData { | ||
id: number; | ||
label: string; | ||
value: string; | ||
} | ||
const statisticData = computed<StatisticData[]>(() => [ | ||
{ | ||
id: 0, | ||
label: $t('page.home.projectCount'), | ||
value: '25' | ||
}, | ||
{ | ||
id: 1, | ||
label: $t('page.home.todo'), | ||
value: '4/16' | ||
}, | ||
{ | ||
id: 2, | ||
label: $t('page.home.message'), | ||
value: '12' | ||
} | ||
]); | ||
</script> | ||
|
||
<template> | ||
<NCard :bordered="false" class="card-wrapper"> | ||
<NGrid :x-gap="gap" :y-gap="16" responsive="screen" item-responsive> | ||
<NGi span="24 s:24 m:20"> | ||
<div class="flex-y-center"> | ||
<div class="shrink-0 size-72px rd-1/2 overflow-hidden"> | ||
<img src="@/assets/imgs/soybean.jpg" class="size-full" /> | ||
</div> | ||
<div class="pl-12px"> | ||
<h3 class="text-18px font-semibold"> | ||
{{ $t('page.home.greeting', { userName: authStore.userInfo.userName }) }} | ||
</h3> | ||
<p class="leading-30px text-#999">{{ $t('page.home.weatherDesc') }}</p> | ||
</div> | ||
</div> | ||
</NGi> | ||
<NGi span="24 s:24 m:4"> | ||
<NSpace :size="24" justify="end"> | ||
<NStatistic v-for="item in statisticData" :key="item.id" class="whitespace-nowrap" v-bind="item" /> | ||
</NSpace> | ||
</NGi> | ||
</NGrid> | ||
</NCard> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { $t } from '@/locales'; | ||
defineOptions({ | ||
name: 'ProjectNews' | ||
}); | ||
interface NewsItem { | ||
id: number; | ||
content: string; | ||
time: string; | ||
} | ||
const newses = computed<NewsItem[]>(() => [ | ||
{ id: 1, content: $t('page.home.projectNews.desc1'), time: '2021-05-28 22:22:22' }, | ||
{ id: 2, content: $t('page.home.projectNews.desc2'), time: '2021-10-27 10:24:54' }, | ||
{ id: 3, content: $t('page.home.projectNews.desc3'), time: '2021-10-31 22:43:12' }, | ||
{ id: 4, content: $t('page.home.projectNews.desc4'), time: '2021-11-03 20:33:31' }, | ||
{ id: 5, content: $t('page.home.projectNews.desc5'), time: '2021-11-07 22:45:32' } | ||
]); | ||
</script> | ||
|
||
<template> | ||
<NCard :title="$t('page.home.projectNews.title')" :bordered="false" size="small" segmented class="card-wrapper"> | ||
<template #header-extra> | ||
<a class="text-primary" href="javascript:;">{{ $t('page.home.projectNews.moreNews') }}</a> | ||
</template> | ||
<NList> | ||
<NListItem v-for="item in newses" :key="item.id"> | ||
<template #prefix> | ||
<SoybeanAvatar class="size-48px!" /> | ||
</template> | ||
<NThing :title="item.content" :description="item.time" /> | ||
</NListItem> | ||
</NList> | ||
</NCard> | ||
</template> | ||
|
||
<style scoped></style> |
Oops, something went wrong.
7bd1e47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
soybean-admin – ./
soybean-admin-eta.vercel.app
soybean-admin-git-main-soybeanjs.vercel.app
soybean-admin-soybeanjs.vercel.app