feat(admin): Flowcharts.vue JSON 在线编辑 + 9 套排查模板种子数据

为管理后台'排查流程图'模块加 JSON 在线编辑能力 + 提供 9 套
办公 IT 常见故障排查模板种子数据(账号/系统/企微/VPN/邮箱/网络/
打印机/软件/硬件),管理员可基于此学习、筛选、修改、新增。

## 选型(按'优选开源'原则)
- @codemirror/lang-json / state / theme-one-dark / view
- codemirror(核心)
- vue-codemirror(Vue 3 集成)
- vue-json-pretty(JSON 树形预览)
全部为社区成熟开源组件,非自行开发

## 改动
- frontend-admin/package.json: 加 6 个 npm 依赖
- frontend-admin/src/api/troubleshooting.ts(新): TS 类型 +
  5 个 API client(listTemplates / getTemplate / createTemplate /
  updateTemplate / deleteTemplate) + formatJson/validateJson/
  countNodes/countDecisions 工具函数
- frontend-admin/src/components/flowchart/FlowchartEditorDialog.vue(新):
  双面板编辑器(左 CodeMirror + 右 vue-json-pretty),
  实时 JSON 校验 + 节点/决策统计 + 格式/复制/导出按钮
- frontend-admin/src/views/Flowcharts.vue(改): 列表 + 导入/导出/
  新建按钮 + EditorDialog 集成 + 文件上传 + 删除确认

## 9 套种子数据
- 01-account-password.json 账号密码
- 02-pc-system.json        电脑系统
- 03-wecom.json            企微问题
- 04-vpn.json              VPN 接入
- 05-email.json            邮箱
- 06-network.json          网络
- 07-printer.json          打印机
- 08-software.json         软件
- 09-hardware.json         硬件
每套 ~150-200 行,结构:name / category / description /
estimated_time / difficulty / tags / root_node(决策树)

## 工具脚本
- data/seed-templates/build_all.py: 合并 9 个 JSON 成 00-all.json
This commit is contained in:
Simon
2026-06-16 14:30:09 +08:00
parent caf9b7ed85
commit cec5607c45
14 changed files with 1824 additions and 156 deletions
+142
View File
@@ -0,0 +1,142 @@
{
"name": "电脑 / Windows 系统故障排查",
"category": "system",
"description": "员工电脑蓝屏、死机、卡顿、开机黑屏、Windows 更新失败",
"estimated_time": 15,
"difficulty": 3,
"tags": ["电脑", "Windows", "蓝屏", "系统更新", "卡顿"],
"root_node": {
"id": "fc-sys-1",
"type": "step",
"label": "确认故障现象(蓝屏代码/卡顿/黑屏/无法开机)",
"status": "pending",
"children": [
{
"id": "fc-sys-2",
"type": "decision",
"label": "电脑能正常开机进入桌面?",
"yes_branch": {
"id": "fc-sys-3",
"type": "step",
"label": "引导员工打开任务管理器查看资源占用",
"status": "pending",
"children": [
{
"id": "fc-sys-4",
"type": "decision",
"label": "CPU/内存/磁盘哪项占用高?",
"yes_branch": {
"id": "fc-sys-5",
"type": "step",
"label": "按占用类型分别处理:",
"status": "current",
"children": [
{
"id": "fc-sys-6",
"type": "step",
"label": "CPU高:结束异常进程,查启动项",
"status": "pending"
},
{
"id": "fc-sys-7",
"type": "step",
"label": "内存高:检查泄漏进程,加内存条",
"status": "pending"
},
{
"id": "fc-sys-8",
"type": "step",
"label": "磁盘100%:查大文件/重做系统考虑",
"status": "pending"
}
]
},
"no_branch": {
"id": "fc-sys-9",
"type": "step",
"label": "检查最近安装的软件/驱动/更新",
"status": "pending",
"children": [
{
"id": "fc-sys-10",
"type": "decision",
"label": "回滚后是否恢复?",
"yes_branch": {
"id": "fc-sys-11",
"type": "step",
"label": "标记该软件/更新为不兼容,记录案例"
},
"no_branch": {
"id": "fc-sys-12",
"type": "step",
"label": "进入安全模式进一步排查"
}
}
]
}
}
]
},
"no_branch": {
"id": "fc-sys-13",
"type": "step",
"label": "判断开机阶段(BIOS/启动管理器/登录界面)",
"status": "pending",
"children": [
{
"id": "fc-sys-14",
"type": "decision",
"label": "能进安全模式?",
"yes_branch": {
"id": "fc-sys-15",
"type": "step",
"label": "在安全模式卸载最近驱动/更新",
"status": "pending",
"children": [
{
"id": "fc-sys-16",
"type": "decision",
"label": "重启后正常?",
"yes_branch": {
"id": "fc-sys-17",
"type": "step",
"label": "回访确认 + 记录故障点"
},
"no_branch": {
"id": "fc-sys-18",
"type": "step",
"label": "备份数据后考虑重装系统"
}
}
]
},
"no_branch": {
"id": "fc-sys-19",
"type": "step",
"label": "硬件层故障:硬盘/内存条/主板",
"status": "pending",
"children": [
{
"id": "fc-sys-20",
"type": "decision",
"label": "外接显示器/拔内存条有变化?",
"yes_branch": {
"id": "fc-sys-21",
"type": "step",
"label": "对症更换硬件(联系硬件供应商)"
},
"no_branch": {
"id": "fc-sys-22",
"type": "step",
"label": "升级二线:送修 / 申请备用机"
}
}
]
}
}
]
}
}
]
}
}