@zgfe/business-lib 1.1.34-alpha.2 → 1.1.34-alpha.21

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.
Files changed (100) hide show
  1. package/es/addToPanel/index.js +7 -1
  2. package/es/addToScene/index.js +1 -1
  3. package/es/assets/colorIcon/demo.css +539 -0
  4. package/es/assets/colorIcon/demo_index.html +741 -0
  5. package/es/assets/colorIcon/iconfont.css +112 -0
  6. package/es/assets/colorIcon/iconfont.js +43 -0
  7. package/es/assets/colorIcon/iconfont.json +177 -0
  8. package/es/assets/colorIcon/iconfont.svg +67 -0
  9. package/es/assets/colorIcon/iconfont.ttf +0 -0
  10. package/es/assets/colorIcon/iconfont.woff +0 -0
  11. package/es/assets/colorIcon/iconfont.woff2 +0 -0
  12. package/es/assets/iconfont/demo_index.html +95 -3
  13. package/es/assets/iconfont/iconfont.css +19 -3
  14. package/es/assets/iconfont/iconfont.js +1 -1
  15. package/es/assets/iconfont/iconfont.json +28 -0
  16. package/es/assets/iconfont/iconfont.ttf +0 -0
  17. package/es/assets/iconfont/iconfont.woff +0 -0
  18. package/es/assets/iconfont/iconfont.woff2 +0 -0
  19. package/es/assets/theme.js +1 -2
  20. package/es/attrConditions/components/stringList.js +0 -1
  21. package/es/attrConditions/components/valuesList.js +1 -0
  22. package/es/attrConditions/demo/group.js +3 -2
  23. package/es/attrConditions/demo/index.js +1 -11
  24. package/es/attrConditions/index.d.ts +3 -1
  25. package/es/attrConditions/index.js +24 -19
  26. package/es/attrConditions/types.d.ts +1 -1
  27. package/es/attributeSelector/index.js +10 -8
  28. package/es/attributeSelector/types.d.ts +4 -0
  29. package/es/attributeSelector/util.js +5 -1
  30. package/es/chart/util/formatOption.js +1 -1
  31. package/es/colorIcon/demo/index.d.ts +3 -0
  32. package/es/colorIcon/demo/index.js +10 -0
  33. package/es/colorIcon/index.d.ts +9 -0
  34. package/es/colorIcon/index.js +19 -0
  35. package/es/constants/apis.d.ts +6 -0
  36. package/es/constants/apis.js +7 -1
  37. package/es/constants/common.d.ts +11 -0
  38. package/es/constants/common.js +35 -0
  39. package/es/context/index.d.ts +4 -1
  40. package/es/cycleTime/month.js +17 -15
  41. package/es/datePicker/index.d.ts +1 -1
  42. package/es/datePicker/index.js +1 -1
  43. package/es/datePicker/styles/index.less +1 -1
  44. package/es/demoWrapper/content.d.ts +2 -1
  45. package/es/demoWrapper/content.js +25 -12
  46. package/es/demoWrapper/demo/index.js +5 -3
  47. package/es/demoWrapper/head.d.ts +3 -1
  48. package/es/demoWrapper/head.js +17 -5
  49. package/es/demoWrapper/index.js +18 -10
  50. package/es/dialog/index.js +1 -1
  51. package/es/eventSelector/demo/index.js +1 -0
  52. package/es/eventSelector/index.js +15 -10
  53. package/es/eventSelector/listPanel.js +33 -7
  54. package/es/eventSelector/types.d.ts +2 -0
  55. package/es/index.d.ts +3 -1
  56. package/es/index.js +3 -1
  57. package/es/select/handle.js +6 -2
  58. package/es/select/index.js +13 -11
  59. package/es/socket/demo/demo.d.ts +2 -0
  60. package/es/socket/demo/demo.js +145 -0
  61. package/es/socket/demo/index.less +27 -0
  62. package/es/socket/index.d.ts +33 -0
  63. package/es/socket/index.js +304 -0
  64. package/es/socket/types.d.ts +38 -0
  65. package/es/socket/types.js +28 -0
  66. package/es/targetConditionGroup/components/targetDimension.js +29 -27
  67. package/es/targetConditionGroup/data/operates.js +0 -3
  68. package/es/targetConditionGroup/demo/index.js +2 -1
  69. package/es/targetConditionGroup/index.js +65 -34
  70. package/es/targetConditionGroup/types.d.ts +1 -0
  71. package/es/targetSelector/index.js +9 -7
  72. package/es/userCondition/conditionTypeList.js +11 -8
  73. package/es/userCondition/conditions/business/operatorCondition.d.ts +11 -0
  74. package/es/userCondition/conditions/business/operatorCondition.js +181 -0
  75. package/es/userCondition/conditions/business/paramsCondition.d.ts +9 -0
  76. package/es/userCondition/conditions/business/paramsCondition.js +79 -0
  77. package/es/userCondition/conditions/businessCondition.d.ts +2 -8
  78. package/es/userCondition/conditions/businessCondition.js +37 -203
  79. package/es/userCondition/conditions/cdpCondition.js +1 -1
  80. package/es/userCondition/conditions/dataAttribute.js +78 -274
  81. package/es/userCondition/conditions/eventCondition.js +7 -4
  82. package/es/userCondition/conditions/order/runPeriodCondition.d.ts +11 -0
  83. package/es/userCondition/conditions/order/runPeriodCondition.js +142 -0
  84. package/es/userCondition/conditions/order/runTimesCondition.d.ts +11 -0
  85. package/es/userCondition/conditions/order/runTimesCondition.js +112 -0
  86. package/es/userCondition/conditions/textDesc.d.ts +1 -1
  87. package/es/userCondition/conditions/textDesc.js +160 -2
  88. package/es/userCondition/conditions/timeDimension.d.ts +1 -0
  89. package/es/userCondition/conditions/timeDimension.js +26 -76
  90. package/es/userCondition/demo/business.d.ts +3 -0
  91. package/es/userCondition/demo/business.js +71 -0
  92. package/es/userCondition/index.js +14 -2
  93. package/es/userCondition/orConditions.js +9 -4
  94. package/es/userCondition/types.d.ts +42 -8
  95. package/es/userCondition/types.js +8 -1
  96. package/es/userCondition/util.d.ts +1 -1
  97. package/es/userCondition/util.js +7 -4
  98. package/es/userTagsSelector/index.js +5 -3
  99. package/es/utils/ajax.js +0 -1
  100. package/package.json +60 -60
@@ -13,22 +13,20 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import React, { useContext, useEffect, useState } from 'react';
14
14
  import BizSelect from '../../select';
15
15
  import { DownOutlined } from '@ant-design/icons';
16
- import { Input, DatePicker, Dropdown, Space, notification } from 'antd';
17
- import moment from 'moment';
16
+ import { Dropdown, Space, notification } from 'antd';
18
17
  import request from '../../utils/ajax';
19
18
  import './styles/periodCondition.less';
20
19
  import { classPrefix } from '..';
21
- import { typeList } from '../../attrConditions/utils/operates';
22
- import { operatorMap } from './constants';
23
20
  import TimeDimension from './timeDimension';
24
21
  import DataAttribute from './dataAttribute';
25
22
  import IconFont from '../../icon/iconFont';
26
23
  import BizGlobalDataContext from '../../context';
27
- var RangePicker = DatePicker.RangePicker;
24
+ import RunPeriodCondition from './order/runPeriodCondition';
25
+ import Apis from '../../constants/apis';
28
26
  var BusinessCondition = function BusinessCondition(props) {
27
+ var _condition$timeDimens, _condition$timeDimens3, _condition$attrs, _condition$timeDimens4, _condition$attrs2;
29
28
  var condition = props.condition,
30
29
  dataId = props.dataId,
31
- isEvent = props.isEvent,
32
30
  label = props.label;
33
31
  var _useContext = useContext(BizGlobalDataContext),
34
32
  currentApp = _useContext.currentApp;
@@ -41,7 +39,7 @@ var BusinessCondition = function BusinessCondition(props) {
41
39
  }
42
40
  }, []);
43
41
  var items = [];
44
- if (condition.timeDimensions.length < 3) {
42
+ if (((_condition$timeDimens = condition.timeDimensions) === null || _condition$timeDimens === void 0 ? void 0 : _condition$timeDimens.length) < 3) {
45
43
  items = items.concat([{
46
44
  label: '时间维度',
47
45
  key: 'time dimension'
@@ -58,7 +56,7 @@ var BusinessCondition = function BusinessCondition(props) {
58
56
  key: 'service attribute'
59
57
  }]);
60
58
  }
61
- var _useState = useState(),
59
+ var _useState = useState(condition.typeId ? '业务属性' : '订单属性'),
62
60
  _useState2 = _slicedToArray(_useState, 2),
63
61
  dataAttributeLabel = _useState2[0],
64
62
  setDataAttributeLabel = _useState2[1];
@@ -70,34 +68,13 @@ var BusinessCondition = function BusinessCondition(props) {
70
68
  _useState6 = _slicedToArray(_useState5, 2),
71
69
  serviceAttributeList = _useState6[0],
72
70
  setServiceAttributeList = _useState6[1];
73
- var options = [{
74
- text: '最近',
75
- value: 'relative'
76
- }, {
77
- text: '任意时间',
78
- value: 'unlimited_time'
79
- }, {
80
- text: '固定时段',
81
- value: 'absolute'
82
- }];
83
- if (isEvent) {
84
- options = options.concat([{
85
- text: '任意时间',
86
- value: 'unlimited_time'
87
- }, {
88
- text: '新增后*',
89
- value: 'join_time'
90
- }]);
91
- }
92
71
  function queryServiceAttributeList() {
93
- request("/cep-console/api/v1/bizdata/type/list/".concat(currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId), {
94
- headers: {
95
- 'Content-Type': 'application/json'
96
- },
72
+ request(Apis.bizDataTypeList + "/".concat(currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId), {
97
73
  method: 'get'
98
74
  }).then(function (res) {
99
75
  if (res.data) {
100
- var list = res.data.map(function (item) {
76
+ var _res$data;
77
+ var list = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
101
78
  return {
102
79
  name: item.typeName,
103
80
  value: item.id
@@ -111,94 +88,6 @@ var BusinessCondition = function BusinessCondition(props) {
111
88
  setServiceAttributeList([]);
112
89
  });
113
90
  }
114
- function onOperatorChange(option) {
115
- var newData = {
116
- operator: option.value
117
- };
118
- if (newData.operator === 'absolute') {
119
- var endDate = moment().format('YYYY-MM-DD');
120
- var startDate = moment().subtract(7, 'days').format('YYYY-MM-DD');
121
- newData.values = [startDate, endDate];
122
- }
123
- if (newData.operator === 'relative') {
124
- newData.values = ['30', '0'];
125
- }
126
- if (newData.operator === 'unlimited_time') {
127
- newData.values = ['30', '0'];
128
- }
129
- if (newData.operator === 'join_time') {
130
- newData.values = ['3', '0'];
131
- }
132
- onChange(_objectSpread(_objectSpread({}, condition), {}, {
133
- runPeriod: newData
134
- }));
135
- }
136
- function onDateChange(newData) {
137
- if (condition.runPeriod.operator === 'absolute') {
138
- var dateRange = newData;
139
- var newValues = dateRange.map(function (date) {
140
- return date.format('YYYY-MM-DD');
141
- });
142
- onChange(_objectSpread(_objectSpread({}, condition), {}, {
143
- runPeriod: _objectSpread(_objectSpread({}, condition.runPeriod), {}, {
144
- values: newValues
145
- })
146
- }));
147
- } else if (condition.runPeriod.operator === 'relative' || condition.runPeriod.operator === 'join_time') {
148
- var newValue = newData.target.value;
149
- onChange(_objectSpread(_objectSpread({}, condition), {}, {
150
- runPeriod: _objectSpread(_objectSpread({}, condition.runPeriod), {}, {
151
- values: [newValue, '0']
152
- })
153
- }));
154
- }
155
- }
156
- function renderValues() {
157
- var _condition$runPeriod = condition.runPeriod,
158
- operator = _condition$runPeriod.operator,
159
- values = _condition$runPeriod.values;
160
- if (operator === 'relative' || operator === 'join_time') {
161
- return /*#__PURE__*/React.createElement(Input, {
162
- key: "relative-date",
163
- className: "".concat(classPrefix, "-select-condition"),
164
- type: "number",
165
- placeholder: "\u8BF7\u8F93\u5165",
166
- value: values[0],
167
- size: "middle",
168
- onChange: onDateChange,
169
- style: {
170
- width: 80
171
- },
172
- suffix: "\u5929"
173
- });
174
- }
175
- if (operator === 'absolute') {
176
- return /*#__PURE__*/React.createElement(RangePicker, {
177
- size: "middle",
178
- defaultValue: [moment(values[0]), moment(values[1])],
179
- onChange: onDateChange,
180
- allowClear: false
181
- });
182
- }
183
- }
184
- var onOperateChange = function onOperateChange(operate) {
185
- condition.runTimes.values = [condition.runTimes.values[0]];
186
- onChange(_objectSpread(_objectSpread({}, condition), {}, {
187
- runTimes: _objectSpread(_objectSpread({}, condition.runTimes), {}, {
188
- operator: operate.value
189
- })
190
- }));
191
- };
192
- var onOperateInput0Change = function onOperateInput0Change(value) {
193
- var newValue = value.target.value;
194
- condition.runTimes.values[0] = newValue;
195
- onChange(_objectSpread({}, condition));
196
- };
197
- var onOperateInput1Change = function onOperateInput1Change(value) {
198
- var newValue = value.target.value;
199
- condition.runTimes.values[1] = newValue;
200
- onChange(_objectSpread({}, condition));
201
- };
202
91
  var onClick = function onClick(_ref) {
203
92
  var key = _ref.key;
204
93
  if (key !== 'time dimension') {
@@ -209,14 +98,15 @@ var BusinessCondition = function BusinessCondition(props) {
209
98
  setDataAttributeLabel((_labelProps$ = labelProps[0]) === null || _labelProps$ === void 0 ? void 0 : _labelProps$.label);
210
99
  }
211
100
  if (key === 'time dimension') {
101
+ var _condition$timeDimens2;
212
102
  var obj = {
213
- frequencyValues: ['1'],
103
+ frequencyValues: [1],
214
104
  frequencyOperator: '>',
215
105
  timeDimension: 1,
216
106
  timeOperator: 'all',
217
107
  timeValues: []
218
108
  };
219
- if (condition.timeDimensions.length !== 3) {
109
+ if (((_condition$timeDimens2 = condition.timeDimensions) === null || _condition$timeDimens2 === void 0 ? void 0 : _condition$timeDimens2.length) !== 3) {
220
110
  condition.timeDimensions.push(obj);
221
111
  } else {
222
112
  notification.info({
@@ -228,13 +118,19 @@ var BusinessCondition = function BusinessCondition(props) {
228
118
  attrId: 0,
229
119
  attrName: '',
230
120
  operator: '',
231
- params: [''],
232
- computeType: 'origin',
121
+ params: [],
122
+ computeType: '',
233
123
  attrType: '',
234
124
  category: ''
235
125
  };
126
+ var params = {
127
+ masterList: [],
128
+ bizDataAttrList: [],
129
+ paramsList: []
130
+ };
236
131
  if (condition.attrs.length < 6) {
237
132
  condition.attrs.push(_obj);
133
+ condition.paramsList.push(params);
238
134
  } else {
239
135
  notification.info({
240
136
  message: '事件属性最多增加6条'
@@ -251,14 +147,9 @@ var BusinessCondition = function BusinessCondition(props) {
251
147
  condition.attrs.splice(index, 1);
252
148
  onChange(_objectSpread({}, condition));
253
149
  }
254
- function onTimeDimensionChange(condition) {
255
- onChange(_objectSpread({}, condition));
256
- }
257
- function onDataAttributeChange(condition) {
258
- onChange(_objectSpread({}, condition));
259
- }
260
150
  function onServiceAttributeChange(operate) {
261
- condition.typeId = operate === null || operate === void 0 ? void 0 : operate.bizDataTypeId;
151
+ condition.typeId = operate === null || operate === void 0 ? void 0 : operate.value;
152
+ condition.typeName = operate === null || operate === void 0 ? void 0 : operate.name;
262
153
  onChange(_objectSpread({}, condition));
263
154
  setServiceAttribute(operate);
264
155
  }
@@ -271,6 +162,10 @@ var BusinessCondition = function BusinessCondition(props) {
271
162
  options: serviceAttributeList,
272
163
  labelField: "name",
273
164
  keyField: "value",
165
+ value: {
166
+ name: condition.typeId,
167
+ value: condition.typeId
168
+ },
274
169
  overlayWidth: 120,
275
170
  onChange: onServiceAttributeChange
276
171
  })) : null, label === '订单数据' ? /*#__PURE__*/React.createElement("div", {
@@ -278,70 +173,12 @@ var BusinessCondition = function BusinessCondition(props) {
278
173
  }, label) : /*#__PURE__*/React.createElement("div", {
279
174
  className: "".concat(classPrefix, "-period-condition-label")
280
175
  }, serviceAttribute === null || serviceAttribute === void 0 ? void 0 : serviceAttribute.name), /*#__PURE__*/React.createElement("div", {
281
- className: "".concat(classPrefix, "-period-condition-operator")
282
- }, /*#__PURE__*/React.createElement(BizSelect, {
283
- dropdownExtra: isEvent ? /*#__PURE__*/React.createElement("div", {
284
- style: {
285
- lineHeight: '29px'
286
- }
287
- }, "*\u7528\u6237\u65B0\u589E\u6570\u636E\u4E3A\u6BCF\u65E5\u51CC\u6668\u751F\u6210") : null,
288
- overlayWidth: isEvent ? 210 : 114,
289
- options: options,
290
- labelField: "text",
291
- keyField: "value",
292
- size: "middle",
293
- value: {
294
- value: condition.runPeriod.operator,
295
- text: operatorMap[condition.runPeriod.operator]
296
- },
297
- onChange: onOperatorChange
298
- })), /*#__PURE__*/React.createElement("div", {
299
176
  className: "".concat(classPrefix, "-period-condition-values")
300
- }, renderValues()), /*#__PURE__*/React.createElement("div", {
301
- className: "".concat(classPrefix, "-period-condition-operator")
302
- }, /*#__PURE__*/React.createElement(BizSelect, {
303
- className: "".concat(classPrefix, "-select-condition"),
304
- options: typeList['cont-num'],
305
- labelField: "name",
306
- keyField: "value",
307
- overlayWidth: 80,
308
- value: {
309
- value: condition.runTimes.operator,
310
- name: condition.runTimes.operator
311
- },
312
- onChange: onOperateChange
313
- })), /*#__PURE__*/React.createElement("div", {
314
- className: "".concat(classPrefix, "-period-condition")
315
- }, /*#__PURE__*/React.createElement(Input, {
316
- key: "relative-date",
317
- className: "".concat(classPrefix, "-select-condition"),
318
- type: condition.runTimes.operator !== 'between' ? 'number' : '',
319
- size: "middle",
320
- value: condition.runTimes.values[0],
321
- placeholder: condition.runTimes.operator !== 'between' ? '请输入' : '输入最小值',
322
- style: {
323
- width: 100
324
- },
325
- onChange: onOperateInput0Change,
326
- suffix: condition.runTimes.operator !== 'between' ? '次' : null
327
- })), condition.runTimes.operator === 'between' ? /*#__PURE__*/React.createElement("div", {
328
- className: "".concat(classPrefix, "-period-condition"),
329
- style: {
330
- marginLeft: 10
331
- }
332
- }, /*#__PURE__*/React.createElement(Input, {
333
- key: "relative-date",
334
- className: "".concat(classPrefix, "-select-condition"),
335
- type: condition.runTimes.operator !== 'between' ? 'number' : '',
336
- size: "middle",
337
- value: condition.runTimes.values[1],
338
- style: {
339
- width: 100
340
- },
341
- placeholder: condition.runTimes.operator !== 'between' ? '请输入' : '输入最大值',
342
- onChange: onOperateInput1Change,
343
- suffix: condition.runTimes.operator !== 'between' ? '次' : null
344
- })) : null), condition.timeDimensions.map(function (_item, index) {
177
+ }, /*#__PURE__*/React.createElement(RunPeriodCondition, {
178
+ dataId: props.dataId,
179
+ condition: condition,
180
+ onChange: onChange
181
+ }))), (_condition$timeDimens3 = condition.timeDimensions) === null || _condition$timeDimens3 === void 0 ? void 0 : _condition$timeDimens3.map(function (_item, index) {
345
182
  return /*#__PURE__*/React.createElement("div", {
346
183
  style: {
347
184
  margin: '10px 0 0 65px'
@@ -356,7 +193,8 @@ var BusinessCondition = function BusinessCondition(props) {
356
193
  }, /*#__PURE__*/React.createElement("div", {
357
194
  className: "".concat(classPrefix, "-period-condition-label")
358
195
  }, "\u65F6\u95F4\u7EF4\u5EA6"), /*#__PURE__*/React.createElement(TimeDimension, {
359
- onChange: onTimeDimensionChange,
196
+ dataId: props.dataId,
197
+ onChange: onChange,
360
198
  condition: condition,
361
199
  index: index
362
200
  }), /*#__PURE__*/React.createElement("div", {
@@ -367,7 +205,7 @@ var BusinessCondition = function BusinessCondition(props) {
367
205
  }, /*#__PURE__*/React.createElement(IconFont, {
368
206
  type: "qingchu"
369
207
  }))));
370
- }), condition.attrs.map(function (_item, index) {
208
+ }), (_condition$attrs = condition.attrs) === null || _condition$attrs === void 0 ? void 0 : _condition$attrs.map(function (_item, index) {
371
209
  return /*#__PURE__*/React.createElement("div", {
372
210
  style: {
373
211
  margin: '10px 0 0 65px'
@@ -382,7 +220,7 @@ var BusinessCondition = function BusinessCondition(props) {
382
220
  }, /*#__PURE__*/React.createElement("div", {
383
221
  className: "".concat(classPrefix, "-period-condition-label")
384
222
  }, dataAttributeLabel), /*#__PURE__*/React.createElement(DataAttribute, {
385
- onChange: onDataAttributeChange,
223
+ onChange: onChange,
386
224
  condition: condition,
387
225
  index: index,
388
226
  serviceAttrType: serviceAttribute
@@ -394,7 +232,7 @@ var BusinessCondition = function BusinessCondition(props) {
394
232
  }, /*#__PURE__*/React.createElement(IconFont, {
395
233
  type: "qingchu"
396
234
  }))));
397
- }), condition.timeDimensions.length !== 3 || condition.attrs.length !== 6 ? /*#__PURE__*/React.createElement("div", {
235
+ }), condition.typeId && label === '业务数据' || label === '订单数据' ? /*#__PURE__*/React.createElement("div", null, ((_condition$timeDimens4 = condition.timeDimensions) === null || _condition$timeDimens4 === void 0 ? void 0 : _condition$timeDimens4.length) !== 3 || ((_condition$attrs2 = condition.attrs) === null || _condition$attrs2 === void 0 ? void 0 : _condition$attrs2.length) !== 6 ? /*#__PURE__*/React.createElement("div", {
398
236
  style: {
399
237
  margin: '2px 0 0 65px',
400
238
  color: '#4075fd',
@@ -409,10 +247,6 @@ var BusinessCondition = function BusinessCondition(props) {
409
247
  onClick: function onClick(e) {
410
248
  return e.preventDefault();
411
249
  }
412
- }, /*#__PURE__*/React.createElement(Space, null, "\u9AD8\u7EA7\u7B5B\u9009", /*#__PURE__*/React.createElement(DownOutlined, null))))) : null);
413
- };
414
- BusinessCondition.defaultProps = {
415
- isEvent: false,
416
- isRealTime: false
250
+ }, /*#__PURE__*/React.createElement(Space, null, "\u9AD8\u7EA7\u7B5B\u9009 ", /*#__PURE__*/React.createElement(DownOutlined, null))))) : null) : null);
417
251
  };
418
252
  export default BusinessCondition;
@@ -146,7 +146,7 @@ var CdpConditionItem = function CdpConditionItem(props) {
146
146
  }
147
147
  }).then(function (result) {
148
148
  setLoading(false);
149
- setFieldList(result.data || []);
149
+ setFieldList((result === null || result === void 0 ? void 0 : result.data) || []);
150
150
  }).catch(function (e) {
151
151
  console.error(e);
152
152
  setLoading(false);