@zgfe/modules-interval 1.0.0-interval.2 → 1.0.0-interval.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.
Files changed (58) hide show
  1. package/dist/esm/assets/business/demo_index.html +164 -26
  2. package/dist/esm/assets/business/iconfont.css +31 -7
  3. package/dist/esm/assets/business/iconfont.js +10 -10
  4. package/dist/esm/assets/business/iconfont.json +49 -7
  5. package/dist/esm/assets/business/iconfont.ttf +0 -0
  6. package/dist/esm/assets/business/iconfont.woff +0 -0
  7. package/dist/esm/assets/business/iconfont.woff2 +0 -0
  8. package/dist/esm/components/common/index.js +1 -1
  9. package/dist/esm/components/common/styles/index.less +11 -7
  10. package/dist/esm/components/eventFilter/index.js +21 -18
  11. package/dist/esm/components/eventFilter/styles/index.less +1 -4
  12. package/dist/esm/components/eventFilter/types.d.ts +2 -0
  13. package/dist/esm/components/renderContent/index.js +10 -11
  14. package/dist/esm/components/renderContent/styles/index.less +13 -2
  15. package/dist/esm/components/searchPanel/index.js +9 -4
  16. package/dist/esm/components/searchPanel/styles/index.less +34 -28
  17. package/dist/esm/components/table/index.js +13 -87
  18. package/dist/esm/components/table/styles/index.less +1 -1
  19. package/dist/esm/components/topBar/index.js +42 -24
  20. package/dist/esm/components/topBar/styles/index.less +2 -1
  21. package/dist/esm/components/topBar/types.d.ts +4 -1
  22. package/dist/esm/constants/apis.js +1 -1
  23. package/dist/esm/constants/fields.d.ts +6 -78
  24. package/dist/esm/constants/fields.js +7 -47
  25. package/dist/esm/index.d.ts +2 -2
  26. package/dist/esm/index.js +2 -2
  27. package/dist/esm/modules/chart/demo/data.d.ts +34 -71
  28. package/dist/esm/modules/chart/demo/data.js +36 -488
  29. package/dist/esm/modules/chart/demo/index.js +8 -37
  30. package/dist/esm/modules/chart/index.d.ts +2 -2
  31. package/dist/esm/modules/chart/index.js +18 -14
  32. package/dist/esm/modules/chart/intervalChart.js +2 -2
  33. package/dist/esm/modules/chart/types.d.ts +1 -1
  34. package/dist/esm/modules/content/index.js +34 -20
  35. package/dist/esm/modules/content/styles/index.less +1 -1
  36. package/dist/esm/modules/content/types.d.ts +2 -1
  37. package/dist/esm/modules/content/utils.d.ts +16 -18
  38. package/dist/esm/modules/content/utils.js +31 -20
  39. package/dist/esm/modules/home/demo/create.js +0 -3
  40. package/dist/esm/modules/home/demo/edit.js +0 -3
  41. package/dist/esm/modules/home/demo/index.js +1 -4
  42. package/dist/esm/modules/home/demo/scene.js +0 -3
  43. package/dist/esm/modules/home/index.js +2 -1
  44. package/dist/esm/modules/home/styles/index.less +7 -3
  45. package/dist/esm/modules/topPanel/index.js +109 -80
  46. package/dist/esm/modules/topPanel/styles/index.less +126 -15
  47. package/dist/esm/modules/topPanel/types.d.ts +3 -1
  48. package/dist/esm/style/image/empty.png +0 -0
  49. package/dist/esm/style/index.less +8 -1
  50. package/dist/esm/types.d.ts +20 -4
  51. package/dist/esm/utils/formData.d.ts +27 -6
  52. package/dist/esm/utils/formData.js +63 -28
  53. package/package.json +2 -2
  54. package/dist/esm/modules/chart/demo/panel.d.ts +0 -3
  55. package/dist/esm/modules/chart/demo/panel.js +0 -30
  56. package/dist/esm/modules/topPanel/index.d.ts +0 -5
  57. package/dist/esm/utils/base64.d.ts +0 -29
  58. package/dist/esm/utils/base64.js +0 -132
@@ -11,15 +11,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
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
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { Button } from 'antd';
14
- import React, { useContext, useState } from 'react';
14
+ import React, { useContext, useEffect, useState } from 'react';
15
15
  import { BizAddToPanel, BizAddToScene, BizGlobalDataContext } from '@zgfe/business-lib';
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';
20
- var classPrefix = 'modules-event-topbar';
19
+ import { searchDataParams } from "../../modules/content/utils";
20
+ import { appVersionType } from '@zgfe/business-lib/es/context';
21
+ var classPrefix = 'modules-interval-topbar';
21
22
  var TopBar = function TopBar(props) {
22
- // console.log('TopBar', props);
23
23
  var _useContext = useContext(EventContext),
24
24
  panelId = _useContext.panelId,
25
25
  afterEditTarget = _useContext.afterEditTarget,
@@ -32,19 +32,23 @@ var TopBar = function TopBar(props) {
32
32
  _useState4 = _slicedToArray(_useState3, 2),
33
33
  showScene = _useState4[0],
34
34
  setShowScene = _useState4[1];
35
+ var _useState5 = useState(true),
36
+ _useState6 = _slicedToArray(_useState5, 2),
37
+ showLoading = _useState6[0],
38
+ setShowLoading = _useState6[1];
35
39
  var _useContext2 = useContext(BizGlobalDataContext),
36
40
  currentApp = _useContext2.currentApp;
37
41
  var searchData = props.searchData,
38
42
  platformChange = props.platformChange;
39
- var _useState5 = useState((searchData === null || searchData === void 0 ? void 0 : searchData.platform) === undefined ? 0 : searchData.platform),
40
- _useState6 = _slicedToArray(_useState5, 2),
41
- selectPlatform = _useState6[0],
42
- setselectPlatform = _useState6[1];
43
- // 看板弹窗类型
44
- var _useState7 = useState(),
43
+ var _useState7 = useState((searchData === null || searchData === void 0 ? void 0 : searchData.platform) === undefined ? 0 : searchData.platform),
45
44
  _useState8 = _slicedToArray(_useState7, 2),
46
- panelType = _useState8[0],
47
- setPanelType = _useState8[1];
45
+ selectPlatform = _useState8[0],
46
+ setselectPlatform = _useState8[1];
47
+ // 看板弹窗类型
48
+ var _useState9 = useState(),
49
+ _useState10 = _slicedToArray(_useState9, 2),
50
+ panelType = _useState10[0],
51
+ setPanelType = _useState10[1];
48
52
 
49
53
  // 关闭弹窗
50
54
  var closeHandle = function closeHandle(type) {
@@ -55,7 +59,11 @@ var TopBar = function TopBar(props) {
55
59
  setShowScene(false);
56
60
  }
57
61
  };
58
-
62
+ useEffect(function () {
63
+ if (props.eventData !== undefined) {
64
+ setShowLoading(false);
65
+ }
66
+ }, [props.eventData]);
59
67
  // 保存
60
68
  var _onOk = function onOk(type, val) {
61
69
  // console.log('onOk', type, val);
@@ -67,15 +75,18 @@ var TopBar = function TopBar(props) {
67
75
  }, !panelId && /*#__PURE__*/React.createElement("div", {
68
76
  className: "".concat(classPrefix, "-panel")
69
77
  }, /*#__PURE__*/React.createElement(Button, {
78
+ disabled: showLoading,
70
79
  onClick: function onClick() {
71
80
  setShowPanel(true);
72
81
  }
73
82
  }, "\u6DFB\u52A0\u5230\u770B\u677F"), showPanel && /*#__PURE__*/React.createElement(BizAddToPanel, {
74
83
  type: panelType,
75
- params: _objectSpread({
76
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
77
- module: 'event'
78
- }, searchData),
84
+ params: _objectSpread(_objectSpread({
85
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
86
+ module: 'interval'
87
+ }, searchDataParams(searchData)), {}, {
88
+ chartType: 'boxplot'
89
+ }),
79
90
  styleOptions: chartTypes,
80
91
  onCancel: function onCancel() {
81
92
  return closeHandle('panel');
@@ -86,13 +97,14 @@ var TopBar = function TopBar(props) {
86
97
  })), enableAddScene && /*#__PURE__*/React.createElement("div", {
87
98
  className: "".concat(classPrefix, "-scene")
88
99
  }, /*#__PURE__*/React.createElement(Button, {
100
+ disabled: showLoading,
89
101
  onClick: function onClick() {
90
102
  setShowScene(true);
91
103
  }
92
104
  }, "\u6DFB\u52A0\u5E38\u7528\u573A\u666F"), showScene && /*#__PURE__*/React.createElement(BizAddToScene, {
93
105
  params: _objectSpread({
94
- app_id: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
95
- module: 'event'
106
+ appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
107
+ module: 'interval'
96
108
  }, searchData),
97
109
  onOk: function onOk(data) {
98
110
  return _onOk('scene', data);
@@ -100,15 +112,21 @@ var TopBar = function TopBar(props) {
100
112
  onCancel: function onCancel() {
101
113
  return closeHandle('scene');
102
114
  }
103
- })), /*#__PURE__*/React.createElement(Button, {
115
+ })), (currentApp === null || currentApp === void 0 ? void 0 : currentApp.appVersion) === appVersionType.CityCommercialBank ? /*#__PURE__*/React.createElement(Button, {
104
116
  className: "".concat(classPrefix, "-earlywarning"),
105
117
  type: "primary",
118
+ disabled: showLoading,
106
119
  onClick: function onClick() {
107
- /*#__PURE__*/React.createElement(Link, {
108
- to: "/manage/warning/list"
109
- }, "Home");
120
+ props.onUserDrill({
121
+ appId: Number(currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId),
122
+ module: 'interval',
123
+ platform: 0,
124
+ count: 0,
125
+ source: '',
126
+ url: ''
127
+ }, searchData);
110
128
  }
111
- }, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66"), /*#__PURE__*/React.createElement("div", {
129
+ }, "\u8BBE\u7F6E\u6D41\u5931\u9884\u8B66") : null, /*#__PURE__*/React.createElement("div", {
112
130
  className: "".concat(classPrefix, "-platform")
113
131
  }, platformOption.map(function (item) {
114
132
  return /*#__PURE__*/React.createElement("div", {
@@ -1,6 +1,6 @@
1
1
  @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
2
 
3
- .modules-event-topbar {
3
+ .modules-interval-topbar {
4
4
  display: flex;
5
5
  justify-content: flex-end;
6
6
  margin: 8px 0;
@@ -21,6 +21,7 @@
21
21
  > div {
22
22
  position: relative;
23
23
  padding: 0 16px;
24
+ font-size: 14px;
24
25
  background: #fff;
25
26
  border: 1px solid #ecedf0;
26
27
  cursor: pointer;
@@ -1,8 +1,11 @@
1
- import { SearchValue } from '../../types';
1
+ import { ResponseDataProps, SearchValue, UserDrillParamsProp } from '../../types';
2
2
  export interface TopBarProps {
3
3
  /**
4
4
  * @description 标题
5
5
  */
6
6
  searchData?: SearchValue;
7
+ loading?: boolean;
8
+ eventData?: ResponseDataProps;
9
+ onUserDrill: (data: UserDrillParamsProp, searchData: SearchValue) => void;
7
10
  platformChange: (data: number) => void;
8
11
  }
@@ -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: '/interval/downLoadintervalData.jsp'
5
+ eventDownloadReport: '/zg/web/v2/interval/downLoadintervalData'
6
6
  };
7
7
  export default Apis;
@@ -2,35 +2,11 @@ export declare const platformOption: {
2
2
  key: number;
3
3
  value: string;
4
4
  }[];
5
- export declare const chartTypes: ({
5
+ export declare const chartTypes: {
6
6
  label: string;
7
7
  value: string;
8
8
  icon: string;
9
- children?: undefined;
10
- disabled?: undefined;
11
- } | {
12
- label: string;
13
- icon: string;
14
- value: string;
15
- children: ({
16
- label: string;
17
- value: string;
18
- icon: string;
19
- disabled?: undefined;
20
- } | {
21
- label: string;
22
- value: string;
23
- icon: string;
24
- disabled: boolean;
25
- })[];
26
- disabled?: undefined;
27
- } | {
28
- label: string;
29
- value: string;
30
- icon: string;
31
- disabled: boolean;
32
- children?: undefined;
33
- })[];
9
+ }[];
34
10
  export declare const addPanelFields: ({
35
11
  label: string;
36
12
  name: string;
@@ -66,35 +42,11 @@ export declare const addPanelFields: ({
66
42
  label: string;
67
43
  name: string;
68
44
  type: string;
69
- options: ({
70
- label: string;
71
- value: string;
72
- icon: string;
73
- children?: undefined;
74
- disabled?: undefined;
75
- } | {
76
- label: string;
77
- icon: string;
78
- value: string;
79
- children: ({
80
- label: string;
81
- value: string;
82
- icon: string;
83
- disabled?: undefined;
84
- } | {
85
- label: string;
86
- value: string;
87
- icon: string;
88
- disabled: boolean;
89
- })[];
90
- disabled?: undefined;
91
- } | {
45
+ options: {
92
46
  label: string;
93
47
  value: string;
94
48
  icon: string;
95
- disabled: boolean;
96
- children?: undefined;
97
- })[];
49
+ }[];
98
50
  rules: {
99
51
  required: boolean;
100
52
  message: string;
@@ -128,35 +80,11 @@ export declare const editPanelFields: ({
128
80
  label: string;
129
81
  name: string;
130
82
  type: string;
131
- options: ({
132
- label: string;
133
- value: string;
134
- icon: string;
135
- children?: undefined;
136
- disabled?: undefined;
137
- } | {
138
- label: string;
139
- icon: string;
140
- value: string;
141
- children: ({
142
- label: string;
143
- value: string;
144
- icon: string;
145
- disabled?: undefined;
146
- } | {
147
- label: string;
148
- value: string;
149
- icon: string;
150
- disabled: boolean;
151
- })[];
152
- disabled?: undefined;
153
- } | {
83
+ options: {
154
84
  label: string;
155
85
  value: string;
156
86
  icon: string;
157
- disabled: boolean;
158
- children?: undefined;
159
- })[];
87
+ }[];
160
88
  rules: {
161
89
  required: boolean;
162
90
  message: string;
@@ -2,59 +2,19 @@ export var platformOption = [{
2
2
  key: 0,
3
3
  value: '全部'
4
4
  }, {
5
- key: 1,
6
- value: 'Android'
5
+ key: 3,
6
+ value: 'JS'
7
7
  }, {
8
8
  key: 2,
9
9
  value: 'IOS'
10
10
  }, {
11
- key: 3,
12
- value: 'JS'
11
+ key: 1,
12
+ value: 'Android'
13
13
  }];
14
14
  export var chartTypes = [{
15
- label: '趋势图',
16
- value: 'line',
17
- icon: 'qushitu1'
18
- }, {
19
- label: '汇总图',
20
- value: 'bar',
21
- icon: 'huizongtu'
22
- }, {
23
- label: '占比图',
24
- value: 'pie',
25
- icon: 'bingtu'
26
- }, {
27
- label: '表格',
28
- icon: 'biaoge',
29
- value: 'grid',
30
- children: [{
31
- label: '',
32
- value: 'line',
33
- icon: 'qushitu1'
34
- }, {
35
- label: '',
36
- value: 'bar',
37
- icon: 'huizongtu'
38
- }, {
39
- label: '',
40
- value: 'pie',
41
- icon: 'bingtu'
42
- }, {
43
- label: '',
44
- value: 'map',
45
- icon: 'ditu',
46
- disabled: true
47
- }]
48
- }, {
49
- label: '地图',
50
- value: 'map',
51
- icon: 'ditu',
52
- disabled: true
53
- }, {
54
- label: '数值',
55
- value: 'number',
56
- icon: 'fenshu',
57
- disabled: true
15
+ label: '盒须图',
16
+ value: 'boxplot',
17
+ icon: 'hexutu'
58
18
  }];
59
19
 
60
20
  // 添加看板弹窗内容
@@ -1,4 +1,4 @@
1
1
  /// <reference path="../typings.d.ts" />
2
- import EventChart from './modules/chart';
2
+ import IntervalEventChart from './modules/chart';
3
3
  import ModuleInterval from './modules/home';
4
- export { ModuleInterval, EventChart };
4
+ export { ModuleInterval, IntervalEventChart };
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference path="../typings.d.ts" />
2
- import EventChart from "./modules/chart";
2
+ import IntervalEventChart from "./modules/chart";
3
3
  import ModuleInterval from "./modules/home";
4
- export { ModuleInterval, EventChart };
4
+ export { ModuleInterval, IntervalEventChart };
@@ -1,79 +1,42 @@
1
- export declare const result: {
2
- xAxis: string[];
3
- series: ({
4
- duration: never[];
5
- index: string;
6
- names: string[];
7
- values: number[];
8
- } | {
9
- duration: {
10
- name: string;
11
- values: number[];
12
- }[];
13
- index: null;
14
- names: string[];
15
- values: number[];
16
- })[];
17
- };
18
- export declare const totalResult: {
19
- xAxis: string[];
20
- series: ({
21
- duration: never[];
22
- index: string;
23
- names: string[];
24
- original_names: never[];
25
- p_total: never[];
26
- total: never[];
27
- values: number[];
28
- } | {
29
- duration: never[];
30
- index: null;
31
- names: string[];
32
- original_names: never[];
33
- p_total: never[];
34
- total: never[];
35
- values: number[];
36
- })[];
37
- };
38
1
  export declare const searchData: {
39
- targets: {
40
- type: string;
41
- alias: string;
42
- eventId: number;
43
- eventName: string;
44
- eventGroupId: number;
45
- analysisDimension: {
46
- analysisIndex: string;
47
- };
48
- }[];
49
- userGroup: number[];
2
+ appId: number;
50
3
  time: {
51
- unit: string;
52
- relative: number[];
53
- begin: string;
54
- end: string;
4
+ dimensionDate: string;
5
+ beginDate: string;
6
+ endDate: string;
55
7
  };
56
- chartType: string;
57
- };
58
- export declare const totalSearchData: {
59
- appId: number;
60
8
  platform: number;
61
- targets: {
62
- type: string;
63
- alias: string;
9
+ userGroup: number[];
10
+ start: {
11
+ operator: string;
64
12
  eventId: number;
65
13
  eventName: string;
66
- eventGroupId: number;
67
- analysisDimension: {
68
- analysisIndex: string;
69
- };
70
- }[];
71
- userGroup: number[];
72
- time: {
73
- unit: string;
74
- relative: number[];
75
- begin: string;
76
- end: string;
77
14
  };
78
- chartType: string;
15
+ end: {
16
+ operator: string;
17
+ eventId: number;
18
+ eventName: string;
19
+ };
20
+ dimension: null;
21
+ };
22
+ export declare const searchDataParams: {
23
+ appData: {
24
+ huanbi: never[];
25
+ series: {
26
+ diyTarget: boolean;
27
+ duration: never[];
28
+ index: null;
29
+ names: never[];
30
+ originalNames: never[];
31
+ pNext: never[];
32
+ pTotal: never[];
33
+ resultFormat: null;
34
+ total: never[];
35
+ values: number[][];
36
+ }[];
37
+ tongbi: never[];
38
+ total: never[];
39
+ xAxis: string[];
40
+ yesterDay: never[];
41
+ };
79
42
  };