Commit d4c4410c authored by 单奇雲's avatar 单奇雲

actionBars

parent 2ceb61fd
......@@ -110,4 +110,5 @@ export const FasSerUrl = {
importExcelDataUrl: completePrefix(convertorURI, 'api/excel/import/data/excel/{type}'),//导入excel数据type=['fireResource','water']
importExcelFireEquipmentPointUrl: completePrefix(convertorURI, 'api/excel/import/fireEquipmentPoint'),
exportExcelFireEquipmentPointUrl: completePrefix(convertorURI, 'api/excel/export?exportType={exportType}&modelName={modelName}'),
pointModelistUrl: completePrefix(convertorURI, 'api/view3d/point/list?model={model}'),
};
\ No newline at end of file
......@@ -163,3 +163,11 @@ export const query3DStatistics = (markerType) => {
export const queryContingencyWater = () => {
return commonGet(formatUrl(FasSerUrl.contingencyWaterUrl));
}
/**
* 颗粒/重点设备 模式点查询
* @param {模式} model
*/
export const pointModelistAction = ( model ) => {
return commonGet(formatUrl(FasSerUrl.pointModelistUrl, { model }));
};
\ No newline at end of file
......@@ -16,6 +16,7 @@
width: 40px;
height: 38px;
text-align: center;
cursor: pointer ;
border:1px solid rgba(146,149,151,1);
.action-item-title{
......
......@@ -18,6 +18,13 @@ const eventConnect = Connect.eventConnect;
@eventConnect
class MaskContent extends Component {
constructor(props) {
super(props);
this.state = {
sideControlShow: true
};
}
componentWillMount() {
this.setState({ planStarted: this.props.planStarted });
}
......@@ -41,8 +48,21 @@ class MaskContent extends Component {
this.props.trigger(topic, content);
};
actionBarClick = (type) => {
this.changeSideControlShow(type);
this.props.onActionItemClick && this.props.onActionItemClick(type);
}
changeSideControlShow = (type) => {
let sideControlShow = false;
if(type === "panoramicMode"){
sideControlShow = true;
}
this.setState({sideControlShow});
}
render() {
const { planStarted } = this.state;
const { planStarted,sideControlShow } = this.state;
const { multiple, onItemClick, layerConfig, showExplain, onExplainClose, alarmStarted, alarmStart, planStart, planQuit } = this.props;
const { onActionItemClick } = this.props;
const wsURL = completeToken(SysWsURL.convertorRulews);
......@@ -75,10 +95,10 @@ class MaskContent extends Component {
return (
<div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
<SideControl multiple={multiple} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />
<DataPane animationProps={datapaneAnim} />
{ sideControlShow && <SideControl multiple={multiple} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />}
{ sideControlShow && <DataPane animationProps={datapaneAnim} />}
<TopMsg alarmStart={alarmStart} />
<ActionBar onActionItemClick={onActionItemClick} animationProps={controlAnimation}/>
<ActionBar onActionItemClick={(e) => this.actionBarClick(e)} animationProps={controlAnimation}/>
{/* <RulesLayer />
{alarmStarted && <LayerPool animationProps={layerPoolAnimation} planStart={planStart} planQuit={planQuit} planStarted={planStarted} />}
<Explain visible={showExplain} onExplainClose={onExplainClose} />*/}
......
......@@ -10,7 +10,7 @@ import * as endConf from 'amos-processor/lib/config/endconf';
import { LensJumpFactory } from 'base-r3d/lib/factory';
import { CONSTS } from './../consts/storageConsts';
import MaskContent from './MaskContent';
import { getObjFromNet, initView3DAction, query3DStatistics } from './../services/3dService';
import { getObjFromNet, initView3DAction, query3DStatistics, pointModelistAction } from './../services/3dService';
import { desigerConf, desigerHelperConfig } from './conf';
import PointsPool from './PointsPool';
import { eventTopics, isControllerEvent, isManualOperate } from './consts';
......@@ -645,6 +645,33 @@ class View3D extends Component {
onActionItemClick = (actionType) => {
console.log('onActionItemClick');
this.clearMarkers();
this.asyncLoadImpEquipment(actionType);
}
asyncLoadImpEquipment = (actionType) => {
pointModelistAction(actionType).then(d =>{
if (markerType === 'fireResource') {
markers['hydrant'] = d['hydrant'];
markers['monitorEquipment'] = d['monitorEquipment'];
markers['fireCar'] = d['fireCar'];
markers['impEquipment'] = d['impEquipment'];
markers['fireChamber'] = d['fireChamber'];
markers['pool'] = d['pool'];
markers[markerType] = d;
this.setState({
markers
});
return;
}
markers[markerType] = d;
this.setState({
markers,
markerType
});
});
}
render() {
......
......@@ -26,7 +26,7 @@ class ActionBar extends Component {
if(!item.singleClick){
this.setState({ activeAction: item.type });
}
this.props.onActionItemClick && this.props.onActionItemClick();
this.props.onActionItemClick && this.props.onActionItemClick(item.type);
this.props.trigger(eventTopics.innate_operater, {
key: item.type,
......
......@@ -79,8 +79,8 @@ export const viewController = [
* 视图控制
*/
export const actionBars = [
{ key: 'impEquipment-action', icon: 'impEquipment', type: 'impEquipmentMode', singleClick: false, label: '重点设备' },
{ key: 'panoramic-action', icon: 'panoramic', type: 'panoramicMode', singleClick: false, label: '全景' },
{ key: 'impEquipment-action', icon: 'impEquipment', type: 'impEquipment', singleClick: false, label: '重点设备' },
{ key: 'panoramic-action', icon: 'panoramic', type: 'panoramic', singleClick: false, label: '全景' },
{ key: 'burst-action', icon: 'burst', type: 'burst', singleClick: true, label: '分解' },
{ key: 'fitview-action', icon: 'fitview', type: 'fitview', singleClick: true, label: '初始视图' },
{ key: 'edit-action', icon: 'editMode', type: 'editMode', singleClick: false, label: '编辑' }
......
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