@zat-design/sisyphus-react 3.13.7-beta.1 → 3.13.7-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/es/ProAction/components/CheckModalContent/index.css +22 -0
- package/es/ProAction/components/CheckModalContent/index.less +2 -3
- package/es/ProAction/index.js +6 -9
- package/es/ProAction/propsType.d.ts +7 -12
- package/lib/ProAction/components/CheckModalContent/index.css +22 -0
- package/lib/ProAction/components/CheckModalContent/index.less +2 -3
- package/lib/ProAction/index.js +6 -9
- package/lib/ProAction/propsType.d.ts +7 -12
- package/package.json +1 -1
@@ -0,0 +1,22 @@
|
|
1
|
+
.pro-action-check-modal-box .res-err-list .err-tip {
|
2
|
+
color: #666;
|
3
|
+
}
|
4
|
+
.pro-action-check-modal-box .res-err-list .err-item {
|
5
|
+
box-sizing: border-box;
|
6
|
+
padding-left: 6px;
|
7
|
+
color: #333;
|
8
|
+
border-radius: 4px;
|
9
|
+
}
|
10
|
+
.pro-action-check-modal-box .res-err-list .err-item:hover {
|
11
|
+
background-color: #f0f0f0;
|
12
|
+
}
|
13
|
+
.pro-action-check-modal-box .res-err-list .list-wrap {
|
14
|
+
box-sizing: border-box;
|
15
|
+
height: 50vh;
|
16
|
+
margin: 12px 0;
|
17
|
+
padding: 4px;
|
18
|
+
overflow-y: auto;
|
19
|
+
line-height: 1.8;
|
20
|
+
border: 1px solid #ccc;
|
21
|
+
border-radius: 6px;
|
22
|
+
}
|
@@ -10,15 +10,14 @@
|
|
10
10
|
color: #333;
|
11
11
|
border-radius: 4px;
|
12
12
|
&:hover {
|
13
|
-
color: var(--zaui-brand);
|
14
13
|
background-color: #f0f0f0;
|
15
14
|
}
|
16
15
|
}
|
17
16
|
|
18
17
|
.list-wrap {
|
19
18
|
box-sizing: border-box;
|
20
|
-
height:
|
21
|
-
margin
|
19
|
+
height: 50vh;
|
20
|
+
margin: 12px 0;
|
22
21
|
padding: 4px;
|
23
22
|
overflow-y: auto;
|
24
23
|
line-height: 1.8;
|
package/es/ProAction/index.js
CHANGED
@@ -27,7 +27,7 @@ var ProAction = function ProAction(props) {
|
|
27
27
|
open: false,
|
28
28
|
servicesArray: [],
|
29
29
|
loading: false,
|
30
|
-
|
30
|
+
errorModalData: null
|
31
31
|
}),
|
32
32
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
33
33
|
state = _useSetState2[0],
|
@@ -40,7 +40,7 @@ var ProAction = function ProAction(props) {
|
|
40
40
|
});
|
41
41
|
}
|
42
42
|
var index = state.index,
|
43
|
-
|
43
|
+
errorModalData = state.errorModalData;
|
44
44
|
var length = config.length;
|
45
45
|
var _onActionRun = /*#__PURE__*/function () {
|
46
46
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(currentIndex, array) {
|
@@ -120,10 +120,7 @@ var ProAction = function ProAction(props) {
|
|
120
120
|
});
|
121
121
|
setState({
|
122
122
|
loading: false,
|
123
|
-
|
124
|
-
errorTitle: errorTitle,
|
125
|
-
list: list
|
126
|
-
}
|
123
|
+
errorModalData: newServicesArray[currentIndex]
|
127
124
|
});
|
128
125
|
return _context.abrupt("return");
|
129
126
|
case 37:
|
@@ -177,7 +174,7 @@ var ProAction = function ProAction(props) {
|
|
177
174
|
var renderContent = function renderContent() {
|
178
175
|
var TargetComponent = _jsx(_Fragment, {});
|
179
176
|
if (typeof contextRender === 'function') {
|
180
|
-
var View = contextRender(
|
177
|
+
var View = contextRender(errorModalData);
|
181
178
|
TargetComponent = _jsx(_Fragment, {
|
182
179
|
children: View
|
183
180
|
});
|
@@ -207,7 +204,7 @@ var ProAction = function ProAction(props) {
|
|
207
204
|
form.resetFields();
|
208
205
|
setState({
|
209
206
|
open: false,
|
210
|
-
|
207
|
+
errorModalData: null
|
211
208
|
});
|
212
209
|
},
|
213
210
|
modalProps: {
|
@@ -216,7 +213,7 @@ var ProAction = function ProAction(props) {
|
|
216
213
|
size: "small",
|
217
214
|
onOk: onOk,
|
218
215
|
form: form,
|
219
|
-
children: !contextRender ? _jsx(CheckModalContent, _objectSpread({},
|
216
|
+
children: !contextRender ? _jsx(CheckModalContent, _objectSpread({}, errorModalData !== null && errorModalData !== void 0 ? errorModalData : {})) : renderContent()
|
220
217
|
}) : null]
|
221
218
|
});
|
222
219
|
};
|
@@ -1,10 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
3
|
-
/**
|
4
|
-
* 视图渲染函数类型
|
5
|
-
* @template T 记录类型
|
6
|
-
*/
|
7
|
-
export type contextRenderFn = (errorTitle?: string, list?: string[]) => string | number | ReactNode | void;
|
8
3
|
export interface ProActionType {
|
9
4
|
/**
|
10
5
|
* @description 模式类型:check执行校验并解析错误信息展示,confirm确认提示
|
@@ -18,34 +13,34 @@ export interface ProActionType {
|
|
18
13
|
title?: string | ReactNode;
|
19
14
|
/**
|
20
15
|
* @description 操作回调函数
|
21
|
-
* @param
|
16
|
+
* @param previousData 接上一个 useRequest 返回的值
|
22
17
|
* @param args 接所有链式 useRequest 返回的值
|
23
18
|
* @param index 当前操作的索引
|
24
19
|
* @returns void或Promise<void>
|
25
20
|
* @default -
|
26
21
|
*/
|
27
|
-
onAction?: (
|
22
|
+
onAction?: (previousData?: any, args?: any[], index?: number) => void | Promise<void>;
|
28
23
|
/**
|
29
24
|
* @description 自定义请求
|
30
|
-
* @param
|
25
|
+
* @param previousData 接上一个 useRequest 返回的值
|
31
26
|
* @param args 接所有链式 useRequest 返回的值
|
32
27
|
* @returns 包含service、options和transformResponse的对象
|
33
28
|
* @default -
|
34
29
|
*/
|
35
|
-
useRequest?: (
|
30
|
+
useRequest?: (previousData: any, args: any) => {
|
36
31
|
service?: Service<any, any>;
|
37
32
|
options?: Options<any, any>;
|
38
33
|
transformResponse?: (data: any) => any;
|
39
34
|
};
|
40
35
|
/**
|
41
36
|
* @description 是否中断链式操作
|
42
|
-
* @param
|
37
|
+
* @param previousData 上一个操作的返回数据
|
43
38
|
* @param args 所有链式的数据合集
|
44
39
|
* @returns 布尔值,返回true继续执行,返回false中断操作
|
45
40
|
* @default -
|
46
41
|
*/
|
47
|
-
continue?: (
|
42
|
+
continue?: (previousData: any, args: any[]) => boolean;
|
48
43
|
/** 自定义错误弹窗内容视图渲染 */
|
49
|
-
contextRender?:
|
44
|
+
contextRender?: (data: any) => string | ReactNode;
|
50
45
|
}
|
51
46
|
export type ProActionProps = ProActionType;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.pro-action-check-modal-box .res-err-list .err-tip {
|
2
|
+
color: #666;
|
3
|
+
}
|
4
|
+
.pro-action-check-modal-box .res-err-list .err-item {
|
5
|
+
box-sizing: border-box;
|
6
|
+
padding-left: 6px;
|
7
|
+
color: #333;
|
8
|
+
border-radius: 4px;
|
9
|
+
}
|
10
|
+
.pro-action-check-modal-box .res-err-list .err-item:hover {
|
11
|
+
background-color: #f0f0f0;
|
12
|
+
}
|
13
|
+
.pro-action-check-modal-box .res-err-list .list-wrap {
|
14
|
+
box-sizing: border-box;
|
15
|
+
height: 50vh;
|
16
|
+
margin: 12px 0;
|
17
|
+
padding: 4px;
|
18
|
+
overflow-y: auto;
|
19
|
+
line-height: 1.8;
|
20
|
+
border: 1px solid #ccc;
|
21
|
+
border-radius: 6px;
|
22
|
+
}
|
@@ -10,15 +10,14 @@
|
|
10
10
|
color: #333;
|
11
11
|
border-radius: 4px;
|
12
12
|
&:hover {
|
13
|
-
color: var(--zaui-brand);
|
14
13
|
background-color: #f0f0f0;
|
15
14
|
}
|
16
15
|
}
|
17
16
|
|
18
17
|
.list-wrap {
|
19
18
|
box-sizing: border-box;
|
20
|
-
height:
|
21
|
-
margin
|
19
|
+
height: 50vh;
|
20
|
+
margin: 12px 0;
|
22
21
|
padding: 4px;
|
23
22
|
overflow-y: auto;
|
24
23
|
line-height: 1.8;
|
package/lib/ProAction/index.js
CHANGED
@@ -31,7 +31,7 @@ var ProAction = function ProAction(props) {
|
|
31
31
|
open: false,
|
32
32
|
servicesArray: [],
|
33
33
|
loading: false,
|
34
|
-
|
34
|
+
errorModalData: null
|
35
35
|
}),
|
36
36
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
37
37
|
state = _useSetState2[0],
|
@@ -44,7 +44,7 @@ var ProAction = function ProAction(props) {
|
|
44
44
|
});
|
45
45
|
}
|
46
46
|
var index = state.index,
|
47
|
-
|
47
|
+
errorModalData = state.errorModalData;
|
48
48
|
var length = config.length;
|
49
49
|
var _onActionRun = /*#__PURE__*/function () {
|
50
50
|
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(currentIndex, array) {
|
@@ -124,10 +124,7 @@ var ProAction = function ProAction(props) {
|
|
124
124
|
});
|
125
125
|
setState({
|
126
126
|
loading: false,
|
127
|
-
|
128
|
-
errorTitle: errorTitle,
|
129
|
-
list: list
|
130
|
-
}
|
127
|
+
errorModalData: newServicesArray[currentIndex]
|
131
128
|
});
|
132
129
|
return _context.abrupt("return");
|
133
130
|
case 37:
|
@@ -181,7 +178,7 @@ var ProAction = function ProAction(props) {
|
|
181
178
|
var renderContent = function renderContent() {
|
182
179
|
var TargetComponent = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
183
180
|
if (typeof contextRender === 'function') {
|
184
|
-
var View = contextRender(
|
181
|
+
var View = contextRender(errorModalData);
|
185
182
|
TargetComponent = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
186
183
|
children: View
|
187
184
|
});
|
@@ -211,7 +208,7 @@ var ProAction = function ProAction(props) {
|
|
211
208
|
form.resetFields();
|
212
209
|
setState({
|
213
210
|
open: false,
|
214
|
-
|
211
|
+
errorModalData: null
|
215
212
|
});
|
216
213
|
},
|
217
214
|
modalProps: {
|
@@ -220,7 +217,7 @@ var ProAction = function ProAction(props) {
|
|
220
217
|
size: "small",
|
221
218
|
onOk: onOk,
|
222
219
|
form: form,
|
223
|
-
children: !contextRender ? (0, _jsxRuntime.jsx)(_CheckModalContent.default, (0, _objectSpread2.default)({},
|
220
|
+
children: !contextRender ? (0, _jsxRuntime.jsx)(_CheckModalContent.default, (0, _objectSpread2.default)({}, errorModalData !== null && errorModalData !== void 0 ? errorModalData : {})) : renderContent()
|
224
221
|
}) : null]
|
225
222
|
});
|
226
223
|
};
|
@@ -1,10 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
3
|
-
/**
|
4
|
-
* 视图渲染函数类型
|
5
|
-
* @template T 记录类型
|
6
|
-
*/
|
7
|
-
export type contextRenderFn = (errorTitle?: string, list?: string[]) => string | number | ReactNode | void;
|
8
3
|
export interface ProActionType {
|
9
4
|
/**
|
10
5
|
* @description 模式类型:check执行校验并解析错误信息展示,confirm确认提示
|
@@ -18,34 +13,34 @@ export interface ProActionType {
|
|
18
13
|
title?: string | ReactNode;
|
19
14
|
/**
|
20
15
|
* @description 操作回调函数
|
21
|
-
* @param
|
16
|
+
* @param previousData 接上一个 useRequest 返回的值
|
22
17
|
* @param args 接所有链式 useRequest 返回的值
|
23
18
|
* @param index 当前操作的索引
|
24
19
|
* @returns void或Promise<void>
|
25
20
|
* @default -
|
26
21
|
*/
|
27
|
-
onAction?: (
|
22
|
+
onAction?: (previousData?: any, args?: any[], index?: number) => void | Promise<void>;
|
28
23
|
/**
|
29
24
|
* @description 自定义请求
|
30
|
-
* @param
|
25
|
+
* @param previousData 接上一个 useRequest 返回的值
|
31
26
|
* @param args 接所有链式 useRequest 返回的值
|
32
27
|
* @returns 包含service、options和transformResponse的对象
|
33
28
|
* @default -
|
34
29
|
*/
|
35
|
-
useRequest?: (
|
30
|
+
useRequest?: (previousData: any, args: any) => {
|
36
31
|
service?: Service<any, any>;
|
37
32
|
options?: Options<any, any>;
|
38
33
|
transformResponse?: (data: any) => any;
|
39
34
|
};
|
40
35
|
/**
|
41
36
|
* @description 是否中断链式操作
|
42
|
-
* @param
|
37
|
+
* @param previousData 上一个操作的返回数据
|
43
38
|
* @param args 所有链式的数据合集
|
44
39
|
* @returns 布尔值,返回true继续执行,返回false中断操作
|
45
40
|
* @default -
|
46
41
|
*/
|
47
|
-
continue?: (
|
42
|
+
continue?: (previousData: any, args: any[]) => boolean;
|
48
43
|
/** 自定义错误弹窗内容视图渲染 */
|
49
|
-
contextRender?:
|
44
|
+
contextRender?: (data: any) => string | ReactNode;
|
50
45
|
}
|
51
46
|
export type ProActionProps = ProActionType;
|