Commit 0e59e1ef authored by zhengjiangtao's avatar zhengjiangtao

科技处轮播图和首页闪烁修改

parent 5b4aa026
......@@ -59,6 +59,31 @@ const createPanel = (text) => {
return div;
};
const moniData = [
{ authOrg: null,
code: "1*13",
content: "-11.45.0.18-423-通讯状态",
id: 176,
isAlarm: 1,
pointId: 221,
pointName: "",
pointType: "1",
sourceId: null,
updateDate: "2020-06-09 09:48:15"},
{
authOrg: null,
code: "1*13",
content: "-11.44.12.83-424-通讯状态",
id: 175,
isAlarm: 1,
pointId: 222,
pointName: "",
pointType: "1",
sourceId: null,
updateDate: "2020-06-09 09:48:12"
}
]
/**
* 展示三维模型
*
......@@ -1188,6 +1213,7 @@ class View3D extends Component {
transferAlarmData = () => {
let { alarmData, orgCode } = this.state;
// alarmData = moniData;
const { isAllDone, alarms, markerType } = this.state;
if (!isAllDone || this.city.isXidajie) {
return;
......@@ -1211,21 +1237,41 @@ class View3D extends Component {
let dicCodeList = JSON.parse(dictionaryList);
let city = this.getSelectCityByOrgCode(orgCode,dicCodeList);
if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
alarmData.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 (pointAttrs.storey === '3' || pointAttrs.storey === 'floor_3') {// 三楼数据
thirdFloorAlarmData.push(item);
} else if (pointAttrs.storey === '6' || pointAttrs.storey === 'floor_6') {// 六楼数据
sixthFloorAlarmData.push(item);
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);
}
}
} else if (city === 'xianyang' && (item.code.startsWith(orgCode)|| item.authOrg &&item.authOrg.indexOf(orgCode)!==-1)) {// 咸阳数据
xyFloorAlarmData.push(item);
}
});
});
}
}
if(city === 'xian' || city === 'xianyang' ){
if (alarmData && !utils.isEmpty(alarmData) && utils.isArray(alarmData)) {
alarmData.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 (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)) {// 咸阳数据
xyFloorAlarmData.push(item);
}
});
}
}
if (this.lensLevel === LENS_LEVEL.ROOT) {
// 三楼告警
......@@ -1300,6 +1346,19 @@ class View3D extends Component {
return city;
}
/**
* 根据城市返回字典中配置的组织orgCode
*/
getSelectOrgCode = (city, dictionaryList) => {
let orgCode = null;
dictionaryList.map(item => {
if (item.dictDataKey === city) {
orgCode = item.dictDataValue;
}
});
return orgCode;
}
/**
* 告警信息点击事件
......@@ -1531,8 +1590,8 @@ class View3D extends Component {
points.push(alarmPoint);
debugger
markers[alarmPoint.type] = points;
//console.log(markers);
if (this.lensLevel === LENS_LEVEL.SUB || this.lensLevel === LENS_LEVEL.SUN) {
......
......@@ -723,12 +723,13 @@ class IndexMap extends Component {
let dicCodeList = JSON.parse(dictionaryList);
let xianCode = this.getSelectOrgCode('xian', dicCodeList);
let xianyangCode = this.getSelectOrgCode('xianyang', dicCodeList);
let kejichuCode = this.getSelectOrgCode('科技处', dicCodeList);
getAlarms().then(data => {
if (!utils.isEmpty(data) && utils.isArray(data)) {
const xianFlag = data.some(e => {
// if (e.code === xianCode) {
if (e.code.startsWith(xianCode) || e.authOrg && e.authOrg.indexOf(xianCode) !== -1) {
if (e.code.startsWith(kejichuCode) || e.code.startsWith(xianCode) || e.authOrg && e.authOrg.indexOf(xianCode) !== -1) {
return true;
}
});
......
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