76f266645d
含 Phase 1.1 IM seq 排序、断线重连、多端已读同步与微信式语音转文字 UI。 排除 node_modules、构建产物、安装包与 .env 密钥。 Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.3 KiB
Dart
46 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../api/oa_client.dart';
|
|
import '../pages/approvals_page.dart';
|
|
import '../pages/record_detail_page.dart';
|
|
import '../pages/todos_page.dart';
|
|
import '../pages/work_assign_page.dart';
|
|
import '../session/session.dart';
|
|
import 'biz_route.dart';
|
|
|
|
/// Opens a system notification at its business destination. System notices are
|
|
/// workflow entries, never an IM peer conversation.
|
|
void openNoticeTarget(
|
|
BuildContext context,
|
|
OaClient api, {
|
|
required SessionStore session,
|
|
required String kind,
|
|
required String bizType,
|
|
required String bizId,
|
|
String title = '系统通知',
|
|
}) {
|
|
if (bizType == 'WORK_ASSIGN') {
|
|
Navigator.of(context).push(MaterialPageRoute(
|
|
builder: (_) => WorkAssignPage(session: session, api: api),
|
|
));
|
|
return;
|
|
}
|
|
final seed = <String, dynamic>{
|
|
'bizType': bizType,
|
|
'bizId': bizId,
|
|
'id': bizId,
|
|
'title': title,
|
|
};
|
|
if (bizId.isNotEmpty && fetchPathOf(seed) != null) {
|
|
openRecord(context, api, seed, title: title);
|
|
return;
|
|
}
|
|
if (kind == 'approval' || bizType.contains('APPROVAL')) {
|
|
Navigator.of(context)
|
|
.push(MaterialPageRoute(builder: (_) => ApprovalsPage(api: api)));
|
|
return;
|
|
}
|
|
Navigator.of(context)
|
|
.push(MaterialPageRoute(builder: (_) => TodosPage(api: api)));
|
|
}
|