zmdms-webui 2.2.4 → 2.2.6
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/menu/SearchInput.js +4 -4
- package/dist/es/applayoutsider/menu/SubMenu.js +9 -4
- package/dist/es/applayoutsider/menu/index.js +1 -1
- package/dist/es/formitem/formItem.js +7 -8
- package/dist/es/input/input.js +1 -1
- package/dist/es/inputnumber/inputNumber.js +1 -1
- package/package.json +1 -1
|
@@ -21,13 +21,13 @@ var SearchInput = function () {
|
|
|
21
21
|
subUserMenuArr.forEach(function (item) {
|
|
22
22
|
var copyItem = __assign(__assign({}, item), { selectedKey: key });
|
|
23
23
|
if (Array.isArray(item === null || item === void 0 ? void 0 : item.children)) {
|
|
24
|
-
var result = item === null || item === void 0 ? void 0 : item.children.filter(function (child) {
|
|
25
|
-
return child.name.includes(searchValue);
|
|
26
|
-
});
|
|
24
|
+
var result = item === null || item === void 0 ? void 0 : item.children.filter(function (child) { return child.name && child.name.includes(searchValue); });
|
|
27
25
|
copyItem.children = result.map(function (resultItem) { return (__assign(__assign({}, resultItem), { selectedKey: key })); });
|
|
28
26
|
}
|
|
29
27
|
if ((Array.isArray(copyItem.children) && copyItem.children.length > 0) ||
|
|
30
|
-
(copyItem.name
|
|
28
|
+
(copyItem.name &&
|
|
29
|
+
copyItem.name.includes(searchValue) &&
|
|
30
|
+
copyItem.path !== "/")) {
|
|
31
31
|
newSubUserMenuArr.push(copyItem);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -14,7 +14,7 @@ import { Drawer, Menu } from 'antd';
|
|
|
14
14
|
|
|
15
15
|
var defaultSubMenu = [];
|
|
16
16
|
var SubMenu = function (props, ref) {
|
|
17
|
-
var marginLeft = props.marginLeft, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, visible = props.visible, setVisible = props.setVisible, _a = props.defaultFixed, defaultFixed = _a === void 0 ?
|
|
17
|
+
var marginLeft = props.marginLeft, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, visible = props.visible, setVisible = props.setVisible, _a = props.defaultFixed, defaultFixed = _a === void 0 ? false : _a, hideSubMenuBg = props.hideSubMenuBg, subMenuItemLine = props.subMenuItemLine, openOnlyHasSubmenus = props.openOnlyHasSubmenus;
|
|
18
18
|
var _b = useContext(LayoutMenuContext), mainMenuSelectedKeys = _b.mainMenuSelectedKeys, setMainMenuSelectedKeys = _b.setMainMenuSelectedKeys, activeTab = _b.activeTab, userMenus = _b.userMenus, userSubMenus = _b.userSubMenus, innerUserSubMenus = _b.innerUserSubMenus, drawerTitle = _b.drawerTitle, selectMainMenu = _b.selectMainMenu, getNewPath = _b.getNewPath, renderItem = _b.renderItem;
|
|
19
19
|
// 二级菜单当前选中项
|
|
20
20
|
var subMenusSelectedKeys = useMemo(function () {
|
|
@@ -146,9 +146,14 @@ var SubMenu = function (props, ref) {
|
|
|
146
146
|
// 这里为什么要用newPath 而不是menuItem.id
|
|
147
147
|
// 因为如果要选到叶子节点,是直接拿路由去做匹配
|
|
148
148
|
// 如果这个菜单有子元素,那么这个菜单是不需要跳转的,他的key应该取menuItem.id
|
|
149
|
-
key: newPath
|
|
150
|
-
?
|
|
151
|
-
:
|
|
149
|
+
key: newPath !== "/"
|
|
150
|
+
? newPath
|
|
151
|
+
: ((_a = menuItem.children) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
152
|
+
? menuItem.id
|
|
153
|
+
: newPath,
|
|
154
|
+
// newPath === "/" || menuItem.children?.length > 0
|
|
155
|
+
// ? menuItem.id
|
|
156
|
+
// : newPath,
|
|
152
157
|
// icon: menuItem.source ? (
|
|
153
158
|
// <Icon type={menuItem.source} style={{ fontSize: "18px" }} />
|
|
154
159
|
// ) : null,
|
|
@@ -7,7 +7,7 @@ import MainMenu from './MainMenu.js';
|
|
|
7
7
|
import SubMenu from './SubMenu.js';
|
|
8
8
|
|
|
9
9
|
var MenuCom = function (props) {
|
|
10
|
-
var width = props.width, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, logo = props.logo, logoStyle = props.logoStyle, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, _a = props.defaultVisible, defaultVisible = _a === void 0 ?
|
|
10
|
+
var width = props.width, subMenuWidth = props.subMenuWidth, layoutSiderRef = props.layoutSiderRef, addTab = props.addTab, logo = props.logo, logoStyle = props.logoStyle, getPrefixByAppId = props.getPrefixByAppId, subMenuLogo = props.subMenuLogo, _a = props.defaultVisible, defaultVisible = _a === void 0 ? false : _a, openOnlyHasSubmenus = props.openOnlyHasSubmenus, defaultFixed = props.defaultFixed, isShowSearchInput = props.isShowSearchInput, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine;
|
|
11
11
|
// 二级菜单是否显示
|
|
12
12
|
var _b = useState(defaultVisible), visible = _b[0], setVisible = _b[1];
|
|
13
13
|
// 二级菜单Ref对象
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { __rest, __assign } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
+
import { Form, Col, Tooltip } from 'antd';
|
|
4
5
|
import classNames from '../node_modules/classnames/index.js';
|
|
5
6
|
import '../config/ZtxkContext.js';
|
|
6
7
|
import isEqual from '../config/isEqual.js';
|
|
7
|
-
import MemoForm from '../form/form.js';
|
|
8
8
|
import QuestionCircleOutlined from '../node_modules/@ant-design/icons/es/icons/QuestionCircleOutlined.js';
|
|
9
|
-
import { Col, Tooltip } from 'antd';
|
|
10
9
|
|
|
11
10
|
var hiddenLabelCol = { span: 0 };
|
|
12
11
|
var FormItem = function (props) {
|
|
13
12
|
var children = props.children, isDisplay = props.isDisplay, isRequired = props.isRequired, isChangeable = props.isChangeable, isStress = props.isStress, preNode = props.preNode, nextNode = props.nextNode; props.dynamicDisabled; var hiddenBorder = props.hiddenBorder, singleSelectShowBorder = props.singleSelectShowBorder, singleSelect = props.singleSelect, hiddenLabel = props.hiddenLabel, width = props.width, className = props.className, itemClassName = props.itemClassName, render = props.render, shouldUpdateNames = props.shouldUpdateNames; props.shouldUpdateClear; var dependencies = props.dependencies, shouldUpdate = props.shouldUpdate; props.index; props.outsideState; props.shouldUpdateBeOutsideState; props.nonForm; var isCustomItem = props.isCustomItem, customStyle = props.customStyle, tipString = props.tipString, directionColumn = props.directionColumn, divider = props.divider, resetProps = __rest(props, ["children", "isDisplay", "isRequired", "isChangeable", "isStress", "preNode", "nextNode", "dynamicDisabled", "hiddenBorder", "singleSelectShowBorder", "singleSelect", "hiddenLabel", "width", "className", "itemClassName", "render", "shouldUpdateNames", "shouldUpdateClear", "dependencies", "shouldUpdate", "index", "outsideState", "shouldUpdateBeOutsideState", "nonForm", "isCustomItem", "customStyle", "tipString", "directionColumn", "divider"]);
|
|
14
|
-
var form =
|
|
13
|
+
var form = Form.useFormInstance();
|
|
15
14
|
// 根据配置属性,判断是否渲染表单项
|
|
16
15
|
// 是否显示表单项
|
|
17
16
|
if (isDisplay === false || isDisplay === "0") {
|
|
@@ -74,8 +73,8 @@ var FormItem = function (props) {
|
|
|
74
73
|
resetProps.labelCol = hiddenLabelCol;
|
|
75
74
|
}
|
|
76
75
|
if (dependencies) {
|
|
77
|
-
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(
|
|
78
|
-
return (jsx(
|
|
76
|
+
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({ dependencies: dependencies, noStyle: true }, { children: function (formInstance) {
|
|
77
|
+
return (jsx(Form.Item, __assign({}, resetProps, { className: itemClasses }, { children: render && render(itemProps, formInstance) })));
|
|
79
78
|
} })), nextNode ? nextNode : null] })));
|
|
80
79
|
}
|
|
81
80
|
if (shouldUpdate !== undefined || shouldUpdateNames) {
|
|
@@ -96,7 +95,7 @@ var FormItem = function (props) {
|
|
|
96
95
|
return false;
|
|
97
96
|
}
|
|
98
97
|
: shouldUpdate;
|
|
99
|
-
return (jsx(
|
|
98
|
+
return (jsx(Form.Item, __assign({ shouldUpdate: shouldUpdateHandle, noStyle: true }, { children: function (formInstance) {
|
|
100
99
|
if (typeof isDisplay === "function") {
|
|
101
100
|
var isD = isDisplay(form);
|
|
102
101
|
if (!isD) {
|
|
@@ -118,10 +117,10 @@ var FormItem = function (props) {
|
|
|
118
117
|
itemClasses = itemClasses.replace(" ztxk-form__item--disabled", "");
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
|
-
return resetProps.name ? (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(
|
|
120
|
+
return resetProps.name ? (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({}, resetProps, { className: itemClasses }, { children: render && render(itemProps, formInstance) })), nextNode ? nextNode : null] }))) : (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, render && render(itemProps, formInstance), nextNode ? nextNode : null] })));
|
|
122
121
|
} })));
|
|
123
122
|
}
|
|
124
|
-
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(
|
|
123
|
+
return (jsxs(ItemWrap, __assign({ width: width, className: className, tipString: tipString }, { children: [preNode ? preNode : null, jsx(Form.Item, __assign({}, resetProps, { className: itemClasses }, { children: render ? render(itemProps, form) : children })), nextNode ? nextNode : null] })));
|
|
125
124
|
};
|
|
126
125
|
function getWidthNum(width) {
|
|
127
126
|
if (typeof width === "number") {
|
package/dist/es/input/input.js
CHANGED
|
@@ -14,7 +14,7 @@ var Input = function (props, ref) {
|
|
|
14
14
|
(_a = props.onPressEnter) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
15
15
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch();
|
|
16
16
|
}
|
|
17
|
-
:
|
|
17
|
+
: props.onPressEnter })));
|
|
18
18
|
};
|
|
19
19
|
var MemoInput = memo(forwardRef(Input));
|
|
20
20
|
MemoInput.displayName = "ZTXK_WEBUI_Input";
|
|
@@ -36,7 +36,7 @@ var InputNumber = function (props, ref) {
|
|
|
36
36
|
(_a = props.onPressEnter) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
37
37
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch();
|
|
38
38
|
}
|
|
39
|
-
:
|
|
39
|
+
: props.onPressEnter })));
|
|
40
40
|
};
|
|
41
41
|
InputNumber.displayName = "ZTXK_WEBUI_InputNumber";
|
|
42
42
|
var InputNumber$1 = memo(forwardRef(InputNumber));
|