@zgfe/modules-event 0.0.2-alpha.22 → 0.0.2-alpha.25
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/es/components/table/images/empty.png +0 -0
- package/es/components/table/index.js +60 -34
- package/es/components/table/styles/index.less +35 -0
- package/es/modules/chart/index.js +19 -5
- package/es/modules/content/index.js +3 -4
- package/es/modules/home/demo/create.js +1 -1
- package/es/modules/home/types.d.ts +2 -2
- package/es/modules/topPanel/index.d.ts +1 -1
- package/es/modules/topPanel/index.js +6 -4
- package/es/style/index.less +13 -1
- package/es/types.d.ts +9 -8
- package/es/utils/formData.d.ts +1 -0
- package/es/utils/formData.js +39 -4
- package/package.json +2 -2
|
Binary file
|
|
@@ -7,18 +7,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
7
7
|
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; }
|
|
8
8
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
9
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
-
import { ajax, BizGlobalDataContext,
|
|
10
|
+
import { ajax, BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
|
|
11
11
|
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
12
12
|
import Highlight from 'react-highlight';
|
|
13
13
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
14
14
|
import 'highlight.js/styles/vs.css';
|
|
15
15
|
import base64 from '../../utils/base64';
|
|
16
16
|
import { Apis } from '../../constants';
|
|
17
|
-
import { Modal, message } from 'antd';
|
|
17
|
+
import { Modal, message, Table, ConfigProvider } from 'antd';
|
|
18
18
|
import { formTableData, getColumns } from '../../utils/formData';
|
|
19
19
|
import './styles/index.less';
|
|
20
20
|
import { getValue } from '../../modules/content/utils';
|
|
21
21
|
import { EventContext } from '../../types';
|
|
22
|
+
import emptyImg from './images/empty.png';
|
|
22
23
|
var classPrefix = 'mi-table';
|
|
23
24
|
var EventTable = function EventTable(props) {
|
|
24
25
|
var dataSource = props.dataSource,
|
|
@@ -39,28 +40,32 @@ var EventTable = function EventTable(props) {
|
|
|
39
40
|
_useContext2$defaultS = _useContext2.defaultSearch,
|
|
40
41
|
defaultSearch = _useContext2$defaultS === void 0 ? {} : _useContext2$defaultS,
|
|
41
42
|
panelName = _useContext2.panelName;
|
|
42
|
-
var _useState3 = useState(
|
|
43
|
+
var _useState3 = useState(false),
|
|
43
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var _useState5 = useState(
|
|
45
|
+
sqlModal = _useState4[0],
|
|
46
|
+
setSqlModal = _useState4[1];
|
|
47
|
+
var _useState5 = useState(''),
|
|
47
48
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var _useState7 = useState(
|
|
49
|
+
sqlText = _useState6[0],
|
|
50
|
+
setSqlText = _useState6[1];
|
|
51
|
+
var _useState7 = useState(1),
|
|
51
52
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _useState9 = useState(
|
|
53
|
+
current = _useState8[0],
|
|
54
|
+
setCurrent = _useState8[1];
|
|
55
|
+
var _useState9 = useState(10),
|
|
55
56
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
pageSize = _useState10[0],
|
|
58
|
+
setPageSize = _useState10[1];
|
|
59
|
+
var _useState11 = useState(0),
|
|
60
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
61
|
+
total = _useState12[0],
|
|
62
|
+
setTotal = _useState12[1];
|
|
58
63
|
useEffect(function () {
|
|
59
64
|
var gLen = (searchData === null || searchData === void 0 ? void 0 : searchData.dimension) ? 1 : 0;
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
setTableData(
|
|
65
|
+
var _data = formTableData(dataSource, searchData.userGroup || [0], gLen);
|
|
66
|
+
console.log(111, _data);
|
|
67
|
+
setTotal(_data.length);
|
|
68
|
+
setTableData(_data);
|
|
64
69
|
}, []);
|
|
65
70
|
var columns = useMemo(function () {
|
|
66
71
|
var _searchData$userGroup = searchData.userGroup,
|
|
@@ -112,12 +117,7 @@ var EventTable = function EventTable(props) {
|
|
|
112
117
|
};
|
|
113
118
|
var _getColumns = getColumns(eventGroupList, userPropList, eventEnvList, dataSource.xAxis || [], userGroup, searchData, showList, onShowClick, onClickToDetail);
|
|
114
119
|
return _getColumns;
|
|
115
|
-
}, [dataSource.xAxis, showList,
|
|
116
|
-
var onChangeTable = function onChangeTable(pagination) {
|
|
117
|
-
var startNum = (pagination.current - 1) * pagination.pageSize;
|
|
118
|
-
var endNum = pagination.current * pagination.pageSize;
|
|
119
|
-
setTableData(searchTable.slice(startNum, endNum));
|
|
120
|
-
};
|
|
120
|
+
}, [dataSource.xAxis, showList, panelName]);
|
|
121
121
|
var seeSql = function seeSql() {
|
|
122
122
|
ajax(Apis.getEventDataSql, {
|
|
123
123
|
method: 'post',
|
|
@@ -163,6 +163,18 @@ var EventTable = function EventTable(props) {
|
|
|
163
163
|
message.success('下载成功!');
|
|
164
164
|
});
|
|
165
165
|
};
|
|
166
|
+
var pageChange = function pageChange(page, pageSize) {
|
|
167
|
+
console.log('切页码', page, pageSize);
|
|
168
|
+
setCurrent(page);
|
|
169
|
+
setPageSize(pageSize);
|
|
170
|
+
};
|
|
171
|
+
var tableEmptyRender = function tableEmptyRender() {
|
|
172
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
className: "".concat(classPrefix, "-table-empty")
|
|
174
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
175
|
+
src: emptyImg
|
|
176
|
+
}), /*#__PURE__*/React.createElement("p", null, "\u6682\u65E0\u6570\u636E"));
|
|
177
|
+
};
|
|
166
178
|
return /*#__PURE__*/React.createElement("div", {
|
|
167
179
|
className: classPrefix
|
|
168
180
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -173,16 +185,31 @@ var EventTable = function EventTable(props) {
|
|
|
173
185
|
onClick: download
|
|
174
186
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
175
187
|
type: "xiazai1"
|
|
176
|
-
}), "\u4E0B\u8F7D\u6570\u636E"))), /*#__PURE__*/React.createElement(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
188
|
+
}), "\u4E0B\u8F7D\u6570\u636E"))), /*#__PURE__*/React.createElement("div", {
|
|
189
|
+
className: "table-area"
|
|
190
|
+
}, /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
191
|
+
renderEmpty: tableEmptyRender
|
|
192
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
193
|
+
className: "table",
|
|
181
194
|
scroll: {
|
|
182
|
-
|
|
195
|
+
y: '380px'
|
|
183
196
|
},
|
|
184
|
-
|
|
185
|
-
|
|
197
|
+
rowKey: 'id',
|
|
198
|
+
columns: columns,
|
|
199
|
+
dataSource: tableData,
|
|
200
|
+
pagination: {
|
|
201
|
+
showQuickJumper: true,
|
|
202
|
+
total: total,
|
|
203
|
+
defaultPageSize: 10,
|
|
204
|
+
defaultCurrent: 1,
|
|
205
|
+
current: current,
|
|
206
|
+
pageSize: pageSize,
|
|
207
|
+
onChange: pageChange,
|
|
208
|
+
showTotal: function showTotal(total) {
|
|
209
|
+
return "\u603B\u6761\u6570\uFF1A".concat(total, " ");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}))), /*#__PURE__*/React.createElement(Modal, {
|
|
186
213
|
open: sqlModal,
|
|
187
214
|
wrapClassName: "event-table-sql-modal",
|
|
188
215
|
okText: "\u786E\u5B9A",
|
|
@@ -202,8 +229,7 @@ var EventTable = function EventTable(props) {
|
|
|
202
229
|
}, /*#__PURE__*/React.createElement(Highlight, {
|
|
203
230
|
languageName: "sql",
|
|
204
231
|
style: {
|
|
205
|
-
whiteSpace: 'pre-wrap'
|
|
206
|
-
background: 'red'
|
|
232
|
+
whiteSpace: 'pre-wrap'
|
|
207
233
|
}
|
|
208
234
|
}, sqlText), /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
209
235
|
text: JSON.stringify(sqlText, null, 2),
|
|
@@ -40,6 +40,41 @@
|
|
|
40
40
|
margin-top: 0;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
.event-name-box {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
&-market {
|
|
47
|
+
display: flex;
|
|
48
|
+
.shoucang {
|
|
49
|
+
color: #fd9f41;
|
|
50
|
+
font-size: 16px !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.fuzhi1 {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
.fuzhi1:hover {
|
|
58
|
+
color: #165dff;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
.event-name-box:hover {
|
|
62
|
+
.fuzhi1 {
|
|
63
|
+
display: block;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&-table-empty {
|
|
68
|
+
img {
|
|
69
|
+
width: 50px !important;
|
|
70
|
+
height: auto;
|
|
71
|
+
margin-top: 30px;
|
|
72
|
+
margin-bottom: 10px;
|
|
73
|
+
}
|
|
74
|
+
p {
|
|
75
|
+
color: rgba(0, 0, 0, 0.25);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
43
78
|
}
|
|
44
79
|
.event-table-sql-modal {
|
|
45
80
|
.ant-modal-header {
|
|
@@ -16,6 +16,8 @@ import { getDefaultShow, getShowColor } from '../../utils/formData';
|
|
|
16
16
|
import _ from 'lodash';
|
|
17
17
|
import { Apis, chartColors } from '../../constants';
|
|
18
18
|
import { Spin } from 'antd';
|
|
19
|
+
import emptyImg from '../../components/table/images/empty.png';
|
|
20
|
+
var classPrefix = 'mi-table';
|
|
19
21
|
var EventChart = function EventChart(props) {
|
|
20
22
|
var params = props.params;
|
|
21
23
|
var _useState = useState(false),
|
|
@@ -48,6 +50,7 @@ var EventChart = function EventChart(props) {
|
|
|
48
50
|
return getShowColor(dataSource, showList);
|
|
49
51
|
}, [showList]);
|
|
50
52
|
var chartData = useMemo(function () {
|
|
53
|
+
console.log('chartData?.length', dataSource);
|
|
51
54
|
if (dataSource) {
|
|
52
55
|
var data = _.cloneDeep(dataSource);
|
|
53
56
|
data.x_axis = dataSource.xAxis;
|
|
@@ -122,11 +125,14 @@ var EventChart = function EventChart(props) {
|
|
|
122
125
|
label: "\u6682\u65E0\u6570\u636E"
|
|
123
126
|
});
|
|
124
127
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
var chartBox = function chartBox() {
|
|
129
|
+
if (chartData.series.length <= 0) {
|
|
130
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: "".concat(classPrefix, "-table-empty")
|
|
132
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
133
|
+
src: emptyImg
|
|
134
|
+
}), /*#__PURE__*/React.createElement("p", null, "\u6682\u65E0\u6570\u636E"));
|
|
135
|
+
} else {
|
|
130
136
|
return /*#__PURE__*/React.createElement(BizChart, {
|
|
131
137
|
key: chartType,
|
|
132
138
|
type: chartType,
|
|
@@ -139,6 +145,14 @@ var EventChart = function EventChart(props) {
|
|
|
139
145
|
isCity: isCity,
|
|
140
146
|
radius: ['30%', '75%']
|
|
141
147
|
});
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
switch (chartType) {
|
|
151
|
+
case 'line':
|
|
152
|
+
case 'bar':
|
|
153
|
+
case 'pie':
|
|
154
|
+
case 'map':
|
|
155
|
+
return chartBox();
|
|
142
156
|
case 'grid':
|
|
143
157
|
return /*#__PURE__*/React.createElement(EventTable, {
|
|
144
158
|
dataSource: dataSource,
|
|
@@ -157,15 +157,14 @@ var EventContent = function EventContent(props) {
|
|
|
157
157
|
showTitle: false,
|
|
158
158
|
hasCollapse: true,
|
|
159
159
|
collapseRef: collapseRef,
|
|
160
|
-
topPanel: /*#__PURE__*/React.createElement(
|
|
161
|
-
ref: collapseRef
|
|
162
|
-
}, /*#__PURE__*/React.createElement(TopPanel, {
|
|
160
|
+
topPanel: /*#__PURE__*/React.createElement(TopPanel, {
|
|
161
|
+
ref: collapseRef,
|
|
163
162
|
onChange: onChangeSearch,
|
|
164
163
|
defaultValue: searchData,
|
|
165
164
|
ajaxFlag: ajaxFlag,
|
|
166
165
|
finalSearchData: finalSearchData,
|
|
167
166
|
fetchRequest: fetchRequest
|
|
168
|
-
})
|
|
167
|
+
})
|
|
169
168
|
}, /*#__PURE__*/React.createElement("div", {
|
|
170
169
|
className: classPrefix
|
|
171
170
|
}, /*#__PURE__*/React.createElement(SearchPanel, {
|
|
@@ -37,7 +37,7 @@ export default (function () {
|
|
|
37
37
|
};
|
|
38
38
|
return /*#__PURE__*/React.createElement(DemoWrapper, {
|
|
39
39
|
needMeta: true,
|
|
40
|
-
defaultApp:
|
|
40
|
+
defaultApp: 161
|
|
41
41
|
}, isDetail ? /*#__PURE__*/React.createElement("div", null, JSON.stringify(detailParams), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
42
42
|
onClick: function onClick() {
|
|
43
43
|
return setIsDetail(false);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SearchValue } from '../../types';
|
|
1
|
+
import { SearchValue, UserDrillParamsProp } from '../../types';
|
|
2
2
|
export declare namespace EventProps {
|
|
3
3
|
interface Props {
|
|
4
4
|
defaultValue?: Value;
|
|
5
5
|
includeToday?: boolean;
|
|
6
6
|
afterEditTarget?: (type: string, value?: any) => void;
|
|
7
|
-
onUserDrill: (data:
|
|
7
|
+
onUserDrill: (data: UserDrillParamsProp, searchData: SearchValue) => void;
|
|
8
8
|
}
|
|
9
9
|
interface Value {
|
|
10
10
|
panelId?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './styles/index.less';
|
|
3
3
|
import { TopPanelProps } from './types';
|
|
4
|
-
declare const TopPanel: React.
|
|
4
|
+
declare const TopPanel: React.ForwardRefExoticComponent<TopPanelProps & React.RefAttributes<any>>;
|
|
5
5
|
export default TopPanel;
|
|
@@ -10,7 +10,7 @@ import { BizUserGroupHeader } from '@zgfe/business-lib';
|
|
|
10
10
|
import EventFilter from '../../components/eventFilter';
|
|
11
11
|
import './styles/index.less';
|
|
12
12
|
var classPrefix = 'top-panel';
|
|
13
|
-
var TopPanel = function
|
|
13
|
+
var TopPanel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
14
|
var defaultValue = props.defaultValue,
|
|
15
15
|
ajaxFlag = props.ajaxFlag,
|
|
16
16
|
finalSearchData = props.finalSearchData,
|
|
@@ -89,7 +89,9 @@ var TopPanel = function TopPanel(props) {
|
|
|
89
89
|
name: "userGroup"
|
|
90
90
|
}, /*#__PURE__*/React.createElement(BizUserGroupHeader, {
|
|
91
91
|
max: 3
|
|
92
|
-
})), /*#__PURE__*/React.createElement(
|
|
92
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
ref: ref
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
93
95
|
label: "\u4E8B\u4EF6",
|
|
94
96
|
name: "filterConditions",
|
|
95
97
|
style: {
|
|
@@ -105,6 +107,6 @@ var TopPanel = function TopPanel(props) {
|
|
|
105
107
|
onClick: function onClick() {
|
|
106
108
|
fetchRequest(true);
|
|
107
109
|
}
|
|
108
|
-
}, "\u67E5\u8BE2")));
|
|
109
|
-
};
|
|
110
|
+
}, "\u67E5\u8BE2"))));
|
|
111
|
+
});
|
|
110
112
|
export default TopPanel;
|
package/es/style/index.less
CHANGED
|
@@ -37,11 +37,23 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&-link {
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: flex-end;
|
|
40
42
|
cursor: pointer;
|
|
41
43
|
&:hover {
|
|
42
44
|
color: @primary-color;
|
|
43
|
-
text-decoration: underline;
|
|
45
|
+
// text-decoration: underline;
|
|
46
|
+
.a-yanjingkai {
|
|
47
|
+
display: block;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.a-yanjingkai {
|
|
51
|
+
display: none;
|
|
52
|
+
margin-right: 10px;
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
}
|
|
56
|
+
&-table-event-data {
|
|
57
|
+
text-align: right !important;
|
|
58
|
+
}
|
|
47
59
|
}
|
package/es/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AttrConditionTypes } from '@zgfe/business-lib';
|
|
2
2
|
import { DatePickerTypes } from '@zgfe/business-lib/es/datePicker/types';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
export interface bizAttributeSelectorValueProp {
|
|
@@ -25,13 +25,14 @@ export interface SearchValue {
|
|
|
25
25
|
dimension?: bizAttributeSelectorValueProp;
|
|
26
26
|
filters?: AttrConditionTypes.GroupValue;
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
export interface UserDrillParamsProp {
|
|
29
|
+
appId: number;
|
|
30
|
+
platform: number;
|
|
31
|
+
count: number;
|
|
32
|
+
source: string;
|
|
33
|
+
url: string;
|
|
34
|
+
params?: Record<string, any>;
|
|
35
|
+
module?: string;
|
|
35
36
|
}
|
|
36
37
|
export type EventChartTypes = 'line' | 'bar' | 'pie' | 'map';
|
|
37
38
|
export interface ChartItemProp {
|
package/es/utils/formData.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ResponseDataProps, SearchValue } from '../types';
|
|
|
5
5
|
import { EventProps } from '../modules/home/types';
|
|
6
6
|
import '../style/index.less';
|
|
7
7
|
export declare function getColumns(eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined, columnData: string[], userGroup: number[], searchData: SearchValue, showList: string[], onShowCallback: Function, onClickToDetailCallback: Function): ColumnsType<EventProps.ColumnsDataType>;
|
|
8
|
+
export declare function marketEventGroupList(eventGroupList: EventGroup[] | undefined): string[];
|
|
8
9
|
export declare function getAttrLabel(attrData: AttrConditionTypes.ItemValue, eventGroupList: EventGroup[] | undefined, userPropList: UserProp[] | undefined, eventEnvList: EnvProp[] | undefined): string | undefined;
|
|
9
10
|
export declare function formTableData(originalData: ResponseDataProps, userGroups: number[], attrNum: number, showList?: string[]): EventProps.ColumnsDataType[];
|
|
10
11
|
export declare function getDefaultShow(source: ResponseDataProps): string[];
|
package/es/utils/formData.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { util } from '@zgfe/business-lib';
|
|
1
|
+
import { util, IconFont } from '@zgfe/business-lib';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { message } from 'antd';
|
|
4
|
+
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
3
5
|
import { chartColors } from '../constants/color';
|
|
4
6
|
import { PropCategory } from '@zgfe/business-lib/es/attributeSelector/types';
|
|
5
7
|
import { Tooltip } from 'antd';
|
|
@@ -7,6 +9,7 @@ import '../style/index.less';
|
|
|
7
9
|
import { getValue } from '../modules/content/utils';
|
|
8
10
|
var classPrefix = 'event-form-data';
|
|
9
11
|
export function getColumns(eventGroupList, userPropList, eventEnvList, columnData, userGroup, searchData, showList, onShowCallback, onClickToDetailCallback) {
|
|
12
|
+
var marketEventNameList = marketEventGroupList(eventGroupList);
|
|
10
13
|
var data = [{
|
|
11
14
|
title: '显示',
|
|
12
15
|
width: 80,
|
|
@@ -15,6 +18,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
15
18
|
key: 'nameGroup',
|
|
16
19
|
align: 'center',
|
|
17
20
|
className: "".concat(classPrefix, "-table-td"),
|
|
21
|
+
fixed: true,
|
|
18
22
|
render: function render(_, record) {
|
|
19
23
|
var isActive = showList.includes(record.nameGroup);
|
|
20
24
|
var cannotClick = showList.length >= 10 && !isActive;
|
|
@@ -38,6 +42,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
38
42
|
dataIndex: 'userGroup',
|
|
39
43
|
key: 'userGroup',
|
|
40
44
|
ellipsis: true,
|
|
45
|
+
fixed: true,
|
|
41
46
|
render: function render(text) {
|
|
42
47
|
return text;
|
|
43
48
|
}
|
|
@@ -51,6 +56,7 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
51
56
|
dataIndex: 'dimension',
|
|
52
57
|
key: 'dimension',
|
|
53
58
|
ellipsis: true,
|
|
59
|
+
fixed: true,
|
|
54
60
|
render: function render(val) {
|
|
55
61
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
56
62
|
title: val
|
|
@@ -70,15 +76,28 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
70
76
|
dataIndex: 'eventName',
|
|
71
77
|
key: 'eventName',
|
|
72
78
|
ellipsis: true,
|
|
79
|
+
fixed: true,
|
|
73
80
|
render: function render(val) {
|
|
74
81
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
82
|
+
className: "event-name-box",
|
|
75
83
|
title: val
|
|
76
|
-
},
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: "event-name-box-market"
|
|
86
|
+
}, marketEventNameList.indexOf(val) !== -1 && /*#__PURE__*/React.createElement(IconFont, {
|
|
87
|
+
type: "shoucang"
|
|
88
|
+
}), util.strMiddleSplit(val, {
|
|
77
89
|
maxLength: 20,
|
|
78
90
|
beginLength: 10,
|
|
79
91
|
endLength: 6,
|
|
80
92
|
replaceStr: '...'
|
|
81
|
-
}))
|
|
93
|
+
})), /*#__PURE__*/React.createElement(CopyToClipboard, {
|
|
94
|
+
text: val,
|
|
95
|
+
onCopy: function onCopy() {
|
|
96
|
+
return message.success('复制成功!');
|
|
97
|
+
}
|
|
98
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
99
|
+
type: "fuzhi1"
|
|
100
|
+
})));
|
|
82
101
|
}
|
|
83
102
|
});
|
|
84
103
|
}
|
|
@@ -103,13 +122,19 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
103
122
|
align: 'center',
|
|
104
123
|
ellipsis: true,
|
|
105
124
|
dataIndex: "field".concat(i),
|
|
125
|
+
className: "".concat(classPrefix, "-table-event-data"),
|
|
126
|
+
sorter: function sorter(a, b) {
|
|
127
|
+
return a["field".concat(i)] - b["field".concat(i)];
|
|
128
|
+
},
|
|
106
129
|
render: function render(text, record) {
|
|
107
130
|
return /*#__PURE__*/React.createElement("div", {
|
|
108
131
|
className: "".concat(classPrefix, "-table-td-link"),
|
|
109
132
|
onClick: function onClick() {
|
|
110
133
|
return onClickToDetailCallback(record, columnData[i], text);
|
|
111
134
|
}
|
|
112
|
-
},
|
|
135
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
136
|
+
type: "a-yanjingkai"
|
|
137
|
+
}), text);
|
|
113
138
|
}
|
|
114
139
|
});
|
|
115
140
|
};
|
|
@@ -118,6 +143,16 @@ export function getColumns(eventGroupList, userPropList, eventEnvList, columnDat
|
|
|
118
143
|
}
|
|
119
144
|
return data;
|
|
120
145
|
}
|
|
146
|
+
export function marketEventGroupList(eventGroupList) {
|
|
147
|
+
var _marketName = [];
|
|
148
|
+
eventGroupList && eventGroupList.map(function (item) {
|
|
149
|
+
item.eventList.map(function (_item) {
|
|
150
|
+
if (_item.marked) _marketName.push(_item.name);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
console.log(666, _marketName);
|
|
154
|
+
return _marketName;
|
|
155
|
+
}
|
|
121
156
|
export function getAttrLabel(attrData, eventGroupList, userPropList, eventEnvList) {
|
|
122
157
|
if (!attrData) return;
|
|
123
158
|
var type = attrData.propCategory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-event",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.25",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react": "^16.12.0 || ^17.0.0",
|
|
50
50
|
"yorkie": "^2.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "7b85ecc4ea7d787abf9df20507edccdfe40a0166",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"react-copy-to-clipboard": "^5.1.0",
|
|
55
55
|
"react-highlight": "^0.15.0"
|