Commit f50fcad0 authored by 涂茜's avatar 涂茜

Merge branch 'fix/bug' into 'dev'

Fix/bug See merge request !30
parents 206e7c16 22a9ef5b
Pipeline #26381 failed with stages
in 14 seconds
...@@ -137,8 +137,8 @@ ...@@ -137,8 +137,8 @@
"registry": "https://g.civnet.cn:4873" "registry": "https://g.civnet.cn:4873"
}, },
"dependencies": { "dependencies": {
"@wisdom-components/Empty": "^1.3.3",
"@wisdom-components/basictable": "^1.2.0", "@wisdom-components/basictable": "^1.2.0",
"@wisdom-components/empty": "^1.3.9",
"@wisdom-components/timerangepicker": "^1.3.4", "@wisdom-components/timerangepicker": "^1.3.4",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
......
# `@wisdom-components/BasicTable` # `@wisdom-components/basictable`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const basicTable = require('@wisdom-components/BasicTable'); const basicTable = require('@wisdom-components/basictable');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
# `@wisdom-components/BasicTools` # `@wisdom-components/basictools`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const basicTools = require('@wisdom-components/BasicTools'); const basicTools = require('@wisdom-components/basictools');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
...@@ -16,7 +16,7 @@ group: ...@@ -16,7 +16,7 @@ group:
## 使用说明 ## 使用说明
```javascript ```javascript
import { getTimeRange, getRange } from '@wisdom-components/BasicTools'; import { getTimeRange, getRange } from '@wisdom-components/basictools';
let result1 = getTimeRange('lastYear'); let result1 = getTimeRange('lastYear');
let result2 = getTimeRange('nextWeek'); let result2 = getTimeRange('nextWeek');
......
...@@ -2,6 +2,25 @@ ...@@ -2,6 +2,25 @@
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.3.11](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.8...@wisdom-components/devicetree@1.3.11) (2021-04-22)
### Bug Fixes
- bug ([9f4ef61](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/9f4ef61f7016acbc1992e37ba1ffeda66517022d))
- update package ([f0b3401](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/f0b34012654a1a9af9d20f72589b78671cb231a0))
## [1.3.10](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.8...@wisdom-components/devicetree@1.3.10) (2021-04-22)
### Bug Fixes
- bug ([9f4ef61](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/9f4ef61f7016acbc1992e37ba1ffeda66517022d))
## [1.3.9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.8...@wisdom-components/devicetree@1.3.9) (2021-04-21)
### Bug Fixes
- bug ([9f4ef61](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/9f4ef61f7016acbc1992e37ba1ffeda66517022d))
## [1.3.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.5...@wisdom-components/devicetree@1.3.8) (2021-04-20) ## [1.3.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.5...@wisdom-components/devicetree@1.3.8) (2021-04-20)
### Bug Fixes ### Bug Fixes
......
# `@wisdom-components/DeviceTree` # `@wisdom-components/devicetree`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const devicetree = require('@wisdom-components/DeviceTree'); const devicetree = require('@wisdom-components/devicetree');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
......
{ {
"name": "@wisdom-components/devicetree", "name": "@wisdom-components/devicetree",
"version": "1.3.8", "version": "1.3.11",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
......
...@@ -79,7 +79,7 @@ const Demo = () => { ...@@ -79,7 +79,7 @@ const Demo = () => {
}; };
return ( return (
<div style={{ width: '300px', height: '400px', border: '1px solid #eee' }}> <div style={{ width: '200px', height: '400px', border: '1px solid #eee' }}>
<PandaDeviceTree <PandaDeviceTree
onSearch={onSearch} onSearch={onSearch}
checkable checkable
......
...@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; ...@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Input, Tree, Divider, ConfigProvider } from 'antd'; import { Input, Tree, Divider, ConfigProvider } from 'antd';
import { SearchOutlined } from '@ant-design/icons'; import { SearchOutlined } from '@ant-design/icons';
import Empty from '@wisdom-components/Empty'; import Empty from '@wisdom-components/empty';
import './index.less'; import './index.less';
const DeviceTree = (props) => { const DeviceTree = (props) => {
......
...@@ -12,6 +12,14 @@ ...@@ -12,6 +12,14 @@
margin: 6px 0 12px 0; margin: 6px 0 12px 0;
} }
.ant-tree-checkbox {
margin: 4px 2px 0 0;
}
.ant-tree-title {
white-space: nowrap;
}
&-content { &-content {
flex: 1; flex: 1;
overflow-y: scroll; overflow-y: scroll;
......
# `@wisdom-components/Empty` # `@wisdom-components/empty`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const empty = require('@wisdom-components/Empty'); const empty = require('@wisdom-components/empty');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
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.4.10](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.4.8...@wisdom-components/historyinfo@1.4.10) (2021-04-22)
### Bug Fixes
- update package ([f0b3401](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/f0b34012654a1a9af9d20f72589b78671cb231a0))
## [1.4.9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.4.8...@wisdom-components/historyinfo@1.4.9) (2021-04-22)
**Note:** Version bump only for package @wisdom-components/historyinfo
## [1.4.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.4.5...@wisdom-components/historyinfo@1.4.8) (2021-04-20) ## [1.4.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.4.5...@wisdom-components/historyinfo@1.4.8) (2021-04-20)
### Bug Fixes ### Bug Fixes
......
# `@wisdom-components/HistoryInfo` # `@wisdom-components/historyinfo`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const historyinfo = require('@wisdom-components/HistoryInfo'); const historyinfo = require('@wisdom-components/historyinfo');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
{ {
"name": "@wisdom-components/historyinfo", "name": "@wisdom-components/historyinfo",
"version": "1.4.8", "version": "1.4.10",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
......
...@@ -92,6 +92,7 @@ const Demo = () => { ...@@ -92,6 +92,7 @@ const Demo = () => {
}; };
return ( return (
<div style={{ height: '1200px' }}>
<HistoryInfo <HistoryInfo
title={'指标曲线'} title={'指标曲线'}
columns={columns} columns={columns}
...@@ -99,8 +100,9 @@ const Demo = () => { ...@@ -99,8 +100,9 @@ const Demo = () => {
chartOptions={{ series }} chartOptions={{ series }}
tableProps={{ bordered: true }} tableProps={{ bordered: true }}
onChange={onChangeParams} onChange={onChangeParams}
defaultChecked={'roundClock'} // defaultChecked={'fourHour'}
/> />
</div>
); );
}; };
......
import React, { useContext, useState, useReducer, useEffect } from 'react'; import React, { useContext, useState, useReducer, useEffect, useRef } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import Highcharts from 'highcharts/highstock'; import Highcharts from 'highcharts/highstock';
...@@ -7,7 +7,7 @@ import { Tabs, Select, Radio, Checkbox, ConfigProvider, DatePicker } from 'antd' ...@@ -7,7 +7,7 @@ import { Tabs, Select, Radio, Checkbox, ConfigProvider, DatePicker } from 'antd'
import { PlusCircleOutlined } from '@ant-design/icons'; import { PlusCircleOutlined } from '@ant-design/icons';
import TimeRangePicker from '@wisdom-components/timerangepicker'; import TimeRangePicker from '@wisdom-components/timerangepicker';
import BasicTable from '@wisdom-components/basictable'; import BasicTable from '@wisdom-components/basictable';
import Empty from '@wisdom-components/Empty'; import Empty from '@wisdom-components/empty';
import moment from 'moment'; import moment from 'moment';
import './index.less'; import './index.less';
...@@ -115,10 +115,16 @@ const HistoryInfo = (props) => { ...@@ -115,10 +115,16 @@ const HistoryInfo = (props) => {
const [state, dispatch] = useReducer(reducer, initialState); const [state, dispatch] = useReducer(reducer, initialState);
const container = useRef(null);
useEffect(() => { useEffect(() => {
onChange(state); onChange(state);
}, [state]); }, [state]);
useEffect(() => {
dispatch({ type: UPDATE_TIME.UPDATE_TIME, payload: props.defaultChecked });
}, [props.defaultChecked]);
// 时间设置切换(自定义/同期对比) // 时间设置切换(自定义/同期对比)
const onTimeSetChange = (e) => { const onTimeSetChange = (e) => {
setTimeValue(e.target.value); setTimeValue(e.target.value);
...@@ -390,6 +396,15 @@ const HistoryInfo = (props) => { ...@@ -390,6 +396,15 @@ const HistoryInfo = (props) => {
}; };
} }
if (container.current) {
Highcharts.setOptions({
chart: {
width: container.current.offsetWidth,
height: container.current.offsetHeight - 10,
},
});
}
return options; return options;
}; };
...@@ -462,13 +477,14 @@ const HistoryInfo = (props) => { ...@@ -462,13 +477,14 @@ const HistoryInfo = (props) => {
{renderOptions(item)} {renderOptions(item)}
{!dataSource.length && <Empty />} {!dataSource.length && <Empty />}
{!!dataSource.length && ( {!!dataSource.length && (
<div> <div style={{ flex: 1 }} ref={container}>
{item.key === 'curve' && ( {item.key === 'curve' && (
<HighchartsReact <HighchartsReact
immutable={true} immutable={true}
highcharts={Highcharts} highcharts={Highcharts}
constructorType={'stockChart'} constructorType={'stockChart'}
options={handleChartOptions()} options={handleChartOptions()}
allowChartUpdate={true}
/> />
)} )}
{item.key === 'table' && ( {item.key === 'table' && (
......
...@@ -2,7 +2,17 @@ ...@@ -2,7 +2,17 @@
@history-info-prefix-cls: ~'@{ant-prefix}-history-info'; @history-info-prefix-cls: ~'@{ant-prefix}-history-info';
.@{history-info-prefix-cls} { .@{history-info-prefix-cls} {
height: 100%;
.ant-tabs,
.ant-tabs-content {
height: 100%;
}
&-content { &-content {
display: flex;
flex-direction: column;
height: 100%;
padding: 10px 0 0 0; padding: 10px 0 0 0;
} }
......
...@@ -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.3.9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/imageselect@1.3.8...@wisdom-components/imageselect@1.3.9) (2021-04-22)
### Bug Fixes
- update package ([f0b3401](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/f0b34012654a1a9af9d20f72589b78671cb231a0))
## [1.3.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/imageselect@1.3.5...@wisdom-components/imageselect@1.3.8) (2021-04-20) ## [1.3.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/imageselect@1.3.5...@wisdom-components/imageselect@1.3.8) (2021-04-20)
### Bug Fixes ### Bug Fixes
......
# `@wisdom-components/ImageSelect` # `@wisdom-components/imageselect`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const imageselect = require('@wisdom-components/ImageSelect'); const imageselect = require('@wisdom-components/imageselect');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
{ {
"name": "@wisdom-components/imageselect", "name": "@wisdom-components/imageselect",
"version": "1.3.8", "version": "1.3.9",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
......
...@@ -2,7 +2,7 @@ import React, { useContext, useState } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useContext, useState } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Input, Image, Modal, Row, Col, ConfigProvider } from 'antd'; import { Input, Image, Modal, Row, Col, ConfigProvider } from 'antd';
import Empty from '@wisdom-components/Empty'; import Empty from '@wisdom-components/empty';
import { PlusOutlined, SearchOutlined } from '@ant-design/icons'; import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
import './index.less'; import './index.less';
......
# `@wisdom-components/MqttView` # `@wisdom-components/mqttview`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const mqttView = require('@wisdom-components/MqttView'); const mqttView = require('@wisdom-components/mqttview');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
...@@ -2,6 +2,25 @@ ...@@ -2,6 +2,25 @@
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.7.5](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.7.2...@wisdom-components/quotaselect@1.7.5) (2021-04-22)
### Bug Fixes
- bug ([9f4ef61](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/9f4ef61f7016acbc1992e37ba1ffeda66517022d))
- update package ([f0b3401](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/f0b34012654a1a9af9d20f72589b78671cb231a0))
## [1.7.4](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.7.2...@wisdom-components/quotaselect@1.7.4) (2021-04-22)
### Bug Fixes
- bug ([9f4ef61](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/9f4ef61f7016acbc1992e37ba1ffeda66517022d))
## [1.7.3](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.7.2...@wisdom-components/quotaselect@1.7.3) (2021-04-21)
### Bug Fixes
- bug ([9f4ef61](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/9f4ef61f7016acbc1992e37ba1ffeda66517022d))
## [1.7.2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.6.0...@wisdom-components/quotaselect@1.7.2) (2021-04-20) ## [1.7.2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.6.0...@wisdom-components/quotaselect@1.7.2) (2021-04-20)
### Bug Fixes ### Bug Fixes
......
# `@wisdom-components/QuotaSelect` # `@wisdom-components/quotaselect`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const quotaselect = require('@wisdom-components/QuotaSelect'); const quotaselect = require('@wisdom-components/quotaselect');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
{ {
"name": "@wisdom-components/quotaselect", "name": "@wisdom-components/quotaselect",
"version": "1.7.2", "version": "1.7.5",
"description": "> TODO: description", "description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>", "author": "tuqian <webtuqian@163.com>",
"homepage": "", "homepage": "",
......
...@@ -19,6 +19,16 @@ const Demo = () => { ...@@ -19,6 +19,16 @@ const Demo = () => {
.then(function (response) { .then(function (response) {
if (response.code == '0') { if (response.code == '0') {
let curData = response.data; let curData = response.data;
curData.forEach((item) => {
item.decimalBit = item.DecimalBit;
item.deviation = item.Deviation;
item.format = item.Format;
item.isShow = item.IsShow;
item.name = item.Name;
item.style = item.Style;
item.type = item.Type;
item.unit = item.Unit;
});
setQuotaList(curData); setQuotaList(curData);
} }
}) })
......
...@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useState } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import { Button, Input, Radio, Modal, Checkbox, Row, Col, Tree, ConfigProvider } from 'antd'; import { Button, Input, Radio, Modal, Checkbox, Row, Col, Tree, ConfigProvider } from 'antd';
import Empty from '@wisdom-components/Empty'; import Empty from '@wisdom-components/empty';
import { ExclamationCircleFilled, SearchOutlined, CloseOutlined } from '@ant-design/icons'; import { ExclamationCircleFilled, SearchOutlined, CloseOutlined } from '@ant-design/icons';
import './index.less'; import './index.less';
...@@ -40,8 +40,8 @@ const QuotaSelect = ({ ...@@ -40,8 +40,8 @@ const QuotaSelect = ({
let data = dataSource.map((item) => ({ let data = dataSource.map((item) => ({
...item, ...item,
checked: false, checked: false,
title: item.Name, title: item.name,
key: item.Name, key: item.name,
})); }));
setAllQuotaList(data); setAllQuotaList(data);
} }
...@@ -71,7 +71,7 @@ const QuotaSelect = ({ ...@@ -71,7 +71,7 @@ const QuotaSelect = ({
// 过滤重点指标 // 过滤重点指标
const filterEmphasisQuota = () => { const filterEmphasisQuota = () => {
let newQuotaList = [...allQuotaList]; let newQuotaList = [...allQuotaList];
newQuotaList = newQuotaList.filter((item) => item.IsShow === '1'); newQuotaList = newQuotaList.filter((item) => item.isShow === '1');
setQuotaList(newQuotaList); setQuotaList(newQuotaList);
}; };
...@@ -111,7 +111,7 @@ const QuotaSelect = ({ ...@@ -111,7 +111,7 @@ const QuotaSelect = ({
if (e.target.value !== '') { if (e.target.value !== '') {
let newQuotaList = []; let newQuotaList = [];
quotaList.forEach((item) => { quotaList.forEach((item) => {
if (item.Name.indexOf(e.target.value) > -1) newQuotaList.push(item); if (item.name.indexOf(e.target.value) > -1) newQuotaList.push(item);
}); });
setQuotaList(newQuotaList); setQuotaList(newQuotaList);
} else { } else {
......
# `@wisdom-components/RealTimeInfo` # `@wisdom-components/realtimeinfo`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const realtimeinfo = require('@wisdom-components/RealTimeInfo'); const realtimeinfo = require('@wisdom-components/realtimeinfo');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
# `@wisdom-components/TimeRangePicker` # `@wisdom-components/timerangepicker`
> TODO: description > TODO: description
## Usage ## Usage
``` ```
const timeRangePicker = require('@wisdom-components/TimeRangePicker'); const timeRangePicker = require('@wisdom-components/timerangepicker');
// TODO: DEMONSTRATE API // TODO: DEMONSTRATE API
``` ```
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