@zat-design/sisyphus-react 3.13.6-beta.7 → 3.13.7-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/es/ProAction/components/CheckModalContent/index.d.ts +8 -0
- package/es/ProAction/components/CheckModalContent/index.js +44 -0
- package/es/ProAction/components/CheckModalContent/index.less +29 -0
- package/es/ProAction/index.js +38 -38
- package/es/ProAction/propsType.d.ts +7 -0
- package/es/ProTable/propsType.d.ts +1 -1
- package/lib/ProAction/components/CheckModalContent/index.d.ts +8 -0
- package/lib/ProAction/components/CheckModalContent/index.js +49 -0
- package/lib/ProAction/components/CheckModalContent/index.less +29 -0
- package/lib/ProAction/index.js +38 -38
- package/lib/ProAction/propsType.d.ts +7 -0
- package/lib/ProTable/propsType.d.ts +1 -1
- package/package.json +1 -1
@@ -0,0 +1,8 @@
|
|
1
|
+
import './index.less';
|
2
|
+
interface propsWithCheckModal {
|
3
|
+
errorTitle?: string;
|
4
|
+
list?: string[];
|
5
|
+
[key: string]: any;
|
6
|
+
}
|
7
|
+
declare const CheckModalContent: (props: propsWithCheckModal) => import("react/jsx-runtime").JSX.Element;
|
8
|
+
export default CheckModalContent;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import "antd/es/tooltip/style";
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
4
|
+
/*
|
5
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
6
|
+
* @Date: 2025-02-17 11:49:02
|
7
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
8
|
+
* @LastEditTime: 2025-05-28 18:23:47
|
9
|
+
* @FilePath: /zat-wjs-pro-product-web/src/components/CheckModalContent/index.tsx
|
10
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
11
|
+
*/
|
12
|
+
|
13
|
+
import './index.less';
|
14
|
+
var CheckModalContent = function CheckModalContent(props) {
|
15
|
+
var _ref = props !== null && props !== void 0 ? props : {},
|
16
|
+
errorTitle = _ref.errorTitle,
|
17
|
+
_ref$list = _ref.list,
|
18
|
+
list = _ref$list === void 0 ? [] : _ref$list;
|
19
|
+
return _jsx("div", {
|
20
|
+
className: "pro-action-check-modal-box",
|
21
|
+
children: _jsxs("div", {
|
22
|
+
className: "res-err-list",
|
23
|
+
children: [_jsx("span", {
|
24
|
+
className: "err-tip",
|
25
|
+
children: errorTitle
|
26
|
+
}), _jsxs(_Tooltip, {
|
27
|
+
title: list.join('\n') || [],
|
28
|
+
children: [Array.isArray(list) && list.length === 1 ? _jsx("span", {
|
29
|
+
className: "err-item",
|
30
|
+
children: list[0]
|
31
|
+
}) : null, Array.isArray(list) && list.length > 1 ? _jsx("div", {
|
32
|
+
className: "list-wrap",
|
33
|
+
children: list.map(function (item) {
|
34
|
+
return _jsx("div", {
|
35
|
+
className: "err-item",
|
36
|
+
children: item
|
37
|
+
});
|
38
|
+
})
|
39
|
+
}) : null]
|
40
|
+
})]
|
41
|
+
})
|
42
|
+
});
|
43
|
+
};
|
44
|
+
export default CheckModalContent;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.pro-action-check-modal-box {
|
2
|
+
.res-err-list {
|
3
|
+
.err-tip {
|
4
|
+
color: #666;
|
5
|
+
}
|
6
|
+
|
7
|
+
.err-item {
|
8
|
+
box-sizing: border-box;
|
9
|
+
padding-left: 6px;
|
10
|
+
color: #333;
|
11
|
+
border-radius: 4px;
|
12
|
+
&:hover {
|
13
|
+
color: var(--zaui-brand);
|
14
|
+
background-color: #f0f0f0;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.list-wrap {
|
19
|
+
box-sizing: border-box;
|
20
|
+
height: 110px;
|
21
|
+
margin-top: 12px;
|
22
|
+
padding: 4px;
|
23
|
+
overflow-y: auto;
|
24
|
+
line-height: 1.8;
|
25
|
+
border: 1px solid #ccc;
|
26
|
+
border-radius: 6px;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
package/es/ProAction/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
1
2
|
import "antd/es/popconfirm/style";
|
2
3
|
import _Popconfirm from "antd/es/popconfirm";
|
3
4
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
@@ -10,6 +11,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
10
11
|
import React from 'react';
|
11
12
|
import { useSetState } from 'ahooks';
|
12
13
|
import { isFunction } from 'lodash';
|
14
|
+
import CheckModalContent from './components/CheckModalContent';
|
13
15
|
import { ProDrawerForm } from '../index';
|
14
16
|
import locale from '../locale';
|
15
17
|
import './index.less';
|
@@ -24,7 +26,8 @@ var ProAction = function ProAction(props) {
|
|
24
26
|
index: 0,
|
25
27
|
open: false,
|
26
28
|
servicesArray: [],
|
27
|
-
loading: false
|
29
|
+
loading: false,
|
30
|
+
errorModalDataSource: null
|
28
31
|
}),
|
29
32
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
30
33
|
state = _useSetState2[0],
|
@@ -37,12 +40,12 @@ var ProAction = function ProAction(props) {
|
|
37
40
|
});
|
38
41
|
}
|
39
42
|
var index = state.index,
|
40
|
-
|
43
|
+
errorModalDataSource = state.errorModalDataSource;
|
41
44
|
var length = config.length;
|
42
45
|
var _onActionRun = /*#__PURE__*/function () {
|
43
46
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(currentIndex, array) {
|
44
47
|
var _actionProps$useReque, _options$defaultParam, _options$onSuccess, _newServicesArray$cur, _newServicesArray$cur2, _newServicesArray$cur3, _actionProps$onAction, _actionProps$continue;
|
45
|
-
var actionProps, newServicesArray, _ref2, service, options, transformResponse, params, res, data, open, _newServicesArray$cur4, _newServicesArray$cur5,
|
48
|
+
var actionProps, newServicesArray, _ref2, service, options, transformResponse, params, res, data, open, _newServicesArray$cur4, _newServicesArray$cur5, list, errorTitle, isContinue;
|
46
49
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
47
50
|
while (1) switch (_context.prev = _context.next) {
|
48
51
|
case 0:
|
@@ -109,14 +112,18 @@ var ProAction = function ProAction(props) {
|
|
109
112
|
_context.next = 37;
|
110
113
|
break;
|
111
114
|
}
|
112
|
-
list = ((_newServicesArray$cur4 = newServicesArray[currentIndex]) === null || _newServicesArray$cur4 === void 0 ? void 0 :
|
113
|
-
errorTitle = (_newServicesArray$
|
115
|
+
list = ((_newServicesArray$cur4 = newServicesArray[currentIndex]) === null || _newServicesArray$cur4 === void 0 ? void 0 : _newServicesArray$cur4.list) || [];
|
116
|
+
errorTitle = (_newServicesArray$cur5 = newServicesArray[currentIndex]) === null || _newServicesArray$cur5 === void 0 ? void 0 : _newServicesArray$cur5.errorTitle;
|
114
117
|
form.setFieldsValue({
|
115
118
|
errorTitle: errorTitle,
|
116
119
|
list: list
|
117
120
|
});
|
118
121
|
setState({
|
119
|
-
loading: false
|
122
|
+
loading: false,
|
123
|
+
errorModalDataSource: {
|
124
|
+
errorTitle: errorTitle,
|
125
|
+
list: list
|
126
|
+
}
|
120
127
|
});
|
121
128
|
return _context.abrupt("return");
|
122
129
|
case 37:
|
@@ -164,6 +171,27 @@ var ProAction = function ProAction(props) {
|
|
164
171
|
open: false
|
165
172
|
});
|
166
173
|
};
|
174
|
+
var errorModalConfig = config === null || config === void 0 ? void 0 : config[index];
|
175
|
+
var _ref3 = errorModalConfig || {},
|
176
|
+
contextRender = _ref3.contextRender;
|
177
|
+
var renderContent = function renderContent() {
|
178
|
+
var TargetComponent = _jsx(_Fragment, {});
|
179
|
+
if (typeof contextRender === 'function') {
|
180
|
+
var View = contextRender(errorModalDataSource);
|
181
|
+
TargetComponent = _jsx(_Fragment, {
|
182
|
+
children: View
|
183
|
+
});
|
184
|
+
} else if (typeof contextRender === 'string' || typeof contextRender === 'number') {
|
185
|
+
TargetComponent = _jsx(_Fragment, {
|
186
|
+
children: contextRender
|
187
|
+
});
|
188
|
+
} else if (/*#__PURE__*/React.isValidElement(contextRender)) {
|
189
|
+
TargetComponent = _jsx(_Fragment, {
|
190
|
+
children: contextRender
|
191
|
+
});
|
192
|
+
}
|
193
|
+
return TargetComponent;
|
194
|
+
};
|
167
195
|
return _jsxs(_Fragment, {
|
168
196
|
children: [((_config$ = config[0]) === null || _config$ === void 0 ? void 0 : _config$.mode) === 'confirm' ? _jsx(_Popconfirm, {
|
169
197
|
onConfirm: function onConfirm() {
|
@@ -176,8 +204,10 @@ var ProAction = function ProAction(props) {
|
|
176
204
|
mode: "Modal",
|
177
205
|
title: config === null || config === void 0 ? void 0 : (_config$index = config[index]) === null || _config$index === void 0 ? void 0 : _config$index.title,
|
178
206
|
onCancel: function onCancel() {
|
207
|
+
form.resetFields();
|
179
208
|
setState({
|
180
|
-
open: false
|
209
|
+
open: false,
|
210
|
+
errorModalDataSource: null
|
181
211
|
});
|
182
212
|
},
|
183
213
|
modalProps: {
|
@@ -186,37 +216,7 @@ var ProAction = function ProAction(props) {
|
|
186
216
|
size: "small",
|
187
217
|
onOk: onOk,
|
188
218
|
form: form,
|
189
|
-
|
190
|
-
span: 24,
|
191
|
-
isView: true,
|
192
|
-
columns: [{
|
193
|
-
type: 'Input',
|
194
|
-
name: 'errorTitle',
|
195
|
-
viewRender: function viewRender(value) {
|
196
|
-
var _servicesArray$index;
|
197
|
-
var list = ((_servicesArray$index = servicesArray[index]) === null || _servicesArray$index === void 0 ? void 0 : _servicesArray$index.list) || [];
|
198
|
-
return _jsxs("div", {
|
199
|
-
className: "pro-action-view-tile",
|
200
|
-
children: [value, list.length === 1 ? _jsxs("span", {
|
201
|
-
children: [" ", list[0]]
|
202
|
-
}) : '']
|
203
|
-
});
|
204
|
-
}
|
205
|
-
}, {
|
206
|
-
type: 'TextArea',
|
207
|
-
name: 'list',
|
208
|
-
fieldProps: {
|
209
|
-
autoSize: {
|
210
|
-
minRows: 4,
|
211
|
-
maxRows: 7
|
212
|
-
}
|
213
|
-
},
|
214
|
-
show: function show() {
|
215
|
-
var _servicesArray$index2, _servicesArray$index3;
|
216
|
-
return ((_servicesArray$index2 = servicesArray[index]) === null || _servicesArray$index2 === void 0 ? void 0 : (_servicesArray$index3 = _servicesArray$index2.list) === null || _servicesArray$index3 === void 0 ? void 0 : _servicesArray$index3.length) > 1;
|
217
|
-
}
|
218
|
-
}]
|
219
|
-
}
|
219
|
+
children: !contextRender ? _jsx(CheckModalContent, _objectSpread({}, errorModalDataSource !== null && errorModalDataSource !== void 0 ? errorModalDataSource : {})) : renderContent()
|
220
220
|
}) : null]
|
221
221
|
});
|
222
222
|
};
|
@@ -1,5 +1,10 @@
|
|
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;
|
3
8
|
export interface ProActionType {
|
4
9
|
/**
|
5
10
|
* @description 模式类型:check执行校验并解析错误信息展示,confirm确认提示
|
@@ -40,5 +45,7 @@ export interface ProActionType {
|
|
40
45
|
* @default -
|
41
46
|
*/
|
42
47
|
continue?: (previouData: any, args: any[]) => boolean;
|
48
|
+
/** 自定义错误弹窗内容视图渲染 */
|
49
|
+
contextRender?: string | number | ReactNode | contextRenderFn;
|
43
50
|
}
|
44
51
|
export type ProActionProps = ProActionType;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import './index.less';
|
2
|
+
interface propsWithCheckModal {
|
3
|
+
errorTitle?: string;
|
4
|
+
list?: string[];
|
5
|
+
[key: string]: any;
|
6
|
+
}
|
7
|
+
declare const CheckModalContent: (props: propsWithCheckModal) => import("react/jsx-runtime").JSX.Element;
|
8
|
+
export default CheckModalContent;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
8
|
+
var _antd = require("antd");
|
9
|
+
require("./index.less");
|
10
|
+
/*
|
11
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
12
|
+
* @Date: 2025-02-17 11:49:02
|
13
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
14
|
+
* @LastEditTime: 2025-05-28 18:23:47
|
15
|
+
* @FilePath: /zat-wjs-pro-product-web/src/components/CheckModalContent/index.tsx
|
16
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
17
|
+
*/
|
18
|
+
|
19
|
+
var CheckModalContent = function CheckModalContent(props) {
|
20
|
+
var _ref = props !== null && props !== void 0 ? props : {},
|
21
|
+
errorTitle = _ref.errorTitle,
|
22
|
+
_ref$list = _ref.list,
|
23
|
+
list = _ref$list === void 0 ? [] : _ref$list;
|
24
|
+
return (0, _jsxRuntime.jsx)("div", {
|
25
|
+
className: "pro-action-check-modal-box",
|
26
|
+
children: (0, _jsxRuntime.jsxs)("div", {
|
27
|
+
className: "res-err-list",
|
28
|
+
children: [(0, _jsxRuntime.jsx)("span", {
|
29
|
+
className: "err-tip",
|
30
|
+
children: errorTitle
|
31
|
+
}), (0, _jsxRuntime.jsxs)(_antd.Tooltip, {
|
32
|
+
title: list.join('\n') || [],
|
33
|
+
children: [Array.isArray(list) && list.length === 1 ? (0, _jsxRuntime.jsx)("span", {
|
34
|
+
className: "err-item",
|
35
|
+
children: list[0]
|
36
|
+
}) : null, Array.isArray(list) && list.length > 1 ? (0, _jsxRuntime.jsx)("div", {
|
37
|
+
className: "list-wrap",
|
38
|
+
children: list.map(function (item) {
|
39
|
+
return (0, _jsxRuntime.jsx)("div", {
|
40
|
+
className: "err-item",
|
41
|
+
children: item
|
42
|
+
});
|
43
|
+
})
|
44
|
+
}) : null]
|
45
|
+
})]
|
46
|
+
})
|
47
|
+
});
|
48
|
+
};
|
49
|
+
var _default = exports.default = CheckModalContent;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.pro-action-check-modal-box {
|
2
|
+
.res-err-list {
|
3
|
+
.err-tip {
|
4
|
+
color: #666;
|
5
|
+
}
|
6
|
+
|
7
|
+
.err-item {
|
8
|
+
box-sizing: border-box;
|
9
|
+
padding-left: 6px;
|
10
|
+
color: #333;
|
11
|
+
border-radius: 4px;
|
12
|
+
&:hover {
|
13
|
+
color: var(--zaui-brand);
|
14
|
+
background-color: #f0f0f0;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.list-wrap {
|
19
|
+
box-sizing: border-box;
|
20
|
+
height: 110px;
|
21
|
+
margin-top: 12px;
|
22
|
+
padding: 4px;
|
23
|
+
overflow-y: auto;
|
24
|
+
line-height: 1.8;
|
25
|
+
border: 1px solid #ccc;
|
26
|
+
border-radius: 6px;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
package/lib/ProAction/index.js
CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
8
9
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
9
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
@@ -14,6 +15,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
14
15
|
var _ahooks = require("ahooks");
|
15
16
|
var _antd = require("antd");
|
16
17
|
var _lodash = require("lodash");
|
18
|
+
var _CheckModalContent = _interopRequireDefault(require("./components/CheckModalContent"));
|
17
19
|
var _index = require("../index");
|
18
20
|
var _locale = _interopRequireDefault(require("../locale"));
|
19
21
|
require("./index.less");
|
@@ -28,7 +30,8 @@ var ProAction = function ProAction(props) {
|
|
28
30
|
index: 0,
|
29
31
|
open: false,
|
30
32
|
servicesArray: [],
|
31
|
-
loading: false
|
33
|
+
loading: false,
|
34
|
+
errorModalDataSource: null
|
32
35
|
}),
|
33
36
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
34
37
|
state = _useSetState2[0],
|
@@ -41,12 +44,12 @@ var ProAction = function ProAction(props) {
|
|
41
44
|
});
|
42
45
|
}
|
43
46
|
var index = state.index,
|
44
|
-
|
47
|
+
errorModalDataSource = state.errorModalDataSource;
|
45
48
|
var length = config.length;
|
46
49
|
var _onActionRun = /*#__PURE__*/function () {
|
47
50
|
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(currentIndex, array) {
|
48
51
|
var _actionProps$useReque, _options$defaultParam, _options$onSuccess, _newServicesArray$cur, _newServicesArray$cur2, _newServicesArray$cur3, _actionProps$onAction, _actionProps$continue;
|
49
|
-
var actionProps, newServicesArray, _ref2, service, options, transformResponse, params, res, data, open, _newServicesArray$cur4, _newServicesArray$cur5,
|
52
|
+
var actionProps, newServicesArray, _ref2, service, options, transformResponse, params, res, data, open, _newServicesArray$cur4, _newServicesArray$cur5, list, errorTitle, isContinue;
|
50
53
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
51
54
|
while (1) switch (_context.prev = _context.next) {
|
52
55
|
case 0:
|
@@ -113,14 +116,18 @@ var ProAction = function ProAction(props) {
|
|
113
116
|
_context.next = 37;
|
114
117
|
break;
|
115
118
|
}
|
116
|
-
list = ((_newServicesArray$cur4 = newServicesArray[currentIndex]) === null || _newServicesArray$cur4 === void 0 ? void 0 :
|
117
|
-
errorTitle = (_newServicesArray$
|
119
|
+
list = ((_newServicesArray$cur4 = newServicesArray[currentIndex]) === null || _newServicesArray$cur4 === void 0 ? void 0 : _newServicesArray$cur4.list) || [];
|
120
|
+
errorTitle = (_newServicesArray$cur5 = newServicesArray[currentIndex]) === null || _newServicesArray$cur5 === void 0 ? void 0 : _newServicesArray$cur5.errorTitle;
|
118
121
|
form.setFieldsValue({
|
119
122
|
errorTitle: errorTitle,
|
120
123
|
list: list
|
121
124
|
});
|
122
125
|
setState({
|
123
|
-
loading: false
|
126
|
+
loading: false,
|
127
|
+
errorModalDataSource: {
|
128
|
+
errorTitle: errorTitle,
|
129
|
+
list: list
|
130
|
+
}
|
124
131
|
});
|
125
132
|
return _context.abrupt("return");
|
126
133
|
case 37:
|
@@ -168,6 +175,27 @@ var ProAction = function ProAction(props) {
|
|
168
175
|
open: false
|
169
176
|
});
|
170
177
|
};
|
178
|
+
var errorModalConfig = config === null || config === void 0 ? void 0 : config[index];
|
179
|
+
var _ref3 = errorModalConfig || {},
|
180
|
+
contextRender = _ref3.contextRender;
|
181
|
+
var renderContent = function renderContent() {
|
182
|
+
var TargetComponent = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
183
|
+
if (typeof contextRender === 'function') {
|
184
|
+
var View = contextRender(errorModalDataSource);
|
185
|
+
TargetComponent = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
186
|
+
children: View
|
187
|
+
});
|
188
|
+
} else if (typeof contextRender === 'string' || typeof contextRender === 'number') {
|
189
|
+
TargetComponent = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
190
|
+
children: contextRender
|
191
|
+
});
|
192
|
+
} else if (/*#__PURE__*/_react.default.isValidElement(contextRender)) {
|
193
|
+
TargetComponent = (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
194
|
+
children: contextRender
|
195
|
+
});
|
196
|
+
}
|
197
|
+
return TargetComponent;
|
198
|
+
};
|
171
199
|
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
172
200
|
children: [((_config$ = config[0]) === null || _config$ === void 0 ? void 0 : _config$.mode) === 'confirm' ? (0, _jsxRuntime.jsx)(_antd.Popconfirm, {
|
173
201
|
onConfirm: function onConfirm() {
|
@@ -180,8 +208,10 @@ var ProAction = function ProAction(props) {
|
|
180
208
|
mode: "Modal",
|
181
209
|
title: config === null || config === void 0 ? void 0 : (_config$index = config[index]) === null || _config$index === void 0 ? void 0 : _config$index.title,
|
182
210
|
onCancel: function onCancel() {
|
211
|
+
form.resetFields();
|
183
212
|
setState({
|
184
|
-
open: false
|
213
|
+
open: false,
|
214
|
+
errorModalDataSource: null
|
185
215
|
});
|
186
216
|
},
|
187
217
|
modalProps: {
|
@@ -190,37 +220,7 @@ var ProAction = function ProAction(props) {
|
|
190
220
|
size: "small",
|
191
221
|
onOk: onOk,
|
192
222
|
form: form,
|
193
|
-
|
194
|
-
span: 24,
|
195
|
-
isView: true,
|
196
|
-
columns: [{
|
197
|
-
type: 'Input',
|
198
|
-
name: 'errorTitle',
|
199
|
-
viewRender: function viewRender(value) {
|
200
|
-
var _servicesArray$index;
|
201
|
-
var list = ((_servicesArray$index = servicesArray[index]) === null || _servicesArray$index === void 0 ? void 0 : _servicesArray$index.list) || [];
|
202
|
-
return (0, _jsxRuntime.jsxs)("div", {
|
203
|
-
className: "pro-action-view-tile",
|
204
|
-
children: [value, list.length === 1 ? (0, _jsxRuntime.jsxs)("span", {
|
205
|
-
children: [" ", list[0]]
|
206
|
-
}) : '']
|
207
|
-
});
|
208
|
-
}
|
209
|
-
}, {
|
210
|
-
type: 'TextArea',
|
211
|
-
name: 'list',
|
212
|
-
fieldProps: {
|
213
|
-
autoSize: {
|
214
|
-
minRows: 4,
|
215
|
-
maxRows: 7
|
216
|
-
}
|
217
|
-
},
|
218
|
-
show: function show() {
|
219
|
-
var _servicesArray$index2, _servicesArray$index3;
|
220
|
-
return ((_servicesArray$index2 = servicesArray[index]) === null || _servicesArray$index2 === void 0 ? void 0 : (_servicesArray$index3 = _servicesArray$index2.list) === null || _servicesArray$index3 === void 0 ? void 0 : _servicesArray$index3.length) > 1;
|
221
|
-
}
|
222
|
-
}]
|
223
|
-
}
|
223
|
+
children: !contextRender ? (0, _jsxRuntime.jsx)(_CheckModalContent.default, (0, _objectSpread2.default)({}, errorModalDataSource !== null && errorModalDataSource !== void 0 ? errorModalDataSource : {})) : renderContent()
|
224
224
|
}) : null]
|
225
225
|
});
|
226
226
|
};
|
@@ -1,5 +1,10 @@
|
|
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;
|
3
8
|
export interface ProActionType {
|
4
9
|
/**
|
5
10
|
* @description 模式类型:check执行校验并解析错误信息展示,confirm确认提示
|
@@ -40,5 +45,7 @@ export interface ProActionType {
|
|
40
45
|
* @default -
|
41
46
|
*/
|
42
47
|
continue?: (previouData: any, args: any[]) => boolean;
|
48
|
+
/** 自定义错误弹窗内容视图渲染 */
|
49
|
+
contextRender?: string | number | ReactNode | contextRenderFn;
|
43
50
|
}
|
44
51
|
export type ProActionProps = ProActionType;
|