const RND = Math.random() /** * 接口地址 */ const BASE_URL = '/yapi' //开发接口代理 /** * 界面配置 */ const HOME_DATA = { startDate: '2024-11-27', group: '国家管网集团北京管道有限公司', company: '内蒙古输油气分公司', curStation: '托克托压气站', } /** * 场站配置 */ const STATION_LIST = [ { name: '托克托', configUrl: '/json/glyConfig.json', cameraUrl: '/json/glyCamera.json', }, ] //以下内容为新版本所需要的配置,未来持续迭代 /** * 页面内标题 已生效 */ const SYSTEM_TITLE = '托克托压气站人员进出站登记终端' /** * 设置浏览器标题 已生效 */ document.title = SYSTEM_TITLE /** * 模块启用状态 部分生效 */ const MODULE_ENABLED = { /** * 定位系统 */ positioning: { /** * 定位启用状态 */ enabled: false, /** * 人员报警启用状态 */ personAlarm: false, /** * 围栏报警启用状态 */ railAlarm: false, /** * 区域报警启用状态 */ areaAlarm: false, /** * 聚集报警 */ gatherAlarm: false, }, } /** * 地图配置 Cesium.UrlTemplateImageryProvider实例 已生效 * * key1:9a5079c684abb9ab2cae02119587ca18  原有 * key2:c7074dacd421b3e1ba311392c4b6923f  后台管理 * key3:f3ddf0996b8f5b1c876094cdcb35faab  自己的 */ const MAP_CONFIG = { // url: 'http://t{s}.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles&tk=c7074dacd421b3e1ba311392c4b6923f', url: 'static/tkt/{z}/{x}/{y}.png', maximumLevel: 18, subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'], } /** * 模型配置 目前仅为3dtiles的设置,未来遇到其他类型再重构 */ const MODEL_CONFIG = { /** * 是否启用模型 */ enabled: true, /** * 是否启用分层模型,enabled=true为前提 */ floorEnabled: true, location: { longitude: 0, //经度 latitude: 0, //纬度 }, scale: 1, map: {}, } /** * 视频播放地址 已生效 */ const VIDEO_PLAYER_CONFIG = 'http://[ip]:5000/NVRPlayer/Play?id=' /** * MQTT配置 已启用 */ const MQTT_CONFIG = { /** * ws主机地址 ws://ip:port/endpoint */ host: '/MQTTOverWebSocket', //"ws://127.0.0.1:18908/MQTTOverWebSocket", /** * client名称前缀 */ clientIdPrefix: 'mapclient', /** * 用户名 */ username: 'client', /** * 密码 */ password: '19c9547ad2029be96774fce5f1b9f099', /** * 订阅主题 单字符串or字符串数组 */ topic: [ 'Message/New', 'AccessControl/Log/#', ], } //后台管理根路径 const ISMSAdminWeb = { path: `https://${window.location.hostname}:8080/#/`, } const CURRENT_STATION = { name: '济阳门站', code: 'JYMZ', center: [117.16449326547945, 36.98251852781648, 0], perspective: { destination: { x: -2328921.7606462426, y: 4538563.992673427, z: 3815788.2687797816, }, orientation: { pitch: -0.29113542476570187, heading: 0.605754941690825, roll: 0.0000010315360015056285, }, }, } const LAYER_CONFIG = { name: '济南管道', code: 'JNGD', type: 'pipeline', visible: true, layerList: [ { id: 'areaLayer', code: 'areaLayer', name: '区域图层', children: [], }, { id: 'lineLayer', code: 'lineLayer', name: '管道图层', children: [], }, { id: 'personLayer', code: 'personLayer', name: '人员图层', children: [], }, ], } const GY_STATIONS = [ { id: '784104499768729600', name: '托克托作业区', code: 'TKT', buildId: '784102618438836224', positioningBuildId: '100001', direction: 'right', position: [106.6263209022603, 26.650585399041464, 1.4657059185197159], layers: ['周界', '泄漏', '摄像头'], }, { id: '784131093203787776', name: '托克托压气站', code: 'TKT', buildId: '784102618438836224', positioningBuildId: '100001', direction: 'right', position: [106.6263209022603, 26.650585399041464, 1.4657059185197159], layers: ['周界', '泄漏', '摄像头'], // webRTCUrl: "wss://dispatcher:1443/webrtc", // admin: "8889", // password: "123456", } ] const GY_ZYQS = [ { id: '784131018197049344', name: '托克托作业区', code: 'TKTZYQ', buildId: '654044537953460225', }, ] /** * 首页展示激光云台视频窗口配置 * 已启用 * 后续改成接口获取 */ const GY_JGYT_CONFIG = [ { id: '1', name: '托克托作业区', children: [ { id: '101', name: '托克托压气站', children: [ { id: '786542179467141120', name: '激光检测1', ndTag: 'JGYT1_ND', }, { id: '786542180738015232', name: '激光检测2', ndTag: 'JGYT2_ND', }, ], },] } ] /** * mqtt地址 * 判断是否被iframe嵌套 * 判断是否https */ const VUE_APP_BASE_WS = () => { // 暂时没有https需求,强制写死 // return "ws://" + window.location.host + BASE_URL; if (window.self !== window.top) { // 在iframe中,使用iframe的地址 const str = window.self.location.protocol === 'https:' ? 'wss://' : 'ws://' return str + window.self.location.host + BASE_URL } else { // 不在iframe中,使用当前地址 const str = window.location.protocol === 'https:' ? 'wss://' : 'ws://' return str + window.location.host + BASE_URL } }