feat: add comprehensive backend topics and fix build issues
## 新增内容 ### 附录文档扩展 - 扩展前端项目架构文档 (frontend-project-architecture.md) - 扩展后端项目架构文档 (backend-project-architecture.md) - 扩展数据治理文档 (data-governance.md) - 扩展数据可视化文档 (data-visualization.md) - 扩展分布式系统文档 (distributed-systems.md) - 扩展高可用文档 (high-availability.md) - 扩展单体到微服务文档 (monolith-to-microservices.md) - 扩展系统设计方法论文档 (system-design-methodology.md) - 扩展 Docker 容器文档 (docker-containers.md) - 扩展 Kubernetes 文档 (kubernetes.md) - 扩展 Linux 基础文档 (linux-basics.md) - 扩展神经网络文档 (neural-networks.md) ### 新增交互式组件 - 数据治理组件: DataQualityDemo, DataGovernanceFrameworkDemo, DataLineageDemo - 数据可视化组件: ChartTypeSelectorDemo, DashboardLayoutDemo - 分布式系统组件: CAPTheoremDemo, ConsistencyModelsDemo, DistributedChallengesDemo - 高可用组件: AvailabilityCalculatorDemo, FailoverStrategyDemo - 系统设计组件: SystemDesignStepsDemo, CapacityEstimationDemo - Docker 容器组件: DockerArchitectureDemo, DockerLifecycleDemo - Kubernetes 组件: K8sArchitectureDemo, K8sWorkloadsDemo - Linux 基础组件: LinuxFileSystemDemo, LinuxCommandDemo, LinuxPermissionsDemo - 神经网络组件: NeuronDemo, NetworkLayersDemo, NetworkArchitectureDemo - 单体到微服务组件: ArchEvolutionDemo - 项目架构组件: ProjectArchitectureComparisonDemo - 附录导航组件: AppendixFlowMap ### 英文版重构 - 将 en-us 目录重命名为 en - 更新相关配置和组件中的语言代码 ## Bug 修复 - 修复 index.js 中重复的组件导入语句导致的 build 失败 - 恢复被注释的 InvertedIndexDemo 和 SearchRelevanceDemo 导入 - 修复 HomeFeatures.vue 中 en-us 与 config.mjs 中 en 不一致导致的语言切换问题 ## 其他改进 - 添加构建脚本 (scripts/build.mjs) - 更新依赖版本
This commit is contained in:
+131
@@ -0,0 +1,131 @@
|
||||
<!--
|
||||
ChartTypeSelectorDemo.vue
|
||||
图表类型选择器:根据数据特征推荐合适的图表类型
|
||||
-->
|
||||
<template>
|
||||
<div class="chart-selector-demo">
|
||||
<div class="header">
|
||||
<div class="title">图表类型选择器</div>
|
||||
<div class="subtitle">选择你的数据目的,查看推荐的图表类型</div>
|
||||
</div>
|
||||
|
||||
<div class="purposes">
|
||||
<div
|
||||
v-for="p in purposes"
|
||||
:key="p.key"
|
||||
:class="['purpose-card', { active: activePurpose === p.key }]"
|
||||
@click="activePurpose = p.key"
|
||||
>
|
||||
<div class="purpose-icon">{{ p.icon }}</div>
|
||||
<div class="purpose-name">{{ p.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="currentPurpose" class="charts-panel">
|
||||
<div class="panel-title">{{ currentPurpose.name }}:推荐图表</div>
|
||||
<div class="chart-list">
|
||||
<div
|
||||
v-for="chart in currentPurpose.charts"
|
||||
:key="chart.name"
|
||||
class="chart-item"
|
||||
>
|
||||
<div class="chart-visual">{{ chart.visual }}</div>
|
||||
<div class="chart-info">
|
||||
<div class="chart-name">{{ chart.name }}</div>
|
||||
<div class="chart-desc">{{ chart.desc }}</div>
|
||||
<div class="chart-example">示例:{{ chart.example }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
|
||||
const activePurpose = ref('comparison')
|
||||
|
||||
const purposes = [
|
||||
{
|
||||
key: 'comparison',
|
||||
name: '比较',
|
||||
icon: '📊',
|
||||
charts: [
|
||||
{ name: '柱状图', visual: '▐▐▐', desc: '比较不同类别的数值大小', example: '各部门销售额对比' },
|
||||
{ name: '分组柱状图', visual: '▐▐ ▐▐', desc: '多维度分组比较', example: '各季度各产品线收入' },
|
||||
{ name: '雷达图', visual: '◇', desc: '多维度综合对比', example: '候选人能力评估' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'trend',
|
||||
name: '趋势',
|
||||
icon: '📈',
|
||||
charts: [
|
||||
{ name: '折线图', visual: '╱╲╱', desc: '展示数据随时间的变化趋势', example: '月度用户增长曲线' },
|
||||
{ name: '面积图', visual: '▓▓▓', desc: '强调趋势下的累积量', example: '各渠道流量占比变化' },
|
||||
{ name: '阶梯图', visual: '┐└┐', desc: '展示离散时间点的变化', example: '价格调整历史' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'proportion',
|
||||
name: '占比',
|
||||
icon: '🍩',
|
||||
charts: [
|
||||
{ name: '饼图', visual: '◔', desc: '展示各部分占整体的比例', example: '市场份额分布' },
|
||||
{ name: '环形图', visual: '◎', desc: '饼图的变体,中间可放数字', example: '预算使用率' },
|
||||
{ name: '堆叠柱状图', visual: '▐▐▐', desc: '展示各部分的组成和总量', example: '各地区各品类销售构成' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'distribution',
|
||||
name: '分布',
|
||||
icon: '🔔',
|
||||
charts: [
|
||||
{ name: '直方图', visual: '▁▃▇▃▁', desc: '展示数据的频率分布', example: '用户年龄分布' },
|
||||
{ name: '散点图', visual: '· ·· ·', desc: '展示两个变量的关系', example: '广告投入 vs 销售额' },
|
||||
{ name: '箱线图', visual: '├─┤', desc: '展示数据的中位数、四分位数和异常值', example: '各城市房价分布' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'relation',
|
||||
name: '关系',
|
||||
icon: '🕸️',
|
||||
charts: [
|
||||
{ name: '桑基图', visual: '≋≋≋', desc: '展示流量或能量的流向', example: '用户转化漏斗' },
|
||||
{ name: '网络图', visual: '⊙─⊙', desc: '展示节点之间的关联关系', example: '社交关系网络' },
|
||||
{ name: '热力图', visual: '▓▒░', desc: '用颜色深浅表示数值大小', example: '各时段各页面访问量' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
const currentPurpose = computed(() => purposes.find(p => p.key === activePurpose.value))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-selector-demo {
|
||||
border: 1px solid var(--vp-c-divider); background: var(--vp-c-bg-soft);
|
||||
border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0;
|
||||
}
|
||||
.header { margin-bottom: 1rem; }
|
||||
.title { font-weight: 700; font-size: 1.1rem; }
|
||||
.subtitle { color: var(--vp-c-text-2); font-size: 0.9rem; }
|
||||
.purposes { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
|
||||
.purpose-card {
|
||||
display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
|
||||
padding: 0.6rem; border-radius: 8px; cursor: pointer;
|
||||
background: var(--vp-c-bg); border: 1px solid var(--vp-c-divider); transition: all 0.2s;
|
||||
}
|
||||
.purpose-card:hover { border-color: var(--vp-c-brand); }
|
||||
.purpose-card.active { border-color: var(--vp-c-brand); background: rgba(var(--vp-c-brand-rgb), 0.05); }
|
||||
.purpose-icon { font-size: 1.3rem; }
|
||||
.purpose-name { font-size: 0.8rem; font-weight: 600; }
|
||||
.panel-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.75rem; }
|
||||
.charts-panel { background: var(--vp-c-bg); border-radius: 8px; padding: 1rem; border: 1px solid var(--vp-c-divider); }
|
||||
.chart-list { display: flex; flex-direction: column; gap: 0.5rem; }
|
||||
.chart-item { display: flex; gap: 0.75rem; padding: 0.5rem; border-radius: 6px; background: var(--vp-c-bg-soft); }
|
||||
.chart-visual { font-size: 1.2rem; min-width: 50px; display: flex; align-items: center; justify-content: center; font-family: var(--vp-font-family-mono); color: var(--vp-c-brand); }
|
||||
.chart-name { font-weight: 600; font-size: 0.85rem; }
|
||||
.chart-desc { font-size: 0.78rem; color: var(--vp-c-text-2); }
|
||||
.chart-example { font-size: 0.75rem; color: var(--vp-c-text-3); font-style: italic; }
|
||||
</style>
|
||||
@@ -0,0 +1,134 @@
|
||||
<!--
|
||||
DashboardLayoutDemo.vue
|
||||
仪表盘布局演示:展示仪表盘的常见布局模式
|
||||
-->
|
||||
<template>
|
||||
<div class="dashboard-demo">
|
||||
<div class="header">
|
||||
<div class="title">仪表盘布局模式</div>
|
||||
<div class="subtitle">点击查看不同类型的仪表盘布局</div>
|
||||
</div>
|
||||
|
||||
<div class="layout-tabs">
|
||||
<div
|
||||
v-for="layout in layouts"
|
||||
:key="layout.key"
|
||||
:class="['tab', { active: activeLayout === layout.key }]"
|
||||
@click="activeLayout = layout.key"
|
||||
>
|
||||
{{ layout.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="current" class="layout-preview">
|
||||
<div class="preview-title">{{ current.name }}</div>
|
||||
<div class="preview-desc">{{ current.desc }}</div>
|
||||
<div :class="['mock-dashboard', current.key]">
|
||||
<div
|
||||
v-for="(widget, i) in current.widgets"
|
||||
:key="i"
|
||||
:class="['widget', widget.type]"
|
||||
>
|
||||
<div class="widget-label">{{ widget.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="use-case">适用场景:{{ current.useCase }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
|
||||
const activeLayout = ref('overview')
|
||||
|
||||
const layouts = [
|
||||
{
|
||||
key: 'overview',
|
||||
name: '全局概览型',
|
||||
desc: '顶部核心指标卡片 + 中间趋势图 + 底部明细表',
|
||||
useCase: '管理层日报、运营大盘',
|
||||
widgets: [
|
||||
{ type: 'kpi', label: 'DAU 12.5万' },
|
||||
{ type: 'kpi', label: '收入 ¥85万' },
|
||||
{ type: 'kpi', label: '转化率 3.2%' },
|
||||
{ type: 'kpi', label: '客单价 ¥268' },
|
||||
{ type: 'chart-wide', label: '趋势折线图' },
|
||||
{ type: 'table', label: '明细数据表' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'comparison',
|
||||
name: '对比分析型',
|
||||
desc: '左右对比布局,适合 A/B 测试或同环比分析',
|
||||
useCase: 'A/B 测试报告、竞品分析',
|
||||
widgets: [
|
||||
{ type: 'half', label: '实验组指标' },
|
||||
{ type: 'half', label: '对照组指标' },
|
||||
{ type: 'chart-wide', label: '差异对比图' },
|
||||
{ type: 'table', label: '统计显著性检验' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'drill',
|
||||
name: '下钻分析型',
|
||||
desc: '从汇总到明细逐层下钻,支持交互式探索',
|
||||
useCase: '销售分析、用户行为分析',
|
||||
widgets: [
|
||||
{ type: 'chart-wide', label: '全国销售地图(点击省份下钻)' },
|
||||
{ type: 'half', label: '省份排名柱状图' },
|
||||
{ type: 'half', label: '城市明细饼图' },
|
||||
{ type: 'table', label: '门店级明细表' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'realtime',
|
||||
name: '实时监控型',
|
||||
desc: '大屏展示,数据自动刷新,适合投屏',
|
||||
useCase: '双十一大屏、服务器监控',
|
||||
widgets: [
|
||||
{ type: 'big-number', label: '实时 GMV ¥1.2亿' },
|
||||
{ type: 'half', label: '订单量实时曲线' },
|
||||
{ type: 'half', label: '地域热力图' },
|
||||
{ type: 'kpi', label: '支付成功率' },
|
||||
{ type: 'kpi', label: '平均响应时间' },
|
||||
{ type: 'kpi', label: '在线用户数' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
const current = computed(() => layouts.find(l => l.key === activeLayout.value))
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dashboard-demo {
|
||||
border: 1px solid var(--vp-c-divider); background: var(--vp-c-bg-soft);
|
||||
border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0;
|
||||
}
|
||||
.header { margin-bottom: 1rem; }
|
||||
.title { font-weight: 700; font-size: 1.1rem; }
|
||||
.subtitle { color: var(--vp-c-text-2); font-size: 0.9rem; }
|
||||
.layout-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
|
||||
.tab {
|
||||
padding: 0.4rem 0.75rem; border-radius: 6px; cursor: pointer;
|
||||
font-size: 0.85rem; background: var(--vp-c-bg); border: 1px solid var(--vp-c-divider);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.tab:hover { border-color: var(--vp-c-brand); }
|
||||
.tab.active { border-color: var(--vp-c-brand); background: rgba(var(--vp-c-brand-rgb), 0.05); font-weight: 600; }
|
||||
.layout-preview { background: var(--vp-c-bg); border-radius: 8px; padding: 1rem; border: 1px solid var(--vp-c-divider); }
|
||||
.preview-title { font-weight: 700; font-size: 0.95rem; }
|
||||
.preview-desc { color: var(--vp-c-text-2); font-size: 0.82rem; margin-bottom: 0.75rem; }
|
||||
.mock-dashboard { display: grid; gap: 0.4rem; margin-bottom: 0.75rem; grid-template-columns: repeat(4, 1fr); }
|
||||
.widget {
|
||||
padding: 0.5rem; border-radius: 6px; text-align: center;
|
||||
font-size: 0.75rem; font-weight: 600; border: 1px dashed var(--vp-c-divider);
|
||||
}
|
||||
.widget.kpi { background: rgba(var(--vp-c-brand-rgb), 0.06); grid-column: span 1; }
|
||||
.widget.chart-wide { background: rgba(34,197,94,0.06); grid-column: span 4; min-height: 50px; }
|
||||
.widget.table { background: rgba(245,158,11,0.06); grid-column: span 4; }
|
||||
.widget.half { background: rgba(99,102,241,0.06); grid-column: span 2; min-height: 40px; }
|
||||
.widget.big-number { background: rgba(239,68,68,0.06); grid-column: span 4; min-height: 40px; font-size: 0.9rem; }
|
||||
.widget-label { color: var(--vp-c-text-2); }
|
||||
.use-case { font-size: 0.82rem; color: var(--vp-c-text-3); }
|
||||
</style>
|
||||
Reference in New Issue
Block a user