@teamias/pro-layout 0.0.14 → 0.0.15
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/pro-layout/components/DocumentTitle.js +5 -4
- package/dist/pro-layout/components/KeepAlive/KeepAliveClass.d.ts +10 -0
- package/dist/pro-layout/components/KeepAlive/index.d.ts +5 -0
- package/dist/pro-layout/components/TabsLayout/index.js +3 -3
- package/dist/pro-layout/hooks/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -16,7 +16,8 @@ export var DocumentTitle = function DocumentTitle(_ref) {
|
|
|
16
16
|
pageStatus = _useAccessRouter$loca.pageStatus,
|
|
17
17
|
pathname = _useAccessRouter$loca.pathname,
|
|
18
18
|
pageTitle = _useAccessRouter$loca.pageTitle,
|
|
19
|
-
intlMenuConfig = _useAccessRouter$loca.intlMenuConfig
|
|
19
|
+
intlMenuConfig = _useAccessRouter$loca.intlMenuConfig,
|
|
20
|
+
localLangKey = _useAccessRouter$loca.localLangKey;
|
|
20
21
|
var _useIntl = useIntl(),
|
|
21
22
|
formatMessage = _useIntl.formatMessage;
|
|
22
23
|
useEffect(function () {
|
|
@@ -28,9 +29,9 @@ export var DocumentTitle = function DocumentTitle(_ref) {
|
|
|
28
29
|
// document.title = pageStatus + '';
|
|
29
30
|
// return;
|
|
30
31
|
// }
|
|
31
|
-
document.title = pageTitle || formatMessage(_objectSpread(_objectSpread({}, intlMenuConfig), {}, {
|
|
32
|
-
id: (intlMenuConfig === null || intlMenuConfig === void 0 ? void 0 : intlMenuConfig.id) || 'menu.unknown'
|
|
32
|
+
document.title = pageTitle || formatMessage(_objectSpread(_objectSpread({}, intlMenuConfig || localLangKey), {}, {
|
|
33
|
+
id: (intlMenuConfig === null || intlMenuConfig === void 0 ? void 0 : intlMenuConfig.id) || (localLangKey === null || localLangKey === void 0 ? void 0 : localLangKey.id) || 'menu.unknown'
|
|
33
34
|
}));
|
|
34
|
-
}, [pathname, pageStatus, pageTitle, intlMenuConfig, title]);
|
|
35
|
+
}, [pathname, pageStatus, pageTitle, intlMenuConfig, localLangKey, title]);
|
|
35
36
|
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
36
37
|
};
|
|
@@ -24,6 +24,11 @@ export declare class KeepAliveClass {
|
|
|
24
24
|
defaultMessage: string;
|
|
25
25
|
localConfigPath: string;
|
|
26
26
|
} | undefined;
|
|
27
|
+
localLangKey?: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
localConfigPath: string;
|
|
31
|
+
} | undefined;
|
|
27
32
|
})[];
|
|
28
33
|
/** 关闭页面 */
|
|
29
34
|
closePage(assignKey: string): number;
|
|
@@ -44,6 +49,11 @@ export declare class KeepAliveClass {
|
|
|
44
49
|
defaultMessage: string;
|
|
45
50
|
localConfigPath: string;
|
|
46
51
|
} | undefined;
|
|
52
|
+
localLangKey?: {
|
|
53
|
+
id: string;
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
localConfigPath: string;
|
|
56
|
+
} | undefined;
|
|
47
57
|
})[];
|
|
48
58
|
/** 更新当前路由页面 */
|
|
49
59
|
updateCurrentPage(index?: number): void;
|
|
@@ -13,6 +13,11 @@ export declare const useKeepAlivePages: () => (import("react-router-dom").Locati
|
|
|
13
13
|
defaultMessage: string;
|
|
14
14
|
localConfigPath: string;
|
|
15
15
|
} | undefined;
|
|
16
|
+
localLangKey?: {
|
|
17
|
+
id: string;
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
localConfigPath: string;
|
|
20
|
+
} | undefined;
|
|
16
21
|
})[];
|
|
17
22
|
/** 根 */
|
|
18
23
|
export declare const KeepAliveRoot: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -133,14 +133,14 @@ export var TabsLayout = function TabsLayout() {
|
|
|
133
133
|
};
|
|
134
134
|
}()),
|
|
135
135
|
items: pathNameList.map(function (item) {
|
|
136
|
-
var _item$intlMenuConfig;
|
|
136
|
+
var _item$intlMenuConfig, _item$localLangKey;
|
|
137
137
|
// 判断是否当前活跃标签
|
|
138
138
|
var isCurrent = eq(state.activeKey, item.pathname);
|
|
139
139
|
return {
|
|
140
140
|
key: item.pathname,
|
|
141
141
|
label: /*#__PURE__*/_jsx(TabItem, {
|
|
142
|
-
pageTitle: item.pageTitle || /*#__PURE__*/_jsx(FormattedMessage, _objectSpread(_objectSpread({}, item.intlMenuConfig), {}, {
|
|
143
|
-
id: ((_item$intlMenuConfig = item.intlMenuConfig) === null || _item$intlMenuConfig === void 0 ? void 0 : _item$intlMenuConfig.id) || 'menu.unknown'
|
|
142
|
+
pageTitle: item.pageTitle || /*#__PURE__*/_jsx(FormattedMessage, _objectSpread(_objectSpread({}, item.intlMenuConfig || item.localLangKey), {}, {
|
|
143
|
+
id: ((_item$intlMenuConfig = item.intlMenuConfig) === null || _item$intlMenuConfig === void 0 ? void 0 : _item$intlMenuConfig.id) || ((_item$localLangKey = item.localLangKey) === null || _item$localLangKey === void 0 ? void 0 : _item$localLangKey.id) || 'menu.unknown'
|
|
144
144
|
})),
|
|
145
145
|
pathname: item.pathname,
|
|
146
146
|
isCurrent: isCurrent,
|
|
@@ -19,5 +19,11 @@ export declare const useAccessRouter: () => {
|
|
|
19
19
|
defaultMessage: string;
|
|
20
20
|
localConfigPath: string;
|
|
21
21
|
} | undefined;
|
|
22
|
+
/** 兼容历史数据保留的, 只在使用时候会用到 */
|
|
23
|
+
localLangKey?: {
|
|
24
|
+
id: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
localConfigPath: string;
|
|
27
|
+
} | undefined;
|
|
22
28
|
};
|
|
23
29
|
};
|