constant.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // 服务端地址
  2. // const BASE_URI = process.env.VUE_APP_WEB // 利用环境变量
  3. // const BASE_URI = '/webServer' // 代理模式代理地址
  4. // const BASE_URI = 'https://www.idea-co-sf.com/settleDownApi'
  5. const BASE_URI = 'http://10.1.4.70/settleDownApi' // 正式
  6. const WEB_URL = 'https://2.21.138.147:8080/lifeline' // 正式
  7. const Scale_Size = null
  8. // 地图常量
  9. // 测试
  10. // const MAP_DEFAULT_ZOOM = 11
  11. // const MAP_MAX_ZOOM = 19
  12. // const Max_Scale = 1300
  13. // const MAP_URL = 'https://js.arcgis.com/4.27/'
  14. // const MAP_CSS = 'https://js.arcgis.com/4.27/esri/themes/light/main.css'
  15. // const MAP_BASE_URL = 'http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer'
  16. // 正式
  17. // const MAP_DEFAULT_ZOOM = 3
  18. // const MAP_MAX_ZOOM = getWidth()
  19. // const Max_Scale = 500
  20. // const MAP_URL = 'http://2.20.41.2:8083/arcgisjs2.24/arcgis_js_api/javascript/4.24/init.js'
  21. // const MAP_CSS = 'http://2.20.41.2:8083/arcgisjs2.24/arcgis_js_api/javascript/4.24/esri/themes/light/main.css'
  22. // const MAP_BASE_URL = 'http://2.21.138.152:6080/geoscene/rest/services/BM/%E7%AE%A1%E7%BA%BF%E6%B7%B1%E8%89%B2%E5%BA%95%E5%9B%BE/MapServer'
  23. const MAP_DEFAULT_ZOOM = 3
  24. const MAP_MAX_ZOOM = getWidth()
  25. const Max_Scale = 500
  26. // const MAP_URL = 'https://2.21.138.147:8080/mapfile/init.js'
  27. // const MAP_CSS = 'https://2.21.138.147:8080/mapfile/esri/themes/light/main.css'
  28. const MAP_URL = 'https://2.21.138.152:8003/arcgisjs2.24/arcgis_js_api/javascript/4.24/init.js'
  29. const MAP_CSS = 'https://2.21.138.152:8003/arcgisjs2.24/arcgis_js_api/javascript/4.24/esri/themes/light/main.css'
  30. const MAP_BASE_URL = 'https://2.21.138.152:6443/geoscene/rest/services/BM/%E7%AE%A1%E7%BA%BF%E6%B7%B1%E8%89%B2%E5%BA%95%E5%9B%BE/MapServer'
  31. const MAP_BASE_URL1 = 'https://2.21.138.152:6443/geoscene/rest/services/BM/500%E6%AF%94%E4%BE%8B%E5%B0%BA%E5%9F%BA%E5%87%86/WXSQMAP/MapServer'
  32. const MAP_BASE_URL2 = 'https://2.21.138.152:6443/geoscene/rest/services/BM/500%E6%AF%94%E4%BE%8B%E5%B0%BA%E5%9F%BA%E5%87%86/2022wxsqdom1/MapServer'
  33. // 系统常量
  34. const DATE_PATTERN = {
  35. DATE_TIME_H: 'yyyy-MM-dd HH:mm:ss',
  36. DATE_TIME_h: 'yyyy-MM-dd hh:mm:ss',
  37. DATE_TIME_s_h: 'MM-dd hh:mm',
  38. DATE: 'yyyy-MM-dd',
  39. MONTH: 'yyyy-MM',
  40. TIME: 'hh:mm:ss'
  41. }
  42. function getWidth() {
  43. // 屏幕小于4800px时降低聚合点放大层级,防止过度放到看不到点位
  44. // if(window.screen.width<=4800){
  45. return 7
  46. // }
  47. }
  48. // 0-燃气,1-内涝,2-供水,3-施工工程,4-地下管线,5-桥梁,6-道路,
  49. const SCENE_MAP = new Map()
  50. .set('0', '燃气')
  51. .set('1', '内涝')
  52. .set('2', '供水')
  53. .set('5', '桥梁')
  54. .set('6', '道路')
  55. .set('4', '地下管线')
  56. .set('3', '第三方施工') // 对照表
  57. const RISK_GRADE = new Map()
  58. .set('重大', '4')
  59. .set('较大', '3')
  60. .set('一般', '2')
  61. .set('低', '1')
  62. const SHIJIAN_GRADE = new Map()
  63. .set('重大', '4')
  64. .set('较大', '3')
  65. .set('一般', '2')
  66. .set('低', '1')
  67. const YINHUAN_GRADE = new Map()
  68. .set('重大', '4')
  69. .set('较大', '3')
  70. .set('一般', '2')
  71. .set('低', '1')
  72. const AREA_MAP = new Map()
  73. .set('梁溪区', '320213')
  74. .set('滨湖区', '320211')
  75. .set('惠山区', '320206')
  76. .set('新吴区', '320214')
  77. .set('锡山区', '320205')
  78. .set('经开区', '320299')
  79. .set('江阴市', '320281')
  80. .set('宜兴市', '320282')
  81. const PARAM_TYPE = [
  82. { value: 'string', label: 'string' },
  83. { value: 'date', label: 'date' },
  84. { value: 'time', label: 'time' },
  85. { value: 'datetime', label: 'datetime' },
  86. { value: 'number', label: 'number' }
  87. ]
  88. const PICKER_OPTION = {
  89. shortcuts: [
  90. {
  91. text: '最近一周',
  92. onClick: function(picker) {
  93. const end = new Date()
  94. const start = new Date()
  95. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
  96. picker.$emit('pick', [start, end])
  97. }
  98. },
  99. {
  100. text: '最近一个月',
  101. onClick: function(picker) {
  102. const end = new Date()
  103. const start = new Date()
  104. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
  105. picker.$emit('pick', [start, end])
  106. }
  107. },
  108. {
  109. text: '最近三个月',
  110. onClick: function(picker) {
  111. const end = new Date()
  112. const start = new Date()
  113. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
  114. picker.$emit('pick', [start, end])
  115. }
  116. }
  117. ]
  118. }
  119. const KEY_RESULT = 'result'
  120. const KEY_TOKEN = 'token'
  121. const KEY_USER = 'user_'
  122. const KEY_USER_TYPE = 'userType' // 用户模式 : 平台管理 - 1 , 合作方管理 - 2
  123. const KEY_BIZ = 'biz_'
  124. const KEY_CODE = 'code'
  125. const KEY_MSG = 'msg'
  126. const KEY_MSG_ORDER = 'msgOrder'
  127. const KEY_USER_MENU = 'menu'
  128. // 业务常量
  129. export default {
  130. Scale_Size,
  131. Max_Scale, // 不聚合最大层级
  132. /* 服务端地址*/
  133. BASE_URI,
  134. WEB_URL,
  135. /* 系统常量*/
  136. // 时间模版
  137. DATE_PATTERN,
  138. // 结果关键字
  139. KEY_RESULT,
  140. // token关键字
  141. KEY_TOKEN,
  142. // 缓存用户key
  143. KEY_USER,
  144. KEY_BIZ,
  145. // 缓存用户类型key
  146. KEY_USER_TYPE,
  147. KEY_USER_MENU,
  148. KEY_CODE,
  149. KEY_MSG,
  150. KEY_MSG_ORDER,
  151. // 系统参数类型
  152. PARAM_TYPE,
  153. // 时间简易选项
  154. PICKER_OPTION,
  155. // 字典关键字
  156. /* 业务常量*/
  157. SCENE_MAP,
  158. AREA_MAP,
  159. RISK_GRADE,
  160. SHIJIAN_GRADE,
  161. YINHUAN_GRADE,
  162. MAP_URL,
  163. MAP_CSS,
  164. MAP_DEFAULT_ZOOM,
  165. MAP_MAX_ZOOM,
  166. MAP_BASE_URL,
  167. MAP_BASE_URL1,
  168. MAP_BASE_URL2
  169. }