Commit dc5baaf5 authored by xinglei's avatar xinglei

格式化代码

parent 3a321c1a
......@@ -5,7 +5,7 @@
/* eslint-disable react/sort-comp */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Store,utils } from 'amos-tool';
import { Store, utils } from 'amos-tool';
import { Connect as UIConnect, Toast } from 'amos-framework';
import A3DDesigner, { Connect } from 'amos-3d/lib/designer';
import WorkerObjContent from 'amos-3d/lib/worker/WorkerObjContent';
......@@ -22,7 +22,7 @@ import LoadingComs from './LoadingComs';
import PointsPool from './PointsPool';
import PointsAlarm from './PointsAlarm';
import CoordinatePickup from './CoordinatePickup';
import { eventTopics, isPointEvent ,isControllerEvent, isManualOperate } from './consts';
import { eventTopics, isPointEvent, isControllerEvent, isManualOperate } from './consts';
import { executeView3dCMD, parseManual } from './dataProcessor';
//import { xianCode, xianyangCode } from '../../../_mock/code';
......@@ -42,7 +42,7 @@ const FLOOR = {
FLOOR_3: 'floor_3',
XY_FLOOR_3: 'xy_floor_3',
FLOOR_6: 'floor_6',
FLOOR_XY:'floor_xy'
FLOOR_XY: 'floor_xy'
};
......@@ -60,7 +60,8 @@ const createPanel = (text) => {
};
const moniData = [
{ authOrg: null,
{
authOrg: null,
code: "1*13",
content: "-11.45.0.18-423-通讯状态",
id: 176,
......@@ -69,7 +70,8 @@ const moniData = [
pointName: "",
pointType: "1",
sourceId: null,
updateDate: "2020-06-09 09:48:15"},
updateDate: "2020-06-09 09:48:15"
},
{
authOrg: null,
code: "1*13",
......@@ -248,7 +250,7 @@ class View3D extends Component {
return;
}
if (evt.object && evt.object.type === 'Mesh'){
if (evt.object && evt.object.type === 'Mesh') {
const parentObj = evt.object.parent;
const userData = parentObj.userData;
if (userData && this.lensLevel !== LENS_LEVEL.ROOT && userData.type === 'cabinet') {
......@@ -315,7 +317,7 @@ class View3D extends Component {
// 清除选中
// _this.outlineFactory.toggleOutline([]);
// info信息框不显示
if (_this.lensLevel !== LENS_LEVEL.SUN){
if (_this.lensLevel !== LENS_LEVEL.SUN) {
_this.infoHelper.toggleVisible(false);
}
}
......@@ -350,7 +352,7 @@ class View3D extends Component {
console.log('消息类型--->' + topic);
console.log('data==' + JSON.stringify(data));
//this.riskAlarmDataTwinkle(data);
switch (topic){
switch (topic) {
case 'base3d.fromws.riskSituation_flicker':
console.log('风险触发风险点闪烁~~~~~~~~~~~~~~~~~~~~');
this.flickerTroubleMarkers(this, data);//风险触发风险点闪烁
......@@ -360,7 +362,7 @@ class View3D extends Component {
this.flickerTroubleMarkers(this, data);//风险触发风险点闪烁
break;
default:
console.log(topic,':类型不支持');
console.log(topic, ':类型不支持');
}
});
};
......@@ -459,7 +461,7 @@ class View3D extends Component {
*/
onComplete = obj => {
const _this = this;
if (!obj.isForceParent ) {
if (!obj.isForceParent) {
obj.on('click', evt => {
// console.log('obj click', evt);
......@@ -494,26 +496,26 @@ class View3D extends Component {
// 加载告警数据
this.timer = setTimeout(() => {
this.transferAlarmData();
let flag= this.props.flag;
if(flag&&flag===1){
let pointName= this.props.pointName;
let pointAttrs= this.props.pointAttrs;
let pid= this.props.pid;
let flag = this.props.flag;
if (flag && flag === 1) {
let pointName = this.props.pointName;
let pointAttrs = this.props.pointAttrs;
let pid = this.props.pid;
//楼层
let floor= this.props.floor;
let pointtype= this.props.pointtype;
let floor = this.props.floor;
let pointtype = this.props.pointtype;
if(this.props.city==='xian'){
this.onAlarmClick1(pointtype,'floor_'+floor,{
if (this.props.city === 'xian') {
this.onAlarmClick1(pointtype, 'floor_' + floor, {
'authOrg': null,
'code': "",
'content': "",
'id': 0,
'isAlarm': 0,
'pointAttrs': `{"position":"`+pointAttrs+`","storey":"`+floor+`"}`,
'pointAttrs': `{"position":"` + pointAttrs + `","storey":"` + floor + `"}`,
'pointId': pid,
'pointName': pointName,
'pointType': "3",
......@@ -521,16 +523,16 @@ class View3D extends Component {
'updateDate': "",
});
}else{
} else {
this.onAlarmClick1(pointtype,'xy_floor_'+floor,{
this.onAlarmClick1(pointtype, 'xy_floor_' + floor, {
'authOrg': null,
'code': "",
'content': "",
'id': 0,
'isAlarm': 0,
'pointAttrs': `{"position":"`+pointAttrs+`","storey":"`+floor+`"}`,
'pointAttrs': `{"position":"` + pointAttrs + `","storey":"` + floor + `"}`,
'pointId': pid,
'pointName': pointName,
'pointType': "3",
......@@ -601,7 +603,7 @@ class View3D extends Component {
var percentComplete = (xhr.loaded / xhr.total) * 100;
const percent = Math.round(percentComplete, 2);
console.log(`model ${percent}% downloaded`);
if (percent === 100){
if (percent === 100) {
this.setState({ percent: 10 });
} else {
this.setState({ percent });
......@@ -727,7 +729,7 @@ class View3D extends Component {
*/
setToggleOutline = () => {
let _objs = [];
this.objs.map(_obj=>{
this.objs.map(_obj => {
const userData = _obj.userData;
if (userData && (userData.key === FLOOR.FLOOR_3 || userData.key === FLOOR.FLOOR_6 || userData.key === FLOOR.XY_FLOOR_3)) {
_objs.push(_obj);
......@@ -818,7 +820,7 @@ class View3D extends Component {
const { orgCode } = this.state;
this.clearMarkers();
//风险点访问风险模块
if (markerType === 'riskSource'){
if (markerType === 'riskSource') {
initView3DRiskFromBizAction(markerType, orgCode).then(data => {
this.initView3DData(markerType, data);
});
......@@ -834,12 +836,12 @@ class View3D extends Component {
*
* @memberof View3D
*/
initView3DData = (markerType, data) =>{
initView3DData = (markerType, data) => {
const { markers, floorType, alarmData } = this.state;
let markerData = [];
if (data) {// 点数据按楼层显示
if (LENS_LEVEL.SUB === this.lensLevel || LENS_LEVEL.SUN === this.lensLevel) {
data.forEach(item=> {
data.forEach(item => {
if (floorType === item.objKey) {
markerData.push(item);
}
......@@ -872,7 +874,7 @@ class View3D extends Component {
*
* @memberof View3D
*/
riskAlarmDataTwinkle = (alarmData) =>{
riskAlarmDataTwinkle = (alarmData) => {
const { markers, markerData, markerType } = this.state;
if (alarmData.bizobj) {
markerData.forEach(marker => {
......@@ -992,7 +994,7 @@ class View3D extends Component {
* @memberof View3D
*/
clearFloorViewEffect() {
this.objs.forEach(obj=>{
this.objs.forEach(obj => {
if (obj.userData.type === 'floor') {
obj.baseObjHelper.style.color = '';
}
......@@ -1049,7 +1051,7 @@ class View3D extends Component {
if (this.lensLevel === LENS_LEVEL.SUN) {
this.backSubView();
this.lensLevel = LENS_LEVEL.SUB;
if (this.state.floorType === FLOOR.FLOOR_0) {this.setState({ floorType: FLOOR.FLOOR_3 });}
if (this.state.floorType === FLOOR.FLOOR_0) { this.setState({ floorType: FLOOR.FLOOR_3 }); }
} else if (this.lensLevel === LENS_LEVEL.SUB && !this.city.isXidajie) {
this.backRootView();
this.lensLevel = LENS_LEVEL.ROOT;
......@@ -1207,7 +1209,7 @@ class View3D extends Component {
existData = (code, orgCode) => {
let xianshi = false;
if ( code ){
if (code) {
if (code.indexOf('#') !== -1) {
let split = code.split('#') || [];
split.map(item => {
......@@ -1218,8 +1220,8 @@ class View3D extends Component {
xianshi = true;
}
}else{
if ( item === orgCode){
} else {
if (item === orgCode) {
xianshi = true;
}
}
......@@ -1257,8 +1259,8 @@ class View3D extends Component {
this.clearMarkers();
this.clearAlarms();
if (!utils.isEmpty(alarmData) && utils.isArray(alarmData)){
alarmData = alarmData.filter(e=>{ //过滤通道信息
if (!utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
alarmData = alarmData.filter(e => { //过滤通道信息
return e.pointType !== '4';
});
}
......@@ -1271,7 +1273,7 @@ class View3D extends Component {
let dictionaryList = lsTool.read('dictionaryList');
let dicCodeList = JSON.parse(dictionaryList);
let city = this.getSelectCityByOrgCode(orgCode,dicCodeList);
let city = this.getSelectCityByOrgCode(orgCode, dicCodeList);
// if( city === '科技处' || city === '商业银行'){
// //暂时全部归属西安中心
......@@ -1289,27 +1291,27 @@ class View3D extends Component {
// }
// }
if(city === 'xian' || city === 'xianyang' || city === '科技处西安' || city === '科技处咸阳' ){
if (city === 'xian' || city === 'xianyang' || city === '科技处西安' || city === '科技处咸阳') {
if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
//过滤该公司没有权限的设备(有则跑马灯显示,否则不显示)
let newData = [];
alarmData.map(e => {
let xianshi = this.existData(e.code,userOrgCode);
let authOrgXianshi = this.existData(e.authOrg,userOrgCode);
let xianshi = this.existData(e.code, userOrgCode);
let authOrgXianshi = this.existData(e.authOrg, userOrgCode);
if (xianshi || authOrgXianshi) {
newData.push(e);
}
});
newData.forEach(item => {
const pointAttrs = JSON.parse(item.pointAttrs);
if ((city === 'xian' || city === '科技处西安') && (item.code.startsWith(orgCode) || item.authOrg && item.authOrg.indexOf(orgCode)!==-1) && pointAttrs && pointAttrs !== '' && pointAttrs !== undefined) {
if ((city === 'xian' || city === '科技处西安') && (item.code.startsWith(orgCode) || item.authOrg && item.authOrg.indexOf(orgCode) !== -1) && pointAttrs && pointAttrs !== '' && pointAttrs !== undefined) {
if (pointAttrs.storey === '3' || pointAttrs.storey === 'floor_3') {// 三楼数据
thirdFloorAlarmData.push(item);
} else if (pointAttrs.storey === '6' || pointAttrs.storey === 'floor_6') {// 六楼数据
sixthFloorAlarmData.push(item);
}
} else if ((city === 'xianyang' || city === '科技处咸阳') && (item.code.startsWith(orgCode)|| item.authOrg &&item.authOrg.indexOf(orgCode)!==-1)) {// 咸阳数据
} else if ((city === 'xianyang' || city === '科技处咸阳') && (item.code.startsWith(orgCode) || item.authOrg && item.authOrg.indexOf(orgCode) !== -1)) {// 咸阳数据
xyFloorAlarmData.push(item);
}
});
......@@ -1400,11 +1402,11 @@ class View3D extends Component {
/**
* 根据城市的orgCode,返回城市名称
*/
getSelectCityByOrgCode = (orgCode,dictionaryList) => {
getSelectCityByOrgCode = (orgCode, dictionaryList) => {
let city = null;
dictionaryList.map(item =>{
if(item.dictDataValue === orgCode){
city=item.dictDataKey;
dictionaryList.map(item => {
if (item.dictDataValue === orgCode) {
city = item.dictDataKey;
}
})
return city;
......@@ -1436,9 +1438,9 @@ class View3D extends Component {
const _this = this;
const pointType = parseInt(item.pointType);
if (type === FLOOR.FLOOR_3 || type === FLOOR.FLOOR_6) {
_this.objs.forEach( obj => {
_this.objs.forEach(obj => {
if (obj.userData && obj.userData.key === type) {
if (!obj.isForceParent ) {
if (!obj.isForceParent) {
_this.outlineFactory.toggleOutline(obj);
// if (pointType === 1) {
// _this.focusObject(obj, true);
......@@ -1448,16 +1450,16 @@ class View3D extends Component {
// }
_this.focusObject(obj);
// 延迟显示告警点
setTimeout(() => {_this.renderAlarmMarker(type, item);}, 1100);
setTimeout(() => { _this.renderAlarmMarker(type, item); }, 1100);
}
}
});
}
if (type === FLOOR.FLOOR_XY) {
_this.objs.forEach( obj => {
_this.objs.forEach(obj => {
if (obj.userData && obj.userData.key === FLOOR.XY_FLOOR_3) {
if (!obj.isForceParent ) {
if (!obj.isForceParent) {
_this.outlineFactory.toggleOutline(obj);
// if (pointType === 1) {
// _this.focusObject(obj, true);
......@@ -1467,7 +1469,7 @@ class View3D extends Component {
// }
_this.focusObject(obj);
// 延迟显示告警点
setTimeout(() => {_this.renderAlarmMarker(type, item);}, 1100);
setTimeout(() => { _this.renderAlarmMarker(type, item); }, 1100);
}
}
});
......@@ -1475,22 +1477,22 @@ class View3D extends Component {
}
onAlarmClick1 = (pointtype,type, item) => {
onAlarmClick1 = (pointtype, type, item) => {
this.clearAlarms();
this.clearMarkers();
const _this = this;
const pointType = parseInt(item.pointType);
if (type === FLOOR.FLOOR_3) {
_this.objs.forEach( obj => {
_this.objs.forEach(obj => {
if (obj.userData && obj.userData.key === FLOOR.FLOOR_3) {
if (!obj.isForceParent ) {
if (!obj.isForceParent) {
_this.outlineFactory.toggleOutline(obj);
_this.focusObject(obj);
// 延迟显示告警点
setTimeout(() => {_this.renderAlarmMarker1(pointtype,type, item);}, 1100);
setTimeout(() => { _this.renderAlarmMarker1(pointtype, type, item); }, 1100);
}
}
});
......@@ -1498,16 +1500,16 @@ class View3D extends Component {
if (type === FLOOR.FLOOR_6) {
_this.objs.forEach( obj => {
_this.objs.forEach(obj => {
if (obj.userData && obj.userData.key === FLOOR.FLOOR_6) {
if (!obj.isForceParent ) {
if (!obj.isForceParent) {
_this.outlineFactory.toggleOutline(obj);
_this.focusObject(obj);
// 延迟显示告警点
setTimeout(() => {_this.renderAlarmMarker1(pointtype,type, item);}, 1100);
setTimeout(() => { _this.renderAlarmMarker1(pointtype, type, item); }, 1100);
}
}
});
......@@ -1518,15 +1520,15 @@ class View3D extends Component {
if (type === FLOOR.XY_FLOOR_3) {
_this.objs.forEach( obj => {
_this.objs.forEach(obj => {
if (obj.userData && obj.userData.key === FLOOR.XY_FLOOR_3) {
if (!obj.isForceParent ) {
if (!obj.isForceParent) {
_this.outlineFactory.toggleOutline(obj);
_this.focusObject(obj);
// 延迟显示告警点
setTimeout(() => {_this.renderAlarmMarker1(pointtype,type, item);}, 1100);
setTimeout(() => { _this.renderAlarmMarker1(pointtype, type, item); }, 1100);
}
}
});
......@@ -1545,7 +1547,7 @@ class View3D extends Component {
object.parent.children.forEach(childrenObj => {
if (childrenObj.primaryKey === object.foreignKey) {
childrenObj.children.forEach(obj => {
if (obj){
if (obj) {
const userData = obj.userData;
if (userData && userData.type === 'cabinet') {
_this.onCabinetClick(obj, userData);
......@@ -1559,7 +1561,7 @@ class View3D extends Component {
renderAlarmMarker1 = (pointtype,type, item) => {
renderAlarmMarker1 = (pointtype, type, item) => {
const { markers } = this.state;
const pointAttrs = JSON.parse(item.pointAttrs);
if (pointAttrs.position) {
......@@ -1574,15 +1576,15 @@ class View3D extends Component {
alarmPoint.id = item.pointId;
let levelType = '';
if (pointType === 3){//巡检
if (pointType === 3) {//巡检
levelType = '3';
} else if (pointType === 2){//动环
} else if (pointType === 2) {//动环
levelType = '01';
} else if (pointType === 6){ //火探
} else if (pointType === 6) { //火探
levelType = '02';
} else if (pointType === 1){//网络设备
} else if (pointType === 1) {//网络设备
levelType = '01';
} else if (pointType === 5){//虚拟设备(自动巡检设备)
} else if (pointType === 5) {//虚拟设备(自动巡检设备)
levelType = '03';
}
alarmPoint.level = levelType;
......@@ -1592,7 +1594,7 @@ class View3D extends Component {
alarmPoint.title = item.pointName;
alarmPoint.sourceId = item.sourceId;
alarmPoint.twinkle = pointtype;
alarmPoint.type = pointType === 3 ? 'patrol' : ((pointType === 2)||(pointType === 6)) ? 'dynamicRingData' : 'impEquipment';
alarmPoint.type = pointType === 3 ? 'patrol' : ((pointType === 2) || (pointType === 6)) ? 'dynamicRingData' : 'impEquipment';
let points = [];
points.push(alarmPoint);
markers[alarmPoint.type] = points;
......@@ -1627,16 +1629,16 @@ class View3D extends Component {
alarmPoint.id = item.pointId;
let levelType = '';
if (pointType === 3){//巡检
if (pointType === 3) {//巡检
levelType = '3';
} else if (pointType === 2){//动环
} else if (pointType === 2) {//动环
levelType = '01';
}else if(pointType === 6){ //火探
} else if (pointType === 6) { //火探
levelType = '02';
}
else if (pointType === 1){//网络设备
else if (pointType === 1) {//网络设备
levelType = '01';
} else if (pointType === 5){//虚拟设备(自动巡检设备)
} else if (pointType === 5) {//虚拟设备(自动巡检设备)
levelType = '03';
}
alarmPoint.level = levelType;
......@@ -1645,11 +1647,11 @@ class View3D extends Component {
alarmPoint.position = pointPosition;
alarmPoint.title = item.pointName;
alarmPoint.sourceId = item.sourceId;
if(pointAttrs.levelStr==='impEqu_04'){
alarmPoint.levelStr='impEqu_04';
if (pointAttrs.levelStr === 'impEqu_04') {
alarmPoint.levelStr = 'impEqu_04';
}
alarmPoint.twinkle = true;
alarmPoint.type = pointType === 3 ? 'patrol' : ((pointType === 2)||(pointType === 6)) ? 'dynamicRingData' : 'impEquipment';
alarmPoint.type = pointType === 3 ? 'patrol' : ((pointType === 2) || (pointType === 6)) ? 'dynamicRingData' : 'impEquipment';
let points = [];
points.push(alarmPoint);
......
......@@ -359,7 +359,7 @@ class IndexMap extends Component {
/**
* 圆
*/
circleEvents = { click: () => {} };
circleEvents = { click: () => { } };
/**
* 线
......@@ -821,7 +821,7 @@ class IndexMap extends Component {
existData = (code, orgCode) => {
let xianshi = false;
if ( code ){
if (code) {
if (code.indexOf('#') !== -1) {
let split = code.split('#') || [];
split.map(item => {
......@@ -832,8 +832,8 @@ class IndexMap extends Component {
xianshi = true;
}
}else{
if ( item === orgCode){
} else {
if (item === orgCode) {
xianshi = true;
}
}
......@@ -872,8 +872,8 @@ class IndexMap extends Component {
let newData = [];
data.map(e => {
let xianshi = this.existData(e.code,orgCode);
let authOrgXianshi = this.existData(e.authOrg,orgCode);
let xianshi = this.existData(e.code, orgCode);
let authOrgXianshi = this.existData(e.authOrg, orgCode);
if (xianshi || authOrgXianshi) {
newData.push(e);
}
......
......@@ -178,6 +178,7 @@ class Warnings extends Component {
* 搜索
*/
onIconClick = (e, value) => {
if (value === undefined){ value = ''; }
let { pageItem1 } = this.state;
pageItem1[0].value = value;
this.setState({
......
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