@zgfe/business-lib 1.2.32 → 1.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AUMFormulaTarget/components/formula/index.js +45 -4
- package/es/AUMFormulaTarget/components/formula/types.d.ts +2 -1
- package/es/AUMFormulaTarget/index.js +6 -3
- package/es/AUMFormulaTarget/types.d.ts +1 -0
- package/es/attrConditions/utils/operates.js +3 -0
- package/es/select/handle.js +2 -2
- package/package.json +2 -2
|
@@ -28,13 +28,17 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
28
28
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
29
29
|
fieldValue = _useState6[0],
|
|
30
30
|
setFieldValue = _useState6[1];
|
|
31
|
+
var _useState7 = useState(),
|
|
32
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
33
|
+
fieldMaxValue = _useState8[0],
|
|
34
|
+
setFieldMaxValue = _useState8[1];
|
|
31
35
|
useEffect(function () {
|
|
32
36
|
init();
|
|
33
37
|
}, []);
|
|
34
38
|
useEffect(function () {
|
|
35
39
|
var item = formatTarget(targetList, 1);
|
|
36
|
-
props.onChange && props.onChange(item.formulaList, item.formula, operator === null || operator === void 0 ? void 0 : operator.value, fieldValue);
|
|
37
|
-
}, [targetList, operator, fieldValue]);
|
|
40
|
+
props.onChange && props.onChange(item.formulaList, item.formula, operator === null || operator === void 0 ? void 0 : operator.value, fieldValue, fieldMaxValue);
|
|
41
|
+
}, [targetList, operator, fieldValue, fieldMaxValue]);
|
|
38
42
|
useImperativeHandle(ref, function () {
|
|
39
43
|
return {
|
|
40
44
|
reset: init
|
|
@@ -45,6 +49,7 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
45
49
|
value: props.operator
|
|
46
50
|
});
|
|
47
51
|
setFieldValue(props.fieldValue);
|
|
52
|
+
setFieldMaxValue(props.fieldMaxValue);
|
|
48
53
|
setTargetList(targetsFormat(props.formula, props.value, 1));
|
|
49
54
|
};
|
|
50
55
|
var _onChange = function onChange(index, data) {
|
|
@@ -138,14 +143,18 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
138
143
|
overlayWidth: 96,
|
|
139
144
|
value: operator,
|
|
140
145
|
onChange: onOperateChange
|
|
141
|
-
}), /*#__PURE__*/React.createElement(
|
|
146
|
+
}), operator && operator.value === 'between' ? /*#__PURE__*/React.createElement("span", {
|
|
147
|
+
style: {
|
|
148
|
+
display: 'flex'
|
|
149
|
+
}
|
|
150
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
142
151
|
style: {
|
|
143
152
|
marginLeft: 16,
|
|
144
153
|
borderWidth: 0
|
|
145
154
|
},
|
|
146
155
|
type: "number",
|
|
147
156
|
value: fieldValue,
|
|
148
|
-
placeholder: "\u8BF7\u8F93\u5165",
|
|
157
|
+
placeholder: "\u8BF7\u8F93\u5165\u6700\u5C0F\u503C",
|
|
149
158
|
onChange: function onChange(e) {
|
|
150
159
|
var _e$target$value;
|
|
151
160
|
e.persist();
|
|
@@ -154,6 +163,38 @@ var FormulaContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
154
163
|
var dealStr = xsStr ? str.split('.')[0] + '.' + xsStr : str;
|
|
155
164
|
setFieldValue(dealStr);
|
|
156
165
|
}
|
|
166
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
167
|
+
style: {
|
|
168
|
+
marginLeft: 16,
|
|
169
|
+
borderWidth: 0
|
|
170
|
+
},
|
|
171
|
+
type: "number",
|
|
172
|
+
value: fieldMaxValue,
|
|
173
|
+
placeholder: "\u8BF7\u8F93\u5165\u6700\u5927\u503C",
|
|
174
|
+
onChange: function onChange(e) {
|
|
175
|
+
var _e$target$value2;
|
|
176
|
+
e.persist();
|
|
177
|
+
var str = (_e$target$value2 = e.target.value) === null || _e$target$value2 === void 0 ? void 0 : _e$target$value2.slice(0, 20);
|
|
178
|
+
var xsStr = str.split('.')[1] ? str.split('.')[1].slice(0, 2) : '';
|
|
179
|
+
var dealStr = xsStr ? str.split('.')[0] + '.' + xsStr : str;
|
|
180
|
+
setFieldMaxValue(dealStr);
|
|
181
|
+
}
|
|
182
|
+
})) : /*#__PURE__*/React.createElement(Input, {
|
|
183
|
+
style: {
|
|
184
|
+
marginLeft: 16,
|
|
185
|
+
borderWidth: 0
|
|
186
|
+
},
|
|
187
|
+
type: "number",
|
|
188
|
+
value: fieldValue,
|
|
189
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
190
|
+
onChange: function onChange(e) {
|
|
191
|
+
var _e$target$value3;
|
|
192
|
+
e.persist();
|
|
193
|
+
var str = (_e$target$value3 = e.target.value) === null || _e$target$value3 === void 0 ? void 0 : _e$target$value3.slice(0, 20);
|
|
194
|
+
var xsStr = str.split('.')[1] ? str.split('.')[1].slice(0, 2) : '';
|
|
195
|
+
var dealStr = xsStr ? str.split('.')[0] + '.' + xsStr : str;
|
|
196
|
+
setFieldValue(dealStr);
|
|
197
|
+
}
|
|
157
198
|
}), /*#__PURE__*/React.createElement(IconFont, {
|
|
158
199
|
style: {
|
|
159
200
|
marginLeft: 16
|
|
@@ -6,7 +6,8 @@ export declare namespace FormulaContainerTypes {
|
|
|
6
6
|
resultFormat?: string;
|
|
7
7
|
operator?: string;
|
|
8
8
|
fieldValue?: string;
|
|
9
|
-
|
|
9
|
+
fieldMaxValue?: string;
|
|
10
|
+
onChange?: (formulaList: TargetConditionTypes.Value[], formula: string, operator?: string, fieldValue?: string, fieldMaxValue?: string) => void;
|
|
10
11
|
}
|
|
11
12
|
type Value = null | string | TargetConditionTypes.Value;
|
|
12
13
|
interface FormulaItemValue {
|
|
@@ -19,21 +19,23 @@ var BizFormulaTarget = function BizFormulaTarget(props) {
|
|
|
19
19
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
20
|
condition = _useState2[0],
|
|
21
21
|
setCondition = _useState2[1];
|
|
22
|
-
var onChange = function onChange(customCondition, formula, operator, fieldValue) {
|
|
22
|
+
var onChange = function onChange(customCondition, formula, operator, fieldValue, fieldMaxValue) {
|
|
23
23
|
setCondition(function (value) {
|
|
24
24
|
props.onChange && props.onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
25
25
|
alias: (value || {}).eventName,
|
|
26
26
|
customCondition: customCondition,
|
|
27
27
|
formula: formula,
|
|
28
28
|
operator: operator,
|
|
29
|
-
fieldValue: fieldValue
|
|
29
|
+
fieldValue: fieldValue,
|
|
30
|
+
fieldMaxValue: fieldMaxValue
|
|
30
31
|
}));
|
|
31
32
|
return _objectSpread(_objectSpread({}, value), {}, {
|
|
32
33
|
alias: (value || {}).eventName,
|
|
33
34
|
customCondition: customCondition,
|
|
34
35
|
formula: formula,
|
|
35
36
|
operator: operator,
|
|
36
|
-
fieldValue: fieldValue
|
|
37
|
+
fieldValue: fieldValue,
|
|
38
|
+
fieldMaxValue: fieldMaxValue
|
|
37
39
|
});
|
|
38
40
|
});
|
|
39
41
|
};
|
|
@@ -44,6 +46,7 @@ var BizFormulaTarget = function BizFormulaTarget(props) {
|
|
|
44
46
|
formula: (condition || {}).formula,
|
|
45
47
|
operator: (condition || {}).operator,
|
|
46
48
|
fieldValue: (condition || {}).fieldValue,
|
|
49
|
+
fieldMaxValue: (condition || {}).fieldMaxValue,
|
|
47
50
|
onChange: onChange
|
|
48
51
|
}));
|
|
49
52
|
};
|
package/es/select/handle.js
CHANGED
|
@@ -103,7 +103,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
103
103
|
if (props.multiple) {
|
|
104
104
|
return /*#__PURE__*/React.createElement("div", {
|
|
105
105
|
ref: handleRef,
|
|
106
|
-
className: "".concat(classPrefix, "-input ").concat(classPrefix, "-input-multiple\n ").concat(props.theme ? props.theme : '', " ").concat(props.disable ? 'disable' : '', "
|
|
106
|
+
className: "".concat(classPrefix, "-input ").concat(classPrefix, "-input-multiple\n ").concat(props.theme ? props.theme : '', " ").concat(props.disable ? 'disable' : '', "\n ").concat(mergedStatus ? "".concat(classPrefix, "-status-").concat(mergedStatus) : '', "\n ").concat(focus ? 'active' : '', " ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : '')
|
|
107
107
|
}, /*#__PURE__*/React.createElement("div", {
|
|
108
108
|
className: "".concat(classPrefix, "-multiple-content")
|
|
109
109
|
}, props.value && props.value.length > 0 ? props.value.map(function (item, index) {
|
|
@@ -146,7 +146,7 @@ var SelectHandle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
146
146
|
var optionData = props.value && props.value;
|
|
147
147
|
return /*#__PURE__*/React.createElement("div", {
|
|
148
148
|
ref: handleRef,
|
|
149
|
-
className: "".concat(classPrefix, "-input ").concat(props.theme ? props.theme : '', "\n ").concat(props.disable ? 'disable' : '', " ").concat(focus ? 'active' : '', "
|
|
149
|
+
className: "".concat(classPrefix, "-input ").concat(props.theme ? props.theme : '', "\n ").concat(props.disable ? 'disable' : '', " ").concat(focus ? 'active' : '', "\n ").concat(mergedStatus ? "".concat(classPrefix, "-status-").concat(mergedStatus) : '', "\n ").concat(border ? '' : 'borderless', " ").concat(props.size ? props.size : 'middle'),
|
|
150
150
|
title: "".concat(props.label || (optionData === null || optionData === void 0 ? void 0 : optionData[aliasField || '']) || (optionData === null || optionData === void 0 ? void 0 : optionData[labelField]) || '').concat(extraLabel)
|
|
151
151
|
}, /*#__PURE__*/React.createElement("span", {
|
|
152
152
|
className: "".concat(classPrefix, "-content")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/business-lib",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.33",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react": "^16.12.0 || ^17.0.0",
|
|
56
56
|
"yorkie": "^2.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "729268b7d3dd7d2ff8573d9a6f5c764b70e010f6",
|
|
59
59
|
"gitHooks": {
|
|
60
60
|
"pre-commit": "lint-staged"
|
|
61
61
|
}
|