Commit f01b6856 authored by xinglei's avatar xinglei

*)修改bug

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