Commit 9ce53a10 authored by 单奇雲's avatar 单奇雲

冲突

parents 42436eb0 bf4c3390
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
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.77:8083/', baseURI: '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/', convertorURI: 'http://172.16.3.122:8083/',
patrolURI: 'http://172.16.3.77:9000/', 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
......
...@@ -233,14 +233,14 @@ export const parseLevelFilter = (instance, topic, data) => { ...@@ -233,14 +233,14 @@ export const parseLevelFilter = (instance, topic, data) => {
mc.node.visible = visible; mc.node.visible = visible;
mc.object2DPipe.pipeNode.show(); mc.object2DPipe.pipeNode.show();
} else { } else {
mc.show(); mc.visible = true;
} }
} else { } else {
if (mc.extData.type === 'fireCar') { if (mc.extData.type === 'fireCar') {
mc.node.visible = visible; mc.node.visible = visible;
mc.object2DPipe.pipeNode.hide(); mc.object2DPipe.pipeNode.hide();
} else { } else {
mc.hide(); mc.visible = false;
} }
} }
}); });
......
...@@ -4,7 +4,6 @@ import echarts from 'echarts/lib/echarts'; ...@@ -4,7 +4,6 @@ import echarts from 'echarts/lib/echarts';
import { safetyIndexWeekAction } from './../../../services/panoramicService'; import { safetyIndexWeekAction } from './../../../services/panoramicService';
import { getIcon } from './../../../utils/request'; import { getIcon } from './../../../utils/request';
/** /**
* 一周安全指数 * 一周安全指数
*/ */
...@@ -15,23 +14,19 @@ const option = { ...@@ -15,23 +14,19 @@ const option = {
boundaryGap: false, boundaryGap: false,
data: ['03-15', '03-16', '03-17', '03-18', '03-19', '03-20'], data: ['03-15', '03-16', '03-17', '03-18', '03-19', '03-20'],
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: '14', fontSize: '14',
fontFamiliy: "SourceHanSansCN-Medium,SourceHanSansCN" fontFamiliy: 'SourceHanSansCN-Medium,SourceHanSansCN'
}
},
} }
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: { show: false },//去除网格线 splitLine: { show: false }, //去除网格线
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#2A5D75', color: '#2A5D75'
} }
}, },
// 改变y轴字体颜色和大小 // 改变y轴字体颜色和大小
...@@ -39,51 +34,49 @@ const option = { ...@@ -39,51 +34,49 @@ const option = {
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: '14', fontSize: '14',
fontFamiliy: "SourceHanSansCN-Medium,SourceHanSansCN" fontFamiliy: 'SourceHanSansCN-Medium,SourceHanSansCN'
}
}
},
},
}, },
series: [{ series: [
data: [0, 40, 80, 100, 85, 70, 85, 80], {
type: 'line', data: [0, 40, 80, 100, 85, 70, 85, 80],
smooth: true, //这个是把线变成 type: 'line',
itemStyle: { smooth: true, //这个是把线变成
normal: { itemStyle: {
color: "#FF7400", //折线点的颜色 normal: {
lineStyle: { color: '#FF7400', //折线点的颜色
width: 3,//折线宽度 lineStyle: {
color: "#DDBF28"//折线颜色 width: 3, //折线宽度
color: '#DDBF28' //折线颜色
}
}
},
areaStyle: {
normal: {
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#00ADFF'
},
{
offset: 0.5,
color: '#DDBF28'
},
{
offset: 1,
color: '#FF7400'
}
])
} }
} }
},
areaStyle: {
normal: {
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#00ADFF'
}, {
offset: 0.5,
color: '#DDBF28'
}, {
offset: 1,
color: '#FF7400'
}])
}
} }
}] ]
}; };
class SafetyIndexWeek extends Component { class SafetyIndexWeek extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -101,35 +94,32 @@ class SafetyIndexWeek extends Component { ...@@ -101,35 +94,32 @@ class SafetyIndexWeek extends Component {
data data
}); });
}); });
} };
getOptionsx = (map) => { getOptionsx = map => {
return { return {
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: map.get("dates"), data: map.get('dates'),
axisLabel: { axisLabel: {
interval: 0,//横轴信息全部显示 interval: 0, //横轴信息全部显示
// rotate:40, // rotate:40,
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: '12', fontSize: '12',
fontFamiliy: "SourceHanSansCN-Medium,SourceHanSansCN" fontFamiliy: 'SourceHanSansCN-Medium,SourceHanSansCN'
}, },
margin: 15,//刻度标签与轴线之间的距离。 margin: 15 //刻度标签与轴线之间的距离。
} }
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
splitLine: { show: false },//去除网格线 splitLine: { show: false }, //去除网格线
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#2A5D75', color: '#2A5D75'
} }
}, },
// 改变y轴字体颜色和大小 // 改变y轴字体颜色和大小
...@@ -137,113 +127,115 @@ class SafetyIndexWeek extends Component { ...@@ -137,113 +127,115 @@ class SafetyIndexWeek extends Component {
textStyle: { textStyle: {
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)',
fontSize: '12', fontSize: '12',
fontFamiliy: "SourceHanSansCN-Medium,SourceHanSansCN" fontFamiliy: 'SourceHanSansCN-Medium,SourceHanSansCN'
}, },
margin: 15,//刻度标签与轴线之间的距离。 margin: 15 //刻度标签与轴线之间的距离。
}, }
}, },
series: [{ series: [
data: map.get("values"), {
type: 'line', data: map.get('values'),
symbol: 'circle',//折线点设置为实心点 type: 'line',
smooth: true, //这个是把线变成 symbol: 'circle', //折线点设置为实心点
itemStyle: { smooth: 0.6,
normal: { // itemStyle: {
color: "#E1B623", //折线点的颜色 // normal: {
lineStyle: { // color: '#FF7400', //折线点的颜色
width: 3,//折线宽度 // lineStyle: {
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上 // width: 3, //折线宽度
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ // color: '#DDBF28' //折线颜色
// }
offset: 0, // }
color: '#FF0000' // },
}, { lineStyle: {
offset: 0.2, normal: { color: {
color: '#DDBF28' type: 'linear',
}, { x: 0,
offset: 0.4, y: 1,
color: '#FF7400' x2: 0,
}, { y2: 0,
offset: 0.5, colorStops: [
color: '#00ADFF' {
}, { offset: 0, color: 'rgba(255, 0, 0, 0)' // 0% 处的颜色
offset: 0.6, },
color: '#DDBF28' {
}]) offset: 0.5, color: 'rgba(255, 0, 0, 0.3)' // 50% 处的颜色
} },
} {
}, offset: 0.9, color: 'rgba(255, 116, 0, 0.67)' // 90% 处的颜色
areaStyle: { },
normal: { {
//颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上#766016 transparent offset: 0.95, color: 'rgba(221, 191, 40, 0.76)' // 95% 处的颜色
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ },
{
offset: 0, offset: 1, color: 'rgba(0, 173, 255, 0.76)' // 100% 处的颜色
color: '#00ADFF' }],
}, { global: false // 缺省为 false
offset: 0.1, } }
color: '#6e6a26' },
}, { areaStyle: { normal: { color: {
offset: 0.2, type: 'linear',
color: '#766016' x: 0,
}, { y: 1,
offset: 0.5, x2: 0,
color: '#4b2006' y2: 0,
},{ colorStops: [
offset: 0.6, {
color: '#280d07' offset: 0, color: 'rgba(255, 0, 0, 0)' // 0% 处的颜色
}]) },
{
} offset: 0.5, color: 'rgba(255, 0, 0, 0.3)' // 50% 处的颜色
},
{
offset: 0.9, color: 'rgba(255, 116, 0, 0.67)' // 90% 处的颜色
},
{
offset: 0.95, color: 'rgba(221, 191, 40, 0.76)' // 95% 处的颜色
},
{
offset: 1, color: 'rgba(0, 173, 255, 0.76)' // 100% 处的颜色
}],
global: false // 缺省为 false
} } }
} }
}] ]
}; };
} };
handleData = (data) => { handleData = data => {
let map = new Map(); let map = new Map();
let dates = []; let dates = [];
let values = []; let values = [];
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(item => { data.map(item => {
let time2 = item.date.substring(5); let time2 = item.date.substring(5);
dates.push(time2) dates.push(time2);
values.push(item.value) values.push(item.value);
}) });
} }
map.set("dates", dates); map.set('dates', dates);
map.set("values", values); map.set('values', values);
return map; return map;
} };
render() { render() {
let { data } = this.state; let { data } = this.state;
let map = this.handleData(data); let map = this.handleData(data);
return ( return (
<div className="safetyIndexWeek"> <div className="safetyIndexWeek">
<div className="content-week-font-style"> <div className="content-week-font-style">
<span className='titleIcon' style={{ background: `url(${getIcon('textleft')}) no-repeat center center/100% 100%` }}></span>一周安全趋势</div> <span className="titleIcon" style={{ background: `url(${getIcon('textleft')}) no-repeat center center/100% 100%` }} />一周安全趋
</div>
{/* <img src="/src/assets/panoramic/statistical/main_icon_textleft.png" ></img> */} {/* <img src="/src/assets/panoramic/statistical/main_icon_textleft.png" ></img> */}
<ReactEcharts option={this.getOptionsx(map)} className='echart-week' /> <ReactEcharts option={this.getOptionsx(map)} className="echart-week" />
</div> </div>
); );
} }
} }
SafetyIndexWeek.propTypes = {};
SafetyIndexWeek.propTypes = {
};
export default SafetyIndexWeek; export default SafetyIndexWeek;
...@@ -3,15 +3,14 @@ import PropTypes from 'prop-types'; ...@@ -3,15 +3,14 @@ import PropTypes from 'prop-types';
import { utils } from 'amos-tool'; import { utils } from 'amos-tool';
import { Markers } from 'amos-3d/lib/designer'; import { Markers } from 'amos-3d/lib/designer';
import formatUrl from 'amos-processor/lib/utils/urlFormat'; import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { EVENT_CONSTS } from 'amos-3d/lib/designer';
import { CONSTS } from './../../consts/storageConsts'; import { CONSTS } from './../../consts/storageConsts';
import PointDialog from './PointDialog'; import PointDialog from './PointDialog';
import { tirggerPlanTopic } from './../dataProcessor'; import { tirggerPlanTopic,tirggerTransTopic } from './../dataProcessor';
import { marker3DIoncMapper, markerTitleBgMapper } from './../../consts/imgStatic'; import { marker3DIoncMapper, markerTitleBgMapper } from './../../consts/imgStatic';
import { eventTopics, isPointEvent , isLevelFilter } from './../consts';
import { parseMarkers, parseLevelFilter, changeMarkerPosition } from '../dataProcessor';
const { EVENT_TYPE_CORE } = EVENT_CONSTS;
const getIcon = (markerType, level) => { const getIcon = (markerType, level) => {
// return marker3DIoncMapper[`${markerType}_${level}`];
if (markerType === 'riskSource' || markerType === 'patrol' || markerType === 'impEquipmentMode') { if (markerType === 'riskSource' || markerType === 'patrol' || markerType === 'impEquipmentMode') {
return marker3DIoncMapper[`${markerType}_${level}`]; return marker3DIoncMapper[`${markerType}_${level}`];
} }
...@@ -34,7 +33,13 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -34,7 +33,13 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
// marker 显隐 // marker 显隐
visible: PropTypes.bool, visible: PropTypes.bool,
markers: PropTypes.array, markers: PropTypes.array,
planStarted: PropTypes.bool planStarted: PropTypes.bool,
isEditMode: PropTypes.bool,
addMarker: PropTypes.func,
stagePilot: PropTypes.object,
subscribe: PropTypes.func,
selectPoints: PropTypes.object,
onCreated: PropTypes.func
}; };
constructor(props) { constructor(props) {
...@@ -42,28 +47,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -42,28 +47,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
this.markerList = {}; this.markerList = {};
this.markerEvents = { this.markerEvents = {
click: this.onMarkerClick, click: this.onMarkerClick,
// dblclick: this.onMarkerDblClick, dragend: this.markerDragend
dragend: this.markerDragend,
mouseover: (marker) => {
if (marker.object2DPipe){
marker.object2DPipe.pipeNode.visible = true;
marker.object2DPipe.pipeNode.elementVisible = true;
marker.object2DPipe.toggleDisplay(true);
}
if (!this.props.isEditMode) {
this.setTopCardConf(marker, marker.extData);
}
},
mouseout: (marker) => {
if (marker.object2DPipe){
marker.object2DPipe.pipeNode.visible = false;
marker.object2DPipe.pipeNode.elementVisible = false;
marker.object2DPipe.toggleDisplay(false);
}
if (!this.props.isEditMode) {
marker.baseObjHelper.title = null;
}
}
}; };
this.state = { this.state = {
isClick: true isClick: true
...@@ -72,19 +56,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -72,19 +56,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
componentWillMount = () => { componentWillMount = () => {
this.setState({ planStarted: this.props.planStarted }); this.setState({ planStarted: this.props.planStarted });
}; }
// componentDidMount() {
// this.props.subscribe(eventTopics.base3d_view, (topic, data) => {
// if (isPointEvent(topic)){
// parseMarkers(this, topic, data);
// } else if (isLevelFilter(topic)) {
// parseLevelFilter(this, topic, data);
// }
// });
// this.props.subscribe('base3d.fromws1.showFireTruckRoute', (topic, data) => {
// parseMarkers(this, topic, data);
// });
// }
componentWillReceiveProps = nextProps => { componentWillReceiveProps = nextProps => {
if (nextProps.isEditMode) { if (nextProps.isEditMode) {
this.markersCache.eachValue(obj => { this.markersCache.eachValue(obj => {
...@@ -95,7 +68,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -95,7 +68,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
}); });
} }
this.setState({ planStarted: nextProps.planStarted }); this.setState({ planStarted: nextProps.planStarted });
}; }
componentWillUnmount() { componentWillUnmount() {
this.objAnchorHelper && this.objAnchorHelper.destroy(); this.objAnchorHelper && this.objAnchorHelper.destroy();
...@@ -124,7 +97,6 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -124,7 +97,6 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
return false; return false;
} }
tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData }); tirggerPlanTopic(CONSTS.plan_detail, { type: marker.extData.type, data: marker.extData });
if (isClick) { if (isClick) {
this.setState({ isClick: false }); //将isClick 变成false,将不会执行处理事件 this.setState({ isClick: false }); //将isClick 变成false,将不会执行处理事件
// this.pdRef && this.pdRef.onOpenClick(marker); // this.pdRef && this.pdRef.onOpenClick(marker);
...@@ -138,11 +110,12 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -138,11 +110,12 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
that.setState({ isClick: true }); // 将isClick设置为true that.setState({ isClick: true }); // 将isClick设置为true
}, 1000); }, 1000);
}; };
setTwinkleConf = ( obj ) => {
const { twinkle,frequency } = obj.extData; setTwinkleConf = obj => {
let pulsePeriod = twinkle && frequency !== 0 ? 1 / frequency : null; const { twinkle, frequency } = obj.extData;
let pulsePeriod = twinkle && frequency !== 0 ? 1 / frequency : null;
let color = twinkle && frequency !== 0 ? '#FF0000' : null; let color = twinkle && frequency !== 0 ? '#FF0000' : null;
if (!obj.baseObjHelper.outlineHelper){ if (!obj.baseObjHelper.outlineHelper) {
obj.baseObjHelper.setOutlineHelper(this.outlineHelper); obj.baseObjHelper.setOutlineHelper(this.outlineHelper);
} }
obj.baseObjHelper.style.outlineColor = color; obj.baseObjHelper.style.outlineColor = color;
...@@ -152,8 +125,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -152,8 +125,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
}); });
}; };
setTopCardConf = (obj, extData )=>{ setTopCardConf = (obj, extData) => {
const { title , name } = extData; const { title, name } = extData;
let cardTitle = null; let cardTitle = null;
console.log(extData); console.log(extData);
obj.baseObjHelper.titleConfig = { obj.baseObjHelper.titleConfig = {
...@@ -182,6 +155,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -182,6 +155,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
// } // }
obj.baseObjHelper.title = cardTitle; obj.baseObjHelper.title = cardTitle;
}; };
markerDragend = (marker, evt) => { markerDragend = (marker, evt) => {
if (marker) { if (marker) {
console.log(marker.position); console.log(marker.position);
...@@ -190,8 +164,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -190,8 +164,8 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
} }
}; };
markerCreated = (data) => { markerCreated = (data) => {
let { isEditMode } = this.props; const { isEditMode } = this.props;
let { markersCache } = data; const { markersCache } = data;
if (markersCache.cacheMap.size > 0) { if (markersCache.cacheMap.size > 0) {
this.props.onCreated(data); this.props.onCreated(data);
} }
...@@ -199,16 +173,28 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -199,16 +173,28 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
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;
markersCache.eachValue(obj=>{ markersCache.eachValue(obj=>{
if (isEditMode){ const extData = obj.extData;
this.setTopCardConf(obj, obj.extData); if (isEditMode) {
this.setTopCardConf(obj, extData);
} }
if (obj.extData.type === 'riskSource' && markerType !== 'impEquipmentMode' && !isEditMode){ if (extData.type === 'riskSource' && markerType !== 'impEquipmentMode' && !isEditMode) {
this.setTwinkleConf(obj); this.setTwinkleConf(obj);
} }
// 鼠标移入
obj.node.on(EVENT_TYPE_CORE.MouseEnter, evt => {
if (!isEditMode) {
this.setTopCardConf(obj, extData);
}
});
// 鼠标移出
obj.node.on(EVENT_TYPE_CORE.MouseLeave, evt => {
if (!isEditMode) {
obj.baseObjHelper.title = null;
}
});
}); });
} }
buildMarkerOptions = (markers, markerType, defaultParams = {}) => { buildMarkerOptions = (markers, markerType, defaultParams = {}) => {
console.log(markers);
const { isEditMode } = this.props; const { isEditMode } = this.props;
if (!utils.isEmpty(markers)) { if (!utils.isEmpty(markers)) {
markers.forEach(m => { markers.forEach(m => {
...@@ -253,7 +239,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) { ...@@ -253,7 +239,7 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
return ( return (
<WrappedComponent> <WrappedComponent>
<Markers {...rest} draggable={isEditMode} markers={result} events={this.markerEvents} onCreated={this.markerCreated} /> <Markers {...rest} draggable={isEditMode} markers={result} events={this.markerEvents} onCreated={this.markerCreated} />
{!planStarted && <PointDialog style={dialogStyle} ref={node => (this.pdRef = node)} />} {!planStarted && <PointDialog style={dialogStyle} ref={node => this.pdRef = node} />}
</WrappedComponent> </WrappedComponent>
); );
} }
......
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