perf: 整体优化细节

This commit is contained in:
橙子
2025-02-06 12:54:48 +08:00
parent 9c94953e0e
commit 37b16e8395
7 changed files with 33 additions and 20 deletions

View File

@@ -1,4 +1,5 @@
using Mapster;
using Microsoft.Extensions.Caching.Distributed;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Yi.Framework.Bbs.Domain.Entities.Forum;
@@ -28,10 +29,13 @@ public class DiscussLableRepository : SqlSugarRepository<DiscussLableAggregateRo
public async Task<Dictionary<Guid, DiscussLableCacheItem>> GetDiscussLableCacheMapAsync()
{
var cahce = await _lableCache.GetOrAddAsync(DiscussLableConst.DiscussLableCacheKey, async () =>
{
var entities = await _DbQueryable.ToListAsync();
return entities.Adapt<List<DiscussLableCacheItem>>();
});
{
var entities = await _DbQueryable.ToListAsync();
return entities.Adapt<List<DiscussLableCacheItem>>();
}, () =>
new DistributedCacheEntryOptions()
{ AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(2) }
);
return cahce.ToDictionary(x => x.Id);
}
}

View File

@@ -11,7 +11,7 @@ const onClickText=()=>{
</script>
<template>
<el-card class="box-card" shadow="never" :body-style="{padding: isPadding===false?'0px 20px':'20px 20px'}">
<el-card class="box-card" shadow="never" :body-style="{padding: props.isPadding===false?'0px 0px':'20px 20px'}">
<template #header>
<div class="card-header">
<span>{{ props.header }}</span>

View File

@@ -1,9 +1,10 @@
<template>
<!-- @node-click="handleNodeClick"-->
<el-tree
empty-text="无子文章"
:data="props.data == '' ? [] : props.data"
:props="defaultProps"
@node-click="handleNodeClick"
:expand-on-click-node="false"
node-key="id"
:default-expand-all="true"
@@ -18,7 +19,7 @@
:content="data.name"
placement="right"
>
<span class="title-name">{{ data.name }}</span>
<span @click="handleNodeClick(data)" class="title-name">{{ data.name }}</span>
</el-tooltip>
<span>
@@ -44,6 +45,7 @@
删除
</a>
</span>
</span>
</template>
</el-tree>
@@ -79,7 +81,7 @@ const { isHasPermission: isRemoveArticle } = getPermission("bbs:article:del");
</script>
<style scoped>
.custom-tree-node {
width: 100%;
flex: 1;
display: flex;
align-items: center;

View File

@@ -13,7 +13,7 @@
<el-menu-item index="2" @click="enterStart"
>开始</el-menu-item>
<el-menu-item index="3" @click="enterWatermelon" style="color: red;font-weight: bolder;font-size: large;"
<el-menu-item index="3" @click="enterBook" style="color: red;font-weight: bolder;font-size: large;"
>面试宝典</el-menu-item>
<el-menu-item index="4" @click="enterShop"
>商城</el-menu-item>
@@ -233,9 +233,8 @@ const enterStart = () => {
router.push("/start");
}
const enterWatermelon=()=>{
// router.push("/dc");
alert("即将上线,敬请期待!")
const enterBook=()=>{
router.push("/book");
}
const enterShop=()=>{
router.push("/shop");

View File

@@ -45,6 +45,10 @@
<el-icon><Trophy /></el-icon>
<span>数字藏品</span>
</el-menu-item>
<el-menu-item index="9" :route="{ path: '/book' }">
<el-icon><Memo /></el-icon>
<span>面试宝典</span>
</el-menu-item>
</el-menu>
</template>

View File

@@ -4,7 +4,7 @@
<el-col :span="5">
<el-row class="art-info-left">
<el-col :span="24">
<InfoCard header="文章信息" text="展开" hideDivider="true">
<InfoCard header="文章信息" text="展开" hideDivider="true" :isPadding="false" style="padding: 10px">
<template #content>
<el-button
style="width: 100%; margin-bottom: 0.8rem"
@@ -21,7 +21,7 @@
</el-button
>
<!--目录在这里 -->
<el-scrollbar style="min-height: 410px">
<el-scrollbar style="height:600px;overflow-y: auto;">
<TreeArticleInfo
:data="articleData"
@remove="delArticle"
@@ -36,7 +36,7 @@
</InfoCard>
</el-col>
<el-col :span="24">
<InfoCard :items="authorList" :isPadding="false" header="作者分享" height="410" text="更多">
<InfoCard :items="authorList" :isPadding="false" header="作者分享" height="410" text="更多" style="padding:0 20px">
<template #item="temp">
<ThemeData :themeData="temp"/>
</template>
@@ -160,7 +160,7 @@
</InfoCard>
</el-col>
<el-col :span="24">
<InfoCard :items="themeList" :isPadding="false" header="推荐主题" text="更多" height="500">
<InfoCard :items="themeList" :isPadding="false" header="推荐主题" text="更多" height="500" style="padding:0 20px">
<template #item="temp">
<ThemeData :themeData="temp"/>
</template>

View File

@@ -162,6 +162,7 @@ margin: 10px auto;">
<el-col v-if="!isIcp" :span="24">
<template v-if="isPointFinished">
<InfoCard :isPadding="false" :items="pointList" header="财富排行榜" text="查看我的位置" height="410"
style="padding:0 20px"
@onClickText="onClickMoneyTop">
<template #item="temp">
<PointsRanking :pointsData="temp"/>
@@ -179,7 +180,8 @@ margin: 10px auto;">
<el-col v-if="!isIcp" :span="24">
<template v-if="isFriendFinished">
<InfoCard :isPadding="false" :items="friendList" header="推荐好友" text="更多" height="400">
<InfoCard :isPadding="false" :items="friendList" header="推荐好友" text="更多" height="400"
style="padding:0 20px">
<template #item="temp">
<RecommendFriend :friendData="temp"/>
</template>
@@ -195,7 +197,9 @@ margin: 10px auto;">
</el-col>
<el-col v-if="!isIcp" :span="24">
<template v-if="isThemeFinished">
<InfoCard :isPadding="false" :items="themeList" header="推荐主题" text="更多" height="400">
<InfoCard :isPadding="false" :items="themeList" header="推荐主题" text="更多" height="400"
style="padding:0 20px"
>
<template #item="temp">
<ThemeData :themeData="temp"/>
</template>
@@ -307,10 +311,10 @@ const activeList = [
{name: "排行榜", path: "/money", icon: "Money"},
{name: "开始", path: "/start", icon: "Position"},
{name: "聊天室", path: "/chat", icon: "ChatRound"},
{name: "商城", path: "/shop", icon: "ShoppingCart"},
{name: "数字藏品", path: "/dc", icon: "Trophy"},
{name: "面试宝典", path: "/book", icon: "Memo"},
// {name: "小程序", path: "/", icon: "Position"},
// {name: "公众号", path: "/", icon: "ChatRound"},
];