gemer zhang 6 mesiacov pred
rodič
commit
60e4f4d6da

+ 1 - 1
packages/backend/src/modules/web/web.service.ts

@@ -52,7 +52,7 @@ export class WebService {
     const lang = this.sharedService.handleValidLang(locale);
     const article = await this.articleRepo.findOne({
       where: { id },
-      relations: { user: true, translations: false, category: true },
+      relations: { user: true, translations: true, category: true },
       select: {
         user: {
           id: true,

+ 1 - 1
packages/web/src/components/header.vue

@@ -5,7 +5,7 @@
         <a href="/"> <img src="@/assets/img/logo_4dge_cn.png" alt="logo" /></a>
       </div>
       <div class="menu">
-        <n-dropdown :options="options" @select="handleSelect">
+        <n-dropdown :options="options" @select="handleSelect" >
           <n-button type="primary" ghost>{{ locale === 'zh' ? $t('zh') : $t('en') }}</n-button>
         </n-dropdown>
       </div>

+ 7 - 6
packages/web/src/pages/showdoc/[id].vue

@@ -3,7 +3,7 @@
     <div v-if="detail">
       <div class="breadcrumb my-[30px] pb-[20px] bb-1px_#EBEBEB" role="navigation">
         <n-breadcrumb separator=">" v-if="breadcrumb">
-          <!--          {{ breadcrumb }}-->
+        <!-- {{ breadcrumb }} -->
           <template v-for="(bread, index) in breadcrumb" :key="index">
             <n-breadcrumb-item :clickable="false"> {{ bread.title }}</n-breadcrumb-item>
           </template>
@@ -92,7 +92,7 @@ import {
   getCategoryTree,
   getArticlesByCateId,
 } from '@/api'
-import { htmlToTree, createAnchorNames, dayjs, findNodeById, findBreadcrumbPath } from '@/utils'
+import { htmlToTree, createAnchorNames, dayjs, findNodeById, findBreadcrumbPath, type TreeNode } from '@/utils'
 import { NH1, NH2, NH4, NBreadcrumb, NBreadcrumbItem, NTree, NAnchor, NAnchorLink } from 'naive-ui'
 import type { TreeOption } from 'naive-ui'
 
@@ -155,13 +155,14 @@ watchEffect(() => {
           if (res.data) {
             mainCategories.value = res.data as CategoryItem[]
             if (mainCategories.value) {
+              debugger
               currentCate.value = findNodeById(
-                [mainCategories.value],
-                detail.value.categoryId,
+                mainCategories.value as unknown as TreeNode[] ||[],
+                String(detail.value.categoryId),
               ) as unknown as CategoryItem
               defaultExpandedKeys.value = [currentCate.value.parentId]
-              breadcrumb.value = findBreadcrumbPath([mainCategories.value], detail.value.categoryId)
-              // console.log('breadcrumb', breadcrumb.value)
+              breadcrumb.value = findBreadcrumbPath(mainCategories.value as unknown as TreeNode[] ||[], String(detail.value.categoryId))
+              console.log('breadcrumb', breadcrumb.value)
             }
           }
         }

+ 6 - 1
packages/web/src/utils/themeOverides.ts

@@ -2,9 +2,14 @@ import { type GlobalThemeOverrides } from 'naive-ui'
 
 export const themeOverrides: GlobalThemeOverrides = {
   common: {
-    primaryColor: '#0661C9',
+    primaryColor: "#0661C9",
+    primaryColorHover: "#0661C9",
+    primaryColorPressed: "#0661C9",
+    primaryColorSuppl: "#0661C9",
   },
+
   Button: {
+    colorHover:"#0661C9"
     // textColor: '#FF0000',
   },
   Tree: {