@zgfe/modules-interval 1.0.0-interval.1 → 1.0.0-interval.2

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.
@@ -92,6 +92,7 @@ var EventFilter = function EventFilter(props) {
92
92
  setIsAdd(true);
93
93
  setTimeout(function () {
94
94
  conditionRef.current.add();
95
+ console.log(333331111, conditionRef, conditionRef.current);
95
96
  }, 0);
96
97
  };
97
98
 
@@ -11,7 +11,7 @@ import "./styles/index.less";
11
11
  import EventChart from "../../modules/chart";
12
12
  var classPrefix = 'render-content';
13
13
  var ContentPanel = function ContentPanel(props) {
14
- var _eventData$xAxis;
14
+ var _eventData$app_data, _eventData$app_data$s;
15
15
  var loading = props.loading,
16
16
  eventData = props.eventData,
17
17
  searchData = props.searchData;
@@ -43,15 +43,13 @@ var ContentPanel = function ContentPanel(props) {
43
43
  className: "".concat(classPrefix, "-chart-container")
44
44
  }, eventData ? /*#__PURE__*/React.createElement(EventChart, {
45
45
  dataSource: eventData,
46
- params: searchData,
47
- showList: showList
46
+ params: searchData
48
47
  }) : /*#__PURE__*/React.createElement(MiNone, {
49
48
  label: "\u6682\u65E0\u6570\u636E"
50
- })), eventData && (_eventData$xAxis = eventData.xAxis) !== null && _eventData$xAxis !== void 0 && _eventData$xAxis.length ? /*#__PURE__*/React.createElement(EventChart, {
49
+ })), eventData && (_eventData$app_data = eventData.app_data) !== null && _eventData$app_data !== void 0 && (_eventData$app_data$s = _eventData$app_data.series) !== null && _eventData$app_data$s !== void 0 && _eventData$app_data$s.length ? /*#__PURE__*/React.createElement(EventChart, {
51
50
  type: "grid",
52
51
  dataSource: eventData,
53
52
  params: searchData,
54
- showList: showList,
55
53
  onChangeShow: onChangeShow
56
54
  }) : null);
57
55
  };
@@ -1,4 +1,3 @@
1
-
2
1
  .render-content {
3
2
  &-chart-container {
4
3
  display: flex;
@@ -105,6 +105,7 @@ var SearchPanel = function SearchPanel(props) {
105
105
  display: 'flex'
106
106
  }
107
107
  }, /*#__PURE__*/React.createElement(BizDatePicker, {
108
+ dateTypeList: ['week', 'month'],
108
109
  defaultValue: time,
109
110
  onChange: onChangeTime
110
111
  }), /*#__PURE__*/React.createElement(BizSelect, {
@@ -1,4 +1,3 @@
1
-
2
1
  .search-panel {
3
2
  display: flex;
4
3
  align-items: center;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import 'highlight.js/styles/vs.css';
3
2
  import { EventTableProps } from './types';
4
3
  import './styles/index.less';
5
4
  declare const EventTable: React.FC<EventTableProps>;
@@ -12,13 +12,13 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { ajax, BizGlobalDataContext, BizTable, IconFont } from '@zgfe/business-lib';
14
14
  import React, { useContext, useEffect, useMemo, useState } from 'react';
15
- import 'highlight.js/styles/vs.css';
15
+ // import 'highlight.js/styles/vs.css';
16
16
  import base64 from "../../utils/base64";
17
17
  import { Apis } from "../../constants";
18
18
  import { message } from 'antd';
19
19
  import { formTableData, getColumns } from "../../utils/formData";
20
20
  import "./styles/index.less";
21
- import { getValue } from "../../modules/content/utils";
21
+ import { getValue, searchDataParams } from "../../modules/content/utils";
22
22
  import { EventContext } from "../../types";
23
23
  var classPrefix = 'mi-table';
24
24
  var EventTable = function EventTable(props) {
@@ -156,18 +156,18 @@ var EventTable = function EventTable(props) {
156
156
  if (searchData.id && !searchData.dimension || !searchData.id) {
157
157
  seriesNames.push(base64.encode('事件'));
158
158
  }
159
+ var obj = searchDataParams(searchData);
159
160
  var params = _objectSpread(_objectSpread({
160
- appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
161
+ app_Id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
161
162
  platform: (currentApp === null || currentApp === void 0 ? void 0 : currentApp.platform) || 0
162
- }, searchData), {}, {
163
+ }, obj), {}, {
163
164
  down: {
164
- fname: base64.encode('间隔分析'),
165
- titles: seriesNames
165
+ fname: base64.encode('间隔分析')
166
166
  }
167
167
  });
168
168
  ajax(Apis.eventDownloadReport, {
169
- method: 'post',
170
- data: params,
169
+ method: 'get',
170
+ params: params,
171
171
  responseType: 'blob',
172
172
  fileName: '间隔分析',
173
173
  getResponse: true
@@ -16,6 +16,7 @@ import { BizAddToPanel, BizAddToScene, BizGlobalDataContext } from '@zgfe/busine
16
16
  import "./styles/index.less";
17
17
  import { EventContext } from "../../types";
18
18
  import { chartTypes, platformOption } from "../../constants/fields";
19
+ import { Link } from 'react-router-dom';
19
20
  var classPrefix = 'modules-event-topbar';
20
21
  var TopBar = function TopBar(props) {
21
22
  // console.log('TopBar', props);
@@ -103,7 +104,9 @@ var TopBar = function TopBar(props) {
103
104
  className: "".concat(classPrefix, "-earlywarning"),
104
105
  type: "primary",
105
106
  onClick: function onClick() {
106
- return console.log('设置流失预警');
107
+ /*#__PURE__*/React.createElement(Link, {
108
+ to: "/manage/warning/list"
109
+ }, "Home");
107
110
  }
108
111
  }, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66"), /*#__PURE__*/React.createElement("div", {
109
112
  className: "".concat(classPrefix, "-platform")
@@ -2,6 +2,6 @@ var Apis = {
2
2
  // dataList: '/zg/web/v2/data/eventDataList',
3
3
  dataList: '/zg/web/v2/interval/intervalData',
4
4
  getEventDataSql: '/zg/web/v2/dataSql/getEventDataSql',
5
- eventDownloadReport: '/zg/web/v2/data/eventDownloadReport'
5
+ eventDownloadReport: '/interval/downLoadintervalData.jsp'
6
6
  };
7
7
  export default Apis;
@@ -1,4 +1,4 @@
1
1
  /// <reference path="../typings.d.ts" />
2
2
  import EventChart from './modules/chart';
3
- import ModuleEvent from './modules/home';
4
- export { ModuleEvent, EventChart };
3
+ import ModuleInterval from './modules/home';
4
+ export { ModuleInterval, EventChart };
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference path="../typings.d.ts" />
2
2
  import EventChart from "./modules/chart";
3
- import ModuleEvent from "./modules/home";
4
- export { ModuleEvent, EventChart };
3
+ import ModuleInterval from "./modules/home";
4
+ export { ModuleInterval, EventChart };
@@ -18,7 +18,8 @@ import { Apis } from "../../constants";
18
18
  import { Spin } from 'antd';
19
19
  import IntervalChart from "./intervalChart";
20
20
  var EventChart = function EventChart(props) {
21
- var _dataSource$app_data, _dataSource$app_data$, _dataSource$app_data2, _dataSource$app_data3;
21
+ var _dataSource$app_data, _dataSource$app_data$;
22
+ console.log(888811111, props);
22
23
  var params = props.params;
23
24
  // 显示内容
24
25
  var _useState = useState(),
@@ -81,7 +82,7 @@ var EventChart = function EventChart(props) {
81
82
  className: "spin-container"
82
83
  });
83
84
  }
84
- if (!dataSource || !(dataSource !== null && dataSource !== void 0 && (_dataSource$app_data = dataSource.app_data) !== null && _dataSource$app_data !== void 0 && (_dataSource$app_data$ = _dataSource$app_data.x_axis) !== null && _dataSource$app_data$ !== void 0 && _dataSource$app_data$.length || dataSource !== null && dataSource !== void 0 && (_dataSource$app_data2 = dataSource.app_data) !== null && _dataSource$app_data2 !== void 0 && (_dataSource$app_data3 = _dataSource$app_data2.series) !== null && _dataSource$app_data3 !== void 0 && _dataSource$app_data3.length)) {
85
+ if (!dataSource || !(dataSource !== null && dataSource !== void 0 && (_dataSource$app_data = dataSource.app_data) !== null && _dataSource$app_data !== void 0 && (_dataSource$app_data$ = _dataSource$app_data.series) !== null && _dataSource$app_data$ !== void 0 && _dataSource$app_data$.length)) {
85
86
  return /*#__PURE__*/React.createElement(MiNone, {
86
87
  label: "\u6682\u65E0\u6570\u636E"
87
88
  });
@@ -89,7 +90,8 @@ var EventChart = function EventChart(props) {
89
90
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IntervalChart, {
90
91
  dataSource: dataSource,
91
92
  showList: showList,
92
- dataSourceList: dataSourceList
93
+ dataSourceList: dataSourceList,
94
+ params: params
93
95
  }), /*#__PURE__*/React.createElement(EventTable, {
94
96
  dataSource: dataSource,
95
97
  searchData: params,
@@ -11,6 +11,7 @@ import { renderToString } from 'react-dom/server';
11
11
  import CustomTooltip from "./customTooltip";
12
12
  import { chartColors } from "../../constants";
13
13
  import { getRandomColor } from "../../constants/color";
14
+ import { convertDateArray } from "../../utils/formData";
14
15
  var IntervalChart = function IntervalChart(props) {
15
16
  var _useState = useState({}),
16
17
  _useState2 = _slicedToArray(_useState, 2),
@@ -19,6 +20,7 @@ var IntervalChart = function IntervalChart(props) {
19
20
  useEffect(function () {
20
21
  var _props$showList, _seriesData$series;
21
22
  var seriesData = props === null || props === void 0 ? void 0 : (_props$showList = props.showList) === null || _props$showList === void 0 ? void 0 : _props$showList.app_data;
23
+ var params = props === null || props === void 0 ? void 0 : props.params;
22
24
  var eCharts = {
23
25
  tooltip: {
24
26
  trigger: 'item',
@@ -41,7 +43,7 @@ var IntervalChart = function IntervalChart(props) {
41
43
  type: 'category',
42
44
  boundaryGap: true,
43
45
  nameGap: 30,
44
- data: seriesData === null || seriesData === void 0 ? void 0 : seriesData.x_axis,
46
+ data: convertDateArray(params, seriesData === null || seriesData === void 0 ? void 0 : seriesData.x_axis),
45
47
  splitArea: {
46
48
  show: false
47
49
  },
@@ -17,7 +17,7 @@ import TopBar from "../../components/topBar";
17
17
  import { EventContext } from "../../types";
18
18
  import "./styles/index.less";
19
19
  import { Apis } from "../../constants";
20
- import { judgeIsCity, judgeIsArea, getValue } from "./utils";
20
+ import { judgeIsCity, judgeIsArea, getValue, searchDataParams } from "./utils";
21
21
  import { ContentPanel, SearchPanel } from "../../components";
22
22
  import TopPanel from "../topPanel";
23
23
  import { message } from 'antd';
@@ -102,54 +102,6 @@ var EventContent = function EventContent(props) {
102
102
  useEffect(function () {
103
103
  handleSearch && handleSearch(loading);
104
104
  }, [loading]);
105
- // 间隔分析传参变更
106
- function searchCondition(params) {
107
- var _params$filters, _params$filters2;
108
- var numAttrTypeMap = {
109
- 1: 'cont-string',
110
- 2: 'cont-num',
111
- 3: 'cont-date'
112
- };
113
- return {
114
- operator: (params === null || params === void 0 ? void 0 : (_params$filters = params.filters) === null || _params$filters === void 0 ? void 0 : _params$filters.relation) || 'and',
115
- event_id: params === null || params === void 0 ? void 0 : params.id,
116
- event_name: params === null || params === void 0 ? void 0 : params.name,
117
- condition: params === null || params === void 0 ? void 0 : (_params$filters2 = params.filters) === null || _params$filters2 === void 0 ? void 0 : _params$filters2.conditions.map(function (item) {
118
- return {
119
- name: item === null || item === void 0 ? void 0 : item.attrName,
120
- attrId: item === null || item === void 0 ? void 0 : item.attrId,
121
- params: item === null || item === void 0 ? void 0 : item.values,
122
- attr_sub: (item === null || item === void 0 ? void 0 : item.propCategory) === 'userProp' ? 'user_attr' : (item === null || item === void 0 ? void 0 : item.propCategory) === 'eventProp' ? 'event_attr' : item === null || item === void 0 ? void 0 : item.attrName,
123
- category: (item === null || item === void 0 ? void 0 : item.category) || 'custom',
124
- attrType: numAttrTypeMap[item === null || item === void 0 ? void 0 : item.type],
125
- operator: item === null || item === void 0 ? void 0 : item.operator
126
- };
127
- })
128
- };
129
- }
130
- function searchDataParams(params) {
131
- var _params$time, _params$time2, _params$time3, _params$userGroup$, _params$dimension, _params$dimension2, _params$dimension3, _params$dimension4, _params$dimension5, _params$dimension6, _params$dimension7, _params$dimension8, _params$dimension9, _params$dimension10, _params$dimension11, _params$associatedPre, _params$associatedNex;
132
- return {
133
- time: {
134
- dimension_date: params === null || params === void 0 ? void 0 : (_params$time = params.time) === null || _params$time === void 0 ? void 0 : _params$time.unit,
135
- begin_date: params === null || params === void 0 ? void 0 : (_params$time2 = params.time) === null || _params$time2 === void 0 ? void 0 : _params$time2.begin,
136
- end_date: params === null || params === void 0 ? void 0 : (_params$time3 = params.time) === null || _params$time3 === void 0 ? void 0 : _params$time3.end
137
- },
138
- user_group: (_params$userGroup$ = params.userGroup[0]) === null || _params$userGroup$ === void 0 ? void 0 : _params$userGroup$.id,
139
- start: searchCondition(params === null || params === void 0 ? void 0 : params.start),
140
- end: searchCondition(params === null || params === void 0 ? void 0 : params.end),
141
- dimension: {
142
- sub: (params === null || params === void 0 ? void 0 : (_params$dimension = params.dimension) === null || _params$dimension === void 0 ? void 0 : _params$dimension.propCategory) === 'userProp' ? 'user_attr' : (params === null || params === void 0 ? void 0 : (_params$dimension2 = params.dimension) === null || _params$dimension2 === void 0 ? void 0 : _params$dimension2.propCategory) === 'eventProp' ? 'event_attr' : params === null || params === void 0 ? void 0 : (_params$dimension3 = params.dimension) === null || _params$dimension3 === void 0 ? void 0 : _params$dimension3.name,
143
- category: (params === null || params === void 0 ? void 0 : (_params$dimension4 = params.dimension) === null || _params$dimension4 === void 0 ? void 0 : _params$dimension4.category) || 'custom',
144
- attr_id: params === null || params === void 0 ? void 0 : (_params$dimension5 = params.dimension) === null || _params$dimension5 === void 0 ? void 0 : _params$dimension5.id,
145
- user_attr: (params === null || params === void 0 ? void 0 : (_params$dimension6 = params.dimension) === null || _params$dimension6 === void 0 ? void 0 : _params$dimension6.propCategory) === 'userProp' ? params === null || params === void 0 ? void 0 : (_params$dimension7 = params.dimension) === null || _params$dimension7 === void 0 ? void 0 : _params$dimension7.dimensionSub : null,
146
- event_attr: (params === null || params === void 0 ? void 0 : (_params$dimension8 = params.dimension) === null || _params$dimension8 === void 0 ? void 0 : _params$dimension8.propCategory) === 'eventProp' ? params === null || params === void 0 ? void 0 : (_params$dimension9 = params.dimension) === null || _params$dimension9 === void 0 ? void 0 : _params$dimension9.label : null,
147
- event: (params === null || params === void 0 ? void 0 : (_params$dimension10 = params.dimension) === null || _params$dimension10 === void 0 ? void 0 : _params$dimension10.propCategory) !== 'envProp' ? params === null || params === void 0 ? void 0 : (_params$dimension11 = params.dimension) === null || _params$dimension11 === void 0 ? void 0 : _params$dimension11.eventId : null
148
- },
149
- associated_pre_attr: params === null || params === void 0 ? void 0 : (_params$associatedPre = params.associatedPreAttr) === null || _params$associatedPre === void 0 ? void 0 : _params$associatedPre.id,
150
- associated_next_attr: params === null || params === void 0 ? void 0 : (_params$associatedNex = params.associatedNextAttr) === null || _params$associatedNex === void 0 ? void 0 : _params$associatedNex.id
151
- };
152
- }
153
105
  // 查询
154
106
  var fetchRequest = function fetchRequest(flag) {
155
107
  var _searchData$associate, _searchData$associate2, _searchData$associate3;
@@ -165,16 +117,8 @@ var EventContent = function EventContent(props) {
165
117
  return message.error('您查询的属性不一致,暂不支持查询');
166
118
  }
167
119
  var params = searchDataParams(searchData);
168
- // const params = {
169
- // app_id: 177,
170
- // platform: 0,
171
- // user_group: 0,
172
- // time: { dimension_date: 'month', begin_date: '2023-05-01', end_date: '2023-08-29' },
173
- // start: { operator: 'and', event_id: 16530, event_name: '查看商品A' },
174
- // end: { operator: 'and', event_id: 16530, event_name: '查看商品A' },
175
- // dimension: { sub: 'user_attr', category: 'fixed', user_attr: 'name' },
176
- // };
177
- console.log(666666, searchData, params);
120
+ // const params = {"app_id":177,"platform":0,"user_group":"0","time":{"dimension_date":"week","begin_date":"2023-08-07","end_date":"2023-09-04"},"start":{"operator":"and","event_id":16530,"event_name":"查看商品A"},"end":{"operator":"and","event_id":16530,"event_name":"查看商品A"},"dimension":{"sub":"user_attr","category":"fixed","user_attr":"name"}}
121
+ // console.log(666666, searchData, params);
178
122
  props.onChange && props.onChange(searchData);
179
123
  ajax(Apis.dataList, {
180
124
  method: 'post',
@@ -19,3 +19,39 @@ export declare const judgeIsArea: (name: string | undefined) => boolean;
19
19
  * @returns 属性的全部数据
20
20
  */
21
21
  export declare const getValue: (param: bizAttributeSelectorValueProp, eventGroupList: EventGroup[] | undefined, eventEnvList: EnvProp[] | undefined, userPropList: UserProp[] | undefined) => AttributeSelect.Value | undefined;
22
+ export declare function searchCondition(params: any): {
23
+ operator: any;
24
+ event_id: any;
25
+ event_name: any;
26
+ condition: any;
27
+ };
28
+ export declare function searchDataParams(params: any): {
29
+ time: {
30
+ dimension_date: any;
31
+ begin_date: any;
32
+ end_date: any;
33
+ };
34
+ user_group: any;
35
+ start: {
36
+ operator: any;
37
+ event_id: any;
38
+ event_name: any;
39
+ condition: any;
40
+ };
41
+ end: {
42
+ operator: any;
43
+ event_id: any;
44
+ event_name: any;
45
+ condition: any;
46
+ };
47
+ dimension: {
48
+ sub: any;
49
+ category: any;
50
+ attr_id: any;
51
+ user_attr: any;
52
+ event_attr: any;
53
+ event: any;
54
+ };
55
+ associated_pre_attr: any;
56
+ associated_next_attr: any;
57
+ };
@@ -48,4 +48,51 @@ export var getValue = function getValue(param, eventGroupList, eventEnvList, use
48
48
  }
49
49
  console.log('获取当前属性的全部数据', res);
50
50
  return res;
51
- };
51
+ };
52
+ export function searchCondition(params) {
53
+ var _params$filters, _params$filters2;
54
+ var numAttrTypeMap = {
55
+ 1: 'cont-string',
56
+ 2: 'cont-num',
57
+ 3: 'cont-date'
58
+ };
59
+ return {
60
+ operator: (params === null || params === void 0 ? void 0 : (_params$filters = params.filters) === null || _params$filters === void 0 ? void 0 : _params$filters.relation) || 'and',
61
+ event_id: params === null || params === void 0 ? void 0 : params.id,
62
+ event_name: params === null || params === void 0 ? void 0 : params.name,
63
+ condition: params === null || params === void 0 ? void 0 : (_params$filters2 = params.filters) === null || _params$filters2 === void 0 ? void 0 : _params$filters2.conditions.map(function (item) {
64
+ return {
65
+ name: item === null || item === void 0 ? void 0 : item.attrName,
66
+ attrId: item === null || item === void 0 ? void 0 : item.attrId,
67
+ params: item === null || item === void 0 ? void 0 : item.values,
68
+ attr_sub: (item === null || item === void 0 ? void 0 : item.propCategory) === 'userProp' ? 'user_attr' : (item === null || item === void 0 ? void 0 : item.propCategory) === 'eventProp' ? 'event_attr' : item === null || item === void 0 ? void 0 : item.attrName,
69
+ category: (item === null || item === void 0 ? void 0 : item.category) || 'custom',
70
+ attrType: numAttrTypeMap[item === null || item === void 0 ? void 0 : item.type],
71
+ operator: item === null || item === void 0 ? void 0 : item.operator
72
+ };
73
+ })
74
+ };
75
+ }
76
+ export function searchDataParams(params) {
77
+ var _params$time, _params$time2, _params$time3, _params$userGroup$, _params$dimension, _params$dimension2, _params$dimension3, _params$dimension4, _params$dimension5, _params$dimension6, _params$dimension7, _params$dimension8, _params$dimension9, _params$dimension10, _params$dimension11, _params$associatedPre, _params$associatedNex;
78
+ return {
79
+ time: {
80
+ dimension_date: params === null || params === void 0 ? void 0 : (_params$time = params.time) === null || _params$time === void 0 ? void 0 : _params$time.unit,
81
+ begin_date: params === null || params === void 0 ? void 0 : (_params$time2 = params.time) === null || _params$time2 === void 0 ? void 0 : _params$time2.begin,
82
+ end_date: params === null || params === void 0 ? void 0 : (_params$time3 = params.time) === null || _params$time3 === void 0 ? void 0 : _params$time3.end
83
+ },
84
+ user_group: (_params$userGroup$ = params.userGroup[0]) === null || _params$userGroup$ === void 0 ? void 0 : _params$userGroup$.id,
85
+ start: searchCondition(params === null || params === void 0 ? void 0 : params.start),
86
+ end: searchCondition(params === null || params === void 0 ? void 0 : params.end),
87
+ dimension: {
88
+ sub: (params === null || params === void 0 ? void 0 : (_params$dimension = params.dimension) === null || _params$dimension === void 0 ? void 0 : _params$dimension.propCategory) === 'userProp' ? 'user_attr' : (params === null || params === void 0 ? void 0 : (_params$dimension2 = params.dimension) === null || _params$dimension2 === void 0 ? void 0 : _params$dimension2.propCategory) === 'eventProp' ? 'event_attr' : params === null || params === void 0 ? void 0 : (_params$dimension3 = params.dimension) === null || _params$dimension3 === void 0 ? void 0 : _params$dimension3.name,
89
+ category: (params === null || params === void 0 ? void 0 : (_params$dimension4 = params.dimension) === null || _params$dimension4 === void 0 ? void 0 : _params$dimension4.category) || 'custom',
90
+ attr_id: params === null || params === void 0 ? void 0 : (_params$dimension5 = params.dimension) === null || _params$dimension5 === void 0 ? void 0 : _params$dimension5.id,
91
+ user_attr: (params === null || params === void 0 ? void 0 : (_params$dimension6 = params.dimension) === null || _params$dimension6 === void 0 ? void 0 : _params$dimension6.propCategory) === 'userProp' ? params === null || params === void 0 ? void 0 : (_params$dimension7 = params.dimension) === null || _params$dimension7 === void 0 ? void 0 : _params$dimension7.dimensionSub : null,
92
+ event_attr: (params === null || params === void 0 ? void 0 : (_params$dimension8 = params.dimension) === null || _params$dimension8 === void 0 ? void 0 : _params$dimension8.propCategory) === 'eventProp' ? params === null || params === void 0 ? void 0 : (_params$dimension9 = params.dimension) === null || _params$dimension9 === void 0 ? void 0 : _params$dimension9.label : null,
93
+ event: (params === null || params === void 0 ? void 0 : (_params$dimension10 = params.dimension) === null || _params$dimension10 === void 0 ? void 0 : _params$dimension10.propCategory) !== 'envProp' ? params === null || params === void 0 ? void 0 : (_params$dimension11 = params.dimension) === null || _params$dimension11 === void 0 ? void 0 : _params$dimension11.eventId : null
94
+ },
95
+ associated_pre_attr: params === null || params === void 0 ? void 0 : (_params$associatedPre = params.associatedPreAttr) === null || _params$associatedPre === void 0 ? void 0 : _params$associatedPre.id,
96
+ associated_next_attr: params === null || params === void 0 ? void 0 : (_params$associatedNex = params.associatedNextAttr) === null || _params$associatedNex === void 0 ? void 0 : _params$associatedNex.id
97
+ };
98
+ }
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useState } from 'react';
8
8
  import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
9
- import { ModuleEvent } from "../../../index";
9
+ import { ModuleInterval } from "../../../index";
10
10
  import { requestConfig } from "../../../utils/ajaxConfig";
11
11
  import { Button } from 'antd';
12
12
  var defaultValue = null;
@@ -43,7 +43,7 @@ export default (function () {
43
43
  onClick: function onClick() {
44
44
  return setIsDetail(false);
45
45
  }
46
- }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleEvent, {
46
+ }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
47
47
  defaultValue: searchParams,
48
48
  afterEditTarget: afterEditTarget,
49
49
  onUserDrill: onUserDrill
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useState } from 'react';
8
8
  import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
9
- import { ModuleEvent } from "../../../index";
9
+ import { ModuleInterval } from "../../../index";
10
10
  import { requestConfig } from "../../../utils/ajaxConfig";
11
11
  import { Button } from 'antd';
12
12
  var defaultValue = {
@@ -82,7 +82,7 @@ export default (function () {
82
82
  onClick: function onClick() {
83
83
  return setIsDetail(false);
84
84
  }
85
- }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleEvent, {
85
+ }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
86
86
  defaultValue: searchParams,
87
87
  afterEditTarget: afterEditTarget,
88
88
  onUserDrill: onUserDrill
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
8
8
  import React, { useEffect, useState } from 'react';
9
- import { ModuleEvent } from "../../../index";
9
+ import { ModuleInterval } from "../../../index";
10
10
  import "./styles/index.less";
11
11
  import { requestConfig } from "../../../utils/ajaxConfig";
12
12
  import { Button } from 'antd';
@@ -43,7 +43,7 @@ export default (function () {
43
43
  onClick: function onClick() {
44
44
  return setIsDetail(false);
45
45
  }
46
- }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleEvent, {
46
+ }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
47
47
  defaultValue: searchParams,
48
48
  afterEditTarget: afterEditTarget,
49
49
  onUserDrill: onUserDrill
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useState } from 'react';
8
8
  import { DemoWrapper, setGlobalConfig } from '@zgfe/business-lib';
9
- import { ModuleEvent } from "../../../index";
9
+ import { ModuleInterval } from "../../../index";
10
10
  import { requestConfig } from "../../../utils/ajaxConfig";
11
11
  import { Button } from 'antd';
12
12
  var defaultValue = {
@@ -79,7 +79,7 @@ export default (function () {
79
79
  onClick: function onClick() {
80
80
  return setIsDetail(false);
81
81
  }
82
- }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleEvent, {
82
+ }, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
83
83
  defaultValue: searchParams,
84
84
  afterEditTarget: afterEditTarget,
85
85
  onUserDrill: onUserDrill
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import './styles/index.less';
3
3
  import { EventProps } from './types';
4
- declare const ModuleEvent: React.FC<EventProps.Props>;
5
- export default ModuleEvent;
4
+ declare const ModuleInterval: React.FC<EventProps.Props>;
5
+ export default ModuleInterval;
@@ -19,7 +19,7 @@ import { getInitDate } from "../../constants/initData";
19
19
  import EventContent from "../content";
20
20
  import { chartTypes } from "../../constants";
21
21
  var classPrefix = 'event-container';
22
- var ModuleEvent = function ModuleEvent(props) {
22
+ var ModuleInterval = function ModuleInterval(props) {
23
23
  // 属性
24
24
  var _useContext = useContext(BizGlobalDataContext),
25
25
  currentApp = _useContext.currentApp,
@@ -135,7 +135,7 @@ var ModuleEvent = function ModuleEvent(props) {
135
135
  initSearch: initSearch
136
136
  })));
137
137
  };
138
- ModuleEvent.defaultProps = {
138
+ ModuleInterval.defaultProps = {
139
139
  includeToday: true
140
140
  };
141
- export default ModuleEvent;
141
+ export default ModuleInterval;
@@ -47,6 +47,7 @@ type ChartData = {
47
47
  x_axis?: string[];
48
48
  };
49
49
  };
50
+ export declare function convertDateArray(params: SearchValue | undefined, dateArray: string[]): string[] | undefined;
50
51
  /**
51
52
  * 获取查询结果的前10条
52
53
  * @param source 结果数据
@@ -1,12 +1,16 @@
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
- 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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
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; }
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; } } }; }
5
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; }
6
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; }
7
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; }
8
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
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); }
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
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."); }
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); }
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; }
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; } }
13
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
14
  import React from 'react';
11
15
  import { chartColors } from "../constants/color";
12
16
  import "../style/index.less";
@@ -165,6 +169,35 @@ function createNewArray(data) {
165
169
  return newArray;
166
170
  }
167
171
  }
172
+ export function convertDateArray(params, dateArray) {
173
+ if (dateArray) {
174
+ var _params$time;
175
+ switch (params === null || params === void 0 ? void 0 : (_params$time = params.time) === null || _params$time === void 0 ? void 0 : _params$time.unit) {
176
+ case 'week':
177
+ case 'month':
178
+ var convertedArray = dateArray === null || dateArray === void 0 ? void 0 : dateArray.map(function (dateRange) {
179
+ var _dateRange$split = dateRange.split('|'),
180
+ _dateRange$split2 = _slicedToArray(_dateRange$split, 2),
181
+ startDate = _dateRange$split2[0],
182
+ endDate = _dateRange$split2[1];
183
+ var formattedStartDate = startDate.split('-').slice(1).join('-');
184
+ var formattedEndDate = endDate.split('-').slice(1).join('-');
185
+ return "".concat(formattedStartDate, "\uFF5E").concat(formattedEndDate);
186
+ });
187
+ return convertedArray;
188
+ break;
189
+ default:
190
+ var weekdays = ['日', '一', '二', '三', '四', '五', '六'];
191
+ var resultArray = dateArray.map(function (date) {
192
+ var dateObj = new Date(date);
193
+ var weekday = weekdays[dateObj.getDay()];
194
+ return "".concat(date, " (").concat(weekday, ")");
195
+ });
196
+ return resultArray;
197
+ break;
198
+ }
199
+ }
200
+ }
168
201
  function getChildrenData(data, index) {
169
202
  var _data$app_data = data.app_data,
170
203
  series = _data$app_data.series,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-interval",
3
- "version": "1.0.0-interval.1",
3
+ "version": "1.0.0-interval.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",