perf: 整体优化细节
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
|
using Microsoft.Extensions.Caching.Distributed;
|
||||||
using Volo.Abp.Caching;
|
using Volo.Abp.Caching;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
using Yi.Framework.Bbs.Domain.Entities.Forum;
|
using Yi.Framework.Bbs.Domain.Entities.Forum;
|
||||||
@@ -28,10 +29,13 @@ public class DiscussLableRepository : SqlSugarRepository<DiscussLableAggregateRo
|
|||||||
public async Task<Dictionary<Guid, DiscussLableCacheItem>> GetDiscussLableCacheMapAsync()
|
public async Task<Dictionary<Guid, DiscussLableCacheItem>> GetDiscussLableCacheMapAsync()
|
||||||
{
|
{
|
||||||
var cahce = await _lableCache.GetOrAddAsync(DiscussLableConst.DiscussLableCacheKey, async () =>
|
var cahce = await _lableCache.GetOrAddAsync(DiscussLableConst.DiscussLableCacheKey, async () =>
|
||||||
{
|
{
|
||||||
var entities = await _DbQueryable.ToListAsync();
|
var entities = await _DbQueryable.ToListAsync();
|
||||||
return entities.Adapt<List<DiscussLableCacheItem>>();
|
return entities.Adapt<List<DiscussLableCacheItem>>();
|
||||||
});
|
}, () =>
|
||||||
|
new DistributedCacheEntryOptions()
|
||||||
|
{ AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(2) }
|
||||||
|
);
|
||||||
return cahce.ToDictionary(x => x.Id);
|
return cahce.ToDictionary(x => x.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ const onClickText=()=>{
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<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>
|
<template #header>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>{{ props.header }}</span>
|
<span>{{ props.header }}</span>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- @node-click="handleNodeClick"-->
|
||||||
<el-tree
|
<el-tree
|
||||||
empty-text="无子文章"
|
empty-text="无子文章"
|
||||||
:data="props.data == '' ? [] : props.data"
|
:data="props.data == '' ? [] : props.data"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
@node-click="handleNodeClick"
|
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
:default-expand-all="true"
|
:default-expand-all="true"
|
||||||
@@ -18,7 +19,7 @@
|
|||||||
:content="data.name"
|
:content="data.name"
|
||||||
placement="right"
|
placement="right"
|
||||||
>
|
>
|
||||||
<span class="title-name">{{ data.name }}</span>
|
<span @click="handleNodeClick(data)" class="title-name">{{ data.name }}</span>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
删除
|
删除
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
@@ -79,7 +81,7 @@ const { isHasPermission: isRemoveArticle } = getPermission("bbs:article:del");
|
|||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.custom-tree-node {
|
.custom-tree-node {
|
||||||
width: 100%;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<el-menu-item index="2" @click="enterStart"
|
<el-menu-item index="2" @click="enterStart"
|
||||||
>开始</el-menu-item>
|
>开始</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>
|
||||||
<el-menu-item index="4" @click="enterShop"
|
<el-menu-item index="4" @click="enterShop"
|
||||||
>商城</el-menu-item>
|
>商城</el-menu-item>
|
||||||
@@ -233,9 +233,8 @@ const enterStart = () => {
|
|||||||
router.push("/start");
|
router.push("/start");
|
||||||
}
|
}
|
||||||
|
|
||||||
const enterWatermelon=()=>{
|
const enterBook=()=>{
|
||||||
// router.push("/dc");
|
router.push("/book");
|
||||||
alert("即将上线,敬请期待!")
|
|
||||||
}
|
}
|
||||||
const enterShop=()=>{
|
const enterShop=()=>{
|
||||||
router.push("/shop");
|
router.push("/shop");
|
||||||
|
|||||||
@@ -45,6 +45,10 @@
|
|||||||
<el-icon><Trophy /></el-icon>
|
<el-icon><Trophy /></el-icon>
|
||||||
<span>数字藏品</span>
|
<span>数字藏品</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
|
<el-menu-item index="9" :route="{ path: '/book' }">
|
||||||
|
<el-icon><Memo /></el-icon>
|
||||||
|
<span>面试宝典</span>
|
||||||
|
</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<el-row class="art-info-left">
|
<el-row class="art-info-left">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<InfoCard header="文章信息" text="展开" hideDivider="true">
|
<InfoCard header="文章信息" text="展开" hideDivider="true" :isPadding="false" style="padding: 10px">
|
||||||
<template #content>
|
<template #content>
|
||||||
<el-button
|
<el-button
|
||||||
style="width: 100%; margin-bottom: 0.8rem"
|
style="width: 100%; margin-bottom: 0.8rem"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</el-button
|
</el-button
|
||||||
>
|
>
|
||||||
<!--目录在这里 -->
|
<!--目录在这里 -->
|
||||||
<el-scrollbar style="min-height: 410px">
|
<el-scrollbar style="height:600px;overflow-y: auto;">
|
||||||
<TreeArticleInfo
|
<TreeArticleInfo
|
||||||
:data="articleData"
|
:data="articleData"
|
||||||
@remove="delArticle"
|
@remove="delArticle"
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
</InfoCard>
|
</InfoCard>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<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">
|
<template #item="temp">
|
||||||
<ThemeData :themeData="temp"/>
|
<ThemeData :themeData="temp"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
</InfoCard>
|
</InfoCard>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<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">
|
<template #item="temp">
|
||||||
<ThemeData :themeData="temp"/>
|
<ThemeData :themeData="temp"/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ margin: 10px auto;">
|
|||||||
<el-col v-if="!isIcp" :span="24">
|
<el-col v-if="!isIcp" :span="24">
|
||||||
<template v-if="isPointFinished">
|
<template v-if="isPointFinished">
|
||||||
<InfoCard :isPadding="false" :items="pointList" header="财富排行榜" text="查看我的位置" height="410"
|
<InfoCard :isPadding="false" :items="pointList" header="财富排行榜" text="查看我的位置" height="410"
|
||||||
|
style="padding:0 20px"
|
||||||
@onClickText="onClickMoneyTop">
|
@onClickText="onClickMoneyTop">
|
||||||
<template #item="temp">
|
<template #item="temp">
|
||||||
<PointsRanking :pointsData="temp"/>
|
<PointsRanking :pointsData="temp"/>
|
||||||
@@ -179,7 +180,8 @@ margin: 10px auto;">
|
|||||||
|
|
||||||
<el-col v-if="!isIcp" :span="24">
|
<el-col v-if="!isIcp" :span="24">
|
||||||
<template v-if="isFriendFinished">
|
<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">
|
<template #item="temp">
|
||||||
<RecommendFriend :friendData="temp"/>
|
<RecommendFriend :friendData="temp"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -195,7 +197,9 @@ margin: 10px auto;">
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="!isIcp" :span="24">
|
<el-col v-if="!isIcp" :span="24">
|
||||||
<template v-if="isThemeFinished">
|
<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">
|
<template #item="temp">
|
||||||
<ThemeData :themeData="temp"/>
|
<ThemeData :themeData="temp"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -307,10 +311,10 @@ const activeList = [
|
|||||||
{name: "排行榜", path: "/money", icon: "Money"},
|
{name: "排行榜", path: "/money", icon: "Money"},
|
||||||
{name: "开始", path: "/start", icon: "Position"},
|
{name: "开始", path: "/start", icon: "Position"},
|
||||||
{name: "聊天室", path: "/chat", icon: "ChatRound"},
|
{name: "聊天室", path: "/chat", icon: "ChatRound"},
|
||||||
|
|
||||||
|
|
||||||
{name: "商城", path: "/shop", icon: "ShoppingCart"},
|
{name: "商城", path: "/shop", icon: "ShoppingCart"},
|
||||||
{name: "数字藏品", path: "/dc", icon: "Trophy"},
|
{name: "数字藏品", path: "/dc", icon: "Trophy"},
|
||||||
|
{name: "面试宝典", path: "/book", icon: "Memo"},
|
||||||
// {name: "小程序", path: "/", icon: "Position"},
|
// {name: "小程序", path: "/", icon: "Position"},
|
||||||
// {name: "公众号", path: "/", icon: "ChatRound"},
|
// {name: "公众号", path: "/", icon: "ChatRound"},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user