fan-standard-comp 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/fan-standard-comp.umd.js +293 -285
- package/es/ButtonGroup/ButtonList.js +18 -36
- package/es/ButtonGroup/ButtonMenu.js +14 -27
- package/es/ButtonGroup/PopConfirmTitle.js +5 -16
- package/es/ButtonGroup/index.js +76 -107
- package/es/DragContent/DragBar.js +6 -18
- package/es/DragContent/index.js +12 -30
- package/es/FormComp/ChunkUploader/api.js +8 -21
- package/es/FormComp/ChunkUploader/index.js +27 -46
- package/es/FormComp/ChunkUploader/lib.js +9 -26
- package/es/FormComp/ChunkUploader/upload-queue.class.js +5 -12
- package/es/FormComp/ChunkUploader/worker.js +2 -7
- package/es/FormComp/EditButton/index.js +16 -35
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +26 -49
- package/es/FormComp/FieldComponent/TitleNode.js +3 -13
- package/es/FormComp/FieldComponent/index.js +87 -131
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -61
- package/es/FormComp/RenderItemGroup/index.js +34 -56
- package/es/FormComp/Uploader/index.js +38 -64
- package/es/FormComp/Uploader/util.js +2 -11
- package/es/FormComp/VarTemplate/index.js +31 -44
- package/es/FormComp/index.js +1 -15
- package/es/NavLeafScroll/index.js +35 -53
- package/es/RefactorTree/index.js +29 -52
- package/es/RefactorTree/indexTreeNode.js +31 -54
- package/es/RefactorTree/style/index.js +1 -3
- package/es/RefactorTree/util.js +10 -18
- package/es/SpecIcon/fonts/iconfont.js +0 -2
- package/es/SpecIcon/index.js +17 -30
- package/es/SplitterLayout/Pane.js +5 -17
- package/es/SplitterLayout/index.js +13 -24
- package/es/StandardContent/SplitterLayout/Pane.js +13 -25
- package/es/StandardContent/SplitterLayout/index.js +30 -43
- package/es/StandardContent/SubfieldContent.js +13 -28
- package/es/StandardContent/WrapperContent.js +10 -24
- package/es/StandardDragModal/index.d.ts +11 -0
- package/es/StandardDragModal/index.js +30 -0
- package/es/StandardFilter/index.js +27 -46
- package/es/StandardForm/ActionList.js +8 -21
- package/es/StandardForm/StepForm.js +40 -68
- package/es/StandardForm/TabForm.js +26 -52
- package/es/StandardForm/index.js +28 -55
- package/es/StandardModal/UpdateFormRef.js +4 -18
- package/es/StandardModal/index.d.ts +3 -0
- package/es/StandardModal/index.js +118 -119
- package/es/StandardPanel/index.js +32 -53
- package/es/StandardTable/index.js +17 -44
- package/es/StandardTable/style/index.js +1 -3
- package/es/components/IconNode/index.js +6 -17
- package/es/components/index.js +2 -15
- package/es/data/func.code.js +2 -9
- package/es/data/general.config.js +2 -9
- package/es/data/index.js +3 -23
- package/es/index.d.ts +0 -1
- package/es/index.js +24 -238
- package/es/utils/ValueFormat.js +1 -9
- package/es/utils/filterPermission.js +4 -20
- package/es/utils/getParentNodes.js +1 -12
- package/es/utils/index.js +3 -35
- package/lib/ButtonGroup/ButtonList.js +9 -9
- package/lib/ButtonGroup/ButtonMenu.js +11 -11
- package/lib/ButtonGroup/PopConfirmTitle.js +5 -5
- package/lib/ButtonGroup/index.js +47 -47
- package/lib/DragContent/DragBar.js +5 -5
- package/lib/DragContent/index.js +7 -7
- package/lib/FormComp/ChunkUploader/api.js +4 -4
- package/lib/FormComp/ChunkUploader/index.js +10 -10
- package/lib/FormComp/ChunkUploader/lib.js +2 -2
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +2 -2
- package/lib/FormComp/ChunkUploader/worker.js +2 -2
- package/lib/FormComp/EditButton/index.js +10 -10
- package/lib/FormComp/FieldComponent/ReUpload.js +9 -9
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +16 -16
- package/lib/FormComp/FieldComponent/TitleNode.js +4 -4
- package/lib/FormComp/FieldComponent/index.js +47 -47
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +23 -23
- package/lib/FormComp/RenderItemGroup/index.js +20 -21
- package/lib/FormComp/Uploader/index.js +16 -16
- package/lib/FormComp/VarTemplate/index.js +25 -23
- package/lib/FormComp/index.js +2 -2
- package/lib/NavLeafScroll/index.js +28 -28
- package/lib/RefactorTree/index.js +14 -14
- package/lib/RefactorTree/indexTreeNode.js +19 -19
- package/lib/SpecIcon/index.js +13 -13
- package/lib/SplitterLayout/Pane.js +4 -4
- package/lib/SplitterLayout/index.js +10 -10
- package/lib/StandardContent/SplitterLayout/Pane.js +11 -11
- package/lib/StandardContent/SplitterLayout/index.js +27 -27
- package/lib/StandardContent/SubfieldContent.js +9 -9
- package/lib/StandardContent/WrapperContent.js +7 -7
- package/lib/StandardDragModal/index.d.ts +11 -0
- package/lib/StandardDragModal/index.js +43 -0
- package/lib/StandardFilter/index.js +18 -18
- package/lib/StandardForm/ActionList.js +6 -6
- package/lib/StandardForm/StepForm.js +26 -26
- package/lib/StandardForm/TabForm.js +13 -13
- package/lib/StandardForm/index.js +14 -14
- package/lib/StandardModal/UpdateFormRef.js +4 -4
- package/lib/StandardModal/index.d.ts +3 -0
- package/lib/StandardModal/index.js +99 -70
- package/lib/StandardPanel/index.js +23 -23
- package/lib/StandardTable/index.js +9 -19
- package/lib/components/IconNode/index.js +6 -6
- package/lib/components/index.js +2 -2
- package/lib/data/func.code.js +2 -2
- package/lib/data/general.config.js +2 -2
- package/lib/data/index.js +3 -3
- package/lib/index.d.ts +0 -1
- package/lib/index.js +23 -32
- package/lib/utils/ValueFormat.js +2 -2
- package/lib/utils/filterPermission.js +2 -2
- package/lib/utils/index.js +2 -2
- package/package.json +4 -3
- package/es/ConfigContext/index.d.ts +0 -7
- package/es/ConfigContext/index.js +0 -12
- package/es/locale/index.d.ts +0 -12
- package/es/locale/index.js +0 -5
- package/es/locale/zh_CN.d.ts +0 -4
- package/es/locale/zh_CN.js +0 -34
- package/lib/ConfigContext/index.d.ts +0 -7
- package/lib/ConfigContext/index.js +0 -12
- package/lib/locale/index.d.ts +0 -12
- package/lib/locale/index.js +0 -5
- package/lib/locale/zh_CN.d.ts +0 -4
- package/lib/locale/zh_CN.js +0 -34
|
@@ -1,51 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _row = _interopRequireDefault(require("antd/es/row"));
|
|
11
|
-
|
|
12
|
-
require("antd/es/modal/style");
|
|
13
|
-
|
|
14
|
-
var _modal = _interopRequireDefault(require("antd/es/modal"));
|
|
15
|
-
|
|
16
|
-
require("antd/es/button/style");
|
|
17
|
-
|
|
18
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
19
|
-
|
|
20
|
-
require("antd/es/form/style");
|
|
21
|
-
|
|
22
|
-
var _form = _interopRequireDefault(require("antd/es/form"));
|
|
23
|
-
|
|
24
|
-
var _tslib = require("tslib");
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
|
-
var _data = require("../data");
|
|
29
|
-
|
|
30
|
-
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
31
|
-
|
|
32
|
-
var _ValueFormat = _interopRequireDefault(require("../utils/ValueFormat.js"));
|
|
33
|
-
|
|
34
|
-
var _IconNode = _interopRequireDefault(require("../components/IconNode"));
|
|
35
|
-
|
|
36
|
-
var _TabForm = _interopRequireDefault(require("../StandardForm/TabForm"));
|
|
37
|
-
|
|
38
|
-
var _StepForm = _interopRequireDefault(require("../StandardForm/StepForm"));
|
|
39
|
-
|
|
40
|
-
var _ActionList = _interopRequireDefault(require("../StandardForm/ActionList.js"));
|
|
41
|
-
|
|
42
|
-
require("./style/index.less");
|
|
43
|
-
|
|
44
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
45
|
-
|
|
46
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
|
-
|
|
48
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/modal/style";
|
|
2
|
+
import _Modal from "antd/es/modal";
|
|
3
|
+
import "antd/es/row/style";
|
|
4
|
+
import _Row from "antd/es/row";
|
|
5
|
+
import "antd/es/button/style";
|
|
6
|
+
import _Button from "antd/es/button";
|
|
7
|
+
import "antd/es/form/style";
|
|
8
|
+
import _Form from "antd/es/form";
|
|
49
9
|
|
|
50
10
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
51
11
|
|
|
@@ -61,6 +21,19 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
61
21
|
|
|
62
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
63
23
|
|
|
24
|
+
import { __rest } from "tslib";
|
|
25
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
26
|
+
import { general } from '../data';
|
|
27
|
+
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
28
|
+
import UtilValueFormat from '../utils/ValueFormat.js';
|
|
29
|
+
import IconNode from "../components/IconNode";
|
|
30
|
+
import TabForm from '../StandardForm/TabForm';
|
|
31
|
+
import StepForm from '../StandardForm/StepForm';
|
|
32
|
+
import ActionList from '../StandardForm/ActionList.js';
|
|
33
|
+
import './style/index.less';
|
|
34
|
+
import { DraggableModal, DraggableModalProvider } from 'ant-design-draggable-modal';
|
|
35
|
+
import 'ant-design-draggable-modal/dist/index.css';
|
|
36
|
+
|
|
64
37
|
var StandardModal = function StandardModal(props) {
|
|
65
38
|
var children = props.children,
|
|
66
39
|
className = props.className,
|
|
@@ -87,32 +60,34 @@ var StandardModal = function StandardModal(props) {
|
|
|
87
60
|
tabsConfig = props.tabsConfig,
|
|
88
61
|
stepsConfig = props.stepsConfig,
|
|
89
62
|
displayLayout = props.displayLayout,
|
|
90
|
-
|
|
63
|
+
_props$dragAble = props.dragAble,
|
|
64
|
+
dragAble = _props$dragAble === void 0 ? false : _props$dragAble,
|
|
65
|
+
otherProps = __rest(props, ["children", "className", "style", "size", "type", "formItemGroup", "title", "visible", "formPrefix", "formPostfix", "initialValues", "hideRequiredMark", "bodyStyle", "footer", "footerButtonGroup", "hideFooter", "getFormFields", "fieldStatus", "formLayout", "tabsConfig", "stepsConfig", "displayLayout", "dragAble"]);
|
|
91
66
|
|
|
92
|
-
var _Form$useForm =
|
|
67
|
+
var _Form$useForm = _Form.useForm(),
|
|
93
68
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
94
69
|
modalForm = _Form$useForm2[0];
|
|
95
70
|
|
|
96
|
-
var _useState =
|
|
71
|
+
var _useState = useState(),
|
|
97
72
|
_useState2 = _slicedToArray(_useState, 2),
|
|
98
73
|
modalFormRef = _useState2[0],
|
|
99
74
|
setModalFormRef = _useState2[1]; // <---- set the ref when Form Rendered
|
|
100
75
|
|
|
101
76
|
|
|
102
|
-
var _useState3 =
|
|
77
|
+
var _useState3 = useState(0),
|
|
103
78
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
104
79
|
bodyMaxHeight = _useState4[0],
|
|
105
80
|
setBodyMaxHeight = _useState4[1]; // setTabFormChild
|
|
106
81
|
|
|
107
82
|
|
|
108
|
-
var _useState5 =
|
|
83
|
+
var _useState5 = useState(),
|
|
109
84
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
110
85
|
formChild = _useState6[0],
|
|
111
86
|
setFormChild = _useState6[1]; // <---- set the ref when Form Rendered
|
|
112
87
|
// 按钮栏是否有显示(默认显示)
|
|
113
88
|
|
|
114
89
|
|
|
115
|
-
var hasFooterBar =
|
|
90
|
+
var hasFooterBar = useMemo(function () {
|
|
116
91
|
var _a, _b, _c, _d, _e;
|
|
117
92
|
|
|
118
93
|
var openLog = false;
|
|
@@ -184,7 +159,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
184
159
|
}; // fill Form when modal open 此处可解决获取 Form.useForm warning
|
|
185
160
|
|
|
186
161
|
|
|
187
|
-
|
|
162
|
+
useEffect(function () {
|
|
188
163
|
if (visible && modalFormRef) {
|
|
189
164
|
// <---- check ref before use the form instance
|
|
190
165
|
if (initialValues && _typeof(initialValues) === 'object') {
|
|
@@ -196,7 +171,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
196
171
|
// }
|
|
197
172
|
|
|
198
173
|
}, [modalFormRef, visible]);
|
|
199
|
-
|
|
174
|
+
useEffect(function () {
|
|
200
175
|
if (visible) {
|
|
201
176
|
initBodyMaxHeight(); // 让resize事件触发 initBodyMaxHeight
|
|
202
177
|
|
|
@@ -214,15 +189,15 @@ var StandardModal = function StandardModal(props) {
|
|
|
214
189
|
if (type === 'form') {
|
|
215
190
|
modalForm.validateFields().then(function (values) {
|
|
216
191
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
217
|
-
delete values
|
|
192
|
+
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
218
193
|
}
|
|
219
194
|
|
|
220
|
-
var resultValues = (
|
|
195
|
+
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
221
196
|
|
|
222
197
|
if (onSubmit) {
|
|
223
198
|
onSubmit(Object.assign({}, resultValues));
|
|
224
199
|
}
|
|
225
|
-
})
|
|
200
|
+
}).catch(function () {
|
|
226
201
|
// 定位到第一条表单异常的
|
|
227
202
|
var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
|
|
228
203
|
|
|
@@ -236,15 +211,15 @@ var StandardModal = function StandardModal(props) {
|
|
|
236
211
|
formChild.validateFields().then(function (values) {
|
|
237
212
|
// console.log(values)
|
|
238
213
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
239
|
-
delete values
|
|
214
|
+
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
240
215
|
}
|
|
241
216
|
|
|
242
|
-
var resultValues = (
|
|
217
|
+
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
243
218
|
|
|
244
219
|
if (onSubmit) {
|
|
245
220
|
onSubmit(Object.assign({}, resultValues));
|
|
246
221
|
}
|
|
247
|
-
})
|
|
222
|
+
}).catch(function () {
|
|
248
223
|
// 定位到第一条表单异常的
|
|
249
224
|
var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
|
|
250
225
|
|
|
@@ -290,7 +265,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
290
265
|
size = _props$size2 === void 0 ? 'md' : _props$size2;
|
|
291
266
|
|
|
292
267
|
if (Array.isArray(formItemGroup)) {
|
|
293
|
-
return /*#__PURE__*/
|
|
268
|
+
return /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
294
269
|
size: size,
|
|
295
270
|
layout: formLayout,
|
|
296
271
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -321,7 +296,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
321
296
|
formChild.validateFields(validatorGroup).then(function () {
|
|
322
297
|
// if (stepClick) stepClick(type, formChild, values);
|
|
323
298
|
extraFunc();
|
|
324
|
-
})
|
|
299
|
+
}).catch(function () {// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
325
300
|
});
|
|
326
301
|
break;
|
|
327
302
|
|
|
@@ -355,9 +330,10 @@ var StandardModal = function StandardModal(props) {
|
|
|
355
330
|
if (Array.isArray(footerButtonGroup)) {
|
|
356
331
|
if (footerButtonGroup.length === 0) return null; // <div>按钮组合配置为空</div>
|
|
357
332
|
|
|
358
|
-
return /*#__PURE__*/
|
|
333
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, footerButtonGroup.map(function (item) {
|
|
359
334
|
if (_typeof(item) === 'object') {
|
|
360
335
|
if (item.isHide) return null;
|
|
336
|
+
|
|
361
337
|
var name = item.name,
|
|
362
338
|
_type = item.type,
|
|
363
339
|
icon = item.icon,
|
|
@@ -365,11 +341,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
365
341
|
disabled = item.disabled,
|
|
366
342
|
loading = item.loading,
|
|
367
343
|
fn = item.fn,
|
|
368
|
-
others =
|
|
369
|
-
|
|
344
|
+
others = __rest(item, ["name", "type", "icon", "ghost", "disabled", "loading", "fn"]);
|
|
345
|
+
|
|
346
|
+
return /*#__PURE__*/React.createElement(_Button, Object.assign({
|
|
370
347
|
key: name,
|
|
371
348
|
type: _type || 'primary',
|
|
372
|
-
icon: /*#__PURE__*/
|
|
349
|
+
icon: /*#__PURE__*/React.createElement(IconNode, {
|
|
373
350
|
icon: icon
|
|
374
351
|
}),
|
|
375
352
|
ghost: ghost,
|
|
@@ -393,12 +370,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
393
370
|
}
|
|
394
371
|
|
|
395
372
|
if (footer) return footer;
|
|
396
|
-
return /*#__PURE__*/
|
|
373
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, Object.assign({
|
|
397
374
|
key: "submit",
|
|
398
375
|
type: "primary",
|
|
399
376
|
loading: confirmLoading,
|
|
400
377
|
onClick: handleSubmit
|
|
401
|
-
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/
|
|
378
|
+
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/React.createElement(_Button, Object.assign({
|
|
402
379
|
key: "back",
|
|
403
380
|
onClick: handleCancel
|
|
404
381
|
}, cancelButtonProps), cancelText || '取消'));
|
|
@@ -409,7 +386,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
409
386
|
|
|
410
387
|
if (type === 'stepForm') {
|
|
411
388
|
var currentStepInfo = formItemGroup[stepsConfig.current];
|
|
412
|
-
return ((_a = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _a === void 0 ? void 0 : _a.length) > 0 ? /*#__PURE__*/
|
|
389
|
+
return ((_a = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _a === void 0 ? void 0 : _a.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
|
|
413
390
|
list: currentStepInfo.actions || [],
|
|
414
391
|
onStep: handleStepType,
|
|
415
392
|
form: formChild,
|
|
@@ -421,7 +398,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
421
398
|
var activeTabInfo = formItemGroup.find(function (fItem) {
|
|
422
399
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
423
400
|
});
|
|
424
|
-
return ((_b = activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) === null || _b === void 0 ? void 0 : _b.length) > 0 ? /*#__PURE__*/
|
|
401
|
+
return ((_b = activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) === null || _b === void 0 ? void 0 : _b.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
|
|
425
402
|
list: activeTabInfo.actions || [],
|
|
426
403
|
form: formChild,
|
|
427
404
|
other: props
|
|
@@ -429,15 +406,77 @@ var StandardModal = function StandardModal(props) {
|
|
|
429
406
|
}
|
|
430
407
|
|
|
431
408
|
return hasFooterBar ? renderButtonGroup() : null;
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
|
|
409
|
+
}; // 内容渲染
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
var renderChildrenNodes = function renderChildrenNodes() {
|
|
413
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children, type === 'form' && /*#__PURE__*/React.createElement(_Form, {
|
|
414
|
+
layout: formLayout,
|
|
415
|
+
ref: setModalFormRef,
|
|
416
|
+
form: modalForm,
|
|
417
|
+
onFinish: handleSubmit,
|
|
418
|
+
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark,
|
|
419
|
+
// initialValues={{ ...initialValues }}
|
|
420
|
+
scrollToFirstError: true,
|
|
421
|
+
className: "modalForm"
|
|
422
|
+
}, formPrefix && /*#__PURE__*/React.createElement(_Row, null, formPrefix(modalForm, props, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/React.createElement(_Row, null, formPostfix(modalForm, props, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/React.createElement(TabForm, {
|
|
423
|
+
grid: size,
|
|
424
|
+
layout: formLayout,
|
|
425
|
+
fieldStatus: fieldStatus,
|
|
426
|
+
actionHide: true,
|
|
427
|
+
// @ts-ignore
|
|
428
|
+
getFormFields: function getFormFields(fields, form) {
|
|
429
|
+
setFormChild(form);
|
|
430
|
+
_getFormFields && _getFormFields(fields, form);
|
|
431
|
+
},
|
|
432
|
+
formItemGroup: formItemGroup,
|
|
433
|
+
tabsConfig: tabsConfig,
|
|
434
|
+
onSubmit: handleSubmit,
|
|
435
|
+
initialValues: Object.assign({}, initialValues),
|
|
436
|
+
displayLayout: displayLayout
|
|
437
|
+
}), type === 'stepForm' && /*#__PURE__*/React.createElement(StepForm, {
|
|
438
|
+
grid: size,
|
|
439
|
+
layout: formLayout,
|
|
440
|
+
fieldStatus: fieldStatus,
|
|
441
|
+
actionHide: true,
|
|
442
|
+
// @ts-ignore
|
|
443
|
+
getFormFields: function getFormFields(fields, form) {
|
|
444
|
+
setFormChild(form);
|
|
445
|
+
_getFormFields && _getFormFields(fields, form);
|
|
446
|
+
},
|
|
447
|
+
formItemGroup: formItemGroup,
|
|
448
|
+
stepsConfig: stepsConfig,
|
|
449
|
+
onSubmit: handleSubmit,
|
|
450
|
+
initialValues: Object.assign({}, initialValues),
|
|
451
|
+
displayLayout: displayLayout
|
|
452
|
+
}));
|
|
453
|
+
}; // 可拖动及缩放
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
if (dragAble) {
|
|
457
|
+
return /*#__PURE__*/React.createElement(DraggableModalProvider, null, /*#__PURE__*/React.createElement(DraggableModal, Object.assign({
|
|
458
|
+
destroyOnClose: true,
|
|
459
|
+
initialWidth: otherProps.width || general.modalSize[size].width,
|
|
460
|
+
initialHeight: otherProps.height
|
|
461
|
+
}, otherProps, {
|
|
462
|
+
zIndex: 1001,
|
|
463
|
+
visible: visible,
|
|
464
|
+
className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
|
|
465
|
+
onCancel: handleCancel,
|
|
466
|
+
afterClose: onAfterClose,
|
|
467
|
+
onOk: handleSubmit,
|
|
468
|
+
title: title,
|
|
469
|
+
footer: renderFooter()
|
|
470
|
+
}), renderChildrenNodes()));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return /*#__PURE__*/React.createElement(_Modal, Object.assign({
|
|
435
474
|
destroyOnClose: true,
|
|
436
|
-
maskClosable: false
|
|
475
|
+
maskClosable: false,
|
|
476
|
+
width: general.modalSize[size].width
|
|
437
477
|
}, otherProps, {
|
|
438
478
|
visible: visible,
|
|
439
479
|
title: title,
|
|
440
|
-
width: _data.general.modalSize[size].width,
|
|
441
480
|
footer: renderFooter(),
|
|
442
481
|
className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
|
|
443
482
|
style: Object.assign({
|
|
@@ -450,47 +489,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
450
489
|
onCancel: handleCancel,
|
|
451
490
|
afterClose: onAfterClose,
|
|
452
491
|
onOk: handleSubmit
|
|
453
|
-
}),
|
|
454
|
-
layout: formLayout,
|
|
455
|
-
ref: setModalFormRef,
|
|
456
|
-
form: modalForm,
|
|
457
|
-
onFinish: handleSubmit,
|
|
458
|
-
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark,
|
|
459
|
-
// initialValues={{ ...initialValues }}
|
|
460
|
-
scrollToFirstError: true,
|
|
461
|
-
className: "modalForm"
|
|
462
|
-
}, formPrefix && /*#__PURE__*/_react["default"].createElement(_row["default"], null, formPrefix(modalForm, props, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/_react["default"].createElement(_row["default"], null, formPostfix(modalForm, props, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/_react["default"].createElement(_TabForm["default"], {
|
|
463
|
-
grid: size,
|
|
464
|
-
layout: formLayout,
|
|
465
|
-
fieldStatus: fieldStatus,
|
|
466
|
-
actionHide: true,
|
|
467
|
-
// @ts-ignore
|
|
468
|
-
getFormFields: function getFormFields(fields, form) {
|
|
469
|
-
setFormChild(form);
|
|
470
|
-
_getFormFields && _getFormFields(fields, form);
|
|
471
|
-
},
|
|
472
|
-
formItemGroup: formItemGroup,
|
|
473
|
-
tabsConfig: tabsConfig,
|
|
474
|
-
onSubmit: handleSubmit,
|
|
475
|
-
initialValues: Object.assign({}, initialValues),
|
|
476
|
-
displayLayout: displayLayout
|
|
477
|
-
}), type === 'stepForm' && /*#__PURE__*/_react["default"].createElement(_StepForm["default"], {
|
|
478
|
-
grid: size,
|
|
479
|
-
layout: formLayout,
|
|
480
|
-
fieldStatus: fieldStatus,
|
|
481
|
-
actionHide: true,
|
|
482
|
-
// @ts-ignore
|
|
483
|
-
getFormFields: function getFormFields(fields, form) {
|
|
484
|
-
setFormChild(form);
|
|
485
|
-
_getFormFields && _getFormFields(fields, form);
|
|
486
|
-
},
|
|
487
|
-
formItemGroup: formItemGroup,
|
|
488
|
-
stepsConfig: stepsConfig,
|
|
489
|
-
onSubmit: handleSubmit,
|
|
490
|
-
initialValues: Object.assign({}, initialValues),
|
|
491
|
-
displayLayout: displayLayout
|
|
492
|
-
}));
|
|
492
|
+
}), renderChildrenNodes());
|
|
493
493
|
};
|
|
494
494
|
|
|
495
|
-
|
|
496
|
-
exports["default"] = _default;
|
|
495
|
+
export default StandardModal;
|
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/popover/style");
|
|
11
|
-
|
|
12
|
-
var _popover = _interopRequireDefault(require("antd/es/popover"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/radio/style");
|
|
15
|
-
|
|
16
|
-
var _radio = _interopRequireDefault(require("antd/es/radio"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
-
|
|
22
|
-
require("./style/index.less");
|
|
23
|
-
|
|
24
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/popover/style";
|
|
2
|
+
import _Popover from "antd/es/popover";
|
|
3
|
+
import "antd/es/radio/style";
|
|
4
|
+
import _Radio from "antd/es/radio";
|
|
29
5
|
|
|
30
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
7
|
|
|
@@ -39,6 +15,10 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
39
15
|
|
|
40
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
17
|
|
|
18
|
+
import React, { useState, useMemo, useRef, useEffect } from 'react';
|
|
19
|
+
import classNames from 'classnames';
|
|
20
|
+
import './style/index.less';
|
|
21
|
+
|
|
42
22
|
var StandardPanel = function StandardPanel(props) {
|
|
43
23
|
var className = props.className,
|
|
44
24
|
style = props.style,
|
|
@@ -51,7 +31,7 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
51
31
|
type = props.type,
|
|
52
32
|
postfix = props.postfix;
|
|
53
33
|
|
|
54
|
-
var _useState =
|
|
34
|
+
var _useState = useState(56),
|
|
55
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
56
36
|
headerHeight = _useState2[0],
|
|
57
37
|
setHeaderHeight = _useState2[1];
|
|
@@ -71,9 +51,9 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
71
51
|
}
|
|
72
52
|
};
|
|
73
53
|
|
|
74
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
55
|
className: className
|
|
76
|
-
}, /*#__PURE__*/
|
|
56
|
+
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
77
57
|
size: size,
|
|
78
58
|
defaultValue: activeKey,
|
|
79
59
|
buttonStyle: "solid",
|
|
@@ -81,7 +61,7 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
81
61
|
return handleChange(e);
|
|
82
62
|
}
|
|
83
63
|
}, list && Array.isArray(list) && list.map(function (item) {
|
|
84
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
85
65
|
key: item.value,
|
|
86
66
|
value: item.value
|
|
87
67
|
}, item.label);
|
|
@@ -90,14 +70,14 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
90
70
|
|
|
91
71
|
|
|
92
72
|
var popoverShow = function popoverShow() {
|
|
93
|
-
return title.content ? /*#__PURE__*/
|
|
73
|
+
return title.content ? /*#__PURE__*/React.createElement(_Popover, {
|
|
94
74
|
content: title.content,
|
|
95
75
|
placement: title.placement
|
|
96
76
|
}, " ", title.label, " ") : title;
|
|
97
77
|
};
|
|
98
78
|
|
|
99
|
-
var panelHeaderRef =
|
|
100
|
-
var bodyLimitStyle =
|
|
79
|
+
var panelHeaderRef = useRef();
|
|
80
|
+
var bodyLimitStyle = useMemo(function () {
|
|
101
81
|
if (height) {
|
|
102
82
|
return {
|
|
103
83
|
overflow: 'auto',
|
|
@@ -107,49 +87,48 @@ var StandardPanel = function StandardPanel(props) {
|
|
|
107
87
|
|
|
108
88
|
return {};
|
|
109
89
|
}, [height, headerHeight]);
|
|
110
|
-
|
|
90
|
+
useEffect(function () {
|
|
111
91
|
if (panelHeaderRef && panelHeaderRef.current) {
|
|
112
92
|
setHeaderHeight(panelHeaderRef.current.clientHeight);
|
|
113
93
|
}
|
|
114
94
|
}, [panelHeaderRef]);
|
|
115
|
-
return /*#__PURE__*/
|
|
116
|
-
className: (
|
|
95
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: classNames('spec-panel', className, type === 'reverse' ? 'spec-panel-reverse' : '', type === 'border' ? 'spec-panel-border' : ''),
|
|
117
97
|
style: Object.assign(Object.assign({}, style), {
|
|
118
98
|
height: "".concat(height, "px")
|
|
119
99
|
})
|
|
120
|
-
}, /*#__PURE__*/
|
|
100
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
121
101
|
className: "spec-panel-header",
|
|
122
102
|
ref: panelHeaderRef
|
|
123
|
-
}, /*#__PURE__*/
|
|
103
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
124
104
|
className: "spec-panel-title"
|
|
125
|
-
}, /*#__PURE__*/
|
|
126
|
-
className: (
|
|
127
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: classNames(type === 'border' ? 'sub-header-line' : 'sub-header-base')
|
|
107
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
128
108
|
className: "header-text"
|
|
129
|
-
}, popoverShow()))), /*#__PURE__*/
|
|
109
|
+
}, popoverShow()))), /*#__PURE__*/React.createElement("div", {
|
|
130
110
|
className: "spec-panel-inner"
|
|
131
|
-
}, badges && Array.isArray(badges) && /*#__PURE__*/
|
|
111
|
+
}, badges && Array.isArray(badges) && /*#__PURE__*/React.createElement("span", {
|
|
132
112
|
className: "badges"
|
|
133
113
|
}, badges.map(function (item) {
|
|
134
|
-
return /*#__PURE__*/
|
|
114
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
135
115
|
className: "badges-item",
|
|
136
116
|
key: item.value
|
|
137
|
-
}, /*#__PURE__*/
|
|
117
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
138
118
|
style: item.color ? {
|
|
139
119
|
background: item.color
|
|
140
120
|
} : {}
|
|
141
121
|
}), item.label);
|
|
142
|
-
}))), cateConfig && /*#__PURE__*/
|
|
122
|
+
}))), cateConfig && /*#__PURE__*/React.createElement(RenderGroupList, Object.assign({
|
|
143
123
|
className: "spec-panel-cate"
|
|
144
|
-
}, cateConfig)), buttonConfig && /*#__PURE__*/
|
|
124
|
+
}, cateConfig)), buttonConfig && /*#__PURE__*/React.createElement(RenderGroupList, Object.assign({
|
|
145
125
|
className: "spec-panel-buttons"
|
|
146
|
-
}, buttonConfig)), postfix && /*#__PURE__*/
|
|
126
|
+
}, buttonConfig)), postfix && /*#__PURE__*/React.createElement("div", {
|
|
147
127
|
className: "spec-panel-extra"
|
|
148
|
-
}, postfix)), /*#__PURE__*/
|
|
128
|
+
}, postfix)), /*#__PURE__*/React.createElement("div", {
|
|
149
129
|
className: "spec-panel-body",
|
|
150
130
|
style: Object.assign({}, bodyLimitStyle)
|
|
151
131
|
}, children));
|
|
152
132
|
};
|
|
153
133
|
|
|
154
|
-
|
|
155
|
-
exports["default"] = _default;
|
|
134
|
+
export default StandardPanel;
|
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
require("antd/es/table/style");
|
|
11
|
-
|
|
12
|
-
var _table = _interopRequireDefault(require("antd/es/table"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/card/style");
|
|
15
|
-
|
|
16
|
-
var _card = _interopRequireDefault(require("antd/es/card"));
|
|
17
|
-
|
|
18
|
-
var _tslib = require("tslib");
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
-
|
|
24
|
-
var _index = _interopRequireDefault(require("../ButtonGroup/index"));
|
|
25
|
-
|
|
26
|
-
require("./style/index.less");
|
|
27
|
-
|
|
28
|
-
var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
29
|
-
|
|
30
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/table/style";
|
|
2
|
+
import _Table from "antd/es/table";
|
|
3
|
+
import "antd/es/card/style";
|
|
4
|
+
import _Card from "antd/es/card";
|
|
5
|
+
import { __rest } from "tslib";
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import ButtonGroup from '../ButtonGroup/index';
|
|
9
|
+
import './style/index.less';
|
|
35
10
|
|
|
36
11
|
var StandardTable = function StandardTable(props) {
|
|
37
12
|
// const ref= React.createRef<Card>();
|
|
38
|
-
var localeContext = (0, _react.useContext)(_ConfigContext["default"]);
|
|
39
|
-
console.log('aaa', localeContext);
|
|
40
13
|
var _props$data = props.data,
|
|
41
14
|
data = _props$data === void 0 ? {} : _props$data,
|
|
42
15
|
rowKey = props.rowKey,
|
|
@@ -49,7 +22,8 @@ var StandardTable = function StandardTable(props) {
|
|
|
49
22
|
emptyText = props.emptyText,
|
|
50
23
|
codes = props.codes,
|
|
51
24
|
permissionCodes = props.permissionCodes,
|
|
52
|
-
rest =
|
|
25
|
+
rest = __rest(props, ["data", "rowKey", "rowSelection", "columns", "hideOrderNumber", "orderNumber", "className", "emptyText", "codes", "permissionCodes"]); // 加上类型修复 TS:2322 报警
|
|
26
|
+
|
|
53
27
|
|
|
54
28
|
var resetColumns = [Object.assign({
|
|
55
29
|
width: 58,
|
|
@@ -97,7 +71,7 @@ var StandardTable = function StandardTable(props) {
|
|
|
97
71
|
|
|
98
72
|
if (Array.isArray(buttonGroup) || typeof buttonGroup === 'function') {
|
|
99
73
|
if (recombinationGroup.length === 0) return '-';
|
|
100
|
-
return /*#__PURE__*/
|
|
74
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
101
75
|
type: "text",
|
|
102
76
|
min: colItem.min || 2,
|
|
103
77
|
options: recombinationGroup,
|
|
@@ -114,7 +88,7 @@ var StandardTable = function StandardTable(props) {
|
|
|
114
88
|
}
|
|
115
89
|
};
|
|
116
90
|
|
|
117
|
-
return /*#__PURE__*/
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderTableButtonGroup(colItem.buttonGroup));
|
|
118
92
|
};
|
|
119
93
|
} else if (!colItem.render) {
|
|
120
94
|
// 若未配置render,则给加个默认的返回方法
|
|
@@ -130,10 +104,10 @@ var StandardTable = function StandardTable(props) {
|
|
|
130
104
|
resetColumns = hideOrderNumber ? columns : resetColumns.concat(columns);
|
|
131
105
|
}
|
|
132
106
|
|
|
133
|
-
return /*#__PURE__*/
|
|
134
|
-
className: (
|
|
107
|
+
return /*#__PURE__*/React.createElement(_Card, {
|
|
108
|
+
className: classNames('standard-table', className),
|
|
135
109
|
bordered: false
|
|
136
|
-
}, /*#__PURE__*/
|
|
110
|
+
}, /*#__PURE__*/React.createElement(_Table, Object.assign({
|
|
137
111
|
rowKey: rowKey || 'id',
|
|
138
112
|
rowSelection: rowSelection ? Object.assign(Object.assign({}, rowSelection), {
|
|
139
113
|
columnWidth: 30
|
|
@@ -149,5 +123,4 @@ var StandardTable = function StandardTable(props) {
|
|
|
149
123
|
}, rest)));
|
|
150
124
|
};
|
|
151
125
|
|
|
152
|
-
|
|
153
|
-
exports["default"] = _default;
|
|
126
|
+
export default StandardTable;
|