zmdms-webui 0.0.106 → 0.0.108

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.
@@ -1,4 +1,5 @@
1
1
  import { useState, useEffect, useRef } from 'react';
2
+ import isEqual from 'lodash/isEqual';
2
3
 
3
4
  // 需要打开的主菜单
4
5
  function useMainMenuOpenKeys(userMenus, mainMenuSelectedKeys, options) {
@@ -100,10 +101,23 @@ function useSubMenuOpenKeys(userSubMenus, activeTab, options) {
100
101
  if (!activeTab) {
101
102
  return;
102
103
  }
104
+ // 专门为那种主菜单带路由跳转的逻辑处理
103
105
  if (selectMainMenu) {
104
- var mainMainId = selectMainMenu(activeTab);
105
- if (mainMainId) {
106
- setMainMenuSelectedKeys && setMainMenuSelectedKeys([mainMainId]);
106
+ var mainMainId_1 = selectMainMenu(activeTab);
107
+ if (mainMainId_1) {
108
+ setMainMenuSelectedKeys &&
109
+ setMainMenuSelectedKeys(function (preMainMainIds) {
110
+ if (isEqual(preMainMainIds, [mainMainId_1])) {
111
+ return preMainMainIds;
112
+ }
113
+ return [mainMainId_1];
114
+ });
115
+ // 展开下面的菜单 如果有菜单的话
116
+ if (userSubMenus &&
117
+ Array.isArray(userSubMenus[mainMainId_1]) &&
118
+ userSubMenus[mainMainId_1].length > 0) {
119
+ setOpenKeys(userSubMenus[mainMainId_1].map(function (i) { return i.id; }));
120
+ }
107
121
  return;
108
122
  }
109
123
  }
@@ -169,7 +169,7 @@ function useColumns(columns, options) {
169
169
  if (isAdd || isDel) {
170
170
  var newColumn = {
171
171
  title: function () {
172
- return isDelAll ? jsx(ColumnDelAll, { onAddAndDel: onAddAndDel }) : null;
172
+ return isDelAll && isDel ? jsx(ColumnDelAll, { onAddAndDel: onAddAndDel }) : null;
173
173
  },
174
174
  width: 52,
175
175
  fixed: "left",
@@ -185,7 +185,7 @@ function useColumns(columns, options) {
185
185
  // 处理一些配置放置的位置
186
186
  if (dynamicKey && !hiddenDynamicIcon) {
187
187
  myNewColumns[0].title = function () {
188
- return isAdd || isDel ? (jsxs(Fragment, { children: [isDelAll ? jsx(ColumnDelAll, { onAddAndDel: onAddAndDel }) : null, jsx(ColumnDynamic, { dynamicSettingRef: dynamicSettingRef })] })) : (jsx(ColumnDynamic, { dynamicSettingRef: dynamicSettingRef }));
188
+ return isAdd || isDel ? (jsxs(Fragment, { children: [isDelAll && isDel ? (jsx(ColumnDelAll, { onAddAndDel: onAddAndDel })) : null, jsx(ColumnDynamic, { dynamicSettingRef: dynamicSettingRef })] })) : (jsx(ColumnDynamic, { dynamicSettingRef: dynamicSettingRef }));
189
189
  };
190
190
  }
191
191
  }
@@ -33,6 +33,7 @@ var UploadList = function (props, ref) {
33
33
  var maxSizeStr = formatUnit(maxSize);
34
34
  var tableRef = useRef({});
35
35
  var modalRef = useRef({});
36
+ var imgCropModalRef = useRef();
36
37
  var _e = useState(), imgSrc = _e[0], setImgSrc = _e[1];
37
38
  var _f = useBaseContext(), apiBaseUrl = _f.apiBaseUrl, fileBaseUrl = _f.fileBaseUrl;
38
39
  var API_BASEURL = PROPS_API_BASEURL ? PROPS_API_BASEURL : apiBaseUrl;
@@ -236,7 +237,7 @@ var UploadList = function (props, ref) {
236
237
  },
237
238
  };
238
239
  });
239
- return (jsxs("div", __assign({ className: classes }, { children: [isPreview ? null : (jsxs(Fragment, { children: [isImage ? (jsx(ImgCrop, __assign({ rotationSlider: true, showReset: true, quality: 0.8, modalClassName: "ztxk-upload-imgcrop" }, { children: renderChildren }))) : (renderChildren), showTip ? (jsxs("span", __assign({ className: "ztxk-upload--tips" }, { children: ["(\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301", maxSizeStr, ")"] }))) : ("")] })), isDelete && !isPreview && listType !== "text" ? (jsx(Popconfirm, __assign({ title: "\u662F\u5426\u5220\u9664\u9009\u4E2D\u9644\u4EF6\uFF1F", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onBatchDeleteHandle(); } }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u5220\u9664" })) }))) : null, isDownload && listType !== "text" ? (jsx(Dropdown, __assign({ menu: {
240
+ return (jsxs("div", __assign({ className: classes, ref: imgCropModalRef }, { children: [isPreview ? null : (jsxs(Fragment, { children: [isImage ? (jsx(ImgCrop, __assign({ rotationSlider: true, showReset: true, quality: 0.8, modalClassName: "ztxk-upload-imgcrop", modalProps: { getContainer: function () { return imgCropModalRef.current; } } }, { children: renderChildren }))) : (renderChildren), showTip ? (jsxs("span", __assign({ className: "ztxk-upload--tips" }, { children: ["(\u5355\u4E2A\u9644\u4EF6\u6700\u5927\u652F\u6301", maxSizeStr, ")"] }))) : ("")] })), isDelete && !isPreview && listType !== "text" ? (jsx(Popconfirm, __assign({ title: "\u662F\u5426\u5220\u9664\u9009\u4E2D\u9644\u4EF6\uFF1F", cancelText: "\u5426", okText: "\u662F", onConfirm: function () { return onBatchDeleteHandle(); } }, { children: jsx(ButtonCom, __assign({ type: "primary" }, { children: "\u6279\u91CF\u5220\u9664" })) }))) : null, isDownload && listType !== "text" ? (jsx(Dropdown, __assign({ menu: {
240
241
  items: [
241
242
  {
242
243
  label: "压缩",