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

冲突

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