Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-convertor-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-convertor-view
Commits
ce38a085
Commit
ce38a085
authored
May 14, 2020
by
baoshuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑模式代码
parent
93c80a4f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
682 additions
and
93 deletions
+682
-93
arrow.png
src/assets/moduleEdit/arrow.png
+0
-0
bindedTip.png
src/assets/moduleEdit/bindedTip.png
+0
-0
cancelBtn.png
src/assets/moduleEdit/cancelBtn.png
+0
-0
editBtn.png
src/assets/moduleEdit/editBtn.png
+0
-0
msg.png
src/assets/moduleEdit/msg.png
+0
-0
noSaveTip.png
src/assets/moduleEdit/noSaveTip.png
+0
-0
nobindTip.png
src/assets/moduleEdit/nobindTip.png
+0
-0
sanwei.png
src/assets/moduleEdit/sanwei.png
+0
-0
saveBtn.png
src/assets/moduleEdit/saveBtn.png
+0
-0
moduleEdit.scss
src/styles/view/3dview/moduleEdit.scss
+24
-0
ModuleEdit.js
src/view/3dview/ModuleEdit.js
+0
-0
AreaLeftTree.js
src/view/3dview/moduleEditComponent/AreaLeftTree.js
+97
-77
PointLeftTree.js
src/view/3dview/moduleEditComponent/PointLeftTree.js
+248
-0
RightEditPointPanel.js
src/view/3dview/moduleEditComponent/RightEditPointPanel.js
+115
-14
RightEditRegionPanel.js
src/view/3dview/moduleEditComponent/RightEditRegionPanel.js
+198
-0
MarkerIcon.js
src/view/3dview/moduleEditPoints/MarkerIcon.js
+0
-2
No files found.
src/assets/moduleEdit/arrow.png
0 → 100644
View file @
ce38a085
145 Bytes
src/assets/moduleEdit/bindedTip.png
0 → 100644
View file @
ce38a085
514 Bytes
src/assets/moduleEdit/cancelBtn.png
0 → 100644
View file @
ce38a085
4.01 KB
src/assets/moduleEdit/editBtn.png
0 → 100644
View file @
ce38a085
467 Bytes
src/assets/moduleEdit/msg.png
0 → 100644
View file @
ce38a085
302 Bytes
src/assets/moduleEdit/noSaveTip.png
0 → 100644
View file @
ce38a085
496 Bytes
src/assets/moduleEdit/nobindTip.png
0 → 100644
View file @
ce38a085
366 Bytes
src/assets/moduleEdit/sanwei.png
0 → 100644
View file @
ce38a085
388 Bytes
src/assets/moduleEdit/saveBtn.png
0 → 100644
View file @
ce38a085
4.1 KB
src/styles/view/3dview/moduleEdit.scss
View file @
ce38a085
...
...
@@ -120,6 +120,14 @@
font-size
:
15px
;
}
}
.icon
{
margin-left
:
5px
;
vertical-align
:
middle
;
img
{
vertical-align
:
initial
;
margin-left
:
10px
;
}
}
}
.bottomBtns
{
padding-top
:
15px
;
...
...
@@ -153,8 +161,18 @@
background-color
:
rgba
(
10
,
53
,
62
,
0
.68
);
border
:
1px
solid
rgba
(
46
,
217
,
239
,
0
.59
);
padding
:
12px
;
color
:
#fff
;
.amos-form-item-label
{
color
:
#fff
;
}
.topForm
{
height
:
calc
(
100%
-
48px
);
.amos-input
{
width
:
100%
;
}
.amos-select
{
width
:
100%
;
}
}
}
.bottomBtns
{
...
...
@@ -172,6 +190,12 @@
background
:
url('/src/assets/moduleEdit/deleteBtn.png')
no-repeat
100%
100%
;
border
:
none
;
}
.cancelBtn
{
width
:
100px
;
height
:
33px
;
background
:
url('/src/assets/moduleEdit/cancelBtn.png')
no-repeat
100%
100%
;
border
:
none
;
}
}
}
...
...
src/view/3dview/ModuleEdit.js
View file @
ce38a085
This diff is collapsed.
Click to expand it.
src/view/3dview/moduleEditComponent/AreaLeftTree.js
View file @
ce38a085
...
...
@@ -28,13 +28,12 @@ class AreaLeftTree extends Component {
}
componentDidMount
()
{
// getAreaTreeAction().then(data => {
// console.log(data);
// this.setState({
// treeData:data || []
// })
// this.props.getAreaData(data || [])
// })
let
{
treeData
,
pointTypeArr
}
=
this
.
props
;
this
.
setState
({
treeData
,
pointTypeArr
,
pointType
:
pointTypeArr
[
0
]?
pointTypeArr
[
0
].
code
:
''
})
}
componentWillUnmount
()
{
...
...
@@ -50,11 +49,11 @@ class AreaLeftTree extends Component {
})
}
onSelectChange
=
(
value
,
item
)
=>
{
console
.
log
(
value
,
item
);
this
.
state
.
pointType
=
value
;
this
.
props
.
pointTypeChange
(
value
);
}
//
onSelectChange = (value, item) =>{
//
console.log(value, item);
//
this.state.pointType = value;
//
this.props.pointTypeChange(value);
//
}
onSearchChange
=
(
e
,
value
)
=>
{
console
.
log
(
e
,
value
);
this
.
setState
({
...
...
@@ -71,35 +70,42 @@ class AreaLeftTree extends Component {
autoExpandParent
:
false
});
}
onCheck
=
(
checkedKeys
,
e
)
=>
{
console
.
log
(
'onCheck'
,
checkedKeys
);
// console.log('onCheck', e);
let
currentKey
=
checkedKeys
.
checked
[
0
]?
checkedKeys
.
checked
[
checkedKeys
.
checked
.
length
-
1
]:
''
;
if
(
checkedKeys
.
checked
.
length
<
2
)
{
currentKey
=
checkedKeys
.
checked
[
0
]
}
else
{
if
(
checkedKeys
.
checked
[
0
]
==
this
.
state
.
checkedKeys
[
0
])
{
currentKey
=
checkedKeys
.
checked
[
1
]
}
else
{
currentKey
=
checkedKeys
.
checked
[
0
]
}
}
// checkedKeys[0] = checkedKeys[checkedKeys.length - 1]
this
.
setState
({
checkedKeys
:
currentKey
?[
currentKey
]:[]
});
this
.
props
.
selectItemChange
(
currentKey
);
if
(
currentKey
)
{
this
.
props
.
startDrow
(
currentKey
);
}
else
{
this
.
props
.
stopDrowing
()
}
}
// onTreeSelect = (selectedKeys, info) => {
// console.log('onSelect', info);
// this.setState({ selectedKeys });
// }
// onCheck = (checkedKeys,e) => {
// console.log('onCheck', checkedKeys);
// // console.log('onCheck', e);
// let currentKey = checkedKeys.checked[0]?checkedKeys.checked[checkedKeys.checked.length-1]:'';
// if (checkedKeys.checked.length<2) {
// currentKey = checkedKeys.checked[0]
// } else {
// if (checkedKeys.checked[0] == this.state.checkedKeys[0]) {
// currentKey = checkedKeys.checked[1]
// } else {
// currentKey = checkedKeys.checked[0]
// }
// }
// // checkedKeys[0] = checkedKeys[checkedKeys.length - 1]
// this.setState({ checkedKeys: currentKey?[currentKey]:[] });
// this.props.selectItemChange(currentKey);
// if (currentKey) {
// this.props.startDrow(currentKey);
// }else {
// this.props.stopDrowing()
// }
// }
drowArea
=
(
editItem
)
=>
{
}
onTreeSelect
=
(
selectedKeys
,
info
)
=>
{
console
.
log
(
'onSelect'
,
info
);
let
selectItem
=
info
.
node
.
props
.
dataRef
;
this
.
setState
({
selectedKeys
});
this
.
props
.
selectItemChange
(
selectItem
);
}
// onClick={(e)=>{e.nativeEvent.stopImmediatePropagation();e.stopPropagation();console.log(123123);}}
renderTreeNodes
=
(
data
)
=>
{
console
.
log
(
data
);
//
console.log(data);
if
(
data
.
length
>
0
)
{
return
data
.
map
((
item
)
=>
{
if
(
item
.
children
)
{
...
...
@@ -107,21 +113,34 @@ class AreaLeftTree extends Component {
<
TreeNode
title
=
{
<
div
>
{
item
.
isRegion
?
<
span
>
{
item
.
name
}
<
/span>
:
<
span
draggable
=
{
true
}
onDragStart
=
{()
=>
{
this
.
props
.
dragItemChange
(
item
)
{
<
span
>
{
item
.
name
}
<
span
className
=
'icon'
>
{
item
.
isBind
?
''
:
<
img
src
=
'/src/assets/moduleEdit/editBtn.png'
onClick
=
{(
e
)
=>
{
e
.
nativeEvent
.
stopImmediatePropagation
();
e
.
stopPropagation
();
this
.
props
.
startDrow
(
item
);
}}
>
{
item
.
name
}
<
/span>
}
/
>
}
{
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
item
.
routePath
?
<
img
src
=
'/src/assets/moduleEdit/noSaveTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
}
<
/span
>
<
/span
>
}
<
/div
>
}
key
=
{
item
.
id
}
dataRef
=
{
item
}
onDragStart
=
{()
=>
{
console
.
log
(
11
)
this
.
props
.
dragItemChange
(
item
)
}}
>
>
{
this
.
renderTreeNodes
(
item
.
children
)}
<
/TreeNode
>
);
...
...
@@ -130,18 +149,33 @@ class AreaLeftTree extends Component {
key
=
{
item
.
id
}
title
=
{
<
div
>
{
item
.
isRegion
?
<
span
>
{
item
.
name
}
<
/span>
:
<
span
draggable
=
{
true
}
onDragStart
=
{()
=>
{
this
.
props
.
dragItemChange
(
item
)
{
<
span
>
{
item
.
name
}
<
span
className
=
'icon'
>
{
item
.
isBind
?
''
:
<
img
src
=
'/src/assets/moduleEdit/editBtn.png'
onClick
=
{(
e
)
=>
{
e
.
nativeEvent
.
stopImmediatePropagation
();
e
.
stopPropagation
();
this
.
props
.
startDrow
(
item
);
}}
>
{
item
.
name
}
<
/span>
}
/
>
}
{
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
item
.
routePath
?
<
img
src
=
'/src/assets/moduleEdit/noSaveTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
}
<
/span
>
<
/span
>
}
<
/div
>
}
dataRef
=
{
item
}
{...
item
}
onClick
=
{()
=>
{
console
.
log
(
'aaa'
)}}
/>
;
});
}
...
...
@@ -149,10 +183,6 @@ class AreaLeftTree extends Component {
}
render
()
{
let
{
treeData
,
checkedKeys
,
pointTypeArr
,
pointType
}
=
this
.
state
;
let
{
pageType
}
=
this
.
props
;
...
...
@@ -160,28 +190,18 @@ class AreaLeftTree extends Component {
<
div
className
=
"leftTree"
>
<
div
className
=
'leftContainer'
>
<
div
className
=
'topForm'
>
{
pageType
==
'region'
?
''
:
<
Select
onChange
=
{
this
.
onSelectChange
}
defaultValue
=
{
pointType
}
className
=
'leftSelect'
>
{
pointTypeArr
.
map
(
item
=>
{
return
(
<
Option
value
=
{
item
.
code
}
>
{
item
.
name
}
<
/Option>
)
})
}
<
/Select
>
}
<
Search
className
=
'leftSearch'
icon
=
"search"
value
=
{
''
}
onChange
=
{
this
.
onSearchChange
}
onIconClick
=
{
this
.
onSearchChange
}
/
>
<
/div
>
<
div
className
=
'treeBox'
>
<
Tree
checkable
checkStrictly
selectable
=
{
fals
e
}
//
checkable
//
checkStrictly
selectable
=
{
tru
e
}
onExpand
=
{
this
.
onExpand
}
expandedKeys
=
{
this
.
state
.
expandedKeys
}
autoExpandParent
=
{
this
.
state
.
autoExpandParent
}
onCheck
=
{
this
.
onCheck
}
checkedKeys
=
{
checkedKeys
}
//
onCheck={this.onCheck}
//
checkedKeys={checkedKeys}
onSelect
=
{
this
.
onTreeSelect
}
selectedKeys
=
{
this
.
state
.
selectedKeys
}
blockNode
...
...
src/view/3dview/moduleEditComponent/PointLeftTree.js
0 → 100644
View file @
ce38a085
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
Connect
,
Modal
,
Tree
,
Select
,
Search
,
Button
}
from
'amos-framework'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
{
getAreaTreeAction
,
saveAreaDataAction
}
from
'../../../services/moduleEditServices'
const
eventConnect
=
Connect
.
eventConnect
;
const
TreeNode
=
Tree
.
TreeNode
;
const
Option
=
Select
.
Option
;
@
eventConnect
class
PointLeftTree
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
// showScreenSaver: false //是否打开屏保
expandedKeys
:
[],
autoExpandParent
:
true
,
checkedKeys
:
[],
selectedKeys
:
[],
treeData
:[],
pointTypeArr
:[],
pointType
:
''
};
}
componentDidMount
()
{
let
{
treeData
,
pointTypeArr
}
=
this
.
props
;
this
.
setState
({
treeData
,
pointTypeArr
,
pointType
:
pointTypeArr
[
0
]?
pointTypeArr
[
0
].
code
:
''
})
// console.log(this.props)
}
componentWillUnmount
()
{
}
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
nextProps
)
let
{
treeData
,
pointTypeArr
}
=
nextProps
;
this
.
setState
({
treeData
,
pointTypeArr
,
pointType
:
pointTypeArr
[
0
]?
pointTypeArr
[
0
].
code
:
''
})
}
onSelectChange
=
(
value
,
item
)
=>
{
console
.
log
(
value
,
item
);
this
.
state
.
pointType
=
value
;
this
.
props
.
pointTypeChange
(
value
);
}
onSearchChange
=
(
e
,
value
)
=>
{
console
.
log
(
e
,
value
);
this
.
setState
({
value
});
}
onExpand
=
(
expandedKeys
)
=>
{
console
.
log
(
'onExpand'
,
arguments
);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this
.
setState
({
expandedKeys
,
autoExpandParent
:
false
});
}
onCheck
=
(
checkedKeys
,
e
)
=>
{
console
.
log
(
'onCheck'
,
checkedKeys
,
e
);
this
.
setState
({
checkedPointsKeys
:
checkedKeys
});
this
.
props
.
selectPointChange
(
checkedKeys
);
}
renderTreeNodes
=
(
data
)
=>
{
// console.log(data);
if
(
data
.
length
>
0
)
{
return
data
.
map
((
item
)
=>
{
if
(
item
.
children
)
{
return
(
<
TreeNode
title
=
{
<
div
>
{
item
.
isRegion
?
<
span
>
{
item
.
name
}
<
span
className
=
'icon'
>
{
item
.
isRegion
?
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
:
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
item
.
position3d
?
<
img
src
=
'/src/assets/moduleEdit/noSaveTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
}
<
/span
>
<
/span>
:
<
span
draggable
=
{
true
}
onDragStart
=
{()
=>
{
this
.
props
.
dragItemChange
(
item
)
}}
>
{
item
.
name
}
<
span
className
=
'icon'
>
{
item
.
isRegion
?
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
:
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
item
.
position3d
?
<
img
src
=
'/src/assets/moduleEdit/noSaveTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
}
<
/span
>
<
/span>
}
<
/div
>
}
key
=
{
item
.
id
}
dataRef
=
{
item
}
onDragStart
=
{()
=>
{
console
.
log
(
11
)
this
.
props
.
dragItemChange
(
item
)
}}
>
{
this
.
renderTreeNodes
(
item
.
children
)}
<
/TreeNode
>
);
}
return
<
TreeNode
key
=
{
item
.
id
}
title
=
{
<
div
>
{
item
.
isRegion
?
<
span
>
{
item
.
name
}
<
span
className
=
'icon'
>
{
item
.
isRegion
?
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
:
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
item
.
position3d
?
<
img
src
=
'/src/assets/moduleEdit/noSaveTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
}
<
/span
>
<
/span>
:
<
span
draggable
=
{
true
}
onDragStart
=
{()
=>
{
this
.
props
.
dragItemChange
(
item
)
}}
>
{
item
.
name
}
<
span
className
=
'icon'
>
{
item
.
isRegion
?
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
:
item
.
isBind
?
<
img
src
=
'/src/assets/moduleEdit/bindedTip.png'
/>
:
item
.
position3d
?
<
img
src
=
'/src/assets/moduleEdit/noSaveTip.png'
/>
:
<
img
src
=
'/src/assets/moduleEdit/nobindTip.png'
/>
}
<
/span
>
<
/span>
}
<
/div
>
}
dataRef
=
{
item
}
{...
item
}
// onClick={() => {console.log('aaa')}}
/>
;
});
}
}
onTreeSelect
=
(
selectedKeys
,
info
)
=>
{
// e.nativeEvent.stopImmediatePropagation();
console
.
log
(
'onSelect'
,
info
);
let
selectItem
=
info
.
node
.
props
.
dataRef
;
this
.
setState
({
selectedKeys
});
this
.
props
.
selectPointChange
(
selectItem
)
}
render
()
{
let
{
treeData
,
checkedPointsKeys
,
pointTypeArr
,
pointType
}
=
this
.
state
;
let
{
pageType
}
=
this
.
props
;
console
.
log
(
treeData
)
console
.
log
(
this
.
props
)
return
(
<
div
className
=
"leftTree"
>
<
div
className
=
'leftContainer'
>
<
div
className
=
'topForm'
>
<
Select
onChange
=
{
this
.
onSelectChange
}
defaultValue
=
{
pointType
}
className
=
'leftSelect'
>
{
pointTypeArr
.
map
(
item
=>
{
return
(
<
Option
value
=
{
item
.
code
}
>
{
item
.
name
}
<
/Option>
)
})
}
<
/Select
>
<
Search
className
=
'leftSearch'
icon
=
"search"
value
=
{
''
}
onChange
=
{
this
.
onSearchChange
}
onIconClick
=
{
this
.
onSearchChange
}
/
>
<
/div
>
<
div
className
=
'treeBox'
>
<
Tree
// checkable
// checkStrictly
selectable
=
{
true
}
onExpand
=
{
this
.
onExpand
}
expandedKeys
=
{
this
.
state
.
expandedKeys
}
autoExpandParent
=
{
this
.
state
.
autoExpandParent
}
// onCheck={this.onCheck}
// checkedKeys={checkedPointsKeys}
onSelect
=
{
this
.
onTreeSelect
}
selectedKeys
=
{
this
.
state
.
selectedKeys
}
blockNode
>
{
this
.
renderTreeNodes
(
treeData
)}
<
/Tree
>
<
/div
>
<
div
className
=
'bottomBtns'
>
<
Button
className
=
'sureBtn'
onClick
=
{()
=>
{
this
.
props
.
savePointData
()
}}
><
/Button
>
<
Button
className
=
'deleteBtn'
onClick
=
{()
=>
{
this
.
props
.
deletePointBind
()
}}
><
/Button
>
<
/div
>
<
/div
>
<
/div
>
);
}
}
PointLeftTree
.
propTypes
=
{
subscribe
:
PropTypes
.
func
,
trigger
:
PropTypes
.
func
};
export
default
PointLeftTree
;
src/view/3dview/moduleEditComponent/RightEditPanel.js
→
src/view/3dview/moduleEditComponent/RightEditP
ointP
anel.js
View file @
ce38a085
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
Connect
,
Modal
,
Tree
,
Select
,
Search
,
Button
,
Input
}
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
{
getAreaTreeAction
,
saveAreaDataAction
}
from
'.
/.
./../../services/moduleEditServices'
import
{
getAreaTreeAction
,
saveAreaDataAction
}
from
'../../../services/moduleEditServices'
const
eventConnect
=
Connect
.
eventConnect
;
const
TreeNode
=
Tree
.
TreeNode
;
const
Option
=
Select
.
Option
;
const
FormItem
=
Form
.
Item
;
const
RadioGroup
=
Radio
.
Group
;
@
eventConnect
class
RightEditPanel
extends
Component
{
class
RightEditP
ointP
anel
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
form
:
{
},
rules
:{}
};
}
...
...
@@ -40,6 +45,25 @@ class RightEditPanel extends Component {
// })
}
onChange
=
(
key
,
e
)
=>
{
const
value
=
e
.
target
.
value
;
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
[
key
]:
value
});
this
.
setState
({
form
:
newForm
});
}
onRadioChange
=
(
value
)
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'isIndoor'
:
value
});
this
.
setState
({
form
:
newForm
});
}
onHobbyChange
=
(
value
,
item
)
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'level'
:
value
});
this
.
setState
({
form
:
newForm
});
}
...
...
@@ -47,13 +71,34 @@ class RightEditPanel extends Component {
handleSubmit
=
(
e
)
=>
{
// e.preventDefault();
this
.
form
.
validate
((
valid
,
dataValues
,
errors
)
=>
{
console
.
log
(
'返回内容:'
,
dataValues
,
valid
,
errors
);
if
(
valid
)
{
// AmosAlert.success('结果', JSON.stringify(dataValues));
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
}
render
()
{
let
{
treeData
,
checkedKeys
,
pointTypeArr
,
pointType
}
=
this
.
state
;
let
{
rules
,
form
,
pointTypeArr
,
pointType
}
=
this
.
state
;
let
{
pageType
}
=
this
.
props
;
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
28
},
sm
:
{
span
:
3
},
className
:
'colspanlab'
}
}
return
(
<
div
className
=
"rightEditPanel"
>
<
Form
className
=
"basic-demo"
ref
=
{
component
=>
this
.
form
=
component
}
model
=
{
form
}
rules
=
{
rules
}
>
<
div
className
=
'rightContainer'
>
<
div
className
=
'topForm'
>
<
div
className
=
'rightTitle'
>
...
...
@@ -61,53 +106,109 @@ class RightEditPanel extends Component {
<
span
className
=
'titleText'
>
风险点信息
<
/span
>
<
/div
>
<
div
className
=
'baseMsg'
>
<
div
className
=
'
bas
eTitle'
>
<
div
className
=
'
modul
eTitle'
>
<
span
className
=
'titleIcon'
><
/span
>
<
span
className
=
'titleText'
>
基本信息
<
/span
>
<
/div
>
<
div
className
=
'
bas
eContent'
>
<
div
className
=
'
modul
eContent'
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
风险名称
<
/div
>
<
FormItem
field
=
"name"
>
<
Input
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
参考编号
<
/div
>
<
Input
/>
<
FormItem
field
=
"code"
>
<
Input
onChange
=
{(
e
)
=>
this
.
onChange
(
'name'
,
e
)}
/
>
<
/FormItem
>
<
/div
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
风险等级
<
/div
>
<
Input
/>
<
FormItem
field
=
"level"
>
<
Select
value
=
{
form
.
level
}
onChange
=
{
this
.
onHobbyChange
}
>
<
Option
value
=
"1"
>
一级
<
/Option
>
<
Option
value
=
"2"
>
二级
<
/Option
>
<
Option
value
=
"3"
>
三级
<
/Option
>
<
Option
value
=
"4"
>
四级
<
/Option
>
<
Option
value
=
"5"
>
五级
<
/Option
>
<
/Select
>
<
/FormItem
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
'3dMsg'
>
<
div
className
=
'
bas
eTitle'
>
<
div
className
=
'
modul
eTitle'
>
<
span
className
=
'titleIcon'
><
/span
>
<
span
className
=
'titleText'
>
三维信息
<
/span
>
<
/div
>
<
div
className
=
'moduleContent'
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
三维坐标
<
/div
>
<
div
className
=
'position'
>
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"X"
field
=
"positionX"
{...
formItemLayout
}
>
<
InputNumber
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"Y"
field
=
"positionY"
{...
formItemLayout
}
>
<
InputNumber
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"Z"
field
=
"positionZ"
{...
formItemLayout
}
>
<
InputNumber
/>
<
/FormItem
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
楼层位置
<
/div
>
<
FormItem
field
=
"floorNum"
>
<
Input
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
是否位于室内
<
/div
>
<
FormItem
field
=
"isIndoor"
>
<
RadioGroup
defaultValue
=
"prop2"
onChange
=
{
value
=>
{
this
.
onRadioChange
(
value
)}}
>
<
Radio
value
=
"prop1"
>
是
<
/Radio
>
<
Radio
value
=
"prop2"
>
否
<
/Radio
>
<
/RadioGroup
>
<
/FormItem
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
'bottomBtns'
>
<
Button
className
=
'sureBtn'
onClick
=
{()
=>
{
// this.props.saveAreaData
()
this
.
handleSubmit
()
}}
><
/Button
>
<
Button
className
=
'
delete
Btn'
className
=
'
cancel
Btn'
onClick
=
{()
=>
{
// this.props.save()
}}
><
/Button
>
<
/div
>
<
/div
>
<
/Form
>
<
/div
>
);
}
}
RightEditPanel
.
propTypes
=
{
RightEditP
ointP
anel
.
propTypes
=
{
subscribe
:
PropTypes
.
func
,
trigger
:
PropTypes
.
func
};
export
default
RightEditPanel
;
export
default
RightEditP
ointP
anel
;
src/view/3dview/moduleEditComponent/RightEditRegionPanel.js
0 → 100644
View file @
ce38a085
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
Connect
,
Modal
,
Tree
,
Select
,
Search
,
Button
,
Input
,
InputNumber
,
Form
,
Radio
}
from
'amos-framework'
;
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
{
getAreaTreeAction
,
saveAreaDataAction
}
from
'../../../services/moduleEditServices'
const
eventConnect
=
Connect
.
eventConnect
;
const
TreeNode
=
Tree
.
TreeNode
;
const
Option
=
Select
.
Option
;
const
FormItem
=
Form
.
Item
;
const
RadioGroup
=
Radio
.
Group
;
@
eventConnect
class
RightEditRegionPanel
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
form
:
{
},
rules
:{}
};
}
componentDidMount
()
{
// getAreaTreeAction().then(data => {
// console.log(data);
// this.setState({
// treeData:data || []
// })
// this.props.getAreaData(data || [])
// })
}
componentWillUnmount
()
{
}
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
nextProps
)
let
{
treeData
,
pointTypeArr
}
=
nextProps
;
// this.setState({
// })
}
onChange
=
(
key
,
e
)
=>
{
const
value
=
e
.
target
.
value
;
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
[
key
]:
value
});
this
.
setState
({
form
:
newForm
});
}
onRadioChange
=
(
value
)
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'isIndoor'
:
value
});
this
.
setState
({
form
:
newForm
});
}
onHobbyChange
=
(
value
,
item
)
=>
{
const
newForm
=
Object
.
assign
({},
this
.
state
.
form
,
{
'level'
:
value
});
this
.
setState
({
form
:
newForm
});
}
handleSubmit
=
(
e
)
=>
{
// e.preventDefault();
this
.
form
.
validate
((
valid
,
dataValues
,
errors
)
=>
{
console
.
log
(
'返回内容:'
,
dataValues
,
valid
,
errors
);
if
(
valid
)
{
// AmosAlert.success('结果', JSON.stringify(dataValues));
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
}
render
()
{
let
{
rules
,
form
,
pointTypeArr
,
pointType
}
=
this
.
state
;
let
{
pageType
}
=
this
.
props
;
const
formItemLayout
=
{
labelCol
:
{
xs
:
{
span
:
28
},
sm
:
{
span
:
3
},
className
:
'colspanlab'
}
}
return
(
<
div
className
=
"rightEditPanel"
>
<
Form
className
=
"basic-demo"
ref
=
{
component
=>
this
.
form
=
component
}
model
=
{
form
}
rules
=
{
rules
}
>
<
div
className
=
'rightContainer'
>
<
div
className
=
'topForm'
>
<
div
className
=
'rightTitle'
>
<
span
className
=
'titleIcon'
><
/span
>
<
span
className
=
'titleText'
>
风险区域信息
<
/span
>
<
/div
>
<
div
className
=
'baseMsg'
>
<
div
className
=
'moduleTitle'
>
<
span
className
=
'titleIcon'
><
/span
>
<
span
className
=
'titleText'
>
基本信息
<
/span
>
<
/div
>
<
div
className
=
'moduleContent'
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
风险名称
<
/div
>
<
FormItem
field
=
"name"
>
<
Input
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
参考编号
<
/div
>
<
FormItem
field
=
"code"
>
<
Input
onChange
=
{(
e
)
=>
this
.
onChange
(
'name'
,
e
)}
/
>
<
/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
=
"2"
>
二级
<
/Option
>
<
Option
value
=
"3"
>
三级
<
/Option
>
<
Option
value
=
"4"
>
四级
<
/Option
>
<
Option
value
=
"5"
>
五级
<
/Option
>
<
/Select
>
<
/FormItem
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
'3dMsg'
>
<
div
className
=
'moduleTitle'
>
<
span
className
=
'titleIcon'
><
/span
>
<
span
className
=
'titleText'
>
三维信息
<
/span
>
<
/div
>
<
div
className
=
'moduleContent'
>
<
div
className
=
'msgItem'
>
<
div
className
=
'itemLabel'
>
三维坐标
<
/div
>
<
div
className
=
'position'
>
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"长"
field
=
"positionX"
{...
formItemLayout
}
>
<
InputNumber
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"宽"
field
=
"positionY"
{...
formItemLayout
}
>
<
InputNumber
/>
<
/FormItem
>
<
/div
>
<
div
className
=
'positionItem'
>
<
FormItem
label
=
"高"
field
=
"positionZ"
{...
formItemLayout
}
>
<
InputNumber
/>
<
/FormItem
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
'bottomBtns'
>
<
Button
className
=
'sureBtn'
onClick
=
{()
=>
{
this
.
handleSubmit
()
}}
><
/Button
>
<
Button
className
=
'cancelBtn'
onClick
=
{()
=>
{
// this.props.save()
}}
><
/Button
>
<
/div
>
<
/div
>
<
/Form
>
<
/div
>
);
}
}
RightEditRegionPanel
.
propTypes
=
{
subscribe
:
PropTypes
.
func
,
trigger
:
PropTypes
.
func
};
export
default
RightEditRegionPanel
;
src/view/3dview/moduleEditPoints/MarkerIcon.js
View file @
ce38a085
...
...
@@ -179,8 +179,6 @@ class MarkerIcon extends Component {
const
showLabel
=
disableLabel
(
markerType
);
let
animDur
=
(
twinkle
?
1
/
frequency
:
0
)
+
's'
;
console
.
log
(
'-------------'
)
console
.
log
(
this
.
props
)
if
(
showInfo
)
{
return
(
<
div
className
=
{
cls
}
style
=
{
style
}
onMouseLeave
=
{
this
.
onMouseLeave
}
onMouseOver
=
{
this
.
onMouseOver
}
>
...
...
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