Commit f01b6856 authored by xinglei's avatar xinglei

*)修改bug

parent b8d40a4e
...@@ -19,7 +19,7 @@ import RegionList from './../view/region'; ...@@ -19,7 +19,7 @@ import RegionList from './../view/region';
import BusinessView from './../view/bizview/point/PointView'; import BusinessView from './../view/bizview/point/PointView';
import RiskPoint from './../view/bizview/riskPoint/index'; import RiskPoint from './../view/bizview/riskPoint/index';
import Dutyinfo from './../view/bizview/dutyInfo/index'; import DutyInfo from './../view/bizview/dutyInfo/index';
import Fireequip from './../view/bizview/fireEquipment/index'; import Fireequip from './../view/bizview/fireEquipment/index';
import Personnel from './../view/bizview/personnelInfo/index'; import Personnel from './../view/bizview/personnelInfo/index';
// import CheckDetail from './../view/bizview/checkManage/checkDetail'; // import CheckDetail from './../view/bizview/checkManage/checkDetail';
...@@ -108,7 +108,7 @@ const Routes = { ...@@ -108,7 +108,7 @@ const Routes = {
twoDimensionalMap: TwoDimensionalMap, twoDimensionalMap: TwoDimensionalMap,
bizview: BusinessView, bizview: BusinessView,
riskpoint: RiskPoint, riskpoint: RiskPoint,
dutyinfo: Dutyinfo, dutyinfo: DutyInfo,
fireequip: Fireequip, fireequip: Fireequip,
personnel: Personnel, personnel: Personnel,
patrolpoint: Patrol, patrolpoint: Patrol,
......
...@@ -51,3 +51,24 @@ export const calcCoorArrUtil = (point_start, point_end, num, key) => { ...@@ -51,3 +51,24 @@ export const calcCoorArrUtil = (point_start, point_end, num, key) => {
return paths; return paths;
}; };
/**
* 语言播放
*/
export function text2Speech(content){
if ('speechSynthesis' in window) {
let sentence = new SpeechSynthesisUtterance(content);
let voices = window.speechSynthesis.getVoices();
for (let i = 0; i < voices.length; i++) {
if (voices[i]['name'] === 'Alex') {
sentence.voice = voices[i];
}
}
sentence.pitch = 1;
sentence.rate = 1.5;//速度
sentence.text = content;
window.speechSynthesis.speak(sentence);
} else {
console.log('当前浏览器不支持语音朗读.');
}
}
...@@ -7,7 +7,7 @@ import sysConsts from 'amos-processor/lib/config'; ...@@ -7,7 +7,7 @@ import sysConsts from 'amos-processor/lib/config';
import payload from './payload'; import payload from './payload';
const lsTool = Store.lsTool; const lsTool = Store.lsTool;
const orgCode = 'orgCode'; const ORGCODE = 'orgCode';
const defaultPageable = { const defaultPageable = {
page: 0, page: 0,
...@@ -142,11 +142,11 @@ export function setUserId(userId){ ...@@ -142,11 +142,11 @@ export function setUserId(userId){
} }
export function setOrgCode(orgCode){ export function setOrgCode(orgCode){
return lsTool.write(orgCode, orgCode); return lsTool.write(ORGCODE, orgCode);
} }
export function getOrgCode(){ export function getOrgCode(){
return lsTool.read(orgCode); return lsTool.read(ORGCODE);
} }
export { amosRequest, commonGet, getWithCookie, singleFetch, commonPost, commonPut, commonDelete, convertDatalist, buildPageable, formatUrl }; export { amosRequest, commonGet, getWithCookie, singleFetch, commonPost, commonPut, commonDelete, convertDatalist, buildPageable, formatUrl };
...@@ -1032,6 +1032,7 @@ class View3D extends Component { ...@@ -1032,6 +1032,7 @@ class View3D extends Component {
* @memberof View3D * @memberof View3D
*/ */
backPreviousLevelView = () => { backPreviousLevelView = () => {
this.props.trigger(eventTopics.innate_operater_back, { value: true });
if (this.lensLevel === LENS_LEVEL.SUN) { if (this.lensLevel === LENS_LEVEL.SUN) {
this.backSubView(); this.backSubView();
this.lensLevel = LENS_LEVEL.SUB; this.lensLevel = LENS_LEVEL.SUB;
......
...@@ -2,6 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { UUID } from 'amos-tool'; import { UUID } from 'amos-tool';
import message from 'amos-framework/lib/message'; import message from 'amos-framework/lib/message';
import { utils } from 'amos-tool'; import { utils } from 'amos-tool';
import { text2Speech } from './../../../utils/CalcCoorArrUtil';
/** /**
* 首页告警跑马灯 * 首页告警跑马灯
...@@ -48,6 +49,9 @@ class AlarmMarquee extends Component { ...@@ -48,6 +49,9 @@ class AlarmMarquee extends Component {
*/ */
resetMessage = (message) => { resetMessage = (message) => {
if (!utils.isEmpty(message) && utils.isArray(message)) { if (!utils.isEmpty(message) && utils.isArray(message)) {
message.forEach((e, index) => {
text2Speech('异常' + (index + 1) + e.content);
});
return (<div> return (<div>
{ {
message.map(e => { message.map(e => {
......
...@@ -63,6 +63,7 @@ export const eventTopics = { ...@@ -63,6 +63,7 @@ export const eventTopics = {
innate_layer: 'base3d.view.controller_layer', // 楼层操作 innate_layer: 'base3d.view.controller_layer', // 楼层操作
innate_operater: 'base3d.view.controller_operater', // 三维内置操作 innate_operater: 'base3d.view.controller_operater', // 三维内置操作
innate_operater_back: 'base3d.view.controller_operater_back', // 三维内置操作返回--关闭首页弹框
broadcast_fresh: 'base3d.view.broadcast_fresh',//执行步骤数据刷新 broadcast_fresh: 'base3d.view.broadcast_fresh',//执行步骤数据刷新
view_fresh: 'base3d.view.view_fresh',//视图刷新 view_fresh: 'base3d.view.view_fresh',//视图刷新
fromws: 'base3d.fromws', fromws: 'base3d.fromws',
......
/* eslint-disable react/sort-comp */ /* eslint-disable react/sort-comp */
/* eslint-disable react/jsx-no-undef */ /* eslint-disable react/jsx-no-undef */
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { pointInfoAction } from 'SERVICES/3dService'; import { pointInfoAction } from 'SERVICES/3dService';
import { CONSTS } from 'CONSTS/storageConsts'; import { CONSTS } from 'CONSTS/storageConsts';
import { queryRoutePlanPointAction } from 'SERVICES/checkInfoService'; import { queryRoutePlanPointAction } from 'SERVICES/checkInfoService';
...@@ -14,7 +15,9 @@ import MonitorEquipmentModal from './dialogModel/MonitorEquipmentModal'; ...@@ -14,7 +15,9 @@ import MonitorEquipmentModal from './dialogModel/MonitorEquipmentModal';
import EquipmentModal from './dialogModel/EquipmentModal'; import EquipmentModal from './dialogModel/EquipmentModal';
import DynamicRingDateModalTable from './dialogModel/DynamicRingDateModalTable'; import DynamicRingDateModalTable from './dialogModel/DynamicRingDateModalTable';
import RiskSourceDetailModal from './dialogModel/RiskSourceDetailModal'; import RiskSourceDetailModal from './dialogModel/RiskSourceDetailModal';
import CheckDetail from './../../../bizview/check/checkDetail/index'; import CheckDetail from './../../../bizview/check/checkDetail/index';
import { eventTopics } from '../consts';
import { PubSub } from 'ray-eventpool';
const headers = [{ key: 'details', icon: 'number-more', text: '详情' }, { key: 'danger', icon: 'danger', text: '隐患' }]; const headers = [{ key: 'details', icon: 'number-more', text: '详情' }, { key: 'danger', icon: 'danger', text: '隐患' }];
...@@ -46,11 +49,17 @@ class PointDialog extends Component { ...@@ -46,11 +49,17 @@ class PointDialog extends Component {
dialog: false, dialog: false,
isFullScreen: false, isFullScreen: false,
fireDetectVisible: false, fireDetectVisible: false,
xun:false, xun: false,
checkId:'' checkId: ''
}; };
} }
componentDidMount() {
PubSub.subscribe(eventTopics.innate_operater_back, (topic, data) => {
this.onDialogClose();
});
}
/** /**
* 打开模态框 * 打开模态框
* *
...@@ -78,7 +87,7 @@ class PointDialog extends Component { ...@@ -78,7 +87,7 @@ class PointDialog extends Component {
markerData.markerExtData = { dialogId: id, type, objType, sourceId }; markerData.markerExtData = { dialogId: id, type, objType, sourceId };
if (type === 'riskSource') { if (type === 'riskSource') {
this.setState({ markerData, modal: true }); this.setState({ markerData, modal: true });
} else if (type === 'impEquipment' && objType !== '03'){//虚拟设备不需要打开Model框 } else if (type === 'impEquipment' && objType !== '03') {//虚拟设备不需要打开Model框
this.setState({ markerData, modal: true }); this.setState({ markerData, modal: true });
} else if (type === 'dynamicRingData') {// } else if (type === 'dynamicRingData') {//
this.setState({ markerData, modal: true }); this.setState({ markerData, modal: true });
...@@ -116,7 +125,7 @@ class PointDialog extends Component { ...@@ -116,7 +125,7 @@ class PointDialog extends Component {
* @memberof PointDialog * @memberof PointDialog
*/ */
onCheckStatusClick = record => { onCheckStatusClick = record => {
this.setState({ xun: true,checkId: record.id }); this.setState({ xun: true, checkId: record.id });
// const detailParams = { // const detailParams = {
// ...markerData.markerExtData, // ...markerData.markerExtData,
// detailForw: 'record', // detailForw: 'record',
...@@ -184,23 +193,12 @@ class PointDialog extends Component { ...@@ -184,23 +193,12 @@ class PointDialog extends Component {
this.setState({ modal: false }); this.setState({ modal: false });
}; };
/**** /**
*
*
* 巡检详情 * 巡检详情
*
*/ */
cancelxun = () => {
cancelxun = () => {
this.setState({ xun: false }); this.setState({ xun: false });
}; };
/** /**
* 全屏切换 * 全屏切换
...@@ -247,8 +245,8 @@ cancelxun = () => { ...@@ -247,8 +245,8 @@ cancelxun = () => {
}; };
render() { render() {
const { open,checkId, xun,showRight, rightContent, markerData, modal, dataList, dialog, isFullScreen, fireDetectVisible} = this.state; const { open, checkId, xun, showRight, rightContent, markerData, modal, dataList, dialog, isFullScreen, fireDetectVisible } = this.state;
const { type, dialogId,objType } = markerData.markerExtData || {}; const { type, dialogId, objType } = markerData.markerExtData || {};
let minInfo = { let minInfo = {
headers, headers,
title: dialogEum[type], title: dialogEum[type],
...@@ -256,27 +254,27 @@ cancelxun = () => { ...@@ -256,27 +254,27 @@ cancelxun = () => {
table: <RiskContentTable pointId={dialogId} dataList={dataList} onCheckStatusClick={this.onCheckStatusClick} fetchData={this.getTableData} /> table: <RiskContentTable pointId={dialogId} dataList={dataList} onCheckStatusClick={this.onCheckStatusClick} fetchData={this.getTableData} />
}; };
let modelClass = 'point-dialog-modal'; let modelClass = 'point-dialog-modal';
if (type === 'riskSource' || type === 'patrol'){ if (type === 'riskSource' || type === 'patrol') {
modelClass = 'risk-warn-modal'; modelClass = 'risk-warn-modal';
} else if (type === 'impEquipment'){ } else if (type === 'impEquipment') {
modelClass = 'impEqu-info-modal'; modelClass = 'impEqu-info-modal';
} else if ( type === 'dynamicRingData' && objType === '01'){ } else if (type === 'dynamicRingData' && objType === '01') {
modelClass = 'dynamicRingData-info-modal'; modelClass = 'dynamicRingData-info-modal';
} else if ( type === 'dynamicRingData' && objType === '02'){ } else if (type === 'dynamicRingData' && objType === '02') {
modelClass = 'dynamicRingData-fire-info-modal'; modelClass = 'dynamicRingData-fire-info-modal';
} }
let header = ''; let header = '';
if (type === 'dynamicRingData' && objType === '01'){ if (type === 'dynamicRingData' && objType === '01') {
header = dialogEum['dynamicRingData']; header = dialogEum['dynamicRingData'];
} else if (type === 'dynamicRingData' && objType === '02'){ } else if (type === 'dynamicRingData' && objType === '02') {
header = dialogEum['huotan']; header = dialogEum['huotan'];
} else { } else {
header = dialogEum[type]; header = dialogEum[type];
} }
//console.log(type,fireDetectVisible); //console.log(type,fireDetectVisible);
let ff=true; let ff = true;
return ( return (
<div> <div>
{ {
...@@ -289,7 +287,6 @@ cancelxun = () => { ...@@ -289,7 +287,6 @@ cancelxun = () => {
clickHeaderItem={this.clickHeaderItem} clickHeaderItem={this.clickHeaderItem}
/> />
} }
{<Modal {<Modal
className='xun' className='xun'
header="巡检详情" header="巡检详情"
...@@ -300,16 +297,7 @@ cancelxun = () => { ...@@ -300,16 +297,7 @@ cancelxun = () => {
onCancel={this.cancelxun} onCancel={this.cancelxun}
content={<CheckDetail pointId={dialogId} checkID={checkId} />} content={<CheckDetail pointId={dialogId} checkID={checkId} />}
/> />
} } }
{type && type !== 'video' && ( {type && type !== 'video' && (
<Modal <Modal
header={header} header={header}
...@@ -336,4 +324,8 @@ cancelxun = () => { ...@@ -336,4 +324,8 @@ cancelxun = () => {
} }
} }
PointDialog.propTypes = {
subscribe: PropTypes.func
};
export default PointDialog; export default PointDialog;
...@@ -7,7 +7,7 @@ import MarkerIcon from './MarkerIcon'; ...@@ -7,7 +7,7 @@ import MarkerIcon from './MarkerIcon';
import StatisticsMarkerIcon from './markers/StatisticsMarkerIcon'; import StatisticsMarkerIcon from './markers/StatisticsMarkerIcon';
import { tirggerTransTopic, tirggerPlanTopic } from '../dataProcessor'; import { tirggerTransTopic, tirggerPlanTopic } from '../dataProcessor';
export default function markerFactory(WrappedComponent = 'div', options){ export default function markerFactory(WrappedComponent = 'div', options) {
const { markerType } = options; const { markerType } = options;
class MarkerPoints extends Component { class MarkerPoints extends Component {
static propTypes = { static propTypes = {
...@@ -54,12 +54,9 @@ export default function markerFactory(WrappedComponent = 'div', options){ ...@@ -54,12 +54,9 @@ export default function markerFactory(WrappedComponent = 'div', options){
* @memberof MarkerPoints * @memberof MarkerPoints
*/ */
onMarkerDblClick = (marker, e) => { onMarkerDblClick = (marker, e) => {
debugger if (marker.extData.levelStr === 'impEqu_04') {
if(marker.extData.levelStr==='impEqu_04'){ return;
return ;
} }
debugger
clearTimeout(this.time); clearTimeout(this.time);
tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData }); tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData });
// if (marker.extData.markerType === 'impEquipment' && void 0 !== marker.extData.show) { // if (marker.extData.markerType === 'impEquipment' && void 0 !== marker.extData.show) {
......
...@@ -37,10 +37,12 @@ class ControlItem extends Component { ...@@ -37,10 +37,12 @@ class ControlItem extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { active } = nextProps; const { active } = nextProps;
if (nextProps.active !== this.state.open ){
this.setState({ this.setState({
open: active open: active
}); });
} }
}
/** /**
* 子项点击事件 * 子项点击事件
......
...@@ -38,6 +38,12 @@ class InnateControlPane extends Component { ...@@ -38,6 +38,12 @@ class InnateControlPane extends Component {
key: item.type, key: item.type,
value: !alreadyActive value: !alreadyActive
}); });
if (item.type === 'back'){//点击返回按钮,关闭页面所有弹窗
this.props.trigger(eventTopics.innate_operater_back, {
key: item.type,
value: !alreadyActive
});
}
}; };
onMulitLayerItemClick = (item, toggle) => { onMulitLayerItemClick = (item, toggle) => {
......
...@@ -5,6 +5,8 @@ import { Store } from 'amos-tool'; ...@@ -5,6 +5,8 @@ import { Store } from 'amos-tool';
import BizControlPane from './BizControlPane'; import BizControlPane from './BizControlPane';
import InnateControlPane from './InnateControlPane'; import InnateControlPane from './InnateControlPane';
import { viewController, bizControls } from '../conf'; import { viewController, bizControls } from '../conf';
import { PubSub } from 'ray-eventpool';
import { eventTopics } from '../consts';
const loginUserName = Store.lsTool.read('userName'); const loginUserName = Store.lsTool.read('userName');
const filterUser = ['tianbo', 'opera1', 'opera2']; const filterUser = ['tianbo', 'opera1', 'opera2'];
...@@ -19,10 +21,19 @@ class SideControl extends Component { ...@@ -19,10 +21,19 @@ class SideControl extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
activeControl: [] activeControl: [],
open: true
}; };
} }
componentDidMount() {
PubSub.subscribe(eventTopics.innate_operater_back, (topic, data) => {//监听三维返回按钮
this.setState({
open: false
});
});
}
/** /**
* control 点击,第二次点击则取消 * control 点击,第二次点击则取消
*/ */
...@@ -58,8 +69,16 @@ class SideControl extends Component { ...@@ -58,8 +69,16 @@ class SideControl extends Component {
* @memberof SideControl * @memberof SideControl
*/ */
isActive = key => { isActive = key => {
const { activeControl } = this.state; const { activeControl, open } = this.state;
return activeControl && activeControl.includes(key); if (!open){//2秒后初始activeControl和open
setTimeout(()=>{
this.setState({
activeControl: [],
open: true
});
}, 2000);
}
return open && activeControl && activeControl.includes(key);
}; };
render() { render() {
......
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