Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
proland-bim-master
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
ReactNative
proland-bim-master
Commits
4c27e74c
提交
4c27e74c
authored
11月 28, 2018
作者:
吴强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#添加了toolBar,就是操作bim 模型的工具栏。费了我好大的功夫。慢慢摸索吧
#添加了一个组件,用来记录tag 标签,目前尚未完工。
上级
4c44e507
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
167 行增加
和
11 行删除
+167
-11
AddTagsForm.js
src/components/AddTagsForm.js
+91
-0
IndexPage.css
src/routes/IndexPage.css
+8
-0
IndexPage.js
src/routes/IndexPage.js
+68
-11
没有找到文件。
src/components/AddTagsForm.js
0 → 100644
浏览文件 @
4c27e74c
import
React
from
'react'
;
import
{
Button
,
Card
,
Form
,
Input
,
Select
}
from
'antd'
;
import
{
connect
}
from
'dva'
;
const
FormItem
=
Form
.
Item
;
class
AddTagsForm
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
};
}
handleSubmit
=
(
e
)
=>
{
e
.
preventDefault
();
this
.
props
.
form
.
validateFields
((
err
,
values
)
=>
{
});
};
render
()
{
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
return
(
<
Card
title
=
"标签登记"
headStyle
=
{{
textAlign
:
"Center"
}}
style
=
{{
width
:
350
}}
>
<
Form
onSubmit
=
{
this
.
handleSubmit
}
>
<
FormItem
label
=
"标签类型"
>
{
getFieldDecorator
(
'TagType'
,{
rules
:
[
{
required
:
true
,
whitespace
:
true
,
},
]
})(
<
Select
/>
)
}
<
/FormItem
>
<
FormItem
label
=
"标签名称"
>
{
getFieldDecorator
(
'TagName'
,{
rules
:
[
{
required
:
true
,
whitespace
:
true
,
},
]
})(
<
Input
/>
)
}
<
/FormItem
>
<
FormItem
label
=
"标签描述"
>
{
getFieldDecorator
(
'TagDescription'
,{
})(
<
Input
/>
)
}
<
/FormItem
>
<
FormItem
label
=
"标签位置"
>
{
getFieldDecorator
(
'TagPosition'
,{
rules
:
[
{
required
:
true
,
whitespace
:
true
,
},
]
})(
<
Input
/>
)
}
<
/FormItem
>
<
FormItem
label
=
"标签图标"
>
{
getFieldDecorator
(
'TagIcon'
,{
})(
<
Select
/>
)
}
<
/FormItem
>
<
FormItem
>
<
Button
type
=
"primary"
htmlType
=
"submit"
>
Search
<
/Button
>
<
Button
type
=
"primary"
>
取消
<
/Button
>
<
/FormItem
>
<
/Form
>
<
/Card
>
);
}
}
// 这里的写法一定要记清楚,不是Form.create(<AddTagsForm/>);写错之后无比的蛋疼
const
AddTagForm
=
Form
.
create
()(
AddTagsForm
);
export
default
connect
()(
AddTagForm
);
src/routes/IndexPage.css
浏览文件 @
4c27e74c
...
@@ -50,6 +50,14 @@ ul,li,button{
...
@@ -50,6 +50,14 @@ ul,li,button{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
}
}
.tagsForm
{
width
:
500px
;
height
:
auto
;
position
:
relative
;
z-index
:
9999
;
float
:
right
;
}
...
...
src/routes/IndexPage.js
浏览文件 @
4c27e74c
...
@@ -7,15 +7,17 @@ import SetModelColor from 'SetModelColor';
...
@@ -7,15 +7,17 @@ import SetModelColor from 'SetModelColor';
import
SetClickMode
from
'SetClickMode'
;
import
SetClickMode
from
'SetClickMode'
;
import
{
Button
,
Menu
,
Icon
,
Tooltip
}
from
'antd'
;
import
{
Button
,
Menu
,
Icon
,
Tooltip
}
from
'antd'
;
import
'../utils/OnClickPosition'
;
import
'../utils/OnClickPosition'
;
import
AddTagForm
from
'../components/AddTagsForm'
;
const
filesurl
=
'../../public/model/house1/house1List.json'
;
const
filesurl
=
'../../public/model/house1/house1List.json'
;
const
SubMenu
=
Menu
.
SubMenu
;
const
MenuItemGroup
=
Menu
.
ItemGroup
;
class
IndexPage
extends
React
.
Component
{
class
IndexPage
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
liVisible
:
false
};
this
.
state
=
{
liVisible
:
false
,
num
:
-
1
,
};
}
}
SetModelColor
=
()
=>
{
SetModelColor
=
()
=>
{
SetModelColor
(
'testtag1'
,
0
,
0
,
255
);
SetModelColor
(
'testtag1'
,
0
,
0
,
255
);
...
@@ -30,15 +32,19 @@ class IndexPage extends React.Component{
...
@@ -30,15 +32,19 @@ class IndexPage extends React.Component{
SetClickMode
(
0
);
SetClickMode
(
0
);
AddModel
(
filesurl
,
'testtag1'
);
AddModel
(
filesurl
,
'testtag1'
);
}
}
ModelSettingMenuClick
=
(
liVisible
)
=>
{
ModelSettingMenuClick
=
(
liVisible
,
num
)
=>
{
console
.
info
(
liVisible
);
console
.
info
(
liVisible
);
if
(
liVisible
===
true
)
{
if
(
liVisible
===
true
)
{
this
.
setState
({
liVisible
:
false
});
this
.
setState
({
liVisible
:
false
});
}
else
{
}
else
{
this
.
setState
({
liVisible
:
true
});
this
.
setState
({
liVisible
:
true
});
}
}
this
.
setState
({
num
:
num
});
};
// 添加标签 pos 是变迁
AddPositionFlag
=
()
=>
{
};
};
...
@@ -51,24 +57,70 @@ class IndexPage extends React.Component{
...
@@ -51,24 +57,70 @@ class IndexPage extends React.Component{
<
li
>
<
li
>
<
Tooltip
title
=
"模型颜色设置"
>
<
Tooltip
title
=
"模型颜色设置"
>
<
Button
type
=
"primary"
onClick
=
{
this
.
SetModelColor
}
>
<
Button
type
=
"primary"
onClick
=
{
this
.
SetModelColor
}
>
<
Icon
type
=
"mail"
><
/Icon
>
<
Icon
type
=
"mail"
/
>
<
/Button
>
<
/Button
>
<
/Tooltip
>
<
/Tooltip
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
Tooltip
title
=
"模型设置"
>
<
Tooltip
title
=
"模型设置"
>
<
Button
type
=
"primary"
onClick
=
{
this
.
ModelSettingMenuClick
.
bind
(
undefined
,
this
.
state
.
liVisible
)}
>
模型设置
<
/Button
>
<
Button
type
=
"primary"
onClick
=
{
this
.
ModelSettingMenuClick
.
bind
(
undefined
,
this
.
state
.
liVisible
,
1
)}
>
<
Icon
type
=
"mail"
/>
<
/Button
>
<
/Tooltip
>
<
/Tooltip
>
{
{
this
.
state
.
liVisible
&&
<
ul
className
=
{
styles
.
clearfix
}
>
this
.
state
.
num
===
1
&&
this
.
state
.
liVisible
&&
<
ul
className
=
{
styles
.
clearfix
}
>
<
li
>
<
li
>
<
Button
type
=
"primary"
>
查看模式
<
/Button
>
<
Tooltip
title
=
"显示模型"
>
<
Button
type
=
"primary"
>
<
Icon
type
=
"mail"
/>
<
/Button
>
<
/Tooltip
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
Button
type
=
"primary"
>
坐标拾取模式
<
/Button
>
<
Tooltip
title
=
"隐藏模型"
>
<
Button
type
=
"primary"
>
<
Icon
type
=
"mail"
/>
<
/Button
>
<
/Tooltip
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
Button
type
=
"primary"
onClick
=
{
this
.
SetClickMode
.
bind
(
undefined
,
'2'
)}
>
ID
拾取模式
<
/Button
>
<
Tooltip
title
=
"模型半透明"
>
<
Button
type
=
"primary"
>
<
Icon
type
=
"mail"
/>
<
/Button
>
<
/Tooltip
>
<
/li
>
<
li
>
<
Tooltip
title
=
"模型半透明恢复"
>
<
Button
type
=
"primary"
>
<
Icon
type
=
"mail"
/>
<
/Button
>
<
/Tooltip
>
<
/li
>
<
/ul
>
}
<
/li
>
<
li
>
<
Tooltip
title
=
"标签管理"
>
<
Button
type
=
"primary"
onClick
=
{
this
.
ModelSettingMenuClick
.
bind
(
undefined
,
this
.
state
.
liVisible
,
2
)}
>
<
Icon
type
=
"mail"
/>
<
/Button
>
<
/Tooltip
>
{
this
.
state
.
num
===
2
&&
this
.
state
.
liVisible
&&
<
ul
className
=
{
styles
.
clearfix
}
>
<
li
>
<
Tooltip
title
=
"添加标签"
placement
=
"right"
>
<
Button
type
=
"primary"
onClick
=
{
this
.
AddPositionFlag
}
>
<
Icon
type
=
"pushpin"
/>
<
/Button
>
<
/Tooltip
>
<
/li
>
<
li
>
<
Tooltip
title
=
"显示所有标签"
>
<
Button
type
=
"primary"
placement
=
"right"
>
<
Icon
type
=
"flag"
/>
<
/Button
>
<
/Tooltip
>
<
/li
>
<
/li
>
<
/ul
>
<
/ul
>
}
}
...
@@ -76,6 +128,11 @@ class IndexPage extends React.Component{
...
@@ -76,6 +128,11 @@ class IndexPage extends React.Component{
<
/ul
>
<
/ul
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
<
div
className
=
{
styles
.
tagsForm
}
>
<
AddTagForm
/>
<
/div
>
}
<
div
id
=
"webglContainer"
className
=
{
styles
.
webglContainer1
}
/
>
<
div
id
=
"webglContainer"
className
=
{
styles
.
webglContainer1
}
/
>
<
/div
>
<
/div
>
);
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论