@zgfe/modules-dm 1.0.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.
- package/README.md +37 -0
- package/es/components/demo.d.ts +8 -0
- package/es/components/demo.js +23 -0
- package/es/constants/api.d.ts +27 -0
- package/es/constants/api.js +58 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +5 -0
- package/es/modules/dataCollection/collectionAttributeList.d.ts +20 -0
- package/es/modules/dataCollection/collectionAttributeList.js +458 -0
- package/es/modules/dataCollection/collectionEventList.d.ts +13 -0
- package/es/modules/dataCollection/collectionEventList.js +317 -0
- package/es/modules/dataCollection/demo/index.d.ts +2 -0
- package/es/modules/dataCollection/demo/index.js +6 -0
- package/es/modules/dataCollection/index.d.ts +3 -0
- package/es/modules/dataCollection/index.js +97 -0
- package/es/modules/dataCollection/styles/index.less +249 -0
- package/es/modules/dataCollection/tablePlus.d.ts +34 -0
- package/es/modules/dataCollection/tablePlus.js +598 -0
- package/es/modules/dataManage/demo/index.d.ts +2 -0
- package/es/modules/dataManage/demo/index.js +6 -0
- package/es/modules/dataManage/index.d.ts +4 -0
- package/es/modules/dataManage/index.js +58 -0
- package/es/modules/dataManage/styles/index.less +26 -0
- package/es/modules/dataPlan/addEventOrUser.d.ts +34 -0
- package/es/modules/dataPlan/addEventOrUser.js +280 -0
- package/es/modules/dataPlan/addPlan.d.ts +10 -0
- package/es/modules/dataPlan/addPlan.js +644 -0
- package/es/modules/dataPlan/demo/index.d.ts +2 -0
- package/es/modules/dataPlan/demo/index.js +6 -0
- package/es/modules/dataPlan/eventList.d.ts +23 -0
- package/es/modules/dataPlan/eventList.js +21 -0
- package/es/modules/dataPlan/index.d.ts +4 -0
- package/es/modules/dataPlan/index.js +233 -0
- package/es/modules/dataPlan/search.d.ts +11 -0
- package/es/modules/dataPlan/search.js +42 -0
- package/es/modules/dataPlan/styles/index.less +269 -0
- package/es/modules/dataPlan/tablePlus.d.ts +22 -0
- package/es/modules/dataPlan/tablePlus.js +106 -0
- package/es/modules/dataPlan/userAttributeList.d.ts +19 -0
- package/es/modules/dataPlan/userAttributeList.js +77 -0
- package/es/types/flow.d.ts +395 -0
- package/es/types/flow.js +77 -0
- package/es/types.d.ts +412 -0
- package/es/types.js +106 -0
- package/es/utils/ajax.d.ts +3 -0
- package/es/utils/ajax.js +7 -0
- package/package.json +60 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
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
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import { BizGlobalDataContext, IconFont } from '@zgfe/business-lib';
|
|
14
|
+
import { Switch, Button, DatePicker, Table, Modal, message } from 'antd';
|
|
15
|
+
var RangePicker = DatePicker.RangePicker;
|
|
16
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
17
|
+
import './styles/index.less';
|
|
18
|
+
import request from '../../utils/ajax';
|
|
19
|
+
import apis from '../../constants/api';
|
|
20
|
+
import AddPlan from './addPlan';
|
|
21
|
+
|
|
22
|
+
var PlanList = function PlanList(props) {
|
|
23
|
+
var classPrefix = 'plan-list';
|
|
24
|
+
|
|
25
|
+
var _useContext = useContext(BizGlobalDataContext),
|
|
26
|
+
currentApp = _useContext.currentApp,
|
|
27
|
+
isDemo = _useContext.isDemo; // 查看方案
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var tableSee = function tableSee(data) {
|
|
31
|
+
setDetailId(data.id);
|
|
32
|
+
setDetailName(data.planName);
|
|
33
|
+
setDrawerShow(true);
|
|
34
|
+
}; // 删除方案
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var tableDel = function tableDel(data) {
|
|
38
|
+
Modal.confirm({
|
|
39
|
+
centered: true,
|
|
40
|
+
title: '是否确认删除方案?',
|
|
41
|
+
okText: '确认',
|
|
42
|
+
cancelText: '取消',
|
|
43
|
+
maskClosable: false,
|
|
44
|
+
onOk: function onOk() {
|
|
45
|
+
request(apis.deletePlan, {
|
|
46
|
+
method: 'post',
|
|
47
|
+
data: {
|
|
48
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
49
|
+
planName: data
|
|
50
|
+
}
|
|
51
|
+
}).then(function (res) {
|
|
52
|
+
message.success('删除成功');
|
|
53
|
+
queryList();
|
|
54
|
+
}).catch(function (err) {
|
|
55
|
+
message.success('删除失败');
|
|
56
|
+
}).finally(function () {});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}; // 时间戳转换
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var getDateTime = function getDateTime(date) {
|
|
63
|
+
var zero = function zero(e) {
|
|
64
|
+
return e < 10 ? '0' + e : e;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var now = new Date(parseInt(date)),
|
|
68
|
+
Y = now.getFullYear(),
|
|
69
|
+
M = now.getMonth() + 1,
|
|
70
|
+
D = now.getDate(),
|
|
71
|
+
h = now.getHours(),
|
|
72
|
+
m = now.getMinutes(),
|
|
73
|
+
s = now.getSeconds();
|
|
74
|
+
return "".concat(Y, "-").concat(zero(M), "-").concat(zero(D), " ").concat(zero(h), ":").concat(zero(m), ":").concat(zero(s));
|
|
75
|
+
}; // 表格列
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
var columns = [{
|
|
79
|
+
title: '方案名称',
|
|
80
|
+
dataIndex: 'planName',
|
|
81
|
+
key: 'planName'
|
|
82
|
+
}, {
|
|
83
|
+
title: '创建时间',
|
|
84
|
+
dataIndex: 'createOn',
|
|
85
|
+
key: 'createOn',
|
|
86
|
+
render: function render(_text, _record) {
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", null, getDateTime(_text));
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
title: '创建人',
|
|
91
|
+
dataIndex: 'createUser',
|
|
92
|
+
key: 'createUser'
|
|
93
|
+
}, {
|
|
94
|
+
title: '操作',
|
|
95
|
+
dataIndex: 'set',
|
|
96
|
+
render: function render(_text, _record) {
|
|
97
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
98
|
+
className: "".concat(classPrefix, "-table-see"),
|
|
99
|
+
onClick: function onClick() {
|
|
100
|
+
return tableSee(_record);
|
|
101
|
+
}
|
|
102
|
+
}, "\u67E5\u770B"), /*#__PURE__*/React.createElement("span", {
|
|
103
|
+
className: "".concat(classPrefix, "-table-del"),
|
|
104
|
+
onClick: function onClick() {
|
|
105
|
+
return tableDel(_record.planName);
|
|
106
|
+
}
|
|
107
|
+
}, "\u5220\u9664"));
|
|
108
|
+
}
|
|
109
|
+
}]; // 方案列表
|
|
110
|
+
|
|
111
|
+
var _useState = useState([]),
|
|
112
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
113
|
+
listData = _useState2[0],
|
|
114
|
+
setListData = _useState2[1];
|
|
115
|
+
|
|
116
|
+
var queryList = function queryList() {
|
|
117
|
+
request(apis.getAllPlan, {
|
|
118
|
+
method: 'get',
|
|
119
|
+
params: {
|
|
120
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
121
|
+
}
|
|
122
|
+
}).then(function (res) {
|
|
123
|
+
if (!res) throw new Error();
|
|
124
|
+
setListData(res.data.planList);
|
|
125
|
+
}).catch(function (err) {
|
|
126
|
+
console.error('查询列表失败', err);
|
|
127
|
+
}).finally(function () {});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
useEffect(function () {
|
|
131
|
+
queryList();
|
|
132
|
+
}, []);
|
|
133
|
+
|
|
134
|
+
var _useState3 = useState(-1),
|
|
135
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
136
|
+
detailId = _useState4[0],
|
|
137
|
+
setDetailId = _useState4[1];
|
|
138
|
+
|
|
139
|
+
var _useState5 = useState(''),
|
|
140
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
141
|
+
detailName = _useState6[0],
|
|
142
|
+
setDetailName = _useState6[1]; // 抽屉显示与隐藏
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
var _useState7 = useState(false),
|
|
146
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
147
|
+
drawerShow = _useState8[0],
|
|
148
|
+
setDrawerShow = _useState8[1]; // 埋点方案控制开关
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
var _useState9 = useState(false),
|
|
152
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
153
|
+
isOpen = _useState10[0],
|
|
154
|
+
setIsOpen = _useState10[1]; // 获取埋点方案开关状态
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
var queryControlSwitch = function queryControlSwitch() {
|
|
158
|
+
request(apis.queryControlSwitch, {
|
|
159
|
+
method: 'get',
|
|
160
|
+
params: {
|
|
161
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
162
|
+
}
|
|
163
|
+
}).then(function (res) {
|
|
164
|
+
var _res$data;
|
|
165
|
+
|
|
166
|
+
setIsOpen((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.isOpen) == '0' ? false : true);
|
|
167
|
+
});
|
|
168
|
+
}; // 初始化数据
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
useEffect(function () {
|
|
172
|
+
queryControlSwitch();
|
|
173
|
+
}, []); // 埋点方案开关状态变更
|
|
174
|
+
|
|
175
|
+
var isOpenChang = function isOpenChang(data) {
|
|
176
|
+
request(apis.updateControlSwitch, {
|
|
177
|
+
method: 'post',
|
|
178
|
+
data: {
|
|
179
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId,
|
|
180
|
+
isOpen: !isOpen ? '1' : '0'
|
|
181
|
+
}
|
|
182
|
+
}).then(function (res) {
|
|
183
|
+
setIsOpen(!isOpen);
|
|
184
|
+
message.success("\u65B9\u6848\u63A7\u5236\u5DF2".concat(!isOpen ? '开始' : '关闭'));
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
var drawerClose = function drawerClose(type) {
|
|
189
|
+
type == 'save' ? queryList() : null;
|
|
190
|
+
setDrawerShow(false);
|
|
191
|
+
setDetailId(-1);
|
|
192
|
+
setDetailName('');
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: classPrefix
|
|
197
|
+
}, !drawerShow && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
198
|
+
className: "".concat(classPrefix, "-switchbox clearfix")
|
|
199
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
200
|
+
className: "switch"
|
|
201
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u57CB\u70B9\u65B9\u6848\u63A7\u5236"), /*#__PURE__*/React.createElement(Switch, {
|
|
202
|
+
onChange: isOpenChang,
|
|
203
|
+
checkedChildren: "\u5F00",
|
|
204
|
+
unCheckedChildren: "\u5173",
|
|
205
|
+
checked: isOpen
|
|
206
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
207
|
+
onClick: function onClick() {
|
|
208
|
+
setDrawerShow(true);
|
|
209
|
+
},
|
|
210
|
+
type: "primary",
|
|
211
|
+
className: "add"
|
|
212
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
213
|
+
type: "tianjia",
|
|
214
|
+
style: {
|
|
215
|
+
marginRight: '5px',
|
|
216
|
+
verticalAlign: '-2px'
|
|
217
|
+
}
|
|
218
|
+
}), "\u65B0\u589E\u57CB\u70B9\u65B9\u6848")), /*#__PURE__*/React.createElement(Table, {
|
|
219
|
+
className: "".concat(classPrefix, "-table"),
|
|
220
|
+
columns: columns,
|
|
221
|
+
rowKey: 'id',
|
|
222
|
+
dataSource: listData,
|
|
223
|
+
// onChange={onChange}
|
|
224
|
+
pagination: false
|
|
225
|
+
})), /*#__PURE__*/React.createElement(AddPlan, {
|
|
226
|
+
detailName: detailName,
|
|
227
|
+
drawerShow: drawerShow,
|
|
228
|
+
drawerClose: drawerClose,
|
|
229
|
+
detailId: detailId
|
|
230
|
+
}));
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export default PlanList;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles/index.less';
|
|
3
|
+
interface PropsType {
|
|
4
|
+
type: 'event' | 'user';
|
|
5
|
+
total: number;
|
|
6
|
+
searchData: string;
|
|
7
|
+
setSearchData: Function;
|
|
8
|
+
setVisible: Function;
|
|
9
|
+
}
|
|
10
|
+
declare const Search: React.FC<PropsType>;
|
|
11
|
+
export default Search;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IconFont } from '@zgfe/business-lib';
|
|
2
|
+
import { Input, Button, Select } from 'antd';
|
|
3
|
+
var Option = Select.Option;
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import './styles/index.less';
|
|
6
|
+
|
|
7
|
+
var Search = function Search(props) {
|
|
8
|
+
var classPrefix = 'search-box';
|
|
9
|
+
|
|
10
|
+
var searchChange = function searchChange(e) {
|
|
11
|
+
props.setSearchData(e.currentTarget.value);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: classPrefix
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
17
|
+
className: "".concat(classPrefix, "-input"),
|
|
18
|
+
value: props.searchData,
|
|
19
|
+
onChange: searchChange,
|
|
20
|
+
placeholder: props.type == 'event' ? '搜索事件名称' : '搜索属性名称',
|
|
21
|
+
prefix: /*#__PURE__*/React.createElement(IconFont, {
|
|
22
|
+
type: "sousuo"
|
|
23
|
+
})
|
|
24
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "".concat(classPrefix, "-text")
|
|
26
|
+
}, "\u5171", /*#__PURE__*/React.createElement("span", null, props.total), "\u6761 / \u4E0A\u9650500\u6761"), /*#__PURE__*/React.createElement(Button, {
|
|
27
|
+
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
28
|
+
type: "tianjia",
|
|
29
|
+
style: {
|
|
30
|
+
marginRight: '5px',
|
|
31
|
+
verticalAlign: '-2px'
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
type: "primary",
|
|
35
|
+
className: "".concat(classPrefix, "-add-button"),
|
|
36
|
+
onClick: function onClick() {
|
|
37
|
+
props.setVisible(true);
|
|
38
|
+
}
|
|
39
|
+
}, "\u624B\u52A8\u6DFB\u52A0", props.type == 'event' ? '事件' : '用户属性'));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Search;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
|
+
.plan-list {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: calc(100% - 264px);
|
|
5
|
+
height: 100%;
|
|
6
|
+
margin-top: 16px;
|
|
7
|
+
padding: 24px;
|
|
8
|
+
background: #fff;
|
|
9
|
+
.clearfix:after {
|
|
10
|
+
display: block;
|
|
11
|
+
clear: both;
|
|
12
|
+
height: 0;
|
|
13
|
+
content: '';
|
|
14
|
+
}
|
|
15
|
+
&-form {
|
|
16
|
+
position: relative;
|
|
17
|
+
margin-top: 5px;
|
|
18
|
+
.ant-form-item {
|
|
19
|
+
width: 35%;
|
|
20
|
+
margin-right: 80px;
|
|
21
|
+
}
|
|
22
|
+
.ant-form-item-label {
|
|
23
|
+
color: @text-color-secondary;
|
|
24
|
+
}
|
|
25
|
+
.ant-form-item-label {
|
|
26
|
+
text-align: left;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
&-submit {
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 0;
|
|
32
|
+
right: 90px;
|
|
33
|
+
}
|
|
34
|
+
&-reset {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
}
|
|
39
|
+
&-switchbox {
|
|
40
|
+
// margin-top: 26px;
|
|
41
|
+
// padding-top: 26px;
|
|
42
|
+
// border-top: 1px solid #e8efff;
|
|
43
|
+
.switch {
|
|
44
|
+
float: left;
|
|
45
|
+
span {
|
|
46
|
+
margin-right: 20px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.add {
|
|
50
|
+
float: right;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
&-table-see {
|
|
54
|
+
margin-right: 20px;
|
|
55
|
+
color: #165dff;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
user-select: none;
|
|
58
|
+
}
|
|
59
|
+
&-table-del {
|
|
60
|
+
color: #165dff;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
user-select: none;
|
|
63
|
+
}
|
|
64
|
+
&-table {
|
|
65
|
+
height: 550px;
|
|
66
|
+
margin-top: 20px;
|
|
67
|
+
overflow-y: scroll;
|
|
68
|
+
}
|
|
69
|
+
&-pagination {
|
|
70
|
+
position: absolute;
|
|
71
|
+
right: 20px;
|
|
72
|
+
bottom: -50px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.add-plan {
|
|
77
|
+
position: relative;
|
|
78
|
+
height: 100%;
|
|
79
|
+
.point-active,
|
|
80
|
+
.point-active-null {
|
|
81
|
+
display: inline-block;
|
|
82
|
+
width: 6px;
|
|
83
|
+
height: 6px;
|
|
84
|
+
margin-right: 5px;
|
|
85
|
+
vertical-align: 2px;
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
}
|
|
88
|
+
.point-active {
|
|
89
|
+
background: @primary-color;
|
|
90
|
+
}
|
|
91
|
+
.point-active-null {
|
|
92
|
+
background: #fb5547;
|
|
93
|
+
}
|
|
94
|
+
&-top {
|
|
95
|
+
position: relative;
|
|
96
|
+
display: flex;
|
|
97
|
+
margin-bottom: 30px;
|
|
98
|
+
.input-waring {
|
|
99
|
+
position: absolute;
|
|
100
|
+
bottom: -30px;
|
|
101
|
+
left: 0;
|
|
102
|
+
color: red;
|
|
103
|
+
}
|
|
104
|
+
> :nth-child(1) {
|
|
105
|
+
line-height: 30px;
|
|
106
|
+
}
|
|
107
|
+
.plan-name-div {
|
|
108
|
+
display: flex;
|
|
109
|
+
height: 32px;
|
|
110
|
+
color: #242541;
|
|
111
|
+
font-weight: 500;
|
|
112
|
+
font-size: 16px;
|
|
113
|
+
line-height: 32px;
|
|
114
|
+
.bsicon {
|
|
115
|
+
margin-right: 40px;
|
|
116
|
+
margin-left: 10px;
|
|
117
|
+
color: @primary-color;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
.plan-name {
|
|
121
|
+
width: 200px;
|
|
122
|
+
margin-right: 20px;
|
|
123
|
+
// margin: 0 50px;
|
|
124
|
+
}
|
|
125
|
+
.cancel {
|
|
126
|
+
margin-right: 20px;
|
|
127
|
+
}
|
|
128
|
+
.back {
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
&-tabs {
|
|
133
|
+
position: relative;
|
|
134
|
+
display: flex;
|
|
135
|
+
margin-bottom: 15px;
|
|
136
|
+
> :nth-child(1) {
|
|
137
|
+
border-radius: 4px 0 0 4px !important;
|
|
138
|
+
}
|
|
139
|
+
> :nth-child(2) {
|
|
140
|
+
border-radius: 0 4px 4px 0 !important;
|
|
141
|
+
}
|
|
142
|
+
.handle-box {
|
|
143
|
+
position: absolute;
|
|
144
|
+
top: 14px;
|
|
145
|
+
right: 20px;
|
|
146
|
+
.bsicon {
|
|
147
|
+
margin-right: 10px;
|
|
148
|
+
}
|
|
149
|
+
.ant-btn {
|
|
150
|
+
margin-left: 20px;
|
|
151
|
+
}
|
|
152
|
+
.export-data {
|
|
153
|
+
margin-left: 20px;
|
|
154
|
+
.ant-select-selection-placeholder {
|
|
155
|
+
color: #000;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
&-table-header {
|
|
161
|
+
display: flex;
|
|
162
|
+
margin: 0;
|
|
163
|
+
padding: 0;
|
|
164
|
+
list-style-type: none;
|
|
165
|
+
background: #fff;
|
|
166
|
+
li {
|
|
167
|
+
width: 25%;
|
|
168
|
+
padding: 16px;
|
|
169
|
+
border: 1px solid #e8efff;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
.user-list,
|
|
173
|
+
.event-list {
|
|
174
|
+
position: relative;
|
|
175
|
+
&-pagination {
|
|
176
|
+
position: absolute;
|
|
177
|
+
right: 20px;
|
|
178
|
+
bottom: -50px;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
.event-list {
|
|
182
|
+
ant-table-thead > tr > th,
|
|
183
|
+
.ant-table-tbody > tr > td,
|
|
184
|
+
.ant-table tfoot > tr > th,
|
|
185
|
+
.ant-table tfoot > tr > td {
|
|
186
|
+
height: 48px;
|
|
187
|
+
padding: 0 !important;
|
|
188
|
+
// margin-left: 16px!important;
|
|
189
|
+
}
|
|
190
|
+
.table-multiline {
|
|
191
|
+
line-height: 48px;
|
|
192
|
+
:nth-child(1) {
|
|
193
|
+
border-top: none;
|
|
194
|
+
}
|
|
195
|
+
> div {
|
|
196
|
+
padding-left: 16px;
|
|
197
|
+
border-top: 1px solid rgb(236, 237, 240);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
.table-single {
|
|
201
|
+
// height: 100%;
|
|
202
|
+
// line-height: 100%;
|
|
203
|
+
padding-left: 16px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
.table-plus {
|
|
207
|
+
&-table {
|
|
208
|
+
margin-top: -2px;
|
|
209
|
+
.ant-table-thead {
|
|
210
|
+
display: none;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// &-table-header {
|
|
214
|
+
// display: flex;
|
|
215
|
+
// margin: 0;
|
|
216
|
+
// padding: 0;
|
|
217
|
+
// list-style-type: none;
|
|
218
|
+
// background: #fff;
|
|
219
|
+
// li {
|
|
220
|
+
// width: 25%;
|
|
221
|
+
// padding: 16px;
|
|
222
|
+
// border: 1px solid #e8efff;
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
.ant-table-title {
|
|
226
|
+
text-align: center;
|
|
227
|
+
.set-button {
|
|
228
|
+
margin-left: 20px;
|
|
229
|
+
color: @primary-color;
|
|
230
|
+
user-select: none;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
.ant-table-selection-column {
|
|
234
|
+
border: 1px solid red;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
.add-event {
|
|
238
|
+
.ant-form-item {
|
|
239
|
+
margin: 0;
|
|
240
|
+
}
|
|
241
|
+
&-add-button {
|
|
242
|
+
margin-top: 10px;
|
|
243
|
+
.bsicon {
|
|
244
|
+
margin-right: 5px;
|
|
245
|
+
line-height: 22px;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
.search-box {
|
|
250
|
+
position: relative;
|
|
251
|
+
display: flex;
|
|
252
|
+
margin-bottom: 16px;
|
|
253
|
+
line-height: 32px;
|
|
254
|
+
&-input {
|
|
255
|
+
width: 264px;
|
|
256
|
+
height: 32px;
|
|
257
|
+
margin-right: 12px;
|
|
258
|
+
}
|
|
259
|
+
&-text {
|
|
260
|
+
span {
|
|
261
|
+
color: @primary-color;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
&-add-button {
|
|
265
|
+
position: absolute;
|
|
266
|
+
right: 20px;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles/index.less';
|
|
3
|
+
interface DataType {
|
|
4
|
+
key: React.Key;
|
|
5
|
+
eventName: string;
|
|
6
|
+
eventActive: string;
|
|
7
|
+
attributeName: string[];
|
|
8
|
+
attributeActive: string[];
|
|
9
|
+
open: Boolean;
|
|
10
|
+
sheetName?: string;
|
|
11
|
+
}
|
|
12
|
+
interface TablePlusType {
|
|
13
|
+
eventListData: {
|
|
14
|
+
[x: string]: DataType[];
|
|
15
|
+
};
|
|
16
|
+
tableClick: Function;
|
|
17
|
+
selectedRowKeys: React.Key[];
|
|
18
|
+
tableCheck: Function;
|
|
19
|
+
eventListDataIndex: number;
|
|
20
|
+
}
|
|
21
|
+
declare const TablePlus: React.FC<TablePlusType>;
|
|
22
|
+
export default TablePlus;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Table, Select, Checkbox } from 'antd';
|
|
2
|
+
var Option = Select.Option;
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './styles/index.less';
|
|
5
|
+
|
|
6
|
+
var TablePlus = function TablePlus(props) {
|
|
7
|
+
var classPrefix = 'table-plus';
|
|
8
|
+
var eventListData = props.eventListData,
|
|
9
|
+
tableClick = props.tableClick; // console.log('TablePlus', eventListData);
|
|
10
|
+
// 表格列
|
|
11
|
+
|
|
12
|
+
var columns = [{
|
|
13
|
+
title: '事件名称',
|
|
14
|
+
dataIndex: 'eventName',
|
|
15
|
+
width: '25%',
|
|
16
|
+
render: function render(text, record, index) {
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "table-single"
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
20
|
+
style: {
|
|
21
|
+
marginRight: '10px'
|
|
22
|
+
},
|
|
23
|
+
checked: props.selectedRowKeys.indexOf(record.key) != -1,
|
|
24
|
+
onChange: function onChange(e) {
|
|
25
|
+
props.tableCheck(e, record);
|
|
26
|
+
}
|
|
27
|
+
}), text);
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
title: '采集状态',
|
|
31
|
+
dataIndex: 'eventActive',
|
|
32
|
+
width: '25%',
|
|
33
|
+
render: function render(text, record, index) {
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
className: "table-single"
|
|
36
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
37
|
+
className: text == '有数据' ? 'point-active' : 'point-active-null'
|
|
38
|
+
}), text);
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
title: '事件属性',
|
|
42
|
+
dataIndex: 'attributeName',
|
|
43
|
+
width: '25%',
|
|
44
|
+
render: function render(text, record, index) {
|
|
45
|
+
var data = record.open ? record.attributeName : [record.attributeName[0]];
|
|
46
|
+
var height = data.length * 48 + 'px';
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: data.length > 1 ? 'table-multiline' : 'table-single',
|
|
49
|
+
style: {
|
|
50
|
+
height: data.length > 1 ? height : '15px'
|
|
51
|
+
}
|
|
52
|
+
}, data.map(function (item, _index) {
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
key: _index
|
|
55
|
+
}, item);
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
title: '采集状态',
|
|
60
|
+
dataIndex: 'attributeActive',
|
|
61
|
+
width: '25%',
|
|
62
|
+
render: function render(text, record, index) {
|
|
63
|
+
var data = record.open ? record.attributeActive : [record.attributeActive[0]];
|
|
64
|
+
var height = data.length * 48 + 'px';
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: data.length > 1 ? 'table-multiline' : 'table-single',
|
|
67
|
+
style: {
|
|
68
|
+
height: data.length > 1 ? height : '15px'
|
|
69
|
+
}
|
|
70
|
+
}, data.map(function (item, _index) {
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
key: _index
|
|
73
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
74
|
+
className: item == '有数据' ? 'point-active' : 'point-active-null'
|
|
75
|
+
}), item);
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
}];
|
|
79
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: classPrefix
|
|
81
|
+
}, Object.keys(eventListData).map(function (item, index) {
|
|
82
|
+
return /*#__PURE__*/React.createElement(Table, {
|
|
83
|
+
key: index,
|
|
84
|
+
className: "".concat(classPrefix, "-table"),
|
|
85
|
+
columns: columns,
|
|
86
|
+
dataSource: eventListData[item],
|
|
87
|
+
bordered: true,
|
|
88
|
+
title: function title() {
|
|
89
|
+
var _eventListData$item$;
|
|
90
|
+
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", null, item, /*#__PURE__*/React.createElement("span", {
|
|
92
|
+
onClick: function onClick() {
|
|
93
|
+
tableClick(item, props.eventListDataIndex);
|
|
94
|
+
}
|
|
95
|
+
}, ((_eventListData$item$ = eventListData[item][0]) === null || _eventListData$item$ === void 0 ? void 0 : _eventListData$item$.open) ? /*#__PURE__*/React.createElement("span", {
|
|
96
|
+
className: "set-button"
|
|
97
|
+
}, "\u6536\u8D77") : /*#__PURE__*/React.createElement("span", {
|
|
98
|
+
className: "set-button"
|
|
99
|
+
}, "\u5C55\u5F00")));
|
|
100
|
+
},
|
|
101
|
+
pagination: false
|
|
102
|
+
});
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default TablePlus;
|