Files
wecom_it_smart_desk/data/seed-templates/07-printer.json
T
Simon cec5607c45 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
2026-06-16 14:30:09 +08:00

81 lines
2.5 KiB
JSON

{
"name": "打印机 / 外设故障排查",
"category": "printer",
"description": "员工打印失败、卡纸、驱动问题、扫描仪、U盘识别",
"estimated_time": 6,
"difficulty": 1,
"tags": ["打印", "扫描", "U盘", "外设", "驱动"],
"root_node": {
"id": "fc-print-1",
"type": "step",
"label": "确认外设类型(打印/扫描/U盘/其他)",
"status": "pending",
"children": [
{
"id": "fc-print-2",
"type": "decision",
"label": "打印机型号?",
"yes_branch": {
"id": "fc-print-3",
"type": "step",
"label": "【打印】按故障现象分流:",
"children": [
{
"id": "fc-print-4",
"type": "step",
"label": "卡纸:打开盖板 + 按箭头方向抽纸 + 检查纸槽"
},
{
"id": "fc-print-5",
"type": "step",
"label": "脱机:重新添加打印机 + 检查网络(IP 直连 or 服务器共享)"
},
{
"id": "fc-print-6",
"type": "step",
"label": "驱动异常:卸载重装 + 选对型号 + 重启打印服务"
},
{
"id": "fc-print-7",
"type": "decision",
"label": "其他员工同打印机能用?",
"yes_branch": {
"id": "fc-print-8",
"type": "step",
"label": "员工电脑问题:换电脑测试确认"
},
"no_branch": {
"id": "fc-print-9",
"type": "step",
"label": "升级二线:硬件供应商(联系信息见公告)"
}
}
]
},
"no_branch": {
"id": "fc-print-10",
"type": "step",
"label": "【扫描仪/其他外设】:",
"children": [
{
"id": "fc-print-11",
"type": "step",
"label": "扫描仪:检查 USB 连接 + 重新装驱动 + 测试扫描"
},
{
"id": "fc-print-12",
"type": "step",
"label": "U盘:插入其他电脑测试 + 检查文件系统(ExFAT 兼容性)"
},
{
"id": "fc-print-13",
"type": "step",
"label": "其他外设:走通用流程(查线/换口/换电脑/重装驱动)"
}
]
}
}
]
}
}