Commit 4a076d4a authored by xinglei's avatar xinglei

提交传入类型

parent f073bda6
...@@ -387,7 +387,9 @@ export const SpcSerUrl = { ...@@ -387,7 +387,9 @@ export const SpcSerUrl = {
getSelfTopoTreeUrl: completePrefix(baseURI, 'bank/topography/selftree'), //自建系统树 getSelfTopoTreeUrl: completePrefix(baseURI, 'bank/topography/selftree'), //自建系统树
getSelfTopographyUrl: completePrefix(baseURI, 'bank/topography/selfnodes'), //自建系统树节点 getSelfTopographyUrl: completePrefix(baseURI, 'bank/topography/selfnodes'), //自建系统树节点
updateSelfUrl: completePrefix(baseURI, 'bank/topography/selfnodes'), //更新自建系统节点 updateSelfUrl: completePrefix(baseURI, 'bank/topography/selfnodes'), //更新自建系统节点
listSelfDevice: completePrefix(baseURI, 'bank/equipment/selfDevice?fname={fname}&pageNumber={page}&pageSize={size}') listSelfDevice: completePrefix(baseURI, 'bank/equipment/selfDevice?fname={fname}&pageNumber={page}&pageSize={size}'),
getTopoTreeByTypeUrl: completePrefix(baseURI, 'bank/topography/treeByType/{type}') //监控系统树
}; };
export const patrolUrls = { export const patrolUrls = {
......
import { SpcSerUrl } from './../consts/urlConsts';
import { commonPost, commonGet, formatUrl } from './../utils/request';
// 监控系统树查询
export const getTopoTreeByTypeAction = (type) => {
return commonGet(formatUrl(SpcSerUrl.getTopoTreeByTypeUrl, { type }));
};
// 获取类型
export const getTypeBySystem = (name) => {
const typeParams = {
PAMS: 1,
SelfSupport: 5,
CityLan: 6,
CloudPlatform: 7
};
return typeParams[name];
};
...@@ -9,79 +9,12 @@ import TreeComponent from './TreeComponent'; ...@@ -9,79 +9,12 @@ import TreeComponent from './TreeComponent';
import mqtt from 'mqtt'; import mqtt from 'mqtt';
import * as endConf from 'amos-processor/lib/config/endconf'; import * as endConf from 'amos-processor/lib/config/endconf';
import { getSelfTopoTreeAction, getSelfTopographyAction, updateSelfTopographyAction, getTopographyEventsAction, getDeivceListAction } from './../../..//services/selfServices'; import { getSelfTopoTreeAction, getSelfTopographyAction, updateSelfTopographyAction, getTopographyEventsAction, getDeivceListAction } from './../../..//services/selfServices';
import { getTypeBySystem } from './conf';
// import AmosGridTable from './../../bizview/common/tableComponent/table/AmosGridTable'; import { getTopoTreeByTypeAction } from 'SERVICES/monitorService';
import AmosGridTable from './../../component/table/table/AmosGridTable';
import SysWsURL from './../../../consts/wsUrlConsts'; import SysWsURL from './../../../consts/wsUrlConsts';
const AmosConfig = endConf.AmosConfig;
const mqttURI = AmosConfig.wsURI.mqttURI;
const options = {
//默认 30 * 1000毫秒,收到 CONNACK 之前等待的时间,即连接超时时间。
connectTimeout: 40000,
// 客户端 ID,随机生成
clientId: 'bank_financialCityLan_mqtt' + Math.random().toString(16).substr(2, 8),
clean: true,
//默认 1000 毫秒,两次重新连接之间的间隔,客户端 ID 重复、认证失败等客户端会重新连接;
reconnectPeriod: 1000 * 50
}
let client = mqtt.connect(mqttURI, options)
const checkListColumns = (financialCityLan) => { const type = getTypeBySystem('SelfSupport');
return [
{
title: '时间',
dataIndex: 'updateDate',
key: 'updateDate',
width: '45%',
render: (text, record) => {
let font = document.createElement('font');
if (record.deviceStatus === 1) {
font.innerText = text;
font.style.color = 'red';
} else {
font.innerText = text;
}
return <div dangerouslySetInnerHTML={{ __html: font.outerHTML }} ></div>
}
}, {
title: '设备名称',
dataIndex: 'name',
key: 'name',
width: '30%',
render: (text, record) => {
let font = document.createElement('font');
if (record.deviceStatus === 1) {
font.innerText = text;
font.style.color = 'red';
} else {
font.innerText = text;
}
return <div dangerouslySetInnerHTML={{ __html: font.outerHTML }} ></div>
}
}, {
title: 'ping结果',
dataIndex: 'deviceStatus',
key: 'deviceStatus',
render: (text, record) => {
let p = document.createElement('span');
if (text === 0) {
let font = document.createElement('font');
font.innerText = '连接正常';
p.append(font);
}
if (text === 1) {
let font = document.createElement('font');
font.innerText = '连接异常';
font.style.color = 'red';
p.append(font);
}
return <div dangerouslySetInnerHTML={{ __html: p.outerHTML }} ></div>
}
}
];
};
//偏移 //偏移
...@@ -121,7 +54,7 @@ class FinancialCityLan extends Component { ...@@ -121,7 +54,7 @@ class FinancialCityLan extends Component {
selectedRows: [], selectedRows: [],
selectedRowKeys: [], selectedRowKeys: [],
pagination: true, pagination: true,
isChecked: false, isChecked: false
}; };
this.updateTopologyData = {}; this.updateTopologyData = {};
this.mapView = true; this.mapView = true;
...@@ -137,8 +70,6 @@ class FinancialCityLan extends Component { ...@@ -137,8 +70,6 @@ class FinancialCityLan extends Component {
this.viewlineItem(); this.viewlineItem();
} }
// this.receivcemqtt(); // this.receivcemqtt();
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
...@@ -220,7 +151,7 @@ class FinancialCityLan extends Component { ...@@ -220,7 +151,7 @@ class FinancialCityLan extends Component {
// 数据初始化 // 数据初始化
initData = () => { initData = () => {
let expandedKeysData = []; let expandedKeysData = [];
getSelfTopoTreeAction().then(data => { getTopoTreeByTypeAction(type).then(data => {
data.map(item => { data.map(item => {
expandedKeysData.push(item.id); expandedKeysData.push(item.id);
}); });
......
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