@teamias/pro-layout 0.0.22 → 0.0.23
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/dist/markdowns/example1/BasicProLayout/index.js +2 -3
- package/dist/markdowns/example1/BasicProLayout/pages/Placeholder.d.ts +1 -0
- package/dist/markdowns/example1/BasicProLayout/pages/Placeholder.js +11 -0
- package/dist/markdowns/example1/BasicProLayout/testData.d.ts +30 -2
- package/dist/markdowns/example1/BasicProLayout/testData.js +15 -1
- package/dist/pro-layout/utils/menu.js +3 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ import { sleep } from 'radash';
|
|
|
8
8
|
import { useEffect } from 'react';
|
|
9
9
|
import ReactDom from 'react-dom';
|
|
10
10
|
import { MemoryRouter } from 'react-router-dom';
|
|
11
|
+
import { Placeholder } from "./pages/Placeholder";
|
|
11
12
|
import { menuData, pageComponentMap } from "./testData";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
var BasicProLayout = function BasicProLayout() {
|
|
@@ -18,9 +19,7 @@ var BasicProLayout = function BasicProLayout() {
|
|
|
18
19
|
basename: "/",
|
|
19
20
|
projectId: "demo-project",
|
|
20
21
|
pageComponentMap: pageComponentMap,
|
|
21
|
-
placeholderElement: /*#__PURE__*/_jsx(
|
|
22
|
-
children: "\u5360\u4F4D\u5143\u7D20: \u9875\u9762\u6B63\u5728\u5F00\u53D1\u4E2D..."
|
|
23
|
-
}),
|
|
22
|
+
placeholderElement: /*#__PURE__*/_jsx(Placeholder, {}),
|
|
24
23
|
requestUserInfoMenuData: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
25
24
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26
25
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Placeholder: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useLocation } from 'react-router-dom';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export var Placeholder = function Placeholder() {
|
|
5
|
+
var location = useLocation();
|
|
6
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
7
|
+
children: ["\u5360\u4F4D\u5143\u7D20: \u9875\u9762\u6B63\u5728\u5F00\u53D1\u4E2D...", /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx("pre", {
|
|
8
|
+
children: JSON.stringify(location, null, 4)
|
|
9
|
+
})]
|
|
10
|
+
});
|
|
11
|
+
};
|
|
@@ -36,7 +36,7 @@ export declare const menuData: ({
|
|
|
36
36
|
hidden: 0;
|
|
37
37
|
menu_type: "dir";
|
|
38
38
|
status_text: string;
|
|
39
|
-
children: {
|
|
39
|
+
children: ({
|
|
40
40
|
id: string;
|
|
41
41
|
app_id: number;
|
|
42
42
|
title: string;
|
|
@@ -49,5 +49,33 @@ export declare const menuData: ({
|
|
|
49
49
|
hidden: 0;
|
|
50
50
|
menu_type: "menu";
|
|
51
51
|
status_text: string;
|
|
52
|
-
|
|
52
|
+
children?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
id: string;
|
|
55
|
+
app_id: number;
|
|
56
|
+
title: string;
|
|
57
|
+
icon: string;
|
|
58
|
+
type: 1;
|
|
59
|
+
routing: string;
|
|
60
|
+
component: string;
|
|
61
|
+
pid: string;
|
|
62
|
+
permission: string;
|
|
63
|
+
hidden: 0;
|
|
64
|
+
menu_type: "menu";
|
|
65
|
+
status_text: string;
|
|
66
|
+
children: {
|
|
67
|
+
id: string;
|
|
68
|
+
app_id: number;
|
|
69
|
+
title: string;
|
|
70
|
+
icon: string;
|
|
71
|
+
type: 1;
|
|
72
|
+
routing: string;
|
|
73
|
+
component: string;
|
|
74
|
+
pid: string;
|
|
75
|
+
permission: string;
|
|
76
|
+
hidden: 0;
|
|
77
|
+
menu_type: "menu";
|
|
78
|
+
status_text: string;
|
|
79
|
+
}[];
|
|
80
|
+
})[];
|
|
53
81
|
})[];
|
|
@@ -77,6 +77,20 @@ export var menuData = [{
|
|
|
77
77
|
permission: '',
|
|
78
78
|
hidden: 0,
|
|
79
79
|
menu_type: 'menu',
|
|
80
|
-
status_text: ''
|
|
80
|
+
status_text: '',
|
|
81
|
+
children: [{
|
|
82
|
+
id: '8432',
|
|
83
|
+
app_id: 2,
|
|
84
|
+
title: '低代码页-详情',
|
|
85
|
+
icon: '',
|
|
86
|
+
type: 1,
|
|
87
|
+
routing: '/page3/detailList/:type/:operateStaffingId/:operateStaffingName/:operateFailure',
|
|
88
|
+
component: '',
|
|
89
|
+
pid: '82',
|
|
90
|
+
permission: '',
|
|
91
|
+
hidden: 0,
|
|
92
|
+
menu_type: 'menu',
|
|
93
|
+
status_text: ''
|
|
94
|
+
}]
|
|
81
95
|
}]
|
|
82
96
|
}];
|
|
@@ -44,7 +44,9 @@ export var handleMenuData = function handleMenuData() {
|
|
|
44
44
|
var nodePath = paths.reduce(function (def, val) {
|
|
45
45
|
var reg = new RegExp("^/".concat(val, "(/)"));
|
|
46
46
|
return def.replace(reg, '$1');
|
|
47
|
-
}, old.routing).
|
|
47
|
+
}, old.routing).replace(/\/([^:])/g, '$1') || '/';
|
|
48
|
+
// .replaceAll('/', '') || '/';
|
|
49
|
+
|
|
48
50
|
var key = "/".concat([].concat(_toConsumableArray(paths), [nodePath]).join('/')).replaceAll('//', '/');
|
|
49
51
|
|
|
50
52
|
/** 组装新数据 */
|