Commit e4d665db by lijiabin

【需求 17679】 perf: 代码优化

parent 1c5d6821
......@@ -35,7 +35,7 @@
<!-- 优化后的右侧内容 -->
<div class="flex items-center gap-3">
<span
class="px-3 py-1.5 text-sm font-medium bg-blue-50 text-blue-600 rounded-md hover:bg-blue-100 transition-colors""
class="px-3 py-1.5 text-sm font-medium bg-blue-50 text-blue-600 rounded-md hover:bg-blue-100 transition-colors"
v-if="articleDetail.relateColumn"
>
{{ articleDetail.relateColumn }}
......@@ -52,7 +52,6 @@
</div>
</div>
<!-- 帖子内容 -->
<div class="p-6">
<h1 class="text-2xl font-bold text-gray-900 mb-4 leading-tight">
{{ articleDetail?.title }}
......
import { createRouter, createWebHistory } from 'vue-router'
import layoutCulture from '@/layoutCulture/index.vue'
import { scrollBehavior } from './scrollStorage'
import { registerRouterGuards } from './guards'
const routes = [
{
path: '/',
name: 'Layout',
component: layoutCulture,
redirect: '/homePage/homeTab',
meta: {
title: '企业文化首页',
},
children: [
{
path: 'homePage',
name: 'CultureHomePage',
// component: () => import('@/layoutCulture/components/mainContainer.vue'),
component: () => import('@/views/homePage/index.vue'),
children: [
{
path: 'homeTab',
name: 'CultureHomeTab',
component: () => import('@/views/homePage/homeTab/index.vue'),
},
{
path: 'yaTab',
name: 'CultureYaTab',
component: () => import('@/views/homePage/yaTab/index.vue'),
},
{
path: 'askTab',
name: 'CultureAskTab',
component: () => import('@/views/homePage/askTab/index.vue'),
},
],
},
// 个人中心
{
path: 'userPage',
name: 'CultureUserPage',
redirect: '/userPage/selfPublish',
component: () => import('@/views/userPage/index.vue'),
children: [
// 我的帖子
{
path: 'selfPublish',
name: 'CultureSelfPublish',
component: () => import('@/views/userPage/components/selfPublish.vue'),
},
// 我的草稿
{
path: 'selfDraft',
name: 'CultureSelfDraft',
component: () => import('@/views/userPage/components/selfDraft.vue'),
},
// 我的收藏
{
path: 'selfCollect',
name: 'CultureSelfCollect',
component: () => import('@/views/userPage/components/selfCollect.vue'),
},
// 我的点赞
{
path: 'selfPraise',
name: 'CultureSelfPraise',
component: () => import('@/views/userPage/components/selfPraise.vue'),
},
// 我的案例库
{
path: 'selfCase',
name: 'CultureSelfCase',
component: () => import('@/views/userPage/components/selfCase.vue'),
},
// 我的任务
{
path: 'selfTask',
name: 'CultureSelfTask',
component: () => import('@/views/userPage/components/selfTask.vue'),
},
// 评论回复
{
path: 'selfComment',
name: 'CultureSelfComment',
component: () => import('@/views/userPage/components/selfComment.vue'),
},
// 回答问题
{
path: 'selfAnswer',
name: 'CultureSelfAnswer',
component: () => import('@/views/userPage/components/selfAnswer.vue'),
},
// 审核帖子列表
{
path: 'selfAudit',
name: 'CultureSelfAudit',
component: () => import('@/views/userPage/components/selfAudit.vue'),
},
// 审核举报列表
{
path: 'selfComplaint',
name: 'CultureSelfComplaint',
component: () => import('@/views/userPage/components/selfComplaint.vue'),
},
],
},
{
path: 'videoDetail/:id',
name: 'CultureVideoDetail',
component: () => import('@/views/videoDetail/index.vue'),
},
{
path: 'articleDetail/:id',
name: 'CultureArticleDetail',
component: () => import('@/views/articleDetail/index.vue'),
},
{
path: 'pointsStore',
name: 'CulturePointsStore',
component: () => import('@/views/pointsStore/index.vue'),
},
// 发布视频
{
path: 'publishVideo',
name: 'CulturePublishVideo',
component: () => import('@/views/publishVideo/index.vue'),
},
// 去投稿
{
path: 'publishCase',
name: 'CulturePublishCase',
component: () => import('@/views/publishCase/index.vue'),
},
// 搜索页面
{
path: 'searchPage',
name: 'CultureSearchPage',
component: () => import('@/views/searchPage/index.vue'),
},
// 审核
{
path: 'auditArticle/:id',
name: 'CultureAuditArticle',
component: () => import('@/views/auditArticle/index.vue'),
},
// 发布文章
// {
// {
// path: 'deshboard',
// name: 'CultureHome',
// component: () => import('@/views/home/index.vue')
// },
// {
// path: 'ya',
// name: 'CultureYa',
// component: () => import('@/views/ya/index.vue')
// },
// {
// path: 'ask',
// name: 'CultureAsk',
// component: () => import('@/views/ask/index.vue')
// }
],
},
{
path: '/test',
name: 'Test',
component: () => import('@/test.vue'),
},
{
path: '/backend',
name: 'Backend',
component: () => import('@/views/backend/index.vue'),
redirect: '/backend/manager',
children: [
{
path: 'manager',
name: 'ManagerManagement',
component: () => import('@/views/backend/manager/index.vue'),
meta: { title: '企业文化管理员' },
},
{
path: 'tags',
name: 'OfficialManagement',
component: () => import('@/views/backend/tags/index.vue'),
meta: { title: '官方标签' },
},
{
path: 'carousel',
name: 'CarouselManagement',
component: () => import('@/views/backend/carousel/index.vue'),
meta: { title: '轮播图设置' },
},
// {
// path: 'topic-admin',
// name: 'TopicAdminManagement',
// component: () => import('@/views/backend/topic-admin/index.vue'),
// meta: { title: '专栏——管理员' },
// },
{
path: 'columnSettings',
name: 'ColumnSettingsManagement',
component: () => import('@/views/backend/columnSettings/index.vue'),
meta: { title: '专栏——栏目管理' },
},
// {
// path: 'interview-admin',
// name: 'InterviewAdminManagement',
// component: () => import('@/views/backend/interview-admin/index.vue'),
// meta: { title: '专访——管理员' },
// },
{
path: 'interviewSettings',
name: 'InterviewSettingsManagement',
component: () => import('@/views/backend/interviewSettings/index.vue'),
meta: { title: '专访——栏目管理' },
},
{
path: 'videoSettings',
name: 'VideoSettingsManagement',
component: () => import('@/views/backend/videoSettings/index.vue'),
meta: { title: '视频——栏目管理' },
},
{
path: 'videoManage',
name: 'VideoManageManagement',
component: () => import('@/views/backend/videoManage/index.vue'),
meta: { title: '视频管理' },
},
{
path: 'caseManage',
name: 'CaseManageManagement',
component: () => import('@/views/backend/caseManage/index.vue'),
meta: { title: 'YAYA案例库管理' },
},
{
path: 'goodsManage',
name: 'GoodsManageManagement',
component: () => import('@/views/backend/goodsManage/index.vue'),
meta: { title: '积分商城——商品配置' },
},
{
path: 'goodsDistribution',
name: 'GoodsDistributionManagement',
component: () => import('@/views/backend/goodsDistribution/index.vue'),
meta: { title: '积分商城——商品分发' },
},
],
},
]
import { constantsRoute } from './route'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes,
routes: constantsRoute,
// scrollBehavior(to, from, savedPosition) {
// return new Promise((resolve) => {
// // console.log(to, from, savedPosition)
......
import layoutCulture from '@/layoutCulture/index.vue'
export const constantsRoute = [
{
path: '/',
name: 'Layout',
component: layoutCulture,
redirect: '/homePage/homeTab',
meta: {
title: '企业文化首页',
},
children: [
{
path: 'homePage',
name: 'CultureHomePage',
// component: () => import('@/layoutCulture/components/mainContainer.vue'),
component: () => import('@/views/homePage/index.vue'),
children: [
{
path: 'homeTab',
name: 'CultureHomeTab',
component: () => import('@/views/homePage/homeTab/index.vue'),
},
{
path: 'yaTab',
name: 'CultureYaTab',
component: () => import('@/views/homePage/yaTab/index.vue'),
},
{
path: 'askTab',
name: 'CultureAskTab',
component: () => import('@/views/homePage/askTab/index.vue'),
},
],
},
// 个人中心
{
path: 'userPage',
name: 'CultureUserPage',
redirect: '/userPage/selfPublish',
component: () => import('@/views/userPage/index.vue'),
children: [
// 我的帖子
{
path: 'selfPublish',
name: 'CultureSelfPublish',
component: () => import('@/views/userPage/components/selfPublish.vue'),
},
// 我的草稿
{
path: 'selfDraft',
name: 'CultureSelfDraft',
component: () => import('@/views/userPage/components/selfDraft.vue'),
},
// 我的收藏
{
path: 'selfCollect',
name: 'CultureSelfCollect',
component: () => import('@/views/userPage/components/selfCollect.vue'),
},
// 我的点赞
{
path: 'selfPraise',
name: 'CultureSelfPraise',
component: () => import('@/views/userPage/components/selfPraise.vue'),
},
// 我的案例库
{
path: 'selfCase',
name: 'CultureSelfCase',
component: () => import('@/views/userPage/components/selfCase.vue'),
},
// 我的任务
{
path: 'selfTask',
name: 'CultureSelfTask',
component: () => import('@/views/userPage/components/selfTask.vue'),
},
// 评论回复
{
path: 'selfComment',
name: 'CultureSelfComment',
component: () => import('@/views/userPage/components/selfComment.vue'),
},
// 回答问题
{
path: 'selfAnswer',
name: 'CultureSelfAnswer',
component: () => import('@/views/userPage/components/selfAnswer.vue'),
},
// 审核帖子列表
{
path: 'selfAudit',
name: 'CultureSelfAudit',
component: () => import('@/views/userPage/components/selfAudit.vue'),
},
// 审核举报列表
{
path: 'selfComplaint',
name: 'CultureSelfComplaint',
component: () => import('@/views/userPage/components/selfComplaint.vue'),
},
],
},
{
path: 'videoDetail/:id',
name: 'CultureVideoDetail',
component: () => import('@/views/videoDetail/index.vue'),
},
{
path: 'articleDetail/:id',
name: 'CultureArticleDetail',
component: () => import('@/views/articleDetail/index.vue'),
},
{
path: 'pointsStore',
name: 'CulturePointsStore',
component: () => import('@/views/pointsStore/index.vue'),
},
// 发布视频
{
path: 'publishVideo',
name: 'CulturePublishVideo',
component: () => import('@/views/publishVideo/index.vue'),
},
// 去投稿
{
path: 'publishCase',
name: 'CulturePublishCase',
component: () => import('@/views/publishCase/index.vue'),
},
// 搜索页面
{
path: 'searchPage',
name: 'CultureSearchPage',
component: () => import('@/views/searchPage/index.vue'),
},
// 审核
{
path: 'auditArticle/:id',
name: 'CultureAuditArticle',
component: () => import('@/views/auditArticle/index.vue'),
},
// 发布文章
// {
// {
// path: 'deshboard',
// name: 'CultureHome',
// component: () => import('@/views/home/index.vue')
// },
// {
// path: 'ya',
// name: 'CultureYa',
// component: () => import('@/views/ya/index.vue')
// },
// {
// path: 'ask',
// name: 'CultureAsk',
// component: () => import('@/views/ask/index.vue')
// }
],
},
{
path: '/test',
name: 'Test',
component: () => import('@/test.vue'),
},
{
path: '/backend',
name: 'Backend',
component: () => import('@/views/backend/index.vue'),
redirect: '/backend/manager',
children: [
{
path: 'manager',
name: 'ManagerManagement',
component: () => import('@/views/backend/manager/index.vue'),
meta: { title: '企业文化管理员' },
},
{
path: 'tags',
name: 'OfficialManagement',
component: () => import('@/views/backend/tags/index.vue'),
meta: { title: '官方标签' },
},
{
path: 'carousel',
name: 'CarouselManagement',
component: () => import('@/views/backend/carousel/index.vue'),
meta: { title: '轮播图设置' },
},
// {
// path: 'topic-admin',
// name: 'TopicAdminManagement',
// component: () => import('@/views/backend/topic-admin/index.vue'),
// meta: { title: '专栏——管理员' },
// },
{
path: 'columnSettings',
name: 'ColumnSettingsManagement',
component: () => import('@/views/backend/columnSettings/index.vue'),
meta: { title: '专栏——栏目管理' },
},
// {
// path: 'interview-admin',
// name: 'InterviewAdminManagement',
// component: () => import('@/views/backend/interview-admin/index.vue'),
// meta: { title: '专访——管理员' },
// },
{
path: 'interviewSettings',
name: 'InterviewSettingsManagement',
component: () => import('@/views/backend/interviewSettings/index.vue'),
meta: { title: '专访——栏目管理' },
},
{
path: 'videoSettings',
name: 'VideoSettingsManagement',
component: () => import('@/views/backend/videoSettings/index.vue'),
meta: { title: '视频——栏目管理' },
},
{
path: 'videoManage',
name: 'VideoManageManagement',
component: () => import('@/views/backend/videoManage/index.vue'),
meta: { title: '视频管理' },
},
{
path: 'caseManage',
name: 'CaseManageManagement',
component: () => import('@/views/backend/caseManage/index.vue'),
meta: { title: 'YAYA案例库管理' },
},
{
path: 'goodsManage',
name: 'GoodsManageManagement',
component: () => import('@/views/backend/goodsManage/index.vue'),
meta: { title: '积分商城——商品配置' },
},
{
path: 'goodsDistribution',
name: 'GoodsDistributionManagement',
component: () => import('@/views/backend/goodsDistribution/index.vue'),
meta: { title: '积分商城——商品分发' },
},
],
},
]
......@@ -46,7 +46,7 @@
</div>
<div class="flex items-center gap-1 hover:text-yellow-500 transition-colors">
<el-icon class="text-sm"><Star /></el-icon>
<span class="font-medium">{{ item.praiseCount }}</span>
<span class="font-medium">{{ item.collectionCount }}</span>
</div>
<!-- 分隔符 -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment