zmdms-webui 0.0.104 → 0.0.106

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.
@@ -14,6 +14,7 @@ var MainMenu = function (props) {
14
14
  var _b = useMainMenuOpenKeys(userMenus, mainMenuSelectedKeys, { apps: apps, mergeSystemIds: mergeSystemIds, postMergeSystemIds: postMergeSystemIds }), mainMenuOpenKeys = _b.mainMenuOpenKeys, onMainMenuOpenChange = _b.onMainMenuOpenChange;
15
15
  // 创建主菜单标签
16
16
  var getLabel = useCallback(function (menuItem) {
17
+ var _a, _b;
17
18
  // 获取当前菜单的系统id
18
19
  var system = menuItem.system, path = menuItem.path;
19
20
  var prefix = getPrefixByAppId(system);
@@ -29,7 +30,12 @@ var MainMenu = function (props) {
29
30
  ? "/".concat(prefix).concat(path)
30
31
  : path;
31
32
  // 根据type的类型做出不同的处理 这里只是留个入口 暂时没有特别的处理
32
- if (menuItem.type === "index") {
33
+ // 如果是以 _index结尾,说明是首页,路由保留
34
+ // 并且要是顶层 并且之前的路由要是 /
35
+ if (menuItem.type === "index" ||
36
+ (((_b = (_a = menuItem.code) === null || _a === void 0 ? void 0 : _a.endsWith) === null || _b === void 0 ? void 0 : _b.call(_a, "_index")) &&
37
+ menuItem.parentId === menuItem.system &&
38
+ newPath === "/")) {
33
39
  var newPath_1 = prefix ? "/".concat(prefix).concat(path) : path;
34
40
  return (jsx(Link, __assign({ to: newPath_1, onClick: function () {
35
41
  addTab &&
@@ -5,6 +5,7 @@ import { useEditing, useIptRef, useTdRef } from './hooks.js';
5
5
  import { getInnerIndex } from '../useInnerPagination.js';
6
6
  import { getFormatter } from '../../inputnumber/utils.js';
7
7
  import { useLatest } from 'ahooks';
8
+ import classNames from '../../node_modules/classnames/index.js';
8
9
  import MemoInput from '../../input/input.js';
9
10
  import InputNumber from '../../inputnumber/inputNumber.js';
10
11
  import { Popover } from 'antd';
@@ -124,6 +125,16 @@ var EnhanceCell = function (props) {
124
125
  }
125
126
  }, onPressEnter: onSave, onBlur: onSave, ref: iptRef, disabled: resultDisabled }, resetEditableConfigProps)));
126
127
  }
128
+ // 文本域输入框处理
129
+ if (type === "textarea") {
130
+ CurrentReactNode = (jsx(MemoInput.TextArea, __assign({ value: val, onChange: function (e) {
131
+ var resultValue = e.target.value;
132
+ setVal(resultValue);
133
+ if (isValidate) {
134
+ removeErrorClass();
135
+ }
136
+ }, onPressEnter: onSave, onBlur: onSave, ref: iptRef, disabled: resultDisabled }, resetEditableConfigProps)));
137
+ }
127
138
  // 数字输入框处理
128
139
  if (type === "inputNumber") {
129
140
  var resultMax_1 = maxHandle ? maxHandle(newRecord) : max;
@@ -155,7 +166,13 @@ var EnhanceCell = function (props) {
155
166
  console.error(err);
156
167
  }
157
168
  }
158
- return (jsx("td", __assign({ ref: tdRef }, resetProps, { children: editing ? (jsx("div", __assign({ className: "ztxk-table__enhance-cell" }, { children: jsx(Popover, __assign({ trigger: "click", content: showPopover.message, open: showPopover.open, overlayClassName: "error-popover" }, { children: CurrentReactNode })) }))) : (jsx("div", __assign({ className: "ztxk-table__enhance-cell-wrap ".concat(resultDisabled ? "ztxk-table__enhance-cell-wrap--disabled" : ""), onClick: resultDisabled
169
+ return (jsx("td", __assign({ ref: tdRef }, resetProps, { children: editing ? (jsx("div", __assign({ className: "ztxk-table__enhance-cell" }, { children: jsx(Popover, __assign({ trigger: "click", content: showPopover.message, open: showPopover.open, overlayClassName: "error-popover" }, { children: CurrentReactNode })) }))) : (jsx("div", __assign({ className: classNames("ztxk-table__enhance-cell-wrap", {
170
+ "ztxk-table__enhance-cell-wrap--disabled": resultDisabled,
171
+ }), style: {
172
+ lineHeight: resetEditableConfigProps.rows
173
+ ? "".concat(26 * resetEditableConfigProps.rows, "px")
174
+ : "30px",
175
+ }, title: val, onClick: resultDisabled
159
176
  ? undefined
160
177
  : function () {
161
178
  setIsCurrent(true);
@@ -1,15 +1,16 @@
1
1
  import { Table } from 'antd';
2
2
  import { TableProps, TablePaginationConfig, ColumnType } from 'antd/lib/table';
3
+ import { TextAreaProps } from 'antd/es/input/TextArea';
3
4
  import { IInputProps } from '../input/input.js';
4
5
  import { IInputNumberProps } from '../inputnumber/inputNumber.js';
5
6
  import _default from './components/TitleDirectionColumn.js';
6
7
 
7
- type IEditableConfigOtherProps = IInputProps & IInputNumberProps;
8
+ type IEditableConfigOtherProps = IInputProps & IInputNumberProps & TextAreaProps;
8
9
  interface IEditableConfig extends Partial<IEditableConfigOtherProps> {
9
10
  /**
10
11
  * 列编辑类型
11
12
  */
12
- type: "input" | "inputNumber";
13
+ type: "input" | "inputNumber" | "textarea";
13
14
  /**
14
15
  * 最大值函数
15
16
  */