Commit 06ee06ea authored by 陈龙's avatar 陈龙

feat: 提交历史曲线代码

parents bbccb3e8 2e1be4d4
......@@ -7,7 +7,7 @@
import { request } from '@wisdom-utils/utils';
import * as constants from '../constants';
const BASEURL = '/PandaAssets/CityWater/ReportManager';
const BASEURL = '/PandaAssets/Assets/ReportManager';
export const API = {
GET_REPORT_INFO: `${BASEURL}/GetReportInfo`, // 获取报表信息
GET_REPORT_FILTER_VALUE: `${BASEURL}/GetReportFilterValue`, // 获取过滤字段的值的枚举
......
......@@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.9](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/VmsVideo@1.1.8...@wisdom-components/VmsVideo@1.1.9) (2023-04-18)
**Note:** Version bump only for package @wisdom-components/VmsVideo
## 1.1.8 (2023-04-14)
......
{
"name": "@wisdom-components/VmsVideo",
"version": "1.1.8",
"version": "1.1.9",
"description": "> TODO: description",
"author": "yutian <249303761@qq.com>",
"homepage": "",
......
......@@ -22,7 +22,7 @@ class App extends React.Component {
if (VideoInfo.url) {
this.create(this.refs[`myVideo` + VideoInfo.id], `key`, JessibucaObj);
setTimeout(() => {
this.play(VideoInfo.url + `${VideoInfo.dataRate == 'Sub' ? 2 : 1}`, `key`);
this.play(VideoInfo.url + `/${VideoInfo.dataRate == 'Sub' ? 2 : 1}`, `key`);
}, 10);
}
}
......
......@@ -37,14 +37,14 @@ group:
| | record 是否显示录制按钮 | boolean | true |
| VideoParam 参数 | --- | --- | --- |
| fullUrl | 完整 url,接入 flv 或者三方的链接 | string | "" |
| pandavmsHost | pandavms 后端主机地址 eg | string | ws://172.16.19.19:8080/ |
| username | 萤石 EZOPEN 协议 账号 | string | "6c44c8e92d1c4d75a9818756025df550" |
| password | 萤石 EZOPEN 协议 密码 | string | "78b7dc88f9f4bf19c2b1aabfdd995244" |
| address | 萤石 EZOPEN 协议 地址 | string | "123638446" |
| username | 账号 | string | "6c44c8e92d1c4d75a9818756025df550" |
| password | 密码 | string | "78b7dc88f9f4bf19c2b1aabfdd995244" |
| address | 地址 | string | "123638446" |
| protocol | 协议类型 | string | "萤石 EZOPEN" |
| useFullUrl | 是否为完整 url,是,则取 fullUrl,否,则会用 id 和 pandavmsHost 去拼接 | boolean | false |
| pandavmsHost | pandavms后端主机地址 eg | string | ws://172.16.19.19:8080/ |
| useFullUrl | 是否为完整 url,是,则取 fullUrl,否,则会用 pandavmsHost和id 去拼接 | boolean | false |
| id | 摄像头唯一标识,一串 GUID | string | "" |
| cameraName | 摄像头名称 | string | "" |
| name | 摄像头名称 | string | "" |
| dataRate | 码率,Main 为主码流,Sub 为辅码流,与消耗网络有关,主码流消耗最高,**由于拼接方式不定,改为是字符串传入** | string | 'Sub' |
## 写在最后
......
......@@ -2,7 +2,7 @@
* @Author: 634665781 634665781@qq.com
* @Date: 2023-04-11 13:40:18
* @LastEditors: 634665781 634665781@qq.com
* @LastEditTime: 2023-04-13 11:05:03
* @LastEditTime: 2023-04-17 11:05:27
* @FilePath: \wisdom-components\packages\base-components\TestVideo\src\demos\dmeo1.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -37,7 +37,18 @@ const Demo1 = (props) => {
// protocol: '萤石EZOPEN',
//};
let VideoParam = {
let VideoParam ={
id: "11F102BC-CE03-4E32-AE60-F297934DFE3F", // 398993BB-A795-4237-BE75-B6A7EC9D675
name: "琼海电信小区", // 设备名称
protocol: "萤石云HTTP-FLV", // 萤石EZOPE 萤石HTTP-FLV RTSP GB28181
username: "6c44c8e92d1c4d75a9818756025df550",
password: "78b7dc88f9f4bf19c2b1aabfdd995244",
dataRate: 'Sub', // Main 主码流 Sub 子码流
pandavmsHost: `ws://192.168.8.27:9876/`, // pandavms后端主机地址 eg: ws://172.16.19.19:8080/
address: "236644034",
}
/* {
id: '398993BB-A795-4237-BE75-B6A7EC9D675', // 398993BB-A795-4237-BE75-B6A7EC9D675
name: '设备1', // 设备名称
protocol: '萤石EZOPEN', // 萤石EZOPE 萤石HTTP-FLV RTSP GB28181
......@@ -46,7 +57,7 @@ const Demo1 = (props) => {
dataRate: 'Sub', // Main 主码流 Sub 子码流
pandavmsHost: 'ws://172.16.19.19:8080/', // pandavms后端主机地址 eg: ws://172.16.19.19:8080/
address: '123638446',
};
}; */
useEffect(() => {
// 事件 ,返回视频信息
......
# Change Log
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.40](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_configurationview@1.4.38...@wisdom-components/ec_configurationview@1.4.40) (2023-04-14)
## [1.4.41](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_configurationview@1.4.40...@wisdom-components/ec_configurationview@1.4.41) (2023-04-17)
### Bug Fixes
- 组态修改图片路径、增加交互脚本解析 ([0705864](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/0705864890ea108257fa355fdd7dd0da28a14668))
* 发布组态 ([a4ee491](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a4ee491d897180d9f73712a57f6ee2391e74087a))
## [1.4.40](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_configurationview@1.4.38...@wisdom-components/ec_configurationview@1.4.40) (2023-04-14)
### Bug Fixes
- 发布组态 ([a4ee491](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/a4ee491d897180d9f73712a57f6ee2391e74087a))
## [1.4.39](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_configurationview@1.4.38...@wisdom-components/ec_configurationview@1.4.39) (2023-04-14)
......
{
"name": "@wisdom-components/ec_configurationview",
"version": "1.4.41",
"version": "1.4.40",
"description": "> TODO: description",
"author": "tuqian <webtuqian@163.com>",
"homepage": "",
......
......@@ -55,10 +55,9 @@ const ConfigurationView = (props) => {
/** **********************************获取工艺图画板信息*********************** */
const getConfiguraList = async () => {
const url = globalConfig.mainserver ? globalConfig.mainserver : 'https://panda-water.cn/';
imgUrl = online
? `${url}PandaMonitor/Monitor/`
: `${globalConfig.baseURI}/PandaMonitor/Monitor/`;
? 'https://panda-water.cn/PandaConfiguration/Raw/'
: `${globalConfig.baseURI}/PandaConfiguration/Raw/`;
// 获取画板信息
const drawInfo = await getSketchPadList({
name: props.name,
......@@ -1032,7 +1031,7 @@ const ConfigurationView = (props) => {
go.Picture,
{ name: 'animateSvg', width: 56, height: 56, column: 0, scale: 1, source: '' },
new go.Binding('source', 'imgSrc', (v) => {
return `${imgUrl}Model/Preview/${encodeURIComponent(v)}`;
return `${imgUrl}File/ModelManage/ModelFilePreview/${encodeURIComponent(v)}`;
}),
new go.Binding('scale', 'scale').makeTwoWay(),
new go.Binding('width', 'width').makeTwoWay(),
......
......@@ -83,10 +83,9 @@ const ConfigurationView = (props) => {
/** **********************************获取工艺图画板信息*********************** */
const getConfiguraList = async () => {
const url = globalConfig.mainserver ? globalConfig.mainserver : 'https://panda-water.cn/';
imgUrl = online
? `${url}PandaMonitor/Monitor/`
: `${globalConfig.baseURI}/PandaMonitor/Monitor/`;
? 'https://panda-water.cn/PandaConfiguration/Raw/'
: `${globalConfig.baseURI}/PandaConfiguration/Raw/`;
// 获取画板信息
const drawInfo = await getSketchPadList({
name: props.name,
......@@ -1147,17 +1146,6 @@ const ConfigurationView = (props) => {
}
};
/** **************************************交互脚本****************************************** */
const interactiveScript = (data) => {
try {
const opRule = JSON.parse(data.opRule);
const script = opRule && opRule.script ? opRule.script : '';
new Function('diagram', 'list', 'props', script)(myDiagram, data, props);
} catch (e) {
// console.log(e)
}
};
/** **************************************跳转方法****************************************** */
const menuJumpMethod = (data) => {
const opRule = JSON.parse(data.opRule);
......@@ -1418,7 +1406,6 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......@@ -1452,7 +1439,7 @@ const ConfigurationView = (props) => {
go.Picture,
{ name: 'animateSvg', width: 56, height: 56, column: 0, scale: 1, source: '' },
new go.Binding('source', 'imgSrc', (v) => {
return `${imgUrl}Model/Preview/${encodeURIComponent(v)}`;
return `${imgUrl}File/ModelManage/ModelFilePreview/${encodeURIComponent(v)}`;
}),
new go.Binding('scale', 'scale').makeTwoWay(),
new go.Binding('width', 'width').makeTwoWay(),
......@@ -1482,7 +1469,6 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......@@ -1610,7 +1596,6 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......@@ -1684,7 +1669,6 @@ const ConfigurationView = (props) => {
break;
case '自定义交互': // 自定义交互
customBack(data);
interactiveScript(data);
break;
default:
break;
......
......@@ -2,12 +2,6 @@
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.6.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_historyview@1.5.1...@wisdom-components/ec_historyview@1.6.0) (2023-04-17)
### Features
- 新增箱线图、置信区间功能 ([d35c48a](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/commits/d35c48a5d7c6176b00b1a9179529a0621cbef805))
## [1.5.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/ec_historyview@1.5.0...@wisdom-components/ec_historyview@1.5.1) (2023-04-13)
**Note:** Version bump only for package @wisdom-components/ec_historyview
......
{
"name": "@wisdom-components/ec_historyview",
"version": "1.6.0",
"version": "1.5.1",
"description": "> TODO: description",
"author": "cuijiahao <15927252954@163.com>",
"homepage": "",
......
import React, {memo, useEffect, useMemo, useRef} from 'react';
import {BasicChart} from '@wisdom-components/basicchart';
import React, { memo, useEffect, useMemo, useRef } from 'react';
import { BasicChart } from '@wisdom-components/basicchart';
import PandaEmpty from '@wisdom-components/empty';
import optionGenerator, {alarmMarkLine, minMaxMarkPoint, offlineArea} from './utils';
import {isArray, cloneDeep} from 'lodash';
import optionGenerator, { alarmMarkLine, minMaxMarkPoint, offlineArea } from './utils';
import { isArray, cloneDeep } from 'lodash';
const SimgleChart = memo((props) => {
const {
dataSource,
contrast = false,
contrastOption = 'day',
smooth = true,
curveCenter,
showGridLine = false,
deviceAlarmSchemes,
chartType,
justLine
} = props;
const chartRef = useRef();
const {
dataSource,
contrast = false,
contrastOption = 'day',
smooth = true,
curveCenter,
showGridLine = false,
deviceAlarmSchemes,
} = props;
const chartRef = useRef();
const option = useMemo(() => {
const config = {
needUnit: true,
curveCenter,
showGridLine,
deviceAlarmSchemes,
showMarkLine: true,
showPoint: true,
chartType,
justLine
};
return optionGenerator(dataSource, null, contrast, contrastOption, smooth, config);
}, [dataSource, smooth, curveCenter]);
const option = useMemo(() => {
const config = {
needUnit: true,
curveCenter,
showGridLine,
deviceAlarmSchemes,
showMarkLine: true,
showPoint: true,
};
return optionGenerator(dataSource, null, contrast, contrastOption, smooth, config);
}, [dataSource, smooth, curveCenter]);
useEffect(() => {
chartRef.current?.resize?.();
const chart = chartRef.current?.getEchartsInstance?.();
useEffect(() => {
chartRef.current?.resize?.();
const chart = chartRef.current?.getEchartsInstance?.();
function hander(params) {
const {selected} = params;
const count = Object.values(selected || {}).filter((item) => item).length;
const option = cloneDeep(chart.getOption());
const needMarkLine = count === 1;
option.series.forEach((item, index) => {
let offlineAreas = offlineArea(dataSource[index]);
if (offlineAreas.data?.length) {
option.markArea = null;
item.markArea = offlineAreas;
}
if (needMarkLine && selected[item.name]) {
item.markLine = alarmMarkLine(
dataSource[index],
index,
[dataSource[index]],
deviceAlarmSchemes,
);
item.markPoint = minMaxMarkPoint(dataSource[index], index, [dataSource[index]]);
} else {
item.markLine = {};
item.markPoint = {};
}
});
chart.setOption(option, true);
function hander(params) {
const { selected } = params;
const count = Object.values(selected || {}).filter((item) => item).length;
const option = cloneDeep(chart.getOption());
const needMarkLine = count === 1;
option.series.forEach((item, index) => {
let offlineAreas = offlineArea(dataSource[index]);
if (offlineAreas.data?.length) {
option.markArea = null;
item.markArea = offlineAreas;
}
if (!chart) return;
chart.on('legendselectchanged', hander);
return () => {
chart.off('legendselectchanged', hander);
};
}, [dataSource, deviceAlarmSchemes]);
// 网格开关,不更新整个图表
useEffect(() => {
const chart = chartRef.current?.getEchartsInstance?.();
if (!chart) return;
const option = chart.getOption();
// 交互指针
const tooltip = {
trigger: 'axis',
axisPointer: {
type: showGridLine ? 'cross' : 'line',
},
};
// 网格线
const axisConfig = {
minorTick: {
show: showGridLine,
splitNumber: 2,
},
minorSplitLine: {
show: showGridLine,
lineStyle: {
type: 'dashed',
},
},
splitLine: {
show: showGridLine,
},
};
let yAxis = axisConfig;
if (isArray(option.yAxis)) {
yAxis = option.yAxis.map((item) => ({...axisConfig}));
if (needMarkLine && selected[item.name]) {
item.markLine = alarmMarkLine(
dataSource[index],
index,
[dataSource[index]],
deviceAlarmSchemes,
);
item.markPoint = minMaxMarkPoint(dataSource[index], index, [dataSource[index]]);
} else {
item.markLine = {};
item.markPoint = {};
}
let xAxis = axisConfig;
chart.setOption({
xAxis,
yAxis,
tooltip,
});
}, [showGridLine]);
});
chart.setOption(option, true);
}
if (!chart) return;
chart.on('legendselectchanged', hander);
return () => {
chart.off('legendselectchanged', hander);
};
}, [dataSource, deviceAlarmSchemes]);
// 网格开关,不更新整个图表
useEffect(() => {
const chart = chartRef.current?.getEchartsInstance?.();
if (!chart) return;
const option = chart.getOption();
// 交互指针
const tooltip = {
trigger: 'axis',
axisPointer: {
type: showGridLine ? 'cross' : 'line',
},
};
// 网格线
const axisConfig = {
minorTick: {
show: showGridLine,
splitNumber: 2,
},
minorSplitLine: {
show: showGridLine,
lineStyle: {
type: 'dashed',
},
},
splitLine: {
show: showGridLine,
},
};
let yAxis = axisConfig;
if (isArray(option.yAxis)) {
yAxis = option.yAxis.map((item) => ({ ...axisConfig }));
}
let xAxis = axisConfig;
chart.setOption({
xAxis,
yAxis,
tooltip,
});
}, [showGridLine]);
// 数据都为空显示缺省页
const isEmpty = useMemo(
() =>
!dataSource ||
!dataSource.length ||
!dataSource.find((e) => e.dataModel && e.dataModel.length > 0),
[dataSource],
);
// 数据都为空显示缺省页
const isEmpty = useMemo(
() =>
!dataSource ||
!dataSource.length ||
!dataSource.find((e) => e.dataModel && e.dataModel.length > 0),
[dataSource],
);
return isEmpty ? (
<PandaEmpty/>
) : (
<BasicChart ref={chartRef} option={option} notMerge style={{width: '100%', height: '100%'}}/>
);
return isEmpty ? (
<PandaEmpty />
) : (
<BasicChart ref={chartRef} option={option} notMerge style={{ width: '100%', height: '100%' }} />
);
});
export default SimgleChart;
......@@ -2,7 +2,7 @@ import React from 'react';
import HistoryView from '../index';
const deviceParams = [
/* {
{
deviceCode: 'EGBF00000146',
sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceType: '二供泵房',
......@@ -13,7 +13,7 @@ const deviceParams = [
sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceType: '二供泵房',
pointAddressID: 4,
},*/
},
{
// deviceCode: 'EGBF00000002',
deviceCode: 'EGBF00000082',
......
......@@ -3,20 +3,17 @@ import HistoryView from '../index';
const deviceParams = [
{
deviceCode: 'EGBF00000082',
sensors: '进水压力',
// sensors: '出水瞬时流量',
// sensors: '出水累计流量',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceCode: 'EGBF00000146',
sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceType: '二供泵房',
pointAddressID: 4,
},
/* {
deviceCode: 'EGBF00000083',
{
deviceCode: 'EGJZ00001113',
sensors: '出水瞬时流量,出水压力,泵1状态',
deviceType: '二供机组',
pointAddressID: 4,
},*/
},
// {
// deviceCode: 'EGJZ00001113',
// sensors: '出水压力',
......@@ -27,7 +24,7 @@ const deviceParams = [
const Demo = () => {
return (
<div style={{ height: 700 }}>
<HistoryView deviceParams={deviceParams} defaultModel="curve" />
<HistoryView deviceParams={deviceParams} defaultModel="table" />
</div>
);
};
......
......@@ -704,6 +704,7 @@ const HistoryView = (props) => {
results.forEach((res, index) => {
const {dateFrom, dateTo} = dateRange?.[index] ?? {};
if (res.code === 0 && res.data.length) {
debugger
res.data.forEach((d) => {
d.dateFrom = dateFrom;
d.dateTo = dateTo;
......
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