config.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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://10.0.0.201:8080/#/`,
  130. // path: `https://${window.location.hostname}:8080/#/`,
  131. }
  132. const CURRENT_STATION = {
  133. name: '济阳门站',
  134. code: 'JYMZ',
  135. center: [117.16449326547945, 36.98251852781648, 0],
  136. perspective: {
  137. destination: {
  138. x: -2328921.7606462426,
  139. y: 4538563.992673427,
  140. z: 3815788.2687797816,
  141. },
  142. orientation: {
  143. pitch: -0.29113542476570187,
  144. heading: 0.605754941690825,
  145. roll: 0.0000010315360015056285,
  146. },
  147. },
  148. }
  149. const LAYER_CONFIG = {
  150. name: '济南管道',
  151. code: 'JNGD',
  152. type: 'pipeline',
  153. visible: true,
  154. layerList: [
  155. {
  156. id: 'areaLayer',
  157. code: 'areaLayer',
  158. name: '区域图层',
  159. children: [],
  160. },
  161. {
  162. id: 'lineLayer',
  163. code: 'lineLayer',
  164. name: '管道图层',
  165. children: [],
  166. },
  167. {
  168. id: 'personLayer',
  169. code: 'personLayer',
  170. name: '人员图层',
  171. children: [],
  172. },
  173. ],
  174. }
  175. const GY_STATIONS = [
  176. {
  177. id: '784104499768729600',
  178. name: '托克托作业区',
  179. code: 'TKT',
  180. buildId: '784102618438836224',
  181. positioningBuildId: '100001',
  182. direction: 'right',
  183. position: [106.6263209022603, 26.650585399041464, 1.4657059185197159],
  184. layers: ['周界', '泄漏', '摄像头'],
  185. },
  186. {
  187. id: '784131093203787776',
  188. name: '托克托压气站',
  189. code: 'TKT',
  190. buildId: '784102618438836224',
  191. positioningBuildId: '100001',
  192. direction: 'right',
  193. position: [106.6263209022603, 26.650585399041464, 1.4657059185197159],
  194. layers: ['周界', '泄漏', '摄像头'],
  195. // webRTCUrl: "wss://dispatcher:1443/webrtc",
  196. // admin: "8889",
  197. // password: "123456",
  198. }
  199. ]
  200. const GY_ZYQS = [
  201. {
  202. id: '784131018197049344',
  203. name: '托克托作业区',
  204. code: 'TKTZYQ',
  205. buildId: '654044537953460225',
  206. },
  207. ]
  208. /**
  209. * 首页展示激光云台视频窗口配置
  210. * 已启用
  211. * 后续改成接口获取
  212. */
  213. const GY_JGYT_CONFIG = [
  214. {
  215. id: '1',
  216. name: '托克托作业区',
  217. children: [
  218. {
  219. id: '101',
  220. name: '托克托压气站',
  221. children: [
  222. {
  223. id: '786542179467141120',
  224. name: '激光检测1',
  225. ndTag: 'JGYT1_ND',
  226. },
  227. {
  228. id: '786542180738015232',
  229. name: '激光检测2',
  230. ndTag: 'JGYT2_ND',
  231. },
  232. ],
  233. },]
  234. }
  235. ]
  236. /**
  237. * mqtt地址
  238. * 判断是否被iframe嵌套
  239. * 判断是否https
  240. */
  241. const VUE_APP_BASE_WS = () => {
  242. // 暂时没有https需求,强制写死
  243. // return "ws://" + window.location.host + BASE_URL;
  244. if (window.self !== window.top) {
  245. // 在iframe中,使用iframe的地址
  246. const str = window.self.location.protocol === 'https:' ? 'wss://' : 'ws://'
  247. return str + window.self.location.host + BASE_URL
  248. } else {
  249. // 不在iframe中,使用当前地址
  250. const str = window.location.protocol === 'https:' ? 'wss://' : 'ws://'
  251. return str + window.location.host + BASE_URL
  252. }
  253. }