|
@@ -1,823 +1,49 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { ref } from 'vue'
|
|
|
|
|
-
|
|
|
|
|
-// 接口定义
|
|
|
|
|
-interface MenuItem {
|
|
|
|
|
- key: string;
|
|
|
|
|
- title: string;
|
|
|
|
|
- type: 'link' | 'group';
|
|
|
|
|
- children?: MenuItem[];
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-interface DocSection {
|
|
|
|
|
- title: string;
|
|
|
|
|
- text?: string;
|
|
|
|
|
- image?: {
|
|
|
|
|
- src: string;
|
|
|
|
|
- alt: string;
|
|
|
|
|
- width?: string;
|
|
|
|
|
- height?: string;
|
|
|
|
|
- };
|
|
|
|
|
- table?: {
|
|
|
|
|
- headers: string[];
|
|
|
|
|
- rows: string[][];
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-interface DocContent {
|
|
|
|
|
- title: string;
|
|
|
|
|
- updateDate: string;
|
|
|
|
|
- rating: number;
|
|
|
|
|
- ratingCount: number;
|
|
|
|
|
- gitUrl: string;
|
|
|
|
|
- content: {
|
|
|
|
|
- title: string;
|
|
|
|
|
- date: string;
|
|
|
|
|
- sections?: DocSection[];
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 左侧导航菜单配置
|
|
|
|
|
-const menuItems = ref<MenuItem[]>([
|
|
|
|
|
- {
|
|
|
|
|
- key: 'version-release',
|
|
|
|
|
- title: '版本发布记录',
|
|
|
|
|
- type: 'link'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- key: 'doc-guide',
|
|
|
|
|
- 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: [
|
|
|
|
|
- ['实时数据传输', '支持', '支持'],
|
|
|
|
|
- ['离线数据同步', '不支持', '支持'],
|
|
|
|
|
- ['多设备管理', '有限支持', '完全支持'],
|
|
|
|
|
- ['安全认证', '基础版', '增强版']
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- '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-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%'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- '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];
|
|
|
|
|
-};
|
|
|
|
|
|
|
+const docUrl = 'https://onemyriad.apifox.cn'
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="doc-container">
|
|
|
|
|
- <!-- 左侧边栏 -->
|
|
|
|
|
- <aside class="sidebar">
|
|
|
|
|
- <!-- 文档导航菜单 -->
|
|
|
|
|
- <ul class="sidebar-items">
|
|
|
|
|
- <li v-for="item in menuItems" :key="item.key">
|
|
|
|
|
- <!-- 链接类型菜单项 -->
|
|
|
|
|
- <a
|
|
|
|
|
- v-if="item.type === 'link'"
|
|
|
|
|
- @click.prevent="switchNav(item.key)"
|
|
|
|
|
- href="#"
|
|
|
|
|
- class="sidebar-item sidebar-heading"
|
|
|
|
|
- :class="{ active: currentNav === item.key }"
|
|
|
|
|
- >{{ item.title }}</a>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 分组类型菜单项 -->
|
|
|
|
|
- <template v-else-if="item.type === 'group'">
|
|
|
|
|
- <p @click="toggleMenu(item.key)" class="sidebar-item sidebar-heading collapsible">
|
|
|
|
|
- {{ item.title }}
|
|
|
|
|
- <span :class="['arrow', expandedMenus[item.key] ? 'down' : 'right']"></span>
|
|
|
|
|
- </p>
|
|
|
|
|
- <ul class="sidebar-item-children" :style="{
|
|
|
|
|
- maxHeight: expandedMenus[item.key] ? '200px' : '0',
|
|
|
|
|
- opacity: expandedMenus[item.key] ? '1' : '0'
|
|
|
|
|
- }">
|
|
|
|
|
- <li v-for="child in item.children" :key="child.key">
|
|
|
|
|
- <a
|
|
|
|
|
- @click.prevent="switchNav(child.key)"
|
|
|
|
|
- href="#"
|
|
|
|
|
- class="sidebar-item"
|
|
|
|
|
- :class="{ active: currentNav === child.key }"
|
|
|
|
|
- >{{ child.title }}</a>
|
|
|
|
|
- </li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </template>
|
|
|
|
|
- </li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </aside>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 右侧内容区 -->
|
|
|
|
|
- <main class="page">
|
|
|
|
|
- <div id="page-content" class="page-content">
|
|
|
|
|
- <div class="page-top">
|
|
|
|
|
- <h1>{{ getCurrentContent().title }}</h1>
|
|
|
|
|
- <div class="page-header-meta">
|
|
|
|
|
- <!-- 更新日期 -->
|
|
|
|
|
- <span class="update-date">
|
|
|
|
|
- <i class="el-icon">
|
|
|
|
|
- <img src="@/assets/icons/calendar.svg" alt="Calendar" />
|
|
|
|
|
- </i>
|
|
|
|
|
- {{ getCurrentContent().updateDate }}
|
|
|
|
|
- </span>
|
|
|
|
|
- <!-- 评分 -->
|
|
|
|
|
- <span class="rate-area">
|
|
|
|
|
- <div class="el-rate is-disabled" role="slider" :aria-label="'rating'" :aria-valuenow="getCurrentContent().rating" :aria-valuetext="getCurrentContent().rating + ' 分'" aria-valuemin="0" aria-valuemax="5" tabindex="0">
|
|
|
|
|
- <span class="el-rate__item" v-for="i in 5" :key="i">
|
|
|
|
|
- <i class="el-icon el-rate__icon" :class="{ 'is-active': i <= getCurrentContent().rating }">
|
|
|
|
|
- <img src="@/assets/icons/star.svg" alt="Star" />
|
|
|
|
|
- </i>
|
|
|
|
|
- </span>
|
|
|
|
|
- <span class="el-rate__text">{{ getCurrentContent().rating }} 分</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <span class="rate-count">{{ getCurrentContent().ratingCount }} 用户已评分</span>
|
|
|
|
|
- </span>
|
|
|
|
|
- <!-- github edit -->
|
|
|
|
|
- <div class="meta-item edit-link">
|
|
|
|
|
- <a class="external-link meta-item-label" :href="getCurrentContent().gitUrl" rel="noopener noreferrer" target="_blank" aria-label="Github Edit">
|
|
|
|
|
- Github Edit
|
|
|
|
|
- <span>
|
|
|
|
|
- <img class="external-link-icon" src="@/assets/icons/external-link.svg" alt="External Link" />
|
|
|
|
|
- <span class="external-link-icon-sr-only">open in new window</span>
|
|
|
|
|
- </span>
|
|
|
|
|
- </a>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <!-- 目录 -->
|
|
|
|
|
- <div class="theme-default-content">
|
|
|
|
|
- <!-- 这里是文档内容 -->
|
|
|
|
|
- <div>
|
|
|
|
|
- <h2 :id="getCurrentContent().content.title" tabindex="-1">
|
|
|
|
|
- <a class="header-anchor" :href="'#' + getCurrentContent().content.title" aria-hidden="true">#</a>
|
|
|
|
|
- {{ getCurrentContent().content.title }}
|
|
|
|
|
- </h2>
|
|
|
|
|
- <h3 id="发布日期" tabindex="-1">
|
|
|
|
|
- <a class="header-anchor" href="#发布日期" aria-hidden="true">#</a>
|
|
|
|
|
- 发布日期
|
|
|
|
|
- </h3>
|
|
|
|
|
- <p>{{ getCurrentContent().content.date }}</p>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 动态内容部分 -->
|
|
|
|
|
- <div v-if="getCurrentContent().content.sections">
|
|
|
|
|
- <div v-for="(section, index) in getCurrentContent().content.sections" :key="index" class="content-section">
|
|
|
|
|
- <!-- 小节标题 -->
|
|
|
|
|
- <h3 :id="section.title" tabindex="-1">
|
|
|
|
|
- <a class="header-anchor" :href="'#' + section.title" aria-hidden="true">#</a>
|
|
|
|
|
- {{ section.title }}
|
|
|
|
|
- </h3>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 文本内容 -->
|
|
|
|
|
- <p v-if="section.text">{{ section.text }}</p>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 图片内容 -->
|
|
|
|
|
- <div v-if="section.image" class="image-container">
|
|
|
|
|
- <img
|
|
|
|
|
- :src="section.image.src"
|
|
|
|
|
- :alt="section.image.alt"
|
|
|
|
|
- :width="section.image.width || 'auto'"
|
|
|
|
|
- :height="section.image.height || 'auto'"
|
|
|
|
|
- />
|
|
|
|
|
- <div class="image-caption">{{ section.image.alt }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 表格内容 -->
|
|
|
|
|
- <div v-if="section.table" class="table-container">
|
|
|
|
|
- <table>
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th v-for="(header, hIndex) in section.table.headers" :key="hIndex">{{ header }}</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
- <tr v-for="(row, rIndex) in section.table.rows" :key="rIndex">
|
|
|
|
|
- <td v-for="(cell, cIndex) in row" :key="cIndex">{{ cell }}</td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="doc-page">
|
|
|
|
|
+ <!-- iframe嵌入外部文档 -->
|
|
|
|
|
+ <main class="doc-main">
|
|
|
|
|
+ <iframe
|
|
|
|
|
+ :src="docUrl"
|
|
|
|
|
+ class="doc-iframe"
|
|
|
|
|
+ frameborder="0"
|
|
|
|
|
+ allowfullscreen
|
|
|
|
|
+ ></iframe>
|
|
|
</main>
|
|
</main>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 保留Footer -->
|
|
|
|
|
+ <footer class="doc-footer">
|
|
|
|
|
+ <p>© 2025 OneMyriad, Ltd.</p>
|
|
|
|
|
+ </footer>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
-// 变量定义
|
|
|
|
|
-$primary-color: #3eaf7c;
|
|
|
|
|
-$text-color: #2c3e50;
|
|
|
|
|
-$border-color: #eaecef;
|
|
|
|
|
-$bg-color: #fff;
|
|
|
|
|
-$meta-color: #6a8bad;
|
|
|
|
|
-$rate-color: #F7BA2A;
|
|
|
|
|
-$disabled-color: #C6D1DE;
|
|
|
|
|
-$hover-bg: #f3f5f7;
|
|
|
|
|
-$even-row-bg: #f9f9f9;
|
|
|
|
|
-
|
|
|
|
|
-// Mixins
|
|
|
|
|
-@mixin flex-center {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-@mixin transition($property: all) {
|
|
|
|
|
- transition: $property 0.3s ease;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-@mixin icon-size($size: 1rem) {
|
|
|
|
|
- width: $size;
|
|
|
|
|
- height: $size;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 容器样式
|
|
|
|
|
-.doc-container {
|
|
|
|
|
|
|
+<style scoped>
|
|
|
|
|
+.doc-page {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- min-height: calc(100vh - 64px); // 减去顶部导航栏的高度
|
|
|
|
|
- position: relative;
|
|
|
|
|
- margin-top: 60px; // 为顶部导航栏留出空间
|
|
|
|
|
- max-width: 100%; // 确保容器可以占满整个屏幕宽度
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 侧边栏样式
|
|
|
|
|
-.sidebar {
|
|
|
|
|
- width: 280px; // 稍微调整侧边栏宽度
|
|
|
|
|
- flex: 0 0 280px; // 固定宽度,不伸缩
|
|
|
|
|
- border-right: 1px solid $border-color;
|
|
|
|
|
- background-color: $bg-color;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
- padding: 1.5rem 0;
|
|
|
|
|
- position: fixed;
|
|
|
|
|
- top: 60px; // 预留顶部导航栏的高度
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- left: 0; // 恢复到左边界
|
|
|
|
|
- z-index: 10;
|
|
|
|
|
-
|
|
|
|
|
- &-items {
|
|
|
|
|
- list-style: none;
|
|
|
|
|
- padding: 1.5rem 0;
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-item {
|
|
|
|
|
- display: block;
|
|
|
|
|
- padding: 0.35rem 1.5rem;
|
|
|
|
|
- color: $text-color;
|
|
|
|
|
- text-decoration: none;
|
|
|
|
|
- font-size: 0.9rem;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- @include transition;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
-
|
|
|
|
|
- &:hover {
|
|
|
|
|
- color: $primary-color;
|
|
|
|
|
- background-color: rgba($primary-color, 0.05);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &.active {
|
|
|
|
|
- color: $primary-color;
|
|
|
|
|
- background-color: rgba($primary-color, 0.1);
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 点击涟漪效果
|
|
|
|
|
- &::after {
|
|
|
|
|
- content: '';
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 50%;
|
|
|
|
|
- left: 50%;
|
|
|
|
|
- @include icon-size(5px);
|
|
|
|
|
- background: rgba($primary-color, 0.3);
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- border-radius: 100%;
|
|
|
|
|
- transform: scale(1, 1) translate(-50%);
|
|
|
|
|
- transform-origin: 50% 50%;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &:active::after {
|
|
|
|
|
- animation: ripple 0.6s ease-out;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-heading {
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- border-left: 0.25rem solid transparent;
|
|
|
|
|
- margin-left: -0.25rem;
|
|
|
|
|
- @include transition(border-left-color);
|
|
|
|
|
- margin-bottom: 0;
|
|
|
|
|
-
|
|
|
|
|
- &.active {
|
|
|
|
|
- color: $primary-color;
|
|
|
|
|
- border-left-color: $primary-color;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-item-children {
|
|
|
|
|
- list-style: none;
|
|
|
|
|
- padding-left: 0;
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- @include transition(max-height);
|
|
|
|
|
-
|
|
|
|
|
- .sidebar-item {
|
|
|
|
|
- padding: 0.35rem 2.5rem;
|
|
|
|
|
- font-size: 0.9rem;
|
|
|
|
|
- position: relative;
|
|
|
|
|
-
|
|
|
|
|
- &::before {
|
|
|
|
|
- content: '';
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- left: 1rem;
|
|
|
|
|
- top: 50%;
|
|
|
|
|
- transform: translateY(-50%);
|
|
|
|
|
- @include icon-size(4px);
|
|
|
|
|
- background-color: $text-color;
|
|
|
|
|
- border-radius: 50%;
|
|
|
|
|
- opacity: 0.4;
|
|
|
|
|
- @include transition;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &:hover::before,
|
|
|
|
|
- &.active::before {
|
|
|
|
|
- background-color: $primary-color;
|
|
|
|
|
- opacity: 1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ min-height: 100vh;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 涟漪动画
|
|
|
|
|
-@keyframes ripple {
|
|
|
|
|
- 0% {
|
|
|
|
|
- transform: scale(0, 0);
|
|
|
|
|
- opacity: 0.5;
|
|
|
|
|
- }
|
|
|
|
|
- 20% {
|
|
|
|
|
- transform: scale(25, 25);
|
|
|
|
|
- opacity: 0.3;
|
|
|
|
|
- }
|
|
|
|
|
- 100% {
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- transform: scale(40, 40);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 折叠箭头
|
|
|
|
|
-.collapsible {
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- @include flex-center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.arrow {
|
|
|
|
|
- display: inline-block;
|
|
|
|
|
- width: 0;
|
|
|
|
|
- height: 0;
|
|
|
|
|
- border: 5px solid transparent;
|
|
|
|
|
-
|
|
|
|
|
- &.down {
|
|
|
|
|
- border-top-color: $text-color;
|
|
|
|
|
- margin-top: 3px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &.right {
|
|
|
|
|
- border-left-color: $text-color;
|
|
|
|
|
- margin-left: 3px;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 右侧内容区样式
|
|
|
|
|
-.page {
|
|
|
|
|
|
|
+.doc-main {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
- padding: 2rem 40px; // 左右padding与header保持一致
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
- margin-left: 280px; // 与侧边栏宽度一致,确保内容不被遮挡
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
-
|
|
|
|
|
- &-content {
|
|
|
|
|
- max-width: 100%; // 使用完整宽度
|
|
|
|
|
- margin: 0; // 移除额外的margin
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-top {
|
|
|
|
|
- padding-bottom: 1rem;
|
|
|
|
|
- border-bottom: 1px solid $border-color;
|
|
|
|
|
- margin-bottom: 2rem;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-header-meta {
|
|
|
|
|
- @include flex-center;
|
|
|
|
|
- font-size: 0.9rem;
|
|
|
|
|
- color: $meta-color;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 元信息样式
|
|
|
|
|
-.update-date {
|
|
|
|
|
- @include flex-center;
|
|
|
|
|
- margin-right: 1rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.el-icon {
|
|
|
|
|
- margin-right: 0.5rem;
|
|
|
|
|
- @include flex-center;
|
|
|
|
|
-
|
|
|
|
|
- img {
|
|
|
|
|
- @include icon-size;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.rate-area {
|
|
|
|
|
- @include flex-center;
|
|
|
|
|
- margin-right: 1rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.el-rate {
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- margin-right: 0.5rem;
|
|
|
|
|
- vertical-align: text-bottom;
|
|
|
|
|
-
|
|
|
|
|
- &__icon {
|
|
|
|
|
- font-size: 1rem;
|
|
|
|
|
- color: $disabled-color;
|
|
|
|
|
-
|
|
|
|
|
- &.is-active {
|
|
|
|
|
- color: $rate-color;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- img {
|
|
|
|
|
- @include icon-size;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &__item {
|
|
|
|
|
- margin-right: 6px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &__text {
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- vertical-align: middle;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.rate-count {
|
|
|
|
|
- font-size: 0.8rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 外部链接
|
|
|
|
|
-.meta-item.edit-link {
|
|
|
|
|
- font-size: 0.9rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.external-link {
|
|
|
|
|
- color: $primary-color;
|
|
|
|
|
- text-decoration: none;
|
|
|
|
|
-
|
|
|
|
|
- &:hover {
|
|
|
|
|
- text-decoration: underline;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &-icon {
|
|
|
|
|
- margin-left: 0.25rem;
|
|
|
|
|
- width: 15px;
|
|
|
|
|
- height: 15px;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 内容样式
|
|
|
|
|
-.theme-default-content {
|
|
|
|
|
- padding: 2rem 0;
|
|
|
|
|
- text-align: left; // 确保文本左对齐
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 标题样式
|
|
|
|
|
-h1, h2, h3 {
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- line-height: 1.25;
|
|
|
|
|
-
|
|
|
|
|
- &:hover .header-anchor {
|
|
|
|
|
- opacity: 1;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-h1 {
|
|
|
|
|
- font-size: 2.2rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-h2 {
|
|
|
|
|
- font-size: 1.65rem;
|
|
|
|
|
- padding-bottom: 0.3rem;
|
|
|
|
|
- border-bottom: 1px solid $border-color;
|
|
|
|
|
- margin-top: 2rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-h3 {
|
|
|
|
|
- font-size: 1.35rem;
|
|
|
|
|
- margin-top: 1.5rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.header-anchor {
|
|
|
|
|
- font-size: 0.85em;
|
|
|
|
|
- float: left;
|
|
|
|
|
- margin-left: -0.87em;
|
|
|
|
|
- padding-right: 0.23em;
|
|
|
|
|
- margin-top: 0.125em;
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- text-decoration: none;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-p {
|
|
|
|
|
- line-height: 1.7;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 内容区域样式
|
|
|
|
|
-.content-section {
|
|
|
|
|
- margin-bottom: 2rem;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.image-container {
|
|
|
|
|
- margin: 1.5rem 0;
|
|
|
|
|
- text-align: left; // 图片左对齐,与文本保持一致
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.image-caption {
|
|
|
|
|
- color: $meta-color;
|
|
|
|
|
- font-size: 0.9rem;
|
|
|
|
|
- margin-top: 0.5rem;
|
|
|
|
|
- text-align: left; // 图片说明左对齐
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 表格样式
|
|
|
|
|
-.table-container {
|
|
|
|
|
- margin: 1.5rem 0;
|
|
|
|
|
- overflow-x: auto;
|
|
|
|
|
|
|
+ padding: 0 1rem;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-table {
|
|
|
|
|
- border-collapse: collapse;
|
|
|
|
|
|
|
+.doc-iframe {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- margin: 1rem 0;
|
|
|
|
|
-
|
|
|
|
|
- th, td {
|
|
|
|
|
- border: 1px solid $border-color;
|
|
|
|
|
- padding: 0.6rem 1rem;
|
|
|
|
|
- text-align: left;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- th {
|
|
|
|
|
- background-color: $hover-bg;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- tr {
|
|
|
|
|
- &:nth-child(even) {
|
|
|
|
|
- background-color: $even-row-bg;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ min-height: calc(100vh - 120px); /* 减去header和footer高度 */
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- &:hover {
|
|
|
|
|
- background-color: $hover-bg;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.doc-footer {
|
|
|
|
|
+ padding: 1rem;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ background: #f5f5f5;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|