wargerm 0.2.19 → 0.2.23
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/components/Cascader/index.d.ts +8 -0
- package/dist/components/Swiper/index.d.ts +4 -0
- package/dist/components/WForm/index.d.ts +1 -1
- package/dist/index.css +50 -17
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.css +50 -17
- package/dist/index.esm.js +1268 -260
- package/dist/index.js +1266 -256
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
@@ -4,8 +4,8 @@ import 'antd/es/dropdown/style';
|
|
4
4
|
import _Dropdown from 'antd/es/dropdown';
|
5
5
|
import 'antd/es/menu/style';
|
6
6
|
import _Menu from 'antd/es/menu';
|
7
|
-
import React, { useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
|
8
|
-
import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined,
|
7
|
+
import React, { useState, useEffect, useMemo, useImperativeHandle, useRef, createContext, useContext, createElement, useLayoutEffect } from 'react';
|
8
|
+
import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, ExclamationCircleOutlined, MoreOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
|
9
9
|
import 'antd/es/input/style';
|
10
10
|
import _Input from 'antd/es/input';
|
11
11
|
import 'antd/es/input-number/style';
|
@@ -36,6 +36,8 @@ import _Checkbox from 'antd/es/checkbox';
|
|
36
36
|
import 'antd/es/tree-select/style';
|
37
37
|
import _TreeSelect from 'antd/es/tree-select';
|
38
38
|
import uniqBy from 'lodash/uniqBy';
|
39
|
+
import 'antd/es/cascader/style';
|
40
|
+
import _Cascader from 'antd/es/cascader';
|
39
41
|
import CountUp from 'react-countup';
|
40
42
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
41
43
|
import SwiperCore, { Pagination, Navigation, Autoplay } from 'swiper';
|
@@ -44,7 +46,10 @@ import _Breadcrumb from 'antd/es/breadcrumb';
|
|
44
46
|
import ReactDOM from 'react-dom';
|
45
47
|
import 'antd/es/modal/style';
|
46
48
|
import _Modal from 'antd/es/modal';
|
47
|
-
import
|
49
|
+
import 'antd/es/config-provider/style';
|
50
|
+
import 'antd/es/config-provider';
|
51
|
+
import 'antd/es/locale/zh_CN';
|
52
|
+
import ProTable, { TableDropdown } from '@ant-design/pro-table';
|
48
53
|
|
49
54
|
function ownKeys(object, enumerableOnly) {
|
50
55
|
var keys = Object.keys(object);
|
@@ -7595,7 +7600,60 @@ RangePicker$2.defaultProps = {};
|
|
7595
7600
|
var Index$6 = WDatePicker$1;
|
7596
7601
|
Index$6.RangePicker = RangePicker$2;
|
7597
7602
|
|
7598
|
-
var _excluded$6 = ["
|
7603
|
+
var _excluded$6 = ["request", "options", "onLoad", "value", "onChange"];
|
7604
|
+
|
7605
|
+
var WCascader = function WCascader(props) {
|
7606
|
+
var request = props.request,
|
7607
|
+
options = props.options,
|
7608
|
+
onLoad = props.onLoad,
|
7609
|
+
value = props.value,
|
7610
|
+
_onChange = props.onChange,
|
7611
|
+
extraProps = _objectWithoutProperties(props, _excluded$6);
|
7612
|
+
|
7613
|
+
var _useState = useState(null),
|
7614
|
+
_useState2 = _slicedToArray(_useState, 2),
|
7615
|
+
resList = _useState2[0],
|
7616
|
+
setResList = _useState2[1];
|
7617
|
+
|
7618
|
+
useEffect(function () {
|
7619
|
+
_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
7620
|
+
var res;
|
7621
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
7622
|
+
while (1) {
|
7623
|
+
switch (_context.prev = _context.next) {
|
7624
|
+
case 0:
|
7625
|
+
if (!request) {
|
7626
|
+
_context.next = 6;
|
7627
|
+
break;
|
7628
|
+
}
|
7629
|
+
|
7630
|
+
_context.next = 3;
|
7631
|
+
return request();
|
7632
|
+
|
7633
|
+
case 3:
|
7634
|
+
res = _context.sent;
|
7635
|
+
setResList(res);
|
7636
|
+
onLoad && onLoad(res);
|
7637
|
+
|
7638
|
+
case 6:
|
7639
|
+
case "end":
|
7640
|
+
return _context.stop();
|
7641
|
+
}
|
7642
|
+
}
|
7643
|
+
}, _callee);
|
7644
|
+
}))();
|
7645
|
+
}, [JSON.stringify(resList)]);
|
7646
|
+
return /*#__PURE__*/React.createElement(_Cascader, _objectSpread2({
|
7647
|
+
value: typeof value === 'string' ? [value] : value,
|
7648
|
+
onChange: function onChange(v, options) {
|
7649
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, options);
|
7650
|
+
},
|
7651
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
7652
|
+
options: request ? resList : options
|
7653
|
+
}, extraProps));
|
7654
|
+
};
|
7655
|
+
|
7656
|
+
var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "onFormChange", "onSubmit", "onReset"];
|
7599
7657
|
var RangePicker$3 = Index$6.RangePicker;
|
7600
7658
|
|
7601
7659
|
var WForm = function WForm(props, ref) {
|
@@ -7609,7 +7667,7 @@ var WForm = function WForm(props, ref) {
|
|
7609
7667
|
onFormChange = props.onFormChange,
|
7610
7668
|
onSubmit = props.onSubmit,
|
7611
7669
|
onReset = props.onReset,
|
7612
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
7670
|
+
extraProps = _objectWithoutProperties(props, _excluded$7);
|
7613
7671
|
|
7614
7672
|
var _Form$useForm = _Form.useForm(),
|
7615
7673
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
@@ -7695,7 +7753,7 @@ var WForm = function WForm(props, ref) {
|
|
7695
7753
|
});
|
7696
7754
|
}
|
7697
7755
|
}, c.fieldProps), _extraProps))));
|
7698
|
-
} else if (c.valueType == '
|
7756
|
+
} else if (c.valueType == 'cascader') {
|
7699
7757
|
var _extraProps2 = {};
|
7700
7758
|
|
7701
7759
|
if (c.request) {
|
@@ -7723,16 +7781,53 @@ var WForm = function WForm(props, ref) {
|
|
7723
7781
|
name: c.dataIndex,
|
7724
7782
|
label: c.title,
|
7725
7783
|
labelCol: _labelCol
|
7784
|
+
}), /*#__PURE__*/React.createElement(WCascader, _objectSpread2(_objectSpread2({
|
7785
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
7786
|
+
disabled: disabled,
|
7787
|
+
onLoad: function onLoad(opt) {
|
7788
|
+
setColumnsFields(function (preColumnsFields) {
|
7789
|
+
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
|
7790
|
+
});
|
7791
|
+
}
|
7792
|
+
}, c.fieldProps), _extraProps2))));
|
7793
|
+
} else if (c.valueType == 'treeSelect') {
|
7794
|
+
var _extraProps3 = {};
|
7795
|
+
|
7796
|
+
if (c.request) {
|
7797
|
+
_extraProps3.request = c.request;
|
7798
|
+
}
|
7799
|
+
|
7800
|
+
var _labelCol2 = {};
|
7801
|
+
|
7802
|
+
if (search && search.labelWidth) {
|
7803
|
+
_labelCol2.style = {
|
7804
|
+
width: search.labelWidth
|
7805
|
+
};
|
7806
|
+
}
|
7807
|
+
|
7808
|
+
return /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
|
7809
|
+
style: {
|
7810
|
+
paddingLeft: '12px',
|
7811
|
+
paddingRight: '12px'
|
7812
|
+
}
|
7813
|
+
}, colProps), {}, {
|
7814
|
+
key: c.dataIndex
|
7815
|
+
}), /*#__PURE__*/React.createElement(_Form.Item, _objectSpread2(_objectSpread2({
|
7816
|
+
initialValue: c.initialValue
|
7817
|
+
}, c.formItemProps), {}, {
|
7818
|
+
name: c.dataIndex,
|
7819
|
+
label: c.title,
|
7820
|
+
labelCol: _labelCol2
|
7726
7821
|
}), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
|
7727
7822
|
disabled: disabled,
|
7728
7823
|
placeholder: "\u8BF7\u9009\u62E9",
|
7729
7824
|
onLoad: function onLoad(opt) {}
|
7730
|
-
}, c.fieldProps),
|
7825
|
+
}, c.fieldProps), _extraProps3))));
|
7731
7826
|
} else if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear'].includes(c.valueType)) {
|
7732
|
-
var
|
7827
|
+
var _labelCol3 = {};
|
7733
7828
|
|
7734
7829
|
if (search && search.labelWidth) {
|
7735
|
-
|
7830
|
+
_labelCol3.style = {
|
7736
7831
|
width: search.labelWidth
|
7737
7832
|
};
|
7738
7833
|
}
|
@@ -7772,16 +7867,16 @@ var WForm = function WForm(props, ref) {
|
|
7772
7867
|
}, c.formItemProps), {}, {
|
7773
7868
|
name: c.dataIndex,
|
7774
7869
|
label: c.title,
|
7775
|
-
labelCol:
|
7870
|
+
labelCol: _labelCol3
|
7776
7871
|
}), /*#__PURE__*/React.createElement(Index$6, _objectSpread2(_objectSpread2(_objectSpread2({
|
7777
7872
|
disabled: disabled,
|
7778
7873
|
placeholder: "\u8BF7\u8F93\u5165"
|
7779
7874
|
}, picker), showTime), c.fieldProps))));
|
7780
7875
|
} else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
|
7781
|
-
var
|
7876
|
+
var _labelCol4 = {};
|
7782
7877
|
|
7783
7878
|
if (search && search.labelWidth) {
|
7784
|
-
|
7879
|
+
_labelCol4.style = {
|
7785
7880
|
width: search.labelWidth
|
7786
7881
|
};
|
7787
7882
|
}
|
@@ -7808,7 +7903,7 @@ var WForm = function WForm(props, ref) {
|
|
7808
7903
|
}, c.formItemProps), {}, {
|
7809
7904
|
name: c.dataIndex,
|
7810
7905
|
label: c.title,
|
7811
|
-
labelCol:
|
7906
|
+
labelCol: _labelCol4
|
7812
7907
|
}), /*#__PURE__*/React.createElement(RangePicker$3, _objectSpread2(_objectSpread2({
|
7813
7908
|
disabled: disabled
|
7814
7909
|
}, _showTime), c.fieldProps))));
|
@@ -7835,10 +7930,10 @@ var WForm = function WForm(props, ref) {
|
|
7835
7930
|
setColumnsFields(function (preColumnsFields) {
|
7836
7931
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
|
7837
7932
|
});
|
7838
|
-
var
|
7933
|
+
var _labelCol5 = {};
|
7839
7934
|
|
7840
7935
|
if (search && search.labelWidth) {
|
7841
|
-
|
7936
|
+
_labelCol5.style = {
|
7842
7937
|
width: search.labelWidth
|
7843
7938
|
};
|
7844
7939
|
}
|
@@ -7855,7 +7950,7 @@ var WForm = function WForm(props, ref) {
|
|
7855
7950
|
}, c.formItemProps), {}, {
|
7856
7951
|
name: c.dataIndex,
|
7857
7952
|
label: c.title,
|
7858
|
-
labelCol:
|
7953
|
+
labelCol: _labelCol5
|
7859
7954
|
}), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
|
7860
7955
|
disabled: disabled,
|
7861
7956
|
options: options
|
@@ -7884,10 +7979,10 @@ var WForm = function WForm(props, ref) {
|
|
7884
7979
|
setColumnsFields(function (preColumnsFields) {
|
7885
7980
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
|
7886
7981
|
});
|
7887
|
-
var
|
7982
|
+
var _labelCol6 = {};
|
7888
7983
|
|
7889
7984
|
if (search && search.labelWidth) {
|
7890
|
-
|
7985
|
+
_labelCol6.style = {
|
7891
7986
|
width: search.labelWidth
|
7892
7987
|
};
|
7893
7988
|
}
|
@@ -7913,7 +8008,7 @@ var WForm = function WForm(props, ref) {
|
|
7913
8008
|
}, c.formItemProps), {}, {
|
7914
8009
|
name: c.dataIndex,
|
7915
8010
|
label: c.title,
|
7916
|
-
labelCol:
|
8011
|
+
labelCol: _labelCol6
|
7917
8012
|
}), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({
|
7918
8013
|
disabled: disabled
|
7919
8014
|
}, radioButtonProps), {}, {
|
@@ -7933,10 +8028,10 @@ var WForm = function WForm(props, ref) {
|
|
7933
8028
|
}
|
7934
8029
|
}
|
7935
8030
|
|
7936
|
-
var
|
8031
|
+
var _labelCol7 = {};
|
7937
8032
|
|
7938
8033
|
if (search && search.labelWidth) {
|
7939
|
-
|
8034
|
+
_labelCol7.style = {
|
7940
8035
|
width: search.labelWidth
|
7941
8036
|
};
|
7942
8037
|
} // if (columnsFieldsRef.current) {
|
@@ -7960,15 +8055,15 @@ var WForm = function WForm(props, ref) {
|
|
7960
8055
|
}, c.formItemProps), {}, {
|
7961
8056
|
name: c.dataIndex,
|
7962
8057
|
label: c.title,
|
7963
|
-
labelCol:
|
8058
|
+
labelCol: _labelCol7
|
7964
8059
|
}), /*#__PURE__*/React.createElement(WSwitch, _objectSpread2({
|
7965
8060
|
disabled: disabled
|
7966
8061
|
}, c.fieldProps))));
|
7967
8062
|
} else if (c.valueType === 'digit') {
|
7968
|
-
var
|
8063
|
+
var _labelCol8 = {};
|
7969
8064
|
|
7970
8065
|
if (search && search.labelWidth) {
|
7971
|
-
|
8066
|
+
_labelCol8.style = {
|
7972
8067
|
width: search.labelWidth
|
7973
8068
|
};
|
7974
8069
|
}
|
@@ -7985,16 +8080,16 @@ var WForm = function WForm(props, ref) {
|
|
7985
8080
|
}, c.formItemProps), {}, {
|
7986
8081
|
name: c.dataIndex,
|
7987
8082
|
label: c.title,
|
7988
|
-
labelCol:
|
8083
|
+
labelCol: _labelCol8
|
7989
8084
|
}), /*#__PURE__*/React.createElement(NumericInput, _objectSpread2({
|
7990
8085
|
disabled: disabled,
|
7991
8086
|
placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570(double/int)"
|
7992
8087
|
}, c.fieldProps))));
|
7993
8088
|
} else if (c.renderFormItem) {
|
7994
|
-
var
|
8089
|
+
var _labelCol9 = {};
|
7995
8090
|
|
7996
8091
|
if (search && search.labelWidth) {
|
7997
|
-
|
8092
|
+
_labelCol9.style = {
|
7998
8093
|
width: search.labelWidth
|
7999
8094
|
};
|
8000
8095
|
}
|
@@ -8017,13 +8112,13 @@ var WForm = function WForm(props, ref) {
|
|
8017
8112
|
}, c.formItemProps), {}, {
|
8018
8113
|
name: c.dataIndex,
|
8019
8114
|
label: c.title,
|
8020
|
-
labelCol:
|
8115
|
+
labelCol: _labelCol9
|
8021
8116
|
}), baseitem)) : null;
|
8022
8117
|
} else if (c.valueType === 'textarea') {
|
8023
|
-
var
|
8118
|
+
var _labelCol10 = {};
|
8024
8119
|
|
8025
8120
|
if (search && search.labelWidth) {
|
8026
|
-
|
8121
|
+
_labelCol10.style = {
|
8027
8122
|
width: search.labelWidth
|
8028
8123
|
};
|
8029
8124
|
}
|
@@ -8040,17 +8135,17 @@ var WForm = function WForm(props, ref) {
|
|
8040
8135
|
}, c.formItemProps), {}, {
|
8041
8136
|
name: c.dataIndex,
|
8042
8137
|
label: c.title,
|
8043
|
-
labelCol:
|
8138
|
+
labelCol: _labelCol10
|
8044
8139
|
}), /*#__PURE__*/React.createElement(Index.TextArea, _objectSpread2({
|
8045
8140
|
rows: 4,
|
8046
8141
|
disabled: disabled,
|
8047
8142
|
placeholder: "\u8BF7\u8F93\u5165"
|
8048
8143
|
}, c.fieldProps))));
|
8049
8144
|
} else if (c.valueType === 'inputNumber') {
|
8050
|
-
var
|
8145
|
+
var _labelCol11 = {};
|
8051
8146
|
|
8052
8147
|
if (search && search.labelWidth) {
|
8053
|
-
|
8148
|
+
_labelCol11.style = {
|
8054
8149
|
width: search.labelWidth
|
8055
8150
|
};
|
8056
8151
|
}
|
@@ -8067,16 +8162,16 @@ var WForm = function WForm(props, ref) {
|
|
8067
8162
|
}, c.formItemProps), {}, {
|
8068
8163
|
name: c.dataIndex,
|
8069
8164
|
label: c.title,
|
8070
|
-
labelCol:
|
8165
|
+
labelCol: _labelCol11
|
8071
8166
|
}), /*#__PURE__*/React.createElement(WInputNumber, _objectSpread2({
|
8072
8167
|
disabled: disabled,
|
8073
8168
|
placeholder: "\u8BF7\u8F93\u5165"
|
8074
8169
|
}, c.fieldProps))));
|
8075
8170
|
} else {
|
8076
|
-
var
|
8171
|
+
var _labelCol12 = {};
|
8077
8172
|
|
8078
8173
|
if (search && search.labelWidth) {
|
8079
|
-
|
8174
|
+
_labelCol12.style = {
|
8080
8175
|
width: search.labelWidth
|
8081
8176
|
};
|
8082
8177
|
}
|
@@ -8093,7 +8188,7 @@ var WForm = function WForm(props, ref) {
|
|
8093
8188
|
}, c.formItemProps), {}, {
|
8094
8189
|
name: c.dataIndex,
|
8095
8190
|
label: c.title,
|
8096
|
-
labelCol:
|
8191
|
+
labelCol: _labelCol12
|
8097
8192
|
}), /*#__PURE__*/React.createElement(Index, _objectSpread2({
|
8098
8193
|
disabled: disabled,
|
8099
8194
|
placeholder: "\u8BF7\u8F93\u5165"
|
@@ -8117,12 +8212,12 @@ var WForm = function WForm(props, ref) {
|
|
8117
8212
|
}
|
8118
8213
|
|
8119
8214
|
if (c.valueType == 'select') {
|
8120
|
-
var
|
8215
|
+
var _extraProps4 = {};
|
8121
8216
|
|
8122
8217
|
if (c.request) {
|
8123
|
-
|
8218
|
+
_extraProps4.request = c.request;
|
8124
8219
|
} else if (c.valueEnum) {
|
8125
|
-
|
8220
|
+
_extraProps4.valueEnum = c.valueEnum;
|
8126
8221
|
}
|
8127
8222
|
|
8128
8223
|
var labelCol = {};
|
@@ -8157,18 +8252,55 @@ var WForm = function WForm(props, ref) {
|
|
8157
8252
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
|
8158
8253
|
});
|
8159
8254
|
}
|
8160
|
-
}, c.fieldProps),
|
8255
|
+
}, c.fieldProps), _extraProps4))));
|
8256
|
+
} else if (c.valueType == 'cascader') {
|
8257
|
+
var _extraProps5 = {};
|
8258
|
+
|
8259
|
+
if (c.request) {
|
8260
|
+
_extraProps5.request = c.request;
|
8261
|
+
}
|
8262
|
+
|
8263
|
+
var _labelCol13 = {};
|
8264
|
+
|
8265
|
+
if (search && search.labelWidth) {
|
8266
|
+
_labelCol13.style = {
|
8267
|
+
width: search.labelWidth
|
8268
|
+
};
|
8269
|
+
}
|
8270
|
+
|
8271
|
+
return /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
|
8272
|
+
style: {
|
8273
|
+
paddingLeft: '12px',
|
8274
|
+
paddingRight: '12px'
|
8275
|
+
}
|
8276
|
+
}, colProps), {}, {
|
8277
|
+
key: c.dataIndex
|
8278
|
+
}), /*#__PURE__*/React.createElement(_Form.Item, _objectSpread2(_objectSpread2({
|
8279
|
+
initialValue: c.initialValue
|
8280
|
+
}, c.formItemProps), {}, {
|
8281
|
+
name: c.dataIndex,
|
8282
|
+
label: c.title,
|
8283
|
+
labelCol: _labelCol13
|
8284
|
+
}), /*#__PURE__*/React.createElement(WCascader, _objectSpread2(_objectSpread2({
|
8285
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
8286
|
+
disabled: disabled,
|
8287
|
+
onLoad: function onLoad(opt) {
|
8288
|
+
setColumnsFields(function (preColumnsFields) {
|
8289
|
+
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
|
8290
|
+
});
|
8291
|
+
}
|
8292
|
+
}, c.fieldProps), _extraProps5))));
|
8161
8293
|
} else if (c.valueType == 'treeSelect') {
|
8162
|
-
var
|
8294
|
+
var _extraProps6 = {};
|
8163
8295
|
|
8164
8296
|
if (c.request) {
|
8165
|
-
|
8297
|
+
_extraProps6.request = c.request;
|
8166
8298
|
}
|
8167
8299
|
|
8168
|
-
var
|
8300
|
+
var _labelCol14 = {};
|
8169
8301
|
|
8170
8302
|
if (search && search.labelWidth) {
|
8171
|
-
|
8303
|
+
_labelCol14.style = {
|
8172
8304
|
width: search.labelWidth
|
8173
8305
|
};
|
8174
8306
|
}
|
@@ -8185,17 +8317,17 @@ var WForm = function WForm(props, ref) {
|
|
8185
8317
|
}, c.formItemProps), {}, {
|
8186
8318
|
name: c.dataIndex,
|
8187
8319
|
label: c.title,
|
8188
|
-
labelCol:
|
8320
|
+
labelCol: _labelCol14
|
8189
8321
|
}), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
|
8190
8322
|
disabled: disabled,
|
8191
8323
|
placeholder: "\u8BF7\u9009\u62E9",
|
8192
8324
|
onLoad: function onLoad(opt) {}
|
8193
|
-
}, c.fieldProps),
|
8325
|
+
}, c.fieldProps), _extraProps6))));
|
8194
8326
|
} else if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear'].includes(c.valueType)) {
|
8195
|
-
var
|
8327
|
+
var _labelCol15 = {};
|
8196
8328
|
|
8197
8329
|
if (search && search.labelWidth) {
|
8198
|
-
|
8330
|
+
_labelCol15.style = {
|
8199
8331
|
width: search.labelWidth
|
8200
8332
|
};
|
8201
8333
|
}
|
@@ -8235,16 +8367,16 @@ var WForm = function WForm(props, ref) {
|
|
8235
8367
|
}, c.formItemProps), {}, {
|
8236
8368
|
name: c.dataIndex,
|
8237
8369
|
label: c.title,
|
8238
|
-
labelCol:
|
8370
|
+
labelCol: _labelCol15
|
8239
8371
|
}), /*#__PURE__*/React.createElement(Index$6, _objectSpread2(_objectSpread2(_objectSpread2({
|
8240
8372
|
disabled: disabled,
|
8241
8373
|
placeholder: "\u8BF7\u8F93\u5165"
|
8242
8374
|
}, picker), showTime), c.fieldProps))));
|
8243
8375
|
} else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
|
8244
|
-
var
|
8376
|
+
var _labelCol16 = {};
|
8245
8377
|
|
8246
8378
|
if (search && search.labelWidth) {
|
8247
|
-
|
8379
|
+
_labelCol16.style = {
|
8248
8380
|
width: search.labelWidth
|
8249
8381
|
};
|
8250
8382
|
}
|
@@ -8271,7 +8403,7 @@ var WForm = function WForm(props, ref) {
|
|
8271
8403
|
}, c.formItemProps), {}, {
|
8272
8404
|
name: c.dataIndex,
|
8273
8405
|
label: c.title,
|
8274
|
-
labelCol:
|
8406
|
+
labelCol: _labelCol16
|
8275
8407
|
}), /*#__PURE__*/React.createElement(RangePicker$3, _objectSpread2(_objectSpread2({
|
8276
8408
|
disabled: disabled
|
8277
8409
|
}, _showTime2), c.fieldProps))));
|
@@ -8298,10 +8430,10 @@ var WForm = function WForm(props, ref) {
|
|
8298
8430
|
setColumnsFields(function (preColumnsFields) {
|
8299
8431
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
|
8300
8432
|
});
|
8301
|
-
var
|
8433
|
+
var _labelCol17 = {};
|
8302
8434
|
|
8303
8435
|
if (search && search.labelWidth) {
|
8304
|
-
|
8436
|
+
_labelCol17.style = {
|
8305
8437
|
width: search.labelWidth
|
8306
8438
|
};
|
8307
8439
|
}
|
@@ -8318,7 +8450,7 @@ var WForm = function WForm(props, ref) {
|
|
8318
8450
|
}, c.formItemProps), {}, {
|
8319
8451
|
name: c.dataIndex,
|
8320
8452
|
label: c.title,
|
8321
|
-
labelCol:
|
8453
|
+
labelCol: _labelCol17
|
8322
8454
|
}), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
|
8323
8455
|
disabled: disabled,
|
8324
8456
|
options: options
|
@@ -8347,10 +8479,10 @@ var WForm = function WForm(props, ref) {
|
|
8347
8479
|
setColumnsFields(function (preColumnsFields) {
|
8348
8480
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options3));
|
8349
8481
|
});
|
8350
|
-
var
|
8482
|
+
var _labelCol18 = {};
|
8351
8483
|
|
8352
8484
|
if (search && search.labelWidth) {
|
8353
|
-
|
8485
|
+
_labelCol18.style = {
|
8354
8486
|
width: search.labelWidth
|
8355
8487
|
};
|
8356
8488
|
}
|
@@ -8376,7 +8508,7 @@ var WForm = function WForm(props, ref) {
|
|
8376
8508
|
}, c.formItemProps), {}, {
|
8377
8509
|
name: c.dataIndex,
|
8378
8510
|
label: c.title,
|
8379
|
-
labelCol:
|
8511
|
+
labelCol: _labelCol18
|
8380
8512
|
}), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({
|
8381
8513
|
disabled: disabled
|
8382
8514
|
}, radioButtonProps), {}, {
|
@@ -8396,10 +8528,10 @@ var WForm = function WForm(props, ref) {
|
|
8396
8528
|
}
|
8397
8529
|
}
|
8398
8530
|
|
8399
|
-
var
|
8531
|
+
var _labelCol19 = {};
|
8400
8532
|
|
8401
8533
|
if (search && search.labelWidth) {
|
8402
|
-
|
8534
|
+
_labelCol19.style = {
|
8403
8535
|
width: search.labelWidth
|
8404
8536
|
};
|
8405
8537
|
} // if (columnsFieldsRef.current) {
|
@@ -8423,15 +8555,15 @@ var WForm = function WForm(props, ref) {
|
|
8423
8555
|
}, c.formItemProps), {}, {
|
8424
8556
|
name: c.dataIndex,
|
8425
8557
|
label: c.title,
|
8426
|
-
labelCol:
|
8558
|
+
labelCol: _labelCol19
|
8427
8559
|
}), /*#__PURE__*/React.createElement(WSwitch, _objectSpread2({
|
8428
8560
|
disabled: disabled
|
8429
8561
|
}, c.fieldProps))));
|
8430
8562
|
} else if (c.valueType === 'digit') {
|
8431
|
-
var
|
8563
|
+
var _labelCol20 = {};
|
8432
8564
|
|
8433
8565
|
if (search && search.labelWidth) {
|
8434
|
-
|
8566
|
+
_labelCol20.style = {
|
8435
8567
|
width: search.labelWidth
|
8436
8568
|
};
|
8437
8569
|
}
|
@@ -8448,16 +8580,16 @@ var WForm = function WForm(props, ref) {
|
|
8448
8580
|
}, c.formItemProps), {}, {
|
8449
8581
|
name: c.dataIndex,
|
8450
8582
|
label: c.title,
|
8451
|
-
labelCol:
|
8583
|
+
labelCol: _labelCol20
|
8452
8584
|
}), /*#__PURE__*/React.createElement(NumericInput, _objectSpread2({
|
8453
8585
|
disabled: disabled,
|
8454
8586
|
placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570(double/int)"
|
8455
8587
|
}, c.fieldProps))));
|
8456
8588
|
} else if (c.renderFormItem) {
|
8457
|
-
var
|
8589
|
+
var _labelCol21 = {};
|
8458
8590
|
|
8459
8591
|
if (search && search.labelWidth) {
|
8460
|
-
|
8592
|
+
_labelCol21.style = {
|
8461
8593
|
width: search.labelWidth
|
8462
8594
|
};
|
8463
8595
|
}
|
@@ -8480,13 +8612,13 @@ var WForm = function WForm(props, ref) {
|
|
8480
8612
|
}, c.formItemProps), {}, {
|
8481
8613
|
name: c.dataIndex,
|
8482
8614
|
label: c.title,
|
8483
|
-
labelCol:
|
8615
|
+
labelCol: _labelCol21
|
8484
8616
|
}), baseitem)) : null;
|
8485
8617
|
} else if (c.valueType === 'textarea') {
|
8486
|
-
var
|
8618
|
+
var _labelCol22 = {};
|
8487
8619
|
|
8488
8620
|
if (search && search.labelWidth) {
|
8489
|
-
|
8621
|
+
_labelCol22.style = {
|
8490
8622
|
width: search.labelWidth
|
8491
8623
|
};
|
8492
8624
|
}
|
@@ -8503,17 +8635,17 @@ var WForm = function WForm(props, ref) {
|
|
8503
8635
|
}, c.formItemProps), {}, {
|
8504
8636
|
name: c.dataIndex,
|
8505
8637
|
label: c.title,
|
8506
|
-
labelCol:
|
8638
|
+
labelCol: _labelCol22
|
8507
8639
|
}), /*#__PURE__*/React.createElement(Index.TextArea, _objectSpread2({
|
8508
8640
|
rows: 4,
|
8509
8641
|
disabled: disabled,
|
8510
8642
|
placeholder: "\u8BF7\u8F93\u5165"
|
8511
8643
|
}, c.fieldProps))));
|
8512
8644
|
} else if (c.valueType === 'inputNumber') {
|
8513
|
-
var
|
8645
|
+
var _labelCol23 = {};
|
8514
8646
|
|
8515
8647
|
if (search && search.labelWidth) {
|
8516
|
-
|
8648
|
+
_labelCol23.style = {
|
8517
8649
|
width: search.labelWidth
|
8518
8650
|
};
|
8519
8651
|
}
|
@@ -8530,16 +8662,16 @@ var WForm = function WForm(props, ref) {
|
|
8530
8662
|
}, c.formItemProps), {}, {
|
8531
8663
|
name: c.dataIndex,
|
8532
8664
|
label: c.title,
|
8533
|
-
labelCol:
|
8665
|
+
labelCol: _labelCol23
|
8534
8666
|
}), /*#__PURE__*/React.createElement(WInputNumber, _objectSpread2({
|
8535
8667
|
disabled: disabled,
|
8536
8668
|
placeholder: "\u8BF7\u8F93\u5165"
|
8537
8669
|
}, c.fieldProps))));
|
8538
8670
|
} else {
|
8539
|
-
var
|
8671
|
+
var _labelCol24 = {};
|
8540
8672
|
|
8541
8673
|
if (search && search.labelWidth) {
|
8542
|
-
|
8674
|
+
_labelCol24.style = {
|
8543
8675
|
width: search.labelWidth
|
8544
8676
|
};
|
8545
8677
|
}
|
@@ -8556,7 +8688,7 @@ var WForm = function WForm(props, ref) {
|
|
8556
8688
|
}, c.formItemProps), {}, {
|
8557
8689
|
name: c.dataIndex,
|
8558
8690
|
label: c.title,
|
8559
|
-
labelCol:
|
8691
|
+
labelCol: _labelCol24
|
8560
8692
|
}), /*#__PURE__*/React.createElement(Index, _objectSpread2({
|
8561
8693
|
disabled: disabled,
|
8562
8694
|
placeholder: "\u8BF7\u8F93\u5165"
|
@@ -8699,8 +8831,8 @@ var WForm = function WForm(props, ref) {
|
|
8699
8831
|
|
8700
8832
|
var WForm$1 = /*#__PURE__*/React.forwardRef(WForm);
|
8701
8833
|
|
8702
|
-
var _excluded$
|
8703
|
-
_excluded2$2 = ["count", "width", "height", "marginRight"];
|
8834
|
+
var _excluded$8 = ["height", "width", "count", "style", "numberStyle"],
|
8835
|
+
_excluded2$2 = ["count", "numberCount", "width", "height", "marginRight"];
|
8704
8836
|
|
8705
8837
|
var Number = function Number(_ref) {
|
8706
8838
|
var height = _ref.height,
|
@@ -8709,7 +8841,7 @@ var Number = function Number(_ref) {
|
|
8709
8841
|
count = _ref$count === void 0 ? 0 : _ref$count,
|
8710
8842
|
style = _ref.style,
|
8711
8843
|
numberStyle = _ref.numberStyle,
|
8712
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
8844
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
8713
8845
|
|
8714
8846
|
// 上次的值
|
8715
8847
|
var _useState = useState(0),
|
@@ -8831,6 +8963,8 @@ Number.defaultProps = {
|
|
8831
8963
|
|
8832
8964
|
var Index$7 = function Index(props) {
|
8833
8965
|
var count = props.count,
|
8966
|
+
_props$numberCount = props.numberCount,
|
8967
|
+
numberCount = _props$numberCount === void 0 ? 5 : _props$numberCount,
|
8834
8968
|
width = props.width,
|
8835
8969
|
height = props.height,
|
8836
8970
|
_props$marginRight = props.marginRight,
|
@@ -8844,6 +8978,11 @@ var Index$7 = function Index(props) {
|
|
8844
8978
|
|
8845
8979
|
useEffect(function () {
|
8846
8980
|
var countArray = count.toString().split('');
|
8981
|
+
|
8982
|
+
if (numberCount > countArray.length) {
|
8983
|
+
countArray = [].concat(_toConsumableArray(Array(numberCount - countArray.length).fill(0)), _toConsumableArray(countArray));
|
8984
|
+
}
|
8985
|
+
|
8847
8986
|
setNumberList(countArray.map(function (num) {
|
8848
8987
|
return +num;
|
8849
8988
|
}));
|
@@ -8866,12 +9005,12 @@ var Index$7 = function Index(props) {
|
|
8866
9005
|
}));
|
8867
9006
|
};
|
8868
9007
|
|
8869
|
-
var _excluded$
|
9008
|
+
var _excluded$9 = ["duration"];
|
8870
9009
|
|
8871
9010
|
var Index$8 = function Index(props) {
|
8872
9011
|
var _props$duration = props.duration,
|
8873
9012
|
duration = _props$duration === void 0 ? 2.75 : _props$duration,
|
8874
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
9013
|
+
extraProps = _objectWithoutProperties(props, _excluded$9);
|
8875
9014
|
return /*#__PURE__*/React.createElement(CountUp, _objectSpread2({
|
8876
9015
|
duration: duration
|
8877
9016
|
}, extraProps));
|
@@ -8879,7 +9018,7 @@ var Index$8 = function Index(props) {
|
|
8879
9018
|
|
8880
9019
|
Index$8.defaultProps = {};
|
8881
9020
|
|
8882
|
-
var _excluded$
|
9021
|
+
var _excluded$a = ["list", "render", "partSize"];
|
8883
9022
|
|
8884
9023
|
function AutoScroll(props) {
|
8885
9024
|
var inner1 = useRef();
|
@@ -8963,7 +9102,7 @@ var Index$9 = function Index(_ref) {
|
|
8963
9102
|
render = _ref.render,
|
8964
9103
|
_ref$partSize = _ref.partSize,
|
8965
9104
|
partSize = _ref$partSize === void 0 ? 4 : _ref$partSize,
|
8966
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
9105
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$a);
|
8967
9106
|
|
8968
9107
|
{
|
8969
9108
|
var _useState = useState([]),
|
@@ -9040,28 +9179,42 @@ var Index$9 = function Index(_ref) {
|
|
9040
9179
|
}
|
9041
9180
|
};
|
9042
9181
|
|
9043
|
-
var _excluded$
|
9182
|
+
var _excluded$b = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
|
9044
9183
|
|
9045
9184
|
SwiperCore.use([Pagination, Navigation, Autoplay]);
|
9046
9185
|
|
9047
9186
|
var Index$a = function Index(props) {
|
9048
9187
|
var data = props.data,
|
9049
9188
|
_onClick = props.onClick,
|
9189
|
+
_props$slidesPerView = props.slidesPerView,
|
9190
|
+
slidesPerView = _props$slidesPerView === void 0 ? 4 : _props$slidesPerView,
|
9191
|
+
rowKey = props.rowKey,
|
9192
|
+
onSwiperChange = props.onSwiperChange,
|
9050
9193
|
renderItem = props.renderItem,
|
9051
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
9194
|
+
extraProps = _objectWithoutProperties(props, _excluded$b);
|
9052
9195
|
|
9053
|
-
|
9054
|
-
|
9055
|
-
|
9056
|
-
|
9057
|
-
} else {
|
9058
|
-
swiper.clickedIndex && swiper.slideTo(swiper.clickedIndex);
|
9059
|
-
}
|
9196
|
+
var _useState = useState(null),
|
9197
|
+
_useState2 = _slicedToArray(_useState, 2),
|
9198
|
+
controlledSwiper = _useState2[0],
|
9199
|
+
setControlledSwiper = _useState2[1];
|
9060
9200
|
|
9061
|
-
|
9201
|
+
return /*#__PURE__*/React.createElement(Swiper, _objectSpread2({
|
9202
|
+
onSwiper: function onSwiper(swiper) {
|
9203
|
+
return setControlledSwiper(swiper);
|
9204
|
+
},
|
9205
|
+
// onClick={(swiper, event) => {
|
9206
|
+
// if (swiper.clickedIndex - 4 > data.length) {
|
9207
|
+
// swiper.slideNext();
|
9208
|
+
// } else {
|
9209
|
+
// swiper.clickedIndex && swiper.slideTo(swiper.clickedIndex);
|
9210
|
+
// }
|
9211
|
+
// onClick && onClick(swiper, event);
|
9212
|
+
// }}
|
9213
|
+
onSlideChange: function onSlideChange(swiper) {
|
9214
|
+
onSwiperChange && onSwiperChange(swiper.realIndex, data[swiper.realIndex]);
|
9062
9215
|
},
|
9063
9216
|
className: "mySwiper",
|
9064
|
-
slidesPerView:
|
9217
|
+
slidesPerView: slidesPerView,
|
9065
9218
|
spaceBetween: 30,
|
9066
9219
|
loop: true,
|
9067
9220
|
loopFillGroupWithBlank: true,
|
@@ -9069,16 +9222,32 @@ var Index$a = function Index(props) {
|
|
9069
9222
|
navigation: true
|
9070
9223
|
}, extraProps), data.map(function (item, index) {
|
9071
9224
|
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
9072
|
-
key: index
|
9225
|
+
key: rowKey ? item[rowKey] : index
|
9073
9226
|
}, function (_ref) {
|
9074
9227
|
var isActive = _ref.isActive;
|
9075
|
-
return
|
9076
|
-
|
9077
|
-
|
9078
|
-
|
9079
|
-
|
9080
|
-
|
9081
|
-
|
9228
|
+
return /*#__PURE__*/React.createElement("div", {
|
9229
|
+
style: {
|
9230
|
+
width: '100%',
|
9231
|
+
height: '100%'
|
9232
|
+
},
|
9233
|
+
onClick: function onClick(event) {
|
9234
|
+
if (controlledSwiper) {
|
9235
|
+
if (controlledSwiper.clickedIndex - slidesPerView > data.length) {
|
9236
|
+
controlledSwiper.slideNext();
|
9237
|
+
} else {
|
9238
|
+
controlledSwiper.clickedIndex && controlledSwiper.slideTo(controlledSwiper.clickedIndex);
|
9239
|
+
}
|
9240
|
+
|
9241
|
+
_onClick && _onClick(controlledSwiper, event);
|
9242
|
+
}
|
9243
|
+
}
|
9244
|
+
}, renderItem(item, index, isActive));
|
9245
|
+
});
|
9246
|
+
}));
|
9247
|
+
};
|
9248
|
+
|
9249
|
+
Index$a.defaultProps = {};
|
9250
|
+
|
9082
9251
|
function _extends$1() {
|
9083
9252
|
_extends$1 = Object.assign || function (target) {
|
9084
9253
|
for (var i = 1; i < arguments.length; i++) {
|
@@ -9199,7 +9368,9 @@ function invariant(condition, message) {
|
|
9199
9368
|
if (isProduction$1) {
|
9200
9369
|
throw new Error(prefix);
|
9201
9370
|
}
|
9202
|
-
|
9371
|
+
var provided = typeof message === 'function' ? message() : message;
|
9372
|
+
var value = provided ? prefix + ": " + provided : prefix;
|
9373
|
+
throw new Error(value);
|
9203
9374
|
}
|
9204
9375
|
|
9205
9376
|
function addLeadingSlash(path) {
|
@@ -9671,7 +9842,7 @@ function createBrowserHistory(props) {
|
|
9671
9842
|
return history;
|
9672
9843
|
}
|
9673
9844
|
|
9674
|
-
var _excluded$
|
9845
|
+
var _excluded$c = ["routes", "className"];
|
9675
9846
|
var history = createBrowserHistory();
|
9676
9847
|
|
9677
9848
|
function itemRender(route, params, routes, paths) {
|
@@ -9689,7 +9860,7 @@ function itemRender(route, params, routes, paths) {
|
|
9689
9860
|
var Index$b = function Index(_ref) {
|
9690
9861
|
var routes = _ref.routes,
|
9691
9862
|
className = _ref.className,
|
9692
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
9863
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
9693
9864
|
|
9694
9865
|
return /*#__PURE__*/React.createElement(_Breadcrumb, _objectSpread2({
|
9695
9866
|
className: className || 'default',
|
@@ -9699,7 +9870,7 @@ var Index$b = function Index(_ref) {
|
|
9699
9870
|
}, props));
|
9700
9871
|
};
|
9701
9872
|
|
9702
|
-
var _excluded$
|
9873
|
+
var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
|
9703
9874
|
|
9704
9875
|
var Index$c = function Index(_ref) {
|
9705
9876
|
var _classNames;
|
@@ -9709,7 +9880,7 @@ var Index$c = function Index(_ref) {
|
|
9709
9880
|
className = _ref$className === void 0 ? 'default' : _ref$className,
|
9710
9881
|
headerTail = _ref.headerTail,
|
9711
9882
|
headerCenter = _ref.headerCenter,
|
9712
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
9883
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
9713
9884
|
|
9714
9885
|
return /*#__PURE__*/React.createElement("div", _objectSpread2({
|
9715
9886
|
className: classnames((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
|
@@ -9786,7 +9957,7 @@ function DialogModel(props) {
|
|
9786
9957
|
height: '100%',
|
9787
9958
|
position: 'relative'
|
9788
9959
|
}
|
9789
|
-
},
|
9960
|
+
}, props.children))), /*#__PURE__*/React.createElement("div", {
|
9790
9961
|
className: 'mask',
|
9791
9962
|
onClick: function onClick() {
|
9792
9963
|
return onClose && onClose();
|
@@ -9816,7 +9987,7 @@ function DialogModel(props) {
|
|
9816
9987
|
return renderChildren;
|
9817
9988
|
}
|
9818
9989
|
|
9819
|
-
var _excluded$
|
9990
|
+
var _excluded$e = ["visible"];
|
9820
9991
|
|
9821
9992
|
var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
9822
9993
|
_inherits(Modal, _React$PureComponent);
|
@@ -9905,7 +10076,9 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
9905
10076
|
style: style
|
9906
10077
|
}, this.renderTop(), /*#__PURE__*/React.createElement("div", {
|
9907
10078
|
className: "model-content"
|
9908
|
-
},
|
10079
|
+
}, /*#__PURE__*/React.createElement("div", {
|
10080
|
+
className: "model-content-in"
|
10081
|
+
}, this.renderContent())), this.renderFooter());
|
9909
10082
|
}
|
9910
10083
|
}]);
|
9911
10084
|
|
@@ -9948,7 +10121,7 @@ Modal.show = function (config) {
|
|
9948
10121
|
manager.setShow = setShow;
|
9949
10122
|
|
9950
10123
|
var visible = props.visible,
|
9951
|
-
trueProps = _objectWithoutProperties(props, _excluded$
|
10124
|
+
trueProps = _objectWithoutProperties(props, _excluded$e);
|
9952
10125
|
|
9953
10126
|
useEffect(function () {
|
9954
10127
|
manager.mounted = true;
|
@@ -9972,7 +10145,7 @@ Modal.hidden = function () {
|
|
9972
10145
|
ModalContainer[modelSysbol] && ModalContainer[modelSysbol].hidden();
|
9973
10146
|
};
|
9974
10147
|
|
9975
|
-
var _excluded$
|
10148
|
+
var _excluded$f = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
|
9976
10149
|
|
9977
10150
|
var ModalForm = function ModalForm(props, ref) {
|
9978
10151
|
var columns = props.columns,
|
@@ -9986,7 +10159,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
9986
10159
|
title = props.title,
|
9987
10160
|
record = props.record,
|
9988
10161
|
onFormChange = props.onFormChange,
|
9989
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
10162
|
+
extraProps = _objectWithoutProperties(props, _excluded$f);
|
9990
10163
|
|
9991
10164
|
var formRef = useRef(null);
|
9992
10165
|
|
@@ -10117,7 +10290,749 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10117
10290
|
|
10118
10291
|
var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
|
10119
10292
|
|
10120
|
-
|
10293
|
+
function _defineProperty$1(obj, key, value) {
|
10294
|
+
if (key in obj) {
|
10295
|
+
Object.defineProperty(obj, key, {
|
10296
|
+
value: value,
|
10297
|
+
enumerable: true,
|
10298
|
+
configurable: true,
|
10299
|
+
writable: true
|
10300
|
+
});
|
10301
|
+
} else {
|
10302
|
+
obj[key] = value;
|
10303
|
+
}
|
10304
|
+
|
10305
|
+
return obj;
|
10306
|
+
}
|
10307
|
+
|
10308
|
+
function ownKeys$1(object, enumerableOnly) {
|
10309
|
+
var keys = Object.keys(object);
|
10310
|
+
|
10311
|
+
if (Object.getOwnPropertySymbols) {
|
10312
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
10313
|
+
|
10314
|
+
if (enumerableOnly) {
|
10315
|
+
symbols = symbols.filter(function (sym) {
|
10316
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
10317
|
+
});
|
10318
|
+
}
|
10319
|
+
|
10320
|
+
keys.push.apply(keys, symbols);
|
10321
|
+
}
|
10322
|
+
|
10323
|
+
return keys;
|
10324
|
+
}
|
10325
|
+
|
10326
|
+
function _objectSpread2$1(target) {
|
10327
|
+
for (var i = 1; i < arguments.length; i++) {
|
10328
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
10329
|
+
|
10330
|
+
if (i % 2) {
|
10331
|
+
ownKeys$1(Object(source), true).forEach(function (key) {
|
10332
|
+
_defineProperty$1(target, key, source[key]);
|
10333
|
+
});
|
10334
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
10335
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
10336
|
+
} else {
|
10337
|
+
ownKeys$1(Object(source)).forEach(function (key) {
|
10338
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
10339
|
+
});
|
10340
|
+
}
|
10341
|
+
}
|
10342
|
+
|
10343
|
+
return target;
|
10344
|
+
}
|
10345
|
+
|
10346
|
+
function _arrayLikeToArray$1(arr, len) {
|
10347
|
+
if (len == null || len > arr.length) len = arr.length;
|
10348
|
+
|
10349
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
10350
|
+
arr2[i] = arr[i];
|
10351
|
+
}
|
10352
|
+
|
10353
|
+
return arr2;
|
10354
|
+
}
|
10355
|
+
|
10356
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
10357
|
+
if (!o) return;
|
10358
|
+
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
10359
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
10360
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
10361
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
10362
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
10363
|
+
}
|
10364
|
+
|
10365
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) {
|
10366
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
10367
|
+
|
10368
|
+
if (!it) {
|
10369
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
|
10370
|
+
if (it) o = it;
|
10371
|
+
var i = 0;
|
10372
|
+
|
10373
|
+
var F = function F() {};
|
10374
|
+
|
10375
|
+
return {
|
10376
|
+
s: F,
|
10377
|
+
n: function n() {
|
10378
|
+
if (i >= o.length) return {
|
10379
|
+
done: true
|
10380
|
+
};
|
10381
|
+
return {
|
10382
|
+
done: false,
|
10383
|
+
value: o[i++]
|
10384
|
+
};
|
10385
|
+
},
|
10386
|
+
e: function e(_e) {
|
10387
|
+
throw _e;
|
10388
|
+
},
|
10389
|
+
f: F
|
10390
|
+
};
|
10391
|
+
}
|
10392
|
+
|
10393
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
10394
|
+
}
|
10395
|
+
|
10396
|
+
var normalCompletion = true,
|
10397
|
+
didErr = false,
|
10398
|
+
err;
|
10399
|
+
return {
|
10400
|
+
s: function s() {
|
10401
|
+
it = it.call(o);
|
10402
|
+
},
|
10403
|
+
n: function n() {
|
10404
|
+
var step = it.next();
|
10405
|
+
normalCompletion = step.done;
|
10406
|
+
return step;
|
10407
|
+
},
|
10408
|
+
e: function e(_e2) {
|
10409
|
+
didErr = true;
|
10410
|
+
err = _e2;
|
10411
|
+
},
|
10412
|
+
f: function f() {
|
10413
|
+
try {
|
10414
|
+
if (!normalCompletion && it["return"] != null) it["return"]();
|
10415
|
+
} finally {
|
10416
|
+
if (didErr) throw err;
|
10417
|
+
}
|
10418
|
+
}
|
10419
|
+
};
|
10420
|
+
}
|
10421
|
+
|
10422
|
+
/*! *****************************************************************************
|
10423
|
+
Copyright (c) Microsoft Corporation.
|
10424
|
+
|
10425
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
10426
|
+
purpose with or without fee is hereby granted.
|
10427
|
+
|
10428
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
10429
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
10430
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10431
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
10432
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
10433
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
10434
|
+
PERFORMANCE OF THIS SOFTWARE.
|
10435
|
+
***************************************************************************** */
|
10436
|
+
|
10437
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
10438
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
10439
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
10440
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
10441
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
10442
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
10443
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
10444
|
+
});
|
10445
|
+
}
|
10446
|
+
|
10447
|
+
function __generator(thisArg, body) {
|
10448
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
10449
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
10450
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
10451
|
+
function step(op) {
|
10452
|
+
if (f) throw new TypeError("Generator is already executing.");
|
10453
|
+
while (_) try {
|
10454
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
10455
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
10456
|
+
switch (op[0]) {
|
10457
|
+
case 0: case 1: t = op; break;
|
10458
|
+
case 4: _.label++; return { value: op[1], done: false };
|
10459
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
10460
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
10461
|
+
default:
|
10462
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
10463
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
10464
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
10465
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
10466
|
+
if (t[2]) _.ops.pop();
|
10467
|
+
_.trys.pop(); continue;
|
10468
|
+
}
|
10469
|
+
op = body.call(thisArg, _);
|
10470
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
10471
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
10472
|
+
}
|
10473
|
+
}
|
10474
|
+
|
10475
|
+
var noop = function () { };
|
10476
|
+
// Using noop() as the undefined value as undefined can possibly be replaced
|
10477
|
+
// by something else. Prettier ignore and extra parentheses are necessary here
|
10478
|
+
// to ensure that tsc doesn't remove the __NOINLINE__ comment.
|
10479
|
+
// prettier-ignore
|
10480
|
+
var UNDEFINED = ( /*#__NOINLINE__*/noop());
|
10481
|
+
var OBJECT = Object;
|
10482
|
+
var isUndefined$1 = function (v) { return v === UNDEFINED; };
|
10483
|
+
var isFunction$1 = function (v) { return typeof v == 'function'; };
|
10484
|
+
var mergeObjects = function (a, b) { return OBJECT.assign({}, a, b); };
|
10485
|
+
var STR_UNDEFINED = 'undefined';
|
10486
|
+
var hasWindow = function () { return typeof window != STR_UNDEFINED; };
|
10487
|
+
var hasDocument = function () { return typeof document != STR_UNDEFINED; };
|
10488
|
+
|
10489
|
+
// use WeakMap to store the object->key mapping
|
10490
|
+
// so the objects can be garbage collected.
|
10491
|
+
// WeakMap uses a hashtable under the hood, so the lookup
|
10492
|
+
// complexity is almost O(1).
|
10493
|
+
var table = new WeakMap();
|
10494
|
+
// counter of the key
|
10495
|
+
var counter = 0;
|
10496
|
+
// A stable hash implementation that supports:
|
10497
|
+
// - Fast and ensures unique hash properties
|
10498
|
+
// - Handles unserializable values
|
10499
|
+
// - Handles object key ordering
|
10500
|
+
// - Generates short results
|
10501
|
+
//
|
10502
|
+
// This is not a serialization function, and the result is not guaranteed to be
|
10503
|
+
// parsible.
|
10504
|
+
var stableHash = function (arg) {
|
10505
|
+
var type = typeof arg;
|
10506
|
+
var constructor = arg && arg.constructor;
|
10507
|
+
var isDate = constructor == Date;
|
10508
|
+
var result;
|
10509
|
+
var index;
|
10510
|
+
if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {
|
10511
|
+
// Object/function, not null/date/regexp. Use WeakMap to store the id first.
|
10512
|
+
// If it's already hashed, directly return the result.
|
10513
|
+
result = table.get(arg);
|
10514
|
+
if (result)
|
10515
|
+
return result;
|
10516
|
+
// Store the hash first for circular reference detection before entering the
|
10517
|
+
// recursive `stableHash` calls.
|
10518
|
+
// For other objects like set and map, we use this id directly as the hash.
|
10519
|
+
result = ++counter + '~';
|
10520
|
+
table.set(arg, result);
|
10521
|
+
if (constructor == Array) {
|
10522
|
+
// Array.
|
10523
|
+
result = '@';
|
10524
|
+
for (index = 0; index < arg.length; index++) {
|
10525
|
+
result += stableHash(arg[index]) + ',';
|
10526
|
+
}
|
10527
|
+
table.set(arg, result);
|
10528
|
+
}
|
10529
|
+
if (constructor == OBJECT) {
|
10530
|
+
// Object, sort keys.
|
10531
|
+
result = '#';
|
10532
|
+
var keys = OBJECT.keys(arg).sort();
|
10533
|
+
while (!isUndefined$1((index = keys.pop()))) {
|
10534
|
+
if (!isUndefined$1(arg[index])) {
|
10535
|
+
result += index + ':' + stableHash(arg[index]) + ',';
|
10536
|
+
}
|
10537
|
+
}
|
10538
|
+
table.set(arg, result);
|
10539
|
+
}
|
10540
|
+
}
|
10541
|
+
else {
|
10542
|
+
result = isDate
|
10543
|
+
? arg.toJSON()
|
10544
|
+
: type == 'symbol'
|
10545
|
+
? arg.toString()
|
10546
|
+
: type == 'string'
|
10547
|
+
? JSON.stringify(arg)
|
10548
|
+
: '' + arg;
|
10549
|
+
}
|
10550
|
+
return result;
|
10551
|
+
};
|
10552
|
+
|
10553
|
+
/**
|
10554
|
+
* Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
|
10555
|
+
* it's not reliable to detect if the browser is currently online or offline
|
10556
|
+
* based on `navigator.onLine`.
|
10557
|
+
* As a work around, we always assume it's online on first load, and change
|
10558
|
+
* the status upon `online` or `offline` events.
|
10559
|
+
*/
|
10560
|
+
var online = true;
|
10561
|
+
var isOnline = function () { return online; };
|
10562
|
+
var hasWin = hasWindow();
|
10563
|
+
var hasDoc = hasDocument();
|
10564
|
+
// For node and React Native, `add/removeEventListener` doesn't exist on window.
|
10565
|
+
var onWindowEvent = hasWin && window.addEventListener
|
10566
|
+
? window.addEventListener.bind(window)
|
10567
|
+
: noop;
|
10568
|
+
var onDocumentEvent = hasDoc ? document.addEventListener.bind(document) : noop;
|
10569
|
+
var offWindowEvent = hasWin && window.removeEventListener
|
10570
|
+
? window.removeEventListener.bind(window)
|
10571
|
+
: noop;
|
10572
|
+
var offDocumentEvent = hasDoc
|
10573
|
+
? document.removeEventListener.bind(document)
|
10574
|
+
: noop;
|
10575
|
+
var isVisible = function () {
|
10576
|
+
var visibilityState = hasDoc && document.visibilityState;
|
10577
|
+
if (!isUndefined$1(visibilityState)) {
|
10578
|
+
return visibilityState !== 'hidden';
|
10579
|
+
}
|
10580
|
+
return true;
|
10581
|
+
};
|
10582
|
+
var initFocus = function (cb) {
|
10583
|
+
// focus revalidate
|
10584
|
+
onDocumentEvent('visibilitychange', cb);
|
10585
|
+
onWindowEvent('focus', cb);
|
10586
|
+
return function () {
|
10587
|
+
offDocumentEvent('visibilitychange', cb);
|
10588
|
+
offWindowEvent('focus', cb);
|
10589
|
+
};
|
10590
|
+
};
|
10591
|
+
var initReconnect = function (cb) {
|
10592
|
+
// revalidate on reconnected
|
10593
|
+
var onOnline = function () {
|
10594
|
+
online = true;
|
10595
|
+
cb();
|
10596
|
+
};
|
10597
|
+
// nothing to revalidate, just update the status
|
10598
|
+
var onOffline = function () {
|
10599
|
+
online = false;
|
10600
|
+
};
|
10601
|
+
onWindowEvent('online', onOnline);
|
10602
|
+
onWindowEvent('offline', onOffline);
|
10603
|
+
return function () {
|
10604
|
+
offWindowEvent('online', onOnline);
|
10605
|
+
offWindowEvent('offline', onOffline);
|
10606
|
+
};
|
10607
|
+
};
|
10608
|
+
var preset = {
|
10609
|
+
isOnline: isOnline,
|
10610
|
+
isVisible: isVisible
|
10611
|
+
};
|
10612
|
+
var defaultConfigOptions = {
|
10613
|
+
initFocus: initFocus,
|
10614
|
+
initReconnect: initReconnect
|
10615
|
+
};
|
10616
|
+
|
10617
|
+
var IS_SERVER = !hasWindow() || 'Deno' in window;
|
10618
|
+
// React currently throws a warning when using useLayoutEffect on the server.
|
10619
|
+
// To get around it, we can conditionally useEffect on the server (no-op) and
|
10620
|
+
// useLayoutEffect in the browser.
|
10621
|
+
var useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
|
10622
|
+
// This assignment is to extend the Navigator type to use effectiveType.
|
10623
|
+
var navigatorConnection = typeof navigator !== 'undefined' &&
|
10624
|
+
navigator.connection;
|
10625
|
+
// Adjust the config based on slow connection status (<= 70Kbps).
|
10626
|
+
var slowConnection = !IS_SERVER &&
|
10627
|
+
navigatorConnection &&
|
10628
|
+
(['slow-2g', '2g'].includes(navigatorConnection.effectiveType) ||
|
10629
|
+
navigatorConnection.saveData);
|
10630
|
+
|
10631
|
+
var serialize = function (key) {
|
10632
|
+
if (isFunction$1(key)) {
|
10633
|
+
try {
|
10634
|
+
key = key();
|
10635
|
+
}
|
10636
|
+
catch (err) {
|
10637
|
+
// dependencies not ready
|
10638
|
+
key = '';
|
10639
|
+
}
|
10640
|
+
}
|
10641
|
+
var args = [].concat(key);
|
10642
|
+
// If key is not falsy, or not an empty array, hash it.
|
10643
|
+
key =
|
10644
|
+
typeof key == 'string'
|
10645
|
+
? key
|
10646
|
+
: (Array.isArray(key)
|
10647
|
+
? key.length
|
10648
|
+
: key)
|
10649
|
+
? stableHash(key)
|
10650
|
+
: '';
|
10651
|
+
var errorKey = key ? '$err$' + key : '';
|
10652
|
+
var isValidatingKey = key ? '$req$' + key : '';
|
10653
|
+
return [key, args, errorKey, isValidatingKey];
|
10654
|
+
};
|
10655
|
+
|
10656
|
+
// Global state used to deduplicate requests and store listeners
|
10657
|
+
var SWRGlobalState = new WeakMap();
|
10658
|
+
|
10659
|
+
var FOCUS_EVENT = 0;
|
10660
|
+
var RECONNECT_EVENT = 1;
|
10661
|
+
var MUTATE_EVENT = 2;
|
10662
|
+
|
10663
|
+
var broadcastState = function (cache, key, data, error, isValidating, revalidate) {
|
10664
|
+
var _a = SWRGlobalState.get(cache), EVENT_REVALIDATORS = _a[0], STATE_UPDATERS = _a[1], CONCURRENT_PROMISES = _a[4], CONCURRENT_PROMISES_TS = _a[5];
|
10665
|
+
var revalidators = EVENT_REVALIDATORS[key];
|
10666
|
+
var updaters = STATE_UPDATERS[key] || [];
|
10667
|
+
// Always update states of all hooks.
|
10668
|
+
for (var i = 0; i < updaters.length; ++i) {
|
10669
|
+
updaters[i](data, error, isValidating);
|
10670
|
+
}
|
10671
|
+
// If we also need to revalidate, only do it for the first hook.
|
10672
|
+
if (revalidate) {
|
10673
|
+
// Invalidate the key by deleting the concurrent request markers so new
|
10674
|
+
// requests will not be deduped.
|
10675
|
+
delete CONCURRENT_PROMISES[key];
|
10676
|
+
delete CONCURRENT_PROMISES_TS[key];
|
10677
|
+
if (revalidators && revalidators[0]) {
|
10678
|
+
return revalidators[0](MUTATE_EVENT).then(function () {
|
10679
|
+
return cache.get(key);
|
10680
|
+
});
|
10681
|
+
}
|
10682
|
+
}
|
10683
|
+
return cache.get(key);
|
10684
|
+
};
|
10685
|
+
|
10686
|
+
// Global timestamp.
|
10687
|
+
var __timestamp = 0;
|
10688
|
+
var getTimestamp = function () { return ++__timestamp; };
|
10689
|
+
|
10690
|
+
var internalMutate = function () {
|
10691
|
+
var args = [];
|
10692
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
10693
|
+
args[_i] = arguments[_i];
|
10694
|
+
}
|
10695
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
10696
|
+
var cache, _key, revalidate, _data, _a, key, keyErr, _b, MUTATION_TS, MUTATION_END_TS, data, error, beforeMutationTs, res;
|
10697
|
+
return __generator(this, function (_c) {
|
10698
|
+
switch (_c.label) {
|
10699
|
+
case 0:
|
10700
|
+
cache = args[0], _key = args[1];
|
10701
|
+
revalidate = args[3] !== false;
|
10702
|
+
_data = args[2];
|
10703
|
+
_a = serialize(_key), key = _a[0], keyErr = _a[2];
|
10704
|
+
if (!key)
|
10705
|
+
return [2 /*return*/];
|
10706
|
+
_b = SWRGlobalState.get(cache), MUTATION_TS = _b[2], MUTATION_END_TS = _b[3];
|
10707
|
+
// If there is no new data provided, revalidate the key with current state.
|
10708
|
+
if (args.length < 3) {
|
10709
|
+
// Revalidate and broadcast state.
|
10710
|
+
return [2 /*return*/, broadcastState(cache, key, cache.get(key), cache.get(keyErr), UNDEFINED, revalidate)];
|
10711
|
+
}
|
10712
|
+
beforeMutationTs = (MUTATION_TS[key] = getTimestamp());
|
10713
|
+
MUTATION_END_TS[key] = 0;
|
10714
|
+
if (isFunction$1(_data)) {
|
10715
|
+
// `_data` is a function, call it passing current cache value.
|
10716
|
+
try {
|
10717
|
+
_data = _data(cache.get(key));
|
10718
|
+
}
|
10719
|
+
catch (err) {
|
10720
|
+
// If it throws an error synchronously, we shouldn't update the cache.
|
10721
|
+
error = err;
|
10722
|
+
}
|
10723
|
+
}
|
10724
|
+
if (!(_data && isFunction$1(_data.then))) return [3 /*break*/, 2];
|
10725
|
+
return [4 /*yield*/, _data.catch(function (err) {
|
10726
|
+
error = err;
|
10727
|
+
})
|
10728
|
+
// Check if other mutations have occurred since we've started this mutation.
|
10729
|
+
// If there's a race we don't update cache or broadcast the change,
|
10730
|
+
// just return the data.
|
10731
|
+
];
|
10732
|
+
case 1:
|
10733
|
+
// This means that the mutation is async, we need to check timestamps to
|
10734
|
+
// avoid race conditions.
|
10735
|
+
data = _c.sent();
|
10736
|
+
// Check if other mutations have occurred since we've started this mutation.
|
10737
|
+
// If there's a race we don't update cache or broadcast the change,
|
10738
|
+
// just return the data.
|
10739
|
+
if (beforeMutationTs !== MUTATION_TS[key]) {
|
10740
|
+
if (error)
|
10741
|
+
throw error;
|
10742
|
+
return [2 /*return*/, data];
|
10743
|
+
}
|
10744
|
+
return [3 /*break*/, 3];
|
10745
|
+
case 2:
|
10746
|
+
data = _data;
|
10747
|
+
_c.label = 3;
|
10748
|
+
case 3:
|
10749
|
+
// Only update cached data if there's no error. Data can be `undefined` here.
|
10750
|
+
if (!error) {
|
10751
|
+
cache.set(key, data);
|
10752
|
+
}
|
10753
|
+
// Always update or reset the error.
|
10754
|
+
cache.set(keyErr, error);
|
10755
|
+
// Reset the timestamp to mark the mutation has ended.
|
10756
|
+
MUTATION_END_TS[key] = getTimestamp();
|
10757
|
+
return [4 /*yield*/, broadcastState(cache, key, data, error, UNDEFINED, revalidate)
|
10758
|
+
// Throw error or return data
|
10759
|
+
];
|
10760
|
+
case 4:
|
10761
|
+
res = _c.sent();
|
10762
|
+
// Throw error or return data
|
10763
|
+
if (error)
|
10764
|
+
throw error;
|
10765
|
+
return [2 /*return*/, res];
|
10766
|
+
}
|
10767
|
+
});
|
10768
|
+
});
|
10769
|
+
};
|
10770
|
+
|
10771
|
+
var revalidateAllKeys = function (revalidators, type) {
|
10772
|
+
for (var key in revalidators) {
|
10773
|
+
if (revalidators[key][0])
|
10774
|
+
revalidators[key][0](type);
|
10775
|
+
}
|
10776
|
+
};
|
10777
|
+
var initCache = function (provider, options) {
|
10778
|
+
// The global state for a specific provider will be used to deduplicate
|
10779
|
+
// requests and store listeners. As well as a mutate function that bound to
|
10780
|
+
// the cache.
|
10781
|
+
// Provider's global state might be already initialized. Let's try to get the
|
10782
|
+
// global state associated with the provider first.
|
10783
|
+
if (!SWRGlobalState.has(provider)) {
|
10784
|
+
var opts = mergeObjects(defaultConfigOptions, options);
|
10785
|
+
// If there's no global state bound to the provider, create a new one with the
|
10786
|
+
// new mutate function.
|
10787
|
+
var EVENT_REVALIDATORS = {};
|
10788
|
+
var mutate = internalMutate.bind(UNDEFINED, provider);
|
10789
|
+
var unmount = noop;
|
10790
|
+
// Update the state if it's new, or the provider has been extended.
|
10791
|
+
SWRGlobalState.set(provider, [
|
10792
|
+
EVENT_REVALIDATORS,
|
10793
|
+
{},
|
10794
|
+
{},
|
10795
|
+
{},
|
10796
|
+
{},
|
10797
|
+
{},
|
10798
|
+
mutate
|
10799
|
+
]);
|
10800
|
+
// This is a new provider, we need to initialize it and setup DOM events
|
10801
|
+
// listeners for `focus` and `reconnect` actions.
|
10802
|
+
if (!IS_SERVER) {
|
10803
|
+
var releaseFocus_1 = opts.initFocus(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT));
|
10804
|
+
var releaseReconnect_1 = opts.initReconnect(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT));
|
10805
|
+
unmount = function () {
|
10806
|
+
releaseFocus_1 && releaseFocus_1();
|
10807
|
+
releaseReconnect_1 && releaseReconnect_1();
|
10808
|
+
// When un-mounting, we need to remove the cache provider from the state
|
10809
|
+
// storage too because it's a side-effect. Otherwise when re-mounting we
|
10810
|
+
// will not re-register those event listeners.
|
10811
|
+
SWRGlobalState.delete(provider);
|
10812
|
+
};
|
10813
|
+
}
|
10814
|
+
// We might want to inject an extra layer on top of `provider` in the future,
|
10815
|
+
// such as key serialization, auto GC, etc.
|
10816
|
+
// For now, it's just a `Map` interface without any modifications.
|
10817
|
+
return [provider, mutate, unmount];
|
10818
|
+
}
|
10819
|
+
return [provider, SWRGlobalState.get(provider)[6]];
|
10820
|
+
};
|
10821
|
+
|
10822
|
+
// error retry
|
10823
|
+
var onErrorRetry = function (_, __, config, revalidate, opts) {
|
10824
|
+
if (!preset.isVisible()) {
|
10825
|
+
// If it's hidden, stop. It will auto revalidate when refocusing.
|
10826
|
+
return;
|
10827
|
+
}
|
10828
|
+
var maxRetryCount = config.errorRetryCount;
|
10829
|
+
var currentRetryCount = opts.retryCount;
|
10830
|
+
// Exponential backoff
|
10831
|
+
var timeout = ~~((Math.random() + 0.5) *
|
10832
|
+
(1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
|
10833
|
+
if (!isUndefined$1(maxRetryCount) && currentRetryCount > maxRetryCount) {
|
10834
|
+
return;
|
10835
|
+
}
|
10836
|
+
setTimeout(revalidate, timeout, opts);
|
10837
|
+
};
|
10838
|
+
// Default cache provider
|
10839
|
+
var _a = initCache(new Map()), cache = _a[0], mutate = _a[1];
|
10840
|
+
// Default config
|
10841
|
+
var defaultConfig = mergeObjects({
|
10842
|
+
// events
|
10843
|
+
onLoadingSlow: noop,
|
10844
|
+
onSuccess: noop,
|
10845
|
+
onError: noop,
|
10846
|
+
onErrorRetry: onErrorRetry,
|
10847
|
+
onDiscarded: noop,
|
10848
|
+
// switches
|
10849
|
+
revalidateOnFocus: true,
|
10850
|
+
revalidateOnReconnect: true,
|
10851
|
+
revalidateIfStale: true,
|
10852
|
+
shouldRetryOnError: true,
|
10853
|
+
// timeouts
|
10854
|
+
errorRetryInterval: slowConnection ? 10000 : 5000,
|
10855
|
+
focusThrottleInterval: 5 * 1000,
|
10856
|
+
dedupingInterval: 2 * 1000,
|
10857
|
+
loadingTimeout: slowConnection ? 5000 : 3000,
|
10858
|
+
// providers
|
10859
|
+
compare: function (currentData, newData) {
|
10860
|
+
return stableHash(currentData) == stableHash(newData);
|
10861
|
+
},
|
10862
|
+
isPaused: function () { return false; },
|
10863
|
+
cache: cache,
|
10864
|
+
mutate: mutate,
|
10865
|
+
fallback: {}
|
10866
|
+
},
|
10867
|
+
// use web preset by default
|
10868
|
+
preset);
|
10869
|
+
|
10870
|
+
var mergeConfigs$1 = function (a, b) {
|
10871
|
+
// Need to create a new object to avoid mutating the original here.
|
10872
|
+
var v = mergeObjects(a, b);
|
10873
|
+
// If two configs are provided, merge their `use` and `fallback` options.
|
10874
|
+
if (b) {
|
10875
|
+
var u1 = a.use, f1 = a.fallback;
|
10876
|
+
var u2 = b.use, f2 = b.fallback;
|
10877
|
+
if (u1 && u2) {
|
10878
|
+
v.use = u1.concat(u2);
|
10879
|
+
}
|
10880
|
+
if (f1 && f2) {
|
10881
|
+
v.fallback = mergeObjects(f1, f2);
|
10882
|
+
}
|
10883
|
+
}
|
10884
|
+
return v;
|
10885
|
+
};
|
10886
|
+
|
10887
|
+
var SWRConfigContext = createContext({});
|
10888
|
+
var SWRConfig$1 = function (props) {
|
10889
|
+
var value = props.value;
|
10890
|
+
// Extend parent context values and middleware.
|
10891
|
+
var extendedConfig = mergeConfigs$1(useContext(SWRConfigContext), value);
|
10892
|
+
// Should not use the inherited provider.
|
10893
|
+
var provider = value && value.provider;
|
10894
|
+
// Use a lazy initialized state to create the cache on first access.
|
10895
|
+
var cacheContext = useState(function () {
|
10896
|
+
return provider
|
10897
|
+
? initCache(provider(extendedConfig.cache || cache), value)
|
10898
|
+
: UNDEFINED;
|
10899
|
+
})[0];
|
10900
|
+
// Override the cache if a new provider is given.
|
10901
|
+
if (cacheContext) {
|
10902
|
+
extendedConfig.cache = cacheContext[0];
|
10903
|
+
extendedConfig.mutate = cacheContext[1];
|
10904
|
+
}
|
10905
|
+
// Unsubscribe events.
|
10906
|
+
useIsomorphicLayoutEffect(function () { return (cacheContext ? cacheContext[2] : UNDEFINED); }, []);
|
10907
|
+
return createElement(SWRConfigContext.Provider, mergeObjects(props, {
|
10908
|
+
value: extendedConfig
|
10909
|
+
}));
|
10910
|
+
};
|
10911
|
+
var SWRConfig = OBJECT.defineProperty(SWRConfig$1, 'default', {
|
10912
|
+
value: defaultConfig
|
10913
|
+
});
|
10914
|
+
|
10915
|
+
var zhCN = {
|
10916
|
+
moneySymbol: '¥',
|
10917
|
+
form: {
|
10918
|
+
lightFilter: {
|
10919
|
+
more: '更多筛选',
|
10920
|
+
clear: '清除',
|
10921
|
+
confirm: '确认',
|
10922
|
+
itemUnit: '项'
|
10923
|
+
}
|
10924
|
+
},
|
10925
|
+
tableForm: {
|
10926
|
+
search: '查询',
|
10927
|
+
reset: '重置',
|
10928
|
+
submit: '提交',
|
10929
|
+
collapsed: '展开',
|
10930
|
+
expand: '收起',
|
10931
|
+
inputPlaceholder: '请输入',
|
10932
|
+
selectPlaceholder: '请选择'
|
10933
|
+
},
|
10934
|
+
alert: {
|
10935
|
+
clear: '取消选择',
|
10936
|
+
selected: '已选择',
|
10937
|
+
item: '项'
|
10938
|
+
},
|
10939
|
+
pagination: {
|
10940
|
+
total: {
|
10941
|
+
range: '第',
|
10942
|
+
total: '条/总共',
|
10943
|
+
item: '条'
|
10944
|
+
}
|
10945
|
+
},
|
10946
|
+
tableToolBar: {
|
10947
|
+
leftPin: '固定在列首',
|
10948
|
+
rightPin: '固定在列尾',
|
10949
|
+
noPin: '不固定',
|
10950
|
+
leftFixedTitle: '固定在左侧',
|
10951
|
+
rightFixedTitle: '固定在右侧',
|
10952
|
+
noFixedTitle: '不固定',
|
10953
|
+
reset: '重置',
|
10954
|
+
columnDisplay: '列展示',
|
10955
|
+
columnSetting: '列设置',
|
10956
|
+
fullScreen: '全屏',
|
10957
|
+
exitFullScreen: '退出全屏',
|
10958
|
+
reload: '刷新',
|
10959
|
+
density: '密度',
|
10960
|
+
densityDefault: '正常',
|
10961
|
+
densityLarger: '默认',
|
10962
|
+
densityMiddle: '中等',
|
10963
|
+
densitySmall: '紧凑'
|
10964
|
+
},
|
10965
|
+
editableTable: {
|
10966
|
+
action: {
|
10967
|
+
save: '保存',
|
10968
|
+
cancel: '取消',
|
10969
|
+
delete: '删除'
|
10970
|
+
}
|
10971
|
+
},
|
10972
|
+
switch: {
|
10973
|
+
open: '打开',
|
10974
|
+
close: '关闭'
|
10975
|
+
},
|
10976
|
+
loginForm: {
|
10977
|
+
submitText: '登录'
|
10978
|
+
}
|
10979
|
+
};
|
10980
|
+
|
10981
|
+
function get$3(source, path, defaultValue) {
|
10982
|
+
// a[3].b -> a.3.b
|
10983
|
+
var paths = path.replace(/\[(\d+)\]/g, '.$1').split('.');
|
10984
|
+
var result = source;
|
10985
|
+
var message = defaultValue; // eslint-disable-next-line no-restricted-syntax
|
10986
|
+
|
10987
|
+
var _iterator = _createForOfIteratorHelper$1(paths),
|
10988
|
+
_step;
|
10989
|
+
|
10990
|
+
try {
|
10991
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
10992
|
+
var p = _step.value;
|
10993
|
+
message = Object(result)[p];
|
10994
|
+
result = Object(result)[p];
|
10995
|
+
|
10996
|
+
if (message === undefined) {
|
10997
|
+
return defaultValue;
|
10998
|
+
}
|
10999
|
+
}
|
11000
|
+
} catch (err) {
|
11001
|
+
_iterator.e(err);
|
11002
|
+
} finally {
|
11003
|
+
_iterator.f();
|
11004
|
+
}
|
11005
|
+
|
11006
|
+
return message;
|
11007
|
+
}
|
11008
|
+
/**
|
11009
|
+
* 创建一个操作函数
|
11010
|
+
*
|
11011
|
+
* @param locale
|
11012
|
+
* @param localeMap
|
11013
|
+
*/
|
11014
|
+
|
11015
|
+
|
11016
|
+
var createIntl = function createIntl(locale, localeMap) {
|
11017
|
+
return {
|
11018
|
+
getMessage: function getMessage(id, defaultMessage) {
|
11019
|
+
return get$3(localeMap, id, defaultMessage) || defaultMessage;
|
11020
|
+
},
|
11021
|
+
locale: locale
|
11022
|
+
};
|
11023
|
+
};
|
11024
|
+
var zhCNIntl = createIntl('zh_CN', zhCN);
|
11025
|
+
var ConfigContext = /*#__PURE__*/React.createContext({
|
11026
|
+
intl: _objectSpread2$1(_objectSpread2$1({}, zhCNIntl), {}, {
|
11027
|
+
locale: 'default'
|
11028
|
+
}),
|
11029
|
+
valueTypeMap: {}
|
11030
|
+
});
|
11031
|
+
var ConfigConsumer = ConfigContext.Consumer,
|
11032
|
+
ConfigProvider = ConfigContext.Provider;
|
11033
|
+
|
11034
|
+
var _excluded$g = ["columns", "extraColumns", "request", "modalFormSearch", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig"],
|
11035
|
+
_excluded2$3 = ["actionMethod"];
|
10121
11036
|
|
10122
11037
|
var TabelCard = function TabelCard(props, ref) {
|
10123
11038
|
var columns = props.columns,
|
@@ -10131,7 +11046,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10131
11046
|
onFormChange = props.onFormChange,
|
10132
11047
|
modalConfig = props.modalConfig,
|
10133
11048
|
optionColumnConfig = props.optionColumnConfig,
|
10134
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
11049
|
+
extraProps = _objectWithoutProperties(props, _excluded$g);
|
10135
11050
|
|
10136
11051
|
var actionRef = useRef();
|
10137
11052
|
var formRef = useRef(null);
|
@@ -10158,164 +11073,243 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10158
11073
|
setModalFormConfig(options);
|
10159
11074
|
};
|
10160
11075
|
|
10161
|
-
var
|
10162
|
-
|
10163
|
-
|
10164
|
-
|
10165
|
-
|
10166
|
-
|
10167
|
-
|
10168
|
-
|
10169
|
-
|
10170
|
-
|
10171
|
-
|
10172
|
-
|
10173
|
-
|
10174
|
-
|
10175
|
-
|
10176
|
-
|
10177
|
-
|
10178
|
-
case 0:
|
10179
|
-
if (!item.actionMethod) {
|
10180
|
-
_context.next = 3;
|
10181
|
-
break;
|
10182
|
-
}
|
10183
|
-
|
10184
|
-
_context.next = 3;
|
10185
|
-
return item.actionMethod(values, function () {
|
10186
|
-
var _actionRef$current;
|
11076
|
+
var actionHandler = {
|
11077
|
+
view: function view(item, record, index) {
|
11078
|
+
openFormModel({
|
11079
|
+
type: '查看',
|
11080
|
+
record: record,
|
11081
|
+
modalOnOk: function () {
|
11082
|
+
var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
11083
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
11084
|
+
while (1) {
|
11085
|
+
switch (_context.prev = _context.next) {
|
11086
|
+
case 0:
|
11087
|
+
case "end":
|
11088
|
+
return _context.stop();
|
11089
|
+
}
|
11090
|
+
}
|
11091
|
+
}, _callee);
|
11092
|
+
}));
|
10187
11093
|
|
10188
|
-
|
10189
|
-
|
10190
|
-
|
11094
|
+
function modalOnOk() {
|
11095
|
+
return _modalOnOk.apply(this, arguments);
|
11096
|
+
}
|
10191
11097
|
|
10192
|
-
|
10193
|
-
|
10194
|
-
|
10195
|
-
|
11098
|
+
return modalOnOk;
|
11099
|
+
}(),
|
11100
|
+
index: index
|
11101
|
+
});
|
11102
|
+
},
|
11103
|
+
edit: function edit(item, record, index) {
|
11104
|
+
openFormModel({
|
11105
|
+
type: '编辑',
|
11106
|
+
record: record,
|
11107
|
+
modalOnOk: function () {
|
11108
|
+
var _modalOnOk2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(values, loading) {
|
11109
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
11110
|
+
while (1) {
|
11111
|
+
switch (_context2.prev = _context2.next) {
|
11112
|
+
case 0:
|
11113
|
+
if (!item.actionMethod) {
|
11114
|
+
_context2.next = 3;
|
11115
|
+
break;
|
10196
11116
|
}
|
10197
|
-
}, _callee);
|
10198
|
-
}));
|
10199
11117
|
|
10200
|
-
|
10201
|
-
|
10202
|
-
|
11118
|
+
_context2.next = 3;
|
11119
|
+
return item.actionMethod(values, function () {
|
11120
|
+
var _actionRef$current;
|
10203
11121
|
|
10204
|
-
|
10205
|
-
|
10206
|
-
|
10207
|
-
});
|
10208
|
-
}
|
10209
|
-
}, /*#__PURE__*/React.createElement(EditOutlined, null), " \u7F16\u8F91"));
|
10210
|
-
} else if (item.type === 'view') {
|
10211
|
-
return /*#__PURE__*/React.createElement(_Tooltip, {
|
10212
|
-
title: "\u67E5\u770B",
|
10213
|
-
key: "view"
|
10214
|
-
}, /*#__PURE__*/React.createElement("a", {
|
10215
|
-
onClick: function onClick() {
|
10216
|
-
return openFormModel({
|
10217
|
-
type: '查看',
|
10218
|
-
record: record,
|
10219
|
-
modalOnOk: function () {
|
10220
|
-
var _modalOnOk2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
10221
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
10222
|
-
while (1) {
|
10223
|
-
switch (_context2.prev = _context2.next) {
|
10224
|
-
case 0:
|
10225
|
-
case "end":
|
10226
|
-
return _context2.stop();
|
10227
|
-
}
|
10228
|
-
}
|
10229
|
-
}, _callee2);
|
10230
|
-
}));
|
11122
|
+
loading();
|
11123
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.reload();
|
11124
|
+
}, record);
|
10231
11125
|
|
10232
|
-
|
10233
|
-
|
11126
|
+
case 3:
|
11127
|
+
case "end":
|
11128
|
+
return _context2.stop();
|
10234
11129
|
}
|
11130
|
+
}
|
11131
|
+
}, _callee2);
|
11132
|
+
}));
|
10235
11133
|
|
10236
|
-
|
10237
|
-
|
10238
|
-
|
10239
|
-
});
|
10240
|
-
},
|
10241
|
-
key: "view"
|
10242
|
-
}, /*#__PURE__*/React.createElement(EyeOutlined, null), " \u67E5\u770B"));
|
10243
|
-
} else if (item.type === 'delete') {
|
10244
|
-
return /*#__PURE__*/React.createElement(_Tooltip, {
|
10245
|
-
title: "\u5220\u9664",
|
10246
|
-
key: "delete"
|
10247
|
-
}, /*#__PURE__*/React.createElement("a", {
|
10248
|
-
onClick: function onClick() {
|
10249
|
-
return _Modal.confirm({
|
10250
|
-
title: '删除',
|
10251
|
-
icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
|
10252
|
-
content: '是否确定要删除吗?',
|
10253
|
-
okText: '确认',
|
10254
|
-
cancelText: '取消',
|
10255
|
-
onOk: function () {
|
10256
|
-
var _onOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
10257
|
-
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
10258
|
-
while (1) {
|
10259
|
-
switch (_context3.prev = _context3.next) {
|
10260
|
-
case 0:
|
10261
|
-
if (!item.actionMethod) {
|
10262
|
-
_context3.next = 3;
|
10263
|
-
break;
|
10264
|
-
}
|
11134
|
+
function modalOnOk(_x, _x2) {
|
11135
|
+
return _modalOnOk2.apply(this, arguments);
|
11136
|
+
}
|
10265
11137
|
|
10266
|
-
|
10267
|
-
|
10268
|
-
|
11138
|
+
return modalOnOk;
|
11139
|
+
}(),
|
11140
|
+
index: index
|
11141
|
+
});
|
11142
|
+
},
|
11143
|
+
delete: function _delete(item, record, index) {
|
11144
|
+
_Modal.confirm({
|
11145
|
+
title: '删除',
|
11146
|
+
icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
|
11147
|
+
content: '是否确定要删除吗?',
|
11148
|
+
okText: '确认',
|
11149
|
+
cancelText: '取消',
|
11150
|
+
onOk: function () {
|
11151
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
11152
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
11153
|
+
while (1) {
|
11154
|
+
switch (_context3.prev = _context3.next) {
|
11155
|
+
case 0:
|
11156
|
+
if (!item.actionMethod) {
|
11157
|
+
_context3.next = 3;
|
11158
|
+
break;
|
11159
|
+
}
|
10269
11160
|
|
10270
|
-
|
10271
|
-
|
11161
|
+
_context3.next = 3;
|
11162
|
+
return item.actionMethod(record, function () {
|
11163
|
+
var _actionRef$current2;
|
10272
11164
|
|
10273
|
-
|
10274
|
-
|
10275
|
-
return _context3.stop();
|
10276
|
-
}
|
10277
|
-
}
|
10278
|
-
}, _callee3);
|
10279
|
-
}));
|
11165
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : _actionRef$current2.reload();
|
11166
|
+
});
|
10280
11167
|
|
10281
|
-
|
10282
|
-
|
11168
|
+
case 3:
|
11169
|
+
case "end":
|
11170
|
+
return _context3.stop();
|
10283
11171
|
}
|
11172
|
+
}
|
11173
|
+
}, _callee3);
|
11174
|
+
}));
|
10284
11175
|
|
10285
|
-
|
10286
|
-
|
10287
|
-
|
10288
|
-
},
|
10289
|
-
key: "del"
|
10290
|
-
}, /*#__PURE__*/React.createElement(DeleteOutlined, null), " \u5220\u9664"));
|
10291
|
-
} else if (item.type === 'extraAction') {
|
10292
|
-
var _item$actionRender;
|
11176
|
+
function onOk() {
|
11177
|
+
return _onOk.apply(this, arguments);
|
11178
|
+
}
|
10293
11179
|
|
10294
|
-
|
10295
|
-
|
10296
|
-
|
10297
|
-
|
10298
|
-
|
10299
|
-
|
10300
|
-
_context4.next = 3;
|
10301
|
-
break;
|
10302
|
-
}
|
11180
|
+
return onOk;
|
11181
|
+
}()
|
11182
|
+
});
|
11183
|
+
},
|
11184
|
+
extraAction: function extraAction(item, record, index) {
|
11185
|
+
var _item$actionRender;
|
10303
11186
|
|
11187
|
+
return (_item$actionRender = item.actionRender) === null || _item$actionRender === void 0 ? void 0 : _item$actionRender.call(item, record, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
11188
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
11189
|
+
while (1) {
|
11190
|
+
switch (_context4.prev = _context4.next) {
|
11191
|
+
case 0:
|
11192
|
+
if (!item.actionMethod) {
|
10304
11193
|
_context4.next = 3;
|
10305
|
-
|
10306
|
-
|
11194
|
+
break;
|
11195
|
+
}
|
10307
11196
|
|
10308
|
-
|
10309
|
-
|
11197
|
+
_context4.next = 3;
|
11198
|
+
return item.actionMethod(record, function () {
|
11199
|
+
var _actionRef$current3;
|
10310
11200
|
|
10311
|
-
|
10312
|
-
|
10313
|
-
|
10314
|
-
|
11201
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : _actionRef$current3.reload();
|
11202
|
+
});
|
11203
|
+
|
11204
|
+
case 3:
|
11205
|
+
case "end":
|
11206
|
+
return _context4.stop();
|
10315
11207
|
}
|
10316
|
-
}
|
10317
|
-
}
|
11208
|
+
}
|
11209
|
+
}, _callee4);
|
11210
|
+
})), index);
|
11211
|
+
},
|
11212
|
+
more: function more(item, record, index) {
|
11213
|
+
var menus = !item.subMenus ? [] : item.subMenus.map(function (b) {
|
11214
|
+
var btn = actionConfig[b.key];
|
11215
|
+
|
11216
|
+
if (btn) {
|
11217
|
+
b.name = btn.title;
|
11218
|
+
b.icon = btn.icon;
|
11219
|
+
}
|
11220
|
+
|
11221
|
+
return b;
|
11222
|
+
});
|
11223
|
+
|
11224
|
+
var selectHandler = function selectHandler(key, item, record, index) {
|
11225
|
+
var _item$actionMethod;
|
11226
|
+
|
11227
|
+
if (key == 'more') {
|
11228
|
+
// No more recursion
|
11229
|
+
return;
|
11230
|
+
}
|
11231
|
+
|
11232
|
+
var customMenu = menus.find(function (m) {
|
11233
|
+
return m.key === key;
|
11234
|
+
});
|
11235
|
+
|
11236
|
+
var _item = _objectSpread2(_objectSpread2({}, customMenu), {}, {
|
11237
|
+
type: key
|
11238
|
+
});
|
11239
|
+
|
11240
|
+
var handler = actionHandler[key];
|
11241
|
+
|
11242
|
+
if (handler) {
|
11243
|
+
return handler(_item, record, index);
|
11244
|
+
}
|
11245
|
+
|
11246
|
+
return (_item$actionMethod = _item.actionMethod) === null || _item$actionMethod === void 0 ? void 0 : _item$actionMethod.call(_item, record, function () {
|
11247
|
+
var _actionRef$current4;
|
11248
|
+
|
11249
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
|
11250
|
+
});
|
11251
|
+
};
|
11252
|
+
|
11253
|
+
var m = _toConsumableArray(menus).map(function (e) {
|
11254
|
+
if (!('actionMethod' in e)) {
|
11255
|
+
return e;
|
11256
|
+
}
|
11257
|
+
|
11258
|
+
var actionMethod = e.actionMethod,
|
11259
|
+
b = _objectWithoutProperties(e, _excluded2$3);
|
11260
|
+
|
11261
|
+
return _objectSpread2({}, b);
|
11262
|
+
});
|
11263
|
+
|
11264
|
+
return /*#__PURE__*/React.createElement(TableDropdown, {
|
11265
|
+
key: "actionGroup",
|
11266
|
+
children: /*#__PURE__*/React.createElement(MoreOutlined, null),
|
11267
|
+
menus: m,
|
11268
|
+
onSelect: function onSelect(key) {
|
11269
|
+
return selectHandler(key, item, record, index);
|
11270
|
+
}
|
11271
|
+
});
|
11272
|
+
}
|
11273
|
+
};
|
11274
|
+
var actionConfig = {
|
11275
|
+
view: {
|
11276
|
+
title: '查看',
|
11277
|
+
key: 'view',
|
11278
|
+
icon: /*#__PURE__*/React.createElement(EyeOutlined, null)
|
11279
|
+
},
|
11280
|
+
edit: {
|
11281
|
+
title: '编辑',
|
11282
|
+
key: 'edit',
|
11283
|
+
icon: /*#__PURE__*/React.createElement(EditOutlined, null)
|
11284
|
+
},
|
11285
|
+
delete: {
|
11286
|
+
title: '删除',
|
11287
|
+
key: 'delete',
|
11288
|
+
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
|
11289
|
+
}
|
11290
|
+
};
|
11291
|
+
|
11292
|
+
var tableActionDom = function tableActionDom(record, index) {
|
11293
|
+
return tableAction === null || tableAction === void 0 ? void 0 : tableAction.map(function (item) {
|
11294
|
+
var _actionHandler$item$t2;
|
11295
|
+
|
11296
|
+
var btn = actionConfig[item.type];
|
11297
|
+
|
11298
|
+
if (btn) {
|
11299
|
+
return /*#__PURE__*/React.createElement(_Tooltip, {
|
11300
|
+
title: btn.title,
|
11301
|
+
key: btn.key
|
11302
|
+
}, /*#__PURE__*/React.createElement("a", {
|
11303
|
+
key: btn.key,
|
11304
|
+
onClick: function onClick() {
|
11305
|
+
var _actionHandler$item$t;
|
11306
|
+
|
11307
|
+
return (_actionHandler$item$t = actionHandler[item.type]) === null || _actionHandler$item$t === void 0 ? void 0 : _actionHandler$item$t.call(actionHandler, item, record, index);
|
11308
|
+
}
|
11309
|
+
}, btn.icon, " ", btn.title));
|
10318
11310
|
}
|
11311
|
+
|
11312
|
+
return (_actionHandler$item$t2 = actionHandler[item.type]) === null || _actionHandler$item$t2 === void 0 ? void 0 : _actionHandler$item$t2.call(actionHandler, item, record, index);
|
10319
11313
|
});
|
10320
11314
|
};
|
10321
11315
|
|
@@ -10345,10 +11339,10 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10345
11339
|
|
10346
11340
|
_context5.next = 3;
|
10347
11341
|
return item.actionMethod(values, function () {
|
10348
|
-
var _actionRef$
|
11342
|
+
var _actionRef$current5;
|
10349
11343
|
|
10350
11344
|
loading();
|
10351
|
-
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
11345
|
+
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.reload();
|
10352
11346
|
});
|
10353
11347
|
|
10354
11348
|
case 3:
|
@@ -10373,14 +11367,15 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10373
11367
|
|
10374
11368
|
return (_item$actionRender2 = item.actionRender) === null || _item$actionRender2 === void 0 ? void 0 : _item$actionRender2.call(item, actionRef, function () {
|
10375
11369
|
item.actionMethod && item.actionMethod(actionRef, function () {
|
10376
|
-
var _actionRef$
|
11370
|
+
var _actionRef$current6;
|
10377
11371
|
|
10378
|
-
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$
|
11372
|
+
return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : _actionRef$current6.reload();
|
10379
11373
|
});
|
10380
11374
|
});
|
10381
11375
|
}
|
10382
11376
|
});
|
10383
11377
|
}, [actionRef]);
|
11378
|
+
var values = useContext(ConfigContext);
|
10384
11379
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10385
11380
|
ref: formRef,
|
10386
11381
|
title: modalFormConfig.type || '新增',
|
@@ -10435,7 +11430,20 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10435
11430
|
|
10436
11431
|
return true;
|
10437
11432
|
})
|
10438
|
-
})), /*#__PURE__*/React.createElement(
|
11433
|
+
})), /*#__PURE__*/React.createElement(ConfigContext.Provider, {
|
11434
|
+
value: _objectSpread2(_objectSpread2({}, values), {}, {
|
11435
|
+
valueTypeMap: {
|
11436
|
+
treeSelect: {
|
11437
|
+
render: function render(text) {
|
11438
|
+
return /*#__PURE__*/React.createElement("span", null, text);
|
11439
|
+
},
|
11440
|
+
renderFormItem: function renderFormItem(text, props) {
|
11441
|
+
return /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({}, props), props === null || props === void 0 ? void 0 : props.fieldProps));
|
11442
|
+
}
|
11443
|
+
}
|
11444
|
+
}
|
11445
|
+
})
|
11446
|
+
}, /*#__PURE__*/React.createElement(ProTable, _objectSpread2({
|
10439
11447
|
actionRef: actionRef,
|
10440
11448
|
rowKey: "id",
|
10441
11449
|
bordered: true,
|
@@ -10476,9 +11484,9 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10476
11484
|
pagination: {
|
10477
11485
|
pageSize: 20
|
10478
11486
|
}
|
10479
|
-
}, extraProps)));
|
11487
|
+
}, extraProps))));
|
10480
11488
|
};
|
10481
11489
|
|
10482
11490
|
var index$1 = /*#__PURE__*/React.forwardRef(TabelCard);
|
10483
11491
|
|
10484
|
-
export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, Index$4 as Checkbox, Index$8 as CountUp, Index$2 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Index$7 as Number, NumericInput, Index$3 as Radio, Index$1 as Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$5 as TreeSelect, Index$6 as WDatePicker, WForm$1 as WForm };
|
11492
|
+
export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, WCascader as Cascader, Index$4 as Checkbox, Index$8 as CountUp, Index$2 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Index$7 as Number, NumericInput, Index$3 as Radio, Index$1 as Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$5 as TreeSelect, Index$6 as WDatePicker, WForm$1 as WForm };
|