@zat-design/sisyphus-react 4.3.2 → 4.3.3-beta.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/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProEnum/hooks/useEnumRequest.js +57 -37
- package/es/ProForm/components/combination/Group/style/index.less +21 -0
- package/es/ProForm/components/combination/Group/utils/index.d.ts +15 -15
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +2 -17
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +8 -9
- package/es/ProForm/index.js +10 -0
- package/es/ProStep/components/Item/index.js +8 -1
- package/es/ProStep/index.js +3 -1
- package/es/ProStep/propsType.d.ts +2 -0
- package/es/ProStep/utils/index.js +8 -7
- package/es/ProTreeModal/style/index.less +7 -7
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
|
|
3
3
|
import { diffCode, getEnumData, setEnumData, removeEnumData, cacheFieldNames, baseCacheKey, baseStorage } from "../utils";
|
|
4
4
|
import locale from "../../locale";
|
|
@@ -29,13 +29,58 @@ const useEnumRequest = (props, dispatch) => {
|
|
|
29
29
|
console.warn('proEnum:', msg);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
// IndexedDB 缓存策略:包装 service,在 service 层面返回缓存数据,
|
|
34
|
+
// 而非跳过 run()。这样 enumRes.data/loading 正常变更,
|
|
35
|
+
// ProConfigProvider 的 onSuccess 回调能正常触发(修复白屏问题)。
|
|
36
|
+
const fromCacheRef = useRef(null);
|
|
37
|
+
const originalService = useRequest?.service;
|
|
38
|
+
const serviceForRequest = useMemo(() => {
|
|
39
|
+
if (!originalService || storage !== 'indexedDB') {
|
|
40
|
+
return originalService;
|
|
41
|
+
}
|
|
42
|
+
return async (...args) => {
|
|
43
|
+
if (!requestRefresh) {
|
|
44
|
+
const cached = await Promise.resolve(getEnumData(storage, cacheKey));
|
|
45
|
+
if (cached?.data && Object.keys(cached.data).length > 0 && cached?.time && Date.now() - cached.time <= 6e4 * 60) {
|
|
46
|
+
fromCacheRef.current = cached.data;
|
|
47
|
+
return {
|
|
48
|
+
status: 200,
|
|
49
|
+
data: cached.data
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
fromCacheRef.current = null;
|
|
54
|
+
return originalService(...args);
|
|
55
|
+
};
|
|
56
|
+
}, [originalService, storage, requestRefresh, cacheKey]);
|
|
57
|
+
const enumRes = useRequestFunc(serviceForRequest, {
|
|
33
58
|
manual: true,
|
|
34
59
|
cacheKey,
|
|
35
60
|
cacheTime: -1,
|
|
36
61
|
staleTime: 6e4 * 60,
|
|
37
62
|
...useRequest?.options,
|
|
38
63
|
setCache: async res => {
|
|
64
|
+
// 缓存命中时跳过 transformResponse 和重复处理,直接 dispatch
|
|
65
|
+
if (fromCacheRef.current) {
|
|
66
|
+
const cachedData = fromCacheRef.current;
|
|
67
|
+
dispatch({
|
|
68
|
+
type: 'setProEnumDic',
|
|
69
|
+
payload: {
|
|
70
|
+
...dics,
|
|
71
|
+
...dataSource,
|
|
72
|
+
...cachedData
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
if (main) {
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
window?.eventCenter?.publish('pro-enum-event', cachedData);
|
|
78
|
+
logDebug(locale?.ProEnum?.mainInitByCache);
|
|
79
|
+
}, 10000);
|
|
80
|
+
}
|
|
81
|
+
fromCacheRef.current = null;
|
|
82
|
+
return res;
|
|
83
|
+
}
|
|
39
84
|
let response = res.data;
|
|
40
85
|
if (transformResponse && typeof transformResponse === 'function') {
|
|
41
86
|
response = await transformResponse(res.data);
|
|
@@ -97,40 +142,18 @@ const useEnumRequest = (props, dispatch) => {
|
|
|
97
142
|
});
|
|
98
143
|
if (main) {
|
|
99
144
|
setTimeout(() => {
|
|
100
|
-
window?.eventCenter?.publish('
|
|
145
|
+
window?.eventCenter?.publish('pro-enum-event', res.data);
|
|
101
146
|
logDebug(locale?.ProEnum?.mainInitByRequest);
|
|
102
147
|
}, 10000);
|
|
103
148
|
}
|
|
104
149
|
return res;
|
|
105
150
|
},
|
|
106
|
-
getCache:
|
|
107
|
-
// 支持异步读取
|
|
108
|
-
const cachePromise = Promise.resolve(getEnumData(storage, cacheKey) || {
|
|
109
|
-
data: {}
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// 对于同步存储,直接返回;对于异步存储,返回 Promise
|
|
151
|
+
getCache: params => {
|
|
113
152
|
if (storage === 'indexedDB') {
|
|
114
|
-
return
|
|
115
|
-
dispatch({
|
|
116
|
-
type: 'setProEnumDic',
|
|
117
|
-
payload: {
|
|
118
|
-
...dics,
|
|
119
|
-
...dataSource,
|
|
120
|
-
...res?.data
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
if (main) {
|
|
124
|
-
setTimeout(() => {
|
|
125
|
-
window?.eventCenter?.publish('zat-design-pro-component-event', res.data);
|
|
126
|
-
logDebug(locale?.ProEnum?.mainInitByCache);
|
|
127
|
-
}, 10000);
|
|
128
|
-
}
|
|
129
|
-
return res;
|
|
130
|
-
});
|
|
153
|
+
return undefined;
|
|
131
154
|
}
|
|
132
155
|
|
|
133
|
-
//
|
|
156
|
+
// 同步存储的处理(原始逻辑)
|
|
134
157
|
const res = getEnumData(storage, cacheKey) || {
|
|
135
158
|
data: {}
|
|
136
159
|
};
|
|
@@ -144,7 +167,7 @@ const useEnumRequest = (props, dispatch) => {
|
|
|
144
167
|
});
|
|
145
168
|
if (main) {
|
|
146
169
|
setTimeout(() => {
|
|
147
|
-
window?.eventCenter?.publish('
|
|
170
|
+
window?.eventCenter?.publish('pro-enum-event', res.data);
|
|
148
171
|
logDebug(locale?.ProEnum?.mainInitByCache);
|
|
149
172
|
}, 10000);
|
|
150
173
|
}
|
|
@@ -210,7 +233,7 @@ const useEnumRequest = (props, dispatch) => {
|
|
|
210
233
|
...cacheData.data
|
|
211
234
|
}
|
|
212
235
|
});
|
|
213
|
-
} else if (dataSource && Object.keys(dataSource)) {
|
|
236
|
+
} else if (dataSource && Object.keys(dataSource).length > 0) {
|
|
214
237
|
// 子系统也可能会有 dataSource
|
|
215
238
|
dispatch({
|
|
216
239
|
type: 'setProEnumDic',
|
|
@@ -233,16 +256,13 @@ const useEnumRequest = (props, dispatch) => {
|
|
|
233
256
|
if (requestRefresh) {
|
|
234
257
|
window.localStorage.removeItem(cacheKey);
|
|
235
258
|
window.sessionStorage.removeItem(cacheKey);
|
|
236
|
-
// 清除 IndexedDB
|
|
237
259
|
if (storage === 'indexedDB') {
|
|
238
260
|
await removeEnumData('indexedDB', cacheKey);
|
|
239
261
|
}
|
|
240
262
|
}
|
|
241
263
|
enumRes.run(params);
|
|
242
|
-
|
|
243
|
-
// TODO 这段代码目前看起来是没啥用的、没起到作用
|
|
244
264
|
mergeData();
|
|
245
|
-
} else if (Object.keys(dataSource)) {
|
|
265
|
+
} else if (dataSource && Object.keys(dataSource).length > 0) {
|
|
246
266
|
const res = await Promise.resolve(getEnumData(storage, cacheKey) || {
|
|
247
267
|
data: {}
|
|
248
268
|
});
|
|
@@ -283,15 +303,15 @@ const useEnumRequest = (props, dispatch) => {
|
|
|
283
303
|
};
|
|
284
304
|
useEffect(() => {
|
|
285
305
|
if (main) {
|
|
286
|
-
window?.eventCenter?.publish('
|
|
306
|
+
window?.eventCenter?.publish('pro-enum-event', {});
|
|
287
307
|
logDebug(locale?.ProEnum?.mainInitOnce);
|
|
288
308
|
}
|
|
289
309
|
if (!main && share) {
|
|
290
|
-
window?.eventCenter?.subscribe('
|
|
310
|
+
window?.eventCenter?.subscribe('pro-enum-event', shareProEnumDic);
|
|
291
311
|
logDebug(locale?.ProEnum?.sonInitEvent);
|
|
292
312
|
}
|
|
293
313
|
return () => {
|
|
294
|
-
window?.eventCenter?.unsubscribe('
|
|
314
|
+
window?.eventCenter?.unsubscribe('pro-enum-event', shareProEnumDic);
|
|
295
315
|
};
|
|
296
316
|
}, []);
|
|
297
317
|
return enumRes;
|
|
@@ -108,6 +108,12 @@
|
|
|
108
108
|
flex: 1;
|
|
109
109
|
margin-right: 0;
|
|
110
110
|
margin-bottom: 0;
|
|
111
|
+
position: relative;
|
|
112
|
+
|
|
113
|
+
&:hover,
|
|
114
|
+
&:focus-within {
|
|
115
|
+
z-index: 2;
|
|
116
|
+
}
|
|
111
117
|
|
|
112
118
|
// 第一个元素后面的所有元素都左移1px以实现紧密连接
|
|
113
119
|
&:not(:first-child) {
|
|
@@ -311,6 +317,12 @@
|
|
|
311
317
|
flex: 1;
|
|
312
318
|
margin-right: 0;
|
|
313
319
|
margin-bottom: 0;
|
|
320
|
+
position: relative;
|
|
321
|
+
|
|
322
|
+
&:hover,
|
|
323
|
+
&:focus-within {
|
|
324
|
+
z-index: 2;
|
|
325
|
+
}
|
|
314
326
|
|
|
315
327
|
// 第一个元素后面的所有元素都左移1px以实现紧密连接
|
|
316
328
|
&:not(:first-child) {
|
|
@@ -475,6 +487,15 @@
|
|
|
475
487
|
border-radius: 0 !important;
|
|
476
488
|
}
|
|
477
489
|
|
|
490
|
+
> .pro-group-form-item {
|
|
491
|
+
position: relative;
|
|
492
|
+
|
|
493
|
+
&:hover,
|
|
494
|
+
&:focus-within {
|
|
495
|
+
z-index: 2;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
478
499
|
> .pro-group-form-item:not(:first-child) {
|
|
479
500
|
.@{ant-prefix}-input,
|
|
480
501
|
.@{ant-prefix}-select,
|
|
@@ -75,30 +75,32 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
75
75
|
confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
|
|
76
76
|
show?: boolean | ReactiveFunction<any, boolean>;
|
|
77
77
|
component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
|
|
78
|
-
|
|
78
|
+
id?: string;
|
|
79
|
+
children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
|
|
79
80
|
style?: React.CSSProperties;
|
|
80
81
|
trim?: boolean;
|
|
81
82
|
normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
|
|
82
|
-
|
|
83
|
+
className?: string;
|
|
83
84
|
hidden?: boolean;
|
|
84
|
-
id?: string;
|
|
85
|
-
onReset?: () => void;
|
|
86
|
-
prefixCls?: string;
|
|
87
|
-
rootClassName?: string;
|
|
88
|
-
vertical?: boolean;
|
|
89
|
-
htmlFor?: string;
|
|
90
85
|
layout?: import("antd/es/form/Form").FormItemLayout;
|
|
91
86
|
help?: React.ReactNode;
|
|
87
|
+
vertical?: boolean;
|
|
92
88
|
preserve?: boolean;
|
|
93
|
-
|
|
94
|
-
isView?: boolean;
|
|
95
|
-
status?: "" | "warning" | "error" | "success" | "validating";
|
|
89
|
+
onReset?: () => void;
|
|
96
90
|
validateTrigger?: string | false | string[];
|
|
97
|
-
|
|
91
|
+
isView?: boolean;
|
|
92
|
+
clearNotShow?: boolean;
|
|
98
93
|
labelAlign?: import("antd/es/form/interface").FormLabelAlign;
|
|
94
|
+
prefixCls?: string;
|
|
95
|
+
colon?: boolean;
|
|
99
96
|
labelCol?: import("antd").ColProps;
|
|
97
|
+
wrapperCol?: import("antd").ColProps;
|
|
98
|
+
rootClassName?: string;
|
|
99
|
+
status?: "" | "warning" | "error" | "success" | "validating";
|
|
100
|
+
htmlFor?: string;
|
|
100
101
|
getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
|
|
101
102
|
shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
|
|
103
|
+
trigger?: string;
|
|
102
104
|
validateDebounce?: number;
|
|
103
105
|
valuePropName?: string;
|
|
104
106
|
getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
|
|
@@ -112,7 +114,6 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
112
114
|
icons: import("antd/es/form/FormItem").FeedbackIcons;
|
|
113
115
|
};
|
|
114
116
|
validateStatus?: "" | "warning" | "error" | "success" | "validating";
|
|
115
|
-
wrapperCol?: import("antd").ColProps;
|
|
116
117
|
fieldId?: string;
|
|
117
118
|
valueType?: import("../../../render/propsType").ProFormValueType;
|
|
118
119
|
switchValue?: [any, any];
|
|
@@ -125,7 +126,6 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
125
126
|
upperCase?: boolean;
|
|
126
127
|
toISOString?: boolean;
|
|
127
128
|
toCSTString?: boolean;
|
|
128
|
-
clearNotShow?: boolean;
|
|
129
129
|
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
130
130
|
name: any;
|
|
131
131
|
dependencies: any[];
|
|
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
141
141
|
* 创建组件属性
|
|
142
142
|
*/
|
|
143
143
|
export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
|
|
144
|
-
componentProps: import("lodash").Omit<any, "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "
|
|
144
|
+
componentProps: import("lodash").Omit<any, "clearNotShow" | "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "precision">;
|
|
145
145
|
formItemTransform: {
|
|
146
146
|
getValueProps: any;
|
|
147
147
|
normalize: any;
|
|
@@ -90,24 +90,9 @@
|
|
|
90
90
|
):not(.@{ant-prefix}-btn-compact-item-rtl) {
|
|
91
91
|
&:hover {
|
|
92
92
|
position: relative;
|
|
93
|
-
z-index: 1;
|
|
94
|
-
transition: none;
|
|
95
|
-
border-color: var(--ant-primary-color-hover, #1677ff) !important;
|
|
96
|
-
&::before {
|
|
97
|
-
opacity: 1;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
&::before {
|
|
101
|
-
content: '';
|
|
102
|
-
position: absolute;
|
|
103
|
-
top: -1px;
|
|
104
|
-
left: -1px;
|
|
105
|
-
width: 1px;
|
|
106
|
-
height: calc(100% + 2px);
|
|
107
|
-
background: var(--ant-primary-color-hover, #1677ff);
|
|
108
|
-
opacity: 0;
|
|
109
|
-
display: block;
|
|
110
93
|
z-index: 2;
|
|
94
|
+
border-color: var(--zaui-brand-hover, #3387ff) !important;
|
|
95
|
+
box-shadow: -1px 0 0 0 var(--zaui-brand-hover, #3387ff);
|
|
111
96
|
}
|
|
112
97
|
}
|
|
113
98
|
|
|
@@ -26,13 +26,13 @@ span.@{ant-prefix}-input-group-compact,
|
|
|
26
26
|
|
|
27
27
|
.@{ant-prefix}-picker {
|
|
28
28
|
flex: 1;
|
|
29
|
-
border-right: 0;
|
|
30
29
|
border-top-right-radius: 0 !important;
|
|
31
30
|
border-bottom-right-radius: 0 !important;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
.@{ant-prefix}-picker-focused
|
|
35
|
-
|
|
33
|
+
.@{ant-prefix}-picker-focused,
|
|
34
|
+
.@{ant-prefix}-picker:not(.@{ant-prefix}-picker-disabled):hover {
|
|
35
|
+
z-index: 2;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.forever-checkbox {
|
|
@@ -50,12 +50,14 @@ span.@{ant-prefix}-input-group-compact,
|
|
|
50
50
|
padding: 4px 11px;
|
|
51
51
|
background-color: #ffffff;
|
|
52
52
|
border: 1px solid #d9d9d9;
|
|
53
|
-
margin-left:
|
|
53
|
+
margin-left: 0;
|
|
54
|
+
position: relative;
|
|
54
55
|
border-top-right-radius: 6px !important;
|
|
55
56
|
border-bottom-right-radius: 6px !important;
|
|
56
57
|
transition: all 0.2s;
|
|
57
58
|
|
|
58
59
|
&:hover {
|
|
60
|
+
z-index: 2;
|
|
59
61
|
border-color: #40a9ff;
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -79,21 +81,18 @@ span.@{ant-prefix}-input-group-compact,
|
|
|
79
81
|
|
|
80
82
|
// 确保焦点状态下的边框连接正确
|
|
81
83
|
.@{ant-prefix}-picker:focus {
|
|
82
|
-
z-index:
|
|
83
|
-
border-right: 0;
|
|
84
|
+
z-index: 2;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
.forever-checkbox.@{ant-prefix}-input:focus {
|
|
87
|
-
z-index:
|
|
88
|
+
z-index: 2;
|
|
88
89
|
border-color: #40a9ff;
|
|
89
|
-
border-left: 0;
|
|
90
90
|
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// 当日期选择器聚焦时,复选框也要有相应的样式
|
|
94
94
|
.@{ant-prefix}-picker-focused + .forever-checkbox.@{ant-prefix}-input {
|
|
95
95
|
border-color: #40a9ff;
|
|
96
|
-
border-left: 0;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
}
|
package/es/ProForm/index.js
CHANGED
|
@@ -227,6 +227,16 @@ const ProForm = (props, ref) => {
|
|
|
227
227
|
labelAlign: labelAlign ?? config.labelAlign ?? 'left',
|
|
228
228
|
onValuesChange: handleValuesChange,
|
|
229
229
|
onFinish: handleFinish,
|
|
230
|
+
onFinishFailed: ({
|
|
231
|
+
errorFields
|
|
232
|
+
}) => {
|
|
233
|
+
if (scrollToError && errorFields?.length) {
|
|
234
|
+
form.scrollToField(errorFields[0]?.name, {
|
|
235
|
+
block: 'center',
|
|
236
|
+
behavior: 'smooth'
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
},
|
|
230
240
|
initialValues: _initialValues,
|
|
231
241
|
children: [/*#__PURE__*/_jsxs(Row, {
|
|
232
242
|
gutter: 24,
|
|
@@ -25,7 +25,8 @@ const ProStepItem = ({
|
|
|
25
25
|
const {
|
|
26
26
|
register,
|
|
27
27
|
collapse,
|
|
28
|
-
lazyLoad: globalLazyLoad
|
|
28
|
+
lazyLoad: globalLazyLoad,
|
|
29
|
+
targetOffset
|
|
29
30
|
} = useStep();
|
|
30
31
|
const lazyLoad = stepLazyLoad ?? globalLazyLoad;
|
|
31
32
|
useEffect(() => {
|
|
@@ -60,6 +61,9 @@ const ProStepItem = ({
|
|
|
60
61
|
return /*#__PURE__*/_jsx("div", {
|
|
61
62
|
className: "pro-step-item",
|
|
62
63
|
id: id,
|
|
64
|
+
style: {
|
|
65
|
+
scrollMarginTop: targetOffset ? `${targetOffset}px` : undefined
|
|
66
|
+
},
|
|
63
67
|
children: /*#__PURE__*/_jsx(ProCollapse, {
|
|
64
68
|
title: title,
|
|
65
69
|
icon: true,
|
|
@@ -83,6 +87,9 @@ const ProStepItem = ({
|
|
|
83
87
|
return /*#__PURE__*/_jsx("div", {
|
|
84
88
|
className: "pro-step-item",
|
|
85
89
|
id: id,
|
|
90
|
+
style: {
|
|
91
|
+
scrollMarginTop: targetOffset ? `${targetOffset}px` : undefined
|
|
92
|
+
},
|
|
86
93
|
children: renderChildren()
|
|
87
94
|
});
|
|
88
95
|
};
|
package/es/ProStep/index.js
CHANGED
|
@@ -27,7 +27,8 @@ const ProStep = ({
|
|
|
27
27
|
const ids = Object.keys(registerMap.current);
|
|
28
28
|
const {
|
|
29
29
|
collapse = false,
|
|
30
|
-
lazyLoad = false
|
|
30
|
+
lazyLoad = false,
|
|
31
|
+
targetOffset
|
|
31
32
|
} = resetProps;
|
|
32
33
|
const dataSource = useMemo(() => {
|
|
33
34
|
if (resetProps?.dataSource) {
|
|
@@ -150,6 +151,7 @@ const ProStep = ({
|
|
|
150
151
|
triggerTo,
|
|
151
152
|
handleScroll,
|
|
152
153
|
lazyLoad,
|
|
154
|
+
targetOffset,
|
|
153
155
|
unNotify,
|
|
154
156
|
source: 'ProStep'
|
|
155
157
|
},
|
|
@@ -102,6 +102,8 @@ export interface ProStepContextType {
|
|
|
102
102
|
handleScroll: (id: string, options?: ScrollOptions) => void;
|
|
103
103
|
/** 懒加载配置 */
|
|
104
104
|
lazyLoad?: boolean | any;
|
|
105
|
+
/** 滚动偏移量 */
|
|
106
|
+
targetOffset?: number;
|
|
105
107
|
/** 取消注册函数 */
|
|
106
108
|
unNotify: (keys: string | string[]) => void;
|
|
107
109
|
/** 来源 */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _pick from "lodash/pick";
|
|
2
2
|
import _debounce from "lodash/debounce";
|
|
3
|
+
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
3
4
|
/**
|
|
4
5
|
* 滚动到错误位置, 延迟200ms解决ProForm错误还未生成
|
|
5
6
|
*/
|
|
@@ -7,9 +8,10 @@ export const handleScrollError = dom => {
|
|
|
7
8
|
setTimeout(() => {
|
|
8
9
|
const errorDom = dom || document.querySelector('[class*="form-item-has-error"]');
|
|
9
10
|
if (errorDom) {
|
|
10
|
-
|
|
11
|
+
scrollIntoView(errorDom, {
|
|
11
12
|
behavior: 'smooth',
|
|
12
|
-
block: 'center'
|
|
13
|
+
block: 'center',
|
|
14
|
+
scrollMode: 'if-needed'
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
17
|
}, 200);
|
|
@@ -25,7 +27,6 @@ export const handleScroll = (id, options) => {
|
|
|
25
27
|
targetOffset = 0,
|
|
26
28
|
scrollToError
|
|
27
29
|
} = options || {};
|
|
28
|
-
if (!scrollToError) return;
|
|
29
30
|
const dom = document.querySelector(`#${id}`);
|
|
30
31
|
if (dom) {
|
|
31
32
|
// 查找指定id下的错误表单项
|
|
@@ -36,10 +37,10 @@ export const handleScroll = (id, options) => {
|
|
|
36
37
|
} else {
|
|
37
38
|
// 如果没有错误表单项,则滚动到指定元素位置
|
|
38
39
|
setTimeout(_debounce(() => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
scrollIntoView(dom, {
|
|
41
|
+
behavior: 'smooth',
|
|
42
|
+
block: 'start',
|
|
43
|
+
scrollMode: 'if-needed'
|
|
43
44
|
});
|
|
44
45
|
}, 100), 0);
|
|
45
46
|
}
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
.pro-enum-input-addonAfter:not(.trigger-no-hover):not(.pro-enum-input-addonAfter-not-allowed):hover {
|
|
56
|
+
z-index: 2;
|
|
57
|
+
border-color: var(--zaui-brand-hover, #3387ff);
|
|
58
|
+
color: var(--zaui-brand-hover, #3387ff);
|
|
59
|
+
box-shadow: -1px 0 0 0 var(--zaui-brand-hover, #3387ff);
|
|
60
|
+
|
|
61
|
+
.pro-tree-modal-view-svg-active {
|
|
62
62
|
color: var(--zaui-brand-hover, #3387ff);
|
|
63
63
|
}
|
|
64
64
|
}
|