Commit 08cd260f by 孙香冬

no message

parent 4c2e0f62
import { getChartOutData, getKeyValueNumberOutData, getListOutData } from "../../cal/out"; import { getChartOutData, getKeyValueNumberOutData, getListOutData } from "../../cal/out";
import { separateDataAndUint } from "../../cal/privateTools"; 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 { getHardware } from "../../data/interface/hardwareData";
import { getCsgkData, getDetachmentRatio, getTestAnalysis, getTestTotalTime } from "../../data/interface/interfaceService"; import { getCsgkData, getDetachmentRatio, getTestAnalysis, getTestTotalTime } from "../../data/interface/interfaceService";
import { getMap } from "../../data/interface/mapInterfaceData"; import { getMap } from "../../data/interface/mapInterfaceData";
...@@ -46,7 +46,7 @@ export async function getCSGK(req, res) { ...@@ -46,7 +46,7 @@ export async function getCSGK(req, res) {
ret["api5"] = getKeyValueNumberOutData("测试牌照分布", 测试牌照分布data); 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}); ret["api6"] = ({title:"路侧监控视频", dataList: 路侧监控视频data});
res.send(ret); res.send(ret);
...@@ -151,9 +151,9 @@ export async function mapData(req, res) { ...@@ -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); res.send(ret);
} }
\ No newline at end of file
...@@ -19,9 +19,10 @@ export let mongoServerConstVal; ...@@ -19,9 +19,10 @@ export let mongoServerConstVal;
export let mySqlConfig; export let mySqlConfig;
let imagePathConfig = ""; let imagePathConfig = "";
let mapCenter = ""; export let lngConfig = "";
let zoom = ""; export let latConfig = "";
let surveillanceVideo = ""; export let zoomConfig = "";
export let surveillanceVideoConfig = "";
const ConfigName = "serverConfig.xml"; const ConfigName = "serverConfig.xml";
export async function initConfig() { export async function initConfig() {
...@@ -31,7 +32,7 @@ export async function initConfig() { ...@@ -31,7 +32,7 @@ export async function initConfig() {
let configInfo:any = await analysisXml(configStr); let configInfo:any = await analysisXml(configStr);
if (!configInfo || !configInfo.config) console.log("xml中无配置加载"); if (!configInfo || !configInfo.config) console.log("xml中无配置加载");
else { 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(portConfig)) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 port');
if ( !getConf(socketPortConfig)) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 sockentPort'); if ( !getConf(socketPortConfig)) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 sockentPort');
if ( !getConf(rightView)) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 rightView'); if ( !getConf(rightView)) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 rightView');
...@@ -44,6 +45,8 @@ export async function initConfig() { ...@@ -44,6 +45,8 @@ export async function initConfig() {
if ( !getConf(imagePath) ) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 imagePath'); if ( !getConf(imagePath) ) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 imagePath');
if ( !getConf(mapCenter) ) throw new SysError(SYSTEMERRORENUM.初始化配置失败, 'serverConfig.xml中 缺少 mapCenter'); 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]; port = portConfig[0];
socketPort = socketPortConfig[0]; socketPort = socketPortConfig[0];
//左屏 //左屏
...@@ -59,7 +62,12 @@ export async function initConfig() { ...@@ -59,7 +62,12 @@ export async function initConfig() {
//图片地址 //图片地址
imagePathConfig = imagePath[0]; 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"); console.log("config init success");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment