@zgfe/business-lib 1.1.34-alpha.18 → 1.1.34-alpha.19
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/es/attrConditions/demo/group.js +3 -2
- package/es/attrConditions/index.d.ts +3 -1
- package/es/attrConditions/index.js +23 -19
- package/es/attrConditions/types.d.ts +1 -1
- package/es/attributeSelector/types.d.ts +2 -0
- package/es/attributeSelector/util.js +5 -1
- package/es/context/index.d.ts +3 -1
- package/es/demoWrapper/content.js +2 -0
- package/es/dialog/index.js +1 -1
- package/es/socket/index.d.ts +5 -3
- package/es/socket/index.js +23 -10
- package/es/userCondition/conditions/business/operatorCondition.js +6 -5
- package/es/userCondition/conditions/business/paramsCondition.js +1 -1
- package/es/userCondition/conditions/businessCondition.js +5 -4
- package/es/userCondition/conditions/dataAttribute.js +15 -12
- package/es/utils/ajax.js +0 -1
- package/package.json +60 -60
|
@@ -7,11 +7,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import React, { useRef, useState } from 'react';
|
|
8
8
|
import { BizConditionGroup, DemoWrapper } from '@zgfe/business-lib';
|
|
9
9
|
import { Button } from 'antd';
|
|
10
|
+
import { OperateTypes } from '../types';
|
|
10
11
|
var conditions = [{
|
|
11
12
|
propCategory: 'userProp',
|
|
12
13
|
attrId: 0,
|
|
13
14
|
type: 2,
|
|
14
|
-
operator:
|
|
15
|
+
operator: OperateTypes.GT,
|
|
15
16
|
values: ['25200', '1'],
|
|
16
17
|
attrName: 'duration',
|
|
17
18
|
category: 'fixed',
|
|
@@ -19,7 +20,7 @@ var conditions = [{
|
|
|
19
20
|
}, {
|
|
20
21
|
propCategory: 'eventProp',
|
|
21
22
|
type: 1,
|
|
22
|
-
operator:
|
|
23
|
+
operator: OperateTypes.Equal,
|
|
23
24
|
values: ['Safari', 'Apple WebKit'],
|
|
24
25
|
attrId: 30183426
|
|
25
26
|
}];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AttributeSelect } from '../attributeSelector/types';
|
|
2
3
|
import './styles/index.less';
|
|
3
|
-
import { AttrConditionTypes } from './types';
|
|
4
|
+
import { AttrConditionTypes, OperateTypes } from './types';
|
|
4
5
|
export declare const classPrefix = "biz-condition-item";
|
|
6
|
+
export declare function getCondition(attr: AttributeSelect.Value, operate: OperateTypes, values: string[]): AttrConditionTypes.ItemValue | undefined;
|
|
5
7
|
declare const BizConditionItem: React.FC<AttrConditionTypes.ItemProp>;
|
|
6
8
|
export default BizConditionItem;
|
|
@@ -12,6 +12,28 @@ import BizOperateList from './components/operateList';
|
|
|
12
12
|
import ValuesList from './components/valuesList';
|
|
13
13
|
import { Skeleton } from 'antd';
|
|
14
14
|
export var classPrefix = 'biz-condition-item';
|
|
15
|
+
export function getCondition(attr, operate, values) {
|
|
16
|
+
if (!attr) return;
|
|
17
|
+
var responseData = {
|
|
18
|
+
attrId: attr.id,
|
|
19
|
+
propCategory: attr.propCategory,
|
|
20
|
+
type: attr.type,
|
|
21
|
+
operator: operate,
|
|
22
|
+
values: values || [],
|
|
23
|
+
dimensionSub: attr.dimensionSub,
|
|
24
|
+
label: attr.label
|
|
25
|
+
};
|
|
26
|
+
if (attr.propCategory === PropCategory.EventProp) {
|
|
27
|
+
responseData.attrName = attr.label;
|
|
28
|
+
} else {
|
|
29
|
+
responseData.attrName = attr.name;
|
|
30
|
+
responseData.category = attr.category;
|
|
31
|
+
if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
|
|
32
|
+
responseData.subtype = attr.subtype;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return responseData;
|
|
36
|
+
}
|
|
15
37
|
var BizConditionItem = function BizConditionItem(props) {
|
|
16
38
|
var _props$defaultValue, _props$value, _props$defaultValue2, _props$value2;
|
|
17
39
|
var defaultValue = props.defaultValue,
|
|
@@ -79,25 +101,7 @@ var BizConditionItem = function BizConditionItem(props) {
|
|
|
79
101
|
useEffect(function () {
|
|
80
102
|
if (props.onChange) {
|
|
81
103
|
if (!attr) return;
|
|
82
|
-
|
|
83
|
-
attrId: attr.id,
|
|
84
|
-
propCategory: attr.propCategory,
|
|
85
|
-
type: attr.type,
|
|
86
|
-
operator: operate,
|
|
87
|
-
values: values || [],
|
|
88
|
-
dimensionSub: attr.dimensionSub,
|
|
89
|
-
label: attr.alias || attr.label
|
|
90
|
-
};
|
|
91
|
-
if (attr.propCategory === PropCategory.EventProp) {
|
|
92
|
-
responseData.attrName = attr.label;
|
|
93
|
-
} else {
|
|
94
|
-
responseData.attrName = attr.name;
|
|
95
|
-
responseData.category = attr.category;
|
|
96
|
-
if (attr.propCategory === PropCategory.UserProp && attr.subtype) {
|
|
97
|
-
responseData.subtype = attr.subtype;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
props.onChange(responseData);
|
|
104
|
+
props.onChange(getCondition(attr, operate, values));
|
|
101
105
|
}
|
|
102
106
|
}, [attr, operate, values]);
|
|
103
107
|
var onChangeAttr = function onChangeAttr(attrData) {
|
|
@@ -18,7 +18,7 @@ export declare namespace AttrConditionTypes {
|
|
|
18
18
|
propCategory?: 'userProp' | 'eventProp' | 'envProp';
|
|
19
19
|
category?: 'fixed' | 'custom';
|
|
20
20
|
dimensionSub?: string;
|
|
21
|
-
operator?:
|
|
21
|
+
operator?: OperateTypes;
|
|
22
22
|
values?: string[];
|
|
23
23
|
}
|
|
24
24
|
interface GroupValue {
|
|
@@ -63,6 +63,8 @@ export interface PropGroups {
|
|
|
63
63
|
eventGroupList?: EventGroup[];
|
|
64
64
|
userPropList?: UserProp[];
|
|
65
65
|
envPropList?: EnvProp[];
|
|
66
|
+
eventNameMap?: Record<string, AnalysisEvent>;
|
|
67
|
+
eventIdMap?: Record<number, AnalysisEvent>;
|
|
66
68
|
}
|
|
67
69
|
export declare namespace AttributeSelect {
|
|
68
70
|
type Value = EventProp | UserProp | EnvProp | null;
|
|
@@ -3,7 +3,9 @@ export default function convertAttributeData(store) {
|
|
|
3
3
|
var res = {
|
|
4
4
|
envPropList: [],
|
|
5
5
|
eventGroupList: [],
|
|
6
|
-
userPropList: []
|
|
6
|
+
userPropList: [],
|
|
7
|
+
eventNameMap: {},
|
|
8
|
+
eventIdMap: {}
|
|
7
9
|
};
|
|
8
10
|
(_store$eventList = store.eventList) === null || _store$eventList === void 0 ? void 0 : _store$eventList.forEach(function (group_) {
|
|
9
11
|
var _res$eventGroupList;
|
|
@@ -39,6 +41,8 @@ export default function convertAttributeData(store) {
|
|
|
39
41
|
eventHidden: e.event_hidden,
|
|
40
42
|
marked: Boolean(e.mark_type)
|
|
41
43
|
};
|
|
44
|
+
res.eventNameMap[event.name] = event;
|
|
45
|
+
res.eventIdMap[event.id] = event;
|
|
42
46
|
if (event.marked) {
|
|
43
47
|
markList.push(event);
|
|
44
48
|
} else {
|
package/es/context/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EventGroup, UserProp, EnvProp } from '../attributeSelector/types';
|
|
2
|
+
import { EventGroup, UserProp, EnvProp, AnalysisEvent } from '../attributeSelector/types';
|
|
3
3
|
export interface AppInfoProps {
|
|
4
4
|
appId?: string | number;
|
|
5
5
|
platform?: string | number;
|
|
@@ -25,6 +25,8 @@ export interface Menu {
|
|
|
25
25
|
export interface GlobalContextProps {
|
|
26
26
|
userGroupList?: Array<any>;
|
|
27
27
|
eventGroupList?: EventGroup[];
|
|
28
|
+
eventNameMap?: Record<string, AnalysisEvent>;
|
|
29
|
+
eventIdMap?: Record<number, AnalysisEvent>;
|
|
28
30
|
userPropList?: UserProp[];
|
|
29
31
|
eventEnvList?: EnvProp[];
|
|
30
32
|
menuNameMap?: {
|
|
@@ -175,6 +175,8 @@ var DemoContent = function DemoContent(_ref3) {
|
|
|
175
175
|
eventGroupList: store === null || store === void 0 ? void 0 : store.eventGroupList,
|
|
176
176
|
userPropList: store === null || store === void 0 ? void 0 : store.userPropList,
|
|
177
177
|
eventEnvList: store === null || store === void 0 ? void 0 : store.envPropList,
|
|
178
|
+
eventIdMap: store === null || store === void 0 ? void 0 : store.eventIdMap,
|
|
179
|
+
eventNameMap: store === null || store === void 0 ? void 0 : store.eventNameMap,
|
|
178
180
|
userGroupList: userGroups
|
|
179
181
|
}
|
|
180
182
|
}, children));
|
package/es/dialog/index.js
CHANGED
package/es/socket/index.d.ts
CHANGED
|
@@ -8,11 +8,12 @@ declare class SocketClient {
|
|
|
8
8
|
private showLog;
|
|
9
9
|
private pingTimer?;
|
|
10
10
|
private appkey?;
|
|
11
|
+
private token?;
|
|
11
12
|
constructor(url: string, appkey: string, params?: Record<string, any>);
|
|
12
13
|
emit(event: string, payload?: SocketClientTypes.Message['data']['payload']): void;
|
|
13
14
|
on<T>(type: SocketClientTypes.EventType | string, handle: (data?: T) => void): void;
|
|
14
|
-
onConnected(handle: () => void): void;
|
|
15
|
-
onDisconnected(handle: () => void): void;
|
|
15
|
+
onConnected(handle: (data?: any) => void): void;
|
|
16
|
+
onDisconnected(handle: (data?: any) => void): void;
|
|
16
17
|
onError(handle: (data?: Error) => void): void;
|
|
17
18
|
private _onError;
|
|
18
19
|
private _onClose;
|
|
@@ -21,11 +22,12 @@ declare class SocketClient {
|
|
|
21
22
|
private ping;
|
|
22
23
|
removeAllListeners(): void;
|
|
23
24
|
removeListener(event: string, handle?: (data?: any) => void): void;
|
|
24
|
-
private
|
|
25
|
+
private _getToken;
|
|
25
26
|
open(url?: string, params?: Record<string, any>): void;
|
|
26
27
|
close(): void;
|
|
27
28
|
destroy(): void;
|
|
28
29
|
private log;
|
|
29
30
|
openLog(open: boolean): void;
|
|
31
|
+
getToken(): string | undefined;
|
|
30
32
|
}
|
|
31
33
|
export default SocketClient;
|
package/es/socket/index.js
CHANGED
|
@@ -29,6 +29,7 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
29
29
|
this.showLog = false;
|
|
30
30
|
this.pingTimer = void 0;
|
|
31
31
|
this.appkey = void 0;
|
|
32
|
+
this.token = void 0;
|
|
32
33
|
this.appkey = appkey;
|
|
33
34
|
this.url = url;
|
|
34
35
|
this.params = params;
|
|
@@ -122,7 +123,7 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
122
123
|
_this = this;
|
|
123
124
|
this.log('info', 'socket连接成功', event);
|
|
124
125
|
(_this$listeners$conne = this.listeners['connected']) === null || _this$listeners$conne === void 0 ? void 0 : _this$listeners$conne.forEach(function (handle) {
|
|
125
|
-
handle.call(undefined);
|
|
126
|
+
handle.call(undefined, _this.token);
|
|
126
127
|
});
|
|
127
128
|
this.log('info', 'clear catch', this.catch);
|
|
128
129
|
this.catch.forEach(function (_ref) {
|
|
@@ -137,7 +138,7 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
137
138
|
}, {
|
|
138
139
|
key: "onMessage",
|
|
139
140
|
value: function onMessage(event) {
|
|
140
|
-
var _this$listeners$Socke, _this$listeners$Socke2, _this$listeners$Socke3;
|
|
141
|
+
var _this$listeners$Socke, _this$listeners$Socke2, _this$listeners$Socke3, _this$listeners$unkno;
|
|
141
142
|
var res = JSON.parse(event.data);
|
|
142
143
|
if (res.code) {
|
|
143
144
|
switch (Number(res.code)) {
|
|
@@ -158,6 +159,10 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
158
159
|
break;
|
|
159
160
|
case SocketClientTypes.ResponseCode.paramError:
|
|
160
161
|
this._onError(new Error('参数缺失或错误'));
|
|
162
|
+
default:
|
|
163
|
+
(_this$listeners$unkno = this.listeners['unknownCode']) === null || _this$listeners$unkno === void 0 ? void 0 : _this$listeners$unkno.forEach(function (handle) {
|
|
164
|
+
handle.call(undefined, res);
|
|
165
|
+
});
|
|
161
166
|
}
|
|
162
167
|
} else if (res.type === SocketClientTypes.RequestType.pong) {
|
|
163
168
|
return;
|
|
@@ -191,7 +196,8 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
191
196
|
value: function removeListener(event, handle) {
|
|
192
197
|
var _this3 = this;
|
|
193
198
|
if (handle) {
|
|
194
|
-
|
|
199
|
+
var _this$listeners$event;
|
|
200
|
+
(_this$listeners$event = this.listeners[event]) === null || _this$listeners$event === void 0 ? void 0 : _this$listeners$event.forEach(function (item, i) {
|
|
195
201
|
if (item === handle) {
|
|
196
202
|
_this3.listeners[event].splice(i, 1);
|
|
197
203
|
}
|
|
@@ -201,9 +207,9 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
201
207
|
}
|
|
202
208
|
}
|
|
203
209
|
}, {
|
|
204
|
-
key: "
|
|
210
|
+
key: "_getToken",
|
|
205
211
|
value: function () {
|
|
206
|
-
var
|
|
212
|
+
var _getToken2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
207
213
|
var res;
|
|
208
214
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
209
215
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -224,21 +230,23 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
224
230
|
}
|
|
225
231
|
}, _callee, this);
|
|
226
232
|
}));
|
|
227
|
-
function
|
|
228
|
-
return
|
|
233
|
+
function _getToken() {
|
|
234
|
+
return _getToken2.apply(this, arguments);
|
|
229
235
|
}
|
|
230
|
-
return
|
|
236
|
+
return _getToken;
|
|
231
237
|
}()
|
|
232
238
|
}, {
|
|
233
239
|
key: "open",
|
|
234
240
|
value: function open(url, params) {
|
|
235
241
|
var _this4 = this;
|
|
236
|
-
this.
|
|
242
|
+
this._getToken().then(function (token) {
|
|
237
243
|
_this4.params = params || _this4.params;
|
|
244
|
+
_this4.token = token;
|
|
238
245
|
if (_this4.client) _this4.close();
|
|
239
246
|
var paramUrl = ["socketToken=".concat(token)];
|
|
240
247
|
if (_this4.params) {
|
|
241
|
-
|
|
248
|
+
var _Object$keys;
|
|
249
|
+
(_Object$keys = Object.keys(_this4.params || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (key) {
|
|
242
250
|
if (_.isObject(_this4.params[key]) || _.isArray(_this4.params[key])) {
|
|
243
251
|
paramUrl.push("".concat(key, "=").concat(JSON.stringify(_this4.params[key])));
|
|
244
252
|
} else {
|
|
@@ -285,6 +293,11 @@ var SocketClient = /*#__PURE__*/function () {
|
|
|
285
293
|
value: function openLog(open) {
|
|
286
294
|
this.showLog = open;
|
|
287
295
|
}
|
|
296
|
+
}, {
|
|
297
|
+
key: "getToken",
|
|
298
|
+
value: function getToken() {
|
|
299
|
+
return this.token;
|
|
300
|
+
}
|
|
288
301
|
}]);
|
|
289
302
|
return SocketClient;
|
|
290
303
|
}();
|
|
@@ -19,7 +19,7 @@ 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$paramsList;
|
|
22
|
+
var _condition$attrs$inde, _condition$attrs$inde2, _condition$paramsList;
|
|
23
23
|
var condition = props.condition,
|
|
24
24
|
index = props.index,
|
|
25
25
|
stringOperateList = props.stringOperateList,
|
|
@@ -37,7 +37,7 @@ var OperatorCondition = function OperatorCondition(props) {
|
|
|
37
37
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
38
38
|
searchValue = _useState6[0],
|
|
39
39
|
setSearchValue = _useState6[1];
|
|
40
|
-
var obj = (_condition$attrs$inde = condition.attrs[index]) === null || _condition$attrs$inde === void 0 ? void 0 : _condition$attrs$inde.params.map(function (item) {
|
|
40
|
+
var obj = (_condition$attrs$inde = condition.attrs[index]) === null || _condition$attrs$inde === void 0 ? void 0 : (_condition$attrs$inde2 = _condition$attrs$inde.params) === null || _condition$attrs$inde2 === void 0 ? void 0 : _condition$attrs$inde2.map(function (item) {
|
|
41
41
|
return {
|
|
42
42
|
name: item,
|
|
43
43
|
value: item
|
|
@@ -74,10 +74,11 @@ var OperatorCondition = function OperatorCondition(props) {
|
|
|
74
74
|
}
|
|
75
75
|
}).then(function (res) {
|
|
76
76
|
if (res.data) {
|
|
77
|
+
var _res$data;
|
|
77
78
|
var isString = function isString(val) {
|
|
78
79
|
return typeof val === 'string';
|
|
79
80
|
};
|
|
80
|
-
var list = res.data.map(function (item) {
|
|
81
|
+
var list = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
|
|
81
82
|
return {
|
|
82
83
|
name: !isString(item) ? JSON.stringify(item) : item,
|
|
83
84
|
value: !isString(item) ? JSON.stringify(item) : item
|
|
@@ -113,13 +114,13 @@ var OperatorCondition = function OperatorCondition(props) {
|
|
|
113
114
|
};
|
|
114
115
|
var onParamsChange = function onParamsChange(operate) {
|
|
115
116
|
if (operate.length > 0) {
|
|
116
|
-
var _obj = operate.map(function (item) {
|
|
117
|
+
var _obj = operate === null || operate === void 0 ? void 0 : operate.map(function (item) {
|
|
117
118
|
return {
|
|
118
119
|
name: item.name,
|
|
119
120
|
value: item.value
|
|
120
121
|
};
|
|
121
122
|
});
|
|
122
|
-
var params = operate.map(function (item) {
|
|
123
|
+
var params = operate === null || operate === void 0 ? void 0 : operate.map(function (item) {
|
|
123
124
|
return item.value;
|
|
124
125
|
});
|
|
125
126
|
if (!(condition === null || condition === void 0 ? void 0 : condition.typeId)) {
|
|
@@ -27,7 +27,7 @@ var ParamsCondition = function ParamsCondition(props) {
|
|
|
27
27
|
function onDateChange(newData) {
|
|
28
28
|
if (condition.attrs[index].operator === 'absolute') {
|
|
29
29
|
var dateRange = newData;
|
|
30
|
-
var newValues = dateRange.map(function (date) {
|
|
30
|
+
var newValues = dateRange === null || dateRange === void 0 ? void 0 : dateRange.map(function (date) {
|
|
31
31
|
return date.format('YYYY-MM-DD');
|
|
32
32
|
});
|
|
33
33
|
condition.attrs[index].params = newValues;
|
|
@@ -24,7 +24,7 @@ import BizGlobalDataContext from '../../context';
|
|
|
24
24
|
import RunPeriodCondition from './order/runPeriodCondition';
|
|
25
25
|
import Apis from '../../constants/apis';
|
|
26
26
|
var BusinessCondition = function BusinessCondition(props) {
|
|
27
|
-
var _condition$timeDimens, _condition$timeDimens3, _condition$timeDimens4, _condition$
|
|
27
|
+
var _condition$timeDimens, _condition$timeDimens3, _condition$attrs, _condition$timeDimens4, _condition$attrs2;
|
|
28
28
|
var condition = props.condition,
|
|
29
29
|
dataId = props.dataId,
|
|
30
30
|
label = props.label;
|
|
@@ -73,7 +73,8 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
73
73
|
method: 'get'
|
|
74
74
|
}).then(function (res) {
|
|
75
75
|
if (res.data) {
|
|
76
|
-
var
|
|
76
|
+
var _res$data;
|
|
77
|
+
var list = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
|
|
77
78
|
return {
|
|
78
79
|
name: item.typeName,
|
|
79
80
|
value: item.id
|
|
@@ -204,7 +205,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
204
205
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
205
206
|
type: "qingchu"
|
|
206
207
|
}))));
|
|
207
|
-
}), condition.attrs.map(function (_item, index) {
|
|
208
|
+
}), (_condition$attrs = condition.attrs) === null || _condition$attrs === void 0 ? void 0 : _condition$attrs.map(function (_item, index) {
|
|
208
209
|
return /*#__PURE__*/React.createElement("div", {
|
|
209
210
|
style: {
|
|
210
211
|
margin: '10px 0 0 65px'
|
|
@@ -231,7 +232,7 @@ var BusinessCondition = function BusinessCondition(props) {
|
|
|
231
232
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
232
233
|
type: "qingchu"
|
|
233
234
|
}))));
|
|
234
|
-
}), 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$
|
|
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", {
|
|
235
236
|
style: {
|
|
236
237
|
margin: '2px 0 0 65px',
|
|
237
238
|
color: '#4075fd',
|
|
@@ -77,11 +77,10 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
77
77
|
}
|
|
78
78
|
}).then(function (res) {
|
|
79
79
|
if (res.data) {
|
|
80
|
-
var
|
|
80
|
+
var _res$data;
|
|
81
|
+
var _list = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.map(function (item) {
|
|
81
82
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
82
|
-
|
|
83
|
-
value: item.id,
|
|
84
|
-
columnName: item.columnName
|
|
83
|
+
value: item.id
|
|
85
84
|
});
|
|
86
85
|
});
|
|
87
86
|
setMasterList(_list);
|
|
@@ -104,7 +103,8 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
104
103
|
}
|
|
105
104
|
}).then(function (res) {
|
|
106
105
|
if (res.data) {
|
|
107
|
-
var
|
|
106
|
+
var _res$data2;
|
|
107
|
+
var _list2 = (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.map(function (item) {
|
|
108
108
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
109
109
|
value: item.id
|
|
110
110
|
});
|
|
@@ -123,9 +123,11 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
123
123
|
}
|
|
124
124
|
var onOrderTypeListChange = function onOrderTypeListChange(operate) {
|
|
125
125
|
if (condition === null || condition === void 0 ? void 0 : condition.typeId) {
|
|
126
|
-
condition.attrs[index]
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
condition.attrs[index] = _objectSpread(_objectSpread({}, condition.attrs[index]), {}, {
|
|
127
|
+
category: 'custom',
|
|
128
|
+
attrId: operate.id,
|
|
129
|
+
attrName: operate.name
|
|
130
|
+
});
|
|
129
131
|
switch (operate.propType) {
|
|
130
132
|
case 1:
|
|
131
133
|
setMasterList(typeList['cont-string']);
|
|
@@ -153,6 +155,7 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
153
155
|
onChange(_objectSpread({}, condition));
|
|
154
156
|
};
|
|
155
157
|
var onMasterListChange = function onMasterListChange(operate) {
|
|
158
|
+
condition.attrs[index].params = [];
|
|
156
159
|
if (!(condition === null || condition === void 0 ? void 0 : condition.typeId)) {
|
|
157
160
|
switch (operate.propType) {
|
|
158
161
|
case 1:
|
|
@@ -177,22 +180,22 @@ var DataAttribute = function DataAttribute(props) {
|
|
|
177
180
|
}
|
|
178
181
|
break;
|
|
179
182
|
}
|
|
180
|
-
condition.attrs[index] = {
|
|
183
|
+
condition.attrs[index] = _objectSpread(_objectSpread({}, condition.attrs[index]), {}, {
|
|
181
184
|
attrId: operate.id,
|
|
182
185
|
computeType: 'origin',
|
|
183
186
|
attrName: operate.name,
|
|
184
187
|
attrMaping: operate.columnName,
|
|
185
188
|
operator: ''
|
|
186
|
-
};
|
|
189
|
+
});
|
|
187
190
|
} else {
|
|
188
191
|
switch (condition.attrs[index].attrType) {
|
|
189
192
|
case 'cont-string':
|
|
190
193
|
case 'cont-date':
|
|
191
|
-
condition.attrs[index] = {
|
|
194
|
+
condition.attrs[index] = _objectSpread(_objectSpread({}, condition.attrs[index]), {}, {
|
|
192
195
|
operator: operate.value,
|
|
193
196
|
computeType: 'origin',
|
|
194
197
|
params: []
|
|
195
|
-
};
|
|
198
|
+
});
|
|
196
199
|
if (condition.attrs[index].operator === 'absolute' && condition.attrs[index].attrType === 'cont-date') {
|
|
197
200
|
var _endDate = moment().format('YYYY-MM-DD');
|
|
198
201
|
var _startDate = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
package/es/utils/ajax.js
CHANGED
|
@@ -62,7 +62,6 @@ function responseErrorHandler(url, apiResult, errorTitle, notifyType) {
|
|
|
62
62
|
if (new RegExp("".concat(ResponseStatus.success, "$")).test(apiResult.code)) {
|
|
63
63
|
flag = true;
|
|
64
64
|
} else if (new RegExp("".concat(ResponseStatus.notLogin)).test(apiResult.code)) {
|
|
65
|
-
flag = true;
|
|
66
65
|
message = '账户未登录或登录已失效';
|
|
67
66
|
} else if (new RegExp("".concat(ResponseStatus.noPermission)).test(apiResult.code)) {
|
|
68
67
|
window.location.href = '/webapp/app/noPermission';
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
"name": "@zgfe/business-lib",
|
|
3
|
+
"version": "1.1.34-alpha.19",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"start": "dumi dev",
|
|
6
|
+
"docs:build": "dumi build",
|
|
7
|
+
"docs:deploy": "gh-pages -d docs-dist",
|
|
8
|
+
"build": "father-build",
|
|
9
|
+
"deploy": "npm run docs:build && npm run docs:deploy",
|
|
10
|
+
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
|
11
|
+
"test": "umi-test",
|
|
12
|
+
"test:coverage": "umi-test --coverage",
|
|
13
|
+
"prepublishOnly": "npm run build",
|
|
14
|
+
"pub": "lerna publish"
|
|
15
|
+
},
|
|
16
|
+
"module": "es/index.js",
|
|
17
|
+
"typings": "es/index.d.ts",
|
|
18
|
+
"gitHooks": {
|
|
19
|
+
"pre-commit": "lint-staged"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"es"
|
|
23
|
+
],
|
|
24
|
+
"lint-staged": {
|
|
25
|
+
"*.{js,jsx,less,md,json}": [
|
|
26
|
+
"prettier --write"
|
|
23
27
|
],
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"react": "^16.12.0 || ^17.0.0",
|
|
60
|
-
"yorkie": "^2.0.0"
|
|
61
|
-
},
|
|
62
|
-
"gitHead": "b2e287ebcfeaa841e1f4e10bd9891e58f3223e95"
|
|
28
|
+
"*.ts?(x)": [
|
|
29
|
+
"prettier --parser=typescript --write"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@types/js-cookie": "^3.0.2",
|
|
34
|
+
"@types/qs": "^6.9.7",
|
|
35
|
+
"axios": "^0.26.1",
|
|
36
|
+
"babel-plugin-import": "^1.13.3",
|
|
37
|
+
"echarts": "^5.3.2",
|
|
38
|
+
"echarts-for-react": "^3.0.2",
|
|
39
|
+
"js-cookie": "^3.0.1",
|
|
40
|
+
"lerna": "^4.0.0",
|
|
41
|
+
"rc-virtual-list": "^3.4.8",
|
|
42
|
+
"react-infinite-scroll-component": "^6.1.0",
|
|
43
|
+
"umi-request": "^1.4.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@testing-library/jest-dom": "^5.15.1",
|
|
47
|
+
"@testing-library/react": "^12.1.2",
|
|
48
|
+
"@types/jest": "^27.0.3",
|
|
49
|
+
"@types/lodash": "^4.14.182",
|
|
50
|
+
"@umijs/fabric": "^2.8.1",
|
|
51
|
+
"@umijs/test": "^3.0.5",
|
|
52
|
+
"antd": "^4.22.8",
|
|
53
|
+
"dumi": "^1.1.0",
|
|
54
|
+
"father-build": "^1.17.2",
|
|
55
|
+
"gh-pages": "^3.0.0",
|
|
56
|
+
"lint-staged": "^10.0.7",
|
|
57
|
+
"lodash": "^4.17.21",
|
|
58
|
+
"prettier": "^2.2.1",
|
|
59
|
+
"react": "^16.12.0 || ^17.0.0",
|
|
60
|
+
"yorkie": "^2.0.0"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "b2e287ebcfeaa841e1f4e10bd9891e58f3223e95"
|
|
63
63
|
}
|