Browse Source

no message

Ryuiso 8 tháng trước cách đây
mục cha
commit
392916346e
1 tập tin đã thay đổi với 255 bổ sung270 xóa
  1. 255 270
      web/src/views/Doc/index.vue

+ 255 - 270
web/src/views/Doc/index.vue

@@ -1,6 +1,5 @@
-
-<script lang="ts">
-import { defineComponent, ref } from 'vue'
+<script setup lang="ts">
+import { ref } from 'vue'
 
 // 接口定义
 interface MenuItem {
@@ -38,287 +37,273 @@ interface DocContent {
   }
 }
 
-export default defineComponent({
-  name: 'Doc',
-  setup() {
-    // 左侧导航菜单配置
-    const menuItems = ref<MenuItem[]>([
+// 左侧导航菜单配置
+const menuItems = ref<MenuItem[]>([
+  {
+    key: 'version-release',
+    title: '版本发布记录',
+    type: 'link'
+  },
+  {
+    key: 'doc-guide',
+    title: '文档阅读指引',
+    type: 'link'
+  },
+  {
+    key: 'basic-intro',
+    title: '基本介绍',
+    type: 'group',
+    children: [
       {
-        key: 'version-release',
-        title: '版本发布记录',
+        key: 'product-intro',
+        title: '产品介绍',
         type: 'link'
       },
       {
-        key: 'doc-guide',
-        title: '文档阅读指引',
+        key: 'product-architecture',
+        title: '产品架构',
         type: 'link'
       },
       {
-        key: 'basic-intro',
-        title: '基本介绍',
-        type: 'group',
-        children: [
-          {
-            key: 'product-intro',
-            title: '产品介绍',
-            type: 'link'
-          },
-          {
-            key: 'product-architecture',
-            title: '产品架构',
-            type: 'link'
-          },
-          {
-            key: 'product-support',
-            title: '产品支持',
-            type: 'link'
-          },
-          {
-            key: 'basic-concept',
-            title: '基本概念',
-            type: 'link'
-          }
-        ]
-      }
-    ]);
-
-    // 折叠菜单状态
-    const expandedMenus = ref<{ [key: string]: boolean }>({
-      'basic-intro': false,
-    });
-
-    // 当前选中的导航项
-    const currentNav = ref<string>('version-release');
-
-    // 文档内容数据
-    const docContents = ref<{ [key: string]: DocContent }>({
-      'version-release': {
-        title: '版本发布记录',
-        updateDate: '2025-02-27',
-        rating: 4,
-        ratingCount: 183,
-        gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/00.index.md',
-        content: {
-          title: '上云 API v1.13.0 发布记录',
-          date: '2025.02.27',
-          sections: [
-            {
-              title: '主要更新',
-              text: '此版本包含多项功能增强和bug修复,提升了整体稳定性和用户体验。'
-            },
-            {
-              title: '功能图示',
-              image: {
-                src: '/src/assets/img/api-diagram.svg',
-                alt: 'API功能架构图',
-                width: '100%'
-              }
-            },
-            {
-              title: '版本对比',
-              table: {
-                headers: ['功能', 'v1.12.0', 'v1.13.0'],
-                rows: [
-                  ['实时数据传输', '支持', '支持'],
-                  ['离线数据同步', '不支持', '支持'],
-                  ['多设备管理', '有限支持', '完全支持'],
-                  ['安全认证', '基础版', '增强版']
-                ]
-              }
-            }
-          ]
-        }
+        key: 'product-support',
+        title: '产品支持',
+        type: 'link'
       },
-      'doc-guide': {
-        title: '文档阅读指引',
-        updateDate: '2025-02-26',
-        rating: 5,
-        ratingCount: 156,
-        gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/01.guide.md',
-        content: {
-          title: '文档阅读指引',
-          date: '2025.02.26',
-          sections: [
-            {
-              title: '如何使用本文档',
-              text: '本文档提供了详细的API使用说明和示例代码,帮助开发者快速集成和使用云平台功能。'
-            },
-            {
-              title: '文档结构',
-              image: {
-                src: '/src/assets/img/doc-structure.svg',
-                alt: '文档结构示意图',
-                width: '80%'
-              }
-            }
-          ]
+      {
+        key: 'basic-concept',
+        title: '基本概念',
+        type: 'link'
+      }
+    ]
+  }
+]);
+
+// 折叠菜单状态
+const expandedMenus = ref<{ [key: string]: boolean }>({
+  'basic-intro': false,
+});
+
+// 当前选中的导航项
+const currentNav = ref<string>('version-release');
+
+// 文档内容数据
+const docContents = ref<{ [key: string]: DocContent }>({
+  'version-release': {
+    title: '版本发布记录',
+    updateDate: '2025-02-27',
+    rating: 4,
+    ratingCount: 183,
+    gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/00.index.md',
+    content: {
+      title: '上云 API v1.13.0 发布记录',
+      date: '2025.02.27',
+      sections: [
+        {
+          title: '主要更新',
+          text: '此版本包含多项功能增强和bug修复,提升了整体稳定性和用户体验。'
+        },
+        {
+          title: '功能图示',
+          image: {
+            src: '/src/assets/img/api-diagram.svg',
+            alt: 'API功能架构图',
+            width: '100%'
+          }
+        },
+        {
+          title: '版本对比',
+          table: {
+            headers: ['功能', 'v1.12.0', 'v1.13.0'],
+            rows: [
+              ['实时数据传输', '支持', '支持'],
+              ['离线数据同步', '不支持', '支持'],
+              ['多设备管理', '有限支持', '完全支持'],
+              ['安全认证', '基础版', '增强版']
+            ]
+          }
         }
-      },
-      'product-intro': {
-        title: '产品介绍',
-        updateDate: '2025-02-25',
-        rating: 4.5,
-        ratingCount: 210,
-        gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/02.product-intro.md',
-        content: {
-          title: '云平台产品介绍',
-          date: '2025.02.25',
-          sections: [
-            {
-              title: '产品概述',
-              text: '云平台是一个全面的解决方案,提供设备管理、数据分析和远程控制等功能,帮助企业实现数字化转型。'
-            },
-            {
-              title: '核心优势',
-              table: {
-                headers: ['优势', '描述'],
-                rows: [
-                  ['高可靠性', '99.99%的服务可用性,确保业务连续性'],
-                  ['可扩展性', '支持百万级设备接入,满足企业规模化需求'],
-                  ['数据安全', '多层次安全防护,保障数据传输和存储安全'],
-                  ['开放生态', '丰富的API接口,支持与第三方系统集成']
-                ]
-              }
-            },
-            {
-              title: '产品架构',
-              image: {
-                src: '/src/assets/img/product-architecture.svg',
-                alt: '产品架构图',
-                width: '100%'
-              }
-            },
-          ]
+      ]
+    }
+  },
+  'doc-guide': {
+    title: '文档阅读指引',
+    updateDate: '2025-02-26',
+    rating: 5,
+    ratingCount: 156,
+    gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/01.guide.md',
+    content: {
+      title: '文档阅读指引',
+      date: '2025.02.26',
+      sections: [
+        {
+          title: '如何使用本文档',
+          text: '本文档提供了详细的API使用说明和示例代码,帮助开发者快速集成和使用云平台功能。'
+        },
+        {
+          title: '文档结构',
+          image: {
+            src: '/src/assets/img/doc-structure.svg',
+            alt: '文档结构示意图',
+            width: '80%'
+          }
         }
-      },
-      'product-architecture': {
-        title: '产品架构',
-        updateDate: '2025-02-24',
-        rating: 4.8,
-        ratingCount: 175,
-        gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/03.product-architecture.md',
-        content: {
-          title: '云平台架构设计',
-          date: '2025.02.24',
-          sections: [
-            {
-              title: '系统架构',
-              text: '云平台采用微服务架构设计,包含设备接入、数据处理、业务逻辑和应用服务等多个层次。'
-            },
-            {
-              title: '架构图',
-              image: {
-                src: '/src/assets/img/system-architecture.svg',
-                alt: '系统架构图',
-                width: '100%'
-              }
-            },
-            {
-              title: '技术栈',
-              table: {
-                headers: ['层级', '技术组件'],
-                rows: [
-                  ['接入层', 'MQTT, WebSocket, HTTP'],
-                  ['处理层', 'Kafka, Flink, Spark'],
-                  ['存储层', 'TimescaleDB, Redis, MinIO'],
-                  ['应用层', 'Spring Cloud, Node.js, React']
-                ]
-              }
-            }
-          ]
+      ]
+    }
+  },
+  'product-intro': {
+    title: '产品介绍',
+    updateDate: '2025-02-25',
+    rating: 4.5,
+    ratingCount: 210,
+    gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/02.product-intro.md',
+    content: {
+      title: '云平台产品介绍',
+      date: '2025.02.25',
+      sections: [
+        {
+          title: '产品概述',
+          text: '云平台是一个全面的解决方案,提供设备管理、数据分析和远程控制等功能,帮助企业实现数字化转型。'
+        },
+        {
+          title: '核心优势',
+          table: {
+            headers: ['优势', '描述'],
+            rows: [
+              ['高可靠性', '99.99%的服务可用性,确保业务连续性'],
+              ['可扩展性', '支持百万级设备接入,满足企业规模化需求'],
+              ['数据安全', '多层次安全防护,保障数据传输和存储安全'],
+              ['开放生态', '丰富的API接口,支持与第三方系统集成']
+            ]
+          }
+        },
+        {
+          title: '产品架构',
+          image: {
+            src: '/src/assets/img/product-architecture.svg',
+            alt: '产品架构图',
+            width: '100%'
+          }
+        },
+      ]
+    }
+  },
+  'product-architecture': {
+    title: '产品架构',
+    updateDate: '2025-02-24',
+    rating: 4.8,
+    ratingCount: 175,
+    gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/03.product-architecture.md',
+    content: {
+      title: '云平台架构设计',
+      date: '2025.02.24',
+      sections: [
+        {
+          title: '系统架构',
+          text: '云平台采用微服务架构设计,包含设备接入、数据处理、业务逻辑和应用服务等多个层次。'
+        },
+        {
+          title: '架构图',
+          image: {
+            src: '/src/assets/img/system-architecture.svg',
+            alt: '系统架构图',
+            width: '100%'
+          }
+        },
+        {
+          title: '技术栈',
+          table: {
+            headers: ['层级', '技术组件'],
+            rows: [
+              ['接入层', 'MQTT, WebSocket, HTTP'],
+              ['处理层', 'Kafka, Flink, Spark'],
+              ['存储层', 'TimescaleDB, Redis, MinIO'],
+              ['应用层', 'Spring Cloud, Node.js, React']
+            ]
+          }
         }
-      },
-      'product-support': {
-        title: '产品支持',
-        updateDate: '2025-02-23',
-        rating: 4.7,
-        ratingCount: 198,
-        gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/04.product-support.md',
-        content: {
-          title: '云平台技术支持与服务',
-          date: '2025.02.23',
-          sections: [
-            {
-              title: '技术支持',
-              text: '我们提供7x24小时的技术支持服务,确保客户在使用过程中遇到的问题能够及时解决。'
-            },
-            {
-              title: '服务协议',
-              table: {
-                headers: ['服务内容', '响应时间'],
-                rows: [
-                  ['技术咨询', '1小时内'],
-                  ['故障处理', '4小时内'],
-                  ['功能请求', '48小时内']
-                ]
-              }
-            },
-            {
-              title: '客户案例',
-              image: {
-                src: '/src/assets/img/customer-case.svg',
-                alt: '客户案例图',
-                width: '100%'
-              }
-            }
-          ]
+      ]
+    }
+  },
+  'product-support': {
+    title: '产品支持',
+    updateDate: '2025-02-23',
+    rating: 4.7,
+    ratingCount: 198,
+    gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/04.product-support.md',
+    content: {
+      title: '云平台技术支持与服务',
+      date: '2025.02.23',
+      sections: [
+        {
+          title: '技术支持',
+          text: '我们提供7x24小时的技术支持服务,确保客户在使用过程中遇到的问题能够及时解决。'
+        },
+        {
+          title: '服务协议',
+          table: {
+            headers: ['服务内容', '响应时间'],
+            rows: [
+              ['技术咨询', '1小时内'],
+              ['故障处理', '4小时内'],
+              ['功能请求', '48小时内']
+            ]
+          }
+        },
+        {
+          title: '客户案例',
+          image: {
+            src: '/src/assets/img/customer-case.svg',
+            alt: '客户案例图',
+            width: '100%'
+          }
         }
-      },
-      'basic-concept': {
-        title: '基础概念',
-        updateDate: '2025-02-22',
-        rating: 4.6,
-        ratingCount: 185,
-        gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/05.basic-concept.md',
-        content: {
-          title: '云平台基本概念介绍',
-          date: '2025.02.22',
-          sections: [
-            {
-              title: '云平台概念',
-              text: '云平台是一个集成了设备管理、数据分析和应用服务的综合性平台,旨在帮助企业实现数字化转型。'
-            },
-            {
-              title: '核心概念',
-              table: {
-                headers: ['概念', '描述'],
-                rows: [
-                  ['设备', '接入云平台的硬件设备'],
-                  ['数据', '设备产生的数据,包括传感器数据、日志等'],
-                  ['API', '云平台提供的接口,用于与外部系统交互']
-                ]
-              }
-            }
-          ]
+      ]
+    }
+  },
+  'basic-concept': {
+    title: '基础概念',
+    updateDate: '2025-02-22',
+    rating: 4.6,
+    ratingCount: 185,
+    gitUrl: 'https://github.com/dji-sdk/Cloud-API-Doc/blob/master/docs/cn/05.basic-concept.md',
+    content: {
+      title: '云平台基本概念介绍',
+      date: '2025.02.22',
+      sections: [
+        {
+          title: '云平台概念',
+          text: '云平台是一个集成了设备管理、数据分析和应用服务的综合性平台,旨在帮助企业实现数字化转型。'
+        },
+        {
+          title: '核心概念',
+          table: {
+            headers: ['概念', '描述'],
+            rows: [
+              ['设备', '接入云平台的硬件设备'],
+              ['数据', '设备产生的数据,包括传感器数据、日志等'],
+              ['API', '云平台提供的接口,用于与外部系统交互']
+            ]
+          }
         }
-      }
-    });
-
-    // 切换菜单展开/收起状态
-    const toggleMenu = (menuKey: string) => {
-      expandedMenus.value[menuKey] = !expandedMenus.value[menuKey];
-    };
-
-    // 切换导航
-    const switchNav = (navKey: string) => {
-      currentNav.value = navKey;
-    };
-
-    // 获取当前显示的内容
-    const getCurrentContent = () => {
-      return docContents.value[currentNav.value];
-    };
-
-    return {
-      menuItems,
-      expandedMenus,
-      toggleMenu,
-      currentNav,
-      switchNav,
-      getCurrentContent
-    };
+      ]
+    }
   }
-})
+});
+
+// 切换菜单展开/收起状态
+const toggleMenu = (menuKey: string) => {
+  expandedMenus.value[menuKey] = !expandedMenus.value[menuKey];
+};
+
+// 切换导航
+const switchNav = (navKey: string) => {
+  currentNav.value = navKey;
+};
+
+// 获取当前显示的内容
+const getCurrentContent = () => {
+  return docContents.value[currentNav.value];
+};
 </script>
 
 <template>