Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-station-module-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
amos-station-module-view
Commits
3361ed6d
Commit
3361ed6d
authored
Jun 17, 2020
by
张博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选择点闪烁
parent
1a4d9ff1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
117 deletions
+126
-117
amos.config.js
amos.config.js
+1
-1
index.json
...components/3dviewConvertor/threeres/models/shm/index.json
+1
-1
RightEditRegionPanel.js
...onvertor/view/moduleEditComponent/RightEditRegionPanel.js
+108
-113
marker3DFactory.js
...components/3dviewConvertor/view/points/marker3DFactory.js
+16
-2
No files found.
amos.config.js
View file @
3361ed6d
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
delayTime
:
10
// 屏保出现时间(单位:秒) 10s
delayTime
:
10
// 屏保出现时间(单位:秒) 10s
},
},
//三维模型配置 yinan 沂南站 shm 上海庙站 sn 苏南 hainan 海南站
//三维模型配置 yinan 沂南站 shm 上海庙站 sn 苏南 hainan 海南站
view3dFile
:
'/mods/components/3dviewConvertor/threeres/models/
shm/index_dev
.json'
,
view3dFile
:
'/mods/components/3dviewConvertor/threeres/models/
yinan/index
.json'
,
}
}
}
}
};
};
...
...
mods/components/3dviewConvertor/threeres/models/shm/index.json
View file @
3361ed6d
{
{
"sceneName"
:
"station-shanghai-temple"
,
"sceneName"
:
"station-shanghai-temple"
,
"basePath"
:
"
/threeres/models/shm/"
,
"basePath"
:
"/mods/components/3dviewConvertor
/threeres/models/shm/"
,
"models"
:
[
"models"
:
[
{
"objName"
:
"ground.obj"
,
"mtlName"
:
"ground.mtl"
,
"modelLevel"
:
"Park"
},
{
"objName"
:
"ground.obj"
,
"mtlName"
:
"ground.mtl"
,
"modelLevel"
:
"Park"
},
{
"objName"
:
"ji1diduanfatingshi.obj"
,
"mtlName"
:
"ji1diduanfatingshi.mtl"
,
"modelLevel"
:
"Building"
,
"foreignKey"
:
"valve-hall_01"
},
{
"objName"
:
"ji1diduanfatingshi.obj"
,
"mtlName"
:
"ji1diduanfatingshi.mtl"
,
"modelLevel"
:
"Building"
,
"foreignKey"
:
"valve-hall_01"
},
...
...
mods/components/3dviewConvertor/view/moduleEditComponent/RightEditRegionPanel.js
View file @
3361ed6d
import
React
,
{
Component
}
from
'react'
;
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
}
from
'../../services/moduleEditServices'
;
import
imgStatic
from
'../../consts/imgStatic'
;
import
imgStatic
from
'../../consts/imgStatic'
;
const
moduleEditIcon
=
imgStatic
.
moduleEditIcon
;
const
moduleEditIcon
=
imgStatic
.
moduleEditIcon
;
...
@@ -12,7 +12,6 @@ const Option = Select.Option;
...
@@ -12,7 +12,6 @@ const Option = Select.Option;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
const
RadioGroup
=
Radio
.
Group
;
const
RadioGroup
=
Radio
.
Group
;
@
eventConnect
@
eventConnect
class
RightEditRegionPanel
extends
Component
{
class
RightEditRegionPanel
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -20,40 +19,39 @@ class RightEditRegionPanel extends Component {
...
@@ -20,40 +19,39 @@ class RightEditRegionPanel extends Component {
this
.
state
=
{
this
.
state
=
{
form
:
{},
form
:
{},
rules
:
{},
rules
:
{},
treeDetailData
:[],
treeDetailData
:
[],
detailData
:
{},
detailData
:
{},
heightInput
:
0
heightInput
:
0
};
};
}
}
componentDidMount
()
{
componentDidMount
()
{
console
.
log
(
JSON
.
stringify
(
this
.
props
.
detailData
))
console
.
log
(
JSON
.
stringify
(
this
.
props
.
detailData
))
;
const
{
detailData
,
routePathData
}
=
this
.
props
;
const
{
detailData
,
routePathData
}
=
this
.
props
;
this
.
mergeDetailData
(
detailData
,
routePathData
);
this
.
mergeDetailData
(
detailData
,
routePathData
);
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{}
}
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
nextProps
)
console
.
log
(
nextProps
)
;
// if(this.props.detailData != nextProps.detailData || this.props.routePathData != nextProps.routePathData){
// if(this.props.detailData != nextProps.detailData || this.props.routePathData != nextProps.routePathData){
let
{
detailData
,
routePathData
}
=
nextProps
;
let
{
detailData
,
routePathData
}
=
nextProps
;
this
.
mergeDetailData
(
detailData
,
routePathData
);
this
.
mergeDetailData
(
detailData
,
routePathData
);
// }
// }
}
}
mergeDetailData
=
(
detailData
,
routePathData
)
=>
{
mergeDetailData
=
(
detailData
,
routePathData
)
=>
{
let
{
heightInput
}
=
this
.
state
;
let
{
heightInput
}
=
this
.
state
;
const
{
rightHeight
}
=
this
.
props
;
const
{
rightHeight
}
=
this
.
props
;
routePathData
&&
routePathData
.
forEach
(
r
=>
{
routePathData
&&
if
(
r
.
riskSourceId
===
detailData
.
id
){
routePathData
.
forEach
(
r
=>
{
detailData
.
routePath
=
r
.
routePath
;
if
(
r
.
riskSourceId
===
detailData
.
id
)
{
}
detailData
.
routePath
=
r
.
routePath
;
});
}
heightInput
=
detailData
&&
detailData
.
routePath
&&
detailData
.
routePath
!=
''
&&
JSON
.
parse
(
detailData
.
routePath
).
regionHeigth
||
rightHeight
;
});
heightInput
=
(
detailData
&&
detailData
.
routePath
&&
detailData
.
routePath
!=
''
&&
JSON
.
parse
(
detailData
.
routePath
).
regionHeigth
)
||
rightHeight
;
this
.
setState
({
detailData
,
heightInput
});
this
.
setState
({
detailData
,
heightInput
});
}
}
;
onChange
=
(
key
,
e
)
=>
{
onChange
=
(
key
,
e
)
=>
{
const
value
=
e
.
target
.
value
;
const
value
=
e
.
target
.
value
;
...
@@ -62,126 +60,122 @@ class RightEditRegionPanel extends Component {
...
@@ -62,126 +60,122 @@ class RightEditRegionPanel extends Component {
form
:
newForm
,
form
:
newForm
,
heightInput
:
value
heightInput
:
value
});
});
}
}
;
onNumberChange
=
(
value
)
=>
{
onNumberChange
=
value
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'positionZ'
:
value
});
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
positionZ
:
value
});
this
.
setState
({
this
.
setState
({
form
:
newForm
,
form
:
newForm
,
heightInput
:
value
heightInput
:
value
});
});
}
}
;
onRadioChange
=
(
value
)
=>
{
onRadioChange
=
value
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'isIndoor'
:
value
});
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
isIndoor
:
value
});
this
.
setState
({
this
.
setState
({
form
:
newForm
form
:
newForm
});
});
}
}
;
onHobbyChange
=
(
value
,
item
)
=>
{
onHobbyChange
=
(
value
,
item
)
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'level'
:
value
});
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
level
:
value
});
this
.
setState
({
this
.
setState
({
form
:
newForm
form
:
newForm
});
});
}
}
;
handleSubmit
=
(
e
)
=>
{
handleSubmit
=
e
=>
{
// e.preventDefault();
// e.preventDefault();
const
{
detailData
}
=
this
.
state
;
const
{
detailData
}
=
this
.
state
;
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
)
{
let
routePathData
=
[
{
let
routePathData
=
[
riskSourceId
:
detailData
.
id
,
{
routePath
:
JSON
.
stringify
({
riskSourceId
:
detailData
.
id
,
routePath
:
JSON
.
parse
(
detailData
.
routePath
).
routePath
,
routePath
:
JSON
.
stringify
({
regionHeigth
:
parseFloat
(
dataValues
.
positionZ
)
routePath
:
JSON
.
parse
(
detailData
.
routePath
).
routePath
,
})}]
regionHeigth
:
parseFloat
(
dataValues
.
positionZ
)
})
}
];
// this.props.saveRoutePath(routePathData)
// this.props.saveRoutePath(routePathData)
let
routePathDataNode
=
{
let
routePathDataNode
=
{
riskSourceId
:
detailData
.
id
,
riskSourceId
:
detailData
.
id
,
routePath
:
JSON
.
stringify
({
routePath
:
JSON
.
stringify
({
routePath
:
JSON
.
parse
(
detailData
.
routePath
).
routePath
,
routePath
:
JSON
.
parse
(
detailData
.
routePath
).
routePath
,
regionHeigth
:
parseFloat
(
dataValues
.
positionZ
)
regionHeigth
:
parseFloat
(
dataValues
.
positionZ
)
})
})
}
}
;
this
.
props
.
changeRoutePath
(
routePathDataNode
);
this
.
props
.
changeRoutePath
(
routePathDataNode
);
this
.
props
.
closeRightPanel
()
this
.
props
.
closeRightPanel
()
;
}
else
{
}
else
{
console
.
log
(
'error submit!!'
);
console
.
log
(
'error submit!!'
);
this
.
props
.
closeRightPanel
()
this
.
props
.
closeRightPanel
()
;
return
false
;
return
false
;
}
}
});
});
}
}
;
render
()
{
render
()
{
let
{
rules
,
form
,
pointTypeArr
,
pointType
,
detailData
,
heightInput
}
=
this
.
state
;
let
{
rules
,
form
,
pointTypeArr
,
pointType
,
detailData
,
heightInput
}
=
this
.
state
;
let
{
pageType
,
rightHeight
}
=
this
.
props
;
let
{
pageType
,
rightHeight
}
=
this
.
props
;
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
labelCol
:
{
xs
:
{
span
:
28
},
xs
:
{
span
:
28
},
sm
:
{
span
:
3
},
sm
:
{
span
:
3
},
className
:
'colspanlab'
className
:
'colspanlab'
}
}
}
}
;
return
(
return
(
<
div
className
=
"rightEditPanel"
>
<
div
className
=
"rightEditPanel"
>
<
div
className
=
'rightContainer'
>
<
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
=
'topForm'
>
<
div
className
=
"topForm"
>
<
div
className
=
'rightTitle'
>
<
div
className
=
"rightTitle"
>
<
img
src
=
{
moduleEditIcon
.
rightModalTitleIcon
}
alt
=
''
/>
<
img
src
=
{
moduleEditIcon
.
rightModalTitleIcon
}
alt
=
""
/>
<
span
className
=
'titleText'
>
风险区域信息
<
/span
>
<
span
className
=
"titleText"
>
风险区域信息
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
'baseMsg'
>
<
div
className
=
"baseMsg"
>
<
div
className
=
'moduleTitle'
>
<
div
className
=
"moduleTitle"
>
<
img
src
=
{
moduleEditIcon
.
rightBaseMsgIcon
}
alt
=
''
/>
<
img
src
=
{
moduleEditIcon
.
rightBaseMsgIcon
}
alt
=
""
/>
<
span
className
=
'titleText'
>
基本信息
<
/span
>
<
span
className
=
"titleText"
>
基本信息
<
/span
>
<
/div
>
<
div
className
=
"moduleContent"
>
<
div
className
=
"msgItem"
>
<
div
className
=
"itemLabel"
>
风险名称
<
/div
>
<
FormItem
field
=
"name"
>
<
Input
value
=
{
detailData
.
name
}
disabled
/>
<
/FormItem
>
<
/div
>
<
/div
>
<
div
className
=
'moduleContent'
>
<
div
className
=
"msgItem"
>
<
div
className
=
'msgItem'
>
<
div
className
=
"itemLabel"
>
参考编号
<
/div
>
<
div
className
=
'itemLabel'
>
风险名称
<
/div
>
<
FormItem
field
=
"code"
>
<
FormItem
field
=
"name"
>
<
Input
onChange
=
{
e
=>
this
.
onChange
(
'name'
,
e
)}
value
=
{
detailData
.
code
}
disabled
/>
<
Input
value
=
{
detailData
.
name
}
disabled
/>
<
/FormItem
>
<
/FormItem
>
<
/div
>
<
div
className
=
"msgItem"
>
<
/div
>
<
div
className
=
"itemLabel"
>
风险等级
<
/div
>
<
div
className
=
'msgItem'
>
<
FormItem
field
=
"level"
>
<
div
className
=
'itemLabel'
>
参考编号
<
/div
>
{
/* <Select value={form.level} onChange={this.onHobbyChange}>
<
FormItem
field
=
"code"
>
<
Input
onChange
=
{(
e
)
=>
this
.
onChange
(
'name'
,
e
)}
value
=
{
detailData
.
code
}
disabled
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
风险等级
<
/div
>
<
FormItem
field
=
"level"
>
{
/* <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
/>
<
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"
>
<
img
src
=
{
moduleEditIcon
.
right3dIcon
}
alt
=
''
/>
<
img
src
=
{
moduleEditIcon
.
right3dIcon
}
alt
=
""
/>
<
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
>
<
div
className
=
'position'
>
<
div
className
=
"position"
>
{
/* <div className='positionItem'>
{
/* <div className='positionItem'>
<FormItem label="长" field="positionX" {...formItemLayout}>
<FormItem label="长" field="positionX" {...formItemLayout}>
<Input value={detailData.ue4Location && detailData.ue4Location[0]} />
<Input value={detailData.ue4Location && detailData.ue4Location[0]} />
...
@@ -192,13 +186,15 @@ class RightEditRegionPanel extends Component {
...
@@ -192,13 +186,15 @@ class RightEditRegionPanel extends Component {
<Input value={detailData.ue4Location && detailData.ue4Location[1]} />
<Input value={detailData.ue4Location && detailData.ue4Location[1]} />
</FormItem>
</FormItem>
</div> */
}
</div> */
}
<
div
className
=
'positionItem'
>
<
div
className
=
"itemLabel"
>
高
<
/div
>
<
FormItem
label
=
"高"
field
=
"positionZ"
{...
formItemLayout
}
>
<
div
className
=
"positionItem"
>
<
InputNumber
<
FormItem
field
=
"positionZ"
{...
formItemLayout
}
>
placeholder
=
{
detailData
.
routePath
&&
JSON
.
parse
(
detailData
.
routePath
).
regionHeigth
||
rightHeight
}
<
InputNumber
value
=
{
heightInput
}
placeholder
=
{(
detailData
.
routePath
&&
JSON
.
parse
(
detailData
.
routePath
).
regionHeigth
)
||
rightHeight
}
min
=
{
0
}
value
=
{
heightInput
}
onChange
=
{(
e
)
=>
this
.
onNumberChange
(
e
)}
/
>
min
=
{
0
}
onChange
=
{
e
=>
this
.
onNumberChange
(
e
)}
/
>
{
/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */
}
{
/* <Input value={detailData.ue4Location && detailData.ue4Location[2]} /> */
}
<
/FormItem
>
<
/FormItem
>
<
/div
>
<
/div
>
...
@@ -207,24 +203,22 @@ class RightEditRegionPanel extends Component {
...
@@ -207,24 +203,22 @@ class RightEditRegionPanel extends Component {
<
/div
>
<
/div
>
<
/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
className
=
'cancelBtn'
className
=
"cancelBtn"
onClick
=
{()
=>
{
onClick
=
{()
=>
{
this
.
props
.
closeRightPanel
()
this
.
props
.
closeRightPanel
();
}}
><
/Button
>
}}
/
>
<
/div
>
<
/div
>
<
/Form
>
<
/Form
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
);
...
@@ -233,7 +227,8 @@ class RightEditRegionPanel extends Component {
...
@@ -233,7 +227,8 @@ class RightEditRegionPanel extends Component {
RightEditRegionPanel
.
propTypes
=
{
RightEditRegionPanel
.
propTypes
=
{
subscribe
:
PropTypes
.
func
,
subscribe
:
PropTypes
.
func
,
trigger
:
PropTypes
.
func
trigger
:
PropTypes
.
func
,
rightHeight
:
PropTypes
.
number
};
};
export
default
RightEditRegionPanel
;
export
default
RightEditRegionPanel
;
mods/components/3dviewConvertor/view/points/marker3DFactory.js
View file @
3361ed6d
...
@@ -61,9 +61,11 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
...
@@ -61,9 +61,11 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
componentWillReceiveProps
=
nextProps
=>
{
componentWillReceiveProps
=
nextProps
=>
{
if
(
nextProps
.
isEditMode
)
{
if
(
nextProps
.
isEditMode
)
{
this
.
markersCache
.
eachValue
(
obj
=>
{
this
.
markersCache
.
eachValue
(
obj
=>
{
// this.setTopCardConf(obj, obj.extData);
if
(
nextProps
.
selectPoints
.
type
===
obj
.
extData
.
type
&&
nextProps
.
selectPoints
.
id
===
obj
.
extData
.
id
)
{
if
(
nextProps
.
selectPoints
.
type
===
obj
.
extData
.
type
&&
nextProps
.
selectPoints
.
id
===
obj
.
extData
.
id
)
{
this
.
setTwinkleConf
(
obj
);
this
.
selectTwinkleConf
(
obj
,
1
,
'#FF0000'
);
}
else
{
this
.
selectTwinkleConf
(
obj
,
null
,
null
);
}
}
});
});
}
}
...
@@ -126,6 +128,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
...
@@ -126,6 +128,18 @@ export default function marker3DFactory(WrappedComponent = 'div', options) {
pulsePeriod
:
pulsePeriod
.
toFixed
(
2
)
pulsePeriod
:
pulsePeriod
.
toFixed
(
2
)
});
});
};
};
selectTwinkleConf
=
(
obj
,
mark
,
selectColor
)
=>
{
let
pulsePeriod
=
mark
;
let
color
=
selectColor
;
if
(
!
obj
.
baseObjHelper
.
outlineHelper
)
{
obj
.
baseObjHelper
.
setOutlineHelper
(
this
.
outlineHelper
);
}
obj
.
baseObjHelper
.
style
.
outlineColor
=
color
;
pulsePeriod
&&
obj
.
baseObjHelper
.
outlineHelper
.
setConfig
({
pulsePeriod
:
pulsePeriod
.
toFixed
(
2
)
});
};
setTopCardConf
=
(
obj
,
extData
)
=>
{
setTopCardConf
=
(
obj
,
extData
)
=>
{
const
{
title
,
name
}
=
extData
;
const
{
title
,
name
}
=
extData
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment