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
7f579d70
Commit
7f579d70
authored
Jun 01, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
免密登录
parent
0e46de8c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
155 additions
and
23 deletions
+155
-23
amos.config.js
amos.config.js
+5
-3
urlConsts.js
src/consts/urlConsts.js
+1
-1
index.js
src/entry/index.js
+34
-6
asyncRoutes.js
src/routes/asyncRoutes.js
+1
-1
asyncView.js
src/routes/asyncView.js
+6
-2
view.js
src/routes/view.js
+5
-2
securityService.js
src/services/securityService.js
+12
-3
AutoLogin.js
src/view/autoLogin/AutoLogin.js
+19
-5
index.js
src/view/bizview/user/index.js
+24
-0
XJIndex.js
src/view/bizview/xunjian/XJIndex.js
+45
-0
index.js
src/view/region/index.js
+3
-0
No files found.
amos.config.js
View file @
7f579d70
...
...
@@ -7,7 +7,7 @@
Amos
.
config
=
{
// 普通http
httpURI
:
{
baseURI
:
'http://172.16.
3.63:8083
/'
,
baseURI
:
'http://172.16.
11.36:10005
/'
,
convertorURI
:
'http://172.16.3.63:8083/'
,
securityBaseURI
:
'http://172.16.10.72:10005/'
,
rulesConfigURI
:
'http://172.16.10.91:8080/'
,
...
...
@@ -27,10 +27,12 @@
},
// 外部链接地址
outterURI
:
{
xunjian
:
'http://172.16.10.91:3001/outter?isSub=true&user={userId}&token={token}&orgCode={orgCode}'
,
//xunjian: 'http://172.16.10.91:3001/outter?isSub=true&user={userId}&token={token}&orgCode={orgCode}',
xunjian
:
'http://172.16.11.36:3001/outter?isSub=true&token={token}&companyId={companyId}&deptId={deptId}&roleId={roleId}'
,
mgtCtrlModel
:
'http://172.16.10.91:8080'
,
prePlan
:
'http://172.16.10.91:3004'
,
ue4URI
:
'http://172.16.11.36:8089'
ue4URI
:
'http://172.16.11.36:8089'
,
userModelURI
:
'http://172.16.10.72/main/authcenter/user?token={token}'
//平台用户界面
},
// 系统配置信息 主要是为了区分各子系统
sysConf
:
{
...
...
src/consts/urlConsts.js
View file @
7f579d70
...
...
@@ -46,7 +46,7 @@ export const secExtUrl = {
permissionsMenusUrl
:
completePrefix
(
securityBaseURI
,
`privilege/
${
secExVerson
}
/permission/tree/role?roleSeq={roleSeq}`
),
loginOutUrl
:
completePrefix
(
baseURI
,
'privilege/v1/auth/token'
),
// 注销 delete
//avoidLoginUrl: completePrefix(baseURI,'api/login/avoid/{loginId}/{accessToken}/{expireTime}?appType={appType}')
};
export
const
FscSerUrl
=
{
...
...
src/entry/index.js
View file @
7f579d70
...
...
@@ -17,7 +17,8 @@ import rootRoutes from './../routes';
import
{
configureStoreWithDev
}
from
'./../store'
;
import
beforeRender
from
'./beforeRender'
;
import
{
Store
,
LocationParam
}
from
'amos-tool'
;
import
{
getSystemAllMenu
}
from
'../services/securityService'
;
import
{
getSystemAllMenu
,
avoidLoginAction
}
from
'../services/securityService'
;
import
{
sessionConsts
}
from
'../consts/storageConsts'
;
import
SysConsts
from
'amos-processor/lib/config/consts'
;
// 引入主体样式文件
import
'./../styles'
;
...
...
@@ -44,10 +45,38 @@ class App extends Component {
componentWillMount
()
{
let
token
=
LocationParam
.
getLocationParamByName
(
'token'
);
if
(
token
)
{
lsTool
.
write
(
SysConsts
.
token
,
token
);
lsTool
.
write
(
'token'
,
token
);
if
(
!
token
)
{
token
=
lsTool
.
read
(
SysConsts
.
token
);
}
// let accessToken = LocationParam.getLocationParamByName('accessToken');
// let expireTime = LocationParam.getLocationParamByName('effectiveTime');
// let loginId = LocationParam.getLocationParamByName('username');
// if (accessToken){
// lsTool.remove('token');
// avoidLoginAction(loginId, accessToken, expireTime, 'station').then(
// data => {
// if (data.toke){
// console.log('token', data.toke);
// this.getSystemAllMenuAction(data.toke);
// } else {
// AmosAlert.error('警告', '接口异常,请联系管理员!');
// }
// },
// err => {
// AmosAlert.error('警告', err || '登录失败!');
// }
// );
// }
if
(
token
){
this
.
getSystemAllMenuAction
(
token
);
}
}
getSystemAllMenuAction
=
(
token
)
=>
{
lsTool
.
write
(
SysConsts
.
token
,
token
);
lsTool
.
write
(
'token'
,
token
);
getSystemAllMenu
().
then
(
menus
=>
{
let
systemMuens
=
this
.
filterSystemMenus
(
menus
);
...
...
@@ -63,8 +92,7 @@ class App extends Component {
AmosAlert
.
error
(
'警告'
,
err
||
'获取初始化菜单失败!'
);
}
);
}
};
onUpdate
=
()
=>
{
RProgress
.
done
();
...
...
src/routes/asyncRoutes.js
View file @
7f579d70
...
...
@@ -4,7 +4,7 @@ import { Store } from 'amos-tool';
import
RProgress
from
'ray-progress'
;
import
calcRoutes
from
'./calcRoutes'
;
import
addCustomRoutes
,
{
customRoutes
,
planChildrenRoutes
}
from
'./customRoutes'
;
import
pageCompontent
,
import
pageCompontent
,
{
AsyncRootView
,
AsyncLogin
,
AsyncUserInfo
,
AsyncRootBizView
,
...
...
src/routes/asyncView.js
View file @
7f579d70
...
...
@@ -50,7 +50,8 @@ const AsyncRiskAssessment = props => <AsyncLoader load={import('./../view/bizvie
const
AsyncFireStationMatches
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/bizview/equipmentLedger/FireResources/matchEquipment/FireStationMatches'
)}
componentProps
=
{
props
}
/>
;
const
AsyncMatchEquipment
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/bizview/equipmentLedger/Equipment/MatchEquipment'
)}
componentProps
=
{
props
}
/>
;
const
AsyncFireStrengthResourceView
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/bizview/equipmentLedger/FireResources/FireStrength'
)}
componentProps
=
{
props
}
/>
;
const
AsyncXJCtrlModel
=
props
=>
<
AsyncLoader
load
=
{
import
(
'../view/bizview/xunjian'
)}
componentProps
=
{
props
}
/>
;
//const AsyncXJCtrlModel = props => <AsyncLoader load={import('../view/bizview/xunjian')} componentProps={props} />;
const
AsyncXJCtrlModel
=
props
=>
<
AsyncLoader
load
=
{
import
(
'../view/bizview/xunjian/XJIndex'
)}
componentProps
=
{
props
}
/>
;
const
AsyncDifferentiate
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/bizview/intelligentDifferentiate/DifferentiateView'
)}
componentProps
=
{
props
}
/>
;
const
AsyncAlarmVideoMonitor
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/bizview/alarmVideoMonitor'
)}
componentProps
=
{
props
}
/>
;
const
AsyncAlarmTestView
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/bizview/alarm'
)}
componentProps
=
{
props
}
/>
;
...
...
@@ -61,6 +62,8 @@ const AsyncIot3DGraphBiz = props => <AsyncLoader load={import('./../view/planMgm
const
AsyncShareTextPlan
=
props
=>
<
AsyncLoader
load
=
{
import
(
'./../view/planMgmt/view/ShareTextPlan'
)}
componentProps
=
{
props
}
/>
;
const
AsyncPublishApp
=
props
=>
<
AsyncLoader
load
=
{
import
(
'amos-iot-3dgraph/lib/view/pubview'
)}
componentProps
=
{
props
}
/>
;
const
AsyncModelEdit
=
props
=>
<
AsyncLoader
load
=
{
import
(
'amos-iot-3dgraph/lib/view/modelMgmt/edit/ModelEdit'
)}
componentProps
=
{
props
}
/>
;
const
AsyncUserModel
=
props
=>
<
AsyncLoader
load
=
{
import
(
'../view/bizview/user'
)}
componentProps
=
{
props
}
/>
;
const
Routes
=
{
// 添加 rules 路由
...
...
@@ -108,7 +111,8 @@ const Routes = {
alarmTest
:
AsyncAlarmTestView
,
vizlib
:
AsyncCusVizLib
,
modelManage
:
AsyncGraph3DModel
,
leaderStruct
:
AsyncLeaderStruct
leaderStruct
:
AsyncLeaderStruct
,
userModel
:
AsyncUserModel
};
const
pageCompontent
=
key
=>
{
...
...
src/routes/view.js
View file @
7f579d70
...
...
@@ -44,7 +44,8 @@ import Graph3DModel from 'amos-iot-3dgraph/lib/view/modelMgmt';
import
FireStrengthResourceView
from
'./../view/bizview/equipmentLedger/FireResources/FireStrength'
;
import
FireStationMatches
from
'./../view/bizview/equipmentLedger/FireResources/matchEquipment/FireStationMatches'
;
import
XJCtrlModel
from
'../view/bizview/xunjian'
;
//import XJCtrlModel from '../view/bizview/xunjian';
import
XJCtrlModel
from
'../view/bizview/xunjian/XJIndex'
;
import
DifferentiateView
from
'./../view/bizview/intelligentDifferentiate/DifferentiateView'
;
import
AlarmVideoMonitor
from
'./../view/bizview/alarmVideoMonitor'
;
import
alarmTestView
from
'./../view/bizview/alarm'
;
...
...
@@ -53,6 +54,7 @@ import CusVizLib from './../view/planMgmt/cusVizLib';
import
PublishView
from
'./../view/planMgmt/view'
;
import
PanoramicMonitor
from
'./../view/panoramicMonitor'
;
import
LeaderStruct
from
'./../view/planMgmt/view/leaderStruct'
;
import
UserModel
from
'../view/bizview/user'
;
const
Routes
=
{
// 添加 rules 路由
...
...
@@ -99,7 +101,8 @@ const Routes = {
vizlib
:
CusVizLib
,
planDrill
:
PublishView
,
modelManage
:
Graph3DModel
,
leaderStruct
:
LeaderStruct
leaderStruct
:
LeaderStruct
,
userModel
:
UserModel
};
const
pageCompontent
=
key
=>
{
...
...
src/services/securityService.js
View file @
7f579d70
...
...
@@ -7,7 +7,7 @@ import formatUrl from 'amos-processor/lib/utils/urlFormat';
import
{
Store
}
from
'amos-tool'
;
import
{
secExtUrl
}
from
'./../consts/urlConsts'
;
import
{
commonGet
,
commonPost
,
commonDelete
}
from
'./../utils/request'
;
import
{
FasSerUrl
}
from
'./../consts/urlConsts'
;
import
{
FasSerUrl
,
getOutterURL
}
from
'./../consts/urlConsts'
;
import
SecurityConsts
from
'./../consts/securityConsts'
;
const
lsTool
=
Store
.
lsTool
;
...
...
@@ -119,4 +119,14 @@ export const logoutAction = () => {
// 清空所有
lsTool
.
clearAll
();
return
commonDelete
(
secExtUrl
.
loginOutUrl
);
};
\ No newline at end of file
};
// export const avoidLoginAction = (loginId, accessToken, expireTime, appType) => {
// return commonGet(formatUrl(secExtUrl.avoidLoginUrl, { loginId, accessToken, expireTime, appType }));
// };
export
const
userModelURIAction
=
()
=>
{
const
token
=
lsTool
.
read
(
'token'
);
let
url
=
formatUrl
(
getOutterURL
(
'userModelURI'
),
{
token
});
return
url
;
};
src/view/autoLogin/AutoLogin.js
View file @
7f579d70
import
React
,
{
Component
}
from
'react'
;
import
{
browserHistory
}
from
'amos-react-router'
;
import
{
Store
,
LocationParam
}
from
'amos-tool'
;
import
{
avoidLoginAction
}
from
'./../../services/securityService'
;
const
lsTool
=
Store
.
lsTool
;
// const AmosConfig = endConf.AmosConfig;
...
...
@@ -38,9 +36,26 @@ class AutoLogin extends Component {
componentWillMount
()
{
let
token
=
LocationParam
.
getLocationParamByName
(
'token'
);
// let accessToken = LocationParam.getLocationParamByName('accessToken');
// let expireTime = LocationParam.getLocationParamByName('effectiveTime');
// let loginId = LocationParam.getLocationParamByName('username');
if
(
token
)
{
browserHistory
.
push
(
'/region'
);
}
// if (accessToken){
// browserHistory.push('/region');
// token = lsTool.read('token');
// console.log('平台token: ', token);
// window.open(opAvoidLoginAction(token));
// avoidLoginAction(loginId, accessToken, expireTime, 'amos').then(
// data => {
// if (data.toke){
// console.log('平台token: ', data.toke);
// window.open(opAvoidLoginAction(data.toke));
// }
// }
// );
// }
}
render
()
{
...
...
@@ -49,4 +64,4 @@ class AutoLogin extends Component {
}
export
default
AutoLogin
;
\ No newline at end of file
export
default
AutoLogin
;
src/view/bizview/user/index.js
0 → 100644
View file @
7f579d70
import
React
,
{
Component
}
from
'react'
;
import
{
userModelURIAction
}
from
'./../../../services/securityService'
;
/**
* 用户管理
*
* @class UserModel
* @extends {Component}
*/
class
UserModel
extends
Component
{
componentWillMount
(){
window
.
open
(
userModelURIAction
(),
'_self'
);
}
render
()
{
return
null
;
}
}
UserModel
.
propTypes
=
{
};
export
default
UserModel
;
src/view/bizview/xunjian/XJIndex.js
0 → 100644
View file @
7f579d70
import
React
,
{
Component
}
from
'react'
;
import
{
IFrame
}
from
'amos-framework'
;
import
{
Store
}
from
'amos-tool'
;
import
SysConsts
from
'amos-processor/lib/config/consts'
;
import
formatUrl
from
'amos-processor/lib/utils/urlFormat'
;
import
{
getOutterURL
}
from
'../../../consts/urlConsts'
;
const
lsTool
=
Store
.
lsTool
;
/**
* 管控模型
*
* @class MgtCtrlModel
* @extends {Component}
*/
class
XJIndex
extends
Component
{
render
()
{
const
reginParams
=
JSON
.
parse
(
lsTool
.
read
(
'CURRENT_REGION'
));
const
token
=
lsTool
.
read
(
SysConsts
.
token
);
const
companyId
=
reginParams
.
company
.
sequenceNbr
;
const
deptId
=
reginParams
.
department
.
sequenceNbr
;
const
roleId
=
reginParams
.
role
.
sequenceNbr
;
//const orgCode = JSON.parse(region).orgCode;
const
url
=
formatUrl
(
getOutterURL
(
'xunjian'
),
{
token
,
companyId
,
deptId
,
roleId
});
return
(
<
div
className
=
"rule-model"
>
<
IFrame
url
=
{
url
}
width
=
"100%"
height
=
"100%"
display
=
"initial"
position
=
"relative"
allowFullScreen
scrolling
=
"auto"
/>
<
/div
>
);
}
}
XJIndex
.
propTypes
=
{
};
export
default
XJIndex
;
src/view/region/index.js
View file @
7f579d70
...
...
@@ -106,6 +106,7 @@ import { getCurrentUser, regionSelectAction} from './../../services/securityServ
import
*
as
endConf
from
'amos-processor/lib/config/endconf'
;
import
_amosTool
from
'amos-tool'
;
import
SysConsts
from
'amos-processor/lib/config/consts'
;
import
{
setRegion
}
from
'UTILS/cacheUtils'
;
const
lsTool
=
Store
.
lsTool
;
const
ls
=
_amosTool
.
Store
.
lsTool
;
const
AmosConfig
=
endConf
.
AmosConfig
;
...
...
@@ -140,6 +141,7 @@ class RegionSelect extends Component {
lsTool
.
write
(
'selectedRole'
,
sequenceNbr
);
lsTool
.
write
(
'curCompanyName'
,
reginParams
.
company
.
companyName
);
lsTool
.
write
(
'orgCode'
,
reginParams
.
company
.
orgCode
);
setRegion
(
reginParams
);
regionSelectAction
(
reginParams
).
then
(
data
=>
{
//1.打开3d屏
...
...
@@ -158,6 +160,7 @@ class RegionSelect extends Component {
const
{
companys
=
[],
companyDepartments
=
{},
orgRoles
=
{}
}
=
this
.
state
.
userInfo
;
const
{
reginParams
}
=
this
.
state
;
let
{
departments
=
[],
roles
=
[]
}
=
this
.
state
;
if
(
key
===
'company'
)
{
reginParams
.
company
=
companys
.
find
(
item
=>
item
.
sequenceNbr
===
value
);
departments
=
companyDepartments
[
value
];
...
...
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