Commit a210fa2f authored by 涂茜's avatar 涂茜

fix: conflict

parent 6c6274eb
Pipeline #27422 failed with stages
in 9 seconds
...@@ -102,8 +102,15 @@ export default { ...@@ -102,8 +102,15 @@ export default {
'/extend-components': [ '/extend-components': [
{ {
title: '数据展示', title: '数据展示',
children: ['EC_DeviceTree', 'EC_QuotaSelect'], children: ['EC_DeviceTree', 'EC_QuotaSelect', 'EC_HistoryInfo'],
}, },
], ],
}, },
proxy: {
'/api': {
target: 'http://127.0.0.1:8888/',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
}; };
...@@ -45,7 +45,7 @@ const Demo = () => { ...@@ -45,7 +45,7 @@ const Demo = () => {
// @ts-ignore // @ts-ignore
return ( return (
<div style={{ height: '400px' }}> <div style={{ height: '800px' }}>
{!!dataSource.length && <BasicTable dataSource={dataSource} columns={columns} bordered />} {!!dataSource.length && <BasicTable dataSource={dataSource} columns={columns} bordered />}
{!dataSource.length && <Empty description={'暂无数据'} />} {!dataSource.length && <Empty description={'暂无数据'} />}
</div> </div>
......
...@@ -118,9 +118,13 @@ ...@@ -118,9 +118,13 @@
} }
.ant-table.ant-table-bordered > .ant-table-container { .ant-table.ant-table-bordered > .ant-table-container {
border: 1px solid #dbe7fb; border-top: 1px solid #dbe7fb;
border-right: 0; border-left: 0;
border-bottom: 0; }
.ant-table-header,
.ant-table-body {
border-left: 1px solid #dbe7fb;
} }
.ant-table-summary { .ant-table-summary {
......
...@@ -8,6 +8,8 @@ const REQUEST_METHOD_POST = 'post'; ...@@ -8,6 +8,8 @@ const REQUEST_METHOD_POST = 'post';
const GET_DEVICE_LIST = const GET_DEVICE_LIST =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/DeviceTree'; //获取设备树列表 'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/DeviceTree'; //获取设备树列表
// const GET_DEVICE_LIST = '/api/Publish/GCK/Device/DeviceTree'; //获取设备树列表
const deviceTreeService = { const deviceTreeService = {
getDeviceList: { getDeviceList: {
url: GET_DEVICE_LIST, url: GET_DEVICE_LIST,
......
...@@ -28,7 +28,7 @@ const DeviceTree = (props) => { ...@@ -28,7 +28,7 @@ const DeviceTree = (props) => {
pageSize: serviceParams.pageSize || 500, pageSize: serviceParams.pageSize || 500,
deviceTypes: serviceParams.deviceTypes || '二供泵房,二供机组', deviceTypes: serviceParams.deviceTypes || '二供泵房,二供机组',
getChild: serviceParams.getChild || true, getChild: serviceParams.getChild || true,
userID: serviceParams.userID || 1, userID: serviceParams.userID || 0,
queryInfo: serviceParams.queryInfo || '', queryInfo: serviceParams.queryInfo || '',
sortFields: serviceParams.sortFields || '', sortFields: serviceParams.sortFields || '',
direction: serviceParams.direction || '', direction: serviceParams.direction || '',
...@@ -39,8 +39,8 @@ const DeviceTree = (props) => { ...@@ -39,8 +39,8 @@ const DeviceTree = (props) => {
const handleData = (data) => { const handleData = (data) => {
data.forEach((item) => { data.forEach((item) => {
item.title = item.DeviceName; item.title = item.deviceName;
item.key = item.StationID; item.key = item.stationID;
item.children = handleData(item.children); item.children = handleData(item.children);
}); });
return data; return data;
...@@ -51,7 +51,7 @@ const DeviceTree = (props) => { ...@@ -51,7 +51,7 @@ const DeviceTree = (props) => {
if (response.code === 0) { if (response.code === 0) {
const data = response.data const data = response.data
? response.data.list && response.data.list.length > 0 ? response.data.list && response.data.list.length > 0
? response.data.list[0].DeviceList ? response.data.list[0].deviceList
: [] : []
: []; : [];
setTreeData(handleData(data)); setTreeData(handleData(data));
......
...@@ -20,6 +20,16 @@ ...@@ -20,6 +20,16 @@
white-space: nowrap; white-space: nowrap;
} }
.ant-tree-treenode {
width: 100%;
}
.ant-tree-node-content-wrapper {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
}
&-content { &-content {
flex: 1; flex: 1;
overflow-y: scroll; overflow-y: scroll;
......
# `@wisdom-components/ec_historyinfo`
> TODO: description
## Usage
```
const ECHistoryInfo = require('@wisdom-components/ec_historyinfo');
// TODO: DEMONSTRATE API
```
{
"name": "@wisdom-components/ec_historyinfo",
"version": "1.0.0",
"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"
}
}
---
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;
}
}
}
}
...@@ -11,12 +11,15 @@ const REQUEST_METHOD_POST = 'post'; ...@@ -11,12 +11,15 @@ const REQUEST_METHOD_POST = 'post';
const GET_QUOTA_LIST = const GET_QUOTA_LIST =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/GetQuotaList'; //获取指标列表 'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/GetQuotaList'; //获取指标列表
// '/api/Publish/GCK/Device/GetQuotaList'; //获取指标列表
const GET_DEVICE_CONF = const GET_DEVICE_CONF =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/GetDeviceConf'; //获取设备配置 'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/GetDeviceConf'; //获取设备配置
// '/api/Publish/GCK/Device/GetDeviceConf'; //获取设备配置
const UPDATE_DEVICE_CONF = const UPDATE_DEVICE_CONF =
'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/SaveDeviceConf'; //更新设备配置 'https://www.fastmock.site/mock/162c15dca15c4dba9ba51e0a0b76929b/api/Publish/Monitor/Device/SaveDeviceConf'; //更新设备配置
// '/api/Publish/GCK/Device/SaveDeviceConf'; //更新设备配置
const quotaSelectService = { const quotaSelectService = {
getQuotaList: { getQuotaList: {
......
...@@ -59,7 +59,7 @@ const QuotaSelect = ({ ...@@ -59,7 +59,7 @@ const QuotaSelect = ({
const fetchData = (item = {}) => { const fetchData = (item = {}) => {
// 请求指标列表 // 请求指标列表
quotaListService({ quotaListService({
acountName: item.deviceType, accountName: item.deviceType,
addrSchemeID: item.pointAddressID, addrSchemeID: item.pointAddressID,
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
...@@ -125,7 +125,7 @@ const QuotaSelect = ({ ...@@ -125,7 +125,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);
}; };
......
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