Commit de807846 authored by zhengjiangtao's avatar zhengjiangtao

Merge branch 'develop_20200601' of http://172.16.10.76/bank/AmosBankView into develop_20200601

parents d3b15d6e 2692de12
// export default function(data, delRequest){
// window.setLoading && window.setLoading(false);
// return new Promise((resolve, reject) => {
// if (data) {
// if (data.dataList || data.dataList === null){
// resolve(data.dataList);
// } else if (data.result || data.result === null){
// resolve(data.result);
// } else if (data === 'TypeError: Failed to fetch'){
// reject(data);
// } else {
// resolve(data);
// }
// } else {
// reject(data);
// }
// });
// }
export default function(data, delRequest){
window.setLoading && window.setLoading(false);
return new Promise((resolve, reject) => {
if (data) {
if (data.result === 'SUCCESS') {
if (data.dataList || data.dataList === null){
resolve(data.dataList);
} else if (data.result || data.result === null){
} else {
resolve(data);
}
} else if (data.status === 200){
if (data.result || data.result !== ''){
resolve(data.result);
}else if (data == 'TypeError: Failed to fetch'){
reject(data);
}else{
} else {
resolve(data);
}
} else {
resolve(data);
}
} else {
reject(data);
}
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Connect, Modal } from 'amos-framework';
import { Connect, Modal, AmosAlert } from 'amos-framework';
import AmosWebSocket from 'amos-websocket';
import * as endConf from 'amos-processor/lib/config/endconf';
import PilotController from 'amos-viz/lib/board/PilotController';
......@@ -180,7 +180,7 @@ class LeftCharts extends Component {
initData = () => {
getLeftMetricDataAction({ code: this.state.currentCode }).then(data => {
// console.log('hhhhh',data);
//console.log('hhhhh',data);
let dataList = data.data || [];
let num=0;
......@@ -193,6 +193,7 @@ class LeftCharts extends Component {
dangerNumData: data,
dangerAllNum: this.state.dangerAllNum
});
if (data.result === 'FAILURE') { AmosAlert.error('警告', data.message);}
});
let dates = {
......
......@@ -142,6 +142,7 @@ class IndexMap extends Component {
this.receivcemqtt();
}
//mqtt接收可删除
receivcemqtt = () => {
client.on('connect', (e) => {
console.log("连接成功!!!")
......@@ -159,7 +160,7 @@ class IndexMap extends Component {
// this.initBankInfoList(null, eqpId, status);
// });
} else {
console.log('订阅失败')
console.log('订阅失败');
}
});
......@@ -171,7 +172,7 @@ class IndexMap extends Component {
let metricJson = JSON.parse(data.metricDatas[0].metricJson);
let eqpId = data.metricDatas[0].eqpId;
let status = metricJson.communication === '正常' ? 0 : 1;
this.initBankInfoList(null, eqpId, status);
//this.initBankInfoList(null, eqpId, status);
});
// 断开发起重连
......@@ -751,7 +752,7 @@ class IndexMap extends Component {
initBankInfoList = (city, eqpId, status) => {
let { bankInfoList } = this.state;
bankInfoList.forEach(bankInfo => {
if (eqpId && bankInfo.sourceId === eqpId) {
if (eqpId && bankInfo.sourceIdStr && bankInfo.sourceIdStr.indexOf(eqpId) >= 0) {
bankInfo.status = status;
} else if (city && bankInfo.eName === city) {
status = status ? 1 : 0;
......@@ -806,6 +807,7 @@ class IndexMap extends Component {
//data = data.index;
console.log('aisleWS', data);
if (data) {
this.initBankInfoList(null, data.eqpId, data.status);
this.queryAisleList('西安');
this.queryAisleList('咸阳');
// const flag = data.some(e => {
......
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