@zat-design/sisyphus-react 4.5.9 → 4.5.10-beta.1
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/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProAction/components/CheckModalContent/index.js +2 -2
- package/es/ProDownload/index.d.ts +2 -1
- package/es/ProDownload/index.js +31 -16
- package/es/ProDownload/utils.d.ts +10 -5
- package/es/ProDownload/utils.js +7 -5
- package/es/ProEditTable/utils/index.js +6 -1
- package/es/ProEnum/hooks/useEnumRequest.js +98 -77
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +1 -0
- package/es/ProForm/components/combination/FormList/components/Empty.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +3 -3
- package/es/ProForm/components/combination/FormList/style/index.less +6 -0
- package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +5 -11
- package/es/ProForm/components/combination/Group/hooks/index.js +1 -1
- package/es/ProForm/components/combination/Group/index.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +22 -8
- package/es/ProForm/components/combination/ProModalSelect/index.js +32 -12
- package/es/ProForm/components/combination/ProRangeLimit/index.js +1 -1
- package/es/ProForm/components/render/Render.js +2 -2
- package/es/ProForm/hooks/useWatch.js +7 -8
- package/es/ProForm/utils/index.js +2 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +8 -8
- package/es/ProLayout/components/Layout/Menu/index.js +1 -1
- package/es/ProLayout/components/ProFooter/index.js +2 -1
- package/es/ProLayout/components/ProHeader/components/Describe/index.js +3 -1
- package/es/ProLayout/components/TabsManager/components/TabItem.js +6 -5
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +104 -16
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.d.ts +19 -0
- package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +295 -0
- package/es/ProLayout/components/TabsManager/index.js +54 -14
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +4 -0
- package/es/ProLayout/components/TabsManager/style/index.less +1 -1
- package/es/ProLayout/components/TabsManager/utils/historyObserver.d.ts +7 -0
- package/es/ProLayout/components/TabsManager/utils/historyObserver.js +62 -0
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +15 -2
- package/es/ProLayout/components/TabsManager/utils/index.js +63 -9
- package/es/ProLayout/index.js +6 -3
- package/es/ProLayout/propTypes.d.ts +28 -1
- package/es/ProSelect/index.js +10 -1
- package/es/ProSelect/style/index.less +13 -0
- package/es/ProStep/style/index.less +1 -1
- package/es/ProTable/hooks/useAntdTable.js +11 -10
- package/es/ProTabs/index.js +3 -3
- package/es/ProTooltip/index.js +2 -5
- package/es/ProTree/components/ProTreeSelect/index.js +2 -2
- package/es/ProTreeModal/index.js +0 -3
- package/es/ProUpload/components/DragRender.js +0 -14
- package/package.json +2 -1
- package/es/ProConfigProvider/demo/locale.js +0 -58
|
@@ -6,12 +6,54 @@ export const getMenuRoute = menuItem => {
|
|
|
6
6
|
return menuItem.redirectUrl || menuItem.url || '';
|
|
7
7
|
};
|
|
8
8
|
export const hasRelationKey = relationKey => relationKey !== undefined && relationKey !== null && relationKey !== '';
|
|
9
|
-
|
|
9
|
+
const resolveHttpUrl = value => {
|
|
10
|
+
if (!value || typeof window === 'undefined') return undefined;
|
|
11
|
+
try {
|
|
12
|
+
const resolved = new URL(value, window.location.origin);
|
|
13
|
+
return resolved.protocol === 'http:' || resolved.protocol === 'https:' ? resolved : undefined;
|
|
14
|
+
} catch (_error) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 将同源 URL 规范化为应用内地址,保留 search 和 hash。
|
|
21
|
+
* 返回 undefined 表示 URL 无效或跨域。
|
|
22
|
+
*/
|
|
23
|
+
export const normalizeTabUrl = value => {
|
|
24
|
+
if (!value) return undefined;
|
|
25
|
+
if (typeof window === 'undefined') {
|
|
26
|
+
return value.startsWith('/') && !value.startsWith('//') ? value : undefined;
|
|
27
|
+
}
|
|
28
|
+
const resolved = resolveHttpUrl(value);
|
|
29
|
+
if (!resolved || resolved.origin !== window.location.origin) return undefined;
|
|
30
|
+
return `${resolved.pathname}${resolved.search}${resolved.hash}`;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** 仅允许将跨域 HTTP(S) URL 交给浏览器外部打开。 */
|
|
34
|
+
export const isSafeExternalUrl = value => {
|
|
35
|
+
const resolved = resolveHttpUrl(value);
|
|
36
|
+
return !!resolved && resolved.origin !== window.location.origin;
|
|
37
|
+
};
|
|
38
|
+
export const isSafeHttpUrl = value => !!resolveHttpUrl(value);
|
|
39
|
+
export const getCurrentTabUrl = () => `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
40
|
+
export const getTabUrlPathname = value => {
|
|
41
|
+
const normalized = normalizeTabUrl(value);
|
|
42
|
+
if (!normalized || typeof window === 'undefined') return undefined;
|
|
43
|
+
return new URL(normalized, window.location.origin).pathname;
|
|
44
|
+
};
|
|
45
|
+
export const findExistingTab = (tabsList, menuItem, options = {}) => {
|
|
46
|
+
if (options.urlSync) {
|
|
47
|
+
const targetUrl = normalizeTabUrl(getMenuRoute(menuItem));
|
|
48
|
+
if (!targetUrl) return undefined;
|
|
49
|
+
return tabsList.find(tab => normalizeTabUrl(tab.url) === targetUrl);
|
|
50
|
+
}
|
|
10
51
|
if (hasRelationKey(menuItem.relationKey)) {
|
|
11
52
|
return tabsList.find(tab => tab.relationKey === menuItem.relationKey || tab.menuItem?.relationKey === menuItem.relationKey);
|
|
12
53
|
}
|
|
13
54
|
const menuRoute = getMenuRoute(menuItem);
|
|
14
|
-
|
|
55
|
+
const hasCode = menuItem.code !== undefined && menuItem.code !== null && menuItem.code !== '';
|
|
56
|
+
return tabsList.find(tab => hasCode && tab.menuItem?.code === menuItem.code || tab.url === menuRoute);
|
|
15
57
|
};
|
|
16
58
|
|
|
17
59
|
/**
|
|
@@ -31,7 +73,8 @@ export const createTabFromMenu = (menuItem, index = 0) => {
|
|
|
31
73
|
pinned,
|
|
32
74
|
menuItem,
|
|
33
75
|
icon: menuItem.icon || menuItem.imgUrl,
|
|
34
|
-
relationKey: menuItem.relationKey
|
|
76
|
+
relationKey: menuItem.relationKey,
|
|
77
|
+
menuCodeSource: menuItem.menuCodeSource
|
|
35
78
|
};
|
|
36
79
|
return result;
|
|
37
80
|
};
|
|
@@ -63,11 +106,15 @@ export const shouldOpenExternal = (menuItem, target) => {
|
|
|
63
106
|
/**
|
|
64
107
|
* 处理外部跳转
|
|
65
108
|
*/
|
|
66
|
-
export const handleExternalOpen = menuItem => {
|
|
109
|
+
export const handleExternalOpen = (menuItem, secure = false) => {
|
|
67
110
|
const url = getMenuRoute(menuItem);
|
|
68
|
-
if (url)
|
|
69
|
-
|
|
111
|
+
if (!url) return;
|
|
112
|
+
const target = menuItem.target || '_blank';
|
|
113
|
+
if (secure && target === '_blank') {
|
|
114
|
+
window.open(url, target, 'noopener,noreferrer');
|
|
115
|
+
return;
|
|
70
116
|
}
|
|
117
|
+
window.open(url, target);
|
|
71
118
|
};
|
|
72
119
|
|
|
73
120
|
/**
|
|
@@ -112,21 +159,28 @@ export const flattenMenuData = (menus = []) => {
|
|
|
112
159
|
*/
|
|
113
160
|
export const resolveTabMenuItem = (params, menus = []) => {
|
|
114
161
|
const matchedMenu = flattenMenuData(menus).find(item => item.code === params.code);
|
|
162
|
+
const menuCodeSource = params.menuCodeSource?.trim() || matchedMenu?.menuCodeSource?.trim() || undefined;
|
|
115
163
|
if (matchedMenu) {
|
|
116
164
|
return {
|
|
117
165
|
...matchedMenu,
|
|
118
166
|
name: params.name || matchedMenu.name,
|
|
167
|
+
...(params.url !== undefined && {
|
|
168
|
+
url: params.url,
|
|
169
|
+
redirectUrl: undefined
|
|
170
|
+
}),
|
|
119
171
|
extra: params.extra ?? matchedMenu.extra,
|
|
120
|
-
relationKey: params.relationKey ?? matchedMenu.relationKey
|
|
172
|
+
relationKey: params.relationKey ?? matchedMenu.relationKey,
|
|
173
|
+
menuCodeSource
|
|
121
174
|
};
|
|
122
175
|
}
|
|
123
176
|
return {
|
|
124
177
|
id: Date.now(),
|
|
125
178
|
code: params.code,
|
|
126
179
|
name: params.name,
|
|
127
|
-
url: `/${params.code}`,
|
|
180
|
+
url: params.url || `/${params.code}`,
|
|
128
181
|
extra: params.extra,
|
|
129
|
-
relationKey: params.relationKey
|
|
182
|
+
relationKey: params.relationKey,
|
|
183
|
+
menuCodeSource
|
|
130
184
|
};
|
|
131
185
|
};
|
|
132
186
|
|
package/es/ProLayout/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { isTabsMode, validateTabsProps } from "./propTypes";
|
|
|
11
11
|
import { useProLayoutTabs } from "./components/TabsManager/hooks/useProLayoutTabs";
|
|
12
12
|
import { useActiveTab } from "./components/TabsManager/hooks/useActiveTab";
|
|
13
13
|
import { transformMenus } from "./utils";
|
|
14
|
-
import { canOpenAsTab } from "./components/TabsManager/utils";
|
|
14
|
+
import { canOpenAsTab, flattenMenuData } from "./components/TabsManager/utils";
|
|
15
15
|
import headerBg from "../assets/header_bg.png";
|
|
16
16
|
|
|
17
17
|
// 全局上下文
|
|
@@ -185,7 +185,10 @@ const ProLayout = props => {
|
|
|
185
185
|
});
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const menuCodeSource = activeTab?.menuCodeSource?.trim();
|
|
189
|
+
const sourceMenu = menuCodeSource ? flattenMenuData(menuDataSource.menus).find(menu => menu.code === menuCodeSource) : undefined;
|
|
190
|
+
const sourcePath = sourceMenu?.redirectUrl || sourceMenu?.url || sourceMenu?.router;
|
|
191
|
+
const targetPath = sourcePath || activeTab?.url || activeTab?.menuItem?.router || activeTab?.menuItem?.redirectUrl || activeTab?.menuItem?.url;
|
|
189
192
|
if (targetPath && targetPath !== selectedPath) {
|
|
190
193
|
setState({
|
|
191
194
|
selectedPath: targetPath
|
|
@@ -194,7 +197,7 @@ const ProLayout = props => {
|
|
|
194
197
|
tabs.onTabChange?.(activeKey, activeTab, allTabs);
|
|
195
198
|
}
|
|
196
199
|
};
|
|
197
|
-
}, [isTabsLayout, tabs, selectedPath]);
|
|
200
|
+
}, [isTabsLayout, menuDataSource.menus, tabs, selectedPath]);
|
|
198
201
|
const renderContent = () => {
|
|
199
202
|
if (!isTabsLayout || !enhancedTabsConfig) {
|
|
200
203
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -321,7 +321,7 @@ export interface TabItem {
|
|
|
321
321
|
*/
|
|
322
322
|
title: string;
|
|
323
323
|
/**
|
|
324
|
-
* @description
|
|
324
|
+
* @description 标签关联路由。URL 同步模式下保存当前完整的 pathname + search + hash
|
|
325
325
|
*/
|
|
326
326
|
url?: string;
|
|
327
327
|
/**
|
|
@@ -349,6 +349,10 @@ export interface TabItem {
|
|
|
349
349
|
* @description 标签页关联键;用于业务详情页复用已有标签页
|
|
350
350
|
*/
|
|
351
351
|
relationKey?: string | number;
|
|
352
|
+
/**
|
|
353
|
+
* @description 最初打开当前业务标签链路的左侧菜单 code;仅用于激活来源菜单
|
|
354
|
+
*/
|
|
355
|
+
menuCodeSource?: string;
|
|
352
356
|
}
|
|
353
357
|
export interface TabsState {
|
|
354
358
|
tabsList: TabItem[];
|
|
@@ -358,6 +362,13 @@ export interface TabsState {
|
|
|
358
362
|
activeComponent?: string;
|
|
359
363
|
}
|
|
360
364
|
export type TabsStorageStrategy = 'localStorage' | 'sessionStorage';
|
|
365
|
+
export interface TabsUrlSyncConfig {
|
|
366
|
+
/**
|
|
367
|
+
* @description 切换标签页时写入浏览器历史的方式
|
|
368
|
+
* @default 'replace'
|
|
369
|
+
*/
|
|
370
|
+
history?: 'replace' | 'push';
|
|
371
|
+
}
|
|
361
372
|
/**
|
|
362
373
|
* @description 添加标签页的业务参数
|
|
363
374
|
*/
|
|
@@ -370,6 +381,11 @@ export interface AddTabParams {
|
|
|
370
381
|
* @description 标签页显示名称
|
|
371
382
|
*/
|
|
372
383
|
name: string;
|
|
384
|
+
/**
|
|
385
|
+
* @description 应用内完整 URL。URL 同步模式下作为页签业务身份
|
|
386
|
+
* @example '/wjs/workbench/workbench/Record?recordTab=quote'
|
|
387
|
+
*/
|
|
388
|
+
url?: string;
|
|
373
389
|
/**
|
|
374
390
|
* @description 额外的业务数据
|
|
375
391
|
*/
|
|
@@ -378,6 +394,10 @@ export interface AddTabParams {
|
|
|
378
394
|
* @description 标签页关联键;相同关联键的业务详情重复打开时复用已有标签页
|
|
379
395
|
*/
|
|
380
396
|
relationKey?: string | number;
|
|
397
|
+
/**
|
|
398
|
+
* @description 最初打开当前业务标签链路的左侧菜单 code;仅用于激活来源菜单
|
|
399
|
+
*/
|
|
400
|
+
menuCodeSource?: string;
|
|
381
401
|
}
|
|
382
402
|
/**
|
|
383
403
|
* @description 添加标签页的选项
|
|
@@ -519,6 +539,13 @@ export interface TabsConfig {
|
|
|
519
539
|
max?: number;
|
|
520
540
|
storage?: TabsStorageStrategy;
|
|
521
541
|
cacheKey?: string;
|
|
542
|
+
/**
|
|
543
|
+
* @description 是否将活动页签与浏览器 URL 双向同步。默认不同步,保持现有行为
|
|
544
|
+
* - true: 开启同步,切换页签时使用 replace
|
|
545
|
+
* - object: 开启同步并自定义历史写入方式
|
|
546
|
+
* @default false
|
|
547
|
+
*/
|
|
548
|
+
urlSync?: boolean | TabsUrlSyncConfig;
|
|
522
549
|
/**
|
|
523
550
|
* @description 普通初始标签页。无缓存时每次 ProLayout 挂载只初始化一次;关闭全部后本次挂载期间不会重新添加
|
|
524
551
|
*/
|
package/es/ProSelect/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export const ProSelect = (props, ref) => {
|
|
|
33
33
|
scrollFollowParent = true,
|
|
34
34
|
defaultOne,
|
|
35
35
|
onSearch: _onSearch,
|
|
36
|
+
onOpenChange,
|
|
36
37
|
optionRender,
|
|
37
38
|
onChange,
|
|
38
39
|
transformResponse,
|
|
@@ -58,6 +59,12 @@ export const ProSelect = (props, ref) => {
|
|
|
58
59
|
|
|
59
60
|
// 用来控制只有第一次才会设置 defaultOne 属性、🔒
|
|
60
61
|
const [isDefaultOne, setIsDefaultOne] = useState(false);
|
|
62
|
+
const [innerPopupOpen, setInnerPopupOpen] = useState(selectProps.defaultOpen ?? false);
|
|
63
|
+
const popupOpen = selectProps.open ?? innerPopupOpen;
|
|
64
|
+
const handleOpenChange = useCallback(open => {
|
|
65
|
+
setInnerPopupOpen(open);
|
|
66
|
+
onOpenChange?.(open);
|
|
67
|
+
}, [onOpenChange]);
|
|
61
68
|
const OptionRender = optionRender;
|
|
62
69
|
const defaultOnSuccessFun = res => {
|
|
63
70
|
const {
|
|
@@ -368,7 +375,7 @@ export const ProSelect = (props, ref) => {
|
|
|
368
375
|
});
|
|
369
376
|
return /*#__PURE__*/_jsx("div", {
|
|
370
377
|
style: props.style,
|
|
371
|
-
className:
|
|
378
|
+
className: `pro-select${popupOpen ? ' pro-select-popup-open' : ''}`,
|
|
372
379
|
children: /*#__PURE__*/_jsx(Select, {
|
|
373
380
|
placeholder: locale?.ProSelect?.select,
|
|
374
381
|
allowClear: true,
|
|
@@ -385,7 +392,9 @@ export const ProSelect = (props, ref) => {
|
|
|
385
392
|
..._omit({
|
|
386
393
|
...selectProps
|
|
387
394
|
}, ['isView', 'showCodeName', 'form', 'name', 'style', 'onFieldChange', 'getChangeValue', 'viewportReady', 'showSearch', 'filterOption', 'optionFilterProp', 'searchValue']),
|
|
395
|
+
onOpenChange: handleOpenChange
|
|
388
396
|
// 如果是多选模式且用户没有自定义maxTagPlaceholder,使用我们的hover版本
|
|
397
|
+
,
|
|
389
398
|
maxTagPlaceholder: selectProps.mode === 'multiple' && !selectProps.maxTagPlaceholder ? maxTagPlaceholder : selectProps.maxTagPlaceholder,
|
|
390
399
|
optionRender: selectOptionRender,
|
|
391
400
|
value: transformValue(),
|
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
}
|
|
9
9
|
.pro-select {
|
|
10
10
|
width: 100%;
|
|
11
|
+
|
|
12
|
+
// Ant Design Compact 控件的交互层级为 2;弹层打开时临时提升当前选择框。
|
|
13
|
+
&.pro-select-popup-open {
|
|
14
|
+
position: relative;
|
|
15
|
+
z-index: 3;
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
> .ant-select {
|
|
12
19
|
width: 100%;
|
|
13
20
|
}
|
|
@@ -18,3 +25,9 @@
|
|
|
18
25
|
font-weight: bold;
|
|
19
26
|
}
|
|
20
27
|
}
|
|
28
|
+
|
|
29
|
+
// scrollFollowParent 会让弹层受祖先堆叠上下文约束,需要同步提升嵌套 Form.Item。
|
|
30
|
+
.ant-form-item:has(.pro-select-popup-open) {
|
|
31
|
+
position: relative;
|
|
32
|
+
z-index: 3 !important;
|
|
33
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _omit from "lodash/omit";
|
|
2
2
|
import _isEqual from "lodash/isEqual";
|
|
3
|
-
import _set from "lodash/set";
|
|
4
3
|
import _merge from "lodash/merge";
|
|
5
4
|
import _isObject from "lodash/isObject";
|
|
6
5
|
import _pickBy from "lodash/pickBy";
|
|
@@ -442,18 +441,20 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
442
441
|
}),
|
|
443
442
|
selections
|
|
444
443
|
};
|
|
445
|
-
const rowSelection = _isObject(returnRowSelection) ? _merge(_rowSelection, returnRowSelection) : _rowSelection;
|
|
446
|
-
if (_isObject(returnRowSelection)
|
|
444
|
+
const rowSelection = _isObject(returnRowSelection) ? _merge({}, _rowSelection, returnRowSelection) : _rowSelection;
|
|
445
|
+
if (_isObject(returnRowSelection)) {
|
|
447
446
|
// getCheckboxProps需要特殊兼容原有的逻辑,特殊处理
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
|
|
451
|
-
const
|
|
447
|
+
const customGetCheckboxProps = returnRowSelection.getCheckboxProps;
|
|
448
|
+
if (typeof customGetCheckboxProps === 'function') {
|
|
449
|
+
rowSelection.getCheckboxProps = record => {
|
|
450
|
+
const internalProps = _rowSelection.getCheckboxProps(record);
|
|
451
|
+
const customProps = customGetCheckboxProps(record) ?? {};
|
|
452
452
|
return {
|
|
453
|
-
|
|
454
|
-
...
|
|
453
|
+
...internalProps,
|
|
454
|
+
...customProps,
|
|
455
|
+
className: [customProps.className, internalProps.className].filter(Boolean).join(' ')
|
|
455
456
|
};
|
|
456
|
-
}
|
|
457
|
+
};
|
|
457
458
|
}
|
|
458
459
|
}
|
|
459
460
|
const selectedTip = allSelected && selectedRowKeys.length ? formatMessage(locale?.ProTable?.selectAll, {
|
package/es/ProTabs/index.js
CHANGED
|
@@ -63,7 +63,7 @@ const ProTabs = (props, ref) => {
|
|
|
63
63
|
})
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
|
-
}, [selectList, fetchFunction?.loading]);
|
|
66
|
+
}, [selectList, fetchFunction?.loading, mode, rest?.size]);
|
|
67
67
|
const cls = classNames({
|
|
68
68
|
'pro-tabs': mode === 'card',
|
|
69
69
|
'pro-tabs-mode-card': mode === 'card',
|
|
@@ -97,10 +97,10 @@ const ProTabs = (props, ref) => {
|
|
|
97
97
|
|
|
98
98
|
// dataSource变化时,更新selectList
|
|
99
99
|
useDeepCompareEffect(() => {
|
|
100
|
-
if (!dataSource
|
|
100
|
+
if (!Array.isArray(props.dataSource)) {
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
setSelectList(dataSource);
|
|
103
|
+
setSelectList(props.dataSource);
|
|
104
104
|
}, [dataSource]);
|
|
105
105
|
useImperativeHandle(ref, () => ({
|
|
106
106
|
useRequestRef: fetchFunction
|
package/es/ProTooltip/index.js
CHANGED
|
@@ -81,7 +81,7 @@ const ProTooltip = props => {
|
|
|
81
81
|
})
|
|
82
82
|
})
|
|
83
83
|
}) : /*#__PURE__*/_jsx("div", {
|
|
84
|
-
className:
|
|
84
|
+
className: "singleLine",
|
|
85
85
|
style: {
|
|
86
86
|
...multiStyle,
|
|
87
87
|
width: localWidth
|
|
@@ -137,9 +137,6 @@ const ProTooltip = props => {
|
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
const AutoMixin = () => {
|
|
140
|
-
if (mode !== 'auto') {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
140
|
return line > 1 ? /*#__PURE__*/_jsx(AutoMixinMulti, {}) : /*#__PURE__*/_jsx(AutoMixinSingle, {});
|
|
144
141
|
};
|
|
145
142
|
useEffect(() => {
|
|
@@ -253,7 +250,7 @@ const ProTooltip = props => {
|
|
|
253
250
|
},
|
|
254
251
|
...restProps,
|
|
255
252
|
styles: {
|
|
256
|
-
root:
|
|
253
|
+
root: {}
|
|
257
254
|
},
|
|
258
255
|
children: renderContentBox()
|
|
259
256
|
});
|
|
@@ -215,7 +215,7 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
215
215
|
origDataSource: resultData
|
|
216
216
|
});
|
|
217
217
|
} else {
|
|
218
|
-
defaultOnSuccessFun(
|
|
218
|
+
defaultOnSuccessFun(data);
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
221
|
...useRequest?.options
|
|
@@ -227,7 +227,7 @@ export const ProTreeSelect = (props, ref) => {
|
|
|
227
227
|
|
|
228
228
|
// 设置cacheKey后使用缓存的数据
|
|
229
229
|
useDeepCompareEffect(() => {
|
|
230
|
-
if (fetchFunction?.data
|
|
230
|
+
if (fetchFunction?.data && useRequest?.options?.cacheKey) {
|
|
231
231
|
if (transformResponse && typeof transformResponse === 'function') {
|
|
232
232
|
const responseData = transformResponse(fetchFunction.data);
|
|
233
233
|
// 先转换字段名,再处理 code-name 展示与 checkLeaf 标记
|
package/es/ProTreeModal/index.js
CHANGED
|
@@ -53,26 +53,12 @@ const DragRender = props => {
|
|
|
53
53
|
* @return {*}
|
|
54
54
|
*/
|
|
55
55
|
const handleReSelect = file => {
|
|
56
|
-
if (disabled) return;
|
|
57
56
|
handleDelFile(file);
|
|
58
57
|
setTimeout(() => {
|
|
59
58
|
refReSelect.current.click();
|
|
60
59
|
}, 1);
|
|
61
60
|
};
|
|
62
61
|
|
|
63
|
-
/**
|
|
64
|
-
* @description: 处理预览按钮
|
|
65
|
-
* @param {UploadFile} file
|
|
66
|
-
* @return {*}
|
|
67
|
-
*/
|
|
68
|
-
const handlePreview = file => {
|
|
69
|
-
if (onPreview) {
|
|
70
|
-
onPreview(file);
|
|
71
|
-
} else {
|
|
72
|
-
window.open(file.url || file.thumbUrl);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
62
|
/**
|
|
77
63
|
* @description: 单个拖拽上传界面
|
|
78
64
|
* @param {UploadFile} file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.10-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
],
|
|
63
63
|
"scripts": {
|
|
64
64
|
"analyze": "ANALYZE=1 dumi build",
|
|
65
|
+
"build:demo": "father build",
|
|
65
66
|
"build": "father build && npm run build:types && mv dist/index.min.css dist/index.esm.css && mv dist/less.min.css dist/less.esm.css && npm run build:ai-meta",
|
|
66
67
|
"build:types": "tsc -p tsconfig.build.json",
|
|
67
68
|
"build:ai-meta": "node ./scripts/build-ai-meta.mjs",
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* iframe: 400
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
import { Button, Space } from 'antd';
|
|
7
|
-
import { ProConfigProvider, ProForm } from '@zat-design/sisyphus-react';
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const LocaleDemo = () => {
|
|
10
|
-
const [locale, setLocale] = useState(localStorage.getItem('locale') || 'zh-CN');
|
|
11
|
-
const handleChange = value => {
|
|
12
|
-
setLocale(value);
|
|
13
|
-
localStorage.setItem('locale', value);
|
|
14
|
-
window.location.reload();
|
|
15
|
-
};
|
|
16
|
-
return /*#__PURE__*/_jsxs(Space, {
|
|
17
|
-
direction: "vertical",
|
|
18
|
-
size: 16,
|
|
19
|
-
style: {
|
|
20
|
-
width: '100%'
|
|
21
|
-
},
|
|
22
|
-
children: [/*#__PURE__*/_jsxs(Space, {
|
|
23
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
24
|
-
type: locale === 'zh-CN' ? 'primary' : 'default',
|
|
25
|
-
onClick: () => handleChange('zh-CN'),
|
|
26
|
-
children: "\u4E2D\u6587"
|
|
27
|
-
}), /*#__PURE__*/_jsx(Button, {
|
|
28
|
-
type: locale === 'en-US' ? 'primary' : 'default',
|
|
29
|
-
onClick: () => handleChange('en-US'),
|
|
30
|
-
children: "English"
|
|
31
|
-
})]
|
|
32
|
-
}), /*#__PURE__*/_jsx(ProConfigProvider, {
|
|
33
|
-
locale: locale,
|
|
34
|
-
children: /*#__PURE__*/_jsx(ProForm, {
|
|
35
|
-
columns: [{
|
|
36
|
-
type: 'Input',
|
|
37
|
-
label: locale === 'zh-CN' ? '姓名' : 'Name',
|
|
38
|
-
name: 'name',
|
|
39
|
-
required: true
|
|
40
|
-
}, {
|
|
41
|
-
type: 'Select',
|
|
42
|
-
label: locale === 'zh-CN' ? '状态' : 'Status',
|
|
43
|
-
name: 'status',
|
|
44
|
-
fieldProps: {
|
|
45
|
-
options: [{
|
|
46
|
-
label: locale === 'zh-CN' ? '启用' : 'Enabled',
|
|
47
|
-
value: '1'
|
|
48
|
-
}, {
|
|
49
|
-
label: locale === 'zh-CN' ? '禁用' : 'Disabled',
|
|
50
|
-
value: '0'
|
|
51
|
-
}]
|
|
52
|
-
}
|
|
53
|
-
}]
|
|
54
|
-
})
|
|
55
|
-
})]
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
export default LocaleDemo;
|