zmdms-webui 1.6.5 → 1.6.7

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.
@@ -49,6 +49,8 @@ interface ILayoutSiderProps {
49
49
  renderItem?: (path: string, menu: any, onClick: any) => React__default.ReactNode | false;
50
50
  defaultVisible?: boolean;
51
51
  defaultFixed?: boolean;
52
+ /** 只有当主菜单有对应子菜单数据时,点击时才打开子菜单 */
53
+ openOnlyHasSubmenus?: boolean;
52
54
  }
53
55
  declare const _default: React__default.NamedExoticComponent<ILayoutSiderProps>;
54
56
 
@@ -16,7 +16,7 @@ var AppLayoutSider = function (props) {
16
16
  // 118 宽度改成 134宽度
17
17
  _b = props.siderWidth,
18
18
  // 118 宽度改成 134宽度
19
- siderWidth = _b === void 0 ? 134 : _b, _c = props.subMenuWidth, subMenuWidth = _c === void 0 ? 162 : _c, addTab = props.addTab, siderBg = props.siderBg, logo = props.logo, logoStyle = props.logoStyle, subMenuLogo = props.subMenuLogo, _d = props.isShowSearchInput, isShowSearchInput = _d === void 0 ? true : _d, apps = props.apps, activeTab = props.activeTab, userMenus = props.userMenus, userSubMenus = props.userSubMenus, mergeSystemIds = props.mergeSystemIds, postMergeSystemIds = props.postMergeSystemIds, drawerTitle = props.drawerTitle, selectMainMenu = props.selectMainMenu, menuJoinRule = props.menuJoinRule, renderItem = props.renderItem, defaultVisible = props.defaultVisible, defaultFixed = props.defaultFixed, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine;
19
+ siderWidth = _b === void 0 ? 134 : _b, _c = props.subMenuWidth, subMenuWidth = _c === void 0 ? 162 : _c, addTab = props.addTab, siderBg = props.siderBg, logo = props.logo, logoStyle = props.logoStyle, subMenuLogo = props.subMenuLogo, _d = props.isShowSearchInput, isShowSearchInput = _d === void 0 ? true : _d, apps = props.apps, activeTab = props.activeTab, userMenus = props.userMenus, userSubMenus = props.userSubMenus, mergeSystemIds = props.mergeSystemIds, postMergeSystemIds = props.postMergeSystemIds, drawerTitle = props.drawerTitle, selectMainMenu = props.selectMainMenu, menuJoinRule = props.menuJoinRule, renderItem = props.renderItem, defaultVisible = props.defaultVisible, defaultFixed = props.defaultFixed, openOnlyHasSubmenus = props.openOnlyHasSubmenus, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine;
20
20
  // 当前选中的主菜单item
21
21
  var _e = useState([]), mainMenuSelectedKeys = _e[0], setMainMenuSelectedKeys = _e[1];
22
22
  // 内部二级菜单管理
@@ -74,7 +74,7 @@ var AppLayoutSider = function (props) {
74
74
  menuJoinRule: menuJoinRule,
75
75
  getNewPath: getNewPath,
76
76
  renderItem: renderItem,
77
- } }, { children: jsx(Menu, { width: siderWidth, subMenuWidth: subMenuWidth, layoutSiderRef: layoutSiderRef, addTab: addTab, logo: logo, logoStyle: logoStyle, subMenuLogo: subMenuLogo, getPrefixByAppId: getPrefixByAppId, defaultVisible: defaultVisible, defaultFixed: defaultFixed, isShowSearchInput: isShowSearchInput, hideSubMenuBg: hideSubMenuBg, menuItemLine: menuItemLine, subMenuItemLine: subMenuItemLine }) })) })));
77
+ } }, { children: jsx(Menu, { width: siderWidth, subMenuWidth: subMenuWidth, layoutSiderRef: layoutSiderRef, addTab: addTab, logo: logo, logoStyle: logoStyle, subMenuLogo: subMenuLogo, getPrefixByAppId: getPrefixByAppId, defaultVisible: defaultVisible, openOnlyHasSubmenus: openOnlyHasSubmenus, defaultFixed: defaultFixed, isShowSearchInput: isShowSearchInput, hideSubMenuBg: hideSubMenuBg, menuItemLine: menuItemLine, subMenuItemLine: subMenuItemLine }) })) })));
78
78
  };
79
79
  AppLayoutSider.displayName = "ZTXK_WEBUI_AppLayoutSider";
80
80
  var AppLayoutSider$1 = memo(AppLayoutSider);
@@ -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 ? true : _a, hideSubMenuBg = props.hideSubMenuBg, subMenuItemLine = props.subMenuItemLine;
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 ? true : _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 () {
@@ -73,6 +73,7 @@ var SubMenu = function (props, ref) {
73
73
  }, [layoutSiderRef, subMenuWidth]);
74
74
  // 底部按钮
75
75
  var footerDom = (jsxs(ButtonCom, __assign({ type: "link", onClick: onToggleSubMenuFixed }, { children: [jsx(SwapOutlined, { style: { fontSize: "14px", color: hideSubMenuBg ? "#4285f4" : "#fff" } }), isFixed ? "浮动" : "固定"] })));
76
+ var hasMenuData = useRef(false);
76
77
  useImperativeHandle(ref, function () {
77
78
  return {
78
79
  setVisible: function (visible) {
@@ -84,10 +85,21 @@ var SubMenu = function (props, ref) {
84
85
  if (keys && keys.length > 0) {
85
86
  var r = userSubMenus[keys[0]];
86
87
  if (Array.isArray(r)) {
88
+ hasMenuData.current = true;
89
+ if (!visible) {
90
+ setVisible(true);
91
+ }
87
92
  onSubMenuOpenChange(r.map(function (i) { return i.id; }));
88
93
  }
94
+ else {
95
+ hasMenuData.current = false;
96
+ openOnlyHasSubmenus && setVisible(false);
97
+ }
89
98
  }
90
99
  },
100
+ hasMenuData: function () {
101
+ return hasMenuData.current;
102
+ },
91
103
  };
92
104
  });
93
105
  var items = useMemo(function () {
@@ -7,22 +7,27 @@ 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 ? true : _a, defaultFixed = props.defaultFixed, isShowSearchInput = props.isShowSearchInput, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine;
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 ? true : _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对象
14
14
  var subMenu = useRef({});
15
15
  // 一级菜单mouseEnter事件
16
16
  var onMouseEnter = useCallback(function () {
17
- var _a;
18
- (_a = subMenu.current) === null || _a === void 0 ? void 0 : _a.setVisible(true);
19
- }, []);
17
+ var _a, _b;
18
+ if (openOnlyHasSubmenus) {
19
+ if (!((_a = subMenu.current) === null || _a === void 0 ? void 0 : _a.hasMenuData())) {
20
+ return;
21
+ }
22
+ }
23
+ (_b = subMenu.current) === null || _b === void 0 ? void 0 : _b.setVisible(true);
24
+ }, [openOnlyHasSubmenus]);
20
25
  // 主容器mouseLeave事件
21
26
  var onMouseLeave = useCallback(function () {
22
27
  var _a;
23
28
  (_a = subMenu.current) === null || _a === void 0 ? void 0 : _a.setVisible(false);
24
29
  }, []);
25
- return (jsxs("div", __assign({ className: "zmdms-menu", onMouseLeave: onMouseLeave }, { children: [jsx(Logo, { logo: logo, showLine: visible && !hideSubMenuBg, style: logoStyle }), isShowSearchInput && jsx(SearchInput, {}), jsx(MainMenu, { onMouseEnter: onMouseEnter, addTab: addTab, getPrefixByAppId: getPrefixByAppId, subMenu: subMenu, hideSubMenuBg: hideSubMenuBg, menuItemLine: menuItemLine }), jsx(SubMenu, { ref: subMenu, marginLeft: width, subMenuWidth: subMenuWidth, layoutSiderRef: layoutSiderRef, addTab: addTab, getPrefixByAppId: getPrefixByAppId, subMenuLogo: subMenuLogo, visible: visible, setVisible: setVisible, defaultFixed: defaultFixed, hideSubMenuBg: hideSubMenuBg, subMenuItemLine: subMenuItemLine })] })));
30
+ return (jsxs("div", __assign({ className: "zmdms-menu", onMouseLeave: onMouseLeave }, { children: [jsx(Logo, { logo: logo, showLine: visible && !hideSubMenuBg, style: logoStyle }), isShowSearchInput && jsx(SearchInput, {}), jsx(MainMenu, { onMouseEnter: onMouseEnter, addTab: addTab, getPrefixByAppId: getPrefixByAppId, subMenu: subMenu, hideSubMenuBg: hideSubMenuBg, menuItemLine: menuItemLine }), jsx(SubMenu, { ref: subMenu, marginLeft: width, subMenuWidth: subMenuWidth, layoutSiderRef: layoutSiderRef, addTab: addTab, getPrefixByAppId: getPrefixByAppId, subMenuLogo: subMenuLogo, visible: visible, setVisible: setVisible, defaultFixed: defaultFixed, hideSubMenuBg: hideSubMenuBg, subMenuItemLine: subMenuItemLine, openOnlyHasSubmenus: openOnlyHasSubmenus })] })));
26
31
  };
27
32
  var Menu = memo(MenuCom);
28
33
 
@@ -45,6 +45,7 @@ var ElectronSignaturesFragment = function (props) {
45
45
  records: records,
46
46
  canEdit: canEdit,
47
47
  }), electronList = _e.electronList, firstLevelPersonName = _e.firstLevelPersonName;
48
+ console.log("deptId", deptId);
48
49
  // 群杰物理章列表相关数据
49
50
  var qunjList = useFetchQunjData({
50
51
  request: request,
@@ -794,7 +794,7 @@ var ElectronSignatures = function (props) {
794
794
  return (jsxs(Fragment, { children: [allOptions.map(function (options, index) {
795
795
  var mergeOptions = index === 0
796
796
  ? __assign(__assign({}, options), { onValueChange: onValueChange }) : __assign(__assign({ deptId: resetProps.deptId, flowId: resetProps.flowId }, options), { onValueChange: onValueChange });
797
- return (jsx(ElectronSignaturesFragment, __assign({ dataType: "".concat(index), onTrackChange: onTrackChange, request: request, isUnControlled: isUnControlled, setLoading: setLoading, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, isSingleQj: isSingleQj }, mergeOptions), index));
797
+ return (jsx(ElectronSignaturesFragment, __assign({ dataType: "".concat(index), onTrackChange: onTrackChange, request: request, isUnControlled: isUnControlled, setLoading: setLoading, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, isSingleQj: isSingleQj }, mergeOptions, { deptId: resetProps.deptId }), index));
798
798
  }), jsxs(ElectronSealBatchDownload, __assign({ request: request, apiBaseUrl: apiBaseUrl, selectRows: selectRows, allData: allData, isShowElectronBatchBtn: isShowElectronBatchBtn, isShowDownloadBatchBtn: isShowDownloadBatchBtn, isShowDoubleSignedBatchBtn: isShowDoubleSignedBatchBtn, batchDownloadZipName: batchDownloadZipName, firstDataType: firstDataType }, { children: [isShowBatchDeleteBtn ? (jsx(Button, __assign({ type: "primary", onClick: onBatchDeleteHandle, style: { marginRight: "10px" } }, { children: "\u6279\u91CF\u5220\u9664" }))) : null, isShowFileUpload && currentIsEditMemo ? (jsx(FileUpload, __assign({ fileList: sameTypeRecords, apiBaseUrl: apiBaseUrl, onFileChange: onFileChange, multiple: true }, fileUploadProps, { children: "\u6DFB\u52A0\u9644\u4EF6" }))) : null] })), jsx(Table, { dataSource: mergeRecords, columns: columns, rowKey: function (record) { return record.id || record.attachId; }, className: "ztxk-table electron-table", bordered: true, pagination: false, loading: loading, rowSelection: myRowSelection, scroll: __assign({ x: "max-content", y: 500 }, tableScroll) }), jsx(LastQysModal, { modalHandleRef: modalHandleRef, appointSignLocation: function (info) {
799
799
  // 未盖章的印章id列表
800
800
  var needReSealList = info.needReSealList;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-webui",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "private": false,
5
5
  "main": "dist/index.es.js",
6
6
  "module": "dist/index.es.js",