config.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. const RND = Math.random()
  2. /**
  3. * 接口地址
  4. */
  5. const BASE_URL = '/yapi' //开发接口代理
  6. /**
  7. * 界面配置
  8. */
  9. const HOME_DATA = {
  10. startDate: '2024-11-27',
  11. group: '国家管网集团北京管道有限公司',
  12. company: '内蒙古输油气分公司',
  13. curStation: '托克托压气站',
  14. }
  15. /**
  16. * 场站配置
  17. */
  18. const STATION_LIST = [
  19. {
  20. name: '托克托',
  21. configUrl: '/json/glyConfig.json',
  22. cameraUrl: '/json/glyCamera.json',
  23. },
  24. ]
  25. //以下内容为新版本所需要的配置,未来持续迭代
  26. /**
  27. * 页面内标题 已生效
  28. */
  29. const SYSTEM_TITLE = '托克托压气站人员进出站登记终端'
  30. /**
  31. * 设置浏览器标题 已生效
  32. */
  33. document.title = SYSTEM_TITLE
  34. /**
  35. * 模块启用状态 部分生效
  36. */
  37. const MODULE_ENABLED = {
  38. /**
  39. * 定位系统
  40. */
  41. positioning: {
  42. /**
  43. * 定位启用状态
  44. */
  45. enabled: false,
  46. /**
  47. * 人员报警启用状态
  48. */
  49. personAlarm: false,
  50. /**
  51. * 围栏报警启用状态
  52. */
  53. railAlarm: false,
  54. /**
  55. * 区域报警启用状态
  56. */
  57. areaAlarm: false,
  58. /**
  59. * 聚集报警
  60. */
  61. gatherAlarm: false,
  62. },
  63. }
  64. /**
  65. * 地图配置 Cesium.UrlTemplateImageryProvider实例 已生效
  66. * * key1:9a5079c684abb9ab2cae02119587ca18  原有
  67. * key2:c7074dacd421b3e1ba311392c4b6923f  后台管理
  68. * key3:f3ddf0996b8f5b1c876094cdcb35faab  自己的
  69. */
  70. const MAP_CONFIG = {
  71. // 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',
  72. url: 'static/tkt/{z}/{x}/{y}.png',
  73. maximumLevel: 18,
  74. subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  75. }
  76. /**
  77. * 模型配置 目前仅为3dtiles的设置,未来遇到其他类型再重构
  78. */
  79. const MODEL_CONFIG = {
  80. /**
  81. * 是否启用模型
  82. */
  83. enabled: true,
  84. /**
  85. * 是否启用分层模型,enabled=true为前提
  86. */
  87. floorEnabled: true,
  88. location: {
  89. longitude: 0, //经度
  90. latitude: 0, //纬度
  91. },
  92. scale: 1,
  93. map: {},
  94. }
  95. /**
  96. * 视频播放地址 已生效
  97. */
  98. const VIDEO_PLAYER_CONFIG = 'http://[ip]:5000/NVRPlayer/Play?id='
  99. /**
  100. * MQTT配置 已启用
  101. */
  102. const MQTT_CONFIG = {
  103. /**
  104. * ws主机地址 ws://ip:port/endpoint
  105. */
  106. host: '/MQTTOverWebSocket', //"ws://127.0.0.1:18908/MQTTOverWebSocket",
  107. /**
  108. * client名称前缀
  109. */
  110. clientIdPrefix: 'mapclient',
  111. /**
  112. * 用户名
  113. */
  114. username: 'client',
  115. /**
  116. * 密码
  117. */
  118. password: '19c9547ad2029be96774fce5f1b9f099',
  119. /**
  120. * 订阅主题 单字符串or字符串数组
  121. */
  122. topic: [
  123. 'Message/New',
  124. 'AccessControl/Log/#',
  125. ],
  126. }
  127. //后台管理根路径
  128. const ISMSAdminWeb = {
  129. path: `https://${window.location.hostname}:8080/#/`,
  130. }
  131. const CURRENT_STATION = {
  132. name: '济阳门站',
  133. code: 'JYMZ',
  134. center: [117.16449326547945, 36.98251852781648, 0],
  135. perspective: {
  136. destination: {
  137. x: -2328921.7606462426,
  138. y: 4538563.992673427,
  139. z: 3815788.2687797816,
  140. },
  141. orientation: {
  142. pitch: -0.29113542476570187,
  143. heading: 0.605754941690825,
  144. roll: 0.0000010315360015056285,
  145. },
  146. },
  147. }
  148. const LAYER_CONFIG = {
  149. name: '济南管道',
  150. code: 'JNGD',
  151. type: 'pipeline',
  152. visible: true,
  153. layerList: [
  154. {
  155. id: 'areaLayer',
  156. code: 'areaLayer',
  157. name: '区域图层',
  158. children: [],
  159. },
  160. {
  161. id: 'lineLayer',
  162. code: 'lineLayer',
  163. name: '管道图层',
  164. children: [],
  165. },
  166. {
  167. id: 'personLayer',
  168. code: 'personLayer',
  169. name: '人员图层',
  170. children: [],
  171. },
  172. ],
  173. }
  174. const GY_STATIONS = [
  175. {
  176. id: '784104499768729600',
  177. name: '托克托作业区',
  178. code: 'TKT',
  179. buildId: '784102618438836224',
  180. positioningBuildId: '100001',
  181. direction: 'right',
  182. position: [106.6263209022603, 26.650585399041464, 1.4657059185197159],
  183. layers: ['周界', '泄漏', '摄像头'],
  184. },
  185. {
  186. id: '784131093203787776',
  187. name: '托克托压气站',
  188. code: 'TKT',
  189. buildId: '784102618438836224',
  190. positioningBuildId: '100001',
  191. direction: 'right',
  192. position: [106.6263209022603, 26.650585399041464, 1.4657059185197159],
  193. layers: ['周界', '泄漏', '摄像头'],
  194. // webRTCUrl: "wss://dispatcher:1443/webrtc",
  195. // admin: "8889",
  196. // password: "123456",
  197. }
  198. ]
  199. const GY_ZYQS = [
  200. {
  201. id: '784131018197049344',
  202. name: '托克托作业区',
  203. code: 'TKTZYQ',
  204. buildId: '654044537953460225',
  205. },
  206. ]
  207. /**
  208. * 首页展示激光云台视频窗口配置
  209. * 已启用
  210. * 后续改成接口获取
  211. */
  212. const GY_JGYT_CONFIG = [
  213. {
  214. id: '1',
  215. name: '托克托作业区',
  216. children: [
  217. {
  218. id: '101',
  219. name: '托克托压气站',
  220. children: [
  221. {
  222. id: '786542179467141120',
  223. name: '激光检测1',
  224. ndTag: 'JGYT1_ND',
  225. },
  226. {
  227. id: '786542180738015232',
  228. name: '激光检测2',
  229. ndTag: 'JGYT2_ND',
  230. },
  231. ],
  232. },]
  233. }
  234. ]
  235. /**
  236. * mqtt地址
  237. * 判断是否被iframe嵌套
  238. * 判断是否https
  239. */
  240. const VUE_APP_BASE_WS = () => {
  241. // 暂时没有https需求,强制写死
  242. // return "ws://" + window.location.host + BASE_URL;
  243. if (window.self !== window.top) {
  244. // 在iframe中,使用iframe的地址
  245. const str = window.self.location.protocol === 'https:' ? 'wss://' : 'ws://'
  246. return str + window.self.location.host + BASE_URL
  247. } else {
  248. // 不在iframe中,使用当前地址
  249. const str = window.location.protocol === 'https:' ? 'wss://' : 'ws://'
  250. return str + window.location.host + BASE_URL
  251. }
  252. }