@signalplus/params-about 1.0.5-alpha4 → 1.0.5
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/lib/es/index.js +35 -26
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
|
-
* Generated: 2023-05-
|
|
4
|
-
* Version: 1.0.5
|
|
3
|
+
* Generated: 2023-05-16
|
|
4
|
+
* Version: 1.0.5
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -11,7 +11,7 @@ import classNames from 'classnames';
|
|
|
11
11
|
import dayjs from 'dayjs';
|
|
12
12
|
import Big from 'big.js';
|
|
13
13
|
import { PlusOutlined, DeleteOutlined, CloseOutlined, CheckOutlined, DownOutlined } from '@ant-design/icons';
|
|
14
|
-
import { Popover,
|
|
14
|
+
import { Popover, Cascader, Input, Select, Form, Button, message, Modal } from 'antd';
|
|
15
15
|
import ReactGlobalComp from 'react-global-comp';
|
|
16
16
|
import { isEqual } from 'lodash-es';
|
|
17
17
|
import ReactFileInput from '@livelybone/react-file-input';
|
|
@@ -260,7 +260,7 @@ function formatNum(val) {
|
|
|
260
260
|
return isNaN(num) ? undefined : num;
|
|
261
261
|
}
|
|
262
262
|
function isNullLike(val) {
|
|
263
|
-
return val === undefined || val === null
|
|
263
|
+
return val === undefined || val === null;
|
|
264
264
|
}
|
|
265
265
|
function emptyValidator(val, enableEmpty) {
|
|
266
266
|
return !enableEmpty && (isNullLike(val) || val instanceof Array && !val.length || typeof val === 'string' && !val) ? 'Should not be empty' : '';
|
|
@@ -1316,14 +1316,20 @@ var Instruments = /*#__PURE__*/function (_PureComponent) {
|
|
|
1316
1316
|
placement: 'bottomLeft',
|
|
1317
1317
|
visible: !this.props.readonly && this.state.visible,
|
|
1318
1318
|
onVisibleChange: this.handleVisibleChange,
|
|
1319
|
-
content: /*#__PURE__*/React.createElement(
|
|
1319
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
1320
|
+
className: "param-renderer"
|
|
1321
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
1322
|
+
style: {
|
|
1323
|
+
width: '180px',
|
|
1324
|
+
height: '30px'
|
|
1325
|
+
},
|
|
1320
1326
|
onChange: function onChange(e) {
|
|
1321
1327
|
return _this3.inputValueChange(e.target.value);
|
|
1322
1328
|
}
|
|
1323
1329
|
}), /*#__PURE__*/React.createElement("div", {
|
|
1324
1330
|
style: {
|
|
1325
1331
|
marginTop: 2,
|
|
1326
|
-
width:
|
|
1332
|
+
width: 220,
|
|
1327
1333
|
height: 300,
|
|
1328
1334
|
overflowY: 'auto',
|
|
1329
1335
|
overflowX: 'hidden'
|
|
@@ -1803,7 +1809,7 @@ var ParamRenderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
1803
1809
|
value: function render() {
|
|
1804
1810
|
var Comp = this.typeConfig.Comp;
|
|
1805
1811
|
return /*#__PURE__*/React.createElement(Comp, Object.assign({}, this.props, {
|
|
1806
|
-
options: this.typeConfig.key === '
|
|
1812
|
+
options: this.typeConfig.key === 'instrumentNumberList' ? this.props.instrumentsOptions : this.props.expiriesOptions,
|
|
1807
1813
|
value: this.value,
|
|
1808
1814
|
onChange: this.onChange,
|
|
1809
1815
|
className: classNames('param-renderer', this.props.className)
|
|
@@ -1907,7 +1913,6 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1907
1913
|
|
|
1908
1914
|
var valueType = (_this$ref$current$get = (_this$ref$current = this.ref.current) === null || _this$ref$current === void 0 ? void 0 : _this$ref$current.getFieldValue('valueType')) !== null && _this$ref$current$get !== void 0 ? _this$ref$current$get : (_this$props$initialVa = this.props.initialValues) === null || _this$props$initialVa === void 0 ? void 0 : _this$props$initialVa.valueType;
|
|
1909
1915
|
var config = ParamTypeConfig[valueType];
|
|
1910
|
-
console.log('ParamTypeOptions', ParamTypeOptions);
|
|
1911
1916
|
return [{
|
|
1912
1917
|
label: '所属分组',
|
|
1913
1918
|
name: 'parentId',
|
|
@@ -1995,6 +2000,8 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1995
2000
|
}, {
|
|
1996
2001
|
key: "render",
|
|
1997
2002
|
value: function render() {
|
|
2003
|
+
var _this3 = this;
|
|
2004
|
+
|
|
1998
2005
|
return /*#__PURE__*/React.createElement(Form, {
|
|
1999
2006
|
className: "param-form",
|
|
2000
2007
|
ref: this.ref,
|
|
@@ -2003,6 +2010,8 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
2003
2010
|
onFinish: this.props.onSubmit,
|
|
2004
2011
|
onValuesChange: this.onChange
|
|
2005
2012
|
}, this.formItems.map(function (it) {
|
|
2013
|
+
var _this3$ref$current;
|
|
2014
|
+
|
|
2006
2015
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
2007
2016
|
key: it.name,
|
|
2008
2017
|
label: it.label,
|
|
@@ -2014,7 +2023,7 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
2014
2023
|
return Promise.resolve();
|
|
2015
2024
|
}
|
|
2016
2025
|
}],
|
|
2017
|
-
validateTrigger: 'onBlur'
|
|
2026
|
+
validateTrigger: it.name === 'defaultValue' && [4, 5, 6, 10, 11].includes((_this3$ref$current = _this3.ref.current) === null || _this3$ref$current === void 0 ? void 0 : _this3$ref$current.getFieldValue('valueType')) ? 'onSubmit' : 'onBlur'
|
|
2018
2027
|
}, /*#__PURE__*/React.createElement(it.Comp, null));
|
|
2019
2028
|
}), this.props.onSubmit && /*#__PURE__*/React.createElement(Button, {
|
|
2020
2029
|
type: "primary",
|
|
@@ -2032,7 +2041,7 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
2032
2041
|
var _super2 = _createSuper(ParamFormModalEl);
|
|
2033
2042
|
|
|
2034
2043
|
function ParamFormModalEl() {
|
|
2035
|
-
var
|
|
2044
|
+
var _this4;
|
|
2036
2045
|
|
|
2037
2046
|
_classCallCheck(this, ParamFormModalEl);
|
|
2038
2047
|
|
|
@@ -2040,50 +2049,50 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
2040
2049
|
args[_key2] = arguments[_key2];
|
|
2041
2050
|
}
|
|
2042
2051
|
|
|
2043
|
-
|
|
2052
|
+
_this4 = _super2.call.apply(_super2, [this].concat(args));
|
|
2044
2053
|
|
|
2045
|
-
_defineProperty(_assertThisInitialized(
|
|
2054
|
+
_defineProperty(_assertThisInitialized(_this4), "ref", React.createRef());
|
|
2046
2055
|
|
|
2047
|
-
_defineProperty(_assertThisInitialized(
|
|
2056
|
+
_defineProperty(_assertThisInitialized(_this4), "state", {
|
|
2048
2057
|
visible: false,
|
|
2049
2058
|
pending: false
|
|
2050
2059
|
});
|
|
2051
2060
|
|
|
2052
|
-
_defineProperty(_assertThisInitialized(
|
|
2053
|
-
return
|
|
2061
|
+
_defineProperty(_assertThisInitialized(_this4), "onShow", function () {
|
|
2062
|
+
return _this4.setState({
|
|
2054
2063
|
visible: true
|
|
2055
2064
|
});
|
|
2056
2065
|
});
|
|
2057
2066
|
|
|
2058
|
-
_defineProperty(_assertThisInitialized(
|
|
2059
|
-
return
|
|
2067
|
+
_defineProperty(_assertThisInitialized(_this4), "onHide", function () {
|
|
2068
|
+
return _this4.setState({
|
|
2060
2069
|
visible: false
|
|
2061
2070
|
});
|
|
2062
2071
|
});
|
|
2063
2072
|
|
|
2064
|
-
_defineProperty(_assertThisInitialized(
|
|
2065
|
-
var form =
|
|
2073
|
+
_defineProperty(_assertThisInitialized(_this4), "onSubmit", function () {
|
|
2074
|
+
var form = _this4.ref.current.ref.current;
|
|
2066
2075
|
return form.validateFields().then(function () {
|
|
2067
|
-
return
|
|
2076
|
+
return _this4.setState({
|
|
2068
2077
|
pending: true
|
|
2069
2078
|
});
|
|
2070
2079
|
}).then(function () {
|
|
2071
|
-
var data = _objectSpread2(_objectSpread2({},
|
|
2080
|
+
var data = _objectSpread2(_objectSpread2({}, _this4.props.initialValues), form.getFieldsValue());
|
|
2072
2081
|
|
|
2073
|
-
if (
|
|
2082
|
+
if (_this4.isEdit && isEqual(data, _this4.props.initialValues)) {
|
|
2074
2083
|
message.warning('请修改后再提交');
|
|
2075
2084
|
return Promise.reject();
|
|
2076
2085
|
}
|
|
2077
2086
|
|
|
2078
|
-
return
|
|
2079
|
-
}).then(
|
|
2080
|
-
return
|
|
2087
|
+
return _this4.props.onSubmit(data);
|
|
2088
|
+
}).then(_this4.onHide).catch(console.error).finally(function () {
|
|
2089
|
+
return _this4.setState({
|
|
2081
2090
|
pending: false
|
|
2082
2091
|
});
|
|
2083
2092
|
});
|
|
2084
2093
|
});
|
|
2085
2094
|
|
|
2086
|
-
return
|
|
2095
|
+
return _this4;
|
|
2087
2096
|
}
|
|
2088
2097
|
|
|
2089
2098
|
_createClass(ParamFormModalEl, [{
|