@zgfe/business-lib 1.1.36 → 1.1.37-beta.1

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.
@@ -85,10 +85,12 @@ var BizSelect = function BizSelect(props) {
85
85
  }
86
86
  };
87
87
  var getCheckedData = function getCheckedData(data) {
88
+ var _props$options;
88
89
  var result = data;
89
- props.options.forEach(function (option) {
90
+ (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.forEach(function (option) {
90
91
  if (props.type === 'group') {
91
- option.children.forEach(function (child) {
92
+ var _option$children;
93
+ (_option$children = option.children) === null || _option$children === void 0 ? void 0 : _option$children.forEach(function (child) {
92
94
  if (data[keyField] === child[keyField]) {
93
95
  result = child;
94
96
  }
@@ -65,7 +65,7 @@ var SelectOverlay = /*#__PURE__*/React.forwardRef(function (props, ref) {
65
65
  setShowList(function () {
66
66
  var list = [];
67
67
  if (props.type === 'group') {
68
- list = options.map(function (group) {
68
+ list = options === null || options === void 0 ? void 0 : options.map(function (group) {
69
69
  var groupDom = /*#__PURE__*/React.createElement(SelectOption, {
70
70
  group: group,
71
71
  key: group.name || String(Math.random())
@@ -175,7 +175,8 @@ var SelectOverlay = /*#__PURE__*/React.forwardRef(function (props, ref) {
175
175
  var selectOptions = [];
176
176
  if (checked) {
177
177
  if (props.type === 'group') {
178
- props.options.forEach(function (item) {
178
+ var _props$options;
179
+ (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.forEach(function (item) {
179
180
  selectOptions = selectOptions.concat(item.children || []);
180
181
  });
181
182
  } else {
@@ -5,6 +5,7 @@ export interface OperatorConditionPropsI {
5
5
  index: number;
6
6
  stringOperateList: any;
7
7
  queryValueObj: any;
8
+ conParamsList: any;
8
9
  onChange: (condition: any) => void;
9
10
  }
10
11
  declare const OperatorCondition: React.FC<OperatorConditionPropsI>;
@@ -19,10 +19,11 @@ import request from '../../../utils/ajax';
19
19
  import BizGlobalDataContext from '../../../context';
20
20
  import Apis from '../../../constants/apis';
21
21
  var OperatorCondition = function OperatorCondition(props) {
22
- var _condition$attrs$inde, _condition$attrs$inde2, _condition$paramsList;
22
+ var _condition$attrs$inde, _condition$attrs$inde2, _conParamsList$index;
23
23
  var condition = props.condition,
24
24
  index = props.index,
25
25
  stringOperateList = props.stringOperateList,
26
+ conParamsList = props.conParamsList,
26
27
  queryValueObj = props.queryValueObj,
27
28
  onChange = props.onChange;
28
29
  var _useState = useState([]),
@@ -84,15 +85,15 @@ var OperatorCondition = function OperatorCondition(props) {
84
85
  value: !isString(item) ? JSON.stringify(item) : item
85
86
  };
86
87
  });
87
- condition.paramsList[index].paramsList = list;
88
+ conParamsList[index].paramsList = list;
88
89
  setParamsList(list);
89
90
  } else {
90
91
  setParamsList([]);
91
- condition.paramsList[index].paramsList = [];
92
+ conParamsList[index].paramsList = [];
92
93
  }
93
94
  }).catch(function () {
94
95
  setParamsList([]);
95
- condition.paramsList[index].paramsList = [];
96
+ conParamsList[index].paramsList = [];
96
97
  });
97
98
  };
98
99
  if (timer) clearTimeout(timer);
@@ -170,7 +171,7 @@ var OperatorCondition = function OperatorCondition(props) {
170
171
  size: "middle",
171
172
  labelField: "name",
172
173
  keyField: "value",
173
- options: paramsList.length > 0 ? paramsList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList = condition.paramsList[index]) === null || _condition$paramsList === void 0 ? void 0 : _condition$paramsList.paramsList,
174
+ options: paramsList.length > 0 ? paramsList : (_conParamsList$index = conParamsList[index]) === null || _conParamsList$index === void 0 ? void 0 : _conParamsList$index.paramsList,
174
175
  value: current,
175
176
  onChange: onParamsChange,
176
177
  onSearch: setSearchValue,
@@ -68,6 +68,10 @@ var BusinessCondition = function BusinessCondition(props) {
68
68
  _useState6 = _slicedToArray(_useState5, 2),
69
69
  serviceAttributeList = _useState6[0],
70
70
  setServiceAttributeList = _useState6[1];
71
+ var _useState7 = useState([]),
72
+ _useState8 = _slicedToArray(_useState7, 2),
73
+ conParamsList = _useState8[0],
74
+ setConParamsList = _useState8[1];
71
75
  function queryServiceAttributeList() {
72
76
  request(Apis.bizDataTypeList + "/".concat(currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId), {
73
77
  method: 'get'
@@ -130,7 +134,8 @@ var BusinessCondition = function BusinessCondition(props) {
130
134
  };
131
135
  if (condition.attrs.length < 6) {
132
136
  condition.attrs.push(_obj);
133
- condition.paramsList.push(params);
137
+ conParamsList.push(params);
138
+ setConParamsList(conParamsList);
134
139
  } else {
135
140
  notification.info({
136
141
  message: '事件属性最多增加6条'
@@ -145,6 +150,8 @@ var BusinessCondition = function BusinessCondition(props) {
145
150
  }
146
151
  function onAttrsDelete(index) {
147
152
  condition.attrs.splice(index, 1);
153
+ conParamsList.splice(index, 1);
154
+ setConParamsList(conParamsList);
148
155
  onChange(_objectSpread({}, condition));
149
156
  }
150
157
  function onServiceAttributeChange(operate) {
@@ -221,6 +228,7 @@ var BusinessCondition = function BusinessCondition(props) {
221
228
  className: "".concat(classPrefix, "-period-condition-label")
222
229
  }, dataAttributeLabel), /*#__PURE__*/React.createElement(DataAttribute, {
223
230
  onChange: onChange,
231
+ conParamsList: conParamsList,
224
232
  condition: condition,
225
233
  index: index,
226
234
  serviceAttrType: serviceAttribute
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import './styles/runTimesCondition.less';
3
3
  export interface DataAttributePropsI {
4
4
  condition: any;
5
+ conParamsList: any;
5
6
  index: number;
6
7
  serviceAttrType: any;
7
8
  onChange: (condition: any) => void;
@@ -22,9 +22,10 @@ import ParamsCondition from './business/paramsCondition';
22
22
  import OperatorCondition from './business/operatorCondition';
23
23
  import Apis from '../../constants/apis';
24
24
  var DataAttribute = function DataAttribute(props) {
25
- var _condition$paramsList, _condition$paramsList2;
25
+ var _conParamsList$index, _conParamsList$index2;
26
26
  var condition = props.condition,
27
27
  index = props.index,
28
+ conParamsList = props.conParamsList,
28
29
  onChange = props.onChange;
29
30
  var list = [];
30
31
  var operateList = [];
@@ -84,14 +85,35 @@ var DataAttribute = function DataAttribute(props) {
84
85
  });
85
86
  });
86
87
  setMasterList(_list);
87
- condition.paramsList[index].masterList = _list;
88
+ conParamsList[index].masterList = _list;
88
89
  } else {
89
- condition.paramsList[index].masterList = [];
90
+ conParamsList[index].masterList = [];
90
91
  setMasterList([]);
91
92
  }
92
93
  }).catch(function () {
93
- setMasterList([]);
94
- condition.paramsList[index].masterList = [];
94
+ setMasterList([{
95
+ id: 93,
96
+ value: 93,
97
+ appId: 501313,
98
+ name: '订单',
99
+ propType: 1,
100
+ required: 1,
101
+ isOrderShow: 1,
102
+ isUserShow: 1,
103
+ columnName: 'cus5',
104
+ isDelete: null,
105
+ isUniqueOrder: 'Y',
106
+ isUniqueUser: '',
107
+ isUniqueCreatedate: '',
108
+ isUniquePaydate: '',
109
+ orderRelationSon: 'Y',
110
+ createDate: 1681924645000,
111
+ updateDateTime: 1681925795000,
112
+ hidden: null,
113
+ attrOrder: 151,
114
+ requestHide: null
115
+ }]);
116
+ conParamsList[index].masterList = [];
95
117
  });
96
118
  onChange(_objectSpread({}, condition));
97
119
  }
@@ -109,14 +131,14 @@ var DataAttribute = function DataAttribute(props) {
109
131
  value: item.id
110
132
  });
111
133
  });
112
- condition.paramsList[index].bizDataAttrList = _list2;
134
+ conParamsList[index].bizDataAttrList = _list2;
113
135
  setBizDataAttrList(_list2);
114
136
  } else {
115
- condition.paramsList[index].bizDataAttrList = [];
137
+ conParamsList[index].bizDataAttrList = [];
116
138
  setBizDataAttrList([]);
117
139
  }
118
140
  }).catch(function () {
119
- condition.paramsList[index].bizDataAttrList = [];
141
+ conParamsList[index].bizDataAttrList = [];
120
142
  setBizDataAttrList([]);
121
143
  });
122
144
  onChange(_objectSpread({}, condition));
@@ -215,7 +237,7 @@ var DataAttribute = function DataAttribute(props) {
215
237
  className: "".concat(classPrefix, "-period-condition-operator")
216
238
  }, /*#__PURE__*/React.createElement(BizSelect, {
217
239
  className: "".concat(classPrefix, "-select-condition"),
218
- options: bizDataAttrList.length > 0 ? bizDataAttrList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList = condition.paramsList[index]) === null || _condition$paramsList === void 0 ? void 0 : _condition$paramsList.bizDataAttrList,
240
+ options: bizDataAttrList.length > 0 ? bizDataAttrList : (_conParamsList$index = conParamsList[index]) === null || _conParamsList$index === void 0 ? void 0 : _conParamsList$index.bizDataAttrList,
219
241
  labelField: "name",
220
242
  keyField: "value",
221
243
  value: {
@@ -228,7 +250,7 @@ var DataAttribute = function DataAttribute(props) {
228
250
  className: "".concat(classPrefix, "-period-condition-operator")
229
251
  }, /*#__PURE__*/React.createElement(BizSelect, {
230
252
  className: "".concat(classPrefix, "-select-condition"),
231
- options: masterList.length > 0 ? masterList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList2 = condition.paramsList[index]) === null || _condition$paramsList2 === void 0 ? void 0 : _condition$paramsList2.masterList,
253
+ options: masterList.length > 0 ? masterList : (_conParamsList$index2 = conParamsList[index]) === null || _conParamsList$index2 === void 0 ? void 0 : _conParamsList$index2.masterList,
232
254
  value: {
233
255
  name: condition.typeId ? condition.attrs[index].attrType === 'cont-string' || condition.attrs[index].attrType === 'cont-date' ? condition.attrs[index].operator : condition.attrs[index].computeType : condition.attrs[index].attrName,
234
256
  value: condition.typeId ? condition.attrs[index].attrType === 'cont-string' || condition.attrs[index].attrType === 'cont-date' ? condition.attrs[index].operator : condition.attrs[index].computeType : condition.attrs[index].attrId
@@ -238,6 +260,7 @@ var DataAttribute = function DataAttribute(props) {
238
260
  onChange: onMasterListChange
239
261
  })), /*#__PURE__*/React.createElement(OperatorCondition, {
240
262
  queryValueObj: queryValueObj,
263
+ conParamsList: conParamsList,
241
264
  stringOperateList: stringOperateList,
242
265
  index: index,
243
266
  condition: condition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.36",
3
+ "version": "1.1.37-beta.1",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",