openxiangda 1.0.66 → 1.0.67
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
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
MacStatusPill,
|
|
39
39
|
cn,
|
|
40
40
|
} from "@/shared/mac-admin";
|
|
41
|
+
import { runtimeDefaultRoutes } from "@/runtime/default-routes";
|
|
41
42
|
|
|
42
43
|
type MenuItem = {
|
|
43
44
|
name: string;
|
|
@@ -104,13 +105,19 @@ export function AdminShell() {
|
|
|
104
105
|
"未登录",
|
|
105
106
|
);
|
|
106
107
|
const primaryReceiptFormUuid = useMemo(
|
|
107
|
-
() =>
|
|
108
|
+
() =>
|
|
109
|
+
runtimeDefaultRoutes.formSubmit?.formUuid ||
|
|
110
|
+
findMenuFormUuid(menus.data, ["receipt", "form"]),
|
|
108
111
|
[menus.data],
|
|
109
112
|
);
|
|
110
113
|
const primaryProcessFormUuid = useMemo(
|
|
111
|
-
() =>
|
|
114
|
+
() =>
|
|
115
|
+
runtimeDefaultRoutes.processSubmit?.formUuid ||
|
|
116
|
+
findMenuFormUuid(menus.data, ["process", "workflow"]),
|
|
112
117
|
[menus.data],
|
|
113
118
|
);
|
|
119
|
+
const primaryDataFormUuid =
|
|
120
|
+
runtimeDefaultRoutes.dataManageList?.formUuid || primaryReceiptFormUuid;
|
|
114
121
|
|
|
115
122
|
const groups = useMemo<MenuGroup[]>(() => {
|
|
116
123
|
const platformItems = menus.data.length
|
|
@@ -132,17 +139,20 @@ export function AdminShell() {
|
|
|
132
139
|
|
|
133
140
|
return [
|
|
134
141
|
{ title: "应用导航", items: platformItems },
|
|
135
|
-
...buildSystemNavigation(
|
|
136
|
-
|
|
142
|
+
...buildSystemNavigation({
|
|
143
|
+
filePreviewTicket: runtimeDefaultRoutes.filePreview?.ticket,
|
|
144
|
+
processFormUuid: primaryProcessFormUuid,
|
|
145
|
+
receiptFormUuid: primaryReceiptFormUuid,
|
|
146
|
+
dataFormUuid: primaryDataFormUuid,
|
|
147
|
+
}).map(group => ({
|
|
137
148
|
...group,
|
|
138
149
|
items: group.items.map(item => ({
|
|
139
150
|
...item,
|
|
140
151
|
path: resolveMenuPath(appType, item.path),
|
|
141
152
|
})),
|
|
142
|
-
}),
|
|
143
|
-
),
|
|
153
|
+
})),
|
|
144
154
|
];
|
|
145
|
-
}, [appType, menus.data, primaryProcessFormUuid, primaryReceiptFormUuid]);
|
|
155
|
+
}, [appType, menus.data, primaryDataFormUuid, primaryProcessFormUuid, primaryReceiptFormUuid]);
|
|
146
156
|
|
|
147
157
|
const handleLogout = async () => {
|
|
148
158
|
setLoggingOut(true);
|
|
@@ -447,16 +457,29 @@ function resolveRuntimeMenuPath(appType: string, menu: RuntimeMenuLike) {
|
|
|
447
457
|
return resolveMenuPath(appType, "admin");
|
|
448
458
|
}
|
|
449
459
|
|
|
450
|
-
function buildSystemNavigation(
|
|
460
|
+
function buildSystemNavigation({
|
|
461
|
+
dataFormUuid,
|
|
462
|
+
filePreviewTicket,
|
|
463
|
+
processFormUuid,
|
|
464
|
+
receiptFormUuid,
|
|
465
|
+
}: {
|
|
466
|
+
dataFormUuid?: string;
|
|
467
|
+
filePreviewTicket?: string;
|
|
468
|
+
processFormUuid?: string;
|
|
469
|
+
receiptFormUuid?: string;
|
|
470
|
+
}): MenuGroup[] {
|
|
451
471
|
const receiptPath = receiptFormUuid
|
|
452
472
|
? `admin/forms/${encodeURIComponent(receiptFormUuid)}/new`
|
|
453
473
|
: "admin/forms";
|
|
454
474
|
const processPath = processFormUuid
|
|
455
475
|
? `admin/forms/${encodeURIComponent(processFormUuid)}/new`
|
|
456
476
|
: "admin/process";
|
|
457
|
-
const dataPath =
|
|
458
|
-
? `admin/data/${encodeURIComponent(
|
|
477
|
+
const dataPath = dataFormUuid
|
|
478
|
+
? `admin/data/${encodeURIComponent(dataFormUuid)}`
|
|
459
479
|
: "admin/data";
|
|
480
|
+
const filePreviewPath = filePreviewTicket
|
|
481
|
+
? `file-preview?ticket=${encodeURIComponent(filePreviewTicket)}`
|
|
482
|
+
: "file-preview";
|
|
460
483
|
|
|
461
484
|
return systemNavigation.map(group => ({
|
|
462
485
|
...group,
|
|
@@ -464,7 +487,7 @@ function buildSystemNavigation(receiptFormUuid?: string, processFormUuid?: strin
|
|
|
464
487
|
if (item.name === "表单模板") return { ...item, path: receiptPath };
|
|
465
488
|
if (item.name === "流程模板") return { ...item, path: processPath };
|
|
466
489
|
if (item.name === "数据列表") return { ...item, path: dataPath };
|
|
467
|
-
if (item.name === "文件预览") return { ...item, path:
|
|
490
|
+
if (item.name === "文件预览") return { ...item, path: filePreviewPath };
|
|
468
491
|
return item;
|
|
469
492
|
}),
|
|
470
493
|
}));
|
|
@@ -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 = {};
|