@zgfe/modules-dm 1.0.2-dm.34 → 1.0.2-dm.35

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.
@@ -312,7 +312,7 @@
312
312
  height: 20px;
313
313
  .ant-drawer-close {
314
314
  position: absolute;
315
- right: 24px;
315
+ right: 6px;
316
316
  }
317
317
  }
318
318
  .ant-drawer-mask {
@@ -21,10 +21,10 @@ import { Input, Table, Select, message, Modal, Popover, Checkbox } from 'antd';
21
21
  import request from '../../utils/ajax';
22
22
  import apis from '../../constants/api';
23
23
  var Option = Select.Option;
24
- import React, { useState, useContext } from 'react';
24
+ import React, { useEffect, useState, useContext } from 'react';
25
25
  import './styles/index.less';
26
26
  import _ from 'lodash';
27
- import { getAppID } from '../../utils';
27
+ import { getAppID, getTableScroll } from '../../utils';
28
28
  import { DmContext } from '../../store';
29
29
 
30
30
  var TablePlus = function TablePlus(props) {
@@ -636,13 +636,24 @@ var TablePlus = function TablePlus(props) {
636
636
  // pageNumber != 1 && props.pageSizeChange(pageNumber);
637
637
  // }, [pageNumber]);
638
638
 
639
+ var _useState13 = useState(''),
640
+ _useState14 = _slicedToArray(_useState13, 2),
641
+ scrollY = _useState14[0],
642
+ setScrollY = _useState14[1]; //页面加载完成后才能获取到对应的元素及其位置
643
+
644
+
645
+ useEffect(function () {
646
+ var _Y = getTableScroll(); // console.log('_Y', _Y);
647
+
648
+
649
+ setScrollY(_Y);
650
+ }, []);
639
651
  return /*#__PURE__*/React.createElement("div", {
640
652
  className: classPrefix
641
653
  }, /*#__PURE__*/React.createElement(Table, {
642
654
  className: "".concat(classPrefix, "-table"),
643
- style: {
644
- minHeight: '640px'
645
- },
655
+ id: "tablePlus",
656
+ // style={{ minHeight: '640px' }}
646
657
  columns: columns,
647
658
  rowKey: "key",
648
659
  loading: props.loading,
@@ -652,7 +663,7 @@ var TablePlus = function TablePlus(props) {
652
663
  },
653
664
  scroll: {
654
665
  x: 1300,
655
- y: 550
666
+ y: scrollY
656
667
  },
657
668
  pagination: false,
658
669
  sticky: true
@@ -17,7 +17,7 @@
17
17
  .data-manage {
18
18
  position: relative;
19
19
  display: flex;
20
- height: 100%;
20
+ // height: 100%;
21
21
  background: #f5f5f5;
22
22
  .tabs-box {
23
23
  position: relative;
@@ -61,7 +61,7 @@
61
61
  .zhidie-botton {
62
62
  position: absolute;
63
63
  bottom: 0;
64
- left: 0;
64
+ left: -10px;
65
65
  width: 100%;
66
66
  height: 40px;
67
67
  font-size: 24px !important;
@@ -72,9 +72,9 @@
72
72
  }
73
73
  }
74
74
  .tabs-collapsed {
75
- min-width: 80px;
75
+ min-width: 48px;
76
76
  .tabs {
77
- min-width: 80px;
77
+ min-width: 48px;
78
78
  .tab {
79
79
  text-align: center;
80
80
  .bsicon {
@@ -86,7 +86,7 @@
86
86
  height: 20px;
87
87
  .ant-drawer-close {
88
88
  position: absolute;
89
- right: 24px;
89
+ right: 6px;
90
90
  }
91
91
  }
92
92
  .ant-drawer-mask {
@@ -117,7 +117,6 @@
117
117
  position: relative;
118
118
  display: flex;
119
119
  margin-top: -8px;
120
- margin-bottom: 8px;
121
120
  .input-waring {
122
121
  position: absolute;
123
122
  bottom: -30px;
@@ -130,6 +129,8 @@
130
129
  .plan-name-div {
131
130
  display: flex;
132
131
  height: 32px;
132
+ margin-top: -10px;
133
+ margin-bottom: -8px;
133
134
  color: #242541;
134
135
  font-weight: 500;
135
136
  font-size: 16px;
@@ -1 +1,7 @@
1
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;
package/es/utils/index.js CHANGED
@@ -6,4 +6,38 @@ export var getAppID = function getAppID(currentApp) {
6
6
  } else {
7
7
  return currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId;
8
8
  }
9
- };
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-dm.34",
3
+ "version": "1.0.2-dm.35",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "license": "ISC",
@@ -53,7 +53,7 @@
53
53
  "umi-request": "^1.4.0",
54
54
  "yorkie": "^2.0.0"
55
55
  },
56
- "gitHead": "d39265a9381367b86616e018ed05011ec7e0066e",
56
+ "gitHead": "5c9fedd7dfaed1615046c3519a175c5dd7aa352c",
57
57
  "gitHooks": {
58
58
  "pre-commit": "lint-staged"
59
59
  }