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

feat: 去除历史曲线loading

parents 10b6e87d 32194b56
...@@ -2,6 +2,10 @@ ...@@ -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. 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) # [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 ### Features
......
{ {
"name": "@wisdom-components/basicreport", "name": "@wisdom-components/basicreport",
"version": "1.14.0", "version": "1.14.1",
"description": "> TODO: description", "description": "> TODO: description",
"author": "chenlong <857265978@163.com>", "author": "chenlong <857265978@163.com>",
"homepage": "", "homepage": "",
...@@ -33,6 +33,6 @@ ...@@ -33,6 +33,6 @@
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.9", "@babel/runtime": "^7.17.9",
"@wisdom-components/basictable": "1.5.28" "@wisdom-components/basictable": "1.5.29"
} }
} }
...@@ -2,6 +2,10 @@ ...@@ -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. 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) ## [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 ### Bug Fixes
......
{ {
"name": "@wisdom-components/basictable", "name": "@wisdom-components/basictable",
"version": "1.5.28", "version": "1.5.29",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
......
import React, { useContext, useState, useEffect } from 'react'; import { ConfigProvider, Table } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Table, ConfigProvider } from 'antd'; import React, { useContext, useEffect, useRef, useState } from 'react';
import { Resizable } from 'react-resizable'; import { Resizable } from 'react-resizable';
import 'react-resizable/css/styles.css'; import 'react-resizable/css/styles.css';
import './index.less'; import './index.less';
...@@ -26,12 +26,12 @@ const ResizeableTitle = (props) => { ...@@ -26,12 +26,12 @@ const ResizeableTitle = (props) => {
}; };
const BasicTable = (props) => { const BasicTable = (props) => {
const tableRef = useRef(null);
const [cols, setCols] = useState(props.columns); const [cols, setCols] = useState(props.columns);
const [columns, setColumns] = useState(props.columns); const [columns, setColumns] = useState(props.columns);
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table'); const prefixCls = getPrefixCls('basic-table');
const pagination = typeof props.pagination !== 'undefined' ? props.pagination : {}; const pagination = typeof props.pagination !== 'undefined' ? props.pagination : {};
const showTotal = (total) => { const showTotal = (total) => {
return `共 ${Math.ceil( return `共 ${Math.ceil(
total / (props.pagination ? props.pagination.pageSize || 10 : 10), total / (props.pagination ? props.pagination.pageSize || 10 : 10),
...@@ -74,20 +74,28 @@ const BasicTable = (props) => { ...@@ -74,20 +74,28 @@ const BasicTable = (props) => {
); );
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [cols]); }, [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(() => { useEffect(() => {
setCols(props.columns); setCols(props.columns);
}, [props.columns]); }, [props.columns]);
return ( return (
<Table <ConfigProvider renderEmpty={renderEmpty}>
className={classNames(prefixCls)} <Table
scroll={{ y: 'calc(100% - 40px)' }} ref={tableRef}
components={components} className={classNames(prefixCls)}
{...props} scroll={{ y: 'calc(100% - 40px)' }}
columns={columns} components={components}
pagination={pagination ? { showTotal, ...pagination } : pagination} {...props}
/> columns={columns}
pagination={pagination ? { showTotal, ...pagination } : pagination}
/>
</ConfigProvider>
); );
}; };
......
...@@ -2,6 +2,12 @@ ...@@ -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. 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) ## [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 **Note:** Version bump only for package @wisdom-components/loadbox
......
{ {
"name": "@wisdom-components/loadbox", "name": "@wisdom-components/loadbox",
"version": "1.1.5", "version": "1.1.6",
"description": "> TODO: description", "description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>", "author": "lijiwen <961370825@qq.com>",
"homepage": "", "homepage": "",
......
...@@ -5,7 +5,7 @@ import { Spin } from 'antd'; ...@@ -5,7 +5,7 @@ import { Spin } from 'antd';
let timer = null; let timer = null;
const LoadBox = ({ const LoadBox = ({
delay, delay = 1000,
indicator, indicator,
size, size,
tip, tip,
...@@ -39,7 +39,7 @@ const LoadBox = ({ ...@@ -39,7 +39,7 @@ const LoadBox = ({
}; };
LoadBox.defaultProps = { LoadBox.defaultProps = {
spinning: true, spinning: true,
delay: 0, delay: 1000,
indicator: '', indicator: '',
size: 'default', size: 'default',
tip: '', tip: '',
......
...@@ -2,6 +2,10 @@ ...@@ -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. 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) # [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 ### Features
......
{ {
"name": "@wisdom-components/ec_configurationview", "name": "@wisdom-components/ec_configurationview",
"version": "1.9.0", "version": "1.9.1",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"dependencies": { "dependencies": {
"@babel/runtime": "^7.17.9", "@babel/runtime": "^7.17.9",
"@wisdom-components/empty": "^1.3.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", "@wisdom-components/mqttview": "^1.3.7",
"cross-env": "^7.0.3" "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