@zgfe/modules-interval 1.0.3-alpha.2 → 1.0.3-alpha.4
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 +2 -2
- package/dist/esm/modules/content/index.js +2 -3
- package/dist/esm/modules/content/types.d.ts +2 -3
- package/dist/esm/modules/home/demo/index.js +6 -12
- package/dist/esm/modules/home/index.js +2 -3
- package/dist/esm/modules/home/types.d.ts +2 -3
- package/dist/esm/modules/topPanel/index.js +2 -2
- package/dist/esm/modules/topPanel/types.d.ts +0 -1
- package/dist/esm/types.d.ts +15 -15
- package/dist/esm/types.js +1 -1
- 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;
|
|
@@ -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,
|
|
@@ -205,7 +205,6 @@ var EventContent = function EventContent(props) {
|
|
|
205
205
|
collapseRef: collapseRef,
|
|
206
206
|
onChange: onChangeSearch,
|
|
207
207
|
defaultValue: searchData,
|
|
208
|
-
urlParam: props.urlParam,
|
|
209
208
|
ajaxFlag: ajaxFlag,
|
|
210
209
|
loading: loading,
|
|
211
210
|
finalSearchData: finalSearchData,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchValue
|
|
1
|
+
import { SearchValue } from '../../types';
|
|
2
2
|
import { IntervalProps } from '../home/types';
|
|
3
3
|
export declare namespace EventContentProps {
|
|
4
4
|
interface Props {
|
|
@@ -10,7 +10,6 @@ export declare namespace EventContentProps {
|
|
|
10
10
|
* 默认值
|
|
11
11
|
*/
|
|
12
12
|
value: SearchValue;
|
|
13
|
-
urlParam?: SearchValue;
|
|
14
13
|
/**
|
|
15
14
|
* 展示列表
|
|
16
15
|
*/
|
|
@@ -19,7 +18,7 @@ export declare namespace EventContentProps {
|
|
|
19
18
|
* 是否查询中
|
|
20
19
|
*/
|
|
21
20
|
onSearching?: (flag: boolean) => void;
|
|
22
|
-
onUserDrill:
|
|
21
|
+
onUserDrill: IntervalProps.Props['onUserDrill'];
|
|
23
22
|
onJumpWarning: IntervalProps.Props['onJumpWarning'];
|
|
24
23
|
/**
|
|
25
24
|
* 查询条件回调
|
|
@@ -17,17 +17,11 @@ export default (function () {
|
|
|
17
17
|
isDetail = _useState2[0],
|
|
18
18
|
setIsDetail = _useState2[1];
|
|
19
19
|
var _useState3 = useState(),
|
|
20
|
-
_useState4 = _slicedToArray(_useState3,
|
|
21
|
-
detailParams = _useState4[0]
|
|
22
|
-
setDetailParams = _useState4[1];
|
|
20
|
+
_useState4 = _slicedToArray(_useState3, 1),
|
|
21
|
+
detailParams = _useState4[0];
|
|
23
22
|
var _useState5 = useState(),
|
|
24
|
-
_useState6 = _slicedToArray(_useState5,
|
|
25
|
-
searchParams = _useState6[0]
|
|
26
|
-
setSearchParams = _useState6[1];
|
|
27
|
-
var _useState7 = useState(),
|
|
28
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
29
|
-
urlParam = _useState8[0],
|
|
30
|
-
setUrlParam = _useState8[1];
|
|
23
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
24
|
+
searchParams = _useState6[0];
|
|
31
25
|
useEffect(function () {
|
|
32
26
|
setGlobalConfig(requestConfig);
|
|
33
27
|
}, []);
|
|
@@ -46,8 +40,8 @@ export default (function () {
|
|
|
46
40
|
}
|
|
47
41
|
}, "\u8FD4\u56DE")) : /*#__PURE__*/React.createElement(ModuleInterval, {
|
|
48
42
|
defaultValue: searchParams,
|
|
49
|
-
urlParam: urlParam,
|
|
50
43
|
afterEditTarget: afterEditTarget,
|
|
51
|
-
onUserDrill: onUserDrill
|
|
44
|
+
onUserDrill: onUserDrill,
|
|
45
|
+
onJumpWarning: function onJumpWarning() {}
|
|
52
46
|
}));
|
|
53
47
|
});
|
|
@@ -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,
|
|
@@ -133,7 +133,6 @@ var ModuleInterval = function ModuleInterval(props) {
|
|
|
133
133
|
defaultValue: props.defaultValue ? props.defaultValue.data : undefined,
|
|
134
134
|
value: searchData,
|
|
135
135
|
show: showList,
|
|
136
|
-
urlParam: props.urlParam,
|
|
137
136
|
onUserDrill: props.onUserDrill,
|
|
138
137
|
onJumpWarning: props.onJumpWarning,
|
|
139
138
|
onChange: setSearchData,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SearchValue,
|
|
2
|
+
import { SearchValue, IntervalDrillParams } from '../../types';
|
|
3
3
|
export declare namespace IntervalProps {
|
|
4
4
|
interface Props {
|
|
5
5
|
/**
|
|
6
6
|
* @description 默认查询值
|
|
7
7
|
*/
|
|
8
8
|
defaultValue?: Value;
|
|
9
|
-
urlParam?: SearchValue;
|
|
10
9
|
/**
|
|
11
10
|
* @description 看板是否可禁用, true禁用
|
|
12
11
|
*/
|
|
@@ -23,7 +22,7 @@ export declare namespace IntervalProps {
|
|
|
23
22
|
/**
|
|
24
23
|
* 用户钻取
|
|
25
24
|
*/
|
|
26
|
-
onUserDrill: (data:
|
|
25
|
+
onUserDrill: (data: IntervalDrillParams) => void;
|
|
27
26
|
onJumpWarning: (data: Record<string, any>, searchData: SearchValue) => void;
|
|
28
27
|
}
|
|
29
28
|
interface Value {
|
|
@@ -18,7 +18,7 @@ import "./styles/index.less";
|
|
|
18
18
|
import { AnalysisMode } from "./types";
|
|
19
19
|
var classPrefix = 'top-panel-interval';
|
|
20
20
|
var TopPanel = function TopPanel(props) {
|
|
21
|
-
var _props$
|
|
21
|
+
var _props$defaultValue, _props$defaultValue2, _defaultValue$associa, _defaultValue$associa2, _finalSearchData$asso, _finalSearchData$asso2, _defaultValue$associa3, _finalSearchData$asso3, _defaultValue$associa4, _finalSearchData$asso4, _defaultValue$associa5, _finalSearchData$asso5, _defaultValue$associa6, _finalSearchData$asso6, _defaultValue$associa7, _finalSearchData$asso7, _defaultValue$associa8, _finalSearchData$asso8, _defaultValue$associa9, _finalSearchData$asso9, _defaultValue$associa10, _finalSearchData$asso10, _defaultValue$dimensi, _finalSearchData$dime, _defaultValue$dimensi2, _finalSearchData$dime2, _defaultValue$dimensi3, _finalSearchData$dime3, _defaultValue$dimensi4, _finalSearchData$dime4;
|
|
22
22
|
var defaultValue = props.defaultValue,
|
|
23
23
|
loading = props.loading,
|
|
24
24
|
collapseRef = props.collapseRef,
|
|
@@ -170,7 +170,7 @@ var TopPanel = function TopPanel(props) {
|
|
|
170
170
|
className: "panel-form-interval",
|
|
171
171
|
layout: "vertical",
|
|
172
172
|
initialValues: {
|
|
173
|
-
userGroup: props !== null && props !== void 0 && (_props$
|
|
173
|
+
userGroup: props !== null && props !== void 0 && (_props$defaultValue = props.defaultValue) !== null && _props$defaultValue !== void 0 && _props$defaultValue.userGroup ? props === null || props === void 0 ? void 0 : (_props$defaultValue2 = props.defaultValue) === null || _props$defaultValue2 === void 0 ? void 0 : _props$defaultValue2.userGroup : userGroup ? userGroup : [0],
|
|
174
174
|
start: _objectSpread(_objectSpread({}, defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.start), {}, {
|
|
175
175
|
relevancy: defaultValue !== null && defaultValue !== void 0 && (_defaultValue$associa = defaultValue.associated_next_attr) !== null && _defaultValue$associa !== void 0 && _defaultValue$associa.event_id && defaultValue !== null && defaultValue !== void 0 && (_defaultValue$associa2 = defaultValue.associated_pre_attr) !== null && _defaultValue$associa2 !== void 0 && _defaultValue$associa2.event_id || finalSearchData !== null && finalSearchData !== void 0 && (_finalSearchData$asso = finalSearchData.associatedNextAttr) !== null && _finalSearchData$asso !== void 0 && _finalSearchData$asso.eventId && finalSearchData !== null && finalSearchData !== void 0 && (_finalSearchData$asso2 = finalSearchData.associatedPreAttr) !== null && _finalSearchData$asso2 !== void 0 && _finalSearchData$asso2.eventId ? true : false
|
|
176
176
|
}),
|
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
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.4",
|
|
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": "c3ea1ca139eb241685bb86fdf924ed80c27b4a26"
|
|
66
66
|
}
|