Browse Source

tableView分页器固定在底部、最后一行边框保留

zhuth 6 years ago
parent
commit
c5487cde80

+ 2 - 2
src/components/dashboardDesigner/viewLayout.jsx

@@ -139,7 +139,7 @@ class ViewLayout extends React.PureComponent {
     render() {
         const { dashboardDesigner, contentSize, lastContentSize, dispatch } = this.props;
         const { editingKey } = this.state;
-        const { editMode, minLayoutHeight } = dashboardDesigner;
+        const { editMode, minLayoutHeight, layoutMargin } = dashboardDesigner;
         const { visiblePreviewBox, previewItem } = this.state;
         const children = dashboardDesigner.items.map((item) => this.createElement(item, false, !item.chartOption));
         return (<div className='dashboard-viewcontent'>
@@ -147,7 +147,7 @@ class ViewLayout extends React.PureComponent {
                 width={ contentSize.width ? contentSize.width : lastContentSize.width }
                 autoSize={true}
                 cols={12}
-                margin = {editMode ? [12, 12] : [12, 12]}
+                margin = {editMode ? layoutMargin : layoutMargin}
                 rowHeight = {minLayoutHeight}
                 isDraggable={editMode && !editingKey}
                 isResizable={editMode && !editingKey}

+ 2 - 1
src/models/dashboardDesigner.js

@@ -89,7 +89,8 @@ export default {
         originData: {
             code: null,
             name: '无标题',
-            minLayoutHeight: 40,
+            minLayoutHeight: 40, // 元素最小高度
+            layoutMargin: [8, 8], // 元素margin
             defaultLayout: { x: 0, y: 50, w: 12, h: 6, minW: 2, maxW: 12, minH: 1 },
             items: [],
             chartCodes: [], // 报表包含的所有图表

+ 8 - 0
src/themes/default/base.less

@@ -79,6 +79,14 @@
         border-bottom: 1px solid #e8e8e8;
     }
 }
+.ant-table-small > .ant-table-content .ant-table-placeholder, .ant-table-small > .ant-table-content .ant-table-row:last-child td {
+    border-bottom: 1px solid #e8e8e8;
+}
+.ant-table-pagination {
+    position: absolute;
+    bottom: 0;
+    right: 0;
+}
 
 // ListFilter
 .list-filter .ant-select:first-child .ant-select-selection.ant-select-selection--single {