@zgfe/modules-settings 1.2.20-role.2 → 1.2.20-role.20

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.
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { AppInfoProps } from '@zgfe/business-lib/es/context';
3
+ declare const SetDataRangeDialog: React.FC<{
4
+ currentSelectAppInfo: AppInfoProps;
5
+ onChangeCondition: (data: any[]) => void;
6
+ currentJson: any[];
7
+ }>;
8
+ export default SetDataRangeDialog;
@@ -0,0 +1,162 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useEffect, useState, useContext } from 'react';
14
+ import { Spin } from 'antd';
15
+ import { BizUserCondition, BizGlobalDataContext, ajax } from '@zgfe/business-lib';
16
+ import convertAttributeData from './util';
17
+ var SetDataRangeDialog = function SetDataRangeDialog(props) {
18
+ var currentSelectAppInfo = props.currentSelectAppInfo,
19
+ onChangeCondition = props.onChangeCondition,
20
+ currentJson = props.currentJson;
21
+ var _useContext = useContext(BizGlobalDataContext),
22
+ authority = _useContext.authority;
23
+ var _useState = useState([]),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ eventGroups = _useState2[0],
26
+ setEventGroups = _useState2[1];
27
+ var _useState3 = useState([]),
28
+ _useState4 = _slicedToArray(_useState3, 2),
29
+ userProps = _useState4[0],
30
+ setUserProps = _useState4[1];
31
+ var _useState5 = useState([]),
32
+ _useState6 = _slicedToArray(_useState5, 2),
33
+ envList = _useState6[0],
34
+ setEnvList = _useState6[1];
35
+ var _useState7 = useState(true),
36
+ _useState8 = _slicedToArray(_useState7, 2),
37
+ loadEvent = _useState8[0],
38
+ setLoadEvent = _useState8[1];
39
+ var _useState9 = useState(true),
40
+ _useState10 = _slicedToArray(_useState9, 2),
41
+ loadEnv = _useState10[0],
42
+ setLoadEnv = _useState10[1];
43
+ var _useState11 = useState(true),
44
+ _useState12 = _slicedToArray(_useState11, 2),
45
+ loadUsers = _useState12[0],
46
+ setLoadUsers = _useState12[1];
47
+ // const [tagsGroup, setTagsGroup] = useState<any>([]);
48
+ var _useState13 = useState({
49
+ eventGroupList: [],
50
+ userPropList: [],
51
+ eventEnvList: []
52
+ }),
53
+ _useState14 = _slicedToArray(_useState13, 2),
54
+ newStore = _useState14[0],
55
+ setStore = _useState14[1];
56
+ useEffect(function () {
57
+ // 请求下拉数据
58
+ initData();
59
+ }, [currentSelectAppInfo]);
60
+ var initData = function initData() {
61
+ loadUserProps(currentSelectAppInfo.app_id);
62
+ loadEvents(currentSelectAppInfo.app_id);
63
+ loadEnvList(currentSelectAppInfo.app_id);
64
+ // queryGroupTags(currentSelectAppInfo); //用户标签选项暂时隐藏
65
+ };
66
+
67
+ function loadUserProps(appId) {
68
+ setLoadUsers(true);
69
+ ajax('/zg/web/v2/appusergroup/getUserPropMeta', {
70
+ method: 'post',
71
+ data: {
72
+ appId: appId,
73
+ platform: 0
74
+ }
75
+ }).then(function (res) {
76
+ setUserProps(res.data);
77
+ setLoadUsers(false);
78
+ });
79
+ }
80
+ function loadEvents(appId) {
81
+ setLoadEvent(true);
82
+ ajax('/zg/web/v2/data/queryEventMetasOfGroup', {
83
+ method: 'post',
84
+ data: {
85
+ appId: appId,
86
+ platform: 0,
87
+ isAll: true
88
+ }
89
+ }).then(function (res) {
90
+ res.data.forEach(function (item1) {
91
+ item1.eventList.forEach(function (item2) {
92
+ item2.name = item2.event_name;
93
+ item2.alias = item2.event_name;
94
+ });
95
+ });
96
+ setEventGroups(res.data);
97
+ setLoadEvent(false);
98
+ });
99
+ }
100
+ function loadEnvList(appId) {
101
+ setLoadEnv(true);
102
+ ajax('/zg/web/v2/appusergroup/getEventEnvData', {
103
+ method: 'post',
104
+ data: {
105
+ appId: appId,
106
+ platform: 0
107
+ }
108
+ }).then(function (res) {
109
+ setEnvList(res.data.eventEnv);
110
+ setLoadEnv(false);
111
+ });
112
+ }
113
+ // function queryGroupTags(appInfo: AppInfoProps) {
114
+ // ajax('/zg/web/v2/v4/userGroup/label/list', {
115
+ // method: 'post',
116
+ // data: {
117
+ // appId: appInfo?.app_id,
118
+ // platform: appInfo?.platform || 0,
119
+ // },
120
+ // }).then((res: any) => {
121
+ // if (!res) return;
122
+ // setTagsGroup(res.data);
123
+ // });
124
+ // }
125
+ useEffect(function () {
126
+ if (loadEnv || loadEvent || loadUsers) return;
127
+ var newStore = convertAttributeData({
128
+ eventList: eventGroups,
129
+ userPropList: userProps,
130
+ envPropList: envList
131
+ });
132
+ setStore(newStore);
133
+ }, [loadEvent, loadEnv, loadUsers]);
134
+ return /*#__PURE__*/React.createElement("div", null, !loadEnv && !loadEvent && !loadUsers ? /*#__PURE__*/React.createElement(BizGlobalDataContext.Provider, {
135
+ value: {
136
+ eventGroupList: newStore.eventGroupList,
137
+ userPropList: newStore.userPropList,
138
+ eventEnvList: newStore.eventEnvList,
139
+ currentApp: _objectSpread({
140
+ appId: currentSelectAppInfo.app_id,
141
+ platform: 0
142
+ }, currentSelectAppInfo),
143
+ authority: authority
144
+ }
145
+ }, /*#__PURE__*/React.createElement(BizUserCondition, {
146
+ openCdpCondition: true,
147
+ openBusinessDataCondition: true,
148
+ openOrderDataCondition: true,
149
+ openTagCondition: false,
150
+ // userTagsData={tagsGroup}
151
+ defaultValue: currentJson,
152
+ onChange: onChangeCondition,
153
+ orConditionNum: 3,
154
+ andConditionNum: 8,
155
+ eventAttrNum: 3,
156
+ isRealTime: true,
157
+ key: currentSelectAppInfo.app_id
158
+ })) : /*#__PURE__*/React.createElement(Spin, {
159
+ tip: "\u57FA\u7840\u6570\u636E\u52A0\u8F7D\u4E2D"
160
+ }));
161
+ };
162
+ export default SetDataRangeDialog;
@@ -0,0 +1,344 @@
1
+ import { SizeType } from 'antd/es/config-provider/SizeContext';
2
+ import { ReactNode } from 'react';
3
+ /**
4
+ * 属性类型
5
+ */
6
+ export declare enum PropType {
7
+ STRING = 1,
8
+ NUMBER = 2,
9
+ DATE = 3
10
+ }
11
+ /**
12
+ * 属性类别
13
+ */
14
+ export declare enum PropCategory {
15
+ EventProp = "eventProp",
16
+ UserProp = "userProp",
17
+ EnvProp = "envProp",
18
+ SessionProp = "sessionProp"
19
+ }
20
+ export declare enum ShowStatus {
21
+ show = 0,
22
+ hidden = 1
23
+ }
24
+ /**
25
+ * 事件数据类型
26
+ */
27
+ export interface AnalysisEvent {
28
+ /**
29
+ * 事件id
30
+ */
31
+ id: number;
32
+ /**
33
+ * 事件id
34
+ */
35
+ event_id?: number;
36
+ /**
37
+ * 事件名称
38
+ */
39
+ name: string;
40
+ /**
41
+ * 事件名称
42
+ */
43
+ event_name?: string;
44
+ /**
45
+ * 事件别名
46
+ */
47
+ alias?: string;
48
+ /**
49
+ * 事件属性列表
50
+ */
51
+ attrList: Array<EventProp>;
52
+ /**
53
+ * 是否被删除
54
+ */
55
+ isDelete?: boolean;
56
+ /**
57
+ * 是否被停止采集
58
+ */
59
+ isStop?: boolean;
60
+ /**
61
+ * 是否是事件概览(true时代表,这不是一个真实事件数据)
62
+ */
63
+ isOverview?: boolean;
64
+ /**
65
+ * 事件显示状态
66
+ */
67
+ eventHidden?: ShowStatus;
68
+ /**
69
+ * 是否被收藏标记
70
+ */
71
+ marked?: boolean;
72
+ /**
73
+ * 是否是内置指标
74
+ */
75
+ isBuiltIn?: boolean;
76
+ /**
77
+ * 指标类型, 默认是event
78
+ */
79
+ type?: string;
80
+ /**
81
+ * 是否埋点分析(页面判断使用)
82
+ */
83
+ clickAnalysis?: boolean;
84
+ /**
85
+ * 所有权
86
+ */
87
+ owner?: string;
88
+ }
89
+ /**
90
+ * 事件分组
91
+ */
92
+ export interface EventGroup {
93
+ /**
94
+ * 分组id
95
+ */
96
+ id: number;
97
+ /**
98
+ * 分组名称
99
+ */
100
+ name?: string;
101
+ /**
102
+ * 事件列表
103
+ */
104
+ eventList: AnalysisEvent[];
105
+ }
106
+ /**
107
+ * 通用属性信息
108
+ */
109
+ export interface BasicProp {
110
+ /**
111
+ * 属性id
112
+ */
113
+ id?: number;
114
+ /**
115
+ * 属性展示名称
116
+ */
117
+ label?: string;
118
+ /**
119
+ * 属性别名
120
+ */
121
+ alias?: string;
122
+ /**
123
+ * 属性类型
124
+ */
125
+ type?: PropType;
126
+ /**
127
+ * 是否实时
128
+ */
129
+ realTime?: boolean;
130
+ /**
131
+ * 类别
132
+ */
133
+ dimensionSub?: string;
134
+ /**
135
+ * 是否展示
136
+ */
137
+ isHidden?: boolean;
138
+ /**
139
+ * 属性类别:fixed(内置属性),custom(自定义属性)
140
+ */
141
+ category?: 'fixed' | 'custom';
142
+ }
143
+ /**
144
+ * 用户属性
145
+ */
146
+ export interface UserProp extends BasicProp {
147
+ /**
148
+ * 属性标识名称(可用于做属性唯一标识)
149
+ */
150
+ name?: string;
151
+ /**
152
+ * 属性类别
153
+ */
154
+ propCategory: 'userProp';
155
+ /**
156
+ * 用户属性唯一标识,取值为:userProp-name
157
+ */
158
+ key?: string;
159
+ subtype?: number;
160
+ }
161
+ /**
162
+ * 触发环境属性
163
+ */
164
+ export interface EnvProp extends BasicProp {
165
+ /**
166
+ * 属性类别
167
+ */
168
+ propCategory: 'envProp';
169
+ /**
170
+ * 属性标识名称(可用于做属性唯一标识)
171
+ */
172
+ name?: string;
173
+ /**
174
+ * 环境属性唯一标识,取值为:envProp-name
175
+ */
176
+ key?: string;
177
+ }
178
+ /**
179
+ * 事件属性
180
+ */
181
+ export interface EventProp extends BasicProp {
182
+ /**
183
+ * 所属事件id
184
+ */
185
+ eventId?: number;
186
+ /**
187
+ * 属性类别
188
+ */
189
+ propCategory: 'eventProp';
190
+ /**
191
+ * 事件属性唯一标识,取值为:eventProp-id
192
+ */
193
+ key?: number | string;
194
+ /**
195
+ * 所属步骤下标(漏斗场景下有)
196
+ */
197
+ step?: number;
198
+ }
199
+ /**
200
+ * 属性组,包含事件属性、用户属性、事件触发环境列表
201
+ */
202
+ export interface PropGroups {
203
+ eventGroupList?: EventGroup[];
204
+ userPropList?: UserProp[];
205
+ envPropList?: EnvProp[];
206
+ eventNameMap?: Record<string, AnalysisEvent>;
207
+ eventIdMap?: Record<number, AnalysisEvent>;
208
+ }
209
+ export declare namespace AttributeSelect {
210
+ /**
211
+ * 属性下拉值
212
+ */
213
+ type Value = EventProp | UserProp | EnvProp | ExtraProp | null;
214
+ /**
215
+ * 属性下拉props
216
+ */
217
+ interface Props {
218
+ /**
219
+ * @description 组件唯一id,不用主动传,组件自动生成,请忽略!!!
220
+ */
221
+ id?: string;
222
+ /**
223
+ * @description 若组件是表单选项,value就是form的initialValues,也是组件的默认选项
224
+ * @default -
225
+ */
226
+ value?: Value;
227
+ /**
228
+ * @description 默认值
229
+ */
230
+ defaultValue?: Value;
231
+ /**
232
+ * @description 禁用选项列表
233
+ */
234
+ disableItemList?: (EventProp | UserProp | EnvProp | ExtraProp)[];
235
+ /**
236
+ * @description 删除按钮是否可用
237
+ * @default false
238
+ */
239
+ enableDelete?: boolean;
240
+ /**
241
+ * @description 默认提示文本
242
+ * @default 请选择
243
+ */
244
+ placeholder?: string;
245
+ /**
246
+ * @description 是否启用事件属性,启用后,eventIdList为必传
247
+ * @default false
248
+ */
249
+ enableEventProp?: boolean;
250
+ /**
251
+ * @description 是否启用用户属性
252
+ * @default true
253
+ */
254
+ enableUserProp?: boolean;
255
+ /**
256
+ * @description 是否启用事件触发环境属性
257
+ */
258
+ enableEnvProp?: boolean;
259
+ /**
260
+ * @description 支持的事件列表,当enableEventProp为true时有效
261
+ */
262
+ eventIdList?: number[];
263
+ /**
264
+ * @description 支持的漏斗事件列表,当enableEventProp为true时有效,eventIdList和funnelEventIdList只能传一个,通过该属性传递的事件属性,选中时会回传所属步骤
265
+ */
266
+ funnelEventIdList?: number[][];
267
+ /**
268
+ * @description 是否显示通用属性(展示通用属性后,单独事件分组将隐藏)
269
+ */
270
+ showCommonProp?: boolean;
271
+ /**
272
+ * @description 非实时后缀图标名称(iconfont)
273
+ * @default *
274
+ */
275
+ propSymbol?: ReactNode;
276
+ /**
277
+ * @description 属性下拉提示
278
+ * @default 带*的属性每日凌晨更新
279
+ */
280
+ optionsHeaderTip?: string;
281
+ /**
282
+ * @description onChange
283
+ */
284
+ onChange?: (value: Value) => void;
285
+ /**
286
+ * @description 删除事件监听
287
+ */
288
+ onDelete?: (value?: Value, e?: any) => void;
289
+ /**
290
+ * 主题
291
+ */
292
+ theme?: string;
293
+ /**
294
+ * @description 关闭后是否销毁下拉
295
+ * @default false
296
+ */
297
+ destroyPopupOnHide?: boolean;
298
+ /**
299
+ * @description 文本框大小 ,40px | 32px | 24px
300
+ * @default middle
301
+ */
302
+ size?: SizeType;
303
+ /**
304
+ * 状态
305
+ */
306
+ status?: string;
307
+ /**
308
+ * 自定义属性类型
309
+ */
310
+ extra?: AttributeExtra[];
311
+ /**
312
+ * 数字类型
313
+ */
314
+ isNumber?: Boolean;
315
+ }
316
+ interface AttributeExtra {
317
+ type: string;
318
+ name: string;
319
+ attrList: ExtraProp[];
320
+ }
321
+ interface ExtraProp extends BasicProp {
322
+ /**
323
+ * 属性类别
324
+ */
325
+ propCategory: string;
326
+ /**
327
+ * 事件属性唯一标识,取值为:propCategory-id||name
328
+ */
329
+ key?: number | string;
330
+ name?: string;
331
+ subtype?: number;
332
+ [key: string]: any;
333
+ }
334
+ /**
335
+ * 下拉选项
336
+ */
337
+ interface Option {
338
+ groupName: string;
339
+ isEvent: boolean;
340
+ key: string;
341
+ anchor: string;
342
+ children: Value[];
343
+ }
344
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 属性类型
3
+ */
4
+ export var PropType;
5
+ (function (PropType) {
6
+ PropType[PropType["STRING"] = 1] = "STRING";
7
+ PropType[PropType["NUMBER"] = 2] = "NUMBER";
8
+ PropType[PropType["DATE"] = 3] = "DATE";
9
+ })(PropType || (PropType = {}));
10
+ /**
11
+ * 属性类别
12
+ */
13
+ export var PropCategory;
14
+ (function (PropCategory) {
15
+ PropCategory["EventProp"] = "eventProp";
16
+ PropCategory["UserProp"] = "userProp";
17
+ PropCategory["EnvProp"] = "envProp";
18
+ PropCategory["SessionProp"] = "sessionProp";
19
+ })(PropCategory || (PropCategory = {}));
20
+ export var ShowStatus;
21
+ (function (ShowStatus) {
22
+ ShowStatus[ShowStatus["show"] = 0] = "show";
23
+ ShowStatus[ShowStatus["hidden"] = 1] = "hidden";
24
+ })(ShowStatus || (ShowStatus = {}));
@@ -0,0 +1,13 @@
1
+ import { OldSystem } from '@zgfe/business-lib/es/utils/type';
2
+ import { PropGroups } from './types';
3
+ /**
4
+ * 老系统(vue)基础数据转化程序
5
+ * @param store
6
+ * @returns PropGropus
7
+ */
8
+ export default function convertAttributeData(store: {
9
+ envPropList?: OldSystem.EnvProp[];
10
+ userPropList?: OldSystem.UserProp[];
11
+ eventList?: OldSystem.EventGroup[];
12
+ }): PropGroups;
13
+ export declare function getIcon(name: string): string;
@@ -0,0 +1,158 @@
1
+ /**
2
+ * 老系统(vue)基础数据转化程序
3
+ * @param store
4
+ * @returns PropGropus
5
+ */
6
+ export default function convertAttributeData(store) {
7
+ var _store$eventList, _store$envPropList, _store$userPropList;
8
+ var res = {
9
+ envPropList: [],
10
+ eventGroupList: [],
11
+ userPropList: [],
12
+ eventNameMap: {},
13
+ eventIdMap: {}
14
+ };
15
+ (_store$eventList = store.eventList) === null || _store$eventList === void 0 ? void 0 : _store$eventList.forEach(function (group_) {
16
+ var _res$eventGroupList;
17
+ var group = {
18
+ id: group_.groupId,
19
+ name: group_.groupName,
20
+ eventList: []
21
+ };
22
+ var list = [];
23
+ var markList = [];
24
+ group_.eventList.forEach(function (e) {
25
+ if (e.is_delete) return;
26
+ var event = {
27
+ alias: e.alias_name,
28
+ attrList: e.event_attrs.map(function (item) {
29
+ return {
30
+ alias: item.alias_name,
31
+ eventId: e.event_id,
32
+ id: item.attr_id,
33
+ isHidden: item.hidden,
34
+ key: "eventProp-".concat(item.attr_id),
35
+ label: item.attr_name,
36
+ propCategory: 'eventProp',
37
+ type: item.prop_type,
38
+ realTime: true,
39
+ dimensionSub: item.dimension_sub || 'event_attr'
40
+ };
41
+ }),
42
+ id: e.event_id,
43
+ isDelete: e.is_delete,
44
+ isStop: e.is_stop,
45
+ name: e.event_name,
46
+ eventHidden: e.event_hidden,
47
+ marked: Boolean(e.mark_type),
48
+ clickAnalysis: e.click_analysis,
49
+ owner: e.owner
50
+ };
51
+ res.eventNameMap[event.name] = event;
52
+ res.eventIdMap[event.id] = event;
53
+ if (event.marked) {
54
+ markList.push(event);
55
+ } else {
56
+ list.push(event);
57
+ }
58
+ });
59
+ group.eventList = [].concat(markList, list);
60
+ (_res$eventGroupList = res.eventGroupList) === null || _res$eventGroupList === void 0 ? void 0 : _res$eventGroupList.push(group);
61
+ });
62
+ res.envPropList = (_store$envPropList = store.envPropList) === null || _store$envPropList === void 0 ? void 0 : _store$envPropList.map(function (prop) {
63
+ return {
64
+ id: prop.id || 0,
65
+ isHidden: prop.hidden,
66
+ alias: prop.alias_name,
67
+ category: prop.category,
68
+ key: "envProp-".concat(prop.name),
69
+ label: prop.text,
70
+ name: prop.name,
71
+ propCategory: 'envProp',
72
+ type: prop.type,
73
+ realTime: true,
74
+ dimensionSub: prop.dimension_sub || prop.name
75
+ };
76
+ });
77
+ res.userPropList = (_store$userPropList = store.userPropList) === null || _store$userPropList === void 0 ? void 0 : _store$userPropList.map(function (prop) {
78
+ return {
79
+ id: prop.id || 0,
80
+ isHidden: prop.hidden,
81
+ alias: prop.alias_name,
82
+ category: prop.category,
83
+ key: "userProp-".concat(prop.name),
84
+ label: prop.text || prop.name,
85
+ name: prop.name,
86
+ propCategory: 'userProp',
87
+ type: prop.type,
88
+ subtype: prop.subtype,
89
+ realTime: prop.category === 'custom',
90
+ dimensionSub: prop.dimension_sub || prop.name
91
+ };
92
+ });
93
+ return res;
94
+ }
95
+ export function getIcon(name) {
96
+ var hash = {
97
+ // 环境属性
98
+ browser_brand: 'internet',
99
+ browser_version: 'internet',
100
+ website: 'web',
101
+ referer_url: 'web',
102
+ current_url: 'web',
103
+ country: 'region',
104
+ area: 'region',
105
+ city: 'region',
106
+ os: 'platform',
107
+ ov: 'platform',
108
+ resolution_h: 'platform',
109
+ resolution_l: 'platform',
110
+ first_referer_url: 'web',
111
+ ip: 'web',
112
+ utm_source: 'utm',
113
+ utm_medium: 'utm',
114
+ utm_campaign: 'utm',
115
+ utm_content: 'utm',
116
+ utm_term: 'utm',
117
+ version: 'overall',
118
+ channel: 'overall',
119
+ network: 'platform',
120
+ mccmnc: 'platform',
121
+ device_brand: 'overall',
122
+ device_model: 'overall',
123
+ event_duration: 'time',
124
+ // 用户属性
125
+ first_visit_time: 'time',
126
+ last_visit_time: 'time',
127
+ visit_times: 'time',
128
+ duration: 'time',
129
+ name: 'personal',
130
+ app_user_id: 'personal',
131
+ zg_id: 'personal',
132
+ is_anonymous: 'type',
133
+ current_country: 'region',
134
+ current_area: 'region',
135
+ current_city: 'region',
136
+ current_app_version: 'overall',
137
+ current_app_channel: 'overall',
138
+ first_version: 'overall',
139
+ first_channel: 'overall',
140
+ current_device_brand: 'overall',
141
+ current_device_model: 'overall',
142
+ current_mccmnc: 'platform',
143
+ user_referer_url: 'web',
144
+ first_website: 'web',
145
+ first_utm_source: 'utm',
146
+ first_utm_medium: 'utm',
147
+ first_utm_campaign: 'utm',
148
+ first_utm_content: 'utm',
149
+ first_utm_term: 'utm',
150
+ current_browser_brand: 'internet',
151
+ current_browser_version: 'internet',
152
+ current_os: 'platform',
153
+ current_ov: 'platform',
154
+ current_resolution_h: 'platform',
155
+ current_resolution_l: 'platform'
156
+ };
157
+ return hash[name] ? 'icon-' + hash[name] : '';
158
+ }
@@ -60,6 +60,9 @@ declare let apis: {
60
60
  updateCompanyUser: string;
61
61
  delCompanyUser: string;
62
62
  updateCompanyUserStatus: string;
63
+ queryEventEnvData: string;
64
+ qeuryUserPropMeta: string;
65
+ queryEventMetasOfGroup: string;
63
66
  };
64
67
  eventMeta: {
65
68
  queryEventMeta: string;
@@ -68,9 +68,12 @@ var apis = {
68
68
  getPasswordRule: '/zg/web/v2/system/getPasswordRule',
69
69
  updateCompanyUser: '/zg/web/v2/company/setting/updateCompanyUser',
70
70
  delCompanyUser: '/zg/web/v2/company/setting/delCompanyUser',
71
- updateCompanyUserStatus: '/zg/web/v2/company/setting/updateCompanyUserStatus' // 修改状态
71
+ updateCompanyUserStatus: '/zg/web/v2/company/setting/updateCompanyUserStatus',
72
+ // 基础数据
73
+ queryEventEnvData: '/zg/web/v2/appusergroup/getEventEnvData',
74
+ qeuryUserPropMeta: '/zg/web/v2/appusergroup/getUserPropMeta',
75
+ queryEventMetasOfGroup: '/zg/web/v2/data/queryEventMetasOfGroup'
72
76
  },
73
-
74
77
  eventMeta: {
75
78
  queryEventMeta: '/zg/web/v2/data/queryEventMetasOfGroup'
76
79
  },
@@ -113,20 +113,36 @@ var RoleList = function RoleList(props) {
113
113
  setSelectArr = _useState36[1];
114
114
  var _useState37 = useState([]),
115
115
  _useState38 = _slicedToArray(_useState37, 2),
116
- appList = _useState38[0],
117
- setAppList = _useState38[1];
118
- var _useState39 = useState(false),
116
+ selectAppId = _useState38[0],
117
+ setSelectAppId = _useState38[1];
118
+ var _useState39 = useState([]),
119
119
  _useState40 = _slicedToArray(_useState39, 2),
120
- isModalOpen = _useState40[0],
121
- setIsModalOpen = _useState40[1];
122
- var _useState41 = useState(''),
120
+ appList = _useState40[0],
121
+ setAppList = _useState40[1];
122
+ var _useState41 = useState(false),
123
123
  _useState42 = _slicedToArray(_useState41, 2),
124
- dataRangeDialogTitle = _useState42[0],
125
- setDataRangeDialogTitle = _useState42[1];
126
- var _useState43 = useState(0),
124
+ isModalOpen = _useState42[0],
125
+ setIsModalOpen = _useState42[1];
126
+ var _useState43 = useState(''),
127
127
  _useState44 = _slicedToArray(_useState43, 2),
128
- currentAppId = _useState44[0],
129
- setCurrentAppId = _useState44[1];
128
+ dataRangeDialogTitle = _useState44[0],
129
+ setDataRangeDialogTitle = _useState44[1];
130
+ var _useState45 = useState({}),
131
+ _useState46 = _slicedToArray(_useState45, 2),
132
+ currentSelectAppInfo = _useState46[0],
133
+ setCurrentSelectAppInfo = _useState46[1];
134
+ var _useState47 = useState([]),
135
+ _useState48 = _slicedToArray(_useState47, 2),
136
+ appCondition = _useState48[0],
137
+ setAPPCondition = _useState48[1];
138
+ var _useState49 = useState(0),
139
+ _useState50 = _slicedToArray(_useState49, 2),
140
+ isRoleAuthStatus = _useState50[0],
141
+ setIsRoleAuthStatus = _useState50[1];
142
+ var _useState51 = useState([]),
143
+ _useState52 = _slicedToArray(_useState51, 2),
144
+ currentJson = _useState52[0],
145
+ setCurrentJson = _useState52[1];
130
146
  var _Form$useForm = Form.useForm(),
131
147
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
132
148
  form = _Form$useForm2[0];
@@ -163,10 +179,6 @@ var RoleList = function RoleList(props) {
163
179
  if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map2 = menuCodeMap.map2) === null || _menuCodeMap$map2 === void 0 ? void 0 : _menuCodeMap$map2.length) === 0) {
164
180
  setAppVersionFlTest('请选择城商行功能权限');
165
181
  return;
166
- } else {
167
- form.setFieldsValue({
168
- menuCodeMap: menuCodeMap.map2
169
- });
170
182
  }
171
183
  if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map3 = menuCodeMap.map3) === null || _menuCodeMap$map3 === void 0 ? void 0 : _menuCodeMap$map3.length) === 0) {
172
184
  setAppVersionFlTest('请选择证券版本功能权限');
@@ -212,10 +224,6 @@ var RoleList = function RoleList(props) {
212
224
  if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map8 = menuCodeMap.map2) === null || _menuCodeMap$map8 === void 0 ? void 0 : _menuCodeMap$map8.length) === 0) {
213
225
  setAppVersionFlTest('请选择城商行功能权限');
214
226
  return;
215
- } else {
216
- form.setFieldsValue({
217
- menuCodeMap: menuCodeMap.map2
218
- });
219
227
  }
220
228
  if ((menuCodeMap === null || menuCodeMap === void 0 ? void 0 : (_menuCodeMap$map9 = menuCodeMap.map3) === null || _menuCodeMap$map9 === void 0 ? void 0 : _menuCodeMap$map9.length) === 0) {
221
229
  setAppVersionFlTest('请选择证券版功能权限');
@@ -310,7 +318,6 @@ var RoleList = function RoleList(props) {
310
318
  }).then(function (res) {
311
319
  if (res && (res === null || res === void 0 ? void 0 : res.data) && res.code === '101000') {
312
320
  var _res$data, _res$data$list, _res$data2;
313
- // const app = util.convertData(res?.data as DepartmentItem[], name);
314
321
  setLoading(false);
315
322
  var arr = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$list = _res$data.list) === null || _res$data$list === void 0 ? void 0 : _res$data$list.map(function (item) {
316
323
  var _item$userSimpleInfos;
@@ -336,7 +343,7 @@ var RoleList = function RoleList(props) {
336
343
  var queryRoleDetailsList = function queryRoleDetailsList(params) {
337
344
  queryRoleDetails(params).then(function (res) {
338
345
  if (res === null || res === void 0 ? void 0 : res.data) {
339
- var _res$data5, _res$data6, _res$data7;
346
+ var _res$data5, _res$data6, _res$data8;
340
347
  var usListArr = usList === null || usList === void 0 ? void 0 : usList.filter(function (item1) {
341
348
  var _res$data3;
342
349
  return res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.appIds.some(function (item2) {
@@ -350,7 +357,18 @@ var RoleList = function RoleList(props) {
350
357
  });
351
358
  });
352
359
  onChangeAppIds(usListArr, params === null || params === void 0 ? void 0 : params.id, res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.menuCodeMap, res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.settingMenuList);
353
- var _menuCodeMap = res.data.menuCodeMap;
360
+ var _res$data7 = res.data,
361
+ _menuCodeMap = _res$data7.menuCodeMap,
362
+ authGroupList = _res$data7.authGroupList;
363
+ authGroupList === null || authGroupList === void 0 ? void 0 : authGroupList.forEach(function (item) {
364
+ item.data = JSON.stringify({
365
+ color: item.color || '#8db3e2',
366
+ name: item.name || '0',
367
+ groupType: item.groupType || 0,
368
+ json: JSON.parse(item.json)
369
+ });
370
+ });
371
+ if (authGroupList === null || authGroupList === void 0 ? void 0 : authGroupList.length) setAPPCondition(authGroupList);
354
372
  form.setFieldsValue(_objectSpread(_objectSpread({}, res === null || res === void 0 ? void 0 : res.data), {}, {
355
373
  appIds: usListArr === null || usListArr === void 0 ? void 0 : usListArr.map(function (item) {
356
374
  return {
@@ -366,7 +384,7 @@ var RoleList = function RoleList(props) {
366
384
  };
367
385
  })
368
386
  }));
369
- setAppList((res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.appIds) || []);
387
+ setAppList((res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.appIds) || []);
370
388
  setCreatedAppPanel(true);
371
389
  }
372
390
  }).catch(function (err) {
@@ -444,6 +462,7 @@ var RoleList = function RoleList(props) {
444
462
  });
445
463
  };
446
464
  var onChangeAppIds = function onChangeAppIds(e, roleId, codeMap, settingMenuList) {
465
+ handleDelAppJson(e); // 删除应用的同时删除赋值的数据范围条件
447
466
  setAppVersionFl(false);
448
467
  var arr = e.map(function (item) {
449
468
  return item.appVersion;
@@ -638,6 +657,40 @@ var RoleList = function RoleList(props) {
638
657
  }
639
658
  }
640
659
  };
660
+ function handleDelAppJson(e) {
661
+ // 删除应用的同时删除赋值的数据范围条件
662
+ var appIdsList = e.map(function (item) {
663
+ return item === null || item === void 0 ? void 0 : item.id;
664
+ });
665
+ setSelectAppId(appIdsList);
666
+ var delAppId = filterData(selectAppId, appIdsList);
667
+ var newAppCondition = appCondition;
668
+ var indexToRemove = newAppCondition === null || newAppCondition === void 0 ? void 0 : newAppCondition.findIndex(function (item) {
669
+ return item.appId === delAppId[0];
670
+ });
671
+ if (indexToRemove !== -1) {
672
+ newAppCondition.splice(indexToRemove, 1);
673
+ }
674
+ setAPPCondition(newAppCondition);
675
+ }
676
+ function filterData(array, array2) {
677
+ var result = [];
678
+ for (var key in array) {
679
+ var stra = array[key];
680
+ var count = 0;
681
+ for (var j = 0; j < array2.length; j++) {
682
+ var strb = array2[j];
683
+ if (stra == strb) {
684
+ count++;
685
+ }
686
+ }
687
+ if (count === 0) {
688
+ //表示数组1的这个值没有重复的,放到arr3列表中
689
+ result.push(stra);
690
+ }
691
+ }
692
+ return result;
693
+ }
641
694
  var onSystemVersion = function onSystemVersion(e, roleId) {
642
695
  setSystemVersionId(e.id);
643
696
  queryRoleMenuTreeList(roleId, e.id);
@@ -667,7 +720,9 @@ var RoleList = function RoleList(props) {
667
720
  systemVersion: appVersionFl ? 0 : 1,
668
721
  userIds: value === null || value === void 0 ? void 0 : (_value$userIds = value.userIds) === null || _value$userIds === void 0 ? void 0 : _value$userIds.map(function (item) {
669
722
  return item === null || item === void 0 ? void 0 : item.id;
670
- })
723
+ }),
724
+ roleAuthStatus: isRoleAuthStatus,
725
+ authInfoParams: appCondition || []
671
726
  });
672
727
  if (menuCodeMap.map2.length && menuCodeMap.map3.length && !menuCodeMap.map1.length) {
673
728
  var _params$menuCodeMap;
@@ -694,6 +749,8 @@ var RoleList = function RoleList(props) {
694
749
  settingList2: [],
695
750
  settingList3: []
696
751
  });
752
+ setAppList([]);
753
+ setAPPCondition([]);
697
754
  // 通知数据刷新
698
755
  msg = !roleId ? '创建成功' : '编辑成功';
699
756
  notification.success({
@@ -712,9 +769,20 @@ var RoleList = function RoleList(props) {
712
769
  className: "custom-item"
713
770
  }, node, !appList.includes(option.app_id) ? null : /*#__PURE__*/React.createElement("div", {
714
771
  onClick: function onClick(e) {
715
- setCurrentAppId(option.app_id);
772
+ setCurrentSelectAppInfo(option);
716
773
  setDataRangeDialogTitle(node);
717
774
  setIsModalOpen(true);
775
+ var currentJson = appCondition.filter(function (item) {
776
+ return item.appId === option.app_id;
777
+ });
778
+ if (currentJson.length) {
779
+ var _currentJson$;
780
+ setCurrentJson(currentJson[0].data ? JSON.parse((_currentJson$ = currentJson[0]) === null || _currentJson$ === void 0 ? void 0 : _currentJson$.data).json : JSON.parse(currentJson[0].json));
781
+ setIsRoleAuthStatus(1);
782
+ } else {
783
+ setCurrentJson([]);
784
+ setIsRoleAuthStatus(0);
785
+ }
718
786
  e.stopPropagation();
719
787
  },
720
788
  className: "custom-item-right"
@@ -738,6 +806,28 @@ var RoleList = function RoleList(props) {
738
806
  className: "bsicon tishi"
739
807
  }))));
740
808
  }
809
+ function setConditionFn(appId, condition) {
810
+ var authInfoParam = {
811
+ appId: appId,
812
+ platform: 0,
813
+ data: JSON.stringify({
814
+ color: '#8db3e2',
815
+ name: 0,
816
+ groupType: 0,
817
+ json: condition
818
+ })
819
+ };
820
+ var newAppCondition = appCondition;
821
+ var indexToRemove = newAppCondition === null || newAppCondition === void 0 ? void 0 : newAppCondition.findIndex(function (item) {
822
+ return item.appId === appId;
823
+ });
824
+ if (indexToRemove !== -1) {
825
+ newAppCondition.splice(indexToRemove, 1, authInfoParam);
826
+ } else {
827
+ newAppCondition.push(authInfoParam);
828
+ }
829
+ setAPPCondition(newAppCondition);
830
+ }
741
831
  return /*#__PURE__*/React.createElement(Spin, {
742
832
  spinning: loading
743
833
  }, /*#__PURE__*/React.createElement("div", {
@@ -812,6 +902,7 @@ var RoleList = function RoleList(props) {
812
902
  settingList3: []
813
903
  });
814
904
  setSystemVersionId(1);
905
+ setAPPCondition([]);
815
906
  },
816
907
  footer: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
817
908
  onClick: function onClick() {
@@ -825,6 +916,7 @@ var RoleList = function RoleList(props) {
825
916
  settingList2: [],
826
917
  settingList3: []
827
918
  });
919
+ setAPPCondition([]);
828
920
  }
829
921
  }, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
830
922
  loading: createAppLoading,
@@ -975,7 +1067,12 @@ var RoleList = function RoleList(props) {
975
1067
  isModalOpen: isModalOpen,
976
1068
  setIsModalOpen: setIsModalOpen,
977
1069
  dataRangeDialogTitle: dataRangeDialogTitle,
978
- currentAppId: currentAppId
1070
+ currentSelectAppInfo: currentSelectAppInfo,
1071
+ setConditionFn: setConditionFn,
1072
+ isRoleAuthStatus: isRoleAuthStatus,
1073
+ setIsRoleAuthStatus: setIsRoleAuthStatus,
1074
+ currentJson: currentJson,
1075
+ setCurrentJson: setCurrentJson
979
1076
  }), /*#__PURE__*/React.createElement("div", {
980
1077
  className: "role-list-content"
981
1078
  }, /*#__PURE__*/React.createElement(Table, {
@@ -1,9 +1,15 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import './index.less';
3
+ import { AppInfoProps } from '@zgfe/business-lib/es/context';
3
4
  declare const SetDataRangeDialog: React.FC<{
4
5
  isModalOpen: boolean;
5
6
  setIsModalOpen: Function;
6
7
  dataRangeDialogTitle: ReactNode;
7
- currentAppId: number;
8
+ currentSelectAppInfo: AppInfoProps;
9
+ setConditionFn: Function;
10
+ currentJson: any[];
11
+ setCurrentJson: Function;
12
+ isRoleAuthStatus: number;
13
+ setIsRoleAuthStatus: Function;
8
14
  }>;
9
15
  export default SetDataRangeDialog;
@@ -1,33 +1,29 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useState } from 'react';
8
- import { Radio } from 'antd';
9
- import { BizDialog, DemoWrapper, BizUserCondition } from '@zgfe/business-lib';
1
+ import React from 'react';
2
+ import { Radio, message } from 'antd';
3
+ import { BizDialog } from '@zgfe/business-lib';
10
4
  import './index.less';
5
+ import util from '../../../../utils/util';
6
+ import SelectAppWrapper from '../../../../components/selectAppWrapper';
11
7
  var SetDataRangeDialog = function SetDataRangeDialog(props) {
12
- // authInfoParam: {
13
- // platform: 0,
14
- // data: JSON.stringify({ color: '#8db3e2', name: 0, groupType: 0, json: condition }),
15
- // },
16
8
  var isModalOpen = props.isModalOpen,
17
9
  setIsModalOpen = props.setIsModalOpen,
18
10
  dataRangeDialogTitle = props.dataRangeDialogTitle,
19
- currentAppId = props.currentAppId;
20
- var _useState = useState(0),
21
- _useState2 = _slicedToArray(_useState, 2),
22
- isRoleAuthStatus = _useState2[0],
23
- setIsRoleAuthStatus = _useState2[1];
24
- var _useState3 = useState([]),
25
- _useState4 = _slicedToArray(_useState3, 2),
26
- condition = _useState4[0],
27
- setCondition = _useState4[1];
28
- function onChangeCondition(condition) {
29
- console.log('condition', condition);
30
- setCondition(condition);
11
+ currentSelectAppInfo = props.currentSelectAppInfo,
12
+ setConditionFn = props.setConditionFn,
13
+ currentJson = props.currentJson,
14
+ setCurrentJson = props.setCurrentJson,
15
+ isRoleAuthStatus = props.isRoleAuthStatus,
16
+ setIsRoleAuthStatus = props.setIsRoleAuthStatus;
17
+ function onChangeCondition(data) {
18
+ setCurrentJson(data);
19
+ }
20
+ function onConfirm() {
21
+ if (!currentJson) return;
22
+ var res = util.validateUserCondition(currentJson);
23
+ if (res) return message.error(res);
24
+ setConditionFn(currentSelectAppInfo.app_id, currentJson);
25
+ setIsModalOpen(false);
26
+ setCurrentJson([]);
31
27
  }
32
28
  return /*#__PURE__*/React.createElement(BizDialog, {
33
29
  className: "set-data-dialog",
@@ -35,42 +31,35 @@ var SetDataRangeDialog = function SetDataRangeDialog(props) {
35
31
  open: isModalOpen,
36
32
  closable: true,
37
33
  style: {
38
- minWidth: isRoleAuthStatus ? '1200px' : '520px'
34
+ minWidth: isRoleAuthStatus ? '80%' : '520px'
39
35
  },
40
36
  onCancel: function onCancel() {
41
- return setIsModalOpen(false);
37
+ setIsModalOpen(false);
38
+ setCurrentJson([]);
39
+ },
40
+ onOk: function onOk() {
41
+ return onConfirm();
42
42
  }
43
43
  }, /*#__PURE__*/React.createElement(Radio.Group, {
44
44
  buttonStyle: "outline",
45
- defaultValue: isRoleAuthStatus,
45
+ value: isRoleAuthStatus,
46
46
  onChange: function onChange(value) {
47
- console.log(value.target.value);
48
47
  setIsRoleAuthStatus(value.target.value);
49
48
  }
50
49
  }, /*#__PURE__*/React.createElement(Radio, {
51
50
  value: 0
52
51
  }, "\u5168\u90E8\u6570\u636E"), /*#__PURE__*/React.createElement(Radio, {
53
52
  value: 1
54
- }, "\u7B5B\u9009\u7528\u6237\uFF08", currentAppId, "\uFF09")), isRoleAuthStatus ? /*#__PURE__*/React.createElement("li", {
53
+ }, "\u7B5B\u9009\u7528\u6237")), isRoleAuthStatus ? /*#__PURE__*/React.createElement("li", {
55
54
  className: "group-config condition"
56
55
  }, /*#__PURE__*/React.createElement("div", {
57
56
  className: "config-name"
58
57
  }, "\u5B9A\u4E49"), /*#__PURE__*/React.createElement("div", {
59
58
  className: "config-value"
60
- }), /*#__PURE__*/React.createElement(DemoWrapper, {
61
- defaultApp: currentAppId
62
- }, /*#__PURE__*/React.createElement(BizUserCondition, {
63
- openCdpCondition: true,
64
- openBusinessDataCondition: true,
65
- openOrderDataCondition: true,
66
- openTagCondition: true,
67
- userTagsData: [],
68
- defaultValue: condition,
69
- onChange: onChangeCondition,
70
- orConditionNum: 3,
71
- andConditionNum: 8,
72
- eventAttrNum: 3,
73
- isRealTime: true
74
- }))) : null);
59
+ }), /*#__PURE__*/React.createElement(SelectAppWrapper, {
60
+ currentSelectAppInfo: currentSelectAppInfo,
61
+ onChangeCondition: onChangeCondition,
62
+ currentJson: currentJson
63
+ })) : null);
75
64
  };
76
65
  export default SetDataRangeDialog;
@@ -1,6 +1,6 @@
1
1
  .set-data-dialog {
2
2
  .ant-card-head-title {
3
- display: none;
3
+ // display: none;
4
4
  }
5
5
 
6
6
  .group-config {
@@ -19,7 +19,7 @@
19
19
  border: none;
20
20
 
21
21
  .ant-card-head {
22
- display: none;
22
+ // display: none;
23
23
  }
24
24
 
25
25
  .biz-user-condition {
@@ -24,4 +24,10 @@ export declare const queryRolePage: (data: {
24
24
  id: number | null;
25
25
  }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, deleteRole: (data: {
26
26
  id: number | null;
27
+ }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryEventEnvDataApi: (data: {
28
+ id: number | null;
29
+ }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, qeuryUserPropMetaApi: (data: {
30
+ id: number | null;
31
+ }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>, queryEventMetasOfGroupApi: (data: {
32
+ id: number | null;
27
33
  }) => Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<unknown> | null>;
@@ -85,6 +85,31 @@ var Department = /*#__PURE__*/function () {
85
85
  data: data
86
86
  });
87
87
  }
88
+ // 事件
89
+ }, {
90
+ key: "queryEventEnvDataApi",
91
+ value: function queryEventEnvDataApi(data) {
92
+ return ajax(api.setting.queryEventEnvData, {
93
+ method: 'post',
94
+ data: data
95
+ });
96
+ }
97
+ }, {
98
+ key: "qeuryUserPropMetaApi",
99
+ value: function qeuryUserPropMetaApi(data) {
100
+ return ajax(api.setting.qeuryUserPropMeta, {
101
+ method: 'post',
102
+ data: data
103
+ });
104
+ }
105
+ }, {
106
+ key: "queryEventMetasOfGroupApi",
107
+ value: function queryEventMetasOfGroupApi(data) {
108
+ return ajax(api.setting.queryEventMetasOfGroup, {
109
+ method: 'post',
110
+ data: data
111
+ });
112
+ }
88
113
  }]);
89
114
  return Department;
90
115
  }();
@@ -96,5 +121,8 @@ var _Department = new Department(),
96
121
  queryCompanyUser = _Department.queryCompanyUser,
97
122
  addRole = _Department.addRole,
98
123
  updateRole = _Department.updateRole,
99
- deleteRole = _Department.deleteRole;
100
- export { queryRolePage, queryRoleDetails, queryRoleDataConfig, queryRoleMenuTree, queryCompanyUser, addRole, updateRole, deleteRole };
124
+ deleteRole = _Department.deleteRole,
125
+ queryEventEnvDataApi = _Department.queryEventEnvDataApi,
126
+ qeuryUserPropMetaApi = _Department.qeuryUserPropMetaApi,
127
+ queryEventMetasOfGroupApi = _Department.queryEventMetasOfGroupApi;
128
+ export { queryRolePage, queryRoleDetails, queryRoleDataConfig, queryRoleMenuTree, queryCompanyUser, addRole, updateRole, deleteRole, queryEventEnvDataApi, qeuryUserPropMetaApi, queryEventMetasOfGroupApi };
@@ -231,5 +231,6 @@ declare const util: {
231
231
  disabled: boolean | number;
232
232
  children: object[] | undefined;
233
233
  }[];
234
+ validateUserCondition(conditions: any[]): "" | "用户定义不能为空" | "事件不能为空" | "用户标签不能为空" | "明细数据不能为空" | "明细表不能为空" | "字段不能为空" | "筛选规则不能为空" | "筛选条件不能为空" | "值类型不能为空" | "用户属性不能为空" | "属性值不能为空" | "时间不能为空" | "次数不能为空" | "事件属性不能为空";
234
235
  };
235
236
  export default util;
package/es/utils/util.js CHANGED
@@ -721,6 +721,110 @@ var util = {
721
721
  newItem.children = (newItem === null || newItem === void 0 ? void 0 : newItem.children) && (newItem === null || newItem === void 0 ? void 0 : newItem.children.length) > 0 ? util.menuTreeData(newItem === null || newItem === void 0 ? void 0 : newItem.children) : undefined;
722
722
  return newItem;
723
723
  });
724
+ },
725
+ validateUserCondition: function validateUserCondition(conditions) {
726
+ if (!conditions.length) return '用户定义不能为空';
727
+ var _iterator2 = _createForOfIteratorHelper(conditions),
728
+ _step2;
729
+ try {
730
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
731
+ var orConditions = _step2.value;
732
+ if (!orConditions.length) return '用户定义不能为空';
733
+ var _iterator3 = _createForOfIteratorHelper(orConditions),
734
+ _step3;
735
+ try {
736
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
737
+ var orCondition = _step3.value;
738
+ if (orCondition.eventId === 0) return '事件不能为空';
739
+ if (orCondition.eventId === undefined) {
740
+ if (orCondition.labels) {
741
+ var _orCondition$labels$v;
742
+ if (((_orCondition$labels$v = orCondition.labels.values) === null || _orCondition$labels$v === void 0 ? void 0 : _orCondition$labels$v.length) === 0) return '用户标签不能为空';
743
+ } else if (orCondition.dataset) {
744
+ if (!orCondition.dataset.length) return '明细数据不能为空';
745
+ var _iterator4 = _createForOfIteratorHelper(orCondition.dataset),
746
+ _step4;
747
+ try {
748
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
749
+ var item = _step4.value;
750
+ if (!item || !item.datasetTable) return '明细表不能为空';
751
+ if (!item.fieldName) return '字段不能为空';
752
+ if (!item.operator) return '筛选规则不能为空';
753
+ if (!/^is null$|^is not null$/.test(item.operator) && !item.params.length) {
754
+ return '筛选条件不能为空';
755
+ }
756
+ }
757
+ } catch (err) {
758
+ _iterator4.e(err);
759
+ } finally {
760
+ _iterator4.f();
761
+ }
762
+ } else if (orCondition.data_set_csh) {
763
+ if (!orCondition.data_set_csh.length) return '明细数据不能为空';
764
+ var _iterator5 = _createForOfIteratorHelper(orCondition.data_set_csh),
765
+ _step5;
766
+ try {
767
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
768
+ var _item = _step5.value;
769
+ if (!_item || !_item.datasetTable) return '明细表不能为空';
770
+ if (!_item.fieldName) return '字段不能为空';
771
+ if (!_item.operator) return '筛选规则不能为空';
772
+ if (_item.subCondition) {
773
+ if (!_item.subCondition.datasetTable) return '明细表不能为空';
774
+ if (!_item.subCondition.fieldName) return '字段不能为空';
775
+ if (!_item.subCondition.operator) return '筛选规则不能为空';
776
+ if (!_item.subCondition.calculate) return '值类型不能为空';
777
+ }
778
+ if (!/^is null$|^is not null$/.test(_item.operator) && !(_item.params || _item.between && _item.between[0] && _item.between[1])) {
779
+ return '筛选条件不能为空';
780
+ }
781
+ }
782
+ } catch (err) {
783
+ _iterator5.e(err);
784
+ } finally {
785
+ _iterator5.f();
786
+ }
787
+ } else if (!orCondition.attrs.length || !orCondition.attrs[0].attrName) {
788
+ return '用户属性不能为空';
789
+ } else if (!/^is null$|^is not null$/.test(orCondition.attrs[0].operator) && !orCondition.attrs[0].params.length) {
790
+ return '属性值不能为空';
791
+ }
792
+ } else {
793
+ if (orCondition.runPeriod && orCondition.runPeriod.values && (!orCondition.runPeriod.values[0] || !orCondition.runPeriod.values[1])) {
794
+ return '时间不能为空';
795
+ }
796
+ if (orCondition.runTimes && !orCondition.runTimes.values[0]) {
797
+ return '次数不能为空';
798
+ }
799
+ if (orCondition.attrs) {
800
+ var _iterator6 = _createForOfIteratorHelper(orCondition.attrs),
801
+ _step6;
802
+ try {
803
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
804
+ var attr = _step6.value;
805
+ if (!attr.attrId && !attr.attrName) return '事件属性不能为空';
806
+ if (!attr.params.length && !/^is null$|^is not null$/.test(attr.operator)) return '属性值不能为空';
807
+ }
808
+ } catch (err) {
809
+ _iterator6.e(err);
810
+ } finally {
811
+ _iterator6.f();
812
+ }
813
+ }
814
+ }
815
+ }
816
+ } catch (err) {
817
+ _iterator3.e(err);
818
+ } finally {
819
+ _iterator3.f();
820
+ }
821
+ }
822
+ } catch (err) {
823
+ _iterator2.e(err);
824
+ } finally {
825
+ _iterator2.f();
826
+ }
827
+ return '';
724
828
  }
725
829
  };
726
830
  export default util;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.2.20-role.2",
3
+ "version": "1.2.20-role.20",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -27,6 +27,7 @@
27
27
  ]
28
28
  },
29
29
  "dependencies": {
30
+ "@zgfe/business-lib": "^1.1.95",
30
31
  "father": "^4.1.7",
31
32
  "react": "^16.12.0 || ^17.0.0",
32
33
  "react-router-dom": "^6.8.2"
@@ -51,7 +52,7 @@
51
52
  "umi-request": "^1.4.0",
52
53
  "yorkie": "^2.0.0"
53
54
  },
54
- "gitHead": "76fd8d8f6c36af2c323af5f6ab8df1944c00ac05",
55
+ "gitHead": "695c9aa8c0c64cfe32439c114fd29912cc05d5c8",
55
56
  "gitHooks": {
56
57
  "pre-commit": "lint-staged"
57
58
  }