Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
motorCity
Overview
Overview
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
node_server
motorCity
Commits
08cd260f
Commit
08cd260f
authored
Aug 24, 2022
by
孙香冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4c2e0f62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
data.ts
src/biz/jgfwnl/data.ts
+5
-4
serverConfig.ts
src/config/serverConfig.ts
+13
-5
No files found.
src/biz/jgfwnl/data.ts
View file @
08cd260f
import
{
getChartOutData
,
getKeyValueNumberOutData
,
getListOutData
}
from
"../../cal/out"
;
import
{
separateDataAndUint
}
from
"../../cal/privateTools"
;
import
{
getImageIp
,
port
}
from
"../../config/serverConfig"
;
import
{
getImageIp
,
latConfig
,
lngConfig
,
port
,
surveillanceVideoConfig
,
zoomConfig
}
from
"../../config/serverConfig"
;
import
{
getHardware
}
from
"../../data/interface/hardwareData"
;
import
{
getCsgkData
,
getDetachmentRatio
,
getTestAnalysis
,
getTestTotalTime
}
from
"../../data/interface/interfaceService"
;
import
{
getMap
}
from
"../../data/interface/mapInterfaceData"
;
...
...
@@ -46,7 +46,7 @@ export async function getCSGK(req, res) {
ret
[
"api5"
]
=
getKeyValueNumberOutData
(
"测试牌照分布"
,
测试牌照分布
data
);
let
路侧监控视频
data
=
{
"src"
:
"http://10.51.50.53:8278/live/13060200882000000001@31011402601318800184@34020000001320000001.m3u8?vhost=bduv0utmss4c3nzidjn.a.e-web.com.cn"
,
"type"
:
'application/x-mpegURL'
};
let
路侧监控视频
data
=
{
"src"
:
surveillanceVideoConfig
,
"type"
:
'application/x-mpegURL'
};
ret
[
"api6"
]
=
({
title
:
"路侧监控视频"
,
dataList
:
路侧监控视频
data
});
res
.
send
(
ret
);
...
...
@@ -151,9 +151,9 @@ export async function mapData(req, res) {
}
]
ret
[
"mapCenter"
]
=
{
lng
:
121.183574
,
lat
:
31.291126
};
ret
[
"mapCenter"
]
=
{
lng
:
lngConfig
,
lat
:
latConfig
};
ret
[
"zoom"
]
=
{
key
:
"缩放比例"
,
value
:
14
};
ret
[
"zoom"
]
=
{
key
:
"缩放比例"
,
value
:
zoomConfig
};
res
.
send
(
ret
);
}
\ No newline at end of file
src/config/serverConfig.ts
View file @
08cd260f
...
...
@@ -19,9 +19,10 @@ export let mongoServerConstVal;
export
let
mySqlConfig
;
let
imagePathConfig
=
""
;
let
mapCenter
=
""
;
let
zoom
=
""
;
let
surveillanceVideo
=
""
;
export
let
lngConfig
=
""
;
export
let
latConfig
=
""
;
export
let
zoomConfig
=
""
;
export
let
surveillanceVideoConfig
=
""
;
const
ConfigName
=
"serverConfig.xml"
;
export
async
function
initConfig
()
{
...
...
@@ -31,7 +32,7 @@ export async function initConfig() {
let
configInfo
:
any
=
await
analysisXml
(
configStr
);
if
(
!
configInfo
||
!
configInfo
.
config
)
console
.
log
(
"xml中无配置加载"
);
else
{
let
{
portConfig
,
socketPortConfig
,
rightView
,
leftView
,
mapView
,
imagePath
}
=
configInfo
.
config
;
let
{
portConfig
,
socketPortConfig
,
rightView
,
leftView
,
mapView
,
imagePath
,
mapCenter
,
zoom
,
surveillanceVideo
}
=
configInfo
.
config
;
if
(
!
getConf
(
portConfig
))
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 port'
);
if
(
!
getConf
(
socketPortConfig
))
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 sockentPort'
);
if
(
!
getConf
(
rightView
))
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 rightView'
);
...
...
@@ -44,6 +45,8 @@ export async function initConfig() {
if
(
!
getConf
(
imagePath
)
)
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 imagePath'
);
if
(
!
getConf
(
mapCenter
)
)
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 mapCenter'
);
if
(
!
getConf
(
zoom
)
)
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 zoom'
);
if
(
!
getConf
(
surveillanceVideo
)
)
throw
new
SysError
(
SYSTEMERRORENUM
.
初始化配置失败
,
'serverConfig.xml中 缺少 surveillanceVideo'
);
port
=
portConfig
[
0
];
socketPort
=
socketPortConfig
[
0
];
//左屏
...
...
@@ -59,7 +62,12 @@ export async function initConfig() {
//图片地址
imagePathConfig
=
imagePath
[
0
];
//地图中心点
mapCenter
=
lngConfig
=
mapCenter
[
0
].
lng
[
0
];
latConfig
=
mapCenter
[
0
].
lat
[
0
];
//缩放比
zoomConfig
=
zoom
[
0
];
//监控视频
surveillanceVideoConfig
=
surveillanceVideo
[
0
];
}
console
.
log
(
"config init success"
);
...
...
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