@zgfe/business-lib 1.1.34-alpha.11 → 1.1.34-alpha.12

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.
@@ -128,7 +128,6 @@ var StringList = function StringList(props) {
128
128
  };
129
129
  }();
130
130
  var onChange = function onChange(data) {
131
- console.log(8888, data);
132
131
  var resData = data.map(function (item) {
133
132
  return item.value;
134
133
  });
@@ -109,7 +109,23 @@ var BusinessCondition = function BusinessCondition(props) {
109
109
  setServiceAttributeList([]);
110
110
  }
111
111
  }).catch(function () {
112
- setServiceAttributeList([]);
112
+ setServiceAttributeList([{
113
+ value: 25,
114
+ uniqueKey: null,
115
+ name: '444'
116
+ }, {
117
+ value: 28,
118
+ uniqueKey: null,
119
+ name: 'sql导入'
120
+ }, {
121
+ value: 27,
122
+ uniqueKey: null,
123
+ name: 'test0322'
124
+ }, {
125
+ value: 26,
126
+ uniqueKey: null,
127
+ name: '业务数据测试1'
128
+ }]);
113
129
  });
114
130
  }
115
131
  function onOperatorChange(option) {
@@ -57,23 +57,29 @@ var DataAttribute = function DataAttribute(props) {
57
57
  _useState8 = _slicedToArray(_useState7, 2),
58
58
  bizDataAttrList = _useState8[0],
59
59
  setBizDataAttrList = _useState8[1];
60
- var _useState9 = useState(''),
60
+ var _useState9 = useState(0),
61
61
  _useState10 = _slicedToArray(_useState9, 2),
62
- searchValue = _useState10[0],
63
- setSearchValue = _useState10[1];
62
+ timer = _useState10[0],
63
+ setTimer = _useState10[1];
64
+ var _useState11 = useState(''),
65
+ _useState12 = _slicedToArray(_useState11, 2),
66
+ searchValue = _useState12[0],
67
+ setSearchValue = _useState12[1];
64
68
  var obj = (_condition$attrs$inde = condition.attrs[index]) === null || _condition$attrs$inde === void 0 ? void 0 : _condition$attrs$inde.params.map(function (item) {
65
69
  return {
66
70
  name: item,
67
71
  value: item
68
72
  };
69
73
  });
70
- var _useState11 = useState(obj ? obj : []),
71
- _useState12 = _slicedToArray(_useState11, 2),
72
- current = _useState12[0],
73
- setCurrent = _useState12[1];
74
+ var _useState13 = useState(obj ? obj : []),
75
+ _useState14 = _slicedToArray(_useState13, 2),
76
+ current = _useState14[0],
77
+ setCurrent = _useState14[1];
74
78
  var _useContext = useContext(BizGlobalDataContext),
75
79
  currentApp = _useContext.currentApp;
76
- useEffect(function () {}, [searchValue]);
80
+ useEffect(function () {
81
+ queryValueList(searchValue, {});
82
+ }, [searchValue]);
77
83
  useEffect(function () {
78
84
  if (condition === null || condition === void 0 ? void 0 : condition.typeId) {
79
85
  queryBizDataAttrList(condition === null || condition === void 0 ? void 0 : condition.typeId);
@@ -114,39 +120,48 @@ var DataAttribute = function DataAttribute(props) {
114
120
  onChange(_objectSpread({}, condition));
115
121
  }
116
122
  function queryValueList(keyword, operate) {
117
- request('/cep-console/api/v1/es/data/attr/value', {
118
- headers: {
119
- 'Content-Type': 'application/json'
120
- },
121
- method: 'post',
122
- data: {
123
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
124
- attrId: condition.attrs[index].attrId,
125
- dataTypeId: operate.bizDataTypeId ? operate.bizDataTypeId : condition.attrs[index].orderType === 'master' ? 1 : 2,
126
- keyword: keyword,
127
- pageNum: 1,
128
- pageSize: 20,
129
- attrName: operate.name,
130
- eventId: 0
131
- }
132
- }).then(function (res) {
133
- if (res.data) {
134
- var _list2 = res.data.map(function (item) {
135
- return {
136
- name: operate.bizDataTypeId ? item : item.name,
137
- value: operate.bizDataTypeId ? item : item.id
123
+ var fetch = function fetch() {
124
+ request('/cep-console/api/v1/es/data/attr/value', {
125
+ headers: {
126
+ 'Content-Type': 'application/json'
127
+ },
128
+ method: 'post',
129
+ data: {
130
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
131
+ attrId: condition.attrs[index].attrId,
132
+ dataTypeId: operate.bizDataTypeId ? operate.bizDataTypeId : condition.attrs[index].orderType === 'master' ? 1 : 2,
133
+ keyword: keyword,
134
+ pageNum: 1,
135
+ pageSize: 20,
136
+ attrName: operate.name,
137
+ eventId: 0
138
+ }
139
+ }).then(function (res) {
140
+ if (res.data) {
141
+ var isString = function isString(val) {
142
+ return typeof val === 'string';
138
143
  };
139
- });
140
- condition.paramsList[index].paramsList = _list2;
141
- setParamsList(_list2);
142
- } else {
144
+ var _list2 = res.data.map(function (item) {
145
+ return {
146
+ name: !isString(item) ? JSON.stringify(item) : item,
147
+ value: !isString(item) ? JSON.stringify(item) : item
148
+ };
149
+ });
150
+ condition.paramsList[index].paramsList = _list2;
151
+ setParamsList(_list2);
152
+ } else {
153
+ setParamsList([]);
154
+ condition.paramsList[index].paramsList = [];
155
+ }
156
+ }).catch(function () {
143
157
  setParamsList([]);
144
158
  condition.paramsList[index].paramsList = [];
145
- }
146
- }).catch(function () {
147
- setParamsList([]);
148
- condition.paramsList[index].paramsList = [];
149
- });
159
+ });
160
+ };
161
+ if (timer) clearTimeout(timer);
162
+ setTimer(setTimeout(function () {
163
+ fetch();
164
+ }, 400));
150
165
  onChange(_objectSpread({}, condition));
151
166
  }
152
167
  function queryBizDataAttrList(bizDataTypeId) {
@@ -173,7 +188,43 @@ var DataAttribute = function DataAttribute(props) {
173
188
  }
174
189
  }).catch(function () {
175
190
  condition.paramsList[index].bizDataAttrList = [];
176
- setBizDataAttrList([]);
191
+ setBizDataAttrList([{
192
+ id: 98,
193
+ value: 98,
194
+ bizDataTypeId: 28,
195
+ name: 'ID',
196
+ propType: 2,
197
+ isRequired: 1,
198
+ isShow: 1,
199
+ isCreateTimeData: '',
200
+ isUniqueData: 'Y',
201
+ isUniqueUser: '',
202
+ attrOrder: 1
203
+ }, {
204
+ id: 100,
205
+ value: 100,
206
+ bizDataTypeId: 28,
207
+ name: '姓名',
208
+ propType: 1,
209
+ isRequired: 1,
210
+ isShow: 1,
211
+ isCreateTimeData: '',
212
+ isUniqueData: '',
213
+ isUniqueUser: '',
214
+ attrOrder: 3
215
+ }, {
216
+ id: 101,
217
+ value: 101,
218
+ bizDataTypeId: 28,
219
+ name: '创建时间',
220
+ propType: 3,
221
+ isRequired: 1,
222
+ isShow: 1,
223
+ isCreateTimeData: 'Y',
224
+ isUniqueData: '',
225
+ isUniqueUser: '',
226
+ attrOrder: 4
227
+ }]);
177
228
  });
178
229
  onChange(_objectSpread({}, condition));
179
230
  }
@@ -365,12 +416,13 @@ var DataAttribute = function DataAttribute(props) {
365
416
  multiple: true,
366
417
  size: "middle",
367
418
  labelField: "name",
368
- options: paramsList.length > 0 ? paramsList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList3 = condition.paramsList[index]) === null || _condition$paramsList3 === void 0 ? void 0 : _condition$paramsList3.paramsList,
369
419
  keyField: "value",
420
+ options: paramsList.length > 0 ? paramsList : condition === null || condition === void 0 ? void 0 : (_condition$paramsList3 = condition.paramsList[index]) === null || _condition$paramsList3 === void 0 ? void 0 : _condition$paramsList3.paramsList,
370
421
  value: current,
371
422
  onChange: onParamsChange,
372
423
  onSearch: setSearchValue,
373
- enableCreate: true
424
+ enableCreate: true,
425
+ enableSearch: true
374
426
  })) : null, condition.attrs[index].attrType === 'cont-num' || condition.attrs[index].attrType === 'cont-date' && condition.attrs[index].operator !== 'absolute' ? /*#__PURE__*/React.createElement("div", {
375
427
  className: "".concat(classPrefix, "-period-condition")
376
428
  }, /*#__PURE__*/React.createElement(Input, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.1.34-alpha.11",
3
+ "version": "1.1.34-alpha.12",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",