@zgfe/modules-dm 1.0.2-dm.8 → 1.0.2-y.0
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/modules/dataCollection/collectionAttributeList.d.ts +2 -1
- package/es/modules/dataCollection/collectionAttributeList.js +65 -28
- package/es/modules/dataCollection/collectionEventList.js +279 -57
- package/es/modules/dataCollection/index.js +9 -7
- package/es/modules/dataCollection/styles/index.less +268 -230
- package/es/modules/dataCollection/tablePlus.d.ts +3 -0
- package/es/modules/dataCollection/tablePlus.js +123 -61
- package/es/modules/dataManage/index.d.ts +1 -0
- package/es/modules/dataManage/index.js +69 -34
- package/es/modules/dataManage/styles/index.less +73 -6
- package/es/modules/dataPlan/addEventOrUser.js +35 -10
- package/es/modules/dataPlan/addPlan.js +232 -129
- package/es/modules/dataPlan/index.js +26 -11
- package/es/modules/dataPlan/search.d.ts +1 -0
- package/es/modules/dataPlan/search.js +3 -2
- package/es/modules/dataPlan/styles/index.less +66 -18
- package/es/modules/dataPlan/userAttributeList.js +3 -24
- package/es/store/index.d.ts +1 -0
- package/es/store/index.js +26 -3
- package/es/store/state.js +1 -3
- package/es/utils/index.d.ts +7 -0
- package/es/utils/index.js +43 -0
- package/package.json +3 -3
|
@@ -17,6 +17,7 @@ import React, { useEffect, useState, useContext } from 'react';
|
|
|
17
17
|
import './styles/index.less';
|
|
18
18
|
import request from '../../utils/ajax';
|
|
19
19
|
import apis from '../../constants/api';
|
|
20
|
+
import { getAppID } from '../../utils';
|
|
20
21
|
import AddPlan from './addPlan';
|
|
21
22
|
|
|
22
23
|
var PlanList = function PlanList(props) {
|
|
@@ -24,8 +25,9 @@ var PlanList = function PlanList(props) {
|
|
|
24
25
|
|
|
25
26
|
var _useContext = useContext(BizGlobalDataContext),
|
|
26
27
|
currentApp = _useContext.currentApp,
|
|
27
|
-
isDemo = _useContext.isDemo;
|
|
28
|
+
isDemo = _useContext.isDemo;
|
|
28
29
|
|
|
30
|
+
console.log('②埋点方案管理', currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId, getAppID(currentApp)); // 查看方案
|
|
29
31
|
|
|
30
32
|
var tableSee = function tableSee(data) {
|
|
31
33
|
setDetailId(data.id);
|
|
@@ -35,6 +37,11 @@ var PlanList = function PlanList(props) {
|
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
var tableDel = function tableDel(data) {
|
|
40
|
+
if (isDemo) {
|
|
41
|
+
message.error('demo环境,无法删除');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
38
45
|
Modal.confirm({
|
|
39
46
|
centered: true,
|
|
40
47
|
title: '是否确认删除方案?',
|
|
@@ -45,7 +52,7 @@ var PlanList = function PlanList(props) {
|
|
|
45
52
|
request(apis.deletePlan, {
|
|
46
53
|
method: 'post',
|
|
47
54
|
data: {
|
|
48
|
-
appId: currentApp
|
|
55
|
+
appId: getAppID(currentApp),
|
|
49
56
|
planName: data
|
|
50
57
|
}
|
|
51
58
|
}).then(function (res) {
|
|
@@ -117,11 +124,10 @@ var PlanList = function PlanList(props) {
|
|
|
117
124
|
request(apis.getAllPlan, {
|
|
118
125
|
method: 'get',
|
|
119
126
|
params: {
|
|
120
|
-
appId: currentApp
|
|
127
|
+
appId: getAppID(currentApp)
|
|
121
128
|
}
|
|
122
129
|
}).then(function (res) {
|
|
123
|
-
|
|
124
|
-
setListData(res.data.planList);
|
|
130
|
+
res.data && res.data.planList && setListData(res.data.planList);
|
|
125
131
|
}).catch(function (err) {
|
|
126
132
|
console.error('查询列表失败', err);
|
|
127
133
|
}).finally(function () {});
|
|
@@ -158,7 +164,7 @@ var PlanList = function PlanList(props) {
|
|
|
158
164
|
request(apis.queryControlSwitch, {
|
|
159
165
|
method: 'get',
|
|
160
166
|
params: {
|
|
161
|
-
appId: currentApp
|
|
167
|
+
appId: getAppID(currentApp)
|
|
162
168
|
}
|
|
163
169
|
}).then(function (res) {
|
|
164
170
|
var _res$data;
|
|
@@ -176,7 +182,7 @@ var PlanList = function PlanList(props) {
|
|
|
176
182
|
request(apis.updateControlSwitch, {
|
|
177
183
|
method: 'post',
|
|
178
184
|
data: {
|
|
179
|
-
appId: currentApp
|
|
185
|
+
appId: getAppID(currentApp),
|
|
180
186
|
isOpen: !isOpen ? '1' : '0'
|
|
181
187
|
}
|
|
182
188
|
}).then(function (res) {
|
|
@@ -194,17 +200,26 @@ var PlanList = function PlanList(props) {
|
|
|
194
200
|
|
|
195
201
|
return /*#__PURE__*/React.createElement("div", {
|
|
196
202
|
className: classPrefix
|
|
197
|
-
},
|
|
203
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
198
204
|
className: "".concat(classPrefix, "-switchbox clearfix")
|
|
199
205
|
}, /*#__PURE__*/React.createElement("div", {
|
|
200
206
|
className: "switch-div"
|
|
201
|
-
}, /*#__PURE__*/React.createElement("span",
|
|
207
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
208
|
+
style: {
|
|
209
|
+
lineHeight: '32px'
|
|
210
|
+
}
|
|
211
|
+
}, "\u57CB\u70B9\u65B9\u6848\u63A7\u5236"), /*#__PURE__*/React.createElement(Switch, {
|
|
202
212
|
onChange: isOpenChang,
|
|
203
213
|
checkedChildren: "\u5F00",
|
|
204
214
|
unCheckedChildren: "\u5173",
|
|
205
215
|
checked: isOpen
|
|
206
216
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
217
|
+
disabled: isDemo,
|
|
207
218
|
onClick: function onClick() {
|
|
219
|
+
if (listData.length >= 10) {
|
|
220
|
+
return message.error('最多创建10个埋点方案');
|
|
221
|
+
}
|
|
222
|
+
|
|
208
223
|
setDrawerShow(true);
|
|
209
224
|
},
|
|
210
225
|
type: "primary",
|
|
@@ -213,7 +228,7 @@ var PlanList = function PlanList(props) {
|
|
|
213
228
|
type: "tianjia",
|
|
214
229
|
style: {
|
|
215
230
|
marginRight: '5px',
|
|
216
|
-
verticalAlign: '-
|
|
231
|
+
verticalAlign: '-1px'
|
|
217
232
|
}
|
|
218
233
|
}), "\u65B0\u589E\u57CB\u70B9\u65B9\u6848")), /*#__PURE__*/React.createElement(Table, {
|
|
219
234
|
className: "".concat(classPrefix, "-table"),
|
|
@@ -222,7 +237,7 @@ var PlanList = function PlanList(props) {
|
|
|
222
237
|
dataSource: listData,
|
|
223
238
|
// onChange={onChange}
|
|
224
239
|
pagination: false
|
|
225
|
-
})
|
|
240
|
+
}), /*#__PURE__*/React.createElement(AddPlan, {
|
|
226
241
|
listData: listData,
|
|
227
242
|
detailName: detailName,
|
|
228
243
|
drawerShow: drawerShow,
|
|
@@ -23,15 +23,16 @@ var Search = function Search(props) {
|
|
|
23
23
|
})
|
|
24
24
|
}), /*#__PURE__*/React.createElement("div", {
|
|
25
25
|
className: "".concat(classPrefix, "-text")
|
|
26
|
-
}, "\u5171", /*#__PURE__*/React.createElement("span", null, props.total), "\u6761 / \u4E0A\u9650500\u6761"), /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
}, "\u5171 ", /*#__PURE__*/React.createElement("span", null, props.total), " \u6761 / \u4E0A\u9650500\u6761"), /*#__PURE__*/React.createElement(Button, {
|
|
27
27
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
28
28
|
type: "tianjia",
|
|
29
29
|
style: {
|
|
30
30
|
marginRight: '5px',
|
|
31
|
-
verticalAlign: '-
|
|
31
|
+
verticalAlign: '-1px'
|
|
32
32
|
}
|
|
33
33
|
}),
|
|
34
34
|
type: "primary",
|
|
35
|
+
disabled: props.isDemo,
|
|
35
36
|
className: "".concat(classPrefix, "-add-button"),
|
|
36
37
|
onClick: function onClick() {
|
|
37
38
|
props.setVisible(true);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@import '~@zgfe/business-lib/es/assets/styles/inner.less';
|
|
2
2
|
.plan-list {
|
|
3
3
|
position: relative;
|
|
4
|
-
width: calc(100% - 264px);
|
|
5
4
|
height: 100%;
|
|
6
|
-
margin-
|
|
7
|
-
padding: 24px;
|
|
5
|
+
margin-right: 24px;
|
|
6
|
+
padding: 20px 24px 24px 24px;
|
|
8
7
|
background: #fff;
|
|
8
|
+
border-radius: 8px;
|
|
9
9
|
.clearfix:after {
|
|
10
10
|
display: block;
|
|
11
11
|
clear: both;
|
|
@@ -42,12 +42,17 @@
|
|
|
42
42
|
// border-top: 1px solid #e8efff;
|
|
43
43
|
.switch-div {
|
|
44
44
|
float: left;
|
|
45
|
+
.ant-switch {
|
|
46
|
+
width: 24px;
|
|
47
|
+
margin-top: -2px;
|
|
48
|
+
}
|
|
45
49
|
span {
|
|
46
50
|
margin-right: 20px;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
.add {
|
|
50
54
|
float: right;
|
|
55
|
+
line-height: 20px;
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
&-table-see {
|
|
@@ -76,6 +81,23 @@
|
|
|
76
81
|
.add-plan {
|
|
77
82
|
position: relative;
|
|
78
83
|
height: 100%;
|
|
84
|
+
&-drawer {
|
|
85
|
+
.ant-drawer-header-title {
|
|
86
|
+
height: 20px;
|
|
87
|
+
.ant-drawer-close {
|
|
88
|
+
position: absolute;
|
|
89
|
+
right: 6px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
.ant-drawer-mask {
|
|
93
|
+
background: rgba(0, 0, 0, 0.8);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.spin {
|
|
97
|
+
position: absolute;
|
|
98
|
+
top: 50%;
|
|
99
|
+
left: 50%;
|
|
100
|
+
}
|
|
79
101
|
.point-active,
|
|
80
102
|
.point-active-null {
|
|
81
103
|
display: inline-block;
|
|
@@ -94,7 +116,7 @@
|
|
|
94
116
|
&-top {
|
|
95
117
|
position: relative;
|
|
96
118
|
display: flex;
|
|
97
|
-
margin-
|
|
119
|
+
margin-top: -8px;
|
|
98
120
|
.input-waring {
|
|
99
121
|
position: absolute;
|
|
100
122
|
bottom: -30px;
|
|
@@ -107,6 +129,8 @@
|
|
|
107
129
|
.plan-name-div {
|
|
108
130
|
display: flex;
|
|
109
131
|
height: 32px;
|
|
132
|
+
margin-top: -10px;
|
|
133
|
+
margin-bottom: -8px;
|
|
110
134
|
color: #242541;
|
|
111
135
|
font-weight: 500;
|
|
112
136
|
font-size: 16px;
|
|
@@ -131,8 +155,8 @@
|
|
|
131
155
|
}
|
|
132
156
|
&-tabs {
|
|
133
157
|
position: relative;
|
|
134
|
-
display: flex;
|
|
135
|
-
margin-bottom: 15px;
|
|
158
|
+
// display: flex;
|
|
159
|
+
// margin-bottom: 15px;
|
|
136
160
|
> :nth-child(1) {
|
|
137
161
|
border-radius: 4px 0 0 4px !important;
|
|
138
162
|
}
|
|
@@ -141,8 +165,8 @@
|
|
|
141
165
|
}
|
|
142
166
|
.handle-box {
|
|
143
167
|
position: absolute;
|
|
144
|
-
top:
|
|
145
|
-
right:
|
|
168
|
+
top: 5px;
|
|
169
|
+
right: 0;
|
|
146
170
|
.bsicon {
|
|
147
171
|
margin-right: 10px;
|
|
148
172
|
}
|
|
@@ -158,15 +182,22 @@
|
|
|
158
182
|
}
|
|
159
183
|
}
|
|
160
184
|
&-table-header {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
185
|
+
.ant-table-tbody {
|
|
186
|
+
display: none;
|
|
187
|
+
}
|
|
188
|
+
.ant-table {
|
|
189
|
+
border-radius: 8px 8px 0 0 !important;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
&-table-header.empty {
|
|
193
|
+
.ant-table {
|
|
194
|
+
border-radius: 8px !important;
|
|
195
|
+
}
|
|
196
|
+
.ant-table-tbody {
|
|
197
|
+
display: contents;
|
|
198
|
+
}
|
|
199
|
+
.ant-table-tbody > tr > td {
|
|
200
|
+
border-bottom: 0px solid #e8efff;
|
|
170
201
|
}
|
|
171
202
|
}
|
|
172
203
|
.user-list,
|
|
@@ -209,6 +240,10 @@
|
|
|
209
240
|
.ant-table-thead {
|
|
210
241
|
display: none;
|
|
211
242
|
}
|
|
243
|
+
.ant-table {
|
|
244
|
+
border: none;
|
|
245
|
+
border-radius: 0;
|
|
246
|
+
}
|
|
212
247
|
}
|
|
213
248
|
// &-table-header {
|
|
214
249
|
// display: flex;
|
|
@@ -235,6 +270,17 @@
|
|
|
235
270
|
}
|
|
236
271
|
}
|
|
237
272
|
.add-event {
|
|
273
|
+
.set-del {
|
|
274
|
+
margin-left: 15px;
|
|
275
|
+
color: #021429;
|
|
276
|
+
}
|
|
277
|
+
.set-del-err {
|
|
278
|
+
color: #cacdd4;
|
|
279
|
+
cursor: not-allowed;
|
|
280
|
+
}
|
|
281
|
+
.ant-modal-body {
|
|
282
|
+
padding: 5px 24px 24px 24px;
|
|
283
|
+
}
|
|
238
284
|
.ant-form-item {
|
|
239
285
|
margin: 0;
|
|
240
286
|
}
|
|
@@ -259,11 +305,13 @@
|
|
|
259
305
|
&-text {
|
|
260
306
|
span {
|
|
261
307
|
color: @primary-color;
|
|
308
|
+
font-weight: bold;
|
|
262
309
|
}
|
|
263
310
|
}
|
|
264
311
|
&-add-button {
|
|
265
312
|
position: absolute;
|
|
266
|
-
right:
|
|
313
|
+
right: 0;
|
|
314
|
+
line-height: 20px;
|
|
267
315
|
}
|
|
268
316
|
}
|
|
269
317
|
}
|
|
@@ -1,31 +1,11 @@
|
|
|
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
1
|
import { Select, Table, Checkbox } from 'antd';
|
|
14
2
|
var Option = Select.Option;
|
|
15
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
16
4
|
import './styles/index.less';
|
|
17
5
|
|
|
18
6
|
var UserAttributeList = function UserAttributeList(props) {
|
|
19
7
|
var classPrefix = 'user-list'; // console.log('userAttrData', props.userAttrData);
|
|
20
|
-
|
|
21
|
-
var _useState = useState([]),
|
|
22
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
-
renderData = _useState2[0],
|
|
24
|
-
setRenderData = _useState2[1];
|
|
25
|
-
|
|
26
|
-
useEffect(function () {
|
|
27
|
-
setRenderData(props.userAttrData);
|
|
28
|
-
}, [props.userAttrData]); // 表格列
|
|
8
|
+
// 表格列
|
|
29
9
|
|
|
30
10
|
var columns = [{
|
|
31
11
|
title: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -68,8 +48,7 @@ var UserAttributeList = function UserAttributeList(props) {
|
|
|
68
48
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
69
49
|
className: "".concat(classPrefix, "-table"),
|
|
70
50
|
columns: columns,
|
|
71
|
-
dataSource:
|
|
72
|
-
bordered: true,
|
|
51
|
+
dataSource: props.userAttrData,
|
|
73
52
|
pagination: false
|
|
74
53
|
}));
|
|
75
54
|
};
|
package/es/store/index.d.ts
CHANGED
package/es/store/index.js
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
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
|
+
|
|
1
13
|
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; }
|
|
2
14
|
|
|
3
15
|
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
16
|
|
|
5
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
18
|
|
|
7
|
-
import { createContext } from 'react';
|
|
19
|
+
import { useReducer, createContext } from 'react';
|
|
8
20
|
import { initState } from './state';
|
|
9
21
|
import { ActionType } from './action';
|
|
10
22
|
|
|
11
23
|
var DmReducer = function DmReducer(prevState, action) {
|
|
24
|
+
// console.log('DmReducer', prevState, action);
|
|
12
25
|
switch (action.type) {
|
|
13
26
|
case ActionType.SET_GLOBAL:
|
|
14
|
-
return _objectSpread(_objectSpread({}, prevState),
|
|
27
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
28
|
+
updateEventMetas: action.payload
|
|
29
|
+
});
|
|
15
30
|
|
|
16
31
|
default:
|
|
17
32
|
return initState;
|
|
@@ -21,4 +36,12 @@ var DmReducer = function DmReducer(prevState, action) {
|
|
|
21
36
|
export var DmContext = /*#__PURE__*/createContext({
|
|
22
37
|
state: initState,
|
|
23
38
|
dispatch: function dispatch() {}
|
|
24
|
-
});
|
|
39
|
+
});
|
|
40
|
+
export var upDatedDmFun = function upDatedDmFun() {
|
|
41
|
+
var _useReducer = useReducer(DmReducer, initState),
|
|
42
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
43
|
+
state = _useReducer2[0],
|
|
44
|
+
dispatch = _useReducer2[1];
|
|
45
|
+
|
|
46
|
+
return [state, dispatch];
|
|
47
|
+
};
|
package/es/store/state.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getAppID: (currentApp: any) => any;
|
|
2
|
+
/**
|
|
3
|
+
* 获取第一个表格的可视化高度
|
|
4
|
+
* @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74)
|
|
5
|
+
* @param {*} id 当前页面中有多个table时需要制定table的id
|
|
6
|
+
*/
|
|
7
|
+
export declare function getTableScroll(extraHeight?: any, id?: any): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export var getAppID = function getAppID(currentApp) {
|
|
2
|
+
var href = window.location.href;
|
|
3
|
+
|
|
4
|
+
if (href.indexOf('/app/') != -1 && href.indexOf('localhost') == -1) {
|
|
5
|
+
return href.split('/app/')[1].split('/')[0];
|
|
6
|
+
} else {
|
|
7
|
+
return currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* 获取第一个表格的可视化高度
|
|
12
|
+
* @param {*} extraHeight 额外的高度(表格底部的内容高度 Number类型,默认为74)
|
|
13
|
+
* @param {*} id 当前页面中有多个table时需要制定table的id
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export function getTableScroll(extraHeight, id) {
|
|
17
|
+
if (typeof extraHeight == 'undefined') {
|
|
18
|
+
// 默认底部分页64 + 边距10
|
|
19
|
+
extraHeight = 74;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var tHeader = null;
|
|
23
|
+
|
|
24
|
+
if (id) {
|
|
25
|
+
var _document$getElementB;
|
|
26
|
+
|
|
27
|
+
tHeader = document.getElementById(id) ? (_document$getElementB = document.getElementById(id)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.getElementsByClassName('ant-table-thead')[0] : null;
|
|
28
|
+
} else {
|
|
29
|
+
tHeader = document.getElementsByClassName('ant-table-thead')[0];
|
|
30
|
+
} //表格内容距离顶部的距离
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
var tHeaderBottom = 0;
|
|
34
|
+
|
|
35
|
+
if (tHeader) {
|
|
36
|
+
tHeaderBottom = tHeader.getBoundingClientRect().bottom;
|
|
37
|
+
} //窗体高度-表格内容顶部的高度-表格内容底部的高度
|
|
38
|
+
// let height = document.body.clientHeight - tHeaderBottom - extraHeight
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var height = "calc(100vh - ".concat(tHeaderBottom + extraHeight, "px)");
|
|
42
|
+
return height;
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-dm",
|
|
3
|
-
"version": "1.0.2-
|
|
3
|
+
"version": "1.0.2-y.0",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"license": "ISC",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/lodash": "^4.14.182",
|
|
42
42
|
"@umijs/fabric": "^2.8.1",
|
|
43
43
|
"@umijs/test": "^3.0.5",
|
|
44
|
-
"@zgfe/business-lib": "1.1.7-
|
|
44
|
+
"@zgfe/business-lib": "1.1.7-dmd2.8",
|
|
45
45
|
"antd": "4.22.6",
|
|
46
46
|
"dumi": "^1.1.0",
|
|
47
47
|
"father-build": "^1.17.2",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"umi-request": "^1.4.0",
|
|
54
54
|
"yorkie": "^2.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "92b2df999c88d9b40535ec116e0fec60affe197c",
|
|
57
57
|
"gitHooks": {
|
|
58
58
|
"pre-commit": "lint-staged"
|
|
59
59
|
}
|