openxiangda 1.0.66 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ChevronRight,
|
|
5
5
|
CircleHelp,
|
|
6
6
|
Database,
|
|
7
|
+
ExternalLink,
|
|
7
8
|
FileText,
|
|
8
9
|
FolderOpen,
|
|
9
10
|
Globe2,
|
|
@@ -38,6 +39,7 @@ import {
|
|
|
38
39
|
MacStatusPill,
|
|
39
40
|
cn,
|
|
40
41
|
} from "@/shared/mac-admin";
|
|
42
|
+
import { runtimeDefaultRoutes } from "@/runtime/default-routes";
|
|
41
43
|
|
|
42
44
|
type MenuItem = {
|
|
43
45
|
name: string;
|
|
@@ -104,13 +106,19 @@ export function AdminShell() {
|
|
|
104
106
|
"未登录",
|
|
105
107
|
);
|
|
106
108
|
const primaryReceiptFormUuid = useMemo(
|
|
107
|
-
() =>
|
|
109
|
+
() =>
|
|
110
|
+
runtimeDefaultRoutes.formSubmit?.formUuid ||
|
|
111
|
+
findMenuFormUuid(menus.data, ["receipt", "form"]),
|
|
108
112
|
[menus.data],
|
|
109
113
|
);
|
|
110
114
|
const primaryProcessFormUuid = useMemo(
|
|
111
|
-
() =>
|
|
115
|
+
() =>
|
|
116
|
+
runtimeDefaultRoutes.processSubmit?.formUuid ||
|
|
117
|
+
findMenuFormUuid(menus.data, ["process", "workflow"]),
|
|
112
118
|
[menus.data],
|
|
113
119
|
);
|
|
120
|
+
const primaryDataFormUuid =
|
|
121
|
+
runtimeDefaultRoutes.dataManageList?.formUuid || primaryReceiptFormUuid;
|
|
114
122
|
|
|
115
123
|
const groups = useMemo<MenuGroup[]>(() => {
|
|
116
124
|
const platformItems = menus.data.length
|
|
@@ -132,17 +140,20 @@ export function AdminShell() {
|
|
|
132
140
|
|
|
133
141
|
return [
|
|
134
142
|
{ title: "应用导航", items: platformItems },
|
|
135
|
-
...buildSystemNavigation(
|
|
136
|
-
|
|
143
|
+
...buildSystemNavigation({
|
|
144
|
+
filePreviewTicket: runtimeDefaultRoutes.filePreview?.ticket,
|
|
145
|
+
processFormUuid: primaryProcessFormUuid,
|
|
146
|
+
receiptFormUuid: primaryReceiptFormUuid,
|
|
147
|
+
dataFormUuid: primaryDataFormUuid,
|
|
148
|
+
}).map(group => ({
|
|
137
149
|
...group,
|
|
138
150
|
items: group.items.map(item => ({
|
|
139
151
|
...item,
|
|
140
152
|
path: resolveMenuPath(appType, item.path),
|
|
141
153
|
})),
|
|
142
|
-
}),
|
|
143
|
-
),
|
|
154
|
+
})),
|
|
144
155
|
];
|
|
145
|
-
}, [appType, menus.data, primaryProcessFormUuid, primaryReceiptFormUuid]);
|
|
156
|
+
}, [appType, menus.data, primaryDataFormUuid, primaryProcessFormUuid, primaryReceiptFormUuid]);
|
|
146
157
|
|
|
147
158
|
const handleLogout = async () => {
|
|
148
159
|
setLoggingOut(true);
|
|
@@ -340,6 +351,21 @@ export function AdminShell() {
|
|
|
340
351
|
<FolderOpen size={17} />
|
|
341
352
|
重新加载上下文
|
|
342
353
|
</button>
|
|
354
|
+
<button
|
|
355
|
+
className="flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm text-slate-600 transition hover:bg-slate-50"
|
|
356
|
+
onClick={() => {
|
|
357
|
+
setUserMenuOpen(false);
|
|
358
|
+
window.open(
|
|
359
|
+
`/dev/${encodeURIComponent(appType)}/admin`,
|
|
360
|
+
"_blank",
|
|
361
|
+
"noopener,noreferrer",
|
|
362
|
+
);
|
|
363
|
+
}}
|
|
364
|
+
type="button"
|
|
365
|
+
>
|
|
366
|
+
<ExternalLink size={17} />
|
|
367
|
+
打开开发态
|
|
368
|
+
</button>
|
|
343
369
|
<button
|
|
344
370
|
className="flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm text-rose-600 transition hover:bg-rose-50"
|
|
345
371
|
disabled={loggingOut}
|
|
@@ -447,16 +473,29 @@ function resolveRuntimeMenuPath(appType: string, menu: RuntimeMenuLike) {
|
|
|
447
473
|
return resolveMenuPath(appType, "admin");
|
|
448
474
|
}
|
|
449
475
|
|
|
450
|
-
function buildSystemNavigation(
|
|
476
|
+
function buildSystemNavigation({
|
|
477
|
+
dataFormUuid,
|
|
478
|
+
filePreviewTicket,
|
|
479
|
+
processFormUuid,
|
|
480
|
+
receiptFormUuid,
|
|
481
|
+
}: {
|
|
482
|
+
dataFormUuid?: string;
|
|
483
|
+
filePreviewTicket?: string;
|
|
484
|
+
processFormUuid?: string;
|
|
485
|
+
receiptFormUuid?: string;
|
|
486
|
+
}): MenuGroup[] {
|
|
451
487
|
const receiptPath = receiptFormUuid
|
|
452
488
|
? `admin/forms/${encodeURIComponent(receiptFormUuid)}/new`
|
|
453
489
|
: "admin/forms";
|
|
454
490
|
const processPath = processFormUuid
|
|
455
491
|
? `admin/forms/${encodeURIComponent(processFormUuid)}/new`
|
|
456
492
|
: "admin/process";
|
|
457
|
-
const dataPath =
|
|
458
|
-
? `admin/data/${encodeURIComponent(
|
|
493
|
+
const dataPath = dataFormUuid
|
|
494
|
+
? `admin/data/${encodeURIComponent(dataFormUuid)}`
|
|
459
495
|
: "admin/data";
|
|
496
|
+
const filePreviewPath = filePreviewTicket
|
|
497
|
+
? `file-preview?ticket=${encodeURIComponent(filePreviewTicket)}`
|
|
498
|
+
: "file-preview";
|
|
460
499
|
|
|
461
500
|
return systemNavigation.map(group => ({
|
|
462
501
|
...group,
|
|
@@ -464,7 +503,7 @@ function buildSystemNavigation(receiptFormUuid?: string, processFormUuid?: strin
|
|
|
464
503
|
if (item.name === "表单模板") return { ...item, path: receiptPath };
|
|
465
504
|
if (item.name === "流程模板") return { ...item, path: processPath };
|
|
466
505
|
if (item.name === "数据列表") return { ...item, path: dataPath };
|
|
467
|
-
if (item.name === "文件预览") return { ...item, path:
|
|
506
|
+
if (item.name === "文件预览") return { ...item, path: filePreviewPath };
|
|
468
507
|
return item;
|
|
469
508
|
}),
|
|
470
509
|
}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface RuntimeDefaultRoutes {
|
|
2
|
+
formSubmit?: {
|
|
3
|
+
formUuid?: string;
|
|
4
|
+
};
|
|
5
|
+
processSubmit?: {
|
|
6
|
+
formUuid?: string;
|
|
7
|
+
};
|
|
8
|
+
dataManageList?: {
|
|
9
|
+
formUuid?: string;
|
|
10
|
+
};
|
|
11
|
+
filePreview?: {
|
|
12
|
+
ticket?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const runtimeDefaultRoutes: RuntimeDefaultRoutes = {};
|