Commit de6c296b authored by 张博's avatar 张博

Merge branch 'developer' of http://172.16.10.76/station/amos-station-module-view into developer

parents 9ba1250d 466f347f
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
objModelURI: '/a3dres', objModelURI: '/a3dres',
// 根url // 根url
// baseURI: 'http://172.16.11.30:9008/', // baseURI: 'http://172.16.11.30:9008/',
baseURI: 'http://172.16.3.122:8083/', baseURI: 'http://172.16.3.77:8083/',
// convertorURI: 'http://172.16.3.122:8083/', // convertorURI: 'http://172.16.3.122:8083/',
convertorURI: 'http://172.16.3.122:8083/', convertorURI: 'http://172.16.3.77:8083/',
patrolURI: 'http://172.16.3.122:8082/', patrolURI: 'http://172.16.3.77:9000/',
rulesConfigURI: 'http://172.16.10.91:8080/', rulesConfigURI: 'http://172.16.10.91:8080/',
// plugin URI // plugin URI
pluginURI: 'http://172.16.11.40:8099/', pluginURI: 'http://172.16.11.40:8099/',
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
studioURI: 'ws://172.16.11.40:10600/', studioURI: 'ws://172.16.11.40:10600/',
securityBaseURI: 'ws://172.16.10.91:10600/', securityBaseURI: 'ws://172.16.10.91:10600/',
convertorView3dURI: 'ws://172.16.10.91:10600/', convertorView3dURI: 'ws://172.16.10.91:10600/',
ruleURI: 'ws://172.16.10.91:8080/' ruleURI: 'ws://172.16.3.77:8083/'
}, },
// 外部链接地址 // 外部链接地址
outterURI: { outterURI: {
......
...@@ -366,3 +366,15 @@ ...@@ -366,3 +366,15 @@
} }
} }
} }
.amos-toast{
.amos-toast-inner{
background: #5a94f5;
opacity: 0.78;
color: white;
.amos-toast-inner-title{
color: white;
}
}
}
...@@ -297,4 +297,43 @@ ...@@ -297,4 +297,43 @@
// } // }
} }
.ant-calendar-picker-container{
.ant-calendar{
border: 1px solid #2b8dd4;
background-color: #2b8dd4;
.ant-calendar-date-input-wrap{
color: white;
.ant-calendar-input{
background-color: #2b8dd4;
}
.ant-calendar-input::-webkit-input-placeholder {
color: white;
}
}
.ant-calendar-header{
color: white;
div a{
color: white;
}
div span a{
color: white;
}
}
.ant-calendar-body{
color: white;
.ant-calendar-cell>.ant-calendar-date{
color: white;
}
.ant-calendar-today>.ant-calendar-date{
color: black;
}
}
.ant-calendar-footer{
color: white;
.ant-calendar-today-btn {
color: white;
}
}
}
}
\ No newline at end of file
...@@ -59,16 +59,6 @@ class PointsPool extends Component { ...@@ -59,16 +59,6 @@ class PointsPool extends Component {
onMarkersCreated = (type, { markersCache }) => { onMarkersCreated = (type, { markersCache }) => {
this.markerList[type] = markersCache; this.markerList[type] = markersCache;
let stagePilot = this.props.stagePilot;
debugger;
// if(markersCache&&stagePilot) {
// // console.log(this.markerList)
// console.log(markersCache)
// // console.log(this.props)
// markersCache.eachValue(item => {
// item.node._userData = { ...item.extData };
// stagePilot.positionCtl.objects.push(item.node); })
// }
(markersCache || []).forEach(mc => { (markersCache || []).forEach(mc => {
const extData = mc.getExtData(); const extData = mc.getExtData();
if (extData.hasOwnProperty('visible')){ if (extData.hasOwnProperty('visible')){
......
...@@ -780,23 +780,26 @@ class View3D extends Component { ...@@ -780,23 +780,26 @@ class View3D extends Component {
} }
//选中点变化 //选中点变化
selectPointChange = (selectPoints) => { selectPointChange = (selectPoints) => {
if(selectPoints.isRegion){ const { markers, pointType } = this.state;
this.setState({selectArea:selectPoints}) if (selectPoints.isRegion){
}else{ this.setState({ selectArea: selectPoints, selectPoints });
this.dragItemChange(selectPoints) } else {
this.dragItemChange(selectPoints);
markers[pointType].map(e => {
if (e.id === selectPoints.id){
selectPoints.position = e.position;
}
});
this.setState({ this.setState({
selectArea:'', selectArea: '',
selectPoints, selectPoints,
showRightPanel: true, showRightPanel: true
}); });
} }
} }
getAreas = (treeData) => { getAreas = (treeData) => {
let { dragItem ,selectArea} = this.state; let { dragItem ,selectArea } = this.state;
// console.log(treeData)
// let areas = [];
if (treeData && treeData.length > 0) { if (treeData && treeData.length > 0) {
treeData.map((item) => { treeData.map((item) => {
if (item.isRegion && item.isBind) { if (item.isRegion && item.isBind) {
...@@ -903,6 +906,10 @@ class View3D extends Component { ...@@ -903,6 +906,10 @@ class View3D extends Component {
position3d: item.position.length > 1 ? `${item.position[0]},${item.position[1]},${item.position[2]}` : null position3d: item.position.length > 1 ? `${item.position[0]},${item.position[1]},${item.position[2]}` : null
}; };
}); });
this.savePointList(pointType,paramsArr);
}
savePointList = (pointType,paramsArr) => {
savePointListAction(paramsArr).then( savePointListAction(paramsArr).then(
data => { data => {
getPointTreeAction(pointType).then( getPointTreeAction(pointType).then(
...@@ -917,54 +924,54 @@ class View3D extends Component { ...@@ -917,54 +924,54 @@ class View3D extends Component {
message.success('保存成功'); message.success('保存成功');
},error => message.error('保存失败') },error => message.error('保存失败')
); );
} }
// 删除点绑定 // 删除点绑定
deletePointBind = () => { deletePointBind = () => {
let { selectPoints ,pointTypeArr,pointType,markers} = this.state; let { selectPoints ,pointTypeArr,pointType,markers} = this.state;
if (selectPoints) { if (selectPoints && !selectPoints.isRegion) {
let pointParams = []; let pointParams = [];
pointParams.push({ pointParams.push({
pointId: selectPoints.id, pointId: selectPoints.id,
pointType: selectPoints.type, pointType: selectPoints.type,
position3d: `` position3d: ``
}) });
this.savePointAndRefreshMarker(pointType,pointParams);
savePointListAction(pointParams).then(data => { }else if(selectPoints && selectPoints.isRegion && selectPoints.children){
getPointTreeAction(pointType).then(data => { AmosAlert.confirm('提示', '是否删除该区域下所有点?', {
getPointListAction().then(data => { callback: (flag) => {
let newMarkers ={ if (flag){
riskSource:[],//风险点 - riskSource; let pointParams = [];
patrol:[],//巡检点 - pointParams = selectPoints.children.filter(e => e.position3d && e.position3d.length > 0).map(item=>{
impEquipment:[],//重点设备 - return {
monitorEquipment:[],//探测器 - pointId: item.id,
video:[],//摄像头 - pointType: item.type,
fireEquipment:[],//消防设备 - position3d: ''
person:[], };
pool:[], });
hydrant:[], this.savePointAndRefreshMarker(pointType,pointParams);
fireChamber:[], } else {
fireCar:[],
fire:[],
fireDetection:[]
}
for (let i = 0; i < data.length;i++){
newMarkers[data[i].type].push(data[i]);
}
this.setState( {markers: newMarkers });
})
this.setState({
treeData: data || [], }
pageType: 'point', }
showRightPanel: false });
});
});
})
} }
} }
savePointAndRefreshMarker = (pointType,pointParams) => {
savePointListAction(pointParams).then(data => {
getPointTreeAction(pointType).then(data => {
this.getPointList(pointType,data);
this.setState({
treeData: data || [],
pageType: 'point',
showRightPanel: false
});
});
});
}
//删除区域 //删除区域
deleteAreaBind = () => { deleteAreaBind = () => {
let { selectArea,treeData } = this.state; let { selectArea,treeData } = this.state;
...@@ -1034,10 +1041,11 @@ class View3D extends Component { ...@@ -1034,10 +1041,11 @@ class View3D extends Component {
*/ */
changeAreaPoint = (type) => { changeAreaPoint = (type) => {
let { pointTypeArr } = this.state; let { pointTypeArr } = this.state;
this.setState({treeDataList:[]}) this.setState({ treeDataList: [] });
this.stagePilot.positionCtl.clearDrag();//清除已有选中
if (type === 'region') { if (type === 'region') {
getAreaTreeAction().then(data => { getAreaTreeAction().then(data => {
this.generateList(data) this.generateList(data);
this.setState({ this.setState({
treeData: data || [], treeData: data || [],
pageType: 'region', pageType: 'region',
...@@ -1105,7 +1113,7 @@ class View3D extends Component { ...@@ -1105,7 +1113,7 @@ class View3D extends Component {
} }
drop = (event) => { drop = (event) => {
console.log('drop'); this.stagePilot.positionCtl.clearDrag();
event.preventDefault(); event.preventDefault();
this.setState({ isPointSave: false }); this.setState({ isPointSave: false });
let { dragItem,markers } = this.state; let { dragItem,markers } = this.state;
...@@ -1146,7 +1154,8 @@ class View3D extends Component { ...@@ -1146,7 +1154,8 @@ class View3D extends Component {
let selectPoints = { let selectPoints = {
id: dragItem.id, id: dragItem.id,
type: dragItem.type type: dragItem.type
} };
markers[`${type}`] = markers[`${type}`].filter(e => e.id != dragItem.id );
markers[`${type}`].push(addPointParam); markers[`${type}`].push(addPointParam);
this.setState({ this.setState({
markers: deepCopy(markers), markers: deepCopy(markers),
...@@ -1254,29 +1263,22 @@ class View3D extends Component { ...@@ -1254,29 +1263,22 @@ class View3D extends Component {
}); });
}; };
/**
* 更新 markers data changeMarkersData = (position,type,id) => {
* 批量更新 const me = this;
* @params {Object} markersData {markerType<String>: markers<Array>} const { markers, selectPoints } = me.state;
*/ const index = markers[type].findIndex(e=>e.id === id);
changeMarkersData = markersData => { if (index >= 0){
if (!utils.isEmpty(markersData)) { markers[type][index].position = position;
const { markers } = this.state; markers[type][index].isEdit = true;
const newMarkers = Object.assign({}, markers, markersData); selectPoints.position = position;
this.setState({ me.setState({
markers: newMarkers markers,
selectPoints
}); });
} }
}; };
createInfowindow = text => {
const div = document.createElement('div');
div.style.position = 'absolute';
div.className = 'three-ui-infowindow';
div.innerText = text;
return div;
};
afterRender = () => { afterRender = () => {
// this.infoHelper && this.infoHelper.update(); // this.infoHelper && this.infoHelper.update();
}; };
...@@ -1470,6 +1472,7 @@ class View3D extends Component { ...@@ -1470,6 +1472,7 @@ class View3D extends Component {
errorAreaId: areaId errorAreaId: areaId
}); });
} else if (type === 'out_except_model'){ } else if (type === 'out_except_model'){
this.stagePilot.positionCtl.clearDrag();
if (!isPointSave){ if (!isPointSave){
AmosAlert.confirm('提示', '有未保存数据,是否保存?', { AmosAlert.confirm('提示', '有未保存数据,是否保存?', {
callback: (flag) => { callback: (flag) => {
...@@ -1537,25 +1540,25 @@ class View3D extends Component { ...@@ -1537,25 +1540,25 @@ class View3D extends Component {
addMarker=({ extData, position })=>{ addMarker=({ extData, position })=>{
const me = this; const me = this;
const { markers } = me; const { markers } = me.state;
const isInside = me.polygonRegion && extData.parentId && me.polygonRegion[extData.parentId].pointInPolygon([position.x,position.y,position.z]); const isInside = me.polygonRegion && extData.parentId && me.polygonRegion[extData.parentId].pointInPolygon([position.x,position.y,position.z]);
if (isInside){ // if (isInside){
markers[extData.type].forEach(e => { markers[extData.type].forEach(e => {
if (e.id === extData.id){ if (e.id === extData.id){
e.position = `${position[0]},${position[1]},${position[2]}`; e.position = position;
e.isEdit = true; e.isEdit = true;
} }
}); });
extData.position = position; extData.position = position;
this.setState({ this.setState({
markers, markers,
positionxyz: position, positionxyz: position,
showRightPanel: true, showRightPanel: true,
selectPoints: extData selectPoints: extData
}); });
} else { // } else {
message.error('不能放置非所在区域'); // message.error('不能放置非所在区域');
} // }
} }
render() { render() {
...@@ -1664,7 +1667,7 @@ class View3D extends Component { ...@@ -1664,7 +1667,7 @@ class View3D extends Component {
> >
{startAsyncLoad && <WorkerObjContent objs={asyncModels} onWorkerMessage={this.onWorkerLoading} enableLoading afterInit={this.onAfterWorkerInit} />} {startAsyncLoad && <WorkerObjContent objs={asyncModels} onWorkerMessage={this.onWorkerLoading} enableLoading afterInit={this.onAfterWorkerInit} />}
{isEditMode && pageType === 'region' ? '' : {isEditMode && pageType === 'region' ? '' :
<PointsPool markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker}/>} <PointsPool markers={markers} isEditMode={isEditMode} selectPoints={selectPoints} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} positionCtl={this.positionCtl} addMarker={this.addMarker} ref={node => this.pointsPool = node} />}
{fireTruckRoute && <FatLine {...lineData.fatLineConf} linePath={JSON.parse(fireTruckRoute)} visible={showFireTruckRoute} />} {fireTruckRoute && <FatLine {...lineData.fatLineConf} linePath={JSON.parse(fireTruckRoute)} visible={showFireTruckRoute} />}
<FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} /> <FlameFire position={firePosition} width={10} height={20} depth={8} sliceSpacing={1} visible={planStarted} />
{isEditMode && this.renderAreas()} {isEditMode && this.renderAreas()}
......
...@@ -181,7 +181,7 @@ class PointLeftTree extends Component { ...@@ -181,7 +181,7 @@ class PointLeftTree extends Component {
console.log('onSelect', info); console.log('onSelect', info);
let selectItem = info.node.props.dataRef; let selectItem = info.node.props.dataRef;
this.setState({ selectedKeys }); this.setState({ selectedKeys });
this.props.selectPointChange(selectItem) this.props.selectPointChange(selectItem);
} }
render() { render() {
let { treeData, checkedPointsKeys,pointTypeArr,pointType } = this.state; let { treeData, checkedPointsKeys,pointTypeArr,pointType } = this.state;
......
...@@ -134,7 +134,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){ ...@@ -134,7 +134,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options){
} }
} }
markerCreated = ({ markersCache }) => { markerCreated = ({ markersCache }) => {
let {isEditMode,selectKey} =this.props let { isEditMode,selectKey } =this.props;
this.markersCache = markersCache; this.markersCache = markersCache;
this.stagePilot = this.props.stagePilot; this.stagePilot = this.props.stagePilot;
this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined; this.outlineHelper = this.stagePilot ? this.stagePilot.outlineHelper : undefined;
......
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