Commit 91774954 authored by 李纪文's avatar 李纪文

Merge branch 'dev' into 'master'

Dev See merge request !37
parents e21aa24a 45f05857
Pipeline #27522 passed with stages
in 5 minutes 7 seconds
......@@ -88,6 +88,7 @@ export default {
'TimeRangePicker',
'MqttView',
'ExportExcel',
'DatePickerCustom',
],
},
{
......@@ -101,9 +102,16 @@ export default {
],
'/extend-components': [
{
title: 'base',
children: ['EC-DeviceTree', 'EC-QuotaSelect'],
title: '数据展示',
children: ['EC_DeviceTree', 'EC_QuotaSelect', 'EC_HistoryInfo'],
},
],
},
proxy: {
'/api': {
target: 'http://127.0.0.1:8888/',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
};
......@@ -2,6 +2,43 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.5.5](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.1...@wisdom-components/basictable@1.5.5) (2021-05-12)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.5.4](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.1...@wisdom-components/basictable@1.5.4) (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.5.3](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.1...@wisdom-components/basictable@1.5.3) (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.5.2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.1...@wisdom-components/basictable@1.5.2) (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.5.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.5.0...@wisdom-components/basictable@1.5.1) (2021-05-11)
### Bug Fixes
- 修改基础表格组件 ([67d9365](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/67d9365634a32d8018ab704a749562a51157988a))
# [1.5.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.4.5...@wisdom-components/basictable@1.5.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
- ec-devicetree ([579e5d2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/579e5d2dd845b9dd58ab4c8db8aaaf7c64ebc3f8))
## [1.4.5](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictable@1.4.2...@wisdom-components/basictable@1.4.5) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/basictable",
"version": "1.4.5",
"version": "1.5.5",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -45,7 +45,7 @@ const Demo = () => {
// @ts-ignore
return (
<div style={{ height: '400px' }}>
<div style={{ height: '800px' }}>
{!!dataSource.length && <BasicTable dataSource={dataSource} columns={columns} bordered />}
{!dataSource.length && <Empty description={'暂无数据'} />}
</div>
......
......@@ -7,7 +7,6 @@ import './index.less';
const BasicTable = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table');
return <Table className={classNames(prefixCls)} scroll={{ y: 'calc(100% - 40px)' }} {...props} />;
};
......
......@@ -118,9 +118,13 @@
}
.ant-table.ant-table-bordered > .ant-table-container {
border: 1px solid #dbe7fb;
border-right: 0;
border-bottom: 0;
border-top: 1px solid #dbe7fb;
border-left: 0;
}
.ant-table-header,
.ant-table-body {
border-left: 1px solid #dbe7fb;
}
.ant-table-summary {
......
......@@ -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.
## [1.3.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictools@1.3.0...@wisdom-components/basictools@1.3.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/basictools
# [1.3.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictools@1.2.10...@wisdom-components/basictools@1.3.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.2.10](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basictools@1.2.7...@wisdom-components/basictools@1.2.10) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/basictools",
"version": "1.2.10",
"version": "1.3.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
# Change Log
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# 1.1.0 (2021-05-12)
### Features
- 增加时间选择组件 ([599df63](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/599df63c3ac4d20bfd51d290102b0b7a6a9b7c65))
# `@wisdom-components/DatePickerCustom`
> TODO: description
## Usage
```
const datePicker = require('@wisdom-components/datepickercustom');
// TODO: DEMONSTRATE API
```
{
"name": "@wisdom-components/datepickercustom",
"version": "1.1.0",
"description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>",
"homepage": "",
"license": "ISC",
"main": "lib/index.js",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"publishConfig": {
"registry": "https://g.civnet.cn:4873/"
},
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/ReactWeb5/wisdom-components.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1"
}
}
---
title: DatePicker - 时间选择器
nav:
title: 基础组件
path: /components
group:
path: /
---
# DatePickerCustom 时间选择器
## 代码演示
<code src="./demos/base.tsx">
## API
api 参考 Antd Table 组件 https://ant.design/components/date-picker-cn/#API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| onChange | 改变选择的时间,重写 antd 方法,返回起始时间对象 | function(date, dateString){ } | -- |
import React, { useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Input } from 'antd';
import DatePickerCustom from '../index';
const Demo = (props) => {
const [startTime, setStartTime] = useState('');
const [endTime, setEndTime] = useState('');
const onChange = (date, dateString) => {
console.log(date);
setStartTime(date.startTime);
setEndTime(date.endTime);
};
return (
<>
<DatePickerCustom onChange={onChange} picker="day" style={{ marginRight: '10px' }} />
<DatePickerCustom onChange={onChange} picker="week" style={{ marginRight: '10px' }} />
<DatePickerCustom onChange={onChange} picker="month" style={{ marginRight: '10px' }} />
<DatePickerCustom onChange={onChange} picker="year" style={{ marginRight: '10px' }} />
<div style={{ display: 'flex', marginTop: '10px' }}>
<Input
value={startTime}
placeholder="起始时间"
style={{ marginRight: '10px', width: '250px' }}
/>
<Input
value={endTime}
placeholder="结束时间"
style={{ marginRight: '10px', width: '250px' }}
/>
</div>
</>
);
};
export default Demo;
import React, { useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import moment from 'moment';
import { DatePicker } from 'antd';
const FORMATS = {
day: 'YYYY-MM-DD',
week: 'YYYY-wo',
month: 'YYYY-MM',
year: 'YYYY',
};
const STANTFORMAT = 'YYYY-MM-DD 00:00:00';
const ENDFORMAT = 'YYYY-MM-DD 23:59:59';
const DatePickerCustom = (props) => {
const modes = props.picker ? props.picker : 'day';
const selectedDate = props.value ? props.value : new Date();
const onChange = (date, dateString) => {
const dateTime = moment(date).format('YYYY-MM-DD');
let startTime = null;
let endTime = null;
switch (modes) {
case 'day':
startTime = moment(dateTime);
endTime = moment(dateTime);
break;
case 'week':
debugger;
startTime = moment(dateTime).startOf(modes);
endTime = moment(dateTime).endOf(modes);
break;
case 'month':
startTime = moment(dateTime).startOf(modes);
endTime = moment(dateTime).endOf(modes);
break;
case 'year':
startTime = moment(dateTime).startOf(modes);
endTime = moment(dateTime).endOf(modes);
break;
default:
startTime = moment(dateTime);
endTime = moment(dateTime);
break;
}
props.onChange(
{ startTime: startTime.format(STANTFORMAT), endTime: endTime.format(ENDFORMAT) },
dateString,
);
};
const customFormat = (value) => {
let name = null;
switch (modes) {
case 'day':
name = value.format(FORMATS[modes]);
if (name === getTime(0, 'days', FORMATS[modes])) {
name = '今天';
} else if (name === getTime(1, 'days', FORMATS[modes])) {
name = '昨天';
}
break;
case 'week':
name = getMonthWeek(value);
if (value.format('YYYY-wo') === getTime(0, 'week', FORMATS[modes])) {
name = '本周';
} else if (value.format('YYYY-wo') === getTime(1, 'week', FORMATS[modes])) {
name = '上周';
}
break;
case 'month':
name = value.format(FORMATS[modes]);
if (name === getTime(0, 'month', FORMATS[modes])) {
name = '本月';
} else if (name === getTime(1, 'month', FORMATS[modes])) {
name = '上月';
}
break;
case 'year':
name = value.format(FORMATS[modes]);
if (name === getTime(0, 'year', FORMATS[modes])) {
name = '今年';
} else if (name === getTime(1, 'year', FORMATS[modes])) {
name = '去年';
}
break;
default:
break;
}
return name;
};
const getTime = (num, type, format) => {
return moment(new Date()).subtract(num, type).format(format);
};
const getMonthWeek = (value) => {
const a = value.format('YYYY'),
b = value.format('MM'),
c = value.format('DD');
let date = new Date(a, parseInt(b) - 1, c),
w = date.getDay(),
d = date.getDate();
if (w == 0) {
w = 7;
}
let config = {
getMonth: moment(date).format('MM'),
getYear: date.getFullYear(),
getWeek: Math.ceil((d + 6 - w) / 7),
};
return '第' + config.getWeek + '周(' + config.getYear + '/' + config.getMonth + ')';
};
return (
<DatePicker
{...props}
defaultValue={selectedDate ? moment(selectedDate) : ''}
format={customFormat}
onChange={onChange}
/>
);
};
export default DatePickerCustom;
......@@ -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.
## [1.4.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.4.0...@wisdom-components/devicetree@1.4.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/devicetree
# [1.4.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.14...@wisdom-components/devicetree@1.4.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.3.14](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/devicetree@1.3.8...@wisdom-components/devicetree@1.3.14) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/devicetree",
"version": "1.3.14",
"version": "1.4.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -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.
## [1.4.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/empty@1.4.0...@wisdom-components/empty@1.4.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/empty
# [1.4.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/empty@1.3.12...@wisdom-components/empty@1.4.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.3.12](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/empty@1.3.9...@wisdom-components/empty@1.3.12) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/empty",
"version": "1.3.12",
"version": "1.4.1",
"description": "@wisdom-components/empty",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -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.
## [1.1.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/exportexcel@1.1.0...@wisdom-components/exportexcel@1.1.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/exportexcel
# [1.1.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/exportexcel@1.0.10...@wisdom-components/exportexcel@1.1.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.0.10](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/exportexcel@1.0.7...@wisdom-components/exportexcel@1.0.10) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/exportexcel",
"version": "1.0.10",
"version": "1.1.1",
"description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>",
"homepage": "",
......
......@@ -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.
## [1.5.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.5.0...@wisdom-components/historyinfo@1.5.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/historyinfo
# [1.5.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.4.13...@wisdom-components/historyinfo@1.5.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.4.13](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/historyinfo@1.4.8...@wisdom-components/historyinfo@1.4.13) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/historyinfo",
"version": "1.4.13",
"version": "1.5.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -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.
## [1.4.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/imageselect@1.4.0...@wisdom-components/imageselect@1.4.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/imageselect
# [1.4.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/imageselect@1.3.12...@wisdom-components/imageselect@1.4.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.3.12](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/imageselect@1.3.8...@wisdom-components/imageselect@1.3.12) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/imageselect",
"version": "1.3.12",
"version": "1.4.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -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.
## [1.3.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/mqttview@1.3.0...@wisdom-components/mqttview@1.3.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/mqttview
# [1.3.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/mqttview@1.2.10...@wisdom-components/mqttview@1.3.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.2.10](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/mqttview@1.2.9...@wisdom-components/mqttview@1.2.10) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/mqttview",
"version": "1.2.10",
"version": "1.3.1",
"description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>",
"homepage": "",
......
......@@ -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.
## [1.3.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/parseform@1.3.0...parseform@1.3.1) (2021-05-12)
**Note:** Version bump only for package parseform
# [1.3.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/parseform@1.2.7...parseform@1.3.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.2.7](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/parseform@1.2.5...parseform@1.2.7) (2021-04-20)
### Bug Fixes
......
{
"name": "parseform",
"version": "1.2.7",
"version": "1.3.1",
"description": "> TODO: description",
"author": "lijiwen <961370825@qq.com>",
"homepage": "",
......
......@@ -2,6 +2,17 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.8.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.8.0...@wisdom-components/quotaselect@1.8.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/quotaselect
# [1.8.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.7.8...@wisdom-components/quotaselect@1.8.0) (2021-05-10)
### Features
- add ec-quotaselect ([306f380](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/306f38034761eba6a8d964bc2a063ab3a35b56fe))
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.7.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/quotaselect@1.7.2...@wisdom-components/quotaselect@1.7.8) (2021-04-26)
### Bug Fixes
......
{
"name": "@wisdom-components/quotaselect",
"version": "1.7.8",
"version": "1.8.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -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.
## [1.3.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/realtimeinfo@1.3.0...@wisdom-components/realtimeinfo@1.3.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/realtimeinfo
# [1.3.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/realtimeinfo@1.2.8...@wisdom-components/realtimeinfo@1.3.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.2.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/realtimeinfo@1.2.5...@wisdom-components/realtimeinfo@1.2.8) (2021-04-20)
### Bug Fixes
......
{
"name": "@wisdom-components/realtimeinfo",
"version": "1.2.8",
"version": "1.3.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -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.
## [1.4.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/timerangepicker@1.4.0...@wisdom-components/timerangepicker@1.4.1) (2021-05-12)
**Note:** Version bump only for package @wisdom-components/timerangepicker
# [1.4.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/timerangepicker@1.3.8...@wisdom-components/timerangepicker@1.4.0) (2021-05-10)
### Features
- custom package foler and perf leran config ([62194a9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/62194a919e4db41f2ebfa02326f41f622dfd3f4c))
## [1.3.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/timerangepicker@1.3.5...@wisdom-components/timerangepicker@1.3.8) (2021-04-20)
### Bug Fixes
......
{
"name": "@wisdom-components/timerangepicker",
"version": "1.3.8",
"version": "1.4.1",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
# Change Log
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.11](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.7...@wisdom-components/ec_devicetree@1.0.11) (2021-05-12)
### Bug Fixes
- bug ([90aecfc](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/90aecfc837b11b1eefe0efef9b6298dd9455954d))
- bug ([d02b3bf](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/d02b3bf0bdd2a709891c86199e5649e2471c577b))
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.0.10](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.7...@wisdom-components/ec_devicetree@1.0.10) (2021-05-11)
### Bug Fixes
- bug ([90aecfc](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/90aecfc837b11b1eefe0efef9b6298dd9455954d))
- bug ([d02b3bf](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/d02b3bf0bdd2a709891c86199e5649e2471c577b))
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.0.9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.7...@wisdom-components/ec_devicetree@1.0.9) (2021-05-11)
### Bug Fixes
- bug ([d02b3bf](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/d02b3bf0bdd2a709891c86199e5649e2471c577b))
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.0.8](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.7...@wisdom-components/ec_devicetree@1.0.8) (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## [1.0.7](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.6...@wisdom-components/ec_devicetree@1.0.7) (2021-05-10)
### Bug Fixes
- 修改业务组件树 ([6d0c2dc](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/6d0c2dc63b8a08b25b4a01dcd7ce4a152e3a2ea7))
- release publish bug ([c541abb](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/c541abbfc6a094bfeaa7dde04cc12ae4a6ce2650))
## [1.0.6](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.5...@wisdom-components/ec_devicetree@1.0.6) (2021-05-10)
### Bug Fixes
- test release ([c9e02b1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/c9e02b1daacd0d8972ae5d8a456cf807206b9e67))
## [1.0.5](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.4...@wisdom-components/ec_devicetree@1.0.5) (2021-05-10)
### Bug Fixes
- test release ([52efcec](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/52efcec9088b52d0200c80c87838327d20554a4d))
## [1.0.4](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.3...@wisdom-components/ec_devicetree@1.0.4) (2021-05-10)
### Bug Fixes
- test release ([a35f677](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a35f67719754116dc78f4883c2fe8aac46b87a0f))
- test release ([1e812dc](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/1e812dc9e62cd5f19df5da787165aab55ae28a92))
## [1.0.3](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.2...@wisdom-components/ec_devicetree@1.0.3) (2021-05-10)
### Bug Fixes
- bug ([30c6d06](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/30c6d06386640ca7749022b2c35858a320c7368f))
## [1.0.2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_devicetree@1.0.1...@wisdom-components/ec_devicetree@1.0.2) (2021-05-10)
### Bug Fixes
- 修改 mqtt 连接配置 ([d42cbc9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/d42cbc9edcab56ed29ca1399f8f0ea714601964a))
## 1.0.1 (2021-05-10)
### Bug Fixes
- bug ([1fcf652](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/1fcf652088fa0f885d289c42fa4f4699f1e16143))
# `@wisdom-components/ec-devicetree`
# `@wisdom-components/ec_devicetree`
> TODO: description
## Usage
```
const ECDeviceTree = require('@wisdom-components/ec-devicetree');
const ECDeviceTree = require('@wisdom-components/ec_devicetree');
// TODO: DEMONSTRATE API
```
{
"name": "@wisdom-components/ec-devicetree",
"version": "1.0.0",
"name": "@wisdom-components/ec_devicetree",
"version": "1.0.11",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
---
title: EC-DeviceTree - 设备树
title: EC_DeviceTree - 设备树
nav:
title: 业务组件
path: /extend-components
......
......@@ -8,6 +8,8 @@ const REQUEST_METHOD_POST = 'post';
const GET_DEVICE_LIST =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/DeviceTree'; //获取设备树列表
// const GET_DEVICE_LIST = '/api/Publish/GCK/Device/DeviceTree'; //获取设备树列表
const deviceTreeService = {
getDeviceList: {
url: GET_DEVICE_LIST,
......@@ -35,7 +37,7 @@ const Demo = () => {
checkable
onTreeCheck={onTreeCheck}
onTreeSelect={onTreeSelect}
deviceTreeService={getDeviceList}
deviceTreeService={dtService.getDeviceList}
serviceParams={
{
// pageIndex: 1,
......
......@@ -28,7 +28,7 @@ const DeviceTree = (props) => {
pageSize: serviceParams.pageSize || 500,
deviceTypes: serviceParams.deviceTypes || '二供泵房,二供机组',
getChild: serviceParams.getChild || true,
userID: serviceParams.userID || 1,
userID: serviceParams.userID || 0,
queryInfo: serviceParams.queryInfo || '',
sortFields: serviceParams.sortFields || '',
direction: serviceParams.direction || '',
......@@ -39,8 +39,8 @@ const DeviceTree = (props) => {
const handleData = (data) => {
data.forEach((item) => {
item.title = item.DeviceName;
item.key = item.StationID;
item.title = item.deviceName;
item.key = item.stationID;
item.children = handleData(item.children);
});
return data;
......@@ -51,7 +51,7 @@ const DeviceTree = (props) => {
if (response.code === 0) {
const data = response.data
? response.data.list && response.data.list.length > 0
? response.data.list[0].DeviceList
? response.data.list[0].deviceList
: []
: [];
setTreeData(handleData(data));
......@@ -122,7 +122,6 @@ DeviceTree.defaultProps = {
serviceParams: {},
onTreeCheck: () => {},
onTreeSelect: () => {},
deviceTreeService: () => {},
};
DeviceTree.propTypes = {
......@@ -131,7 +130,7 @@ DeviceTree.propTypes = {
serviceParams: PropTypes.object,
onTreeCheck: PropTypes.func,
onTreeSelect: PropTypes.func,
deviceTreeService: PropTypes.func,
deviceTreeService: PropTypes.any,
};
export default DeviceTree;
......@@ -20,6 +20,16 @@
white-space: nowrap;
}
.ant-tree-treenode {
width: 100%;
}
.ant-tree-node-content-wrapper {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
}
&-content {
flex: 1;
overflow-y: scroll;
......
# Change Log
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 1.0.4 (2021-05-12)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.3 (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.2 (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.1 (2021-05-11)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
# `@wisdom-components/EC-QuotaSelect`
# `@wisdom-components/ec_historyinfo`
> TODO: description
## Usage
```
const ecQuotaSelect = require('@wisdom-components/EC-QuotaSelect');
const ECHistoryInfo = require('@wisdom-components/ec_historyinfo');
// TODO: DEMONSTRATE API
```
{
"name": "@wisdom-components/ec-quotaselect",
"version": "1.0.0",
"name": "@wisdom-components/ec_historyinfo",
"version": "1.0.4",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
"license": "ISC",
"main": "lib/EC-QuotaSelect.js",
"main": "lib/index.js",
"directories": {
"lib": "lib",
"test": "__tests__"
......
---
title: EC-HistoryInfo - 历史数据查看
nav:
title: 基础组件
path: /extend-components
group:
path: /
---
# HistoryInfo 历史数据查看
基础业务组件
- 查看任意时间段的历史数据
- 允许同期对比任意历史数据
- 允许过滤异常值
- 允许指定时间间隔的数据抽稀
## 何时使用
- 以图表或表格形式,查看历史数据时。
## 代码演示
<code src="./demos/Basic.tsx">
## API
api 参考 Antd Table 组件 https://ant.design/components/table-cn/#API
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
| --- | --- | --- | --- | --- |
| title | 标题 | string | 指标曲线 | - |
| defaultChecked | 默认选中自定义时间 key | string | oneHour | oneHour/fourHour/twelveHours/roundClock/yesterday |
| tableProps | 表格其他 props | object | { } | - |
| historyInfoService | 历史曲线服务 | promise | - | - |
| historyInfoParams | 历史曲线服务参数 | object | { } | - |
import React from 'react';
import { service } from '@wisdom-utils/utils';
import HistoryInfo from '../index';
const REQUEST_HTTP = 'http';
const REQUEST_METHOD_POST = 'post';
const GET_HISTORY_INFO =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/SensorsDataForStation'; //获取历史信息
// const GET_HISTORY_INFO = '/api/Publish/GCK/Device/SensorsDataForStation'; //获取历史信息
const historyInfoService = {
getHistoryInfo: {
url: GET_HISTORY_INFO,
method: REQUEST_METHOD_POST,
type: REQUEST_HTTP,
},
};
const hsService = service(historyInfoService);
const getHistoryInfo = hsService.getHistoryInfo;
const Demo = () => {
return (
<div style={{ height: '800px' }}>
<HistoryInfo
title={'指标曲线'}
tableProps={{ bordered: true, pagination: { pageSize: 20 } }}
historyInfoService={getHistoryInfo}
historyInfoParams={initialParams}
/>
</div>
);
};
export default Demo;
const initialParams = {
stream: [
{
stationCode: 'EGBF00000006',
sensors: '出水瞬时流量,今日供水量,今日用电量',
pointVersions: '二供泵房',
dateFrom: '2021-05-09 15:01:21',
dateTo: '2021-05-09 16:01:21',
},
{
stationCode: 'EGJZ00007117',
sensors: '进水压力,出水压力,泵1状态',
pointVersions: '二供机组',
dateFrom: '2021-05-09 15:01:21',
dateTo: '2021-05-09 16:01:21',
},
],
ignoreOutliers: false, // 过滤异常值
isVertical: false, // 是否展示竖表
zoom: '', // 数据抽稀
unit: '', // 数据抽稀 min h
};
This diff is collapsed.
@import (reference) '../../../../node_modules/antd/es/style/themes/default';
@history-info-prefix-cls: ~'@{ant-prefix}-history-info';
.@{history-info-prefix-cls} {
height: 100%;
.ant-tabs,
.ant-tabs-content {
height: 100%;
}
&-content {
display: flex;
flex-direction: column;
height: 100%;
padding: 10px 0 0 0;
}
&-wrap {
flex: 1;
overflow: hidden;
}
&-main {
width: 100%;
max-width: 100%;
height: 100%;
max-height: 100%;
}
&-chart {
width: 100%;
height: 100%;
}
&-time {
display: flex;
align-items: center;
margin-bottom: 20px;
white-space: nowrap;
.@{history-info-prefix-cls}-label {
letter-spacing: 27px;
}
.@{history-info-prefix-cls}-label:after {
right: -20px;
}
.ant-radio-group,
.ant-select {
margin-right: 16px;
}
.anticon-plus-circle {
margin-left: 10px;
color: @primary-color;
font-size: 16px;
cursor: pointer;
}
}
&-cover {
display: flex;
align-items: center;
margin-bottom: 20px;
white-space: nowrap;
}
&-label {
position: relative;
width: 80px;
}
&-label:after {
position: absolute;
top: 0;
right: 7px;
content: ':';
}
&-contrast-list {
display: flex;
align-items: center;
}
&-connect {
margin: 0 10px;
}
&-date-wrap {
position: relative;
cursor: pointer;
}
&-date-delete {
position: absolute;
top: -12px;
right: -8px;
.anticon.anticon-close-circle {
color: #d9d9d9;
background: white;
}
&:hover {
.anticon.anticon-close-circle {
color: rgba(0, 0, 0, 0.45);
background: white;
}
}
}
}
# Change Log
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.5](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_quotaselect@1.0.1...@wisdom-components/ec_quotaselect@1.0.5) (2021-05-12)
### Bug Fixes
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.4 (2021-05-11)
### Bug Fixes
- bug ([1fcf652](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/1fcf652088fa0f885d289c42fa4f4699f1e16143))
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.3 (2021-05-11)
### Bug Fixes
- bug ([1fcf652](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/1fcf652088fa0f885d289c42fa4f4699f1e16143))
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.2 (2021-05-11)
### Bug Fixes
- bug ([1fcf652](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/1fcf652088fa0f885d289c42fa4f4699f1e16143))
- conflict ([a210fa2](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a210fa2f050d8b9c7f3a4a1b6884fd39b22914b0))
## 1.0.1 (2021-05-10)
### Bug Fixes
- bug ([1fcf652](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/1fcf652088fa0f885d289c42fa4f4699f1e16143))
# `@wisdom-components/ec_quotaselect`
> TODO: description
## Usage
```
const ECQuotaSelect = require('@wisdom-components/ec_quotaselect');
// TODO: DEMONSTRATE API
```
{
"name": "@wisdom-components/ec_quotaselect",
"version": "1.0.5",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
"license": "ISC",
"main": "lib/index.js",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"publishConfig": {
"registry": "https://g.civnet.cn:4873/"
},
"repository": {
"type": "git",
"url": "https://g.civnet.cn:8443/ReactWeb5/wisdom-components.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1"
}
}
......@@ -11,12 +11,15 @@ const REQUEST_METHOD_POST = 'post';
const GET_QUOTA_LIST =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/GetQuotaList'; //获取指标列表
// '/api/Publish/GCK/Device/GetQuotaList'; //获取指标列表
const GET_DEVICE_CONF =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/GetDeviceConf'; //获取设备配置
// '/api/Publish/GCK/Device/GetDeviceConf'; //获取设备配置
const UPDATE_DEVICE_CONF =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/SaveDeviceConf'; //更新设备配置
// '/api/Publish/GCK/Device/SaveDeviceConf'; //更新设备配置
const quotaSelectService = {
getQuotaList: {
......@@ -101,12 +104,7 @@ const Demo = () => {
<>
<h3>无 user, 无“保存修改”按钮</h3>
<PandaQuotaSelect
buttonProps={
{
// icon: <UnorderedListOutlined />,
// children: `指标选择(${selectData.length})`,
}
}
buttonProps={{}}
deviceList={deviceList}
quotaListService={getQuotaList}
pointType={pointType}
......@@ -119,12 +117,7 @@ const Demo = () => {
<br />
<h3>带 user, 有“保存修改”按钮</h3>
<PandaQuotaSelect
buttonProps={
{
// icon: <UnorderedListOutlined />,
// children: `指标选择(${selectData.length})`,
}
}
buttonProps={{}}
deviceList={deviceList}
quotaListService={getQuotaList}
updateDeviceConfService={updateDeviceConfService}
......
......@@ -59,7 +59,7 @@ const QuotaSelect = ({
const fetchData = (item = {}) => {
// 请求指标列表
quotaListService({
acountName: item.deviceType,
accountName: item.deviceType,
addrSchemeID: item.pointAddressID,
}).then((res) => {
if (res.code === 0) {
......@@ -125,7 +125,7 @@ const QuotaSelect = ({
// 过滤重点指标
const filterEmphasisQuota = () => {
let newQuotaList = [...allQuotaList];
newQuotaList = newQuotaList.filter((item) => item.isShow === '1');
newQuotaList = newQuotaList.filter((item) => item.isShow === 1);
setQuotaList(newQuotaList);
};
......
const { utils } = require('umi');
const { join } = require('path');
const { join, relative, resolve, sep } = require('path');
const exec = require('./utils/exec');
const getPackages = require('./utils/getPackages');
const isNextVersion = require('./utils/isNextVersion');
......@@ -24,6 +24,14 @@ function packageExists({ name, version }) {
}
async function release() {
let pkgList = execa.sync(lernaCli, ['list', '--json']).stdout;
pkgList = JSON.parse(pkgList);
const locMap = {};
pkgList.forEach((item) => {
const location = item.location.split(sep);
const componentName = item.name.split('/')[1];
locMap[componentName] = `${location[location.length - 2]}/${location[location.length - 1]}`;
});
// Check git status
if (!args.skipGitStatusCheck) {
const gitStatus = execa.sync('git', ['status', '--porcelain']).stdout;
......@@ -56,6 +64,7 @@ async function release() {
// Get updated packages
logStep('check updated packages');
const updatedStdout = execa.sync(lernaCli, ['changed']).stdout;
console.log('updatedStdout', updatedStdout);
updated = updatedStdout
.split('\n')
.map((pkg) => {
......@@ -120,7 +129,8 @@ async function release() {
// eslint-disable-next-line consistent-return
pkgs.forEach((pkg, index) => {
const [shortName, p] = pkg.split('!');
const pkgMap = locMap[pkg];
const [p, shortName] = pkgMap.split('/');
const pkgPath = join(cwd, 'packages', p, shortName.replace('pro-', ''));
// eslint-disable-next-line global-require,import/no-dynamic-require
const { name, version } = require(join(pkgPath, 'package.json'));
......
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