Commit 10b6e87d authored by 陈龙's avatar 陈龙

feat: 去除历史曲线loading

parent b31a4917
...@@ -190,23 +190,37 @@ import { MobileHistoryChart } from '../mobile'; ...@@ -190,23 +190,37 @@ import { MobileHistoryChart } from '../mobile';
"deviceType": "送水泵房" "deviceType": "送水泵房"
} }
];*/ ];*/
const deviceParams = [ /*const deviceParams = [
// 预测的 // 预测的
/* { /!* {
"deviceCode": "YLB00000041", "deviceCode": "YLB00000041",
"sensors": "进水压力", "sensors": "进水压力",
"deviceType": "压力表" "deviceType": "压力表"
},*/ },*!/
{ /!* {
"deviceCode": "SSBF00000001", "deviceCode": "SSBF00000001",
"sensors": "出水压力", "sensors": "出水压力",
"deviceType": "送水泵房" "deviceType": "送水泵房"
} }*!/
//预测结束 //预测结束
/* { /!* {
"deviceCode": "EGBF00000141", "deviceCode": "EGBF00000141",
"sensors": "进水压力,出水瞬时流量,今日用电量", "sensors": "进水压力,出水瞬时流量,今日用电量",
"deviceType": "二供泵房" "deviceType": "二供泵房"
}*!/
];*/
const deviceParams = [
// 新乐,水厂数据异常的问题
{
"deviceCode": "SC00000004",
"sensors": "进水瞬时流量,1#出水瞬时流量,2#出水瞬时流量",
"deviceType": "水厂"
}
// 182:8088 报警设备
/* {
"deviceCode": "XMYL00000043",
"sensors": "进水压力",
"deviceType": "熊猫压力表"
}*/ }*/
] ]
const Demo = () => { const Demo = () => {
......
...@@ -354,6 +354,8 @@ const HistoryView = (props) => { ...@@ -354,6 +354,8 @@ const HistoryView = (props) => {
const [predicateDevice, setPredicateDevice] = useState(null); const [predicateDevice, setPredicateDevice] = useState(null);
const [predicateData, setPredicateData] = useState([]); const [predicateData, setPredicateData] = useState([]);
const [predicateTime, setPredicateTime] = useState(null); const [predicateTime, setPredicateTime] = useState(null);
// 这部分功能有问题,等待解决后上线 2024年3月13日
// const [discreteDeviceType, setDiscreteDeviceType] = useState(['水厂'])
// 历史数据相关的特征描述 // 历史数据相关的特征描述
const deviceConfig = useRef({ const deviceConfig = useRef({
oneDevice: deviceParams.length === 1, //单设备 oneDevice: deviceParams.length === 1, //单设备
...@@ -1077,6 +1079,8 @@ const HistoryView = (props) => { ...@@ -1077,6 +1079,8 @@ const HistoryView = (props) => {
const requestArr = []; const requestArr = [];
const acrossTables = []; const acrossTables = [];
const zoomArray = []; const zoomArray = [];
// 这部分功能有问题,等待解决后上线 2024年3月13日
// let hasDiscreteDeviceType = false;
deviceParams deviceParams
.map((item) => { .map((item) => {
let _item = {...item}; let _item = {...item};
...@@ -1090,6 +1094,10 @@ const HistoryView = (props) => { ...@@ -1090,6 +1094,10 @@ const HistoryView = (props) => {
.forEach((i) => { .forEach((i) => {
if (i.sensors && i.deviceCode) if (i.sensors && i.deviceCode)
acrossTables.push(_.omit(i, ['pointAddressID'])); acrossTables.push(_.omit(i, ['pointAddressID']));
// 这部分功能有问题,等待解决后上线 2024年3月13日
/* if (discreteDeviceType.includes(i.deviceType)) {
hasDiscreteDeviceType = true;
}*/
}); });
if (!acrossTables?.length || !dateRange.length) { if (!acrossTables?.length || !dateRange.length) {
handleTableData([]); handleTableData([]);
...@@ -1128,6 +1136,11 @@ const HistoryView = (props) => { ...@@ -1128,6 +1136,11 @@ const HistoryView = (props) => {
if (dateRange.length === 1 && predicateDevice) { if (dateRange.length === 1 && predicateDevice) {
_finalParams.acrossTables.push(predicateDevice); _finalParams.acrossTables.push(predicateDevice);
} }
// 2024年3月11日 如果设备是某些特殊设备,则采用离散型算法
// 这部分功能有问题,等待解决后上线 2024年3月13日
/* if (hasDiscreteDeviceType) {
_finalParams.algorithmName = "outliers";
}*/
requestArr.push(getHistoryInfo(_finalParams)); requestArr.push(getHistoryInfo(_finalParams));
}); });
setLoading(true); setLoading(true);
...@@ -1363,6 +1376,16 @@ const HistoryView = (props) => { ...@@ -1363,6 +1376,16 @@ const HistoryView = (props) => {
}; };
// 获取字段配置 // 获取字段配置
const getDefaultOptions = async () => { const getDefaultOptions = async () => {
// 特定设备
// 这部分功能有问题,等待解决后上线 2024年3月13日
/* getDictionaryInfoAll({
level: '离散算法设备类型',
}).then(res => {
if (res.code === 0 && res.data.length) {
let deviceType = res.data.find(item => item.fieldName === '设备类型')?.fieldValue;
setDiscreteDeviceType(deviceType.split(',').filter(item => item))
}
})*/
// 非单曲线、单指标不执行 // 非单曲线、单指标不执行
if ( if (
deviceParams?.length !== 1 || deviceParams?.length !== 1 ||
...@@ -1397,13 +1420,13 @@ const HistoryView = (props) => { ...@@ -1397,13 +1420,13 @@ const HistoryView = (props) => {
if (_res3.code === 0 && _res3.data) { if (_res3.code === 0 && _res3.data) {
// 1. 如果是单曲线,并且配置了预测,那么默认开启预测; // 1. 如果是单曲线,并且配置了预测,那么默认开启预测;
// 2024年3月11日 物联预测功能支撑后,再开发这部分 // 2024年3月11日 物联预测功能支撑后,再开发这部分
/* _checkboxData.push({ /* _checkboxData.push({
key: 'predicate', key: 'predicate',
label: '数据预测', label: '数据预测',
checked: true, checked: true,
showInCurve: true, showInCurve: true,
showInTable: true, showInTable: true,
})*/ })*/
setPredicateDevice({..._res3.data, deviceType: '预测'}); setPredicateDevice({..._res3.data, deviceType: '预测'});
} else { } else {
setPredicateDevice(null); setPredicateDevice(null);
...@@ -1485,24 +1508,22 @@ const HistoryView = (props) => { ...@@ -1485,24 +1508,22 @@ const HistoryView = (props) => {
<div className={classNames(`${prefixCls}-spin`)} style={{position: 'relative'}}> <div className={classNames(`${prefixCls}-spin`)} style={{position: 'relative'}}>
{loading || percent !== 0 ? ( {loading || percent !== 0 ? (
<div className={classNames(`${prefixCls}-progressWrapper`)}> <div className={classNames(`${prefixCls}-progressWrapper`)}>
<div className={classNames(`${prefixCls}-contentWrapper`)}> {lineDataType === '原始曲线' ||
{lineDataType === '原始曲线' || (lineDataType === '特征曲线' &&
(lineDataType === '特征曲线' && moment(dateRange?.[0]?.dateTo).diff(moment(dateRange?.[0]?.dateFrom), 'days') >=
moment(dateRange?.[0]?.dateTo).diff(moment(dateRange?.[0]?.dateFrom), 'days') >= 30) ?
30) ? ( <div className={classNames(`${prefixCls}-contentWrapper`)}>
<> <Progress
<Progress percent={percent}
percent={percent} steps={20}
steps={20} className={classNames(`${prefixCls}-progress`, `${prefixCls}-blink-2`)}
className={classNames(`${prefixCls}-progress`, `${prefixCls}-blink-2`)} showInfo={false}
showInfo={false} />
/> <div className={classNames(`${prefixCls}-tip`)}>加载中...</div>
<div className={classNames(`${prefixCls}-tip`)}>加载中...</div> </div> :
</> <Spin spinning={loading || false} tip={'数据加载中...'} delay={1000}
) : ( style={{background: 'transparent'}}/>
<Spin spinning={loading || false}/> }
)}
</div>
</div> </div>
) : ( ) : (
'' ''
......
...@@ -1331,6 +1331,7 @@ const optionGenerator = ( ...@@ -1331,6 +1331,7 @@ const optionGenerator = (
visualMap, visualMap,
...restOption, ...restOption,
}; };
console.log('_option: ', _options);
return _options; return _options;
}; };
......
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