zmdms-webui 0.0.58 → 0.0.59
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/es/applayoutsider/appLayoutSider.d.ts +2 -0
- package/dist/es/applayoutsider/appLayoutSider.js +2 -1
- package/dist/es/applayoutsider/menu/SubMenu.js +8 -4
- package/dist/es/icon/index.js +1 -1
- package/dist/es/node_modules/@ant-design/icons/es/icons/SwapOutlined.js +15 -0
- package/dist/es/node_modules/@ant-design/icons-svg/es/asn/SwapOutlined.js +5 -0
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/package.json +1 -1
|
@@ -20,6 +20,8 @@ interface ILayoutSiderProps {
|
|
|
20
20
|
mergeSystemIds?: number[][];
|
|
21
21
|
/** 合并的系统id对应合并后的系统id ['hr', 'xx'] */
|
|
22
22
|
postMergeSystemIds?: (string | number)[];
|
|
23
|
+
/** 二级菜单头部内容 */
|
|
24
|
+
drawerTitle?: React__default.ReactNode;
|
|
23
25
|
}
|
|
24
26
|
declare const _default: React__default.NamedExoticComponent<ILayoutSiderProps>;
|
|
25
27
|
|
|
@@ -10,7 +10,7 @@ import { Layout } from 'antd';
|
|
|
10
10
|
*/
|
|
11
11
|
var AppLayoutSider = function (props) {
|
|
12
12
|
// console.log("layout-sider- rerender");
|
|
13
|
-
var _a = props.siderWidth, siderWidth = _a === void 0 ? 118 : _a, _b = props.subMenuWidth, subMenuWidth = _b === void 0 ? 162 : _b, addTab = props.addTab, siderBg = props.siderBg, logo = props.logo, apps = props.apps, activeTab = props.activeTab, userMenus = props.userMenus, userSubMenus = props.userSubMenus, mergeSystemIds = props.mergeSystemIds, postMergeSystemIds = props.postMergeSystemIds;
|
|
13
|
+
var _a = props.siderWidth, siderWidth = _a === void 0 ? 118 : _a, _b = props.subMenuWidth, subMenuWidth = _b === void 0 ? 162 : _b, addTab = props.addTab, siderBg = props.siderBg, logo = props.logo, apps = props.apps, activeTab = props.activeTab, userMenus = props.userMenus, userSubMenus = props.userSubMenus, mergeSystemIds = props.mergeSystemIds, postMergeSystemIds = props.postMergeSystemIds, drawerTitle = props.drawerTitle;
|
|
14
14
|
// 当前选中的主菜单item
|
|
15
15
|
var _c = useState([]), mainMenuSelectedKeys = _c[0], setMainMenuSelectedKeys = _c[1];
|
|
16
16
|
var layoutSiderRef = useRef();
|
|
@@ -35,6 +35,7 @@ var AppLayoutSider = function (props) {
|
|
|
35
35
|
userSubMenus: userSubMenus,
|
|
36
36
|
mergeSystemIds: mergeSystemIds,
|
|
37
37
|
postMergeSystemIds: postMergeSystemIds,
|
|
38
|
+
drawerTitle: drawerTitle,
|
|
38
39
|
} }, { children: jsx(Menu, { width: siderWidth, subMenuWidth: subMenuWidth, layoutSiderRef: layoutSiderRef, addTab: addTab, logo: logo, getPrefixByAppId: getPrefixByAppId }) })) })));
|
|
39
40
|
};
|
|
40
41
|
AppLayoutSider.displayName = "ZTXK_WEBUI_AppLayoutSider";
|
|
@@ -4,14 +4,15 @@ import { memo, forwardRef, useContext, useMemo, useState, useCallback, useImpera
|
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
5
5
|
import { useSubMenuOpenKeys } from './hook.js';
|
|
6
6
|
import { LayoutMenuContext } from '../LayoutSiderContext.js';
|
|
7
|
+
import classNames from '../../node_modules/classnames/index.js';
|
|
7
8
|
import ButtonCom from '../../button/button.js';
|
|
8
|
-
import
|
|
9
|
+
import SwapOutlined from '../../node_modules/@ant-design/icons/es/icons/SwapOutlined.js';
|
|
9
10
|
import { Drawer, Menu } from 'antd';
|
|
10
11
|
|
|
11
12
|
var defaultSubMenu = [];
|
|
12
13
|
var SubMenu = function (props, ref) {
|
|
13
14
|
var marginLeft = props.marginLeft, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, getPrefixByAppId = props.getPrefixByAppId;
|
|
14
|
-
var _a = useContext(LayoutMenuContext), mainMenuSelectedKeys = _a.mainMenuSelectedKeys, setMainMenuSelectedKeys = _a.setMainMenuSelectedKeys, activeTab = _a.activeTab, userSubMenus = _a.userSubMenus;
|
|
15
|
+
var _a = useContext(LayoutMenuContext), mainMenuSelectedKeys = _a.mainMenuSelectedKeys, setMainMenuSelectedKeys = _a.setMainMenuSelectedKeys, activeTab = _a.activeTab, userSubMenus = _a.userSubMenus, drawerTitle = _a.drawerTitle;
|
|
15
16
|
// 二级菜单当前选中项
|
|
16
17
|
var subMenusSelectedKeys = useMemo(function () {
|
|
17
18
|
return activeTab ? [activeTab] : [];
|
|
@@ -41,7 +42,7 @@ var SubMenu = function (props, ref) {
|
|
|
41
42
|
});
|
|
42
43
|
}, [layoutSiderRef, subMenuWidth]);
|
|
43
44
|
// 底部按钮
|
|
44
|
-
var footerDom = (jsxs(ButtonCom, __assign({ type: "link", onClick: onToggleSubMenuFixed }, { children: [jsx(
|
|
45
|
+
var footerDom = (jsxs(ButtonCom, __assign({ type: "link", onClick: onToggleSubMenuFixed }, { children: [jsx(SwapOutlined, { style: { fontSize: "14px", color: "#fff" } }), isFixed ? "浮动" : "固定"] })));
|
|
45
46
|
useImperativeHandle(ref, function () {
|
|
46
47
|
return {
|
|
47
48
|
setVisible: function (visible) {
|
|
@@ -94,7 +95,10 @@ var SubMenu = function (props, ref) {
|
|
|
94
95
|
var newSubMenusItems = dfn(subMenus);
|
|
95
96
|
return newSubMenusItems;
|
|
96
97
|
}, [subMenus, addTab, getPrefixByAppId]);
|
|
97
|
-
|
|
98
|
+
var classes = classNames("zmdms-menu--sub", {
|
|
99
|
+
"zmdms-menu--sub-margin": !drawerTitle,
|
|
100
|
+
});
|
|
101
|
+
return (jsx(Drawer, __assign({ mask: false, placement: "left", width: subMenuWidth, zIndex: 99, closable: false, open: visible, className: classes, style: { marginLeft: marginLeft }, footer: footerDom, getContainer: false, title: drawerTitle }, { children: jsx(Menu, { inlineIndent: 10, selectedKeys: subMenusSelectedKeys, mode: "inline", items: items, openKeys: subMenuOpenKeys, onOpenChange: onSubMenuOpenChange }) })));
|
|
98
102
|
};
|
|
99
103
|
var SubMenu$1 = memo(forwardRef(SubMenu));
|
|
100
104
|
|
package/dist/es/icon/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import create from '../node_modules/@ant-design/icons/es/components/IconFont.js';
|
|
2
2
|
|
|
3
3
|
var IconFont = create({
|
|
4
|
-
scriptUrl: ["//at.alicdn.com/t/c/
|
|
4
|
+
scriptUrl: ["//at.alicdn.com/t/c/font_4078313_gq6ahwyi6ju.js"],
|
|
5
5
|
});
|
|
6
6
|
|
|
7
7
|
export { IconFont as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _objectSpread2 from '../../../../@babel/runtime/helpers/esm/objectSpread2.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import SwapOutlinedSvg from '../../../icons-svg/es/asn/SwapOutlined.js';
|
|
4
|
+
import AntdIcon from '../components/AntdIcon.js';
|
|
5
|
+
|
|
6
|
+
var SwapOutlined = function SwapOutlined(props, ref) {
|
|
7
|
+
return /*#__PURE__*/React.createElement(AntdIcon, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
8
|
+
ref: ref,
|
|
9
|
+
icon: SwapOutlinedSvg
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
SwapOutlined.displayName = 'SwapOutlined';
|
|
13
|
+
var SwapOutlined$1 = /*#__PURE__*/React.forwardRef(SwapOutlined);
|
|
14
|
+
|
|
15
|
+
export { SwapOutlined$1 as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This icon file is generated automatically.
|
|
2
|
+
var SwapOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "swap", "theme": "outlined" };
|
|
3
|
+
var SwapOutlinedSvg = SwapOutlined;
|
|
4
|
+
|
|
5
|
+
export { SwapOutlinedSvg as default };
|