Commit cead3eea authored by zhengjiangtao's avatar zhengjiangtao

修改告警显示

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