diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs index 1cc27cf6..2f1c387e 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs @@ -44,6 +44,21 @@ namespace Yi.Framework.Bbs.Application.Services } } + + + + /// + /// 获取全部访问流量 + /// + /// + public async Task> Get() + { + var entities = await _repository._DbQueryable.OrderBy(x => x.CreationTime).ToListAsync(); + var output = entities.Adapt>(); + output?.ForEach(x => x.CreationTime = x.CreationTime.Date); + return output; + } + /// /// 触发 /// @@ -106,5 +121,8 @@ namespace Yi.Framework.Bbs.Application.Services return result.ToArray(); } + + + } } diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs index 357d6da3..0e23cc1f 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/BbsUserAnalyseService.cs @@ -93,5 +93,6 @@ namespace Yi.Framework.Bbs.Application.Services.Analyses } } + } } diff --git a/Yi.Bbs.Vue3/src/apis/accessApi.js b/Yi.Bbs.Vue3/src/apis/accessApi.js index 8506ccf5..cbbcf2cc 100644 --- a/Yi.Bbs.Vue3/src/apis/accessApi.js +++ b/Yi.Bbs.Vue3/src/apis/accessApi.js @@ -15,3 +15,10 @@ export function getWeek() { method: "get", }); } +// 获取全部数据 +export function getAccessList() { + return request({ + url: "/access-log", + method: "get", + }); +} diff --git a/Yi.Bbs.Vue3/src/components/InfoCard.vue b/Yi.Bbs.Vue3/src/components/InfoCard.vue index 4bf2469e..2820ecb0 100644 --- a/Yi.Bbs.Vue3/src/components/InfoCard.vue +++ b/Yi.Bbs.Vue3/src/components/InfoCard.vue @@ -2,7 +2,12 @@ import { ref } from "vue"; const props = defineProps(["items", "header", "text", "hideDivider", "height"]); +const emit = defineEmits(['onClickText']) const height = ref(props.height + "px"); + +const onClickText=()=>{ + emit('onClickText') +} @@ -10,7 +15,7 @@ const height = ref(props.height + "px"); {{ props.header }} - {{ props.text }} + {{ props.text }} diff --git a/Yi.Bbs.Vue3/src/views/home/Index.vue b/Yi.Bbs.Vue3/src/views/home/Index.vue index 00261daa..eb8a6420 100644 --- a/Yi.Bbs.Vue3/src/views/home/Index.vue +++ b/Yi.Bbs.Vue3/src/views/home/Index.vue @@ -6,22 +6,11 @@ - - + + @@ -49,11 +38,7 @@ {{ item.name }} - + @@ -101,20 +86,22 @@ - + + + + + - + - 没有什么能够阻挡,人类对代码优雅的追求 + 没有什么能够阻挡,人类对代码优雅的追求 @@ -122,12 +109,7 @@ - + @@ -135,19 +117,16 @@ - + + + - + @@ -155,18 +134,15 @@ - + + + - + @@ -174,7 +150,9 @@ - + + + @@ -197,7 +175,8 @@ import PlateCard from "@/components/PlateCard.vue"; import ScrollbarInfo from "@/components/ScrollbarInfo.vue"; import BottomInfo from "@/components/BottomInfo.vue"; import VisitsLineChart from "./components/VisitsLineChart/index.vue"; -import { access } from "@/apis/accessApi.js"; +import AccessLogChart from "./components/AccessLogChart/Index.vue" +import { access, getAccessList } from "@/apis/accessApi.js"; import { getList } from "@/apis/plateApi.js"; import { getList as bannerGetList } from "@/apis/bannerApi.js"; import { getHomeDiscuss } from "@/apis/discussApi.js"; @@ -215,10 +194,10 @@ import ThemeData from "./components/RecommendTheme/index.vue"; import Skeleton from "@/components/Skeleton/index.vue"; import useSocketStore from "@/stores/socket"; - +const accessLogDialogVisible = ref(false) const router = useRouter(); - +const accessAllList = ref([]); const plateList = ref([]); const discussList = ref([]); @@ -294,6 +273,25 @@ const statisOptions = computed(() => { }, }; }); +//历史全部访问统计 +const accessLogOptins = computed(() => { + return { + xAxis: { + data: accessAllList.value?.map((item,index)=>{ + return item.creationTime.slice(0, 10); + + }) + }, + series: [ + { + data: accessAllList.value?.map((item,index)=>{ + return item.number; + }) + } + ] + } +}); + const handleToSign = () => { router.push("/activity/sign"); @@ -309,12 +307,19 @@ watch( { deep: true } ); +const onClickAccessLog = async () => { + accessLogDialogVisible.value = true; + const {data} = await getAccessList(); + + accessAllList.value = data; +} diff --git a/Yi.Bbs.Vue3/src/views/home/components/AccessLogChart/Index.vue b/Yi.Bbs.Vue3/src/views/home/components/AccessLogChart/Index.vue new file mode 100644 index 00000000..57be3852 --- /dev/null +++ b/Yi.Bbs.Vue3/src/views/home/components/AccessLogChart/Index.vue @@ -0,0 +1,31 @@ + + + + + + + \ No newline at end of file diff --git a/Yi.Bbs.Vue3/src/views/home/hooks/accessLogEchartsConfig.js b/Yi.Bbs.Vue3/src/views/home/hooks/accessLogEchartsConfig.js new file mode 100644 index 00000000..a9b7f064 --- /dev/null +++ b/Yi.Bbs.Vue3/src/views/home/hooks/accessLogEchartsConfig.js @@ -0,0 +1,18 @@ +export const accessLogEchartsConfig = { + xAxis: { + type: 'category', + boundaryGap: false, + data: [] + }, + yAxis: { + type: 'value' + }, + series: [ + { + data: [], + type: 'line', + areaStyle: {} + } + ] +}; + \ No newline at end of file