@zgfe/modules-interval 1.0.0-interval.1

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 (121) hide show
  1. package/README.md +33 -0
  2. package/dist/esm/assets/business/demo.css +539 -0
  3. package/dist/esm/assets/business/demo_index.html +3178 -0
  4. package/dist/esm/assets/business/iconfont.css +535 -0
  5. package/dist/esm/assets/business/iconfont.js +43 -0
  6. package/dist/esm/assets/business/iconfont.json +919 -0
  7. package/dist/esm/assets/business/iconfont.ttf +0 -0
  8. package/dist/esm/assets/business/iconfont.woff +0 -0
  9. package/dist/esm/assets/business/iconfont.woff2 +0 -0
  10. package/dist/esm/assets/icons/demo.css +539 -0
  11. package/dist/esm/assets/icons/demo_index.html +9618 -0
  12. package/dist/esm/assets/icons/iconfont.css +1655 -0
  13. package/dist/esm/assets/icons/iconfont.js +43 -0
  14. package/dist/esm/assets/icons/iconfont.json +2879 -0
  15. package/dist/esm/assets/icons/iconfont.ttf +0 -0
  16. package/dist/esm/assets/icons/iconfont.woff +0 -0
  17. package/dist/esm/assets/icons/iconfont.woff2 +0 -0
  18. package/dist/esm/assets/images/empty@2x.png +0 -0
  19. package/dist/esm/assets/images/empty_state.png +0 -0
  20. package/dist/esm/assets/images/table_nodata.png +0 -0
  21. package/dist/esm/components/common/index.d.ts +6 -0
  22. package/dist/esm/components/common/index.js +21 -0
  23. package/dist/esm/components/common/styles/index.less +27 -0
  24. package/dist/esm/components/eventFilter/index.d.ts +5 -0
  25. package/dist/esm/components/eventFilter/index.js +187 -0
  26. package/dist/esm/components/eventFilter/styles/index.less +42 -0
  27. package/dist/esm/components/eventFilter/types.d.ts +50 -0
  28. package/dist/esm/components/eventFilter/types.js +1 -0
  29. package/dist/esm/components/index.d.ts +5 -0
  30. package/dist/esm/components/index.js +5 -0
  31. package/dist/esm/components/renderContent/index.d.ts +5 -0
  32. package/dist/esm/components/renderContent/index.js +58 -0
  33. package/dist/esm/components/renderContent/styles/index.less +23 -0
  34. package/dist/esm/components/renderContent/types.d.ts +31 -0
  35. package/dist/esm/components/renderContent/types.js +1 -0
  36. package/dist/esm/components/searchPanel/index.d.ts +5 -0
  37. package/dist/esm/components/searchPanel/index.js +122 -0
  38. package/dist/esm/components/searchPanel/styles/index.less +59 -0
  39. package/dist/esm/components/searchPanel/types.d.ts +49 -0
  40. package/dist/esm/components/searchPanel/types.js +1 -0
  41. package/dist/esm/components/table/index.d.ts +6 -0
  42. package/dist/esm/components/table/index.js +199 -0
  43. package/dist/esm/components/table/styles/index.less +123 -0
  44. package/dist/esm/components/table/types.d.ts +26 -0
  45. package/dist/esm/components/table/types.js +1 -0
  46. package/dist/esm/components/topBar/index.d.ts +5 -0
  47. package/dist/esm/components/topBar/index.js +121 -0
  48. package/dist/esm/components/topBar/styles/index.less +49 -0
  49. package/dist/esm/components/topBar/types.d.ts +8 -0
  50. package/dist/esm/components/topBar/types.js +1 -0
  51. package/dist/esm/constants/apis.d.ts +6 -0
  52. package/dist/esm/constants/apis.js +7 -0
  53. package/dist/esm/constants/chart.d.ts +2 -0
  54. package/dist/esm/constants/chart.js +31 -0
  55. package/dist/esm/constants/color.d.ts +2 -0
  56. package/dist/esm/constants/color.js +9 -0
  57. package/dist/esm/constants/fields.d.ts +226 -0
  58. package/dist/esm/constants/fields.js +219 -0
  59. package/dist/esm/constants/index.d.ts +6 -0
  60. package/dist/esm/constants/index.js +6 -0
  61. package/dist/esm/constants/initData.d.ts +2 -0
  62. package/dist/esm/constants/initData.js +11 -0
  63. package/dist/esm/index.d.ts +4 -0
  64. package/dist/esm/index.js +4 -0
  65. package/dist/esm/modules/chart/customTooltip.d.ts +7 -0
  66. package/dist/esm/modules/chart/customTooltip.js +37 -0
  67. package/dist/esm/modules/chart/demo/data.d.ts +79 -0
  68. package/dist/esm/modules/chart/demo/data.js +495 -0
  69. package/dist/esm/modules/chart/demo/index.d.ts +3 -0
  70. package/dist/esm/modules/chart/demo/index.js +51 -0
  71. package/dist/esm/modules/chart/demo/panel.d.ts +3 -0
  72. package/dist/esm/modules/chart/demo/panel.js +30 -0
  73. package/dist/esm/modules/chart/index.d.ts +4 -0
  74. package/dist/esm/modules/chart/index.js +100 -0
  75. package/dist/esm/modules/chart/index.less +48 -0
  76. package/dist/esm/modules/chart/intervalChart.d.ts +4 -0
  77. package/dist/esm/modules/chart/intervalChart.js +136 -0
  78. package/dist/esm/modules/chart/types.d.ts +37 -0
  79. package/dist/esm/modules/chart/types.js +2 -0
  80. package/dist/esm/modules/content/index.d.ts +5 -0
  81. package/dist/esm/modules/content/index.js +272 -0
  82. package/dist/esm/modules/content/styles/index.less +7 -0
  83. package/dist/esm/modules/content/types.d.ts +29 -0
  84. package/dist/esm/modules/content/types.js +2 -0
  85. package/dist/esm/modules/content/utils.d.ts +21 -0
  86. package/dist/esm/modules/content/utils.js +51 -0
  87. package/dist/esm/modules/home/demo/create.d.ts +3 -0
  88. package/dist/esm/modules/home/demo/create.js +51 -0
  89. package/dist/esm/modules/home/demo/edit.d.ts +3 -0
  90. package/dist/esm/modules/home/demo/edit.js +90 -0
  91. package/dist/esm/modules/home/demo/index.d.ts +4 -0
  92. package/dist/esm/modules/home/demo/index.js +51 -0
  93. package/dist/esm/modules/home/demo/scene.d.ts +3 -0
  94. package/dist/esm/modules/home/demo/scene.js +87 -0
  95. package/dist/esm/modules/home/demo/styles/index.less +33 -0
  96. package/dist/esm/modules/home/index.d.ts +5 -0
  97. package/dist/esm/modules/home/index.js +141 -0
  98. package/dist/esm/modules/home/styles/index.less +53 -0
  99. package/dist/esm/modules/home/types.d.ts +69 -0
  100. package/dist/esm/modules/home/types.js +2 -0
  101. package/dist/esm/modules/topPanel/index.d.ts +5 -0
  102. package/dist/esm/modules/topPanel/index.js +250 -0
  103. package/dist/esm/modules/topPanel/styles/index.less +67 -0
  104. package/dist/esm/modules/topPanel/types.d.ts +54 -0
  105. package/dist/esm/modules/topPanel/types.js +1 -0
  106. package/dist/esm/style/image/noData.png +0 -0
  107. package/dist/esm/style/image/ring.svg +9 -0
  108. package/dist/esm/style/index.less +46 -0
  109. package/dist/esm/style/theme.d.ts +15 -0
  110. package/dist/esm/style/theme.js +16 -0
  111. package/dist/esm/types.d.ts +169 -0
  112. package/dist/esm/types.js +19 -0
  113. package/dist/esm/utils/ajaxConfig.d.ts +8 -0
  114. package/dist/esm/utils/ajaxConfig.js +47 -0
  115. package/dist/esm/utils/base64.d.ts +29 -0
  116. package/dist/esm/utils/base64.js +132 -0
  117. package/dist/esm/utils/formData.d.ts +76 -0
  118. package/dist/esm/utils/formData.js +258 -0
  119. package/dist/esm/utils/util.d.ts +66 -0
  120. package/dist/esm/utils/util.js +177 -0
  121. package/package.json +61 -0
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import './styles/index.less';
3
+ export declare const MiSpin: React.FC;
4
+ export declare const MiNone: React.FC<{
5
+ label?: string;
6
+ }>;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import "./styles/index.less";
3
+ var classPrefix = 'mi-common';
4
+
5
+ // 加载按钮
6
+ export var MiSpin = function MiSpin() {
7
+ return /*#__PURE__*/React.createElement("div", {
8
+ className: "".concat(classPrefix, "-loading-icon")
9
+ });
10
+ };
11
+
12
+ // 无数据状态
13
+ export var MiNone = function MiNone(props) {
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: "".concat(classPrefix, "-none-container")
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: "".concat(classPrefix, "-none")
18
+ }), /*#__PURE__*/React.createElement("span", {
19
+ className: "".concat(classPrefix, "-none-text")
20
+ }, " ", props.label));
21
+ };
@@ -0,0 +1,27 @@
1
+ @import '~@zgfe/business-lib/es/assets/styles/inner.less';
2
+
3
+ .mi-common {
4
+ &-loading-icon {
5
+ z-index: 1000;
6
+ display: inline-block;
7
+ width: 40px;
8
+ height: 40px;
9
+ background: url('../../../style/image/ring.svg') no-repeat;
10
+ background-size: contain;
11
+ }
12
+
13
+ &-none-text {
14
+ color: @text-color;
15
+ font-size: 16px;
16
+ }
17
+
18
+ &-none {
19
+ width: 348px;
20
+ height: 132px;
21
+ background: url('../../../style/image/noData.png') no-repeat;
22
+ }
23
+
24
+ &-none-container {
25
+ text-align: center;
26
+ }
27
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './styles/index.less';
3
+ import { EventFilterProps } from './types';
4
+ declare const EventFilter: React.FC<EventFilterProps>;
5
+ export default EventFilter;
@@ -0,0 +1,187 @@
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 { Switch, Tooltip } from 'antd';
14
+ import React, { useEffect, useRef, useState } from 'react';
15
+ import { BizEventSelector, IconFont, BizAttrConditionGroup } from '@zgfe/business-lib';
16
+ import "./styles/index.less";
17
+ import _ from 'lodash';
18
+ var classPrefix = 'eventfilter-box';
19
+ var EventFilter = function EventFilter(props) {
20
+ // 筛选条件个数
21
+ var _useState = useState(0),
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ count = _useState2[0],
24
+ setCount = _useState2[1];
25
+ // 是否点击添加
26
+ var _useState3 = useState(false),
27
+ _useState4 = _slicedToArray(_useState3, 2),
28
+ isAdd = _useState4[0],
29
+ setIsAdd = _useState4[1];
30
+ // 筛选条件组ref
31
+ var conditionRef = useRef(null);
32
+ // 当前选中的事件
33
+ var _useState5 = useState({
34
+ id: -100,
35
+ name: '事件概览'
36
+ }),
37
+ _useState6 = _slicedToArray(_useState5, 2),
38
+ event = _useState6[0],
39
+ setEvent = _useState6[1];
40
+ // 是否为事件概览, true展示
41
+ var _useState7 = useState(false),
42
+ _useState8 = _slicedToArray(_useState7, 2),
43
+ eventOverview = _useState8[0],
44
+ setEventOverview = _useState8[1];
45
+ // 关联属性
46
+ var _useState9 = useState(false),
47
+ _useState10 = _slicedToArray(_useState9, 2),
48
+ relevancy = _useState10[0],
49
+ setRelevancy = _useState10[1];
50
+ // 筛选属性组
51
+ var _useState11 = useState(),
52
+ _useState12 = _slicedToArray(_useState11, 2),
53
+ filter = _useState12[0],
54
+ setFilter = _useState12[1];
55
+ // 细分属性初始值
56
+ var _useState13 = useState(),
57
+ _useState14 = _slicedToArray(_useState13, 2),
58
+ bizAttributeSelectorValue = _useState14[0],
59
+ setBizAttributeSelectorValue = _useState14[1];
60
+
61
+ // 初始化
62
+ useEffect(function () {
63
+ if (props.value) {
64
+ var _data = props.value;
65
+ if (_data && _data.id) {
66
+ setEvent({
67
+ id: _data.id,
68
+ name: _data.name
69
+ });
70
+ setEventOverview(true);
71
+ }
72
+ if (_data.filters) {
73
+ setFilter(_data.filters);
74
+ }
75
+ if (_data.dimension) {
76
+ setBizAttributeSelectorValue(_objectSpread(_objectSpread({}, _data.dimension), {}, {
77
+ key: _data.dimension.propCategory === 'eventProp' ? _data.dimension.value : _data.dimension.propCategory + '-' + _data.dimension.value
78
+ }));
79
+ }
80
+ }
81
+ }, []);
82
+
83
+ // 添加筛选
84
+ var onAdd = function onAdd() {
85
+ if (event.id === -1) {
86
+ return;
87
+ }
88
+ // 最多可添加10条属性筛选
89
+ if (count >= 10) {
90
+ return;
91
+ }
92
+ setIsAdd(true);
93
+ setTimeout(function () {
94
+ conditionRef.current.add();
95
+ }, 0);
96
+ };
97
+
98
+ // 筛选条件改变
99
+ var onChangeFilters = function onChangeFilters(data) {
100
+ if (data && data.conditions && data.conditions.length > 0) {
101
+ setFilter(data);
102
+ } else {
103
+ setFilter(undefined);
104
+ setIsAdd(false);
105
+ }
106
+ };
107
+ var onChangeEvent = function onChangeEvent(event) {
108
+ if (event && event.event && event.event.id === -100) {
109
+ setEventOverview(false);
110
+ } else {
111
+ setEventOverview(true);
112
+ }
113
+ if (event && event.event) {
114
+ setEvent(event.event);
115
+ props.onChange && props.onChange(event.event);
116
+ }
117
+ setBizAttributeSelectorValue(undefined);
118
+ setFilter(undefined);
119
+ setIsAdd(false);
120
+ setCount(0);
121
+ };
122
+
123
+ // 变更searchData
124
+ useEffect(function () {
125
+ var _event = {
126
+ id: event.id,
127
+ name: event.name
128
+ };
129
+ if (filter) {
130
+ _event.filters = filter;
131
+ }
132
+ if (bizAttributeSelectorValue) {
133
+ var _dimension = _.cloneDeep(bizAttributeSelectorValue);
134
+ delete _dimension.key;
135
+ _event.dimension = _dimension;
136
+ }
137
+ if (props.relevancy && relevancy !== undefined) {
138
+ _event.relevancy = relevancy;
139
+ }
140
+ props.onChange && props.onChange(_event);
141
+ }, [bizAttributeSelectorValue, filter, event, relevancy]);
142
+ return /*#__PURE__*/React.createElement("div", {
143
+ className: classPrefix
144
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(BizEventSelector, {
145
+ showAllEvent: true,
146
+ showBuiltInTarget: false,
147
+ popupContainer: false,
148
+ defaultSelectAble: false,
149
+ value: {
150
+ event: event
151
+ },
152
+ onChange: onChangeEvent,
153
+ placeholder: "\u8BF7\u9009\u62E9\u4E8B\u4EF6"
154
+ }), eventOverview && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
155
+ placement: "top",
156
+ title: '添加属性筛选'
157
+ }, /*#__PURE__*/React.createElement(IconFont, {
158
+ className: "".concat(count >= 10 || event.id === -1 ? 'disable' : ''),
159
+ type: "shaixuan",
160
+ onClick: function onClick() {
161
+ return onAdd();
162
+ }
163
+ }))), props !== null && props !== void 0 && props.relevancy && eventOverview ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switch, {
164
+ size: "default",
165
+ style: {
166
+ marginLeft: 24
167
+ },
168
+ checked: relevancy,
169
+ onChange: function onChange(checked) {
170
+ return setRelevancy(checked);
171
+ }
172
+ }), /*#__PURE__*/React.createElement("span", {
173
+ className: "switch-title"
174
+ }, "\u8BBE\u7F6E\u5173\u8054\u5C5E\u6027")) : ''), (filter || isAdd) && /*#__PURE__*/React.createElement("div", {
175
+ className: "".concat(count > 0 ? 'attr-box-show' : '', " top")
176
+ }, /*#__PURE__*/React.createElement(BizAttrConditionGroup, {
177
+ ref: conditionRef,
178
+ value: filter,
179
+ onlyAnd: true,
180
+ enableEventProp: true,
181
+ enableDelete: true,
182
+ eventIdList: [event.id],
183
+ onChange: onChangeFilters,
184
+ onConditionsCount: setCount
185
+ })));
186
+ };
187
+ export default EventFilter;
@@ -0,0 +1,42 @@
1
+ .eventfilter-box {
2
+ > :nth-child(1) {
3
+ display: flex;
4
+ display: flex;
5
+ gap: 16px;
6
+ align-items: center;
7
+ margin-bottom: 12px;
8
+ margin-bottom: 12px;
9
+
10
+ .biz-event-select,
11
+ .biz-attr-select {
12
+ width: 208px;
13
+ }
14
+
15
+ .shaixuan {
16
+ margin-top: 2px;
17
+ color: #9aa1a9;
18
+ font-size: 20px !important;
19
+ cursor: pointer;
20
+ }
21
+
22
+ .shaixuan:hover {
23
+ color: #165dff;
24
+ }
25
+
26
+ .disable {
27
+ color: #ccd0d4 !important;
28
+ cursor: not-allowed !important;
29
+ }
30
+
31
+ .switch-title {
32
+ margin-left: -8px;
33
+ color: var(--io-n-8, #354354);
34
+ font-weight: 400;
35
+ font-size: 14px;
36
+ font-family: PingFang SC;
37
+ font-style: normal;
38
+ line-height: normal;
39
+ letter-spacing: 1px;
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,50 @@
1
+ import { eventProps } from '../../types';
2
+ /**
3
+ * 事件属性
4
+ */
5
+ export interface ConditionsnProps {
6
+ /**
7
+ * 属性id
8
+ */
9
+ attrId: number | undefined;
10
+ /**
11
+ * 属性类型
12
+ */
13
+ propCategory: string | undefined;
14
+ /**
15
+ * 类型
16
+ */
17
+ type: string | undefined;
18
+ /**
19
+ * id
20
+ */
21
+ id?: number | undefined;
22
+ /**
23
+ * 名字
24
+ */
25
+ name?: string | undefined;
26
+ /**
27
+ * 类别
28
+ */
29
+ category?: string | undefined;
30
+ /**
31
+ * 属性name
32
+ */
33
+ attrName?: string | undefined;
34
+ /**
35
+ * 属性label
36
+ */
37
+ label?: string | undefined;
38
+ /**
39
+ * dimensionSub
40
+ */
41
+ dimensionSub?: string | undefined;
42
+ }
43
+ /**
44
+ * EventFilter组件
45
+ */
46
+ export interface EventFilterProps {
47
+ value?: eventProps;
48
+ relevancy?: boolean;
49
+ onChange?: (event: eventProps) => {};
50
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import ContentPanel from './renderContent';
2
+ import SearchPanel from './searchPanel';
3
+ import EventTable from './table';
4
+ import { MiNone, MiSpin } from './common';
5
+ export { ContentPanel, SearchPanel, EventTable, MiNone, MiSpin };
@@ -0,0 +1,5 @@
1
+ import ContentPanel from "./renderContent";
2
+ import SearchPanel from "./searchPanel";
3
+ import EventTable from "./table";
4
+ import { MiNone, MiSpin } from "./common";
5
+ export { ContentPanel, SearchPanel, EventTable, MiNone, MiSpin };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { RenderContentProps } from './types';
3
+ import './styles/index.less';
4
+ declare const ContentPanel: React.FC<RenderContentProps>;
5
+ export default ContentPanel;
@@ -0,0 +1,58 @@
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 { Spin } from 'antd';
8
+ import React, { useEffect, useState } from 'react';
9
+ import { MiNone, MiSpin } from '..';
10
+ import "./styles/index.less";
11
+ import EventChart from "../../modules/chart";
12
+ var classPrefix = 'render-content';
13
+ var ContentPanel = function ContentPanel(props) {
14
+ var _eventData$xAxis;
15
+ var loading = props.loading,
16
+ eventData = props.eventData,
17
+ searchData = props.searchData;
18
+
19
+ // 显示内容
20
+ var _useState = useState(props.showList || []),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ showList = _useState2[0],
23
+ setShowList = _useState2[1];
24
+ useEffect(function () {
25
+ setShowList(props.showList);
26
+ }, [eventData]);
27
+
28
+ // 表格筛选,取前10个
29
+ var onChangeShow = function onChangeShow(names) {
30
+ setShowList(names);
31
+ if (props.onChangeShow) props.onChangeShow(names);
32
+ };
33
+ if (loading) {
34
+ return /*#__PURE__*/React.createElement(Spin, {
35
+ className: "".concat(classPrefix, "-spin-container"),
36
+ tip: "\u67E5\u8BE2\u4E2D...",
37
+ indicator: /*#__PURE__*/React.createElement(MiSpin, null)
38
+ });
39
+ }
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: classPrefix
42
+ }, /*#__PURE__*/React.createElement("div", {
43
+ className: "".concat(classPrefix, "-chart-container")
44
+ }, eventData ? /*#__PURE__*/React.createElement(EventChart, {
45
+ dataSource: eventData,
46
+ params: searchData,
47
+ showList: showList
48
+ }) : /*#__PURE__*/React.createElement(MiNone, {
49
+ label: "\u6682\u65E0\u6570\u636E"
50
+ })), eventData && (_eventData$xAxis = eventData.xAxis) !== null && _eventData$xAxis !== void 0 && _eventData$xAxis.length ? /*#__PURE__*/React.createElement(EventChart, {
51
+ type: "grid",
52
+ dataSource: eventData,
53
+ params: searchData,
54
+ showList: showList,
55
+ onChangeShow: onChangeShow
56
+ }) : null);
57
+ };
58
+ export default ContentPanel;
@@ -0,0 +1,23 @@
1
+
2
+ .render-content {
3
+ &-chart-container {
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ justify-content: center;
8
+
9
+ .echarts-for-react {
10
+ width: 100%;
11
+ background: #fff;
12
+ border: 1px solid var(--unnamed, #ecedf0);
13
+ border-radius: 8px;
14
+ }
15
+ }
16
+
17
+ &-spin-container {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ min-height: 300px;
22
+ }
23
+ }
@@ -0,0 +1,31 @@
1
+ import { SearchValue, ResponseDataProps } from '../../types';
2
+ export interface RenderContentProps {
3
+ /**
4
+ * 查询状态
5
+ */
6
+ loading?: boolean;
7
+ /**
8
+ * 查询结果
9
+ */
10
+ eventData?: ResponseDataProps;
11
+ /**
12
+ * 查询条件
13
+ */
14
+ searchData?: SearchValue;
15
+ /**
16
+ * 显示列表
17
+ */
18
+ showList: string[];
19
+ /**
20
+ * 是否是城市
21
+ */
22
+ isCity?: boolean;
23
+ /**
24
+ * 添加或者编辑,另存为到看板,添加到常用场景成功之后回调
25
+ */
26
+ afterEditTarget?: (type: string, value?: any) => void;
27
+ /**
28
+ * 改变显示内容
29
+ */
30
+ onChangeShow?: (data: string[]) => void;
31
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './styles/index.less';
3
+ import { SearchPanelProps } from './types';
4
+ declare const SearchPanel: React.FC<SearchPanelProps>;
5
+ export default SearchPanel;
@@ -0,0 +1,122 @@
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 { BizDatePicker, BizSelect } from '@zgfe/business-lib';
14
+ import React, { useContext, useEffect, useState } from 'react';
15
+ import { chartTypeOptions, getInitDate } from "../../constants";
16
+ import { EventContext } from "../../types";
17
+ import "./styles/index.less";
18
+ import { extractNames } from "../../utils/formData";
19
+ var classPrefix = 'search-panel';
20
+ var SearchPanel = function SearchPanel(props) {
21
+ var _useContext = useContext(EventContext),
22
+ includeToday = _useContext.includeToday;
23
+ // 当前时间段
24
+ var _useState = useState(props.time || getInitDate(includeToday)),
25
+ _useState2 = _slicedToArray(_useState, 2),
26
+ time = _useState2[0],
27
+ setTime = _useState2[1];
28
+ // 当前图表类型
29
+ var _useState3 = useState(chartTypeOptions[0]),
30
+ _useState4 = _slicedToArray(_useState3, 2),
31
+ chart = _useState4[0],
32
+ setChart = _useState4[1];
33
+ var _useState5 = useState(0),
34
+ _useState6 = _slicedToArray(_useState5, 2),
35
+ timer = _useState6[0],
36
+ setTimer = _useState6[1];
37
+ var _useState7 = useState([]),
38
+ _useState8 = _slicedToArray(_useState7, 2),
39
+ displaySetupList = _useState8[0],
40
+ setDisplaySetupLIst = _useState8[1];
41
+ var _useState9 = useState([]),
42
+ _useState10 = _slicedToArray(_useState9, 2),
43
+ displaySetupSliceList = _useState10[0],
44
+ setDisplaySetupSliceList = _useState10[1];
45
+ // 查询维度
46
+ var _useState11 = useState({
47
+ analysisIndex: 'number'
48
+ }),
49
+ _useState12 = _slicedToArray(_useState11, 2),
50
+ dimension = _useState12[0],
51
+ setDimension = _useState12[1];
52
+ // 初始化表格表头和内容
53
+ useEffect(function () {
54
+ if (props !== null && props !== void 0 && props.eventData) {
55
+ var arr = extractNames(props === null || props === void 0 ? void 0 : props.eventData);
56
+ setDisplaySetupLIst(arr);
57
+ }
58
+ }, [props === null || props === void 0 ? void 0 : props.eventData]);
59
+ // 初始化
60
+ useEffect(function () {
61
+ if (props.chartType && props.chartType !== chart.value) {
62
+ setChart({
63
+ value: props.chartType
64
+ });
65
+ }
66
+ var _dimension = {
67
+ analysisIndex: 'number'
68
+ };
69
+ if (props.analysisIndex) {
70
+ _dimension = {
71
+ analysisIndex: props.analysisIndex
72
+ };
73
+ }
74
+ if (props.analysisAttr) {
75
+ // _dimension['analysisAttr'] = props.analysisAttr;
76
+ }
77
+ setDimension(_objectSpread({}, _dimension));
78
+ }, [props.chartType]);
79
+
80
+ // 时间改变
81
+ var onChangeTime = function onChangeTime(val) {
82
+ if (timer) clearTimeout(timer);
83
+ setTimer(setTimeout(function () {
84
+ setTime(val);
85
+ props.onChange && props.onChange(_objectSpread({
86
+ time: val,
87
+ chartType: chart.value
88
+ }, dimension));
89
+ }, 10));
90
+ };
91
+ // 显示设置选择
92
+ var onDimensionChange = function onDimensionChange(val) {
93
+ if (val) {
94
+ props.onChange && props.onChange({
95
+ time: time,
96
+ displaySetup: val
97
+ });
98
+ setDisplaySetupSliceList(val);
99
+ }
100
+ };
101
+ return /*#__PURE__*/React.createElement("div", {
102
+ className: classPrefix
103
+ }, /*#__PURE__*/React.createElement("div", {
104
+ style: {
105
+ display: 'flex'
106
+ }
107
+ }, /*#__PURE__*/React.createElement(BizDatePicker, {
108
+ defaultValue: time,
109
+ onChange: onChangeTime
110
+ }), /*#__PURE__*/React.createElement(BizSelect, {
111
+ multiple: true,
112
+ onChange: onDimensionChange,
113
+ className: "".concat(classPrefix, "-select"),
114
+ placeholder: "\u8BF7\u9009\u62E9\u663E\u793A\u8BBE\u7F6E",
115
+ enableSearch: true,
116
+ options: displaySetupList,
117
+ value: displaySetupSliceList.length > 0 ? displaySetupSliceList : displaySetupList.slice(0, 4),
118
+ labelField: "label",
119
+ keyField: "value"
120
+ })));
121
+ };
122
+ export default SearchPanel;