@zgfe/business-lib 1.1.34-alpha.8 → 1.1.34-alpha.9

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.
@@ -21,7 +21,7 @@ import BizGlobalDataContext from '../../context';
21
21
  import { DatePicker, Input } from 'antd';
22
22
  var RangePicker = DatePicker.RangePicker;
23
23
  var DataAttribute = function DataAttribute(props) {
24
- var _condition$attrs$inde;
24
+ var _condition$attrs$inde, _condition$paramsList, _condition$paramsList2, _condition$paramsList3;
25
25
  var condition = props.condition,
26
26
  index = props.index,
27
27
  onChange = props.onChange;
@@ -102,12 +102,16 @@ var DataAttribute = function DataAttribute(props) {
102
102
  });
103
103
  });
104
104
  setMasterList(_list);
105
+ condition.paramsList[index].masterList = _list;
105
106
  } else {
107
+ condition.paramsList[index].masterList = [];
106
108
  setMasterList([]);
107
109
  }
108
110
  }).catch(function () {
109
111
  setMasterList([]);
112
+ condition.paramsList[index].masterList = [];
110
113
  });
114
+ onChange(_objectSpread({}, condition));
111
115
  }
112
116
  function queryValueList(keyword, operate) {
113
117
  request('/cep-console/api/v1/es/data/attr/value', {
@@ -133,13 +137,17 @@ var DataAttribute = function DataAttribute(props) {
133
137
  value: operate.bizDataTypeId ? item : item.id
134
138
  };
135
139
  });
140
+ condition.paramsList[index].paramsList = _list2;
136
141
  setParamsList(_list2);
137
142
  } else {
138
143
  setParamsList([]);
144
+ condition.paramsList[index].paramsList = [];
139
145
  }
140
146
  }).catch(function () {
141
147
  setParamsList([]);
148
+ condition.paramsList[index].paramsList = [];
142
149
  });
150
+ onChange(_objectSpread({}, condition));
143
151
  }
144
152
  function queryBizDataAttrList(bizDataTypeId) {
145
153
  request('/cep-console/api/v1/bizdata/attr/list', {
@@ -157,13 +165,17 @@ var DataAttribute = function DataAttribute(props) {
157
165
  value: item.id
158
166
  });
159
167
  });
168
+ condition.paramsList[index].bizDataAttrList = _list3;
160
169
  setBizDataAttrList(_list3);
161
170
  } else {
171
+ condition.paramsList[index].bizDataAttrList = [];
162
172
  setBizDataAttrList([]);
163
173
  }
164
174
  }).catch(function () {
175
+ condition.paramsList[index].bizDataAttrList = [];
165
176
  setBizDataAttrList([]);
166
177
  });
178
+ onChange(_objectSpread({}, condition));
167
179
  }
168
180
  var onOrderTypeListChange = function onOrderTypeListChange(operate) {
169
181
  if (condition === null || condition === void 0 ? void 0 : condition.typeId) {
@@ -262,21 +274,23 @@ var DataAttribute = function DataAttribute(props) {
262
274
  onChange(_objectSpread({}, condition));
263
275
  };
264
276
  var onParamsChange = function onParamsChange(operate) {
265
- var obj = operate.map(function (item) {
266
- return {
267
- name: item.name,
268
- value: item.value
269
- };
270
- });
271
- var params = operate.map(function (item) {
272
- return item.value;
273
- });
274
- if (!(condition === null || condition === void 0 ? void 0 : condition.typeId)) {
275
- queryValueList(searchValue, {});
277
+ if (operate.length > 0) {
278
+ var _obj = operate.map(function (item) {
279
+ return {
280
+ name: item.name,
281
+ value: item.value
282
+ };
283
+ });
284
+ var params = operate.map(function (item) {
285
+ return item.value;
286
+ });
287
+ if (!(condition === null || condition === void 0 ? void 0 : condition.typeId)) {
288
+ queryValueList(searchValue, {});
289
+ }
290
+ setCurrent(_obj);
291
+ condition.attrs[index].params = params;
292
+ onChange(_objectSpread({}, condition));
276
293
  }
277
- setCurrent(obj);
278
- condition.attrs[index].params = params;
279
- onChange(_objectSpread({}, condition));
280
294
  };
281
295
  function onDateChange(newData) {
282
296
  if (condition.attrs[index].operator === 'absolute') {
@@ -294,7 +308,7 @@ var DataAttribute = function DataAttribute(props) {
294
308
  className: "".concat(classPrefix, "-period-condition-operator")
295
309
  }, /*#__PURE__*/React.createElement(BizSelect, {
296
310
  className: "".concat(classPrefix, "-select-condition"),
297
- options: bizDataAttrList,
311
+ options: bizDataAttrList.length > 0 ? bizDataAttrList : (_condition$paramsList = condition.paramsList[index]) === null || _condition$paramsList === void 0 ? void 0 : _condition$paramsList.bizDataAttrList,
298
312
  labelField: "name",
299
313
  keyField: "value",
300
314
  value: {
@@ -307,7 +321,7 @@ var DataAttribute = function DataAttribute(props) {
307
321
  className: "".concat(classPrefix, "-period-condition-operator")
308
322
  }, /*#__PURE__*/React.createElement(BizSelect, {
309
323
  className: "".concat(classPrefix, "-select-condition"),
310
- options: masterList,
324
+ options: masterList.length > 0 ? masterList : (_condition$paramsList2 = condition.paramsList[index]) === null || _condition$paramsList2 === void 0 ? void 0 : _condition$paramsList2.masterList,
311
325
  value: {
312
326
  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,
313
327
  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
@@ -351,9 +365,9 @@ var DataAttribute = function DataAttribute(props) {
351
365
  multiple: true,
352
366
  size: "middle",
353
367
  labelField: "name",
368
+ options: paramsList.length > 0 ? paramsList : (_condition$paramsList3 = condition.paramsList[index]) === null || _condition$paramsList3 === void 0 ? void 0 : _condition$paramsList3.paramsList,
354
369
  keyField: "value",
355
370
  value: current,
356
- options: paramsList,
357
371
  onChange: onParamsChange,
358
372
  onSearch: setSearchValue,
359
373
  enableCreate: true
@@ -88,6 +88,11 @@ export declare namespace BizUserConditionT {
88
88
  category: 'fixed' | 'custom';
89
89
  computeType: string;
90
90
  }
91
+ interface paramsListCondition {
92
+ masterList: [];
93
+ bizDataAttrList: [];
94
+ paramsList: [];
95
+ }
91
96
  interface TimeDimensionsCondition {
92
97
  timeDimension: number;
93
98
  timeOperator: string;
@@ -111,6 +116,7 @@ export declare namespace BizUserConditionT {
111
116
  interface BusinessCondition {
112
117
  typeId: undefined;
113
118
  typeName: undefined;
119
+ paramsList: paramsListCondition[];
114
120
  attrs: AttrsCondition[];
115
121
  timeDimensions: TimeDimensionsCondition[];
116
122
  runTimes: RunTimesII;
@@ -120,6 +126,7 @@ export declare namespace BizUserConditionT {
120
126
  interface OrderCondition {
121
127
  attrs: AttrsCondition[];
122
128
  timeDimensions: TimeDimensionsCondition[];
129
+ paramsList: paramsListCondition[];
123
130
  runTimes: RunTimesII;
124
131
  runPeriod: RunPeriodII;
125
132
  eventId: -13;
@@ -77,6 +77,11 @@ export function buildCondition(type) {
77
77
  values: [1]
78
78
  },
79
79
  attrs: [],
80
+ paramsList: [{
81
+ masterList: [],
82
+ bizDataAttrList: [],
83
+ paramsList: []
84
+ }],
80
85
  timeDimensions: [],
81
86
  runPeriod: {
82
87
  operator: 'relative',
@@ -91,6 +96,11 @@ export function buildCondition(type) {
91
96
  values: [1]
92
97
  },
93
98
  attrs: [],
99
+ paramsList: [{
100
+ masterList: [],
101
+ bizDataAttrList: [],
102
+ paramsList: []
103
+ }],
94
104
  timeDimensions: [],
95
105
  runPeriod: {
96
106
  operator: 'relative',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.34-alpha.8",
3
+ "version": "1.1.34-alpha.9",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",