@bit-sun/business-component 3.0.0-alpha.32 → 3.0.0-alpha.34
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/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import _, { isNil, escapeRegExp, omit, debounce, cloneDeep as cloneDeep$1, throt
|
|
|
6
6
|
import React$1, { useState, useEffect, forwardRef, useImperativeHandle, useRef, useMemo, Component, useLayoutEffect, createRef } from 'react';
|
|
7
7
|
import moment$1 from 'moment';
|
|
8
8
|
import { request as request$2, Table as Table$1, QueryTable, Form as Form$1 } from 'bssula';
|
|
9
|
-
import { EyeOutlined, DeleteOutlined, EditOutlined, CopyOutlined, CloseSquareOutlined, WarningOutlined, SendOutlined, ProfileTwoTone, ExclamationCircleOutlined, DownOutlined, UnorderedListOutlined, SearchOutlined, CaretLeftOutlined, CloseCircleOutlined, ArrowLeftOutlined, FolderOutlined, EllipsisOutlined, CaretDownOutlined, HomeOutlined, DoubleLeftOutlined, DoubleRightOutlined, MenuUnfoldOutlined, DashOutlined, SettingOutlined, BulbOutlined, PlayCircleOutlined, SaveOutlined, FullscreenExitOutlined, MinusCircleOutlined
|
|
9
|
+
import { EyeOutlined, DeleteOutlined, EditOutlined, CopyOutlined, CloseSquareOutlined, WarningOutlined, SendOutlined, ProfileTwoTone, ExclamationCircleOutlined, DownOutlined, UnorderedListOutlined, SearchOutlined, CaretLeftOutlined, CloseCircleOutlined, ArrowLeftOutlined, FolderOutlined, EllipsisOutlined, CaretDownOutlined, HomeOutlined, DoubleLeftOutlined, DoubleRightOutlined, MenuUnfoldOutlined, DashOutlined, SettingOutlined, BulbOutlined, PlayCircleOutlined, SaveOutlined, FullscreenExitOutlined, MinusCircleOutlined, PlusCircleOutlined } from '@ant-design/icons';
|
|
10
10
|
import { formatMessage, history, useLocation, Link, useModel, setLocale, useIntl } from 'umi';
|
|
11
11
|
import isEqual from 'lodash/isEqual';
|
|
12
12
|
import 'qs';
|
|
@@ -28821,8 +28821,8 @@ var findChangedThresholdQuery = function findChangedThresholdQuery(oldVal, newVa
|
|
|
28821
28821
|
var isObj = function isObj(object) {
|
|
28822
28822
|
return object && _typeof(object) == 'object' && Object.prototype.toString.call(object).toLowerCase() == '[object object]';
|
|
28823
28823
|
};
|
|
28824
|
-
var dateFormat
|
|
28825
|
-
var fullDateFormat
|
|
28824
|
+
var dateFormat = 'YYYY-MM-DD';
|
|
28825
|
+
var fullDateFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
28826
28826
|
|
|
28827
28827
|
var RangePicker = DatePicker.RangePicker;
|
|
28828
28828
|
var RuleField = /*#__PURE__*/function (_Component) {
|
|
@@ -31070,7 +31070,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
|
|
|
31070
31070
|
style: {
|
|
31071
31071
|
width: customerWidth || '300px'
|
|
31072
31072
|
},
|
|
31073
|
-
format: dataTypeCode == 41 ? dateFormat
|
|
31073
|
+
format: dataTypeCode == 41 ? dateFormat : fullDateFormat,
|
|
31074
31074
|
value: [values[0] ? moment$1(values[0]) : '', values[1] ? moment$1(values[1]) : ''],
|
|
31075
31075
|
onChange: function onChange(dates, dateStrings) {
|
|
31076
31076
|
// 业务产品要求时间范围取值固定00:00:00-23:59:59,有问题请找产品业务
|
|
@@ -31090,7 +31090,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
|
|
|
31090
31090
|
} else {
|
|
31091
31091
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(DatePicker, {
|
|
31092
31092
|
showTime: dataTypeCode == 32,
|
|
31093
|
-
format: dataTypeCode == 41 ? dateFormat
|
|
31093
|
+
format: dataTypeCode == 41 ? dateFormat : fullDateFormat,
|
|
31094
31094
|
disabled: disabled,
|
|
31095
31095
|
style: {
|
|
31096
31096
|
width: customerWidth || '300px'
|
|
@@ -31694,7 +31694,7 @@ var RuleField$1 = /*#__PURE__*/function (_Component) {
|
|
|
31694
31694
|
}
|
|
31695
31695
|
})), /*#__PURE__*/React$1.createElement(Tooltip, {
|
|
31696
31696
|
title: '移除执行动作'
|
|
31697
|
-
}, /*#__PURE__*/React$1.createElement(MinusCircleOutlined
|
|
31697
|
+
}, /*#__PURE__*/React$1.createElement(MinusCircleOutlined, {
|
|
31698
31698
|
onClick: function onClick() {
|
|
31699
31699
|
return handleOperatingAction(i.code, 'delete');
|
|
31700
31700
|
}
|
|
@@ -31704,7 +31704,54 @@ var RuleField$1 = /*#__PURE__*/function (_Component) {
|
|
|
31704
31704
|
}]);
|
|
31705
31705
|
}(Component);
|
|
31706
31706
|
|
|
31707
|
-
var
|
|
31707
|
+
var InnerSelect = (function (props) {
|
|
31708
|
+
var disabled = props.disabled,
|
|
31709
|
+
inputType = props.inputType,
|
|
31710
|
+
defaultValue = props.defaultValue,
|
|
31711
|
+
styleCommon = props.styleCommon,
|
|
31712
|
+
value = props.value,
|
|
31713
|
+
_onChange = props.onChange,
|
|
31714
|
+
dictionaryCode = props.dictionaryCode;
|
|
31715
|
+
var _useState = useState(getDictionarySource(dictionaryCode !== null && dictionaryCode !== void 0 ? dictionaryCode : '') || []),
|
|
31716
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31717
|
+
dataSource = _useState2[0],
|
|
31718
|
+
setDataSource = _useState2[1];
|
|
31719
|
+
useEffect(function () {
|
|
31720
|
+
if (!!dictionaryCode && !getDictionarySource(dictionaryCode)) {
|
|
31721
|
+
request$2({
|
|
31722
|
+
url: "/basic/bscDictItem/allItemList?qp-code-eq=".concat(dictionaryCode),
|
|
31723
|
+
method: 'get',
|
|
31724
|
+
converter: function converter(_ref) {
|
|
31725
|
+
var _data$map;
|
|
31726
|
+
var data = _ref.data;
|
|
31727
|
+
var dataList = (data === null || data === void 0 ? void 0 : (_data$map = data.map) === null || _data$map === void 0 ? void 0 : _data$map.call(data, function (item) {
|
|
31728
|
+
return {
|
|
31729
|
+
label: item.dictItemName,
|
|
31730
|
+
value: item.dictItemCode
|
|
31731
|
+
};
|
|
31732
|
+
})) || [];
|
|
31733
|
+
setDataSource(dataList);
|
|
31734
|
+
return dataList;
|
|
31735
|
+
}
|
|
31736
|
+
});
|
|
31737
|
+
}
|
|
31738
|
+
}, [dictionaryCode]);
|
|
31739
|
+
return /*#__PURE__*/React$1.createElement(Select, _objectSpread2(_objectSpread2({
|
|
31740
|
+
disabled: disabled
|
|
31741
|
+
}, inputType === 30 ? {
|
|
31742
|
+
mode: 'multiple'
|
|
31743
|
+
} : {}), {}, {
|
|
31744
|
+
defaultValue: defaultValue,
|
|
31745
|
+
style: styleCommon,
|
|
31746
|
+
value: value === null || value === void 0 ? void 0 : value.split(','),
|
|
31747
|
+
onChange: function onChange(changeValue) {
|
|
31748
|
+
_onChange(changeValue);
|
|
31749
|
+
// handleEdit(ites.code, value);
|
|
31750
|
+
},
|
|
31751
|
+
options: dataSource
|
|
31752
|
+
}));
|
|
31753
|
+
});
|
|
31754
|
+
|
|
31708
31755
|
var RangePicker$1 = DatePicker.RangePicker;
|
|
31709
31756
|
function RenderCompItem(props) {
|
|
31710
31757
|
var regularDataList = props.regularDataList,
|
|
@@ -31785,7 +31832,7 @@ function RenderCompItem(props) {
|
|
|
31785
31832
|
disabled: disabled,
|
|
31786
31833
|
allowClear: true,
|
|
31787
31834
|
onClear: function onClear() {
|
|
31788
|
-
handleEdit(ites.code, undefined);
|
|
31835
|
+
return handleEdit(ites.code, undefined);
|
|
31789
31836
|
},
|
|
31790
31837
|
defaultValue: showValue(ites.code, 'input'),
|
|
31791
31838
|
style: styleCommon,
|
|
@@ -32004,6 +32051,7 @@ function RenderCompItem(props) {
|
|
|
32004
32051
|
method: 'get',
|
|
32005
32052
|
converter: function converter(_ref2) {
|
|
32006
32053
|
var data = _ref2.data;
|
|
32054
|
+
// FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
|
|
32007
32055
|
var handleData = data && data[0] ? data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
32008
32056
|
return {
|
|
32009
32057
|
text: item.name,
|
|
@@ -32233,6 +32281,7 @@ function RenderCompItem(props) {
|
|
|
32233
32281
|
}, /*#__PURE__*/React$1.createElement(App$1, {
|
|
32234
32282
|
disabled: disabled,
|
|
32235
32283
|
key: showValue(ites.code),
|
|
32284
|
+
// FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
|
|
32236
32285
|
setValue: function setValue(val, formulaName) {
|
|
32237
32286
|
console.log(val, 'val');
|
|
32238
32287
|
var value = val.map(function (item) {
|
|
@@ -32252,90 +32301,6 @@ function RenderCompItem(props) {
|
|
|
32252
32301
|
sourceData: fieldListGroup
|
|
32253
32302
|
}))));
|
|
32254
32303
|
}
|
|
32255
|
-
renderFormCompItem = function renderFormCompItem(config, showValue, handleEdit, parentItem, boxStyle, disabled) {
|
|
32256
|
-
if (!config) return;
|
|
32257
|
-
return /*#__PURE__*/React$1.createElement("div", {
|
|
32258
|
-
style: boxStyle
|
|
32259
|
-
}, (config === null || config === void 0 ? void 0 : config.leftText) && ( /*#__PURE__*/React$1.createElement("div", {
|
|
32260
|
-
style: {
|
|
32261
|
-
flex: 'none',
|
|
32262
|
-
marginRight: 10
|
|
32263
|
-
}
|
|
32264
|
-
}, (config === null || config === void 0 ? void 0 : config.required) && /*#__PURE__*/React$1.createElement("span", {
|
|
32265
|
-
className: "requiredMark"
|
|
32266
|
-
}), config.leftText)) || null, !(config === null || config === void 0 ? void 0 : config.leftText) && (config === null || config === void 0 ? void 0 : config.rightText) && (config === null || config === void 0 ? void 0 : config.required) && ( /*#__PURE__*/React$1.createElement("div", {
|
|
32267
|
-
style: {
|
|
32268
|
-
flex: 'none',
|
|
32269
|
-
marginRight: 10
|
|
32270
|
-
}
|
|
32271
|
-
}, /*#__PURE__*/React$1.createElement("span", {
|
|
32272
|
-
className: "requiredMark"
|
|
32273
|
-
}))) || null, _this$1.renderCompItem(config, function (a, b) {
|
|
32274
|
-
var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : parentItem;
|
|
32275
|
-
var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : config;
|
|
32276
|
-
return showValue(a, b, c, d);
|
|
32277
|
-
}, function (a, b) {
|
|
32278
|
-
var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : parentItem;
|
|
32279
|
-
var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : config;
|
|
32280
|
-
return handleEdit(a, b, c, d);
|
|
32281
|
-
}, disabled), (config === null || config === void 0 ? void 0 : config.rightText) && ( /*#__PURE__*/React$1.createElement("div", {
|
|
32282
|
-
style: {
|
|
32283
|
-
flex: 'none',
|
|
32284
|
-
marginLeft: 10
|
|
32285
|
-
}
|
|
32286
|
-
}, config.rightText)) || null);
|
|
32287
|
-
};
|
|
32288
|
-
renderActionList = function renderActionList(itemDetail, parentDetail, handleRuleTypeData, sRuleActionData, classDataIndex, disabled, boxStyle) {
|
|
32289
|
-
var showValue = function showValue(code, type, functionItem, configItem) {
|
|
32290
|
-
var functionIndex = handleRuleTypeData.findIndex(function (m) {
|
|
32291
|
-
return m.code === functionItem.code;
|
|
32292
|
-
});
|
|
32293
|
-
var pCode = itemDetail.execute[functionIndex] && itemDetail.execute[functionIndex].properties[code];
|
|
32294
|
-
var defaultValue = configItem.defaultValue;
|
|
32295
|
-
if (type === 'input') {
|
|
32296
|
-
return pCode === undefined ? pCode : pCode || defaultValue;
|
|
32297
|
-
}
|
|
32298
|
-
return pCode || defaultValue;
|
|
32299
|
-
};
|
|
32300
|
-
var handleEdit = function handleEdit(code, val, functionItem) {
|
|
32301
|
-
var functionIndex = handleRuleTypeData.findIndex(function (m) {
|
|
32302
|
-
return m.code === functionItem.code;
|
|
32303
|
-
});
|
|
32304
|
-
var ruleClassData = _this$1.state.ruleClassData;
|
|
32305
|
-
var callBack = _this$1.props.callBack;
|
|
32306
|
-
parentDetail.extraInfo.execute[functionIndex]['properties'][code] = val;
|
|
32307
|
-
parentDetail.extraInfo.execute[functionIndex]['code'] = functionItem.code;
|
|
32308
|
-
_this$1.setState({
|
|
32309
|
-
ruleClassData: ruleClassData
|
|
32310
|
-
}, function () {
|
|
32311
|
-
callBack(ruleClassData);
|
|
32312
|
-
});
|
|
32313
|
-
};
|
|
32314
|
-
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, sRuleActionData.map(function (i, index) {
|
|
32315
|
-
var _i$valueList;
|
|
32316
|
-
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("div", {
|
|
32317
|
-
style: {
|
|
32318
|
-
display: 'flex'
|
|
32319
|
-
}
|
|
32320
|
-
}, ((_i$valueList = i.valueList) === null || _i$valueList === void 0 ? void 0 : _i$valueList.length) && i.valueList.map(function (s) {
|
|
32321
|
-
return _this$1.renderFormCompItem(s, showValue, handleEdit, i, boxStyle, disabled);
|
|
32322
|
-
}) || ( /*#__PURE__*/React$1.createElement("div", {
|
|
32323
|
-
style: boxStyle,
|
|
32324
|
-
key: i.functionName
|
|
32325
|
-
}, /*#__PURE__*/React$1.createElement("div", null, i.functionName))), /*#__PURE__*/React$1.createElement(MinusCircleOutlined, {
|
|
32326
|
-
className: 'icon_btn_style',
|
|
32327
|
-
onClick: function onClick() {
|
|
32328
|
-
_this$1.handleDeleteRuleAction(classDataIndex, i.code);
|
|
32329
|
-
},
|
|
32330
|
-
style: {
|
|
32331
|
-
color: 'gray',
|
|
32332
|
-
marginLeft: '15px',
|
|
32333
|
-
marginTop: '15px',
|
|
32334
|
-
display: disabled ? 'none' : 'inline-block'
|
|
32335
|
-
}
|
|
32336
|
-
})));
|
|
32337
|
-
}));
|
|
32338
|
-
};
|
|
32339
32304
|
|
|
32340
32305
|
var RangePicker$2 = DatePicker.RangePicker;
|
|
32341
32306
|
var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
@@ -32664,7 +32629,8 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32664
32629
|
var ruleClassData = _this.state.ruleClassData;
|
|
32665
32630
|
var _this$props2 = _this.props,
|
|
32666
32631
|
callBack = _this$props2.callBack,
|
|
32667
|
-
|
|
32632
|
+
_this$props2$ruleType = _this$props2.ruleTypeData,
|
|
32633
|
+
ruleTypeData = _this$props2$ruleType === void 0 ? [] : _this$props2$ruleType,
|
|
32668
32634
|
ruleGroupInfo = _this$props2.ruleGroupInfo;
|
|
32669
32635
|
var isRuleInstance = (ruleGroupInfo === null || ruleGroupInfo === void 0 ? void 0 : (_ruleGroupInfo$type2 = ruleGroupInfo.type) === null || _ruleGroupInfo$type2 === void 0 ? void 0 : _ruleGroupInfo$type2.indexOf('instance')) > -1;
|
|
32670
32636
|
var initKongData = {
|
|
@@ -32681,7 +32647,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32681
32647
|
enable: false,
|
|
32682
32648
|
value: ''
|
|
32683
32649
|
},
|
|
32684
|
-
execute: ruleTypeData.map(function (s) {
|
|
32650
|
+
execute: (ruleTypeData === null || ruleTypeData === void 0 ? void 0 : ruleTypeData.map(function (s) {
|
|
32685
32651
|
return {
|
|
32686
32652
|
priority: 1,
|
|
32687
32653
|
code: s.code,
|
|
@@ -32689,7 +32655,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32689
32655
|
configPropertyCode: 'configPropertyValue'
|
|
32690
32656
|
}
|
|
32691
32657
|
};
|
|
32692
|
-
})
|
|
32658
|
+
})) || []
|
|
32693
32659
|
}
|
|
32694
32660
|
};
|
|
32695
32661
|
var initTemplateData = (ruleGroupInfo === null || ruleGroupInfo === void 0 ? void 0 : ruleGroupInfo.templateData) && ((_Object$keys2 = Object.keys(ruleGroupInfo === null || ruleGroupInfo === void 0 ? void 0 : ruleGroupInfo.templateData)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length) ? _objectSpread2({
|
|
@@ -32902,7 +32868,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32902
32868
|
marginLeft: '15px',
|
|
32903
32869
|
display: floorIndex > 4 || disabled ? 'none' : 'inline-block'
|
|
32904
32870
|
}
|
|
32905
|
-
}), /*#__PURE__*/React$1.createElement(MinusCircleOutlined
|
|
32871
|
+
}), /*#__PURE__*/React$1.createElement(MinusCircleOutlined, {
|
|
32906
32872
|
className: 'icon_btn_style',
|
|
32907
32873
|
onClick: function onClick() {
|
|
32908
32874
|
_this.handleDeleteRule(itemDetail, parentDetail, classDataIndex);
|
|
@@ -33002,7 +32968,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
33002
32968
|
style: {
|
|
33003
32969
|
display: 'flex'
|
|
33004
32970
|
}
|
|
33005
|
-
}, _this.renderFormCompItem(ruleReturnConfig, showValue, handleEdit, {}, boxStyle, disabled), /*#__PURE__*/React$1.createElement(MinusCircleOutlined
|
|
32971
|
+
}, _this.renderFormCompItem(ruleReturnConfig, showValue, handleEdit, {}, boxStyle, disabled), /*#__PURE__*/React$1.createElement(MinusCircleOutlined, {
|
|
33006
32972
|
className: 'icon_btn_style',
|
|
33007
32973
|
onClick: function onClick() {
|
|
33008
32974
|
_this.handleEditExtraInfoResponse('enable', false, parentDetail, classDataIndex);
|
|
@@ -33091,7 +33057,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
33091
33057
|
}) || /*#__PURE__*/React$1.createElement("div", {
|
|
33092
33058
|
style: boxStyle,
|
|
33093
33059
|
key: i.functionName
|
|
33094
|
-
}, /*#__PURE__*/React$1.createElement("div", null, i.functionName)), /*#__PURE__*/React$1.createElement(MinusCircleOutlined
|
|
33060
|
+
}, /*#__PURE__*/React$1.createElement("div", null, i.functionName)), /*#__PURE__*/React$1.createElement(MinusCircleOutlined, {
|
|
33095
33061
|
className: 'icon_btn_style',
|
|
33096
33062
|
onClick: function onClick() {
|
|
33097
33063
|
_this.handleDeleteRuleAction(classDataIndex, i.code);
|
package/dist/index.js
CHANGED
|
@@ -28843,8 +28843,8 @@ var findChangedThresholdQuery = function findChangedThresholdQuery(oldVal, newVa
|
|
|
28843
28843
|
var isObj = function isObj(object) {
|
|
28844
28844
|
return object && _typeof(object) == 'object' && Object.prototype.toString.call(object).toLowerCase() == '[object object]';
|
|
28845
28845
|
};
|
|
28846
|
-
var dateFormat
|
|
28847
|
-
var fullDateFormat
|
|
28846
|
+
var dateFormat = 'YYYY-MM-DD';
|
|
28847
|
+
var fullDateFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
28848
28848
|
|
|
28849
28849
|
var RangePicker = antd.DatePicker.RangePicker;
|
|
28850
28850
|
var RuleField = /*#__PURE__*/function (_Component) {
|
|
@@ -31092,7 +31092,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
|
|
|
31092
31092
|
style: {
|
|
31093
31093
|
width: customerWidth || '300px'
|
|
31094
31094
|
},
|
|
31095
|
-
format: dataTypeCode == 41 ? dateFormat
|
|
31095
|
+
format: dataTypeCode == 41 ? dateFormat : fullDateFormat,
|
|
31096
31096
|
value: [values[0] ? moment__default['default'](values[0]) : '', values[1] ? moment__default['default'](values[1]) : ''],
|
|
31097
31097
|
onChange: function onChange(dates, dateStrings) {
|
|
31098
31098
|
// 业务产品要求时间范围取值固定00:00:00-23:59:59,有问题请找产品业务
|
|
@@ -31112,7 +31112,7 @@ var RuleField = /*#__PURE__*/function (_Component) {
|
|
|
31112
31112
|
} else {
|
|
31113
31113
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.DatePicker, {
|
|
31114
31114
|
showTime: dataTypeCode == 32,
|
|
31115
|
-
format: dataTypeCode == 41 ? dateFormat
|
|
31115
|
+
format: dataTypeCode == 41 ? dateFormat : fullDateFormat,
|
|
31116
31116
|
disabled: disabled,
|
|
31117
31117
|
style: {
|
|
31118
31118
|
width: customerWidth || '300px'
|
|
@@ -31726,7 +31726,54 @@ var RuleField$1 = /*#__PURE__*/function (_Component) {
|
|
|
31726
31726
|
}]);
|
|
31727
31727
|
}(React$1.Component);
|
|
31728
31728
|
|
|
31729
|
-
var
|
|
31729
|
+
var InnerSelect = (function (props) {
|
|
31730
|
+
var disabled = props.disabled,
|
|
31731
|
+
inputType = props.inputType,
|
|
31732
|
+
defaultValue = props.defaultValue,
|
|
31733
|
+
styleCommon = props.styleCommon,
|
|
31734
|
+
value = props.value,
|
|
31735
|
+
_onChange = props.onChange,
|
|
31736
|
+
dictionaryCode = props.dictionaryCode;
|
|
31737
|
+
var _useState = React$1.useState(getDictionarySource(dictionaryCode !== null && dictionaryCode !== void 0 ? dictionaryCode : '') || []),
|
|
31738
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31739
|
+
dataSource = _useState2[0],
|
|
31740
|
+
setDataSource = _useState2[1];
|
|
31741
|
+
React$1.useEffect(function () {
|
|
31742
|
+
if (!!dictionaryCode && !getDictionarySource(dictionaryCode)) {
|
|
31743
|
+
bssula.request({
|
|
31744
|
+
url: "/basic/bscDictItem/allItemList?qp-code-eq=".concat(dictionaryCode),
|
|
31745
|
+
method: 'get',
|
|
31746
|
+
converter: function converter(_ref) {
|
|
31747
|
+
var _data$map;
|
|
31748
|
+
var data = _ref.data;
|
|
31749
|
+
var dataList = (data === null || data === void 0 ? void 0 : (_data$map = data.map) === null || _data$map === void 0 ? void 0 : _data$map.call(data, function (item) {
|
|
31750
|
+
return {
|
|
31751
|
+
label: item.dictItemName,
|
|
31752
|
+
value: item.dictItemCode
|
|
31753
|
+
};
|
|
31754
|
+
})) || [];
|
|
31755
|
+
setDataSource(dataList);
|
|
31756
|
+
return dataList;
|
|
31757
|
+
}
|
|
31758
|
+
});
|
|
31759
|
+
}
|
|
31760
|
+
}, [dictionaryCode]);
|
|
31761
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({
|
|
31762
|
+
disabled: disabled
|
|
31763
|
+
}, inputType === 30 ? {
|
|
31764
|
+
mode: 'multiple'
|
|
31765
|
+
} : {}), {}, {
|
|
31766
|
+
defaultValue: defaultValue,
|
|
31767
|
+
style: styleCommon,
|
|
31768
|
+
value: value === null || value === void 0 ? void 0 : value.split(','),
|
|
31769
|
+
onChange: function onChange(changeValue) {
|
|
31770
|
+
_onChange(changeValue);
|
|
31771
|
+
// handleEdit(ites.code, value);
|
|
31772
|
+
},
|
|
31773
|
+
options: dataSource
|
|
31774
|
+
}));
|
|
31775
|
+
});
|
|
31776
|
+
|
|
31730
31777
|
var RangePicker$1 = antd.DatePicker.RangePicker;
|
|
31731
31778
|
function RenderCompItem(props) {
|
|
31732
31779
|
var regularDataList = props.regularDataList,
|
|
@@ -31807,7 +31854,7 @@ function RenderCompItem(props) {
|
|
|
31807
31854
|
disabled: disabled,
|
|
31808
31855
|
allowClear: true,
|
|
31809
31856
|
onClear: function onClear() {
|
|
31810
|
-
handleEdit(ites.code, undefined);
|
|
31857
|
+
return handleEdit(ites.code, undefined);
|
|
31811
31858
|
},
|
|
31812
31859
|
defaultValue: showValue(ites.code, 'input'),
|
|
31813
31860
|
style: styleCommon,
|
|
@@ -32026,6 +32073,7 @@ function RenderCompItem(props) {
|
|
|
32026
32073
|
method: 'get',
|
|
32027
32074
|
converter: function converter(_ref2) {
|
|
32028
32075
|
var data = _ref2.data;
|
|
32076
|
+
// FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
|
|
32029
32077
|
var handleData = data && data[0] ? data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
32030
32078
|
return {
|
|
32031
32079
|
text: item.name,
|
|
@@ -32255,6 +32303,7 @@ function RenderCompItem(props) {
|
|
|
32255
32303
|
}, /*#__PURE__*/React__default['default'].createElement(App$1, {
|
|
32256
32304
|
disabled: disabled,
|
|
32257
32305
|
key: showValue(ites.code),
|
|
32306
|
+
// FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
|
|
32258
32307
|
setValue: function setValue(val, formulaName) {
|
|
32259
32308
|
console.log(val, 'val');
|
|
32260
32309
|
var value = val.map(function (item) {
|
|
@@ -32274,90 +32323,6 @@ function RenderCompItem(props) {
|
|
|
32274
32323
|
sourceData: fieldListGroup
|
|
32275
32324
|
}))));
|
|
32276
32325
|
}
|
|
32277
|
-
renderFormCompItem = function renderFormCompItem(config, showValue, handleEdit, parentItem, boxStyle, disabled) {
|
|
32278
|
-
if (!config) return;
|
|
32279
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
32280
|
-
style: boxStyle
|
|
32281
|
-
}, (config === null || config === void 0 ? void 0 : config.leftText) && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
32282
|
-
style: {
|
|
32283
|
-
flex: 'none',
|
|
32284
|
-
marginRight: 10
|
|
32285
|
-
}
|
|
32286
|
-
}, (config === null || config === void 0 ? void 0 : config.required) && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
32287
|
-
className: "requiredMark"
|
|
32288
|
-
}), config.leftText)) || null, !(config === null || config === void 0 ? void 0 : config.leftText) && (config === null || config === void 0 ? void 0 : config.rightText) && (config === null || config === void 0 ? void 0 : config.required) && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
32289
|
-
style: {
|
|
32290
|
-
flex: 'none',
|
|
32291
|
-
marginRight: 10
|
|
32292
|
-
}
|
|
32293
|
-
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
32294
|
-
className: "requiredMark"
|
|
32295
|
-
}))) || null, _this$1.renderCompItem(config, function (a, b) {
|
|
32296
|
-
var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : parentItem;
|
|
32297
|
-
var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : config;
|
|
32298
|
-
return showValue(a, b, c, d);
|
|
32299
|
-
}, function (a, b) {
|
|
32300
|
-
var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : parentItem;
|
|
32301
|
-
var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : config;
|
|
32302
|
-
return handleEdit(a, b, c, d);
|
|
32303
|
-
}, disabled), (config === null || config === void 0 ? void 0 : config.rightText) && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
32304
|
-
style: {
|
|
32305
|
-
flex: 'none',
|
|
32306
|
-
marginLeft: 10
|
|
32307
|
-
}
|
|
32308
|
-
}, config.rightText)) || null);
|
|
32309
|
-
};
|
|
32310
|
-
renderActionList = function renderActionList(itemDetail, parentDetail, handleRuleTypeData, sRuleActionData, classDataIndex, disabled, boxStyle) {
|
|
32311
|
-
var showValue = function showValue(code, type, functionItem, configItem) {
|
|
32312
|
-
var functionIndex = handleRuleTypeData.findIndex(function (m) {
|
|
32313
|
-
return m.code === functionItem.code;
|
|
32314
|
-
});
|
|
32315
|
-
var pCode = itemDetail.execute[functionIndex] && itemDetail.execute[functionIndex].properties[code];
|
|
32316
|
-
var defaultValue = configItem.defaultValue;
|
|
32317
|
-
if (type === 'input') {
|
|
32318
|
-
return pCode === undefined ? pCode : pCode || defaultValue;
|
|
32319
|
-
}
|
|
32320
|
-
return pCode || defaultValue;
|
|
32321
|
-
};
|
|
32322
|
-
var handleEdit = function handleEdit(code, val, functionItem) {
|
|
32323
|
-
var functionIndex = handleRuleTypeData.findIndex(function (m) {
|
|
32324
|
-
return m.code === functionItem.code;
|
|
32325
|
-
});
|
|
32326
|
-
var ruleClassData = _this$1.state.ruleClassData;
|
|
32327
|
-
var callBack = _this$1.props.callBack;
|
|
32328
|
-
parentDetail.extraInfo.execute[functionIndex]['properties'][code] = val;
|
|
32329
|
-
parentDetail.extraInfo.execute[functionIndex]['code'] = functionItem.code;
|
|
32330
|
-
_this$1.setState({
|
|
32331
|
-
ruleClassData: ruleClassData
|
|
32332
|
-
}, function () {
|
|
32333
|
-
callBack(ruleClassData);
|
|
32334
|
-
});
|
|
32335
|
-
};
|
|
32336
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, sRuleActionData.map(function (i, index) {
|
|
32337
|
-
var _i$valueList;
|
|
32338
|
-
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
32339
|
-
style: {
|
|
32340
|
-
display: 'flex'
|
|
32341
|
-
}
|
|
32342
|
-
}, ((_i$valueList = i.valueList) === null || _i$valueList === void 0 ? void 0 : _i$valueList.length) && i.valueList.map(function (s) {
|
|
32343
|
-
return _this$1.renderFormCompItem(s, showValue, handleEdit, i, boxStyle, disabled);
|
|
32344
|
-
}) || ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
32345
|
-
style: boxStyle,
|
|
32346
|
-
key: i.functionName
|
|
32347
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", null, i.functionName))), /*#__PURE__*/React__default['default'].createElement(MinusCircleOutlined, {
|
|
32348
|
-
className: 'icon_btn_style',
|
|
32349
|
-
onClick: function onClick() {
|
|
32350
|
-
_this$1.handleDeleteRuleAction(classDataIndex, i.code);
|
|
32351
|
-
},
|
|
32352
|
-
style: {
|
|
32353
|
-
color: 'gray',
|
|
32354
|
-
marginLeft: '15px',
|
|
32355
|
-
marginTop: '15px',
|
|
32356
|
-
display: disabled ? 'none' : 'inline-block'
|
|
32357
|
-
}
|
|
32358
|
-
})));
|
|
32359
|
-
}));
|
|
32360
|
-
};
|
|
32361
32326
|
|
|
32362
32327
|
var RangePicker$2 = antd.DatePicker.RangePicker;
|
|
32363
32328
|
var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
@@ -32686,7 +32651,8 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32686
32651
|
var ruleClassData = _this.state.ruleClassData;
|
|
32687
32652
|
var _this$props2 = _this.props,
|
|
32688
32653
|
callBack = _this$props2.callBack,
|
|
32689
|
-
|
|
32654
|
+
_this$props2$ruleType = _this$props2.ruleTypeData,
|
|
32655
|
+
ruleTypeData = _this$props2$ruleType === void 0 ? [] : _this$props2$ruleType,
|
|
32690
32656
|
ruleGroupInfo = _this$props2.ruleGroupInfo;
|
|
32691
32657
|
var isRuleInstance = (ruleGroupInfo === null || ruleGroupInfo === void 0 ? void 0 : (_ruleGroupInfo$type2 = ruleGroupInfo.type) === null || _ruleGroupInfo$type2 === void 0 ? void 0 : _ruleGroupInfo$type2.indexOf('instance')) > -1;
|
|
32692
32658
|
var initKongData = {
|
|
@@ -32703,7 +32669,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32703
32669
|
enable: false,
|
|
32704
32670
|
value: ''
|
|
32705
32671
|
},
|
|
32706
|
-
execute: ruleTypeData.map(function (s) {
|
|
32672
|
+
execute: (ruleTypeData === null || ruleTypeData === void 0 ? void 0 : ruleTypeData.map(function (s) {
|
|
32707
32673
|
return {
|
|
32708
32674
|
priority: 1,
|
|
32709
32675
|
code: s.code,
|
|
@@ -32711,7 +32677,7 @@ var RuleObjectComponent = /*#__PURE__*/function (_Component) {
|
|
|
32711
32677
|
configPropertyCode: 'configPropertyValue'
|
|
32712
32678
|
}
|
|
32713
32679
|
};
|
|
32714
|
-
})
|
|
32680
|
+
})) || []
|
|
32715
32681
|
}
|
|
32716
32682
|
};
|
|
32717
32683
|
var initTemplateData = (ruleGroupInfo === null || ruleGroupInfo === void 0 ? void 0 : ruleGroupInfo.templateData) && ((_Object$keys2 = Object.keys(ruleGroupInfo === null || ruleGroupInfo === void 0 ? void 0 : ruleGroupInfo.templateData)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.length) ? _objectSpread2({
|
package/package.json
CHANGED
|
@@ -7,6 +7,11 @@ import { Input, InputNumber, DatePicker, Switch, Select } from 'antd';
|
|
|
7
7
|
import React, { useEffect, useState } from 'react'
|
|
8
8
|
import { request } from 'bssula';
|
|
9
9
|
import Formula from './Formula';
|
|
10
|
+
import {
|
|
11
|
+
dateFormat,
|
|
12
|
+
fullDateFormat
|
|
13
|
+
} from './util';
|
|
14
|
+
import InnerSelect from './InnerSelect';
|
|
10
15
|
const { RangePicker } = DatePicker;
|
|
11
16
|
export default function RenderCompItem(props:any){
|
|
12
17
|
const { regularDataList,ites, showValue, handleEdit,disabled } = props;
|
|
@@ -56,9 +61,7 @@ export default function RenderCompItem(props:any){
|
|
|
56
61
|
<Input
|
|
57
62
|
disabled={disabled}
|
|
58
63
|
allowClear={true}
|
|
59
|
-
onClear={() =>
|
|
60
|
-
handleEdit(ites.code, undefined);
|
|
61
|
-
}}
|
|
64
|
+
onClear={() => handleEdit(ites.code, undefined)}
|
|
62
65
|
defaultValue={showValue(ites.code, 'input')}
|
|
63
66
|
style={styleCommon}
|
|
64
67
|
onBlur={(e) => {
|
|
@@ -71,7 +74,7 @@ export default function RenderCompItem(props:any){
|
|
|
71
74
|
}}
|
|
72
75
|
/>
|
|
73
76
|
)) ||
|
|
74
|
-
|
|
77
|
+
null}
|
|
75
78
|
{/* 输入 / 长整数23/小数22 */}
|
|
76
79
|
{(ites?.inputType === 10 &&
|
|
77
80
|
(ites?.valueType === 23 || ites?.valueType === 22) && (
|
|
@@ -88,7 +91,7 @@ export default function RenderCompItem(props:any){
|
|
|
88
91
|
}}
|
|
89
92
|
/>
|
|
90
93
|
)) ||
|
|
91
|
-
|
|
94
|
+
null}
|
|
92
95
|
{/* 输入/日期 */}
|
|
93
96
|
{(ites?.inputType === 10 && (ites?.valueType === 41 || ites?.valueType === 32) && (
|
|
94
97
|
<DatePicker
|
|
@@ -103,7 +106,7 @@ export default function RenderCompItem(props:any){
|
|
|
103
106
|
}}
|
|
104
107
|
/>
|
|
105
108
|
)) ||
|
|
106
|
-
|
|
109
|
+
null}
|
|
107
110
|
{/* 输入/时间 */}
|
|
108
111
|
{(ites?.inputType === 10 && ites?.valueType === 40 && (
|
|
109
112
|
<RangePicker
|
|
@@ -117,7 +120,7 @@ export default function RenderCompItem(props:any){
|
|
|
117
120
|
}}
|
|
118
121
|
/>
|
|
119
122
|
)) ||
|
|
120
|
-
|
|
123
|
+
null}
|
|
121
124
|
{/* 输入/布尔值 */}
|
|
122
125
|
{(ites?.inputType === 10 && ites?.valueType === 24 && (
|
|
123
126
|
<Switch
|
|
@@ -130,7 +133,7 @@ export default function RenderCompItem(props:any){
|
|
|
130
133
|
}}
|
|
131
134
|
/>
|
|
132
135
|
)) ||
|
|
133
|
-
|
|
136
|
+
null}
|
|
134
137
|
{/* 单选/多选 自定义 */}
|
|
135
138
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
136
139
|
ites?.choiceType === 10 && (
|
|
@@ -140,12 +143,12 @@ export default function RenderCompItem(props:any){
|
|
|
140
143
|
showArrow
|
|
141
144
|
{...(ites?.inputType === 30
|
|
142
145
|
? {
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
mode: 'multiple',
|
|
147
|
+
}
|
|
145
148
|
: {})}
|
|
146
149
|
defaultValue={ites.defaultValue}
|
|
147
150
|
style={styleCommon}
|
|
148
|
-
value={showValue(ites.code)}
|
|
151
|
+
value={showValue(ites.code) as string}
|
|
149
152
|
onChange={(value) => {
|
|
150
153
|
handleEdit(ites.code, value);
|
|
151
154
|
}}
|
|
@@ -157,7 +160,7 @@ export default function RenderCompItem(props:any){
|
|
|
157
160
|
))}
|
|
158
161
|
</Select>
|
|
159
162
|
)) ||
|
|
160
|
-
|
|
163
|
+
null}
|
|
161
164
|
{/* 单选/多选 数据字典 */}
|
|
162
165
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
163
166
|
ites?.choiceType === 20 && (
|
|
@@ -173,7 +176,7 @@ export default function RenderCompItem(props:any){
|
|
|
173
176
|
dictionaryCode={ites.dictionaryCode}
|
|
174
177
|
/>
|
|
175
178
|
)) ||
|
|
176
|
-
|
|
179
|
+
null}
|
|
177
180
|
{/* 单选/多选 仓库选择器(物理仓) */}
|
|
178
181
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
179
182
|
ites?.choiceType === 110 && (
|
|
@@ -184,9 +187,9 @@ export default function RenderCompItem(props:any){
|
|
|
184
187
|
placeholder: '请选择物理仓',
|
|
185
188
|
...(ites?.inputType === 30
|
|
186
189
|
? {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
mode: 'multiple',
|
|
191
|
+
maxTagCount: 1,
|
|
192
|
+
}
|
|
190
193
|
: {}),
|
|
191
194
|
}}
|
|
192
195
|
disabled={disabled}
|
|
@@ -196,13 +199,13 @@ export default function RenderCompItem(props:any){
|
|
|
196
199
|
mappingValueField: 'physicalWarehouseCode',
|
|
197
200
|
filterInit: 'qp-physicalWarehouseCode-in',
|
|
198
201
|
}}
|
|
199
|
-
onChange={(value) => {
|
|
202
|
+
onChange={(value: any) => {
|
|
200
203
|
handleEdit(ites.code, value);
|
|
201
204
|
}}
|
|
202
205
|
getPopupContainer={() => document.body}
|
|
203
206
|
/>
|
|
204
207
|
)) ||
|
|
205
|
-
|
|
208
|
+
null}
|
|
206
209
|
{/* 单选/多选 仓库选择器(逻辑仓) */}
|
|
207
210
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
208
211
|
ites?.choiceType === 120 && (
|
|
@@ -213,9 +216,9 @@ export default function RenderCompItem(props:any){
|
|
|
213
216
|
placeholder: '请选择逻辑仓',
|
|
214
217
|
...(ites?.inputType === 30
|
|
215
218
|
? {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
+
mode: 'multiple',
|
|
220
|
+
maxTagCount: 1,
|
|
221
|
+
}
|
|
219
222
|
: {}),
|
|
220
223
|
}}
|
|
221
224
|
disabled={disabled}
|
|
@@ -231,7 +234,7 @@ export default function RenderCompItem(props:any){
|
|
|
231
234
|
getPopupContainer={() => document.body}
|
|
232
235
|
/>
|
|
233
236
|
)) ||
|
|
234
|
-
|
|
237
|
+
null}
|
|
235
238
|
{/* 单选/多选 仓库选择器(虚拟仓) */}
|
|
236
239
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
237
240
|
ites?.choiceType === 130 && (
|
|
@@ -242,9 +245,9 @@ export default function RenderCompItem(props:any){
|
|
|
242
245
|
placeholder: '请选择虚拟仓',
|
|
243
246
|
...(ites?.inputType === 30
|
|
244
247
|
? {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
mode: 'multiple',
|
|
249
|
+
maxTagCount: 1,
|
|
250
|
+
}
|
|
248
251
|
: {}),
|
|
249
252
|
}}
|
|
250
253
|
disabled={disabled}
|
|
@@ -260,7 +263,7 @@ export default function RenderCompItem(props:any){
|
|
|
260
263
|
getPopupContainer={() => document.body}
|
|
261
264
|
/>
|
|
262
265
|
)) ||
|
|
263
|
-
|
|
266
|
+
null}
|
|
264
267
|
{/* 单选/多选 仓库选择器(渠道仓) */}
|
|
265
268
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
266
269
|
ites?.choiceType === 140 && (
|
|
@@ -271,9 +274,9 @@ export default function RenderCompItem(props:any){
|
|
|
271
274
|
placeholder: '请选择渠道仓',
|
|
272
275
|
...(ites?.inputType === 30
|
|
273
276
|
? {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
mode: 'multiple',
|
|
278
|
+
maxTagCount: 1,
|
|
279
|
+
}
|
|
277
280
|
: {}),
|
|
278
281
|
}}
|
|
279
282
|
disabled={disabled}
|
|
@@ -283,13 +286,13 @@ export default function RenderCompItem(props:any){
|
|
|
283
286
|
mappingValueField: 'channelWarehouseCode',
|
|
284
287
|
filterInit: 'qp-channelWarehouseCode-in',
|
|
285
288
|
}}
|
|
286
|
-
onChange={(value) => {
|
|
289
|
+
onChange={(value: any) => {
|
|
287
290
|
handleEdit(ites.code, value);
|
|
288
291
|
}}
|
|
289
292
|
getPopupContainer={() => document.body}
|
|
290
293
|
/>
|
|
291
294
|
)) ||
|
|
292
|
-
|
|
295
|
+
null}
|
|
293
296
|
{/* 单选/多选 商品SPU选择器 */}
|
|
294
297
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
295
298
|
ites?.choiceType === 150 && (
|
|
@@ -300,9 +303,9 @@ export default function RenderCompItem(props:any){
|
|
|
300
303
|
placeholder: '请选择SPU',
|
|
301
304
|
...(ites?.inputType === 30
|
|
302
305
|
? {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
+
mode: 'multiple',
|
|
307
|
+
maxTagCount: 1,
|
|
308
|
+
}
|
|
306
309
|
: {}),
|
|
307
310
|
}}
|
|
308
311
|
disabled={disabled}
|
|
@@ -317,7 +320,7 @@ export default function RenderCompItem(props:any){
|
|
|
317
320
|
getPopupContainer={() => document.body}
|
|
318
321
|
/>
|
|
319
322
|
)) ||
|
|
320
|
-
|
|
323
|
+
null}
|
|
321
324
|
{/* 单选/多选 商品SKU选择器 */}
|
|
322
325
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
323
326
|
ites?.choiceType === 160 && (
|
|
@@ -328,9 +331,9 @@ export default function RenderCompItem(props:any){
|
|
|
328
331
|
placeholder: '请选择商品',
|
|
329
332
|
...(ites?.inputType === 30
|
|
330
333
|
? {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
+
mode: 'multiple',
|
|
335
|
+
maxTagCount: 1,
|
|
336
|
+
}
|
|
334
337
|
: {}),
|
|
335
338
|
}}
|
|
336
339
|
disabled={disabled}
|
|
@@ -339,13 +342,13 @@ export default function RenderCompItem(props:any){
|
|
|
339
342
|
requestConfig={{
|
|
340
343
|
filterInit: 'qp-skuCode-in',
|
|
341
344
|
}}
|
|
342
|
-
onChange={(value) => {
|
|
345
|
+
onChange={(value: any) => {
|
|
343
346
|
handleEdit(ites.code, value);
|
|
344
347
|
}}
|
|
345
348
|
getPopupContainer={() => document.body}
|
|
346
349
|
/>
|
|
347
350
|
)) ||
|
|
348
|
-
|
|
351
|
+
null}
|
|
349
352
|
{/* 单选/多选 省市区 */}
|
|
350
353
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
351
354
|
ites?.choiceType === 190 && (
|
|
@@ -358,17 +361,18 @@ export default function RenderCompItem(props:any){
|
|
|
358
361
|
return await request({
|
|
359
362
|
url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
|
|
360
363
|
method: 'get',
|
|
361
|
-
converter: ({ data }) => {
|
|
364
|
+
converter: ({ data }: any) => {
|
|
365
|
+
// FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115629
|
|
362
366
|
const handleData =
|
|
363
367
|
data && data[0]
|
|
364
|
-
? data?.map((item) => {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
? data?.map((item: any) => {
|
|
369
|
+
return {
|
|
370
|
+
text: item.name,
|
|
371
|
+
value: item.id,
|
|
372
|
+
level: item.level,
|
|
373
|
+
id: item.id,
|
|
374
|
+
};
|
|
375
|
+
})
|
|
372
376
|
: [];
|
|
373
377
|
return handleData;
|
|
374
378
|
},
|
|
@@ -381,7 +385,7 @@ export default function RenderCompItem(props:any){
|
|
|
381
385
|
getPopupContainer={() => document.body}
|
|
382
386
|
/>
|
|
383
387
|
)) ||
|
|
384
|
-
|
|
388
|
+
null}
|
|
385
389
|
{/* 单选/多选 行政组织选择器 */}
|
|
386
390
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
387
391
|
ites?.choiceType === 210 && (
|
|
@@ -398,7 +402,7 @@ export default function RenderCompItem(props:any){
|
|
|
398
402
|
getPopupContainer={() => document.body}
|
|
399
403
|
/>
|
|
400
404
|
)) ||
|
|
401
|
-
|
|
405
|
+
null}
|
|
402
406
|
{/* 单选/多选 采购组织选择器 */}
|
|
403
407
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
404
408
|
ites?.choiceType === 220 && (
|
|
@@ -415,7 +419,7 @@ export default function RenderCompItem(props:any){
|
|
|
415
419
|
getPopupContainer={() => document.body}
|
|
416
420
|
/>
|
|
417
421
|
)) ||
|
|
418
|
-
|
|
422
|
+
null}
|
|
419
423
|
{/* 单选/多选 销售组织选择器 */}
|
|
420
424
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
421
425
|
ites?.choiceType === 230 && (
|
|
@@ -432,7 +436,7 @@ export default function RenderCompItem(props:any){
|
|
|
432
436
|
getPopupContainer={() => document.body}
|
|
433
437
|
/>
|
|
434
438
|
)) ||
|
|
435
|
-
|
|
439
|
+
null}
|
|
436
440
|
{/* 单选/多选 供应商选择器 */}
|
|
437
441
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
438
442
|
ites?.choiceType === 240 && (
|
|
@@ -443,9 +447,9 @@ export default function RenderCompItem(props:any){
|
|
|
443
447
|
placeholder: '请选择供应商',
|
|
444
448
|
...(ites?.inputType === 30
|
|
445
449
|
? {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
450
|
+
mode: 'multiple',
|
|
451
|
+
maxTagCount: 1,
|
|
452
|
+
}
|
|
449
453
|
: {}),
|
|
450
454
|
}}
|
|
451
455
|
disabled={disabled}
|
|
@@ -460,7 +464,7 @@ export default function RenderCompItem(props:any){
|
|
|
460
464
|
getPopupContainer={() => document.body}
|
|
461
465
|
/>
|
|
462
466
|
)) ||
|
|
463
|
-
|
|
467
|
+
null}
|
|
464
468
|
{/* 单选/多选 客户选择器 */}
|
|
465
469
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
466
470
|
ites?.choiceType === 250 && (
|
|
@@ -471,9 +475,9 @@ export default function RenderCompItem(props:any){
|
|
|
471
475
|
placeholder: '请选择客户',
|
|
472
476
|
...(ites?.inputType === 30
|
|
473
477
|
? {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
478
|
+
mode: 'multiple',
|
|
479
|
+
maxTagCount: 1,
|
|
480
|
+
}
|
|
477
481
|
: {}),
|
|
478
482
|
}}
|
|
479
483
|
disabled={disabled}
|
|
@@ -488,7 +492,7 @@ export default function RenderCompItem(props:any){
|
|
|
488
492
|
getPopupContainer={() => document.body}
|
|
489
493
|
/>
|
|
490
494
|
)) ||
|
|
491
|
-
|
|
495
|
+
null}
|
|
492
496
|
{/* 单选/多选 店铺选择器 */}
|
|
493
497
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
494
498
|
ites?.choiceType === 260 && (
|
|
@@ -499,9 +503,9 @@ export default function RenderCompItem(props:any){
|
|
|
499
503
|
placeholder: '请选择店铺',
|
|
500
504
|
...(ites?.inputType === 30
|
|
501
505
|
? {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
506
|
+
mode: 'multiple',
|
|
507
|
+
maxTagCount: 1,
|
|
508
|
+
}
|
|
505
509
|
: {}),
|
|
506
510
|
}}
|
|
507
511
|
disabled={disabled}
|
|
@@ -516,7 +520,7 @@ export default function RenderCompItem(props:any){
|
|
|
516
520
|
getPopupContainer={() => document.body}
|
|
517
521
|
/>
|
|
518
522
|
)) ||
|
|
519
|
-
|
|
523
|
+
null}
|
|
520
524
|
{/* 单选/多选 员工选择器 */}
|
|
521
525
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
522
526
|
ites?.choiceType === 270 && (
|
|
@@ -527,9 +531,9 @@ export default function RenderCompItem(props:any){
|
|
|
527
531
|
placeholder: '请选择员工',
|
|
528
532
|
...(ites?.inputType === 30
|
|
529
533
|
? {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
534
|
+
mode: 'multiple',
|
|
535
|
+
maxTagCount: 1,
|
|
536
|
+
}
|
|
533
537
|
: {}),
|
|
534
538
|
}}
|
|
535
539
|
disabled={disabled}
|
|
@@ -544,7 +548,7 @@ export default function RenderCompItem(props:any){
|
|
|
544
548
|
getPopupContainer={() => document.body}
|
|
545
549
|
/>
|
|
546
550
|
)) ||
|
|
547
|
-
|
|
551
|
+
null}
|
|
548
552
|
{/* 单选/多选 库存组织选择器 */}
|
|
549
553
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
550
554
|
ites?.choiceType === 280 && (
|
|
@@ -578,7 +582,7 @@ export default function RenderCompItem(props:any){
|
|
|
578
582
|
getPopupContainer={() => document.body}
|
|
579
583
|
/>
|
|
580
584
|
)) ||
|
|
581
|
-
|
|
585
|
+
null}
|
|
582
586
|
{/* 单选/多选 配送方式选择器 */}
|
|
583
587
|
{((ites?.inputType === 20 || ites?.inputType === 30) &&
|
|
584
588
|
ites?.choiceType === 310 && (
|
|
@@ -589,9 +593,9 @@ export default function RenderCompItem(props:any){
|
|
|
589
593
|
placeholder: '请选择配送方式',
|
|
590
594
|
...(ites?.inputType === 30
|
|
591
595
|
? {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
596
|
+
mode: 'multiple',
|
|
597
|
+
maxTagCount: 1,
|
|
598
|
+
}
|
|
595
599
|
: {}),
|
|
596
600
|
}}
|
|
597
601
|
disabled={disabled}
|
|
@@ -634,13 +638,14 @@ export default function RenderCompItem(props:any){
|
|
|
634
638
|
getPopupContainer={() => document.body}
|
|
635
639
|
/>
|
|
636
640
|
)) ||
|
|
637
|
-
|
|
641
|
+
null}
|
|
638
642
|
{/* 表达式 */}
|
|
639
643
|
{ites?.inputType === 40 && (
|
|
640
644
|
<div style={{ display: 'flex' }}>
|
|
641
645
|
<Formula
|
|
642
646
|
disabled={disabled}
|
|
643
647
|
key={showValue(ites.code)}
|
|
648
|
+
// FIXME http://192.168.13.78/mep-fed-group/web/libs/business-component/-/merge_requests/45#note_115667
|
|
644
649
|
setValue={(val, formulaName) => {
|
|
645
650
|
console.log(val, 'val');
|
|
646
651
|
const value = val.map((item) => {
|
|
@@ -662,123 +667,4 @@ export default function RenderCompItem(props:any){
|
|
|
662
667
|
)}
|
|
663
668
|
</>
|
|
664
669
|
);
|
|
665
|
-
};
|
|
666
|
-
|
|
667
|
-
renderFormCompItem = (
|
|
668
|
-
config,
|
|
669
|
-
showValue,
|
|
670
|
-
handleEdit,
|
|
671
|
-
parentItem,
|
|
672
|
-
boxStyle,
|
|
673
|
-
disabled
|
|
674
|
-
) => {
|
|
675
|
-
if (!config) return;
|
|
676
|
-
return (
|
|
677
|
-
<div style={boxStyle}>
|
|
678
|
-
{(config?.leftText && (
|
|
679
|
-
<div style={{ flex: 'none', marginRight: 10 }}>
|
|
680
|
-
{config?.required && <span className="requiredMark" />}
|
|
681
|
-
{config.leftText}
|
|
682
|
-
</div>
|
|
683
|
-
)) ||
|
|
684
|
-
null}
|
|
685
|
-
{(!config?.leftText && config?.rightText && config?.required && (
|
|
686
|
-
<div style={{ flex: 'none', marginRight: 10 }}>
|
|
687
|
-
<span className="requiredMark" />
|
|
688
|
-
</div>
|
|
689
|
-
)) ||
|
|
690
|
-
null}
|
|
691
|
-
{this.renderCompItem(
|
|
692
|
-
config,
|
|
693
|
-
(a, b, c = parentItem, d = config) => showValue(a, b, c, d),
|
|
694
|
-
(a, b, c = parentItem, d = config) => handleEdit(a, b, c, d),
|
|
695
|
-
disabled
|
|
696
|
-
)}
|
|
697
|
-
{(config?.rightText && (
|
|
698
|
-
<div style={{ flex: 'none', marginLeft: 10 }}>{config.rightText}</div>
|
|
699
|
-
)) ||
|
|
700
|
-
null}
|
|
701
|
-
</div>
|
|
702
|
-
);
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
renderActionList = (
|
|
706
|
-
itemDetail,
|
|
707
|
-
parentDetail,
|
|
708
|
-
handleRuleTypeData,
|
|
709
|
-
sRuleActionData,
|
|
710
|
-
classDataIndex,
|
|
711
|
-
disabled,
|
|
712
|
-
boxStyle,
|
|
713
|
-
) => {
|
|
714
|
-
const showValue = (code, type, functionItem, configItem) => {
|
|
715
|
-
const functionIndex = handleRuleTypeData.findIndex(
|
|
716
|
-
(m) => m.code === functionItem.code,
|
|
717
|
-
);
|
|
718
|
-
const pCode =
|
|
719
|
-
itemDetail.execute[functionIndex] &&
|
|
720
|
-
itemDetail.execute[functionIndex].properties[code];
|
|
721
|
-
let defaultValue = configItem.defaultValue;
|
|
722
|
-
if (type === 'input') {
|
|
723
|
-
return pCode === undefined ? pCode : pCode || defaultValue;
|
|
724
|
-
}
|
|
725
|
-
return pCode || defaultValue;
|
|
726
|
-
};
|
|
727
|
-
const handleEdit = (code, val, functionItem) => {
|
|
728
|
-
const functionIndex = handleRuleTypeData.findIndex(
|
|
729
|
-
(m) => m.code === functionItem.code,
|
|
730
|
-
);
|
|
731
|
-
const { ruleClassData } = this.state;
|
|
732
|
-
const { callBack } = this.props;
|
|
733
|
-
parentDetail.extraInfo.execute[functionIndex]['properties'][code] = val;
|
|
734
|
-
parentDetail.extraInfo.execute[functionIndex]['code'] = functionItem.code;
|
|
735
|
-
|
|
736
|
-
this.setState(
|
|
737
|
-
{
|
|
738
|
-
ruleClassData,
|
|
739
|
-
},
|
|
740
|
-
() => {
|
|
741
|
-
callBack(ruleClassData);
|
|
742
|
-
},
|
|
743
|
-
);
|
|
744
|
-
};
|
|
745
|
-
|
|
746
|
-
return (
|
|
747
|
-
<>
|
|
748
|
-
{sRuleActionData.map((i, index) => (
|
|
749
|
-
<div>
|
|
750
|
-
<div style={{ display: 'flex' }}>
|
|
751
|
-
{(i.valueList?.length &&
|
|
752
|
-
i.valueList.map((s) => {
|
|
753
|
-
return this.renderFormCompItem(
|
|
754
|
-
s,
|
|
755
|
-
showValue,
|
|
756
|
-
handleEdit,
|
|
757
|
-
i,
|
|
758
|
-
boxStyle,
|
|
759
|
-
disabled
|
|
760
|
-
);
|
|
761
|
-
})) || (
|
|
762
|
-
<div style={boxStyle} key={i.functionName}>
|
|
763
|
-
<div>{i.functionName}</div>
|
|
764
|
-
</div>
|
|
765
|
-
)}
|
|
766
|
-
<MinusCircleOutlined
|
|
767
|
-
className={'icon_btn_style'}
|
|
768
|
-
onClick={() => {
|
|
769
|
-
this.handleDeleteRuleAction(classDataIndex, i.code);
|
|
770
|
-
}}
|
|
771
|
-
style={{
|
|
772
|
-
color: 'gray',
|
|
773
|
-
marginLeft: '15px',
|
|
774
|
-
marginTop: '15px',
|
|
775
|
-
display: disabled ? 'none' : 'inline-block',
|
|
776
|
-
}}
|
|
777
|
-
/>
|
|
778
|
-
</div>
|
|
779
|
-
</div>
|
|
780
|
-
))}
|
|
781
|
-
</>
|
|
782
|
-
|
|
783
|
-
);
|
|
784
670
|
};
|
|
@@ -31,8 +31,6 @@ import {
|
|
|
31
31
|
getSpecialPropertyCode,
|
|
32
32
|
getPropertyCode,
|
|
33
33
|
isObj,
|
|
34
|
-
dateFormat,
|
|
35
|
-
fullDateFormat
|
|
36
34
|
} from './util';
|
|
37
35
|
import { getDictionarySource, uuid } from '../../../utils/utils';
|
|
38
36
|
import {
|
|
@@ -45,7 +43,6 @@ import { request } from 'bssula';
|
|
|
45
43
|
import Formula from './Formula';
|
|
46
44
|
import RenderSpecificAction from './renderSpecificAction';
|
|
47
45
|
import RenderCompItem from './RenderCompItem';
|
|
48
|
-
import InnerSelect from './InnerSelect';
|
|
49
46
|
|
|
50
47
|
const { RangePicker } = DatePicker;
|
|
51
48
|
|
|
@@ -532,7 +529,7 @@ class RuleObjectComponent extends Component {
|
|
|
532
529
|
|
|
533
530
|
handleAddRule = () => {
|
|
534
531
|
const { ruleClassData } = this.state;
|
|
535
|
-
const { callBack, ruleTypeData, ruleGroupInfo } = this.props;
|
|
532
|
+
const { callBack, ruleTypeData=[], ruleGroupInfo } = this.props;
|
|
536
533
|
const isRuleInstance = ruleGroupInfo?.type?.indexOf('instance') > -1;
|
|
537
534
|
const initKongData = {
|
|
538
535
|
ruleName: `规则${ruleClassData?.length + 1}`,
|
|
@@ -548,7 +545,7 @@ class RuleObjectComponent extends Component {
|
|
|
548
545
|
enable: false,
|
|
549
546
|
value: '',
|
|
550
547
|
},
|
|
551
|
-
execute: ruleTypeData
|
|
548
|
+
execute: ruleTypeData?.map((s) => {
|
|
552
549
|
return {
|
|
553
550
|
priority: 1,
|
|
554
551
|
code: s.code,
|
|
@@ -556,7 +553,7 @@ class RuleObjectComponent extends Component {
|
|
|
556
553
|
configPropertyCode: 'configPropertyValue',
|
|
557
554
|
},
|
|
558
555
|
};
|
|
559
|
-
}),
|
|
556
|
+
})||[],
|
|
560
557
|
},
|
|
561
558
|
}
|
|
562
559
|
const initTemplateData = ruleGroupInfo?.templateData && Object.keys(ruleGroupInfo?.templateData)?.length ? {
|