Commit cead3eea authored by zhengjiangtao's avatar zhengjiangtao

修改告警显示

parent 0e59e1ef
......@@ -1213,6 +1213,9 @@ class View3D extends Component {
transferAlarmData = () => {
let { alarmData, orgCode } = this.state;
//登录人的orgCode
let userOrgCode = lsTool.read('selectedCompanyOrg');
// alarmData = moniData;
const { isAllDone, alarms, markerType } = this.state;
if (!isAllDone || this.city.isXidajie) {
......@@ -1237,33 +1240,40 @@ class View3D extends Component {
let dicCodeList = JSON.parse(dictionaryList);
let city = this.getSelectCityByOrgCode(orgCode,dicCodeList);
if( city === '科技处' || city === '商业银行'){
//暂时全部归属西安中心
// if( city === '科技处' || city === '商业银行'){
// //暂时全部归属西安中心
// if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
// alarmData.forEach(item => {
// const pointAttrs = JSON.parse(item.pointAttrs);
// if ((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);
// }
// }
// });
// }
// }
if(city === 'xian' || city === 'xianyang' || city === '科技处西安' || city === '科技处咸阳' ){
if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
alarmData.forEach(item => {
const pointAttrs = JSON.parse(item.pointAttrs);
if ((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);
}
//过滤该公司没有权限的设备(有则跑马灯显示,否则不显示)
let newData = [];
alarmData.map(e =>{
if(( e.code.indexOf(userOrgCode) !==-1) || ( e.authOrg.indexOf(userOrgCode) !==-1 )){
newData.push(e);
}
});
}
}
if(city === 'xian' || city === 'xianyang' ){
if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
alarmData.forEach(item => {
newData.forEach(item => {
const pointAttrs = JSON.parse(item.pointAttrs);
if (city === 'xian' && (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' && (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);
}
});
......@@ -1271,6 +1281,24 @@ class View3D extends Component {
}
// if(city === '科技处西安' || city === '科技处咸阳' ){
// if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
// alarmData.forEach(item => {
// const pointAttrs = JSON.parse(item.pointAttrs);
// if ( && (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 === '科技处咸阳' && (item.authOrg && item.authOrg.indexOf(orgCode) !==-1)) {// 咸阳数据
// xyFloorAlarmData.push(item);
// }
// });
// }
// }
if (this.lensLevel === LENS_LEVEL.ROOT) {
......@@ -1588,7 +1616,7 @@ class View3D extends Component {
alarmPoint.type = pointType === 3 ? 'patrol' : ((pointType === 2)||(pointType === 6)) ? 'dynamicRingData' : 'impEquipment';
let points = [];
points.push(alarmPoint);
debugger
markers[alarmPoint.type] = points;
......
......@@ -676,8 +676,25 @@ class IndexMap extends Component {
}else{
map = { 'is3DPage': true, 'city': '', 'orgCode': '' };
}
} else {
map = { 'is3DPage': true, 'city': '', 'orgCode': selectedCompanyOrg };
} else if (companyName && companyName.indexOf("科技处") !== -1){
// map = { 'is3DPage': true, 'city': '', 'orgCode': selectedCompanyOrg };
let newOrgCode = null;
if(city === 'xian'){
newOrgCode = this.getSelectOrgCode('科技处西安', dicCodeList);
} ;
if(city === 'xianyang') {
newOrgCode = this.getSelectOrgCode('科技处咸阳', dicCodeList);
};
if (city === 'xian' || city === 'xianyang' || city === 'xidajie'){
map = { 'is3DPage': true, 'city': city, 'orgCode': newOrgCode };
}else{
map = { 'is3DPage': true, 'city': '', 'orgCode': '' };
}
}else {
map = { 'is3DPage': true, 'city': '', 'orgCode': '' };
}
this.props.indexViewChange(map);
......@@ -686,6 +703,7 @@ class IndexMap extends Component {
markerOnClick1 = (city,flag,id, pointName,pointAttrs,floor,pointtype) => {
this.state.isOnClickCity=true;
let selectedCompanyOrg = lsTool.read('selectedCompanyOrg');
let dictionaryList = lsTool.read('dictionaryList');
let dicCodeList = JSON.parse(dictionaryList);
......@@ -695,13 +713,29 @@ class IndexMap extends Component {
if(companyName && companyName.indexOf("清算中心") !== -1){
let orgCode = this.getSelectOrgCode(city, dicCodeList);
if (city === 'xian' || city === 'xianyang' || city === 'xidajie'){
//map = { 'is3DPage': true, 'city': city, 'orgCode': orgCode };
map = { 'is3DPage': true, 'city': city, 'orgCode': orgCode ,'flag':flag,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype};
}else{
map = { 'is3DPage': true, 'city': city, 'orgCode': '','flag':flag ,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype};
map = { 'is3DPage': true, 'city': '', 'orgCode': '','flag':flag,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype };
}
} else {
map = { 'is3DPage': true, 'city': city, 'orgCode': selectedCompanyOrg ,'flag':flag,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype};
} else if (companyName && companyName.indexOf("科技处") !== -1){
// map = { 'is3DPage': true, 'city': '', 'orgCode': selectedCompanyOrg };
let newOrgCode = null;
if(city === 'xian'){
newOrgCode = this.getSelectOrgCode('科技处西安', dicCodeList);
} ;
if(city === 'xianyang') {
newOrgCode = this.getSelectOrgCode('科技处咸阳', dicCodeList);
};
if (city === 'xian' || city === 'xianyang' || city === 'xidajie'){
map = { 'is3DPage': true, 'city': city, 'orgCode': newOrgCode ,'flag':flag,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype};
}else{
map = { 'is3DPage': true, 'city': '', 'orgCode': '','flag':flag,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype };
}
}else {
map = { 'is3DPage': true, 'city': '', 'orgCode': '','flag':flag,'pid':id,'pointName':pointName,'pointAttrs':pointAttrs,'floor':floor,'pointtype':pointtype };
}
this.props.indexViewChange(map);
......@@ -719,28 +753,44 @@ class IndexMap extends Component {
* 初始化告警数据
*/
queeryAlarms = () => {
let dictionaryList = lsTool.read('dictionaryList');
let dicCodeList = JSON.parse(dictionaryList);
let xianCode = this.getSelectOrgCode('xian', dicCodeList);
let xianyangCode = this.getSelectOrgCode('xianyang', dicCodeList);
let kejichuCode = this.getSelectOrgCode('科技处', dicCodeList);
//登录的orgCode
let { orgCode } = this.state;
// let kejichuCode = this.getSelectOrgCode('科技处', dicCodeList);
// let qingsuanzhongxin = this.getSelectOrgCode('清算中心', dicCodeList);
let kejichuxianCode = this.getSelectOrgCode('科技处西安', dicCodeList);
let kejichuxianyangCode = this.getSelectOrgCode('科技处咸阳', dicCodeList);
if ( orgCode !== '') {
getAlarms().then(data => {
if (!utils.isEmpty(data) && utils.isArray(data)) {
const xianFlag = data.some(e => {
//过滤该公司没有权限的设备(有则跑马灯显示,否则不显示)
let newData = [];
data.map(e =>{
if(( e.code.indexOf(orgCode) !==-1) || ( e.authOrg.indexOf(orgCode) !==-1)){
newData.push(e);
}
})
if (!utils.isEmpty(newData) && utils.isArray(newData)) {
const xianFlag = newData.some(e => {
// if (e.code === xianCode) {
if (e.code.startsWith(kejichuCode) || e.code.startsWith(xianCode) || e.authOrg && e.authOrg.indexOf(xianCode) !== -1) {
if ( e.code.startsWith(xianCode) || (e.authOrg && e.authOrg.indexOf(xianCode) !== -1 || (e.authOrg && e.authOrg.indexOf(kejichuxianCode) !== -1))) {
return true;
}
});
const xianyangFlag = data.some(e => {
if (e.code.startsWith(xianyangCode) || e.authOrg && e.authOrg.indexOf(xianyangCode) !== -1) {
const xianyangFlag = newData.some(e => {
if (e.code.startsWith(xianyangCode) || (e.authOrg && e.authOrg.indexOf(xianyangCode) !== -1 || ( e.authOrg && e.authOrg.indexOf(kejichuxianyangCode) !== -1) )) {
return true;
}
});
this.setState({
pmdList: data,
pmdList: newData,
xianVisible: xianFlag,
xianyangVisible: xianyangFlag
});
......@@ -751,6 +801,9 @@ class IndexMap extends Component {
});
}
}
/**
* 根据告警city或者eqpId的重构数据
*
......
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