Commit 33d7e82a authored by 陈龙's avatar 陈龙

feat: 去除历史曲线loading

parents 10b6e87d 32194b56
......@@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.14.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basicreport@1.14.0...@wisdom-components/basicreport@1.14.1) (2024-03-13)
**Note:** Version bump only for package @wisdom-components/basicreport
# [1.14.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basicreport@1.13.1...@wisdom-components/basicreport@1.14.0) (2024-01-23)
### Features
......
{
"name": "@wisdom-components/basicreport",
"version": "1.14.0",
"version": "1.14.1",
"description": "> TODO: description",
"author": "chenlong <857265978@163.com>",
"homepage": "",
......@@ -33,6 +33,6 @@
},
"dependencies": {
"@babel/runtime": "^7.17.9",
"@wisdom-components/basictable": "1.5.28"
"@wisdom-components/basictable": "1.5.29"
}
}
......@@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.5.29](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.28...@wisdom-components/basictable@1.5.29) (2024-03-13)
**Note:** Version bump only for package @wisdom-components/basictable
## [1.5.28](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.27...@wisdom-components/basictable@1.5.28) (2023-02-13)
### Bug Fixes
......
{
"name": "@wisdom-components/basictable",
"version": "1.5.28",
"version": "1.5.29",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
import React, { useContext, useState, useEffect } from 'react';
import { ConfigProvider, Table } from 'antd';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import { Table, ConfigProvider } from 'antd';
import React, { useContext, useEffect, useRef, useState } from 'react';
import { Resizable } from 'react-resizable';
import 'react-resizable/css/styles.css';
import './index.less';
......@@ -26,12 +26,12 @@ const ResizeableTitle = (props) => {
};
const BasicTable = (props) => {
const tableRef = useRef(null);
const [cols, setCols] = useState(props.columns);
const [columns, setColumns] = useState(props.columns);
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table');
const pagination = typeof props.pagination !== 'undefined' ? props.pagination : {};
const showTotal = (total) => {
return `共 ${Math.ceil(
total / (props.pagination ? props.pagination.pageSize || 10 : 10),
......@@ -74,20 +74,28 @@ const BasicTable = (props) => {
);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [cols]);
const renderEmpty = () => {
let height = tableRef.current?.clientHeight;
// 表格高度减 表头 减padding
height = height ? (props.showHeader === false ? height - 15 - 32 : height - 60 - 32) : 200;
return <div style={{ height: height }} />;
};
useEffect(() => {
setCols(props.columns);
}, [props.columns]);
return (
<Table
className={classNames(prefixCls)}
scroll={{ y: 'calc(100% - 40px)' }}
components={components}
{...props}
columns={columns}
pagination={pagination ? { showTotal, ...pagination } : pagination}
/>
<ConfigProvider renderEmpty={renderEmpty}>
<Table
ref={tableRef}
className={classNames(prefixCls)}
scroll={{ y: 'calc(100% - 40px)' }}
components={components}
{...props}
columns={columns}
pagination={pagination ? { showTotal, ...pagination } : pagination}
/>
</ConfigProvider>
);
};
......
......@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.6](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/loadbox@1.1.5...@wisdom-components/loadbox@1.1.6) (2024-03-13)
### Performance Improvements
- 修改加载 loading 组件默认 1s 前不显示 ([eef8d60](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/eef8d6005c63ed3606abc3b0fe41aa505a4ffd96))
## [1.1.5](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/loadbox@1.1.4...@wisdom-components/loadbox@1.1.5) (2023-01-05)
**Note:** Version bump only for package @wisdom-components/loadbox
......
{
"name": "@wisdom-components/loadbox",
"version": "1.1.5",
"version": "1.1.6",
"description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>",
"homepage": "",
......
......@@ -5,7 +5,7 @@ import { Spin } from 'antd';
let timer = null;
const LoadBox = ({
delay,
delay = 1000,
indicator,
size,
tip,
......@@ -39,7 +39,7 @@ const LoadBox = ({
};
LoadBox.defaultProps = {
spinning: true,
delay: 0,
delay: 1000,
indicator: '',
size: 'default',
tip: '',
......
......@@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.9.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_configurationview@1.9.0...@wisdom-components/ec_configurationview@1.9.1) (2024-03-13)
**Note:** Version bump only for package @wisdom-components/ec_configurationview
# [1.9.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_configurationview@1.8.0...@wisdom-components/ec_configurationview@1.9.0) (2024-01-19)
### Features
......
{
"name": "@wisdom-components/ec_configurationview",
"version": "1.9.0",
"version": "1.9.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......@@ -34,7 +34,7 @@
"dependencies": {
"@babel/runtime": "^7.17.9",
"@wisdom-components/empty": "^1.3.9",
"@wisdom-components/loadbox": "^1.1.5",
"@wisdom-components/loadbox": "1.1.6",
"@wisdom-components/mqttview": "^1.3.7",
"cross-env": "^7.0.3"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment