@zgfe/modules-interval 1.0.3-alpha.1 → 1.0.3-alpha.3
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.
- package/dist/esm/components/searchPanel/index.js +2 -2
- package/dist/esm/components/table/index.js +2 -2
- package/dist/esm/components/topBar/index.js +3 -3
- package/dist/esm/components/topBar/types.d.ts +3 -2
- package/dist/esm/modules/content/index.js +3 -3
- package/dist/esm/modules/content/types.d.ts +4 -2
- package/dist/esm/modules/home/index.d.ts +2 -2
- package/dist/esm/modules/home/index.js +5 -3
- package/dist/esm/modules/home/types.d.ts +4 -3
- package/dist/esm/modules/home/types.js +2 -2
- package/dist/esm/types.d.ts +15 -15
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils/formData.d.ts +2 -2
- package/package.json +2 -2
|
@@ -13,12 +13,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import { BizDatePicker, BizSelect } from '@zgfe/business-lib';
|
|
14
14
|
import React, { useContext, useEffect, useState } from 'react';
|
|
15
15
|
import { chartTypeOptions, getInitDate } from "../../constants";
|
|
16
|
-
import {
|
|
16
|
+
import { IntervalContext } from "../../types";
|
|
17
17
|
import "./styles/index.less";
|
|
18
18
|
import { extractNames } from "../../utils/formData";
|
|
19
19
|
var classPrefix = 'search-panel-interval';
|
|
20
20
|
var SearchPanel = function SearchPanel(props) {
|
|
21
|
-
var _useContext = useContext(
|
|
21
|
+
var _useContext = useContext(IntervalContext),
|
|
22
22
|
includeToday = _useContext.includeToday;
|
|
23
23
|
// 当前时间段
|
|
24
24
|
var _useState = useState(props.time || getInitDate(includeToday)),
|
|
@@ -17,7 +17,7 @@ import { message } from 'antd';
|
|
|
17
17
|
import { formTableData, getColumns } from "../../utils/formData";
|
|
18
18
|
import "./styles/index.less";
|
|
19
19
|
import { searchDataParams } from "../../modules/content/utils";
|
|
20
|
-
import {
|
|
20
|
+
import { IntervalContext } from "../../types";
|
|
21
21
|
var classPrefix = 'mi-interval-table';
|
|
22
22
|
var EventTable = function EventTable(props) {
|
|
23
23
|
var _dataSource$appData2;
|
|
@@ -35,7 +35,7 @@ var EventTable = function EventTable(props) {
|
|
|
35
35
|
eventGroupList = _useContext$eventGrou === void 0 ? [] : _useContext$eventGrou,
|
|
36
36
|
eventEnvList = _useContext.eventEnvList,
|
|
37
37
|
userPropList = _useContext.userPropList;
|
|
38
|
-
var _useContext2 = useContext(
|
|
38
|
+
var _useContext2 = useContext(IntervalContext),
|
|
39
39
|
panelName = _useContext2.panelName,
|
|
40
40
|
onUserDrill = _useContext2.onUserDrill;
|
|
41
41
|
|
|
@@ -14,12 +14,12 @@ import { Button } from 'antd';
|
|
|
14
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
|
-
import {
|
|
17
|
+
import { IntervalContext } from "../../types";
|
|
18
18
|
import { chartTypes, platformOption } from "../../constants/fields";
|
|
19
19
|
import { appVersionType } from '@zgfe/business-lib/es/context';
|
|
20
20
|
var classPrefix = 'modules-interval-topbar';
|
|
21
21
|
var TopBar = function TopBar(props) {
|
|
22
|
-
var _useContext = useContext(
|
|
22
|
+
var _useContext = useContext(IntervalContext),
|
|
23
23
|
panelId = _useContext.panelId,
|
|
24
24
|
afterEditTarget = _useContext.afterEditTarget,
|
|
25
25
|
enableAddScene = _useContext.enableAddScene;
|
|
@@ -118,7 +118,7 @@ var TopBar = function TopBar(props) {
|
|
|
118
118
|
type: "primary",
|
|
119
119
|
disabled: showLoading,
|
|
120
120
|
onClick: function onClick() {
|
|
121
|
-
props.
|
|
121
|
+
props.onJumpWarning({
|
|
122
122
|
appId: Number(currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId),
|
|
123
123
|
module: 'interval',
|
|
124
124
|
platform: 0,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IntervalProps } from '../../modules/home/types';
|
|
2
|
+
import { ResponseDataProps, SearchValue } from '../../types';
|
|
2
3
|
export interface TopBarProps {
|
|
3
4
|
/**
|
|
4
5
|
* @description 标题
|
|
@@ -6,6 +7,6 @@ export interface TopBarProps {
|
|
|
6
7
|
searchData?: SearchValue;
|
|
7
8
|
loading?: boolean;
|
|
8
9
|
eventData?: ResponseDataProps;
|
|
9
|
-
|
|
10
|
+
onJumpWarning: IntervalProps.Props['onJumpWarning'];
|
|
10
11
|
platformChange: (data: number) => void;
|
|
11
12
|
}
|
|
@@ -14,7 +14,7 @@ import { ajax, BizGlobalDataContext, BizLayout, BizTargetFromPanelContext } from
|
|
|
14
14
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
15
15
|
import Request from 'umi-request';
|
|
16
16
|
import TopBar from "../../components/topBar";
|
|
17
|
-
import {
|
|
17
|
+
import { IntervalContext } from "../../types";
|
|
18
18
|
import "./styles/index.less";
|
|
19
19
|
import { Apis } from "../../constants";
|
|
20
20
|
import { judgeIsCity, judgeIsArea, getValue, searchDataParams } from "./utils";
|
|
@@ -64,7 +64,7 @@ var EventContent = function EventContent(props) {
|
|
|
64
64
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
65
65
|
eventId = _useState16[0],
|
|
66
66
|
setEventId = _useState16[1];
|
|
67
|
-
var _useContext2 = useContext(
|
|
67
|
+
var _useContext2 = useContext(IntervalContext),
|
|
68
68
|
searchData = _useContext2.searchData,
|
|
69
69
|
setSearchData = _useContext2.setSearchData,
|
|
70
70
|
eventGroupList = _useContext2.eventGroupList,
|
|
@@ -195,7 +195,7 @@ var EventContent = function EventContent(props) {
|
|
|
195
195
|
loading: loading,
|
|
196
196
|
eventData: eventData,
|
|
197
197
|
platformChange: platformChange,
|
|
198
|
-
|
|
198
|
+
onJumpWarning: props.onJumpWarning
|
|
199
199
|
}), /*#__PURE__*/React.createElement(BizLayout, {
|
|
200
200
|
showTitle: false,
|
|
201
201
|
hasCollapse: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SearchValue
|
|
1
|
+
import { SearchValue } from '../../types';
|
|
2
|
+
import { IntervalProps } from '../home/types';
|
|
2
3
|
export declare namespace EventContentProps {
|
|
3
4
|
interface Props {
|
|
4
5
|
/**
|
|
@@ -18,7 +19,8 @@ export declare namespace EventContentProps {
|
|
|
18
19
|
* 是否查询中
|
|
19
20
|
*/
|
|
20
21
|
onSearching?: (flag: boolean) => void;
|
|
21
|
-
onUserDrill:
|
|
22
|
+
onUserDrill: IntervalProps.Props['onUserDrill'];
|
|
23
|
+
onJumpWarning: IntervalProps.Props['onJumpWarning'];
|
|
22
24
|
/**
|
|
23
25
|
* 查询条件回调
|
|
24
26
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './styles/index.less';
|
|
3
|
-
import {
|
|
4
|
-
declare const ModuleInterval: React.FC<
|
|
3
|
+
import { IntervalProps } from './types';
|
|
4
|
+
declare const ModuleInterval: React.FC<IntervalProps.Props>;
|
|
5
5
|
export default ModuleInterval;
|
|
@@ -14,7 +14,7 @@ import React, { useContext, useEffect, useState } from 'react';
|
|
|
14
14
|
import { Spin } from 'antd';
|
|
15
15
|
import { BizGlobalDataContext, BizTargetFromPanel } from '@zgfe/business-lib';
|
|
16
16
|
import "./styles/index.less";
|
|
17
|
-
import {
|
|
17
|
+
import { IntervalContext } from "../../types";
|
|
18
18
|
import { getInitDate } from "../../constants/initData";
|
|
19
19
|
import EventContent from "../content";
|
|
20
20
|
import { chartTypes } from "../../constants";
|
|
@@ -112,7 +112,7 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
112
112
|
children: ""
|
|
113
113
|
}), !panelId && /*#__PURE__*/React.createElement("div", {
|
|
114
114
|
className: "".concat(classPrefix, "-header-title")
|
|
115
|
-
}, "\u95F4\u9694\u5206\u6790"), /*#__PURE__*/React.createElement(
|
|
115
|
+
}, "\u95F4\u9694\u5206\u6790"), /*#__PURE__*/React.createElement(IntervalContext.Provider, {
|
|
116
116
|
value: {
|
|
117
117
|
panelId: panelId,
|
|
118
118
|
elementId: elementId,
|
|
@@ -126,7 +126,8 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
126
126
|
enableAddScene: props.defaultValue && props.defaultValue.enableAddScene === false ? false : true,
|
|
127
127
|
changeLoading: changeLoading,
|
|
128
128
|
afterEditTarget: props.afterEditTarget,
|
|
129
|
-
onUserDrill: props.onUserDrill
|
|
129
|
+
onUserDrill: props.onUserDrill,
|
|
130
|
+
onJumpWarning: props.onJumpWarning
|
|
130
131
|
}
|
|
131
132
|
}, /*#__PURE__*/React.createElement(EventContent, {
|
|
132
133
|
defaultValue: props.defaultValue ? props.defaultValue.data : undefined,
|
|
@@ -134,6 +135,7 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
134
135
|
show: showList,
|
|
135
136
|
urlParam: props.urlParam,
|
|
136
137
|
onUserDrill: props.onUserDrill,
|
|
138
|
+
onJumpWarning: props.onJumpWarning,
|
|
137
139
|
onChange: setSearchData,
|
|
138
140
|
initSearch: initSearch
|
|
139
141
|
})));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SearchValue,
|
|
3
|
-
export declare namespace
|
|
2
|
+
import { SearchValue, IntervalDrillParams } from '../../types';
|
|
3
|
+
export declare namespace IntervalProps {
|
|
4
4
|
interface Props {
|
|
5
5
|
/**
|
|
6
6
|
* @description 默认查询值
|
|
@@ -23,7 +23,8 @@ export declare namespace EventProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* 用户钻取
|
|
25
25
|
*/
|
|
26
|
-
onUserDrill: (data:
|
|
26
|
+
onUserDrill: (data: IntervalDrillParams) => void;
|
|
27
|
+
onJumpWarning: (data: Record<string, any>, searchData: SearchValue) => void;
|
|
27
28
|
}
|
|
28
29
|
interface Value {
|
|
29
30
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
1
|
+
export var IntervalProps;
|
|
2
|
+
(function (_IntervalProps) {})(IntervalProps || (IntervalProps = {}));
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -131,20 +131,6 @@ export interface SearchValue {
|
|
|
131
131
|
unit: string;
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
export interface UserDrillParamsProp {
|
|
135
|
-
/**
|
|
136
|
-
* @description 用户数量
|
|
137
|
-
*/
|
|
138
|
-
count: number;
|
|
139
|
-
/**
|
|
140
|
-
* @description 查询接口
|
|
141
|
-
*/
|
|
142
|
-
url: string;
|
|
143
|
-
/**
|
|
144
|
-
* @description 查询对象
|
|
145
|
-
*/
|
|
146
|
-
params?: Record<string, any>;
|
|
147
|
-
}
|
|
148
134
|
export type EventChartTypes = 'line' | 'bar' | 'pie' | 'map' | 'boxplot';
|
|
149
135
|
/**
|
|
150
136
|
* 图表选择类型
|
|
@@ -187,4 +173,18 @@ export interface TableChildrenProps {
|
|
|
187
173
|
name: string;
|
|
188
174
|
values: number[];
|
|
189
175
|
}
|
|
190
|
-
export declare const
|
|
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
|
+
}
|
package/dist/esm/types.js
CHANGED
|
@@ -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 {
|
|
4
|
+
import { IntervalProps } 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:
|
|
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>;
|
|
13
13
|
/**
|
|
14
14
|
* 获取属性的label
|
|
15
15
|
* @param attrData 当前属性
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-interval",
|
|
3
|
-
"version": "1.0.3-alpha.
|
|
3
|
+
"version": "1.0.3-alpha.3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"umi-request": "^1.4.0",
|
|
63
63
|
"yorkie": "^2.0.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "ff72ad7d6d914c1f5d4e1659b0efaed33059dd3a"
|
|
66
66
|
}
|