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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
161 additions
and
56 deletions
+161
-56
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
+0
-0
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 = {
...
@@ -207,6 +207,8 @@ export const FasSerUrl = {
contingencyWaterUrl
:
completePrefix
(
baseURI
,
'/api/risksource/contingency/water'
),
contingencyWaterUrl
:
completePrefix
(
baseURI
,
'/api/risksource/contingency/water'
),
configPointEquipmentUrl
:
completePrefix
(
baseURI
,
'api/firequment/point/batch/bindToEquipment?deviceId={deviceId}&pointIds={pointIds}'
),
configPointEquipmentUrl
:
completePrefix
(
baseURI
,
'api/firequment/point/batch/bindToEquipment?deviceId={deviceId}&pointIds={pointIds}'
),
getPlanTreeUrl
:
completePrefix
(
baseURI
,
'api/visual/plan/tree'
),
//获取预案树url
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'
),
//导入消防设备
importExcelFireEquipmentUrl
:
completePrefix
(
baseURI
,
'api/excel/import/fireEquipment'
),
//导入消防设备
importExcelDataUrl
:
completePrefix
(
baseURI
,
'api/excel/import/data/excel/{type}'
),
//导入excel数据type=['fireResource','water']
importExcelDataUrl
:
completePrefix
(
baseURI
,
'api/excel/import/data/excel/{type}'
),
//导入excel数据type=['fireResource','water']
importExcelFireEquipmentPointUrl
:
completePrefix
(
baseURI
,
'api/excel/import/fireEquipmentPoint'
),
importExcelFireEquipmentPointUrl
:
completePrefix
(
baseURI
,
'api/excel/import/fireEquipmentPoint'
),
...
@@ -221,6 +223,7 @@ export const FasSerUrl = {
...
@@ -221,6 +223,7 @@ export const FasSerUrl = {
getAllUserUrl
:
completePrefix
(
baseURI
,
'api/common/user/list'
),
//获取所有用户
getAllUserUrl
:
completePrefix
(
baseURI
,
'api/common/user/list'
),
//获取所有用户
queryFmeaControlObjUrl
:
completePrefix
(
baseURI
,
'api/riskModel/fmea/{ids}/controlObjCount'
),
//根据fmea id查询关联对象个数
queryFmeaControlObjUrl
:
completePrefix
(
baseURI
,
'api/riskModel/fmea/{ids}/controlObjCount'
),
//根据fmea id查询关联对象个数
queryTopographyUrl
:
completePrefix
(
baseURI
,
'api/Topography/query/{type}/{appId}'
),
//获取Topo图数据
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图数据
updateTopographyUrl
:
completePrefix
(
baseURI
,
'api/Topography/updateTopo'
),
//更新Topo图数据
queryNodeDetailUrl
:
completePrefix
(
baseURI
,
'api/Topography/detail/{id}'
),
//获取node节点详情
queryNodeDetailUrl
:
completePrefix
(
baseURI
,
'api/Topography/detail/{id}'
),
//获取node节点详情
saveNodeDetailUrl
:
completePrefix
(
baseURI
,
'api/Topography/detail'
),
//保存nodeDetail详情
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';
...
@@ -12,6 +12,7 @@ import PlanDrill from './../view/planMgmt/view/PlanDrill';
import
LeaderStruct
from
'./../view/planMgmt/view/leaderStruct'
;
import
LeaderStruct
from
'./../view/planMgmt/view/leaderStruct'
;
import
PubView
from
'./../view/planMgmt/view/pubview'
;
import
PubView
from
'./../view/planMgmt/view/pubview'
;
import
PublishView
from
'./../view/planMgmt/view'
;
/**
/**
...
@@ -27,11 +28,17 @@ export const customRoutes = [
...
@@ -27,11 +28,17 @@ export const customRoutes = [
{
path
:
'differentiateDetail'
,
parent
:
'biz'
,
component
:
DifferentiateDetail
},
{
path
:
'differentiateDetail'
,
parent
:
'biz'
,
component
:
DifferentiateDetail
},
{
path
:
'leaderStruct'
,
parent
:
'biz'
,
component
:
LeaderStruct
},
{
path
:
'leaderStruct'
,
parent
:
'biz'
,
component
:
LeaderStruct
},
// { path: 'pubview', parent: 'planDrill', component: PlanDrill },
// { path: 'pubview', parent: 'planDrill', component: PlanDrill },
{
path
:
'pubview'
,
parent
:
'planDrill'
,
component
:
PubView
},
//
{ path: 'pubview', parent: 'planDrill', component: PubView },
{
path
:
'textview'
,
parent
:
'planDrill'
,
component
:
TextPlan
},
//
{ path: 'textview', parent: 'planDrill', component: TextPlan },
...
parseCusotmRoutes
()
...
parseCusotmRoutes
()
];
];
export
const
planChildrenRoutes
=
{
path
:
'planDrill'
,
component
:
PublishView
,
childRoutes
:
[
{
path
:
'pubview'
,
component
:
PubView
},
{
path
:
'textview'
,
component
:
TextPlan
}
]};
/**
/**
* path mapping
* path mapping
...
...
src/routes/index.js
View file @
66fddfdb
...
@@ -7,7 +7,7 @@ import routerFilter, { checkLogin } from 'amos-security/lib/routes/validateRoute
...
@@ -7,7 +7,7 @@ import routerFilter, { checkLogin } from 'amos-security/lib/routes/validateRoute
import
PublishView
from
'./../view/planMgmt/view'
;
import
PublishView
from
'./../view/planMgmt/view'
;
import
AutoLogin
from
'./../view/autoLogin/AutoLogin'
;
import
AutoLogin
from
'./../view/autoLogin/AutoLogin'
;
import
calcRoutes
from
'./calcRoutes'
;
import
calcRoutes
from
'./calcRoutes'
;
import
addCustomRoutes
,
{
customRoutes
,
customRoutesPubView
}
from
'./customRoutes'
;
import
addCustomRoutes
,
{
customRoutes
,
planChildrenRoutes
}
from
'./customRoutes'
;
import
pageCompontent
,
{
import
pageCompontent
,
{
RootView
,
RootView
,
Login
,
Login
,
...
@@ -19,7 +19,8 @@ import pageCompontent, {
...
@@ -19,7 +19,8 @@ import pageCompontent, {
import
Iot3DGraphBiz
from
'./../view/planMgmt/iot3DGraph'
;
import
Iot3DGraphBiz
from
'./../view/planMgmt/iot3DGraph'
;
import
ShareTextPlan
from
'./../view/planMgmt/view/ShareTextPlan'
;
import
ShareTextPlan
from
'./../view/planMgmt/view/ShareTextPlan'
;
import
PubView
from
'./../view/planMgmt/view/pubview'
;
import
TextPlan
from
'./../view/planMgmt/view/TextPlan'
;
const
groups
=
[
const
groups
=
[
'main'
,
'biz'
,
'console'
,
'ruleConfig'
'main'
,
'biz'
,
'console'
,
'ruleConfig'
...
@@ -34,7 +35,12 @@ const injectRoutes = menus => {
...
@@ -34,7 +35,12 @@ const injectRoutes = menus => {
{
{
path
:
'viz3d/:subjectId'
,
path
:
'viz3d/:subjectId'
,
component
:
Iot3DGraphBiz
component
:
Iot3DGraphBiz
},
},
// {
// path: 'viz3dpub',
// component: PublishView,
// childRoutes: [...customRoutesPubView]
// },
{
path
:
'login'
,
component
:
Login
},
{
path
:
'login'
,
component
:
Login
},
{
path
:
'autologin'
,
component
:
AutoLogin
},
{
path
:
'autologin'
,
component
:
AutoLogin
},
{
path
:
'region'
,
component
:
RegionList
},
// 区域选择
{
path
:
'region'
,
component
:
RegionList
},
// 区域选择
...
@@ -51,7 +57,9 @@ const injectRoutes = menus => {
...
@@ -51,7 +57,9 @@ const injectRoutes = menus => {
{
{
path
:
'biz'
,
path
:
'biz'
,
component
:
RootBizView
,
component
:
RootBizView
,
childRoutes
:
[...
bizChilds
,
...
customRoutes
]
childRoutes
:
[...
bizChilds
,
...
customRoutes
,
planChildrenRoutes
]
},
},
{
{
path
:
'console'
,
path
:
'console'
,
...
...
src/routes/view.js
View file @
66fddfdb
...
@@ -55,6 +55,7 @@ import CusVizLib from './../view/planMgmt/cusVizLib';
...
@@ -55,6 +55,7 @@ import CusVizLib from './../view/planMgmt/cusVizLib';
import
RealTimeMonitor
from
'./../view/morphic'
;
import
RealTimeMonitor
from
'./../view/morphic'
;
import
PublishView
from
'./../view/planMgmt/view'
;
import
PublishView
from
'./../view/planMgmt/view'
;
import
ModelManage
from
'./../view/planMgmt/modelManage'
;
import
ModelManage
from
'./../view/planMgmt/modelManage'
;
import
LeaderStruct
from
'./../view/planMgmt/view/leaderStruct'
;
const
Routes
=
{
const
Routes
=
{
// 添加 rules 路由
// 添加 rules 路由
...
@@ -108,8 +109,9 @@ const Routes = {
...
@@ -108,8 +109,9 @@ const Routes = {
alarmVideoMonitor
:
AlarmVideoMonitor
,
alarmVideoMonitor
:
AlarmVideoMonitor
,
alarmTest
:
alarmTestView
,
alarmTest
:
alarmTestView
,
vizlib
:
CusVizLib
,
vizlib
:
CusVizLib
,
planDrill
:
PublishView
,
// planDrill: PublishView,
modelManage
:
ModelManage
modelManage
:
ModelManage
,
leaderStruct
:
LeaderStruct
};
};
const
pageCompontent
=
key
=>
{
const
pageCompontent
=
key
=>
{
...
...
src/services/preControlService.js
View file @
66fddfdb
...
@@ -202,6 +202,13 @@ export const queryTopographyAction = (type,appId) => {
...
@@ -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
)
=>
{
export
const
updateTopographyAction
=
(
params
)
=>
{
...
@@ -227,4 +234,16 @@ export const nodeDetailTopoSaveAction = (nodeDatil) => {
...
@@ -227,4 +234,16 @@ export const nodeDetailTopoSaveAction = (nodeDatil) => {
*/
*/
export
const
deleteTopoAction
=
(
id
,
type
)
=>
{
export
const
deleteTopoAction
=
(
id
,
type
)
=>
{
return
commonDelete
(
formatUrl
(
FasSerUrl
.
deleteTopoUrl
,
{
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 @@
...
@@ -12,25 +12,47 @@
border-width
:
1px
;
border-width
:
1px
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
.tool-bar-button
{
vertical-align
:
baseline
;
}
.header-left
{
.header-left
{
flex-grow
:
1
;
line-height
:
42px
;
line-height
:
42px
;
.tool-bar-button
{
vertical-align
:
baseline
;
}
.header-name
{
.header-name
{
padding-left
:
20px
;
padding-left
:
20px
;
font-size
:
15px
;
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
{
.tool-bar-root
{
float
:
right
;
width
:
300px
;
margin-right
:
5px
;
.amos-button-bar-group
{
float
:
right
;
}
}
}
}
}
.leader-struct-content
{
.leader-struct-content
{
...
@@ -50,7 +72,8 @@
...
@@ -50,7 +72,8 @@
}
}
.leader-struct-diagram
{
.leader-struct-diagram
{
height
:
90%
;
// height: 90%;
height
:
100%
;
}
}
.tooltip-content
{
.tooltip-content
{
...
...
src/view/planMgmt/common/conf.js
View file @
66fddfdb
export
const
headerButton
=
[
export
const
headerButton
=
[
//
{ key: 'back', text: '返回', icon: 'fanhui' },
{
key
:
'back'
,
text
:
'返回'
,
icon
:
'fanhui'
},
{
key
:
'onOff'
,
text
:
'显示窗'
,
icon
:
'yuan1'
},
//
{ key: 'onOff', text: '显示窗', icon: 'yuan1' },
{
key
:
'planDrill'
,
text
:
'预案演练'
,
icon
:
'yuan1'
},
//
{ key: 'planDrill', text: '预案演练', icon: 'yuan1' },
{
key
:
'textPlan'
,
text
:
'文字预案'
,
icon
:
'jiuyuanjiagou'
},
{
key
:
'textPlan'
,
text
:
'文字预案'
,
icon
:
'jiuyuanjiagou'
},
{
key
:
'textPlanUpload'
,
text
:
'预案上传'
,
icon
:
'daochu'
},
{
key
:
'taskList'
,
text
:
'任务列表'
,
icon
:
'renwuliebiao'
},
{
key
:
'taskList'
,
text
:
'任务列表'
,
icon
:
'renwuliebiao'
},
];
];
...
...
src/view/planMgmt/cusVizLib/index.js
View file @
66fddfdb
...
@@ -20,7 +20,7 @@ const uploadUrl = FasSerUrl.uploadTextPlan;
...
@@ -20,7 +20,7 @@ const uploadUrl = FasSerUrl.uploadTextPlan;
const
extraMenus
=
[
const
extraMenus
=
[
{
key
:
'preview'
,
text
:
'预览'
,
icon
:
'eye'
},
{
key
:
'preview'
,
text
:
'预览'
,
icon
:
'eye'
},
{
key
:
'textImport'
,
text
:
'文字预案'
,
icon
:
'totop1'
},
{
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';
...
@@ -2,9 +2,12 @@ import React, { Component } from 'react';
import
{
Tree
,
message
}
from
'amos-framework'
;
import
{
Tree
,
message
}
from
'amos-framework'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
import
classnames
from
'classnames'
;
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
BizIcon
from
'./../../common/icon/BizIcon'
;
import
{
eventTopics
}
from
'./../../3dview/consts'
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
const
TreeNode
=
Tree
.
TreeNode
;
const
TreeNode
=
Tree
.
TreeNode
;
class
PlanTreeView
extends
Component
{
class
PlanTreeView
extends
Component
{
...
@@ -27,6 +30,9 @@ class PlanTreeView extends Component {
...
@@ -27,6 +30,9 @@ class PlanTreeView extends Component {
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
'plan tree view~~~~~~~~~~~'
);
console
.
log
(
'plan tree view~~~~~~~~~~~'
);
if
(
!
fastDeepEqual
(
this
.
props
.
selectAppId
,
nextProps
.
selectAppId
))
{
this
.
setState
({
selectedKeys
:
[
`textNode-
${
nextProps
.
selectAppId
}
`
]})
}
}
}
onTreeItemSelect
=
(
selectedKeys
,
info
)
=>
{
onTreeItemSelect
=
(
selectedKeys
,
info
)
=>
{
...
@@ -60,10 +66,22 @@ class PlanTreeView extends Component {
...
@@ -60,10 +66,22 @@ class PlanTreeView extends Component {
}
}
getPlanTree
()
{
getPlanTree
()
{
getPlanTreeAction
().
then
(
data
=>
{
// getPlanTreeAction().then(data => {
this
.
setState
({
treeData
:
data
},()
=>
{
// this.setState({ treeData: data },()=>{
this
.
defaultOpen
();
// 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 {
...
@@ -71,7 +89,7 @@ class PlanTreeView extends Component {
let
{
treeData
}
=
this
.
state
;
let
{
treeData
}
=
this
.
state
;
let
{
onTreeSelect
,
selectAppId
}
=
this
.
props
;
let
{
onTreeSelect
,
selectAppId
}
=
this
.
props
;
let
defaultOpenPlan
=
{};
let
defaultOpenPlan
=
{};
if
(
selectAppId
!=
''
){
if
(
selectAppId
!=
''
&&
selectAppId
!=
undefined
){
this
.
findTreeNodesById
(
treeData
,
selectAppId
);
this
.
findTreeNodesById
(
treeData
,
selectAppId
);
if
(
this
.
state
.
selectData
!=
undefined
){
if
(
this
.
state
.
selectData
!=
undefined
){
defaultOpenPlan
=
this
.
state
.
selectData
;
defaultOpenPlan
=
this
.
state
.
selectData
;
...
@@ -103,7 +121,7 @@ class PlanTreeView extends Component {
...
@@ -103,7 +121,7 @@ class PlanTreeView extends Component {
outerloop
:
outerloop
:
for
(
let
i
=
0
;
i
<
arrData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arrData
.
length
;
i
++
)
{
const
e
=
arrData
[
i
];
const
e
=
arrData
[
i
];
if
(
e
.
id
==
selectAppId
){
if
(
e
.
parentId
==
selectAppId
||
e
.
id
==
selectAppId
){
//selectAppId 为appId || 文本id
this
.
state
.
selectData
=
e
;
this
.
state
.
selectData
=
e
;
break
outerloop
;
break
outerloop
;
}
else
if
(
e
.
children
&&
e
.
children
.
length
>
0
){
}
else
if
(
e
.
children
&&
e
.
children
.
length
>
0
){
...
...
src/view/planMgmt/view/index.js
View file @
66fddfdb
This diff is collapsed.
Click to expand it.
src/view/planMgmt/view/leaderStruct/index.js
View file @
66fddfdb
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
Modal
,
Button
,
message
,
AmosAlert
}
from
'amos-framework'
;
import
{
Modal
,
Button
,
message
,
AmosAlert
}
from
'amos-framework'
;
import
BizIcon
from
'./../../../common/icon/BizIcon'
;
import
BizIcon
from
'./../../../common/icon/BizIcon'
;
import
ToolBar
from
'./ToolBar'
;
import
ToolBar
from
'./ToolBar'
;
import
go
from
'amos-gojs'
;
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
LeaderStructModel
from
'./LeaderStructModel'
;
import
LeaderStructRightGrid
from
'./LeaderStructRightGrid'
;
import
LeaderStructRightGrid
from
'./LeaderStructRightGrid'
;
...
@@ -30,6 +29,7 @@ class LeaderStruct extends Component {
...
@@ -30,6 +29,7 @@ class LeaderStruct extends Component {
selectNodeType
:
''
,
selectNodeType
:
''
,
rightGridData
:
[],
rightGridData
:
[],
type
:
'1'
,
//topo 类型 1 领导架构
type
:
'1'
,
//topo 类型 1 领导架构
addNodeLoc
:
{
x
:
0
,
y
:
0
},
};
};
this
.
diagram
=
null
;
//gojs图
this
.
diagram
=
null
;
//gojs图
this
.
myPalette
=
null
;
//工具栏
this
.
myPalette
=
null
;
//工具栏
...
@@ -37,12 +37,16 @@ class LeaderStruct extends Component {
...
@@ -37,12 +37,16 @@ class LeaderStruct extends Component {
}
}
componentDidMount
()
{
componentDidMount
()
{
let
{
appId
}
=
this
.
props
.
location
.
state
;
//
let { appId } = this.props.location.state;
this
.
fetchData
(
appId
);
this
.
fetchData
();
}
}
fetchData
=
(
appId
)
=>
{
fetchData
=
()
=>
{
queryTopographyAction
(
this
.
state
.
type
,
appId
).
then
(
res
=>
{
// 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
.
setState
({
nodeData
:
res
.
nodeData
,
linkData
:
res
.
linkData
})
this
.
renderCanvas
();
this
.
renderCanvas
();
});
});
...
@@ -154,7 +158,7 @@ class LeaderStruct extends Component {
...
@@ -154,7 +158,7 @@ class LeaderStruct extends Component {
});
});
this
.
diagram
=
goObj
(
go
.
Diagram
,
this
.
refs
.
goJsDiv
,
{
this
.
diagram
=
goObj
(
go
.
Diagram
,
this
.
refs
.
goJsDiv
,
{
contentAlignment
:
go
.
Spot
.
Center
,
initialContentAlignment
:
go
.
Spot
.
TopLeft
,
initialPosition
:
new
go
.
Point
(
0
,
0
),
initialPosition
:
new
go
.
Point
(
0
,
0
),
'undoManager.isEnabled'
:
true
,
//// enable undo & redo 是否可撤回
'undoManager.isEnabled'
:
true
,
//// enable undo & redo 是否可撤回
'animationManager.isEnabled'
:
false
,
// 过渡动画
'animationManager.isEnabled'
:
false
,
// 过渡动画
...
@@ -225,15 +229,15 @@ class LeaderStruct extends Component {
...
@@ -225,15 +229,15 @@ class LeaderStruct extends Component {
linkDataArray
:
linkData
||
[]
linkDataArray
:
linkData
||
[]
});
});
this
.
myPalette
=
//
this.myPalette =
goObj
(
go
.
Palette
,
this
.
refs
.
myPaletteDiv
,
//
goObj(go.Palette, this.refs.myPaletteDiv,
{
//
{
nodeTemplateMap
:
this
.
diagram
.
nodeTemplateMap
,
// share the templates used by myDiagram
//
nodeTemplateMap: this.diagram.nodeTemplateMap, // share the templates used by myDiagram
model
:
new
go
.
GraphLinksModel
([
// specify the contents of the Palette
//
model: new go.GraphLinksModel([ // specify the contents of the Palette
{
category
:
"leaderStruct"
,
text
:
"节点"
,
isPalette
:
true
}
//
{ category: "leaderStruct", text: "节点", isPalette: true }
]
//
]
)
//
)
});
//
});
}
}
onButtonClick
=
(
key
)
=>
{
onButtonClick
=
(
key
)
=>
{
...
@@ -258,16 +262,27 @@ class LeaderStruct extends Component {
...
@@ -258,16 +262,27 @@ class LeaderStruct extends Component {
}
else
{
}
else
{
message
.
danger
(
'请选择节点!'
);
message
.
danger
(
'请选择节点!'
);
}
}
}
else
if
(
key
===
'addNode'
){
this
.
addTopoNode
();
}
else
{
}
else
{
console
.
log
(
'暂未开发'
);
console
.
log
(
'暂未开发'
);
}
}
this
.
setState
({
toolBarFlag
:
key
});
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
)
=>
{
saveTopography
=
(
nodeDetail
)
=>
{
const
{
nodeDataArray
,
linkDataArray
}
=
this
.
updateTopologyData
;
const
{
nodeDataArray
,
linkDataArray
}
=
this
.
updateTopologyData
;
const
params
=
{
const
params
=
{
appId
:
this
.
props
.
location
.
state
.
appId
,
//
appId: this.props.location.state.appId,
type
:
this
.
state
.
type
,
type
:
this
.
state
.
type
,
nodeData
:
nodeDataArray
,
nodeData
:
nodeDataArray
,
linkData
:
linkDataArray
,
linkData
:
linkDataArray
,
...
@@ -303,12 +318,12 @@ class LeaderStruct extends Component {
...
@@ -303,12 +318,12 @@ class LeaderStruct extends Component {
if
(
toolBarFlag
)
{
if
(
toolBarFlag
)
{
if
(
toolBarFlag
===
'edit'
)
{
//编辑
if
(
toolBarFlag
===
'edit'
)
{
//编辑
return
<
LeaderStructModel
return
<
LeaderStructModel
cancel
=
{
this
.
cancel
}
cancel
=
{
this
.
cancel
}
selectNode
=
{
selectNode
}
selectNode
=
{
selectNode
}
reloadSelectNode
=
{
this
.
reloadSelectNode
}
reloadSelectNode
=
{
this
.
reloadSelectNode
}
saveTopography
=
{
this
.
saveTopography
}
saveTopography
=
{
this
.
saveTopography
}
ref
=
{
component
=>
this
.
model
=
component
}
ref
=
{
component
=>
this
.
model
=
component
}
/>
;
/>
;
}
}
}
}
};
};
...
@@ -329,12 +344,16 @@ class LeaderStruct extends Component {
...
@@ -329,12 +344,16 @@ class LeaderStruct extends Component {
<
div
className
=
'header-left'
>
<
div
className
=
'header-left'
>
<
Button
className
=
'tool-bar-button'
transparent
icon
=
{
<
BizIcon
icon
=
'fanhui'
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'goback'
)}
/
>
<
Button
className
=
'tool-bar-button'
transparent
icon
=
{
<
BizIcon
icon
=
'fanhui'
/>
}
onClick
=
{()
=>
this
.
onButtonClick
(
'goback'
)}
/
>
<
span
className
=
'header-name'
>
领导架构
<
/span
>
<
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
>
<
/div
>
<
ToolBar
onClick
=
{
this
.
onButtonClick
}
/
>
<
ToolBar
onClick
=
{
this
.
onButtonClick
}
/
>
<
/div
>
<
/div
>
<
div
className
=
'leader-struct-content'
>
<
div
className
=
'leader-struct-content'
>
<
div
className
=
'leader-struct-left'
>
<
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'
/>
<
div
ref
=
"goJsDiv"
className
=
'leader-struct-diagram'
/>
{
this
.
renderDetail
()}
{
this
.
renderDetail
()}
<
/div
>
<
/div
>
...
...
src/view/planMgmt/view/pubview/StageActuator.js
View file @
66fddfdb
...
@@ -170,7 +170,7 @@ class StageActuator extends Component {
...
@@ -170,7 +170,7 @@ class StageActuator extends Component {
//展开任务列表
//展开任务列表
PubSub
.
publish
(
eventTopics
.
plan_task_list
,
true
);
PubSub
.
publish
(
eventTopics
.
plan_task_list
,
true
);
//收起预案树
//收起预案树
PubSub
.
publish
(
eventTopics
.
plan_tree_view
,
false
);
//
PubSub.publish(eventTopics.plan_tree_view,false);
}
}
playTargetAnimate
=
(
anim
,
e
)
=>
{
playTargetAnimate
=
(
anim
,
e
)
=>
{
...
...
src/view/planMgmt/view/pubview/index.js
View file @
66fddfdb
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
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
ActuatorContainer
from
'./ActuatorContainer'
;
import
{
eventTopics
}
from
'./../../../3dview/consts'
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
/**
/**
* 三维可视化 发布模式
* 三维可视化 发布模式
...
@@ -50,7 +53,10 @@ class Pubview extends Component {
...
@@ -50,7 +53,10 @@ class Pubview extends Component {
render
()
{
render
()
{
const
{
shouldRender
}
=
this
.
state
;
const
{
shouldRender
}
=
this
.
state
;
const
params
=
this
.
calcParams
();
const
params
=
this
.
calcParams
();
const
{
appId
}
=
params
||
{};
let
{
appId
}
=
params
||
{};
if
(
appId
==
undefined
){
appId
=
ls
.
read
(
eventTopics
.
plan_drill_appId
);
}
if
(
shouldRender
){
if
(
shouldRender
){
return
(
return
(
<
div
className
=
"publish-view"
>
<
div
className
=
"publish-view"
>
...
...
src/view/planMgmt/view/pubview/play/PlayMenuBar.js
View file @
66fddfdb
...
@@ -119,7 +119,7 @@ class PlayMenuBar extends Component {
...
@@ -119,7 +119,7 @@ class PlayMenuBar extends Component {
className
=
{
`tip-control-panel`
}
className
=
{
`tip-control-panel`
}
left
=
{
false
}
left
=
{
false
}
top
=
{
false
}
top
=
{
false
}
animateName
=
"slide-
down
"
animateName
=
"slide-
up
"
visible
=
{
tulieActive
}
visible
=
{
tulieActive
}
animateProps
=
{
animateProps
}
animateProps
=
{
animateProps
}
>
>
...
...
src/view/planMgmt/view/pubview/taskTabs/index.js
View file @
66fddfdb
...
@@ -19,7 +19,7 @@ class taskTabs extends Component {
...
@@ -19,7 +19,7 @@ class taskTabs extends Component {
constructor
(
props
){
constructor
(
props
){
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
taskTabsShow
:
fals
e
,
taskTabsShow
:
tru
e
,
tabs
:[
tabs
:[
{
key
:
1
,
type
:
'person'
,
icon
:
'person'
,
models
:[]},
{
key
:
1
,
type
:
'person'
,
icon
:
'person'
,
models
:[]},
{
key
:
2
,
type
:
'car'
,
icon
:
'car'
,
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