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
66fddfdb
Commit
66fddfdb
authored
Apr 10, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改页面展示逻辑
parent
044ada16
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
275 additions
and
92 deletions
+275
-92
urlConsts.js
src/consts/urlConsts.js
+3
-0
customRoutes.js
src/routes/customRoutes.js
+9
-2
index.js
src/routes/index.js
+12
-4
view.js
src/routes/view.js
+4
-2
preControlService.js
src/services/preControlService.js
+20
-2
leaderStruct.scss
src/styles/view/planMgmt/leaderStruct.scss
+29
-6
conf.js
src/view/planMgmt/common/conf.js
+4
-3
index.js
src/view/planMgmt/cusVizLib/index.js
+1
-1
PlanTreeView.js
src/view/planMgmt/treeView/PlanTreeView.js
+25
-7
index.js
src/view/planMgmt/view/index.js
+114
-36
index.js
src/view/planMgmt/view/leaderStruct/index.js
+43
-24
StageActuator.js
src/view/planMgmt/view/pubview/StageActuator.js
+1
-1
index.js
src/view/planMgmt/view/pubview/index.js
+8
-2
PlayMenuBar.js
src/view/planMgmt/view/pubview/play/PlayMenuBar.js
+1
-1
index.js
src/view/planMgmt/view/pubview/taskTabs/index.js
+1
-1
No files found.
src/consts/urlConsts.js
View file @
66fddfdb
...
...
@@ -207,6 +207,8 @@ export const FasSerUrl = {
contingencyWaterUrl
:
completePrefix
(
baseURI
,
'/api/risksource/contingency/water'
),
configPointEquipmentUrl
:
completePrefix
(
baseURI
,
'api/firequment/point/batch/bindToEquipment?deviceId={deviceId}&pointIds={pointIds}'
),
getPlanTreeUrl
:
completePrefix
(
baseURI
,
'api/visual/plan/tree'
),
//获取预案树url
getTextPlanTreeUrl
:
completePrefix
(
baseURI
,
'api/visual/plan/textPlanTree/{appId}'
),
//获取预案树url
deleteTextPlanUrl
:
completePrefix
(
baseURI
,
'api/visual/plan/textPlan/{id}'
),
//删除预案url
importExcelFireEquipmentUrl
:
completePrefix
(
baseURI
,
'api/excel/import/fireEquipment'
),
//导入消防设备
importExcelDataUrl
:
completePrefix
(
baseURI
,
'api/excel/import/data/excel/{type}'
),
//导入excel数据type=['fireResource','water']
importExcelFireEquipmentPointUrl
:
completePrefix
(
baseURI
,
'api/excel/import/fireEquipmentPoint'
),
...
...
@@ -221,6 +223,7 @@ export const FasSerUrl = {
getAllUserUrl
:
completePrefix
(
baseURI
,
'api/common/user/list'
),
//获取所有用户
queryFmeaControlObjUrl
:
completePrefix
(
baseURI
,
'api/riskModel/fmea/{ids}/controlObjCount'
),
//根据fmea id查询关联对象个数
queryTopographyUrl
:
completePrefix
(
baseURI
,
'api/Topography/query/{type}/{appId}'
),
//获取Topo图数据
queryTopographyByTypeUrl
:
completePrefix
(
baseURI
,
'api/Topography/query/{type}'
),
//获取Topo图数据 type
updateTopographyUrl
:
completePrefix
(
baseURI
,
'api/Topography/updateTopo'
),
//更新Topo图数据
queryNodeDetailUrl
:
completePrefix
(
baseURI
,
'api/Topography/detail/{id}'
),
//获取node节点详情
saveNodeDetailUrl
:
completePrefix
(
baseURI
,
'api/Topography/detail'
),
//保存nodeDetail详情
...
...
src/routes/customRoutes.js
View file @
66fddfdb
...
...
@@ -12,6 +12,7 @@ import PlanDrill from './../view/planMgmt/view/PlanDrill';
import
LeaderStruct
from
'./../view/planMgmt/view/leaderStruct'
;
import
PubView
from
'./../view/planMgmt/view/pubview'
;
import
PublishView
from
'./../view/planMgmt/view'
;
/**
...
...
@@ -27,11 +28,17 @@ export const customRoutes = [
{
path
:
'differentiateDetail'
,
parent
:
'biz'
,
component
:
DifferentiateDetail
},
{
path
:
'leaderStruct'
,
parent
:
'biz'
,
component
:
LeaderStruct
},
// { path: 'pubview', parent: 'planDrill', component: PlanDrill },
{
path
:
'pubview'
,
parent
:
'planDrill'
,
component
:
PubView
},
{
path
:
'textview'
,
parent
:
'planDrill'
,
component
:
TextPlan
},
//
{ path: 'pubview', parent: 'planDrill', component: PubView },
//
{ path: 'textview', parent: 'planDrill', component: TextPlan },
...
parseCusotmRoutes
()
];
export
const
planChildrenRoutes
=
{
path
:
'planDrill'
,
component
:
PublishView
,
childRoutes
:
[
{
path
:
'pubview'
,
component
:
PubView
},
{
path
:
'textview'
,
component
:
TextPlan
}
]};
/**
* path mapping
...
...
src/routes/index.js
View file @
66fddfdb
...
...
@@ -7,7 +7,7 @@ import routerFilter, { checkLogin } from 'amos-security/lib/routes/validateRoute
import
PublishView
from
'./../view/planMgmt/view'
;
import
AutoLogin
from
'./../view/autoLogin/AutoLogin'
;
import
calcRoutes
from
'./calcRoutes'
;
import
addCustomRoutes
,
{
customRoutes
,
customRoutesPubView
}
from
'./customRoutes'
;
import
addCustomRoutes
,
{
customRoutes
,
planChildrenRoutes
}
from
'./customRoutes'
;
import
pageCompontent
,
{
RootView
,
Login
,
...
...
@@ -19,7 +19,8 @@ import pageCompontent, {
import
Iot3DGraphBiz
from
'./../view/planMgmt/iot3DGraph'
;
import
ShareTextPlan
from
'./../view/planMgmt/view/ShareTextPlan'
;
import
PubView
from
'./../view/planMgmt/view/pubview'
;
import
TextPlan
from
'./../view/planMgmt/view/TextPlan'
;
const
groups
=
[
'main'
,
'biz'
,
'console'
,
'ruleConfig'
...
...
@@ -34,7 +35,12 @@ const injectRoutes = menus => {
{
path
:
'viz3d/:subjectId'
,
component
:
Iot3DGraphBiz
},
},
// {
// path: 'viz3dpub',
// component: PublishView,
// childRoutes: [...customRoutesPubView]
// },
{
path
:
'login'
,
component
:
Login
},
{
path
:
'autologin'
,
component
:
AutoLogin
},
{
path
:
'region'
,
component
:
RegionList
},
// 区域选择
...
...
@@ -51,7 +57,9 @@ const injectRoutes = menus => {
{
path
:
'biz'
,
component
:
RootBizView
,
childRoutes
:
[...
bizChilds
,
...
customRoutes
]
childRoutes
:
[...
bizChilds
,
...
customRoutes
,
planChildrenRoutes
]
},
{
path
:
'console'
,
...
...
src/routes/view.js
View file @
66fddfdb
...
...
@@ -55,6 +55,7 @@ import CusVizLib from './../view/planMgmt/cusVizLib';
import
RealTimeMonitor
from
'./../view/morphic'
;
import
PublishView
from
'./../view/planMgmt/view'
;
import
ModelManage
from
'./../view/planMgmt/modelManage'
;
import
LeaderStruct
from
'./../view/planMgmt/view/leaderStruct'
;
const
Routes
=
{
// 添加 rules 路由
...
...
@@ -108,8 +109,9 @@ const Routes = {
alarmVideoMonitor
:
AlarmVideoMonitor
,
alarmTest
:
alarmTestView
,
vizlib
:
CusVizLib
,
planDrill
:
PublishView
,
modelManage
:
ModelManage
// planDrill: PublishView,
modelManage
:
ModelManage
,
leaderStruct
:
LeaderStruct
};
const
pageCompontent
=
key
=>
{
...
...
src/services/preControlService.js
View file @
66fddfdb
...
...
@@ -202,6 +202,13 @@ export const queryTopographyAction = (type,appId) => {
};
/**
* 获取节点by type
*/
export
const
queryTopographyByTypeAction
=
(
type
)
=>
{
return
commonGet
(
formatUrl
(
FasSerUrl
.
queryTopographyByTypeUrl
,{
type
}));
};
/**
* 更新节点
*/
export
const
updateTopographyAction
=
(
params
)
=>
{
...
...
@@ -227,4 +234,16 @@ export const nodeDetailTopoSaveAction = (nodeDatil) => {
*/
export
const
deleteTopoAction
=
(
id
,
type
)
=>
{
return
commonDelete
(
formatUrl
(
FasSerUrl
.
deleteTopoUrl
,
{
id
,
type
}));
};
\ No newline at end of file
};
/**
* 获取指定预案文件
*/
export
const
getTextPlanTreeAction
=
(
appId
)
=>
{
return
commonGet
(
formatUrl
(
FasSerUrl
.
getTextPlanTreeUrl
,
{
appId
}));
};
/**
* 删除预案文件
*/
export
const
deleteTextPlanAction
=
(
id
)
=>
{
return
commonDelete
(
formatUrl
(
FasSerUrl
.
deleteTextPlanUrl
,
{
id
}));
};
src/styles/view/planMgmt/leaderStruct.scss
View file @
66fddfdb
...
...
@@ -12,25 +12,47 @@
border-width
:
1px
;
justify-content
:
space-between
;
align-items
:
center
;
.tool-bar-button
{
vertical-align
:
baseline
;
}
.header-left
{
flex-grow
:
1
;
line-height
:
42px
;
.tool-bar-button
{
vertical-align
:
baseline
;
}
.header-name
{
padding-left
:
20px
;
font-size
:
15px
;
}
.header-add-button
{
float
:
right
;
padding-right
:
15px
;
.leader-struct-add-button
{
width
:
8
.5rem
;
height
:
2
.5rem
;
color
:
black
;
padding
:
0px
;
background-color
:
#f8f8f8
;
border-color
:
#c6c6c6
;
border
:
1px
solid
#ccc
;
vertical-align
:
baseline
;
}
}
}
.tool-bar-root
{
float
:
right
;
margin-right
:
5px
;
width
:
300px
;
.amos-button-bar-group
{
float
:
right
;
}
}
}
.leader-struct-content
{
...
...
@@ -50,7 +72,8 @@
}
.leader-struct-diagram
{
height
:
90%
;
// height: 90%;
height
:
100%
;
}
.tooltip-content
{
...
...
src/view/planMgmt/common/conf.js
View file @
66fddfdb
export
const
headerButton
=
[
//
{ key: 'back', text: '返回', icon: 'fanhui' },
{
key
:
'onOff'
,
text
:
'显示窗'
,
icon
:
'yuan1'
},
{
key
:
'planDrill'
,
text
:
'预案演练'
,
icon
:
'yuan1'
},
{
key
:
'back'
,
text
:
'返回'
,
icon
:
'fanhui'
},
//
{ key: 'onOff', text: '显示窗', icon: 'yuan1' },
//
{ key: 'planDrill', text: '预案演练', icon: 'yuan1' },
{
key
:
'textPlan'
,
text
:
'文字预案'
,
icon
:
'jiuyuanjiagou'
},
{
key
:
'textPlanUpload'
,
text
:
'预案上传'
,
icon
:
'daochu'
},
{
key
:
'taskList'
,
text
:
'任务列表'
,
icon
:
'renwuliebiao'
},
];
...
...
src/view/planMgmt/cusVizLib/index.js
View file @
66fddfdb
...
...
@@ -20,7 +20,7 @@ const uploadUrl = FasSerUrl.uploadTextPlan;
const
extraMenus
=
[
{
key
:
'preview'
,
text
:
'预览'
,
icon
:
'eye'
},
{
key
:
'textImport'
,
text
:
'文字预案'
,
icon
:
'totop1'
},
{
key
:
'leaderStruct'
,
text
:
'领导架构'
,
icon
:
'user'
}
//
{ key: 'leaderStruct', text: '领导架构', icon: 'user' }
];
/**
...
...
src/view/planMgmt/treeView/PlanTreeView.js
View file @
66fddfdb
...
...
@@ -2,9 +2,12 @@ import React, { Component } from 'react';
import
{
Tree
,
message
}
from
'amos-framework'
;
import
PropTypes
from
'prop-types'
;
import
classnames
from
'classnames'
;
import
{
getPlanTreeAction
}
from
'./../../../services/preControlService'
;
import
_amosTool
,
{
fastDeepEqual
}
from
'amos-tool'
;
import
{
getPlanTreeAction
,
getTextPlanTreeAction
}
from
'./../../../services/preControlService'
;
import
BizIcon
from
'./../../common/icon/BizIcon'
;
import
{
eventTopics
}
from
'./../../3dview/consts'
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
const
TreeNode
=
Tree
.
TreeNode
;
class
PlanTreeView
extends
Component
{
...
...
@@ -27,6 +30,9 @@ class PlanTreeView extends Component {
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
'plan tree view~~~~~~~~~~~'
);
if
(
!
fastDeepEqual
(
this
.
props
.
selectAppId
,
nextProps
.
selectAppId
))
{
this
.
setState
({
selectedKeys
:
[
`textNode-
${
nextProps
.
selectAppId
}
`
]})
}
}
onTreeItemSelect
=
(
selectedKeys
,
info
)
=>
{
...
...
@@ -60,10 +66,22 @@ class PlanTreeView extends Component {
}
getPlanTree
()
{
getPlanTreeAction
().
then
(
data
=>
{
this
.
setState
({
treeData
:
data
},()
=>
{
this
.
defaultOpen
();
});
// getPlanTreeAction().then(data => {
// this.setState({ treeData: data },()=>{
// this.defaultOpen();
// });
// });
const
curAppId
=
ls
.
read
(
eventTopics
.
plan_drill_appId
);
getTextPlanTreeAction
(
curAppId
).
then
(
data
=>
{
if
(
data
){
this
.
setState
({
treeData
:
data
},()
=>
{
if
(
data
.
length
>
0
){
this
.
defaultOpen
();
}
else
{
message
.
danger
(
'暂无文本预案!'
);
}
});
}
});
}
...
...
@@ -71,7 +89,7 @@ class PlanTreeView extends Component {
let
{
treeData
}
=
this
.
state
;
let
{
onTreeSelect
,
selectAppId
}
=
this
.
props
;
let
defaultOpenPlan
=
{};
if
(
selectAppId
!=
''
){
if
(
selectAppId
!=
''
&&
selectAppId
!=
undefined
){
this
.
findTreeNodesById
(
treeData
,
selectAppId
);
if
(
this
.
state
.
selectData
!=
undefined
){
defaultOpenPlan
=
this
.
state
.
selectData
;
...
...
@@ -103,7 +121,7 @@ class PlanTreeView extends Component {
outerloop
:
for
(
let
i
=
0
;
i
<
arrData
.
length
;
i
++
)
{
const
e
=
arrData
[
i
];
if
(
e
.
id
==
selectAppId
){
if
(
e
.
parentId
==
selectAppId
||
e
.
id
==
selectAppId
){
//selectAppId 为appId || 文本id
this
.
state
.
selectData
=
e
;
break
outerloop
;
}
else
if
(
e
.
children
&&
e
.
children
.
length
>
0
){
...
...
src/view/planMgmt/view/index.js
View file @
66fddfdb
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
SidePane
,
Button
,
Modal
,
message
}
from
'amos-framework'
;
import
{
SidePane
,
Button
,
Modal
,
message
,
AmosAlert
}
from
'amos-framework'
;
import
{
headerButton
,
pageUrl
}
from
'./../common/conf'
;
import
PlanTreeView
from
'./../treeView/PlanTreeView'
;
import
TextButton
from
'./../common/TextButton'
;
import
BizIcon
from
'./../../common/icon/BizIcon'
;
import
{
textPlanDownloadFileAction
}
from
'./../../../services/preControlService'
;
import
{
textPlanDownloadFileAction
,
deleteTextPlanAction
}
from
'./../../../services/preControlService'
;
import
formatUrl
from
'amos-processor/lib/utils/urlFormat'
;
import
SysConsts
from
'amos-processor/lib/config/consts'
;
import
{
FasSerUrl
}
from
'CONSTS/urlConsts'
;
import
_amosTool
from
'amos-tool'
;
import
_amosTool
,
{
fastDeepEqual
}
from
'amos-tool'
;
import
{
PubSub
}
from
'ray-eventpool'
;
import
{
eventTopics
}
from
'./../../3dview/consts'
;
import
Upload
from
'./../common/upload'
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
const
apiKey
=
SysConsts
.
api_key
;
const
token
=
SysConsts
.
token
;
const
uploadUrl
=
FasSerUrl
.
uploadTextPlan
;
const
sidePaneStyle
=
{
planDrill
:
{
...
...
@@ -53,18 +58,18 @@ class PublishView extends Component {
this
.
state
=
{
activeKey
:
'planDrill'
,
params
:
{},
visible
:
tru
e
,
visible
:
fals
e
,
animateDelay
:
0
,
rightClickNodeTreeItem
:
null
,
node
:
{},
shareVisible
:
false
,
taskTabsShow
:
fals
e
,
//任务列表
taskTabsShow
:
tru
e
,
//任务列表
selectAppId
:
''
,
};
}
componentWillMount
(){
//
this.setState({ params: this.props.location.state });
this
.
setState
({
params
:
this
.
props
.
location
.
state
});
}
componentDidMount
(){
...
...
@@ -72,19 +77,33 @@ class PublishView extends Component {
viewRootDiv
&&
viewRootDiv
.
addEventListener
(
'click'
,
this
.
_handleClick
);
//页面增加鼠标单击监听
window
.
addEventListener
(
'resize'
,
this
.
_resize
);
//预案树展示
this
.
planTreePubsub
=
PubSub
.
subscribe
(
eventTopics
.
plan_tree_view
,
function
(
topic
,
message
){
this
.
setState
({
visible
:
message
})
}.
bind
(
this
));
//
this.planTreePubsub = PubSub.subscribe(eventTopics.plan_tree_view,function(topic,message){
//
this.setState({ visible: message })
//
}.bind(this));
//获取选择预案树节点
this
.
setState
({
selectAppId
:
ls
.
read
(
eventTopics
.
plan_drill_appId
)
});
console
.
log
(
ls
.
read
(
eventTopics
.
plan_drill_appId
));
}
componentWillUnmount
(){
let
viewRootDiv
=
document
.
getElementsByClassName
(
'publish-view-content'
)[
0
];
viewRootDiv
&&
viewRootDiv
.
addEventListener
(
'click'
,
this
.
_handleClick
);
//页面增加鼠标单击监听
window
.
addEventListener
(
'resize'
,
this
.
_resize
);
PubSub
.
unsubscribe
(
this
.
planTreePubsub
);
ls
.
write
(
eventTopics
.
plan_drill_appId
,
''
);
// PubSub.unsubscribe(this.planTreePubsub);
// ls.write(eventTopics.plan_drill_appId,'');
}
componentWillReceiveProps
(
nextProps
)
{
if
(
fastDeepEqual
(
'/biz/planDrill/pubview'
,
nextProps
.
location
.
pathname
))
{
console
.
log
(
'receive'
,
ls
.
read
(
eventTopics
.
plan_drill_appId
))
this
.
setState
({
activeKey
:
'planDrill'
,
visible
:
false
,
selectAppId
:
ls
.
read
(
eventTopics
.
plan_drill_appId
)
})
}
else
{
this
.
setState
({
selectAppId
:
nextProps
.
location
.
state
.
appId
})
}
}
_handleClick
=
(
event
)
=>
{
...
...
@@ -108,11 +127,18 @@ class PublishView extends Component {
getSidePaneContent
=
(
activeKey
)
=>
{
const
{
selectAppId
}
=
this
.
state
;
return
<
PlanTreeView
activeKey
=
{
activeKey
}
selectAppId
=
{
selectAppId
}
onTreeSelect
=
{
this
.
onTreeSelect
}
onRightClick
=
{
this
.
onRightClick
}
onRightCancel
=
{
this
.
_handleClick
}
/>
;
return
<
PlanTreeView
activeKey
=
{
activeKey
}
selectAppId
=
{
selectAppId
}
onTreeSelect
=
{
this
.
onTreeSelect
}
onRightClick
=
{
this
.
onRightClick
}
onRightCancel
=
{
this
.
_handleClick
}
ref
=
{
node
=>
this
.
planTree
=
node
}
/>
;
}
handleChange
=
(
activeKey
)
=>
{
cons
t
{
params
}
=
this
.
state
;
le
t
{
params
}
=
this
.
state
;
let
$path
=
{};
switch
(
activeKey
){
case
'planDrill'
:
...
...
@@ -120,11 +146,11 @@ class PublishView extends Component {
pathname
:
pageUrl
.
planDrill
,
state
:
{
...
params
}
};
if
(
this
.
state
.
taskTabsShow
)
{
this
.
state
.
taskTabsShow
=
false
;
PubSub
.
publish
(
eventTopics
.
plan_task_list
,
this
.
state
.
taskTabsShow
);
}
this
.
setState
({
activeKey
,
visible
:
true
,
taskTabsShow
:
this
.
state
.
taskTabsShow
});
//
if(this.state.taskTabsShow) {
//
this.state.taskTabsShow = false;
//
PubSub.publish(eventTopics.plan_task_list,this.state.taskTabsShow);
//
}
this
.
setState
({
activeKey
,
visible
:
false
,
taskTabsShow
:
this
.
state
.
taskTabsShow
});
browserHistory
.
push
(
$path
);
break
;
case
'textPlan'
:
...
...
@@ -132,24 +158,26 @@ class PublishView extends Component {
pathname
:
pageUrl
.
textPlan
,
state
:
{
...
params
}
};
this
.
setState
({
activeKey
,
visible
:
true
});
this
.
setState
({
activeKey
,
visible
:
true
,
selectAppId
:
ls
.
read
(
eventTopics
.
plan_drill_appId
)
});
browserHistory
.
push
(
$path
);
break
;
case
'back'
:
browserHistory
.
push
(
pageUrl
.
back
);
break
;
case
'onOff'
:
if
(
this
.
state
.
taskTabsShow
)
{
this
.
state
.
taskTabsShow
=
false
;
PubSub
.
publish
(
eventTopics
.
plan_task_list
,
this
.
state
.
taskTabsShow
);
}
this
.
setState
({
visible
:
!
this
.
state
.
visible
,
taskTabsShow
:
this
.
state
.
taskTabsShow
});
browserHistory
.
goBack
();
break
;
// case 'onOff':
// if(this.state.taskTabsShow) {
// this.state.taskTabsShow = false;
// PubSub.publish(eventTopics.plan_task_list,this.state.taskTabsShow);
// }
// this.setState({ visible: !this.state.visible, taskTabsShow: this.state.taskTabsShow });
// break;
case
'taskList'
:
//任务列表
if
(
this
.
state
.
visible
)
this
.
state
.
visible
=
false
;
PubSub
.
publish
(
eventTopics
.
plan_task_list
,
!
this
.
state
.
taskTabsShow
);
this
.
setState
({
visible
:
this
.
state
.
visible
,
taskTabsShow
:
!
this
.
state
.
taskTabsShow
});
break
;
case
'textPlanUpload'
:
this
.
setState
({
uploadVisible
:
true
});
default
:
break
;
}
...
...
@@ -166,7 +194,7 @@ class PublishView extends Component {
return
<
TextButton
key
=
{
e
.
key
}
{...
e
}
onClick
=
{()
=>
this
.
handleChange
(
e
.
key
)}
/>
;
});
}
else
{
return
headerButton
.
map
(
e
=>
{
return
headerButton
.
filter
(
item
=>
item
.
key
!==
'textPlanUpload'
).
map
(
e
=>
{
return
<
TextButton
key
=
{
e
.
key
}
{...
e
}
onClick
=
{()
=>
this
.
handleChange
(
e
.
key
)}
/>
;
});
}
...
...
@@ -188,7 +216,7 @@ class PublishView extends Component {
onButtonClick
=
(
value
)
=>
{
const
{
id
}
=
this
.
state
.
node
;
console
.
log
(
id
,
"treeId"
)
if
(
value
===
'
1
'
)
{
if
(
value
===
'
daochu
'
)
{
let
a
=
document
.
createElement
(
'a'
);
fetch
(
formatUrl
(
FasSerUrl
.
textPlanDownloadFile
,{
id
}),
{
method
:
'get'
,
...
...
@@ -200,8 +228,15 @@ class PublishView extends Component {
message
.
danger
(
"导出错误,文件不存在!"
)
}
});
}
else
if
(
value
===
'
2
'
)
{
}
else
if
(
value
===
'
fenxiang
'
)
{
this
.
setState
({
shareVisible
:
true
});
}
else
if
(
value
===
'shanchu'
)
{
deleteTextPlanAction
(
id
).
then
(
data
=>
{
message
.
success
(
'删除成功'
);
this
.
planTree
.
getPlanTree
();
}).
catch
(
e
=>
{
message
.
danger
(
'删除失败'
);
})
}
this
.
setState
({
rightClickNodeTreeItem
:
null
});
}
...
...
@@ -217,15 +252,16 @@ class PublishView extends Component {
top
:
`
${
pageY
-
45
}
px`
,
backgroundColor
:
'#ffffff'
,
border
:
'solid'
,
height
:
'
70
px'
,
height
:
'
105
px'
,
borderWidth
:
'1px'
,
borderColor
:
'#c9c9c9'
,
zIndex
:
'9999'
};
const
menu
=
(
<
div
style
=
{
tmpStyle
}
>
<
Button
icon
=
{
<
BizIcon
icon
=
"daochu"
/>
}
type
=
"button"
onClick
=
{()
=>
this
.
onButtonClick
(
'1'
)}
className
=
'risk-model-button'
transparent
>
导出
<
/Button
>
<
Button
icon
=
{
<
BizIcon
icon
=
"fenxiang"
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'2'
)}
className
=
'risk-model-button'
transparent
>
分享
<
/Button
>
<
Button
icon
=
{
<
BizIcon
icon
=
"daochu"
/>
}
type
=
"button"
onClick
=
{()
=>
this
.
onButtonClick
(
'daochu'
)}
className
=
'risk-model-button'
transparent
>
导出
<
/Button
>
<
Button
icon
=
{
<
BizIcon
icon
=
"fenxiang"
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'fenxiang'
)}
className
=
'risk-model-button'
transparent
>
分享
<
/Button
>
<
Button
icon
=
{
<
BizIcon
icon
=
"shanchu"
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'shanchu'
)}
className
=
'risk-model-button'
transparent
>
删除
<
/Button
>
<
/div
>
);
return
this
.
state
.
rightClickNodeTreeItem
?
menu
:
''
;
...
...
@@ -281,12 +317,47 @@ class PublishView extends Component {
cancel
=
()
=>
{
this
.
setState
({
shareVisible
:
false
shareVisible
:
false
,
uploadVisible
:
false
});
}
getUploadContent
=
()
=>
{
return
<
Upload
onCommit
=
{
this
.
onOk
}
ref
=
{
node
=>
this
.
upload
=
node
}
/>
;
}
onOk
=
()
=>
{
const
appId
=
ls
.
read
(
eventTopics
.
plan_drill_appId
);
const
{
fileList
}
=
this
.
upload
.
state
;
if
(
fileList
.
length
>
0
)
{
let
formData
=
new
FormData
();
fileList
.
forEach
((
file
,
i
)
=>
{
formData
.
append
(
'files'
,
file
[
'file'
]);
});
let
url
=
formatUrl
(
uploadUrl
,{
appId
});
fetch
(
url
,
{
method
:
'post'
,
headers
:
{
'Accept'
:
'application/json;charset=UTF-8'
,
'X-Api-Key'
:
_amosTool
.
Store
.
getCookieByName
(
apiKey
),
'X-Access-Token'
:
ls
.
read
(
token
)
},
body
:
formData
}).
then
(
e
=>
{
AmosAlert
.
success
(
'提示'
,
'保存成功'
,{
callback
:
()
=>
{
this
.
cancel
();
this
.
planTree
.
getPlanTree
();
}
});
}).
catch
(
e
=>
{
AmosAlert
.
error
(
'错误'
,
'保存失败'
);
});
}
}
render
()
{
const
{
activeKey
,
visible
,
animateDelay
,
shareVisible
}
=
this
.
state
;
const
{
activeKey
,
visible
,
animateDelay
,
shareVisible
,
uploadVisible
}
=
this
.
state
;
const
animateProps
=
{
transitionAppear
:
true
};
...
...
@@ -297,7 +368,6 @@ class PublishView extends Component {
{
this
.
renderButton
(
activeKey
)}
<
/div
>
<
SidePane
// className={`publish-view-side plan-tree-${activeKey}`}
className
=
{
`publish-view-side plan-tree-
${
activeKey
}
`
}
animateName
=
"fade"
animateProps
=
{
animateProps
}
...
...
@@ -320,6 +390,14 @@ class PublishView extends Component {
content
=
{
visible
&&
this
.
getShareContent
()}
noDefaultFooter
/>
<
Modal
header
=
"预案上传"
visible
=
{
uploadVisible
}
destroyContent
onOk
=
{
this
.
onOk
}
onCancel
=
{
this
.
cancel
}
content
=
{
uploadVisible
&&
this
.
getUploadContent
()}
/
>
<
/div
>
);
}
...
...
src/view/planMgmt/view/leaderStruct/index.js
View file @
66fddfdb
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
Modal
,
Button
,
message
,
AmosAlert
}
from
'amos-framework'
;
import
BizIcon
from
'./../../../common/icon/BizIcon'
;
import
ToolBar
from
'./ToolBar'
;
import
go
from
'amos-gojs'
;
import
{
queryTopographyAction
,
updateTopographyAction
,
nodeDetailTopoAction
,
deleteTopoAction
}
from
'./../../../../services/preControlService'
;
import
{
queryTopographyAction
,
queryTopographyByTypeAction
,
updateTopographyAction
,
nodeDetailTopoAction
,
deleteTopoAction
}
from
'./../../../../services/preControlService'
;
import
LeaderStructModel
from
'./LeaderStructModel'
;
import
LeaderStructRightGrid
from
'./LeaderStructRightGrid'
;
...
...
@@ -30,6 +29,7 @@ class LeaderStruct extends Component {
selectNodeType
:
''
,
rightGridData
:
[],
type
:
'1'
,
//topo 类型 1 领导架构
addNodeLoc
:
{
x
:
0
,
y
:
0
},
};
this
.
diagram
=
null
;
//gojs图
this
.
myPalette
=
null
;
//工具栏
...
...
@@ -37,12 +37,16 @@ class LeaderStruct extends Component {
}
componentDidMount
()
{
let
{
appId
}
=
this
.
props
.
location
.
state
;
this
.
fetchData
(
appId
);
//
let { appId } = this.props.location.state;
this
.
fetchData
();
}
fetchData
=
(
appId
)
=>
{
queryTopographyAction
(
this
.
state
.
type
,
appId
).
then
(
res
=>
{
fetchData
=
()
=>
{
// queryTopographyAction(this.state.type, appId).then(res =>{
// this.setState({nodeData: res.nodeData , linkData: res.linkData })
// this.renderCanvas();
// });
queryTopographyByTypeAction
(
this
.
state
.
type
).
then
(
res
=>
{
this
.
setState
({
nodeData
:
res
.
nodeData
,
linkData
:
res
.
linkData
})
this
.
renderCanvas
();
});
...
...
@@ -154,7 +158,7 @@ class LeaderStruct extends Component {
});
this
.
diagram
=
goObj
(
go
.
Diagram
,
this
.
refs
.
goJsDiv
,
{
contentAlignment
:
go
.
Spot
.
Center
,
initialContentAlignment
:
go
.
Spot
.
TopLeft
,
initialPosition
:
new
go
.
Point
(
0
,
0
),
'undoManager.isEnabled'
:
true
,
//// enable undo & redo 是否可撤回
'animationManager.isEnabled'
:
false
,
// 过渡动画
...
...
@@ -225,15 +229,15 @@ class LeaderStruct extends Component {
linkDataArray
:
linkData
||
[]
});
this
.
myPalette
=
goObj
(
go
.
Palette
,
this
.
refs
.
myPaletteDiv
,
{
nodeTemplateMap
:
this
.
diagram
.
nodeTemplateMap
,
// share the templates used by myDiagram
model
:
new
go
.
GraphLinksModel
([
// specify the contents of the Palette
{
category
:
"leaderStruct"
,
text
:
"节点"
,
isPalette
:
true
}
]
)
});
//
this.myPalette =
//
goObj(go.Palette, this.refs.myPaletteDiv,
//
{
//
nodeTemplateMap: this.diagram.nodeTemplateMap, // share the templates used by myDiagram
//
model: new go.GraphLinksModel([ // specify the contents of the Palette
//
{ category: "leaderStruct", text: "节点", isPalette: true }
//
]
//
)
//
});
}
onButtonClick
=
(
key
)
=>
{
...
...
@@ -258,16 +262,27 @@ class LeaderStruct extends Component {
}
else
{
message
.
danger
(
'请选择节点!'
);
}
}
else
if
(
key
===
'addNode'
){
this
.
addTopoNode
();
}
else
{
console
.
log
(
'暂未开发'
);
}
this
.
setState
({
toolBarFlag
:
key
});
}
addTopoNode
=
()
=>
{
let
{
addNodeLoc
}
=
this
.
state
;
addNodeLoc
.
x
+=
15
;
addNodeLoc
.
y
+=
15
;
let
node
=
{
category
:
"leaderStruct"
,
text
:
"节点"
,
loc
:
`
${
addNodeLoc
.
x
}
${
addNodeLoc
.
y
}
`
};
this
.
diagram
.
model
.
addNodeData
(
node
);
this
.
setState
({
addNodeLoc
})
}
saveTopography
=
(
nodeDetail
)
=>
{
const
{
nodeDataArray
,
linkDataArray
}
=
this
.
updateTopologyData
;
const
params
=
{
appId
:
this
.
props
.
location
.
state
.
appId
,
//
appId: this.props.location.state.appId,
type
:
this
.
state
.
type
,
nodeData
:
nodeDataArray
,
linkData
:
linkDataArray
,
...
...
@@ -303,12 +318,12 @@ class LeaderStruct extends Component {
if
(
toolBarFlag
)
{
if
(
toolBarFlag
===
'edit'
)
{
//编辑
return
<
LeaderStructModel
cancel
=
{
this
.
cancel
}
selectNode
=
{
selectNode
}
reloadSelectNode
=
{
this
.
reloadSelectNode
}
saveTopography
=
{
this
.
saveTopography
}
ref
=
{
component
=>
this
.
model
=
component
}
/>
;
cancel
=
{
this
.
cancel
}
selectNode
=
{
selectNode
}
reloadSelectNode
=
{
this
.
reloadSelectNode
}
saveTopography
=
{
this
.
saveTopography
}
ref
=
{
component
=>
this
.
model
=
component
}
/>
;
}
}
};
...
...
@@ -329,12 +344,16 @@ class LeaderStruct extends Component {
<
div
className
=
'header-left'
>
<
Button
className
=
'tool-bar-button'
transparent
icon
=
{
<
BizIcon
icon
=
'fanhui'
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'goback'
)}
/
>
<
span
className
=
'header-name'
>
领导架构
<
/span
>
<
div
className
=
'header-add-button'
>
<
Button
className
=
'leader-struct-add-button'
icon
=
{
<
BizIcon
icon
=
'tianjia'
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'addNode'
)}
>
新增节点
<
/Button
>
<
/div
>
<
/div
>
<
ToolBar
onClick
=
{
this
.
onButtonClick
}
/
>
<
/div
>
<
div
className
=
'leader-struct-content'
>
<
div
className
=
'leader-struct-left'
>
<
div
ref
=
"myPaletteDiv"
className
=
'leader-struct-palette'
id
=
"myPaletteDiv"
/>
{
/* 工具栏 */
}
{
/* <div ref="myPaletteDiv" className='leader-struct-palette' id = "myPaletteDiv"/> */
}
<
div
ref
=
"goJsDiv"
className
=
'leader-struct-diagram'
/>
{
this
.
renderDetail
()}
<
/div
>
...
...
src/view/planMgmt/view/pubview/StageActuator.js
View file @
66fddfdb
...
...
@@ -170,7 +170,7 @@ class StageActuator extends Component {
//展开任务列表
PubSub
.
publish
(
eventTopics
.
plan_task_list
,
true
);
//收起预案树
PubSub
.
publish
(
eventTopics
.
plan_tree_view
,
false
);
//
PubSub.publish(eventTopics.plan_tree_view,false);
}
playTargetAnimate
=
(
anim
,
e
)
=>
{
...
...
src/view/planMgmt/view/pubview/index.js
View file @
66fddfdb
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
LocationParam
,
utils
,
fastDeepEqual
}
from
'amos-tool'
;
import
_amosTool
,
{
LocationParam
,
utils
,
fastDeepEqual
}
from
'amos-tool'
;
import
ActuatorContainer
from
'./ActuatorContainer'
;
import
{
eventTopics
}
from
'./../../../3dview/consts'
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
/**
* 三维可视化 发布模式
...
...
@@ -50,7 +53,10 @@ class Pubview extends Component {
render
()
{
const
{
shouldRender
}
=
this
.
state
;
const
params
=
this
.
calcParams
();
const
{
appId
}
=
params
||
{};
let
{
appId
}
=
params
||
{};
if
(
appId
==
undefined
){
appId
=
ls
.
read
(
eventTopics
.
plan_drill_appId
);
}
if
(
shouldRender
){
return
(
<
div
className
=
"publish-view"
>
...
...
src/view/planMgmt/view/pubview/play/PlayMenuBar.js
View file @
66fddfdb
...
...
@@ -119,7 +119,7 @@ class PlayMenuBar extends Component {
className
=
{
`tip-control-panel`
}
left
=
{
false
}
top
=
{
false
}
animateName
=
"slide-
down
"
animateName
=
"slide-
up
"
visible
=
{
tulieActive
}
animateProps
=
{
animateProps
}
>
...
...
src/view/planMgmt/view/pubview/taskTabs/index.js
View file @
66fddfdb
...
...
@@ -19,7 +19,7 @@ class taskTabs extends Component {
constructor
(
props
){
super
(
props
);
this
.
state
=
{
taskTabsShow
:
fals
e
,
taskTabsShow
:
tru
e
,
tabs
:[
{
key
:
1
,
type
:
'person'
,
icon
:
'person'
,
models
:[]},
{
key
:
2
,
type
:
'car'
,
icon
:
'car'
,
models
:[]}
...
...
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