feat(flow): 泳道拓宽计划(空泳道策略 + 多槽位泳道,三视图同步);发布 v1.3.4
- 空泳道策略(F2 文档设置 →「泳道」):动作全部移走的泳道可保留(默认,序号不变) 或自动移除;条形空行 / 圆周空环 / 流程空列与左侧栏占位行同步 - 泳道加宽(1–5 槽):双击条形视图左侧泳道编号 / 右键空白泳道 / 左侧栏「N 槽」徽标; 条形分子行(浅色虚线分隔)、圆周同色加宽环带 + 槽位虚线、流程图分子列且泳道带 随内容智能加宽;拖拽动作同时换道 + 换槽位;旧数据零迁移(row 语义改为槽位并自动钳制) - 流程图智能排开:同源同层扇出连线在空隙内均匀铺开;同层节点水平重叠自动推开 - 显示修复:画布左栏标题按真实行高排版(灰色副标题不再被换行标题压住, 持续换行到泳道高度不足);多槽位采用「槽位紧凑 + 泳道间拉开」的间隔 - 「时序创建和编辑」更名为「文档设置」(含对话框标题/帮助/文档);新增自动保存 (默认 10 分钟,可选 1/5/10/30 或关闭;写入文件并同步 .bak) - 授权临时冻结(kLicenseRequired=false):桌面版导出无需 .lic;关于页授权状态 「开放授权版本」、EDC 版权、开发者与交流群(邮箱 liuyu65@126.com、微信 online-goose) - 更新体验:直接升级到最新版本提示、下载过程保持屏幕常亮提示、 下载/上传统一限速 320KB/s(客户端限速 + 发布脚本 --limit-rate 320k) - docs/HELP.md 与帮助中心同步更新;新增 docs/ROADMAP.md 开发路线图 - flutter analyze 0 问题、40 项测试全过;演示截图更新(含泳道加宽与拥挤场景验证图)
This commit is contained in:
+86
-8
@@ -18,6 +18,7 @@ import 'package:flutter/services.dart';
|
||||
import '../export/drawio_writer.dart';
|
||||
import '../export/export_renderer.dart';
|
||||
import '../export/svg_writer.dart';
|
||||
import '../layout/layout.dart';
|
||||
import '../model/models.dart';
|
||||
import '../model/units.dart';
|
||||
import '../persistence/android_docs.dart';
|
||||
@@ -1179,7 +1180,7 @@ class _AppShellState extends State<AppShell> {
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
_sectionLabel(t, '时序创建和编辑'),
|
||||
_sectionLabel(t, '文档设置'),
|
||||
const Spacer(),
|
||||
_panelControls(t, true),
|
||||
],
|
||||
@@ -1188,14 +1189,14 @@ class _AppShellState extends State<AppShell> {
|
||||
_editEntry(
|
||||
t,
|
||||
icon: Icons.edit_note,
|
||||
label: '编辑时序与节拍参数',
|
||||
label: '文档设置',
|
||||
enabled: !flow,
|
||||
onTap: () => showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => SettingsDialog(controller: c),
|
||||
),
|
||||
),
|
||||
// 较浅的分隔横线,区分上方「时序创建和编辑」与下方「动作和执行编辑」。
|
||||
// 较浅的分隔横线,区分上方「文档设置」与下方「动作和执行编辑」。
|
||||
const SizedBox(height: 14),
|
||||
Divider(height: 1, thickness: 1, color: t.line),
|
||||
const SizedBox(height: 14),
|
||||
@@ -1358,6 +1359,35 @@ class _AppShellState extends State<AppShell> {
|
||||
return Tooltip(message: '流程图只读:修改请切回条形 / 圆周视图', child: card);
|
||||
}
|
||||
|
||||
/// 左侧栏的泳道槽位小徽标:显示当前槽位数,点击可调整(1–5 槽)。
|
||||
///
|
||||
/// 槽位数 > 1 时高亮显示(多槽位泳道内动作按子行并列放置)。
|
||||
Widget _laneSlotChip(Tokens t, int lane) {
|
||||
final int n = c.project.slotsOf(lane);
|
||||
return Builder(
|
||||
builder: (BuildContext ctx) => Tooltip(
|
||||
message: '泳道 L${lane + 1} 槽位数:$n(点击调整,最多 5)',
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
onTap: () async {
|
||||
final RenderBox box = ctx.findRenderObject()! as RenderBox;
|
||||
await showLaneSlotMenu(context, c, box.localToGlobal(Offset.zero), lane);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: n > 1 ? t.accent.withValues(alpha: 0.14) : t.panel2,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: n > 1 ? t.accent.withValues(alpha: 0.4) : t.line2),
|
||||
),
|
||||
child: Text('$n 槽',
|
||||
style: TextStyle(color: n > 1 ? t.accent : t.dim, fontSize: 10)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 动作列表小节标题右侧的紧凑按钮(新建 / 删除)。
|
||||
///
|
||||
/// [onTap] 为 null 时按钮呈禁用态(降低不透明度),用于「未选中动作时禁用删除」。
|
||||
@@ -1385,12 +1415,17 @@ class _AppShellState extends State<AppShell> {
|
||||
|
||||
/// 左侧栏:按泳道 / 轨道分组的行列表。
|
||||
List<Widget> _laneRows(Tokens t, bool bar) {
|
||||
final List<int> lanes = <int>{for (final Action a in c.project.actions) a.layer}.toList()..sort();
|
||||
final List<int> lanes = c.project.renderLanes;
|
||||
final List<Widget> out = <Widget>[];
|
||||
for (int li = 0; li < lanes.length; li++) {
|
||||
final int lane = lanes[li];
|
||||
final List<Action> acts = c.project.actions.where((Action a) => a.layer == lane).toList()
|
||||
..sort((Action a, Action b) => a.startAngle.compareTo(b.startAngle));
|
||||
// 空泳道(开启「保留空泳道」后动作被全部移走):显示占位行。
|
||||
if (acts.isEmpty) {
|
||||
out.add(_emptyLaneRow(t, lane, li));
|
||||
continue;
|
||||
}
|
||||
// 单动作泳道沿用普通动作行;多动作泳道合并显示。
|
||||
out.add(acts.length == 1
|
||||
? _actionRow(t, acts.first, li, bar)
|
||||
@@ -1399,6 +1434,42 @@ class _AppShellState extends State<AppShell> {
|
||||
return out;
|
||||
}
|
||||
|
||||
/// 左侧栏中的空泳道占位行(开启「保留空泳道」后,动作被全部移走的泳道)。
|
||||
Widget _emptyLaneRow(Tokens t, int lane, int li) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 6),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: t.line),
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 22,
|
||||
height: 22,
|
||||
decoration: BoxDecoration(
|
||||
color: t.panel2,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: t.line2),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text('${li + 1}',
|
||||
style: TextStyle(color: t.dim, fontSize: 11, fontWeight: FontWeight.w700)),
|
||||
),
|
||||
const SizedBox(width: 9),
|
||||
Expanded(
|
||||
child: Text('空泳道(已保留,可拖入动作)',
|
||||
style: TextStyle(color: t.dim, fontSize: 11)),
|
||||
),
|
||||
_laneSlotChip(t, lane),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 单条泳道 / 轨道行:多个动作合并显示(≤2 行,/ 分隔)。
|
||||
Widget _laneRow(Tokens t, int lane, int li, List<Action> acts, bool bar) {
|
||||
if (acts.isEmpty) return const SizedBox.shrink();
|
||||
@@ -1454,7 +1525,8 @@ class _AppShellState extends State<AppShell> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
joined,
|
||||
maxLines: 2,
|
||||
// 多槽位泳道允许更多行(最多与槽位数一致),持续自动换行。
|
||||
maxLines: math.max(2, c.project.slotsOf(lane)),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: sel ? t.text : t.text2,
|
||||
@@ -1492,6 +1564,8 @@ class _AppShellState extends State<AppShell> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
_laneSlotChip(t, lane),
|
||||
const SizedBox(width: 4),
|
||||
InkWell(
|
||||
onTap: flow
|
||||
? null
|
||||
@@ -1561,7 +1635,9 @@ class _AppShellState extends State<AppShell> {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(color: sel ? t.text : t.text2, fontSize: 12, fontWeight: sel ? FontWeight.w600 : FontWeight.normal)),
|
||||
Text('${a.id} · ${st?.name ?? a.stationId} · ${a.driver}',
|
||||
Text(
|
||||
'${a.id} · ${st?.name ?? a.stationId} · ${a.driver}'
|
||||
'${c.project.slotsOf(a.layer) > 1 ? ' · 槽 ${effectiveSlot(c.project, a) + 1}' : ''}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(color: t.dim, fontSize: 10)),
|
||||
@@ -1589,6 +1665,8 @@ class _AppShellState extends State<AppShell> {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
_laneSlotChip(t, a.layer),
|
||||
const SizedBox(width: 4),
|
||||
InkWell(
|
||||
onTap: flow
|
||||
? null
|
||||
@@ -2160,9 +2238,9 @@ class _AppShellState extends State<AppShell> {
|
||||
'相位 360° = 100%',
|
||||
'动作 ${c.project.actions.length}',
|
||||
'依赖 ${_depCount()}',
|
||||
circular ? '轨道 L1–L${c.project.laneCount}' : '工位 ${c.project.stations.length}',
|
||||
circular ? '轨道 L1–L${c.project.renderLaneCount}' : '工位 ${c.project.stations.length}',
|
||||
mode == ViewMode.flow
|
||||
? '泳道 L1–L${c.project.laneCount}(流程节点 ${c.project.actions.length})'
|
||||
? '泳道 L1–L${c.project.renderLaneCount}(流程节点 ${c.project.actions.length})'
|
||||
: (circular ? '同心圆 ${c.project.laneCount}' : '时间轴 0–${tfmt(c.project.cycle.durationMs, u)}'),
|
||||
'单位 ${timeUnitLabel(u.timeUnit)} / ${phaseUnitLabel(u.phaseUnit)}',
|
||||
'1° = ${tfmtAuto(c.project.cycle.durationMs / 360)}',
|
||||
|
||||
Reference in New Issue
Block a user