flowchart TD
  START[编辑生产工艺弹窗] --> LEFT[左侧工序基础库<br/>filteredTableData4]
  START --> RIGHT[右侧生产工艺明细<br/>tableData5]

  LEFT --> SEARCH[输入 processSearchName]
  SEARCH --> FILTER[filterProcess<br/>按 工艺名称 includes 过滤]
  FILTER --> LEFT

  LEFT --> CLICK[点击某个工序 editProcedure（row）]
  CLICK --> HASINSERT{insertidx 是否非 0?}
  HASINSERT -->|否: 普通新增| ADD[组装参数<br/>工艺编号/物料编号/计划数量/订单编号]
  ADD --> SPADD[工艺管理_零件工序_生产工艺_修改数据]
  SPADD --> RELOAD1[重新查询生产工艺]

  HASINSERT -->|是: 填入占位行| FILL[组装参数<br/>工艺编号/idd/计划数量/订单编号]
  FILL --> SPFILL[工艺管理_零件工序_生产工艺_编辑插入工序]
  SPFILL --> RELOAD1

  RIGHT --> EDIT[编辑字段<br/>准备工时/标准工时/工时合计<br/>工卡量具/指定机床/车间/属性<br/>工艺要求/备注]
  EDIT --> NORM[规范化工卡量具/指定机床<br/>数组/对象/字符串 -> 数组]
  NORM --> SPEDIT[工艺管理_零件工序_生产工艺_编辑]
  SPEDIT --> SILENT[当前无成功提示<br/>后台即时保存]

  RIGHT --> MOVEUP[上移工序]
  MOVEUP --> SPMU[工艺管理_零件工序_生产工艺_上移工序]
  RIGHT --> MOVEDOWN[下移工序]
  MOVEDOWN --> SPMD[工艺管理_零件工序_生产工艺_下移工序]
  RIGHT --> INSERT[插入工序]
  INSERT --> SPI[工艺管理_零件工序_生产工艺_插入工序<br/>生成空占位行]
  RIGHT --> DELETE[删除工序]
  DELETE --> SPD[工艺管理_零件工序_生产工艺_删除工序]

  SPMU --> RELOAD1
  SPMD --> RELOAD1
  SPI --> RELOAD1
  SPD --> RELOAD1

  RELOAD1 --> SPQUERY[工艺管理_生产工艺_查询生产工艺]
  SPQUERY --> NEWT5[刷新 tableData5]
  NEWT5 --> FN[fninsertidx<br/>识别占位行/转换多选字段]
  FN --> RIGHT

  classDef ui fill:#E8F3FF,stroke:#2B6CB0,color:#111;
  classDef action fill:#FFF7E6,stroke:#C47F00,color:#111;
  classDef api fill:#EAF8EA,stroke:#2F855A,color:#111;
  classDef decision fill:#F3E8FF,stroke:#6B46C1,color:#111;
  classDef output fill:#F0FFF4,stroke:#38A169,color:#111;
  class START,LEFT,RIGHT ui;
  class SEARCH,FILTER,CLICK,ADD,FILL,EDIT,NORM,MOVEUP,MOVEDOWN,INSERT,DELETE,RELOAD1,FN action;
  class SPADD,SPFILL,SPEDIT,SPMU,SPMD,SPI,SPD,SPQUERY api;
  class HASINSERT decision;
  class SILENT,NEWT5 output;

