Commit 801a2c12 authored by 单奇雲's avatar 单奇雲

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

parents 6b53e693 6a7e1c61
...@@ -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.63: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.63:8083/', convertorURI: 'http://172.16.3.122:8083/',
patrolURI: 'http://172.16.3.122:8082/', patrolURI: 'http://172.16.3.122:8082/',
rulesConfigURI: 'http://172.16.10.91:8080/', rulesConfigURI: 'http://172.16.10.91:8080/',
// plugin URI // plugin URI
......
...@@ -34,14 +34,19 @@ export const saveDesignAction = object => { ...@@ -34,14 +34,19 @@ export const saveDesignAction = object => {
export const getAreaTreeAction = () => { export const getAreaTreeAction = () => {
return commonGet(ModuleEditUrl.getAreaTreeUrl); return commonGet(ModuleEditUrl.getAreaTreeUrl);
} }
export const getAreaTreeDetailAction = (id) => {
return commonGet(`${ModuleEditUrl.getPointTreeDetailUrl}/${id}`);
}
export const getPointTreeDetailAction = (pointId, type ) => {
return commonGet(formatUrl(ModuleEditUrl.getPointTreeDetailUrl,{ pointId, type }));
}
export const getPointTreeAction = (type) => { export const getPointTreeAction = (type) => {
return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`); return commonGet(`${ModuleEditUrl.getPointTreeUrl}/${type}`);
} }
/** /**
* 保存区域 * 保存区域
* @param {*} routePathParams * @param {*} routePathParams
*/ */
export const saveAreaDataAction = (routePathParams) => { export const saveAreaDataAction = (routePathParams) => {
return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams); return commonPost(ModuleEditUrl.saveAreaDataUrl, routePathParams);
...@@ -52,8 +57,8 @@ export const getPointTypeAction = () => { ...@@ -52,8 +57,8 @@ export const getPointTypeAction = () => {
} }
/** /**
* 获取风险点 * 获取风险点
* @param {点类型} type * @param {点类型} type
* @param {区域id} riskSourceId * @param {区域id} riskSourceId
*/ */
export const getPointListAction = (type,riskSourceId) => { export const getPointListAction = (type,riskSourceId) => {
if (type) { if (type) {
...@@ -61,13 +66,13 @@ export const getPointListAction = (type,riskSourceId) => { ...@@ -61,13 +66,13 @@ export const getPointListAction = (type,riskSourceId) => {
} else { } else {
return commonGet(`${ModuleEditUrl.getPointListUrl}`); return commonGet(`${ModuleEditUrl.getPointListUrl}`);
} }
} }
/** /**
* 保存风险点 * 保存风险点
* @param {*} bindParams * @param {*} bindParams
*/ */
export const savePointListAction = (bindParams) => { export const savePointListAction = (bindParams) => {
return commonPost(ModuleEditUrl.savePointListUrl, bindParams); return commonPost(ModuleEditUrl.savePointListUrl, bindParams);
} }
\ No newline at end of file
...@@ -13,13 +13,11 @@ ...@@ -13,13 +13,11 @@
@import './actionbar.scss'; @import './actionbar.scss';
@import './moduleEdit.scss'; @import './moduleEdit.scss';
@import './searchpane.scss'; @import './searchpane.scss';
@import './reservePlan.scss';
@import './../assets/bizFont/iconfont.css'; @import './../assets/bizFont/iconfont.css';
@import './../assets/amosFont/iconfont.css'; @import './../assets/amosFont/iconfont.css';
.obj-loading-coms { .obj-loading-coms {
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -133,5 +131,3 @@ ...@@ -133,5 +131,3 @@
border-image-slice: 50 50 50 50; border-image-slice: 50 50 50 50;
border-image-repeat: stretch; border-image-repeat: stretch;
} }
...@@ -27,13 +27,15 @@ ...@@ -27,13 +27,15 @@
// border-image:linear-gradient(90deg,rgba(50,217,239,0) 2%,rgba(50,217,239,0.49) 29%,rgba(50,217,239,0.73) 73%,rgba(50,217,239,0) 100%); // border-image:linear-gradient(90deg,rgba(50,217,239,0) 2%,rgba(50,217,239,0.49) 29%,rgba(50,217,239,0.73) 73%,rgba(50,217,239,0) 100%);
} }
} }
.quipBtn {
width: 169px; .quipBtn {
height: 44px; width: 169px;
background: url('/mods/components/3dviewConvertor/assets/convertor/moduleEdit/quip.png') no-repeat 100% 100%; height: 44px;
margin-top: 10px; margin-top: 10px;
margin-left: 70px; margin-left: 70px;
} cursor: pointer;
background: url('/mods/components/3dviewConvertor/assets/convertor/moduleEdit/quip.png') no-repeat 100% 100%;
}
} }
.bottomBox { .bottomBox {
position: absolute; position: absolute;
...@@ -164,17 +166,46 @@ ...@@ -164,17 +166,46 @@
border: 1px solid rgba(46, 217, 239, 0.59); border: 1px solid rgba(46, 217, 239, 0.59);
padding: 12px; padding: 12px;
color: #fff; color: #fff;
.basic-demo{
height: calc(100% - 48px);
}
.amos-form-item-label { .amos-form-item-label {
color: #fff; color: #fff;
} }
.topForm { .topForm {
.rightTitle{
margin-left: -15px;
.titleText{
margin-left: 5px;
}
}
.amos-input{
background-color: rgba(4, 30, 36,0.4);
border-radius: 1px;
border: solid 1px rgba(46, 217, 239, 0.59);
font-size: 14px;
color:#fff;
}
.moduleTitle{
height: 50px;
display: flex;
align-items: center;
.titleText{
margin-left: 5px;
}
}
height: calc(100% - 48px); height: calc(100% - 48px);
padding-left: 20px;
.amos-input { .amos-input {
width: 100%; width: 100%;
} }
.amos-select { .amos-select {
width: 100%; width: 100%;
} }
.radio-text{
color:#fff
}
} }
} }
.bottomBtns { .bottomBtns {
......
...@@ -365,53 +365,54 @@ ...@@ -365,53 +365,54 @@
} }
} }
.reserve-plan-root{ .reserve-plan-root {
height: 80px; height: 80px;
.operate-button-root + .operate-button-root { .operate-button-root + .operate-button-root {
padding-left: 35px; padding-left: 35px;
margin-left: 20px; margin-left: 20px;
} }
%operate-button-root-common { %operate-button-root-common {
display: flex; display: flex;
align-items: center; align-items: center;
width: 250px; width: 250px;
} }
.operate-button-display-root{
.operate-button-display-root {
justify-content: center; justify-content: center;
} }
.operate-button-root{ .operate-button-root {
width: 250px; width: 250px;
justify-content: center; justify-content: center;
.operate-button-left{ .operate-button-left {
img{ img {
// width: 20px !important; // width: 20px !important;
// height: 20px !important // height: 20px !important
} }
.operate-button-content{ .operate-button-content {
margin-left: 5px; margin-left: 5px;
font-weight: 500; font-weight: 500;
line-height: 15px; line-height: 15px;
width: 170px; width: 170px;
.button-name{ .button-name {
font-size: 14px !important font-size: 14px !important
} }
.button-desc{ .button-desc {
font-size: 8px !important font-size: 8px !important
} }
} }
} }
.operate-button-right{ .operate-button-right {
width: 77px; width: 77px;
.operate-button-button{ .operate-button-button {
margin-left: 10px; margin-left: 10px;
width: 70px; width: 70px;
height: 31px; height: 31px;
...@@ -434,7 +435,7 @@ ...@@ -434,7 +435,7 @@
.quit-btn { .quit-btn {
margin-top: 10px; margin-top: 10px;
img{ img {
width: 17px width: 17px
} }
} }
......
.step-cxt-root {
z-index: 9;
.drawer-content {
width: $content-width;
height: 100%;
// background: $content-bg;
// border-radius: 1rem 1rem 0 0;
background-image: url('../assets/convertor/3dview/prePlan/zhixingtanchuang.png');
background-repeat: no-repeat;
-moz-background-size: 100% 100%;
background-size: 100% 100%;
.drawer-content-header {
display: flex;
height: $content-header-height;
font-size: 1.25rem;
line-height: 1.8;
align-items: center;
justify-content: space-between;
text-align: center;
.drawer-content-header-title {
display: inline-block;
// height: $content-header-height;
width: 87px;
margin: 0 auto;
font-family: 'PingFangSC-Semibold';
font-size: 15px;
font-weight: 600;
line-height: 26px;
color: white;
span {
margin-left: 0.5rem;
}
}
.drawer-content-header-close {
width: $content-header-height;
height: $content-header-height;
text-align: center;
cursor: pointer;
i {
font-size: 1.7rem;
line-height: 1.5;
color: red;
}
}
}
.drawer-content-body {
height: calc(100% - 4.5rem);
min-height: 3rem;
overflow: auto;
color: white;
}
::-webkit-scrollbar {
/* 隐藏滚轮 */
display: none;
}
}
}
%operate-button-root-common {
display: flex;
align-items: center;
width: 400px;
height: 65px;
justify-content: space-between;
.operate-button-left {
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
img{
width: 30px;
height: 30px;
}
.operate-button-content {
margin-left: 15px;
font-family: 'PingFangSC-Semibold';
font-weight: 600;
line-height: 26px;
color: white;
.button-name {
font-size: 15px;
}
.button-desc {
font-size: 10px;
}
}
}
.operate-button-right {
width: 91px;
.operate-button-button {
width: 91px;
height: 35px;
padding: 0 1rem;
color: white;
background-repeat: no-repeat;
background-size: 100% 100%;
border-radius: 4px;
opacity: 1;
}
.amos-btn + .amos-btn {
margin-left: 0;
}
:nth-child(2) {
margin-top: 2px;
}
}
}
.operate-button-root {
@extend %operate-button-root-common;
}
.operate-button-root + .operate-button-root {
padding-left: 19px;
margin-left: 19px;
border-left: 2px solid #13b1d4;
}
.step-cxt-line-root {
display: flex;
align-items: center;
height: 63px;
margin: 10px 15px 0;
margin-top: 10px;
justify-content: space-between;
background: linear-gradient(180deg, rgba(9, 65, 124, 1) 0%, rgba(0, 0, 0, 0) 100%);
border: 1px solid rgba(255, 195, 0, 1);
.step-cxt-line-left {
display: flex;
padding-left: 20px;
align-items: center;
flex: 0 0 40%;
}
.step-cxt-line-content {
margin-left: 15px;
font-size: 15px;
}
.step-cxt-line-right {
padding-right: 20px;
.operate-button-button {
width: 91px;
height: 35px;
padding: 0 8px;
color: white;
background-repeat: no-repeat;
background-size: 100% 100%;
opacity: 1;
}
}
}
.reserve-plan-root {
@extend %plan-border-img;
display: flex;
height: 100px;
align-items: center;
justify-content: center;
border-image: url('../assets/convertor/3dview/prePlan/jiaohuqu-duan.png');
}
.operate-button-display-root {
@extend %operate-button-root-common;
.render-spinner-stick {
width: 21px;
background: #ffc000;
}
}
...@@ -3,34 +3,41 @@ ...@@ -3,34 +3,41 @@
// height: 100%; // height: 100%;
// width: 100%; // width: 100%;
.statistical-left { .statistical-left {
position: absolute; position: absolute;
height: 100%; height: 100%;
width: 350px; width: 350px;
float: left; float: left;
z-index: 1; z-index: 1;
color: white; color: white;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.equipStatusList {
padding-left: 97px;
padding-top: 10px;
flex-grow: 1;
overflow-y: auto;
.title-child{
width: 100%;
height: 55px;
//margin-top: 5px;
}
.title-date{
height: 20px;
font-size: 13px;
}
.title-text{
font-size: 15px;
}
}
.equipStatusList{
padding-left: 97px;
padding-top: 10px;
flex-grow: 1;
.title-child{ ::-webkit-scrollbar {
width: 100%; /* 隐藏滚轮 */
height: 55px; display: none;
//margin-top: 5px; }
}
.title-date{
height: 20px;
font-size: 13px;
}
.title-text{
font-size: 15px;
}
}
.safetyExecuteList{ .safetyExecuteList{
flex: 2; flex: 2;
...@@ -114,7 +121,6 @@ ...@@ -114,7 +121,6 @@
width: 90%; width: 90%;
span{ span{
position: absolute;
margin-top: 3px; margin-top: 3px;
font-size: 14px; font-size: 14px;
color: rgba(255,255,255,1); color: rgba(255,255,255,1);
...@@ -156,9 +162,7 @@ ...@@ -156,9 +162,7 @@
height: 100%; height: 100%;
margin-left: 30px; margin-left: 30px;
margin-right: 20px; margin-right: 20px;
&:hover{ cursor: pointer;
background-color: rgba(199,223,245,0.3);
}
.content-item { .content-item {
margin: 5px; margin: 5px;
...@@ -473,56 +477,65 @@ ...@@ -473,56 +477,65 @@
text-align: right; text-align: right;
margin-top: 5px; margin-top: 5px;
margin-right: 3px; margin-right: 3px;
float: right;
// margin-top: 5px;
// margin-right: 3px;
img{ img{
cursor: pointer; cursor: pointer;
} }
} }
.model-line{
float: left;
display: inline;
width: 32%;
height: 88%;
text-align: center;
padding-left: 35px;
margin-top: 5px;
margin-left: 10px;
overflow: auto;
.model-title{
height: 30px;
font-size:16px;
color:rgba(240,223,45,1);
padding-top: 10px;
}
.model-content{
.content-div{ &-body {
min-width: 80px; display: flex;
min-height: 120px; height: calc(100% - 50px);
text-align: left;
padding-top: 20px;
.title{ .model-line {
height: 30px; height: 88%;
font-size: 16px; margin-top: 5px;
color:rgba(240,223,45,1); text-align: center;
} flex: 1;
.next-title{
padding-left: 5px; &-img {
} height: 30px;
.rows{ }
padding-left: 15px;
font-size: 14px; .model-title {
color:rgba(255,255,255,1); height: 30px;
.row{ font-size: 16px;
display: inline-block; color:rgba(240,223,45,1);
height: 28px; }
.model-content {
height: calc(100% - 60px);
padding-left: 10px;
overflow: auto;
.content-div {
min-width: 80px;
min-height: 120px;
padding-top: 20px;
text-align: left;
.title {
height: 30px;
font-size: 16px;
color:rgba(240,223,45,1);
} }
.date{
padding-left: 25px; .next-title {
padding-left: 5px;
}
.rows {
padding-left: 15px;
font-size: 14px;
color:rgba(255,255,255,1);
.row {
display: inline-block;
height: 28px;
}
.date {
padding-left: 25px;
}
} }
} }
} }
......
...@@ -98,7 +98,7 @@ class LayerPool extends Component { ...@@ -98,7 +98,7 @@ class LayerPool extends Component {
let wsURL = AmosConfig.wsURI.securityBaseURI + 'plan'; let wsURL = AmosConfig.wsURI.securityBaseURI + 'plan';
return ( return (
<div className="layer-pool"> <div className="layer-pool">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
<SidePane <SidePane
className={displayDetail ? 'precontrol-sidePlan-detail-display' : 'precontrol-sidePlan-detail'} className={displayDetail ? 'precontrol-sidePlan-detail-display' : 'precontrol-sidePlan-detail'}
left={false} left={false}
......
...@@ -51,7 +51,7 @@ class MaskContent extends Component { ...@@ -51,7 +51,7 @@ class MaskContent extends Component {
}; };
actionBarClick = ({ singleClick, type, label, showLabel }) => { actionBarClick = ({ singleClick, type, label, showLabel }) => {
if (!singleClick){//设置选中状态 if (!singleClick){//设置选中状态
this.setState({ activeAction: type }); this.setState({ activeAction: type });
} }
...@@ -91,6 +91,7 @@ class MaskContent extends Component { ...@@ -91,6 +91,7 @@ class MaskContent extends Component {
headerName, headerName,
errorAreaId errorAreaId
} = this.props; } = this.props;
alarmStarted && this.props.editModelChange(true);
const wsURL = completeToken(SysWsURL.rulews); const wsURL = completeToken(SysWsURL.rulews);
const controlAnimation = { const controlAnimation = {
animateName: 'zoom-comb-left', animateName: 'zoom-comb-left',
...@@ -121,12 +122,12 @@ class MaskContent extends Component { ...@@ -121,12 +122,12 @@ class MaskContent extends Component {
return ( return (
<div className="mask-content"> <div className="mask-content">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
{ sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />} { !alarmStarted && sideControlShow && <SideControl multiple={multiple} errorAreaId={errorAreaId} onItemClick={onItemClick} layerConfig={layerConfig} animationProps={controlAnimation} />}
{ sideControlShow && <DataPane animationProps={datapaneAnim} />} { !alarmStarted && sideControlShow && <DataPane animationProps={datapaneAnim} />}
<SearchPane visible={searchPaneVisible} changeSearchPaneVisible={() => this.changeSearchPaneVisible}/> { !alarmStarted && <SearchPane visible={searchPaneVisible} changeSearchPaneVisible={() => this.changeSearchPaneVisible} />}
<TopMsg alarmStart={alarmStart} /> <TopMsg alarmStart={alarmStart} />
{!isShowActionBar && <ModelHeader headerName={headerName} handleExceptModel={this.handleExceptModel} />} { !alarmStarted && !isShowActionBar && <ModelHeader animationProps={controlAnimation} headerName={headerName} handleExceptModel={this.handleExceptModel} />}
{isShowActionBar && <ActionBar activeAction={activeAction} onActionItemClick={(e) => this.actionBarClick(e)} animationProps={controlAnimation}/> } { !alarmStarted && isShowActionBar && <ActionBar activeAction={activeAction} onActionItemClick={(e) => this.actionBarClick(e)} animationProps={controlAnimation} /> }
{alarmStarted && <LayerPool animationProps={layerPoolAnimation} planStart={planStart} planQuit={planQuit} planStarted={planStarted} />} {alarmStarted && <LayerPool animationProps={layerPoolAnimation} planStart={planStart} planQuit={planQuit} planStarted={planStarted} />}
</div> </div>
); );
......
...@@ -200,6 +200,7 @@ class View3D extends Component { ...@@ -200,6 +200,7 @@ class View3D extends Component {
tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false }, dateTime: Date.now() }); tirggerTransTopic(CONSTS.forward, { details: { type: 'prePlan', show: false }, dateTime: Date.now() });
removeFireAlarm2(this); removeFireAlarm2(this);
this.cameraFactory.fitView(desigerHelperConfig.cameraEffect); this.cameraFactory.fitView(desigerHelperConfig.cameraEffect);
this.quitEditMode();
}; };
alarmStart = () => { alarmStart = () => {
...@@ -728,57 +729,55 @@ class View3D extends Component { ...@@ -728,57 +729,55 @@ class View3D extends Component {
} }
//选中区域变化 //选中区域变化
selectItemChange = (selectArea) => { selectItemChange = (selectArea) => {
console.log(selectArea);
this.state.selectArea = selectArea
this.setState({ this.setState({
selectArea: selectArea, selectArea,
showRightPanel: true showRightPanel: true
}) });
} }
//选中点变化 //选中点变化
selectPointChange = (selectPoints) => { selectPointChange = (selectPoints) => {
this.setState({ this.setState({
selectPoints: selectPoints, selectPoints,
showRightPanel: true showRightPanel: true
}) });
} }
getAreas = (treeData) => { getAreas = (treeData) => {
let { dragItem } = this.state; let { dragItem } = this.state;
// console.log(treeData) // console.log(treeData)
// let areas = []; // 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) {
if (item.children&&item.children.length > 0) { if (item.children && item.children.length > 0) {
if (dragItem) { if (dragItem) {
if ( dragItem.parentId && dragItem.parentId == item.id) { if ( dragItem.parentId && dragItem.parentId == item.id) {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}}/>) this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} else { } else {
this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}} />) this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} }
{this.getAreas(item.children)} {this.getAreas(item.children)}
} else { } else {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}} />) this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
{this.getAreas(item.children)} {this.getAreas(item.children)}
} }
}else { } else {
if (dragItem) { if (dragItem) {
if ( dragItem&&dragItem.parentId && dragItem.parentId == item.id) { if ( dragItem && dragItem.parentId && dragItem.parentId === item.id) {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}}/>) this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} else { } else {
this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}} />) this.areas.push(<PolygonRegion {...this.areaStyles.noDrop} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} }
} else { } else {
this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath?JSON.parse(item.routePath).routePath:''} onCreated={(e) => {this.onRegionCreated(e,item)}}/>) this.areas.push(<PolygonRegion {...this.areaStyles.normal} points={item.routePath ? JSON.parse(item.routePath).routePath : ''} onCreated={(e) => {this.onRegionCreated(e,item)}} />);
} }
} }
} else { } else {
if (item.children&&item.children.length > 0) { if (item.children && item.children.length > 0) {
{this.getAreas(item.children)} this.getAreas(item.children);
} }
} }
}); });
...@@ -789,29 +788,28 @@ class View3D extends Component { ...@@ -789,29 +788,28 @@ class View3D extends Component {
this.getAreas(this.state.treeData); this.getAreas(this.state.treeData);
return this.areas; return this.areas;
} }
onRegionCreated = (polygonRegion,item) => { onRegionCreated = (polygonRegion,item) => {
console.log(polygonRegion)
// console.log(polygonRegion.pointInPolygon)
this.polygonRegion[item.id] = polygonRegion; this.polygonRegion[item.id] = polygonRegion;
console.log(this.polygonRegion)
} }
//保存区域绑定 //保存区域绑定
saveAreaData = () => { saveAreaData = () => {
let { treeData, routePathData, pageType } = this.state; let { routePathData } = this.state;
let routePathParams = [];
console.log(routePathData)
saveAreaDataAction(routePathData).then(d => { saveAreaDataAction(routePathData).then(d => {
message.success('保存成功!'); message.success('保存成功!');
getAreaTreeAction().then(data => { getAreaTreeAction().then(data => {
console.log(data); console.log(data);
this.setState({ this.setState({
treeData:data || [] treeData: data || []
}) });
}); });
}, eer => { }, eer => {
message.error('保存失败!'); message.error('保存失败!');
}); });
} }
//保存点绑定 //保存点绑定
savePointData = () => { savePointData = () => {
let { markers } = this.state; let { markers } = this.state;
...@@ -823,14 +821,12 @@ class View3D extends Component { ...@@ -823,14 +821,12 @@ class View3D extends Component {
pointId: item[i].id, pointId: item[i].id,
pointType: item[i].type, pointType: item[i].type,
position3d: `${item[i].position.x},${item[i].position.y},${item[i].position.z}` position3d: `${item[i].position.x},${item[i].position.y},${item[i].position.z}`
}) });
} }
} }
savePointListAction(paramsArr).then(data => { savePointListAction(paramsArr).then(data => {
console.log(data); console.log(data);
}) });
} }
// 删除点绑定 // 删除点绑定
deletePointBind = () => { deletePointBind = () => {
...@@ -841,28 +837,28 @@ class View3D extends Component { ...@@ -841,28 +837,28 @@ class View3D extends Component {
pointId: selectPoints.id, pointId: selectPoints.id,
pointType: selectPoints.type, pointType: selectPoints.type,
position3d: `${selectPoints.position.x},${selectPoints.position.y},${selectPoints.position.z}` position3d: `${selectPoints.position.x},${selectPoints.position.y},${selectPoints.position.z}`
}) });
savePointListAction(pointParams).then(data => { savePointListAction(pointParams).then(data => {
console.log(data); console.log(data);
}) });
} }
} }
//删除区域 //删除区域
deleteAreaBind = () => { deleteAreaBind = () => {
let { selectArea,routePathData } = this.state; let { selectArea } = this.state;
if (selectArea) { if (selectArea) {
let areaParams = []; let areaParams = [];
areaParams.push({ areaParams.push({
riskSourceId: selectArea.id, riskSourceId: selectArea.id,
routePath: '' routePath: ''
}) });
saveAreaDataAction(areaParams).then(d => { saveAreaDataAction(areaParams).then(d => {
message.success('删除成功!'); message.success('删除成功!');
getAreaTreeAction().then(data => { getAreaTreeAction().then(data => {
console.log(data); console.log(data);
this.setState({ this.setState({
treeData:data || [] treeData: data || []
}) });
}); });
}, eer => { }, eer => {
message.error('删除失败!'); message.error('删除失败!');
...@@ -1000,6 +996,7 @@ class View3D extends Component { ...@@ -1000,6 +996,7 @@ class View3D extends Component {
this.getPointList(); this.getPointList();
} }
} }
simpleTipOk = () => { simpleTipOk = () => {
this.setState({ this.setState({
simpleTipVisible: false simpleTipVisible: false
...@@ -1203,13 +1200,13 @@ class View3D extends Component { ...@@ -1203,13 +1200,13 @@ class View3D extends Component {
const { markers } = this.state; const { markers } = this.state;
pointModelistAction(actionType).then(d =>{ pointModelistAction(actionType).then(d =>{
// if (markerType === 'fireResource') { // if (markerType === 'fireResource') {
markers['impEquipmentMode'] = d.filter(item => item.position != null); markers['impEquipmentMode'] = d.dataList.filter(item => item.position !== null);
// markers[markerType] = d; // markers[markerType] = d;
this.setState({ this.setState({
markers, markers,
markerType: "impEquipmentMode" markerType: "impEquipmentMode"
}); });
return; return;
}); });
} }
...@@ -1254,7 +1251,7 @@ class View3D extends Component { ...@@ -1254,7 +1251,7 @@ class View3D extends Component {
}; };
return exceptionAreas.map((area,index) =>{ return exceptionAreas.map((area,index) =>{
const { routePath: points = [] } = area.routePath; const { routePath: points = [] } = area.routePath;
return <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.onRectCreated(e,area,index)} />; return points.length > 0 && <PolygonRegion key={area.id} {...regionConf} points={points} onCreated={e=>this.onRectCreated(e,area,index)} />;
}); });
} }
...@@ -1305,7 +1302,7 @@ class View3D extends Component { ...@@ -1305,7 +1302,7 @@ class View3D extends Component {
headerName, headerName,
errorAreaId errorAreaId
} = this.state; } = this.state;
const { dimension, hiddenScreenSaver } = this.props; const { dimension, hiddenScreenSaver, editModelChange } = this.props;
const graphicProps = { const graphicProps = {
...dimension, ...dimension,
...desigerConf, ...desigerConf,
...@@ -1373,6 +1370,7 @@ class View3D extends Component { ...@@ -1373,6 +1370,7 @@ class View3D extends Component {
onActionItemClick={this.onActionItemClick} onActionItemClick={this.onActionItemClick}
errorAreaId={errorAreaId} errorAreaId={errorAreaId}
handleExceptModel={this.handleExceptModel} handleExceptModel={this.handleExceptModel}
editModelChange={editModelChange}
/> />
} }
modelContentProps={modelContentProps} modelContentProps={modelContentProps}
...@@ -1387,7 +1385,7 @@ class View3D extends Component { ...@@ -1387,7 +1385,7 @@ class View3D extends Component {
{editFlag && pageType === 'region' ? '' : <PointsPool markers={markers} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} />} {editFlag && pageType === 'region' ? '' : <PointsPool markers={markers} updateMarker={this.updateMarker} planStarted={alarmStarted} stagePilot={this.stagePilot} />}
{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} />
{this.renderAreas()} {editFlag && this.renderAreas()}
{this.renderPolygonRegion(exceptionAreas)} {this.renderPolygonRegion(exceptionAreas)}
{startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />} {startLoadExceptionArea && <ExceptionArea markers={exceptionMarkers} handleExceptModel={this.handleExceptModel} />}
</A3DDesigner> </A3DDesigner>
......
...@@ -12,9 +12,9 @@ export default class ModelHeader extends Component { ...@@ -12,9 +12,9 @@ export default class ModelHeader extends Component {
} }
render() { render() {
const { headerName } = this.props; const { animationProps, headerName } = this.props;
return ( return (
<div className='ModuleEditPage'> <div className='ModuleEditPage' {...animationProps}>
<div className='topBox'> <div className='topBox'>
<span className='editTitle'> <span className='editTitle'>
<span className='titleText'>{headerName}</span> <span className='titleText'>{headerName}</span>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { utils, Store } from 'amos-tool'; import { utils } from 'amos-tool';
import { Markers } from 'amos-3d/lib/designer'; import { Markers } from 'amos-3d/lib/designer';
import { connect3D } from 'amos-3d/lib/designer'; import { connect3D } from 'amos-3d/lib/designer';
import { BaseObjHelper } from 'base-r3d/lib/factory'; import { BaseObjHelper } from 'base-r3d/lib/factory';
import { safetyIndexIconMapper } from './../../consts/imgStatic'; import { safetyIndexIconMapper } from './../../consts/imgStatic';
const lsTool = Store.lsTool;
const getIcon = (exceptionType) => { const getIcon = (exceptionType) => {
return safetyIndexIconMapper[exceptionType]; return safetyIndexIconMapper[exceptionType];
}; };
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Connect, Modal, Tree, Select, Search, Button, Input,InputNumber, Form, Radio } from 'amos-framework'; import { Connect, Modal, Tree, Select, Search, Button, Input,InputNumber, Form, Radio } from 'amos-framework';
import * as endConf from 'amos-processor/lib/config/endconf'; import * as endConf from 'amos-processor/lib/config/endconf';
import { getAreaTreeAction,saveAreaDataAction } from '../../services/moduleEditServices' import { getAreaTreeAction,saveAreaDataAction,getPointTreeDetailAction } from '../../services/moduleEditServices'
const eventConnect = Connect.eventConnect; const eventConnect = Connect.eventConnect;
const TreeNode = Tree.TreeNode; const TreeNode = Tree.TreeNode;
...@@ -20,30 +20,38 @@ class RightEditPointPanel extends Component { ...@@ -20,30 +20,38 @@ class RightEditPointPanel extends Component {
form: { form: {
}, },
rules:{} rules:{},
detailData:[]
}; };
} }
componentDidMount() { componentDidMount() {
// getAreaTreeAction().then(data => { let {detailData}=this.props
// console.log(data);
// this.setState({ getPointTreeDetailAction(detailData.id,detailData.type).then(data => {
// treeData:data || [] console.log(data);
// }) this.setState({
// this.props.getAreaData(data || []) detailData: data || [],
// }) },err => {
console.log(err)
});
});
} }
componentWillUnmount() { componentWillUnmount() {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(nextProps) let {detailData}=this.props
let {treeData,pointTypeArr} = nextProps; getPointTreeDetailAction(detailData.id,detailData.type).then(data => {
// this.setState({ console.log(data);
this.setState({
// }) detailData: data || [],
},err => {
console.log(err)
});
});
} }
onChange = (key, e) => { onChange = (key, e) => {
const value = e.target.value; const value = e.target.value;
...@@ -67,10 +75,10 @@ class RightEditPointPanel extends Component { ...@@ -67,10 +75,10 @@ class RightEditPointPanel extends Component {
handleSubmit = (e) => { handleSubmit = (e) => {
// e.preventDefault(); // e.preventDefault();
this.form.validate((valid, dataValues, errors) => { this.form.validate((valid, dataValues, errors) => {
...@@ -85,8 +93,9 @@ class RightEditPointPanel extends Component { ...@@ -85,8 +93,9 @@ class RightEditPointPanel extends Component {
} }
render() { render() {
let { rules, form,pointTypeArr,pointType } = this.state; let { rules, form,pointTypeArr,pointType ,detailData} = this.state;
let { pageType } = this.props; let { pageType } = this.props;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 28 }, xs: { span: 28 },
...@@ -96,49 +105,51 @@ class RightEditPointPanel extends Component { ...@@ -96,49 +105,51 @@ class RightEditPointPanel extends Component {
} }
return ( return (
<div className="rightEditPanel"> <div className="rightEditPanel">
<div className='rightContainer'>
<Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}> <Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}>
<div className='rightContainer'>
<div className='topForm'> <div className='topForm'>
<div className='rightTitle'> <div className='rightTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightModalTitleIcon.png'/>
<span className='titleText'>风险点信息</span> <span className='titleText'>风险点信息</span>
</div> </div>
<div className='baseMsg'> <div className='baseMsg'>
<div className='moduleTitle'> <div className='moduleTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightBaseMsgIcon.png'/>
<span className='titleText'>基本信息</span> <span className='titleText'>基本信息</span>
</div> </div>
<div className='moduleContent'> <div className='moduleContent'>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险名称</div> <div className='itemLabel'>风险名称</div>
<FormItem field="name" > <FormItem field="name" >
<Input /> <Input value={detailData.name} disabled/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>参考编号</div> <div className='itemLabel'>参考编号</div>
<FormItem field="code" > <FormItem field="code" >
<Input <Input
onChange={(e) => this.onChange('name', e)} onChange={(e) => this.onChange('name', e)}
value={detailData.code}
disabled
/> />
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险等级</div> <div className='itemLabel'>风险等级</div>
<FormItem field="level" > <FormItem field="level" >
<Select value={form.level} onChange={this.onHobbyChange}> {/* <Select value={form.level} onChange={this.onHobbyChange}>
<Option value="1">一级</Option> <Option value="1">一级</Option>
<Option value="2">二级</Option> <Option value="2">二级</Option>
<Option value="3">三级</Option> <Option value="3">三级</Option>
<Option value="4">四级</Option> <Option value="4">四级</Option>
<Option value="5">五级</Option> <Option value="5">五级</Option>
</Select> </Select> */}
<Input value={detailData.level} disabled/>
</FormItem> </FormItem>
</div> </div>
</div> </div>
</div> </div>
...@@ -153,17 +164,17 @@ class RightEditPointPanel extends Component { ...@@ -153,17 +164,17 @@ class RightEditPointPanel extends Component {
<div className='position'> <div className='position'>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="X" field="positionX" {...formItemLayout}> <FormItem label="X" field="positionX" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[0]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="Y" field="positionY" {...formItemLayout}> <FormItem label="Y" field="positionY" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[1]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="Z" field="positionZ" {...formItemLayout}> <FormItem label="Z" field="positionZ" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[2]} />
</FormItem> </FormItem>
</div> </div>
</div> </div>
...@@ -171,16 +182,16 @@ class RightEditPointPanel extends Component { ...@@ -171,16 +182,16 @@ class RightEditPointPanel extends Component {
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>楼层位置</div> <div className='itemLabel'>楼层位置</div>
<FormItem field="floorNum" > <FormItem field="floorNum" >
<Input /> <Input value={detailData.floor3d} disabled/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>是否位于室内</div> <div className='itemLabel'>是否位于室内</div>
<FormItem field="isIndoor" > <FormItem field="isIndoor" >
<RadioGroup defaultValue="prop2" onChange={value => {this.onRadioChange(value)}}> <RadioGroup defaultValue="prop2" onChange={value => {this.onRadioChange(value)}}>
<Radio value="prop1"></Radio> <Radio className='radio-text' value="prop1"></Radio>
<Radio value="prop2"></Radio> <Radio className='radio-text' value="prop2"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</div> </div>
...@@ -188,19 +199,20 @@ class RightEditPointPanel extends Component { ...@@ -188,19 +199,20 @@ class RightEditPointPanel extends Component {
</div> </div>
</div> </div>
<div className='bottomBtns'> <div className='bottomBtns'>
<Button <Button
className='sureBtn' className='sureBtn'
onClick={() => { onClick={() => {
this.handleSubmit() this.handleSubmit()
}} ></Button> }} ></Button>
<Button <Button
className='cancelBtn' className='cancelBtn'
onClick={() => { onClick={() => {
// this.props.save() // this.props.save()
}} ></Button> }} ></Button>
</div> </div>
</div>
</Form> </Form>
</div>
</div> </div>
); );
} }
......
...@@ -20,29 +20,31 @@ class RightEditRegionPanel extends Component { ...@@ -20,29 +20,31 @@ class RightEditRegionPanel extends Component {
form: { form: {
}, },
rules:{} rules:{},
treeDetailData:[]
}; };
} }
componentDidMount() { componentDidMount() {
// getAreaTreeAction().then(data => { console.log(JSON.stringify(this.props.detailData))
// getAreaTreeDetailAction().then(data => {
// console.log(data); // console.log(data);
// this.setState({ // this.setState({
// treeData:data || [] // treeDetailData:data || []
// }) // })
// this.props.getAreaData(data || []) // this.props.getAreaData(data || [])
// }) // })
} }
componentWillUnmount() { componentWillUnmount() {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log(nextProps) console.log(nextProps)
let {treeData,pointTypeArr} = nextProps; let {treeData,pointTypeArr} = nextProps;
// this.setState({ // this.setState({
// }) // })
} }
onChange = (key, e) => { onChange = (key, e) => {
...@@ -67,16 +69,17 @@ class RightEditRegionPanel extends Component { ...@@ -67,16 +69,17 @@ class RightEditRegionPanel extends Component {
handleSubmit = (e) => { handleSubmit = (e) => {
// e.preventDefault(); // e.preventDefault();
this.form.validate((valid, dataValues, errors) => { this.form.validate((valid, dataValues, errors) => {
console.log('返回内容:', dataValues, valid, errors); console.log('返回内容:', dataValues, valid, errors);
if (valid) { if (valid) {
// AmosAlert.success('结果', JSON.stringify(dataValues)); //AmosAlert.success('结果', JSON.stringify(dataValues));
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
...@@ -85,8 +88,8 @@ class RightEditRegionPanel extends Component { ...@@ -85,8 +88,8 @@ class RightEditRegionPanel extends Component {
} }
render() { render() {
let { rules, form,pointTypeArr,pointType } = this.state; let { rules, form,pointTypeArr,pointType, } = this.state;
let { pageType } = this.props; let { pageType,detailData } = this.props;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 28 }, xs: { span: 28 },
...@@ -96,55 +99,57 @@ class RightEditRegionPanel extends Component { ...@@ -96,55 +99,57 @@ class RightEditRegionPanel extends Component {
} }
return ( return (
<div className="rightEditPanel"> <div className="rightEditPanel">
<div className='rightContainer'>
<Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}> <Form className="basic-demo" ref={component => this.form = component} model={form} rules={rules}>
<div className='rightContainer'>
<div className='topForm'> <div className='topForm'>
<div className='rightTitle'> <div className='rightTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightModalTitleIcon.png'/>
<span className='titleText'>风险区域信息</span> <span className='titleText'>风险区域信息</span>
</div> </div>
<div className='baseMsg'> <div className='baseMsg'>
<div className='moduleTitle'> <div className='moduleTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/rightBaseMsgIcon.png'/>
<span className='titleText'>基本信息</span> <span className='titleText'>基本信息</span>
</div> </div>
<div className='moduleContent'> <div className='moduleContent'>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险名称</div> <div className='itemLabel'>风险名称</div>
<FormItem field="name" > <FormItem field="name" >
<Input /> <Input value={detailData.name} disabled/>
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>参考编号</div> <div className='itemLabel'>参考编号</div>
<FormItem field="code" > <FormItem field="code" >
<Input <Input
onChange={(e) => this.onChange('name', e)} onChange={(e) => this.onChange('name', e)}
value={detailData.code}
disabled
/> />
</FormItem> </FormItem>
</div> </div>
<div className='msgItem'> <div className='msgItem'>
<div className='itemLabel'>风险等级</div> <div className='itemLabel'>风险等级</div>
<FormItem field="level" > <FormItem field="level" >
<Select value={form.level} onChange={this.onHobbyChange}> {/* <Select value={form.level} onChange={this.onHobbyChange}>
<Option value="1">一级</Option> <Option value="1">一级</Option>
<Option value="2">二级</Option> <Option value="2">二级</Option>
<Option value="3">三级</Option> <Option value="3">三级</Option>
<Option value="4">四级</Option> <Option value="4">四级</Option>
<Option value="5">五级</Option> <Option value="5">五级</Option>
</Select> </Select> */}
<Input value={detailData.level} disabled/>
</FormItem> </FormItem>
</div> </div>
</div> </div>
</div> </div>
<div className='3dMsg'> <div className='3dMsg'>
<div className='moduleTitle'> <div className='moduleTitle'>
<span className='titleIcon'></span> <img src='/mods/components/3dviewConvertor/assets/convertor/moduleEdit/right3dIcon.png'/>
<span className='titleText'>三维信息</span> <span className='titleText'>三维信息</span>
</div> </div>
<div className='moduleContent'> <div className='moduleContent'>
...@@ -153,17 +158,17 @@ class RightEditRegionPanel extends Component { ...@@ -153,17 +158,17 @@ class RightEditRegionPanel extends Component {
<div className='position'> <div className='position'>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="长" field="positionX" {...formItemLayout}> <FormItem label="长" field="positionX" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[0]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="宽" field="positionY" {...formItemLayout}> <FormItem label="宽" field="positionY" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[1]} />
</FormItem> </FormItem>
</div> </div>
<div className='positionItem'> <div className='positionItem'>
<FormItem label="高" field="positionZ" {...formItemLayout}> <FormItem label="高" field="positionZ" {...formItemLayout}>
<InputNumber /> <Input value={detailData.ue4Location && detailData.ue4Location[2]} />
</FormItem> </FormItem>
</div> </div>
</div> </div>
...@@ -172,19 +177,20 @@ class RightEditRegionPanel extends Component { ...@@ -172,19 +177,20 @@ class RightEditRegionPanel extends Component {
</div> </div>
</div> </div>
<div className='bottomBtns'> <div className='bottomBtns'>
<Button <Button
className='sureBtn' className='sureBtn'
onClick={() => { onClick={() => {
this.handleSubmit() this.handleSubmit()
}} ></Button> }} ></Button>
<Button <Button
className='cancelBtn' className='cancelBtn'
onClick={() => { onClick={() => {
// this.props.save() // this.props.save()
}} ></Button> }} ></Button>
</div> </div>
</div>
</Form> </Form>
</div>
</div> </div>
); );
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { safetyIndexDetailAction } from './../../../services/panoramicService'; import { safetyIndexDetailAction } from './../../../services/panoramicService';
import moment from 'moment'; import moment from 'moment';
const format = 'YYYY-MM-dd';
export default class ModelContent extends Component { export default class ModelContent extends Component {
...@@ -14,18 +14,10 @@ export default class ModelContent extends Component { ...@@ -14,18 +14,10 @@ export default class ModelContent extends Component {
} }
componentDidMount(){ componentDidMount(){
let { type } = this.props; const { type } = this.props;
this.safetyIndexDetail(type); this.safetyIndexDetail(type);
} }
safetyIndexDetail = (type) => {
safetyIndexDetailAction(type).then(data => {
this.setState({
alarmData: data
});
});
}
/** /**
* 获取标题 * 获取标题
* *
...@@ -41,6 +33,14 @@ export default class ModelContent extends Component { ...@@ -41,6 +33,14 @@ export default class ModelContent extends Component {
return titleParams[v]; return titleParams[v];
} }
safetyIndexDetail = (type) => {
safetyIndexDetailAction(type).then(data => {
this.setState({
alarmData: data
});
});
}
formatData = (str) => { formatData = (str) => {
let date = str.split(' ')[0]; let date = str.split(' ')[0];
return date; return date;
...@@ -63,12 +63,12 @@ export default class ModelContent extends Component { ...@@ -63,12 +63,12 @@ export default class ModelContent extends Component {
render() { render() {
let { alarmData } = this.state; let { alarmData } = this.state;
let { type } = this.props; const { type } = this.props;
return ( return (
<div className='model-content'> <div className='model-content'>
{(alarmData || []).map(item => { {(alarmData || []).map(item => {
return ( return (
<div className='content-div'> <div key={item.typeCode} className='content-div'>
<div className='title'> <div className='title'>
<span>|</span> <span>|</span>
<span className='next-title'>{ type === 'risk' ? this.getTitle(item.typeCode) : item.typeName }</span> <span className='next-title'>{ type === 'risk' ? this.getTitle(item.typeCode) : item.typeName }</span>
...@@ -81,3 +81,7 @@ export default class ModelContent extends Component { ...@@ -81,3 +81,7 @@ export default class ModelContent extends Component {
); );
} }
} }
ModelContent.propTypes = {
type: PropTypes.string
};
...@@ -81,7 +81,8 @@ export default class SafetyExecuteList extends Component { ...@@ -81,7 +81,8 @@ export default class SafetyExecuteList extends Component {
datas.map((item, index) => { datas.map((item, index) => {
return ( return (
<div key={item.id} className="title-child"> <div key={item.id} className="title-child">
<span className="title-text" >{item.label}</span> <span className="title-text" >{item.label}</span>&nbsp;&nbsp;
<span className="title-text" >{item.changeDate}</span>
</div> </div>
); );
}) })
......
...@@ -35,59 +35,59 @@ export default class SafetyIndex extends Component { ...@@ -35,59 +35,59 @@ export default class SafetyIndex extends Component {
const { safetyIndexData } = this.state; const { safetyIndexData } = this.state;
return { return {
tooltip: { tooltip: {
show:false show: false
}, },
toolbox: { toolbox: {
show:false, show: false,
feature: { feature: {
mark: {show: false}, mark: { show: false },
restore: {show: false}, restore: { show: false },
saveAsImage: {show: false} saveAsImage: { show: false }
} }
}, },
series: [ series: [
{ {
name: '今日安全指数', name: '今日安全指数',
type: 'gauge', type: 'gauge',
center: ['10%', '48%'], // 默认全局居中 center: ['10%', '48%'], // 默认全局居中
radius: '60%', radius: '60%',
min: 0, min: 0,
max: 100, max: 100,
endAngle: 90, endAngle: 90,
startAngle:-90, startAngle: -90,
splitNumber: 3, splitNumber: 3,
axisLine: { // 坐标轴线 axisLine: { // 坐标轴线
show:false, show: false,
lineStyle: { // 属性lineStyle控制线条样式 lineStyle: { // 属性lineStyle控制线条样式
color: [ color: [
[0.5, 'red'], [0.5, 'red'],
[0.9, 'Orange'], [0.9, 'Orange'],
[0.95, 'Gold'], [0.95, 'Gold'],
[1, '#00C3FF'] [1, '#00C3FF']
], ],
width: 0, width: 0,
opacity : 0 opacity: 0
} }
}, },
axisLabel: { // 坐标轴小标记 axisLabel: { // 坐标轴小标记
show:false show: false
}, },
axisTick: { // 坐标轴小标记 axisTick: { // 坐标轴小标记
show:false show: false
}, },
splitLine: { // 分隔线 splitLine: { // 分隔线
show:false show: false
}, },
pointer: { pointer: {
width: 5 width: 5
}, },
title: { title: {
show:false show: false
}, },
detail: { detail: {
show:false show: false
}, },
data: [{value: safetyIndexData.safetyIndex, name: '今日安全指数'}] data: [{ value: safetyIndexData.safetyIndex, name: '今日安全指数' }]
} }
] ]
} }
...@@ -103,19 +103,21 @@ export default class SafetyIndex extends Component { ...@@ -103,19 +103,21 @@ export default class SafetyIndex extends Component {
return ( return (
<div className='warnModal'> <div className='warnModal'>
<div className='close'> <div className='close'>
<img src={panoramicIcon.model_close} onClick={() => this.modelOpen(false)}></img> <img src={panoramicIcon.model_close} alt='' onClick={() => this.modelOpen(false)} />
</div> </div>
{warnController.map(item => { <div className='warnModal-body'>
return ( {warnController.map(item => {
<div className='model-line'> return (
<div> <div key={item.key} className='model-line'>
<img src={getIcon(item.icon)}></img> <div className='model-line-img'>
<img src={getIcon(item.icon)} alt='' />
</div>
<div className='model-title'>{item.label}</div>
<ModelContent type={item.type} />
</div> </div>
<div className='model-title'>{item.label}</div> );
<ModelContent type={item.type} /> })}
</div> </div>
);
})}
</div> </div>
); );
} }
...@@ -130,21 +132,21 @@ export default class SafetyIndex extends Component { ...@@ -130,21 +132,21 @@ export default class SafetyIndex extends Component {
<div className='safetyIndex-content' onClick={() => this.modelOpen(true)}> <div className='safetyIndex-content' onClick={() => this.modelOpen(true)}>
<div>今日安全指数 </div> <div>今日安全指数 </div>
<div className='safetyIndex-content-row'> <div className='safetyIndex-content-row'>
<div className='number-large'>{safetyIndexData.safetyIndex}</div> <div className='number-large'>{safetyIndexData.safetyIndex}</div>
<span className='number-unit'>&nbsp;&nbsp; <span className='number-unit'>&nbsp;&nbsp;
<img src={panoramicIcon.safetyup} className="row-up" alt="up" /> <img src={panoramicIcon.safetyup} className="row-up" alt="up" />
</span> </span>
</div> </div>
{ {
[{name:'风险值上升',num:safetyIndexData.riskExceptionNum}, [{ name: '风险异常',num: safetyIndexData.riskExceptionNum },
{name:'巡检不合格',num:safetyIndexData.checkExceptionNum}, { name: '巡检异常',num: safetyIndexData.checkExceptionNum },
{name:'火灾报警',num:safetyIndexData.fireExceptionNum}].map((item,index)=> { name: '故障告警',num: safetyIndexData.fireExceptionNum }].map((item,index)=>
<div className="content-item">{item.name} {item.num}</div> <div key={item.name} className="content-item">{item.name} {item.num}</div>
) )
} }
</div> </div>
<ReactEcharts className='safetyIndex-content-chart' option={this.getOption()}/> <ReactEcharts className='safetyIndex-content-chart' option={this.getOption()} />
{ modelVisable && this.renderWarnContent()} { modelVisable && this.renderWarnContent()}
</div> </div>
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 告警控制 * 告警控制
*/ */
export const warnController = [ export const warnController = [
{ key: 'fire', icon: 'model_fire', type: 'fire', label: '火灾告警' }, { key: 'equip', icon: 'model_fire', type: 'equip', label: '故障告警' },
{ key: 'risk', icon: 'model_risk', type: 'risk', label: '风险异常' }, { key: 'risk', icon: 'model_risk', type: 'risk', label: '风险异常' },
{ key: 'check', icon: 'model_patrol', type: 'check', label: '巡检异常' } { key: 'check', icon: 'model_patrol', type: 'check', 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