@zgfe/modules-interval 1.0.10-qirui.3 → 1.0.10-zbfix.0

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 (51) hide show
  1. package/dist/esm/assets/business/demo.css +539 -0
  2. package/dist/esm/assets/business/demo_index.html +3316 -0
  3. package/dist/esm/assets/business/iconfont.css +559 -0
  4. package/dist/esm/assets/business/iconfont.js +43 -0
  5. package/dist/esm/assets/business/iconfont.json +961 -0
  6. package/dist/esm/assets/business/iconfont.ttf +0 -0
  7. package/dist/esm/assets/business/iconfont.woff +0 -0
  8. package/dist/esm/assets/business/iconfont.woff2 +0 -0
  9. package/dist/esm/assets/icons/demo.css +539 -0
  10. package/dist/esm/assets/icons/demo_index.html +9618 -0
  11. package/dist/esm/assets/icons/iconfont.css +1655 -0
  12. package/dist/esm/assets/icons/iconfont.js +43 -0
  13. package/dist/esm/assets/icons/iconfont.json +2879 -0
  14. package/dist/esm/assets/icons/iconfont.ttf +0 -0
  15. package/dist/esm/assets/icons/iconfont.woff +0 -0
  16. package/dist/esm/assets/icons/iconfont.woff2 +0 -0
  17. package/dist/esm/components/common/styles/index.less +3 -3
  18. package/dist/esm/components/eventFilter/index.js +20 -17
  19. package/dist/esm/components/eventFilter/types.d.ts +3 -4
  20. package/dist/esm/components/renderContent/styles/index.less +0 -3
  21. package/dist/esm/components/searchPanel/index.js +4 -3
  22. package/dist/esm/components/table/index.js +4 -5
  23. package/dist/esm/components/topBar/index.js +4 -4
  24. package/dist/esm/components/topBar/types.d.ts +2 -3
  25. package/dist/esm/constants/apis.d.ts +5 -1
  26. package/dist/esm/constants/apis.js +4 -15
  27. package/dist/esm/modules/chart/index.js +3 -4
  28. package/dist/esm/modules/chart/intervalChart.js +1 -1
  29. package/dist/esm/modules/chart/types.d.ts +0 -1
  30. package/dist/esm/modules/content/index.js +44 -28
  31. package/dist/esm/modules/content/types.d.ts +3 -4
  32. package/dist/esm/modules/content/utils.d.ts +0 -2
  33. package/dist/esm/modules/content/utils.js +2 -4
  34. package/dist/esm/modules/home/demo/edit.js +1 -1
  35. package/dist/esm/modules/home/demo/index.js +15 -200
  36. package/dist/esm/modules/home/demo/scene.js +1 -1
  37. package/dist/esm/modules/home/index.d.ts +2 -2
  38. package/dist/esm/modules/home/index.js +46 -59
  39. package/dist/esm/modules/home/styles/index.less +0 -6
  40. package/dist/esm/modules/home/types.d.ts +4 -7
  41. package/dist/esm/modules/home/types.js +2 -2
  42. package/dist/esm/modules/topPanel/index.js +127 -246
  43. package/dist/esm/modules/topPanel/styles/index.less +2 -29
  44. package/dist/esm/modules/topPanel/types.d.ts +9 -6
  45. package/dist/esm/modules/topPanel/types.js +1 -5
  46. package/dist/esm/style/index.less +0 -14
  47. package/dist/esm/types.d.ts +28 -25
  48. package/dist/esm/types.js +1 -1
  49. package/dist/esm/utils/formData.d.ts +2 -7
  50. package/dist/esm/utils/formData.js +12 -64
  51. package/package.json +4 -7
@@ -1,7 +1,7 @@
1
1
  import { AttrConditionTypes } from '@zgfe/business-lib';
2
2
  import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
3
3
  import { ReactNode } from 'react';
4
- import { AnalysisMode, FormDataProps, start } from './modules/topPanel/types';
4
+ import { FormDataProps, start } from './modules/topPanel/types';
5
5
  /**
6
6
  * 属性选择器 默认值
7
7
  */
@@ -117,19 +117,36 @@ export interface SearchValue {
117
117
  * @description 分类
118
118
  */
119
119
  module?: string;
120
+ }
121
+ export interface UserDrillParamsProp {
120
122
  /**
121
- * 分析模型
123
+ * @description 应用id
122
124
  */
123
- analysisModel?: AnalysisMode;
125
+ appId: number;
124
126
  /**
125
- * 分析主体
127
+ * @description 平台
126
128
  */
127
- analysisSubject?: {
128
- subjectId: number;
129
- subjectName: string;
130
- subjectAlias?: string;
131
- unit: string;
132
- };
129
+ platform: number;
130
+ /**
131
+ * @description 用户数量
132
+ */
133
+ count: number;
134
+ /**
135
+ * @description 模型类型 整体|事件|漏斗|留存|获取|粘性|崩溃|微信生态-整体|微信生态-小程序
136
+ */
137
+ source: string;
138
+ /**
139
+ * @description 查询接口
140
+ */
141
+ url: string;
142
+ /**
143
+ * @description 查询对象
144
+ */
145
+ params?: Record<string, any>;
146
+ /**
147
+ * @description 间隔分析,数据格式与其他业务不一致,间隔分析单独提出来了,其他业务在data里面
148
+ */
149
+ module?: string;
133
150
  }
134
151
  export type EventChartTypes = 'line' | 'bar' | 'pie' | 'map' | 'boxplot';
135
152
  /**
@@ -173,18 +190,4 @@ export interface TableChildrenProps {
173
190
  name: string;
174
191
  values: number[];
175
192
  }
176
- export declare const IntervalContext: import("react").Context<any>;
177
- export interface IntervalDrillParams {
178
- /**
179
- * @description 用户数量
180
- */
181
- count: number;
182
- /**
183
- * @description 查询接口
184
- */
185
- url: string;
186
- /**
187
- * @description 查询对象
188
- */
189
- params?: Record<string, any>;
190
- }
193
+ export declare const EventContext: import("react").Context<any>;
package/dist/esm/types.js CHANGED
@@ -16,4 +16,4 @@ var defaultContext = {
16
16
  onUserDrill: null,
17
17
  defaultSearch: {}
18
18
  };
19
- export var IntervalContext = /*#__PURE__*/createContext(defaultContext);
19
+ export var EventContext = /*#__PURE__*/createContext(defaultContext);
@@ -1,7 +1,7 @@
1
1
  import type { ColumnsType } from 'antd/es/table';
2
2
  import { EventGroup, UserProp, EnvProp } from '@zgfe/business-lib/es/attributeSelector/types';
3
3
  import { ResponseDataProps, SearchValue, SeriesProps } from '../types';
4
- import { IntervalProps } from '../modules/home/types';
4
+ import { EventProps } from '../modules/home/types';
5
5
  import '../style/index.less';
6
6
  import { DisplaySetup } from '../components/searchPanel/types';
7
7
  /**
@@ -9,7 +9,7 @@ import { DisplaySetup } from '../components/searchPanel/types';
9
9
  * @param columnData xAxis
10
10
  * @returns column fields
11
11
  */
12
- export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], dataSource: ResponseDataProps, userGroup: number[], searchData: SearchValue, showList: string[], onUserDrill: IntervalProps.Props['onUserDrill']): ColumnsType<IntervalProps.ColumnsDataType>;
12
+ export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], dataSource: ResponseDataProps, userGroup: number[], searchData: SearchValue, showList: string[]): ColumnsType<EventProps.ColumnsDataType>;
13
13
  /**
14
14
  * 获取属性的label
15
15
  * @param attrData 当前属性
@@ -35,9 +35,7 @@ export declare function formTableData(originalData: ChartData): {
35
35
  Q3: number;
36
36
  min: number;
37
37
  perValue: number;
38
- total: number;
39
38
  peopleNum: number;
40
- names: string[];
41
39
  }[] | {
42
40
  key: number;
43
41
  time: string;
@@ -47,7 +45,6 @@ export declare function formTableData(originalData: ChartData): {
47
45
  Q3: number;
48
46
  min: number;
49
47
  perValue: number;
50
- total: number;
51
48
  peopleNum: number;
52
49
  children: {
53
50
  key: string;
@@ -58,9 +55,7 @@ export declare function formTableData(originalData: ChartData): {
58
55
  Q3: number;
59
56
  min: number;
60
57
  perValue: number;
61
- total: number;
62
58
  peopleNum: number;
63
- names: string[];
64
59
  }[];
65
60
  }[] | undefined;
66
61
  type ChartData = {
@@ -1,22 +1,19 @@
1
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
2
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
3
8
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
9
  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."); }
5
10
  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); }
6
11
  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; }
7
12
  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; } }
8
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
- 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; }
10
- 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; }
11
- 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; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
- 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); }
14
14
  import React from 'react';
15
15
  import { chartColors } from "../constants/color";
16
16
  import "../style/index.less";
17
- import { IconFont } from '@zgfe/business-lib';
18
- import { Apis } from "../constants";
19
- import { searchDataParams } from "../modules/content/utils";
20
17
  var classPrefix = 'interval-form-data';
21
18
  function convertToHMS(seconds) {
22
19
  var hours = Math.floor(seconds / 3600);
@@ -32,7 +29,7 @@ function convertToHMS(seconds) {
32
29
  * @param columnData xAxis
33
30
  * @returns column fields
34
31
  */
35
- export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, dataSource, userGroup, searchData, showList, onUserDrill
32
+ export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, dataSource, userGroup, searchData, showList
36
33
  // onClickToDetailCallback: Function,
37
34
  ) {
38
35
  var _dataSource$appData, _dataSource$appData$s, _searchData$dimension;
@@ -124,7 +121,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
124
121
  return /*#__PURE__*/React.createElement("span", null, " ", convertToHMS(text));
125
122
  }
126
123
  }, {
127
- title: '均值',
124
+ title: '人均值',
128
125
  width: 148,
129
126
  ellipsis: true,
130
127
  align: 'right',
@@ -139,22 +136,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
139
136
  return /*#__PURE__*/React.createElement("span", null, " ", convertToHMS(text));
140
137
  }
141
138
  }, {
142
- title: '合计',
143
- width: 148,
144
- ellipsis: true,
145
- align: 'right',
146
- dataIndex: 'total',
147
- key: 'total',
148
- className: "".concat(classPrefix, "-table-td"),
149
- sorter: function sorter(a, b) {
150
- var _a$total, _b$total;
151
- return ((_a$total = a === null || a === void 0 ? void 0 : a.total) !== null && _a$total !== void 0 ? _a$total : 0) - ((_b$total = b === null || b === void 0 ? void 0 : b.total) !== null && _b$total !== void 0 ? _b$total : 0);
152
- },
153
- render: function render(text, record) {
154
- return /*#__PURE__*/React.createElement("span", null, " ", convertToHMS(text));
155
- }
156
- }, {
157
- title: searchData.analysisSubject ? "".concat(searchData.analysisSubject.subjectAlias || searchData.analysisSubject.subjectName, "\u6570") : '人数',
139
+ title: '人数',
158
140
  width: 148,
159
141
  ellipsis: true,
160
142
  align: 'right',
@@ -166,38 +148,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
166
148
  key: 'peopleNum',
167
149
  className: "".concat(classPrefix, "-table-td"),
168
150
  render: function render(text, record) {
169
- return /*#__PURE__*/React.createElement("span", {
170
- className: "interval-drill",
171
- onClick: function onClick() {
172
- var params;
173
- var searchParam = searchDataParams(searchData);
174
- // 主体下钻
175
- if (searchData.analysisSubject) {
176
- params = {
177
- url: Apis.subjectDrill,
178
- count: Number(text),
179
- params: _objectSpread({}, searchParam)
180
- };
181
- } else {
182
- // 用户下钻
183
- params = {
184
- url: Apis.userDrill,
185
- count: Number(text),
186
- params: _objectSpread({}, searchParam)
187
- };
188
- }
189
- if (searchParam.dimension) {
190
- params.params.groupValue = /\d{4}-\d{2}-\d{2}/.test(record.time || '') ? record.names ? record.names[0] : undefined : record.time;
191
- }
192
- if (/\d{4}-\d{2}-\d{2}/.test(record.time || '')) {
193
- params.params.time.begin = record.time.split('|')[0];
194
- params.params.time.end = record.time.split('|')[1] || record.time.split('|')[0];
195
- }
196
- onUserDrill === null || onUserDrill === void 0 ? void 0 : onUserDrill(params, searchData.analysisSubject ? true : false);
197
- }
198
- }, /*#__PURE__*/React.createElement(IconFont, {
199
- type: "a-yanjingkai"
200
- }), " ", text);
151
+ return /*#__PURE__*/React.createElement("span", null, " ", text);
201
152
  }
202
153
  }];
203
154
  return data;
@@ -241,8 +192,7 @@ function createNewArray(data) {
241
192
  Q3: item.total[3] || 0,
242
193
  min: item.total[4] || 0,
243
194
  perValue: item.total[5] || 0,
244
- total: item.total[6] || 0,
245
- peopleNum: item.total[7] || 0,
195
+ peopleNum: item.total[6] || 0,
246
196
  children: getChildrenData(data, i)
247
197
  };
248
198
  });
@@ -271,7 +221,7 @@ export function convertDateArray(params, dateArray) {
271
221
  var resultArray = dateArray.map(function (date) {
272
222
  var dateObj = new Date(date);
273
223
  var weekday = weekdays[dateObj.getDay()];
274
- return "".concat(date).concat(weekday ? " (".concat(weekday, ")") : '');
224
+ return "".concat(date, " (").concat(weekday, ")");
275
225
  });
276
226
  return resultArray;
277
227
  break;
@@ -295,9 +245,7 @@ function getChildrenData(data, index) {
295
245
  Q3: values[i][3] || 0,
296
246
  min: values[i][4] || 0,
297
247
  perValue: values[i][5] || 0,
298
- total: values[i][6] || 0,
299
- peopleNum: values[i][7] || 0,
300
- names: firstSeries.names
248
+ peopleNum: values[i][6] || 0
301
249
  };
302
250
  });
303
251
  }
package/package.json CHANGED
@@ -1,24 +1,21 @@
1
1
  {
2
2
  "name": "@zgfe/modules-interval",
3
- "version": "1.0.10-qirui.3",
3
+ "version": "1.0.10-zbfix.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
7
7
  "docs:deploy": "gh-pages -d docs-dist",
8
8
  "build": "father build",
9
+ "pub": "lerna publish",
9
10
  "deploy": "npm run docs:build && npm run docs:deploy",
10
11
  "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
11
12
  "test": "umi-test",
12
- "pub": "lerna publish",
13
13
  "test:coverage": "umi-test --coverage",
14
14
  "prepublishOnly": "npm run build"
15
15
  },
16
16
  "files": [
17
17
  "dist"
18
18
  ],
19
- "publishConfig": {
20
- "access": "public"
21
- },
22
19
  "module": "dist/esm/index.js",
23
20
  "typings": "dist/esm/index.d.ts",
24
21
  "gitHooks": {
@@ -47,7 +44,7 @@
47
44
  "@types/uuid": "^9.0.2",
48
45
  "@umijs/fabric": "^2.8.1",
49
46
  "@umijs/test": "^3.0.5",
50
- "@zgfe/business-lib": "1.1.96-qirui.0",
47
+ "@zgfe/business-lib": "1.1.87-auth.7",
51
48
  "@zgfe/modules-demo-manage": "^1.0.1",
52
49
  "antd": "^4.22.6",
53
50
  "dumi": "^1.1.0",
@@ -62,5 +59,5 @@
62
59
  "umi-request": "^1.4.0",
63
60
  "yorkie": "^2.0.0"
64
61
  },
65
- "gitHead": "9f9360a9bb9774be8bbd58cbfee74df64aea4789"
62
+ "gitHead": "b237d89c718e2bfadfcc098f143bf85d1ed941f9"
66
63
  }