zmdms-webui 3.1.0 → 3.1.2
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 -2
- package/dist/es/applayoutsider/menu/Logo.js +2 -2
- package/dist/es/applayoutsider/menu/index.js +2 -2
- package/dist/es/config/ZtxkContext.d.ts +4 -0
- package/dist/es/config/ZtxkContext.js +1 -0
- package/dist/es/table/components/EnhanceBodyCell.js +12 -12
- package/dist/es/translationbutton/translationButton.js +24 -18
- package/package.json +1 -1
|
@@ -55,6 +55,8 @@ interface ILayoutSiderProps {
|
|
|
55
55
|
defaultFixed?: boolean;
|
|
56
56
|
/** 只有当主菜单有对应子菜单数据时,点击时才打开子菜单 */
|
|
57
57
|
openOnlyHasSubmenus?: boolean;
|
|
58
|
+
/** 点击logo事件 */
|
|
59
|
+
onLogoClick?: () => void;
|
|
58
60
|
}
|
|
59
61
|
declare const _default: React__default.NamedExoticComponent<ILayoutSiderProps>;
|
|
60
62
|
|
|
@@ -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, openOnlyHasSubmenus = props.openOnlyHasSubmenus, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine, bottomContainer = props.bottomContainer;
|
|
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, bottomContainer = props.bottomContainer, onLogoClick = props.onLogoClick;
|
|
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, openOnlyHasSubmenus: openOnlyHasSubmenus, defaultFixed: defaultFixed, isShowSearchInput: isShowSearchInput, hideSubMenuBg: hideSubMenuBg, menuItemLine: menuItemLine, subMenuItemLine: subMenuItemLine, bottomContainer: bottomContainer }) })) })));
|
|
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, bottomContainer: bottomContainer, onLogoClick: onLogoClick }) })) })));
|
|
78
78
|
};
|
|
79
79
|
AppLayoutSider.displayName = "ZTXK_WEBUI_AppLayoutSider";
|
|
80
80
|
var AppLayoutSider$1 = memo(AppLayoutSider);
|
|
@@ -4,11 +4,11 @@ import { memo } from 'react';
|
|
|
4
4
|
import classNames from '../../node_modules/classnames/index.js';
|
|
5
5
|
|
|
6
6
|
var Logo = function (_a) {
|
|
7
|
-
var logo = _a.logo, showLine = _a.showLine, style = _a.style;
|
|
7
|
+
var logo = _a.logo, showLine = _a.showLine, style = _a.style, onClick = _a.onClick;
|
|
8
8
|
var classes = classNames("zmdms-logo", {
|
|
9
9
|
"zmdms-logo--line": showLine,
|
|
10
10
|
});
|
|
11
|
-
return (jsx("div", __assign({ className: classes }, { children: jsx("img", { src: logo, title: "\u6D59\u6C5F\u4EA4\u901A\u96C6\u56E2", alt: "cico_logo", style: style }) })));
|
|
11
|
+
return (jsx("div", __assign({ className: classes }, { children: jsx("img", { src: logo, title: "\u6D59\u6C5F\u4EA4\u901A\u96C6\u56E2", alt: "cico_logo", style: style, onClick: onClick }) })));
|
|
12
12
|
};
|
|
13
13
|
var Logo$1 = memo(Logo);
|
|
14
14
|
|
|
@@ -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 ? false : _a, openOnlyHasSubmenus = props.openOnlyHasSubmenus, defaultFixed = props.defaultFixed, isShowSearchInput = props.isShowSearchInput, hideSubMenuBg = props.hideSubMenuBg, menuItemLine = props.menuItemLine, subMenuItemLine = props.subMenuItemLine, bottomContainer = props.bottomContainer;
|
|
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, bottomContainer = props.bottomContainer, onLogoClick = props.onLogoClick;
|
|
11
11
|
// 二级菜单是否显示
|
|
12
12
|
var _b = useState(defaultVisible), visible = _b[0], setVisible = _b[1];
|
|
13
13
|
// 二级菜单Ref对象
|
|
@@ -27,7 +27,7 @@ var MenuCom = function (props) {
|
|
|
27
27
|
var _a;
|
|
28
28
|
(_a = subMenu.current) === null || _a === void 0 ? void 0 : _a.setVisible(false);
|
|
29
29
|
}, []);
|
|
30
|
-
return (jsxs("div", __assign({ className: "zmdms-menu", onMouseLeave: onMouseLeave }, { children: [jsx(Logo, { logo: logo, showLine: visible && !hideSubMenuBg, style: logoStyle }), isShowSearchInput && jsx(SearchInput, { setVisible: setVisible }), 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 }), bottomContainer] })));
|
|
30
|
+
return (jsxs("div", __assign({ className: "zmdms-menu", onMouseLeave: onMouseLeave }, { children: [jsx(Logo, { logo: logo, showLine: visible && !hideSubMenuBg, style: logoStyle, onClick: onLogoClick }), isShowSearchInput && jsx(SearchInput, { setVisible: setVisible }), 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 }), bottomContainer] })));
|
|
31
31
|
};
|
|
32
32
|
var Menu = memo(MenuCom);
|
|
33
33
|
|
|
@@ -16,7 +16,7 @@ import { Popover } from 'antd';
|
|
|
16
16
|
var EnhanceCell = function (props) {
|
|
17
17
|
var _a, _b;
|
|
18
18
|
var record = props.record, propsIndex = props.index, editable = props.editable, editableConfig = props.editableConfig, dataIndex = props.dataIndex, title = props.title, onEditableSave = props.onEditableSave, dataSourceRef = props.dataSourceRef; props.onMouseEnter; props.onMouseLeave; var children = props.children, currentPage = props.currentPage, isValidate = props.isValidate, validate = props.validate, isRealTimeValidate = props.isRealTimeValidate, insertTableFromClipboard = props.insertTableFromClipboard, filterConfigRef = props.filterConfigRef, __rowKey = props.__rowKey, resetProps = __rest(props, ["record", "index", "editable", "editableConfig", "dataIndex", "title", "onEditableSave", "dataSourceRef", "onMouseEnter", "onMouseLeave", "children", "currentPage", "isValidate", "validate", "isRealTimeValidate", "insertTableFromClipboard", "filterConfigRef", "__rowKey"]);
|
|
19
|
-
var
|
|
19
|
+
var _c = useBaseContext(), editTableInputMode = _c.editTableInputMode, editTableInputAllowClear = _c.editTableInputAllowClear;
|
|
20
20
|
// 当前单元格的类型
|
|
21
21
|
var tdType = editableConfig === null || editableConfig === void 0 ? void 0 : editableConfig.type;
|
|
22
22
|
// 设置最新的index
|
|
@@ -33,22 +33,22 @@ var EnhanceCell = function (props) {
|
|
|
33
33
|
// 20250114:用下面这种方式取值,如果是配置了scu的话,值就会有问题。
|
|
34
34
|
// const newRecord = record || dataSourceRef?.current?.[index];
|
|
35
35
|
// 当前数据
|
|
36
|
-
var
|
|
36
|
+
var _d = useState(newRecord ? newRecord[dataIndex] : undefined), val = _d[0], setVal = _d[1];
|
|
37
37
|
var iptNumberRef = useRef();
|
|
38
38
|
var isIptNumberBooleanRef = useRef(false);
|
|
39
39
|
// 当前是否是编辑状态 性能优化,显示纯字段比显示一个完整的组件 性能要高出许多
|
|
40
40
|
// 文本域 不需要切换状态
|
|
41
|
-
var
|
|
41
|
+
var _e = useEditing(
|
|
42
42
|
// tdType === "textarea" ? true : false,
|
|
43
|
-
false, tdType === "textarea" ? false : true), editing =
|
|
43
|
+
false, tdType === "textarea" ? false : true), editing = _e.editing, toggleEdit = _e.toggleEdit;
|
|
44
44
|
// 输入框ref对象
|
|
45
45
|
var iptRef = useIptRef(editing);
|
|
46
46
|
// 单元格Ref
|
|
47
|
-
var
|
|
48
|
-
var
|
|
47
|
+
var _f = useTdRef(), tdRef = _f.tdRef, removeErrorClass = _f.removeErrorClass, addErrorClass = _f.addErrorClass;
|
|
48
|
+
var _g = useState({
|
|
49
49
|
open: false,
|
|
50
50
|
message: "",
|
|
51
|
-
}), showPopover =
|
|
51
|
+
}), showPopover = _g[0], setShowPopover = _g[1];
|
|
52
52
|
// 点击时触发验证
|
|
53
53
|
// const [isCurrent, setIsCurrent] = useState<boolean>(false);
|
|
54
54
|
// 20231124 修改逻辑: 点击时不触发 点击只做一个必要条件
|
|
@@ -183,9 +183,9 @@ var EnhanceCell = function (props) {
|
|
|
183
183
|
}); };
|
|
184
184
|
// 如果开启编辑 那么内部直接代理
|
|
185
185
|
if (typeof editable === "function" ? editable(newRecord, index) : editable) {
|
|
186
|
-
var
|
|
186
|
+
var _h = editableConfig || {
|
|
187
187
|
type: "input",
|
|
188
|
-
},
|
|
188
|
+
}, _j = _h.type, type = _j === void 0 ? "input" : _j, max = _h.max, min = _h.min, maxHandle = _h.maxHandle, minHandle = _h.minHandle, disabled = _h.disabled, disabledHandle = _h.disabledHandle; _h.trimType; var resetEditableConfigProps = __rest(_h, ["type", "max", "min", "maxHandle", "minHandle", "disabled", "disabledHandle", "trimType"]);
|
|
189
189
|
var CurrentReactNode = null;
|
|
190
190
|
// 这里将children 替换成val 要显示的值
|
|
191
191
|
// let newChildren: any = children;
|
|
@@ -202,7 +202,7 @@ var EnhanceCell = function (props) {
|
|
|
202
202
|
if (isValidate) {
|
|
203
203
|
removeErrorClass();
|
|
204
204
|
}
|
|
205
|
-
}, onPressEnter: onSave, onBlur: onSave, ref: iptRef, disabled: resultDisabled, onPaste: onPasteHand }, resetEditableConfigProps)));
|
|
205
|
+
}, onPressEnter: onSave, onBlur: onSave, ref: iptRef, disabled: resultDisabled, onPaste: onPasteHand, allowClear: editTableInputAllowClear }, resetEditableConfigProps)));
|
|
206
206
|
}
|
|
207
207
|
// 文本域输入框处理
|
|
208
208
|
if (type === "textarea") {
|
|
@@ -213,7 +213,7 @@ var EnhanceCell = function (props) {
|
|
|
213
213
|
if (isValidate) {
|
|
214
214
|
removeErrorClass();
|
|
215
215
|
}
|
|
216
|
-
}, onPressEnter: onSave, onBlur: onSave, ref: iptRef, disabled: resultDisabled, onPaste: onPasteHand }, resetEditableConfigProps)));
|
|
216
|
+
}, onPressEnter: onSave, onBlur: onSave, ref: iptRef, disabled: resultDisabled, onPaste: onPasteHand, allowClear: editTableInputAllowClear }, resetEditableConfigProps)));
|
|
217
217
|
}
|
|
218
218
|
// 数字输入框处理
|
|
219
219
|
if (type === "inputNumber") {
|
|
@@ -239,7 +239,7 @@ var EnhanceCell = function (props) {
|
|
|
239
239
|
setTimeout(function () {
|
|
240
240
|
onSave();
|
|
241
241
|
});
|
|
242
|
-
}, ref: iptRef, disabled: resultDisabled, onPaste: onPasteHand }, resetEditableConfigProps)));
|
|
242
|
+
}, ref: iptRef, disabled: resultDisabled, onPaste: onPasteHand, allowClear: editTableInputAllowClear }, resetEditableConfigProps)));
|
|
243
243
|
// 显示的时候 展示转换的值
|
|
244
244
|
try {
|
|
245
245
|
if (Array.isArray(newChildren)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo, useState } from 'react';
|
|
4
4
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
@@ -6,7 +6,7 @@ import { usePercent } from './hooks.js';
|
|
|
6
6
|
import '../config/ZtxkContext.js';
|
|
7
7
|
import useBaseContext from '../config/useBaseContext.js';
|
|
8
8
|
import '../config/MyStorage.js';
|
|
9
|
-
import {
|
|
9
|
+
import { useQuery } from '@tanstack/react-query';
|
|
10
10
|
import ButtonCom from '../button/button.js';
|
|
11
11
|
import myMessage from '../message/index.js';
|
|
12
12
|
import { Progress, Dropdown } from 'antd';
|
|
@@ -23,24 +23,30 @@ var TranslationButton = function (props) {
|
|
|
23
23
|
}, [previewUrl, translationPreviewRoute]);
|
|
24
24
|
var _b = useState(), translationTid = _b[0], setTranslationTid = _b[1];
|
|
25
25
|
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
var res = useQuery({
|
|
27
|
+
queryKey: [
|
|
28
|
+
"/api/zmdms-mdm-data/dict-biz/dictionary",
|
|
29
|
+
"zsk_term_library_id",
|
|
30
|
+
],
|
|
31
|
+
queryFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
32
|
+
return __generator(this, function (_a) {
|
|
33
|
+
// 查询函数,用于获取数据的逻辑
|
|
34
|
+
return [2 /*return*/, request({
|
|
35
|
+
url: "/api/zmdms-mdm-data/dict-biz/dictionary",
|
|
36
|
+
method: "GET",
|
|
37
|
+
params: { code: "zsk_term_library_id" },
|
|
38
|
+
})];
|
|
39
|
+
});
|
|
40
|
+
}); },
|
|
41
|
+
staleTime: Infinity, // 数据过期时间
|
|
42
|
+
}).data;
|
|
38
43
|
var libraryMap = useMemo(function () {
|
|
39
|
-
|
|
44
|
+
var _a;
|
|
45
|
+
return (((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) || []).reduce(function (acc, item) {
|
|
40
46
|
acc[item.dictKey] = item.dictValue;
|
|
41
47
|
return acc;
|
|
42
48
|
}, {});
|
|
43
|
-
}, [
|
|
49
|
+
}, [res]);
|
|
44
50
|
// 翻译状态 当没有tid的时候 是 开始状态 start
|
|
45
51
|
// 有tid的时候 调用接口判断是否 是翻译中 然后下载
|
|
46
52
|
var currentTid = useMemo(function () {
|
|
@@ -49,11 +55,11 @@ var TranslationButton = function (props) {
|
|
|
49
55
|
var translationStatus = useMemo(function () {
|
|
50
56
|
return currentTid ? "pending" : "start";
|
|
51
57
|
}, [currentTid]);
|
|
52
|
-
var
|
|
58
|
+
var _d = usePercent({
|
|
53
59
|
currentTid: currentTid,
|
|
54
60
|
tid: tid,
|
|
55
61
|
request: request,
|
|
56
|
-
}), percent =
|
|
62
|
+
}), percent = _d.percent, isTranslating = _d.isTranslating, startTranslate = _d.startTranslate;
|
|
57
63
|
/**
|
|
58
64
|
* @param translationType 翻译转换规则
|
|
59
65
|
*/
|