pipeConfig.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. /**
  2. * 管线图层映照方法,本方法获取图层的Id做好是通过图层的name,如果图层管线顺序有变化则需要调整此处,
  3. * 必须保证此处与发布图层的内容一致
  4. */
  5. class PipeInfo {
  6. type = {
  7. company: 'company',
  8. client: 'client'
  9. }
  10. currentType="";
  11. constructor(){
  12. //本地环境
  13. // this.currentType=this.type.company;
  14. //客户环境
  15. this.currentType=this.type.client;
  16. }
  17. /**
  18. * 管线图层的映照管线,
  19. */
  20. pipeData = [
  21. {
  22. "id": 0,
  23. "name": "供水管网",
  24. "isPipe": false,
  25. },
  26. {
  27. "id": 1,
  28. "field":"waterinhead",
  29. "name": "取水头部",
  30. "isPipe": true,//是否属于管网
  31. },
  32. {
  33. "id": 2,
  34. "field":"waterintake",
  35. "name": "取水口",
  36. "isPipe": true
  37. },
  38. {
  39. "id": 3,
  40. "field":"waterspeak",
  41. "name": "水厂送水口",
  42. "isPipe": true
  43. },
  44. {
  45. "id": 4,
  46. "field":"waterhead",
  47. "name": "水厂",
  48. "isPipe": true
  49. },
  50. {
  51. "id": 5,
  52. "field":"waterpump",
  53. "name": "加压站",
  54. "isPipe": true,
  55. "isEquipment":true,//是否属于设备
  56. },
  57. {
  58. "id": 6,
  59. "field":"watermeter",
  60. "name": "水表",
  61. "isPipe": true,
  62. "isEquipment":true,//是否属于设备
  63. },
  64. {
  65. "id": 7,
  66. "field":"collectsite",
  67. "name": "水质取样点",
  68. "isPipe": true
  69. },
  70. {
  71. "id": 8,
  72. "field":"station",
  73. "name": "监测点",
  74. "isPipe": true
  75. },
  76. {
  77. "id": 9,
  78. "field":"valve",
  79. "name": "控制阀门",
  80. "isPipe": true,
  81. "isEquipment":true,//是否属于设备
  82. },
  83. {
  84. "id": 10,
  85. "field":"nonvalve",
  86. "name": "非控制阀",
  87. "isPipe": true,
  88. "isEquipment":true,//是否属于设备
  89. },
  90. {
  91. "id": 11,
  92. "field":"hydrant",
  93. "name": "消防栓",
  94. "isPipe": true,
  95. "isEquipment":true,//是否属于设备
  96. },
  97. {
  98. "id": 12,
  99. "field":"manhole",
  100. "name": "检查井",
  101. "isPipe": true,
  102. "isEquipment":true,//是否属于设备
  103. },
  104. {
  105. "id": 13,
  106. "field":"inspectsite",
  107. "name": "排污点",
  108. "isPipe": true
  109. },
  110. {
  111. "id": 14,
  112. "field":"pipenode",
  113. "name": "节点",
  114. "isPipe": true
  115. },
  116. {
  117. "id": 15,
  118. "field":"standpipe",
  119. "name": "立管",
  120. "isPipe": true,
  121. "isLine":true,//是否属于线
  122. },
  123. {
  124. "id": 16,
  125. "field":"pipe",
  126. "name": "管线",
  127. "isPipe": true,
  128. "isLine":true,//是否属于线
  129. },
  130. {
  131. "id": 17,
  132. "field":"region",
  133. "name": "管网片区",
  134. },
  135. {
  136. "id": 18,
  137. "name": "井盖",
  138. "field":"wellvover",
  139. "isPipe": false,
  140. "isEquipment":true,//是否属于设备
  141. },
  142. {
  143. "id": 19,
  144. "name": "图幅框",
  145. "isPipe": false
  146. },
  147. {
  148. "id": 20,
  149. "name": "其他分布",
  150. "isPipe": false
  151. },
  152. {
  153. "id": 21,
  154. "name": "地图注记",
  155. "isPipe": false
  156. },
  157. {
  158. "id": 22,
  159. "name": "道路面",
  160. "isPipe": false
  161. },
  162. {
  163. "id": 23,
  164. "name": "绿化区",
  165. "isPipe": false
  166. },
  167. {
  168. "id": 24,
  169. "name": "居民区",
  170. "isPipe": false
  171. },
  172. {
  173. "id": 25,
  174. "name": "水库",
  175. "isPipe": false
  176. },
  177. {
  178. "id": 26,
  179. "name": "河流",
  180. "isPipe": false
  181. },
  182. {
  183. "id": 27,
  184. "name": "行政区",
  185. "isPipe": false
  186. }
  187. ]
  188. /**
  189. * 根据KeyValue获取图层(获取管网和设备)
  190. */
  191. getPipeIdByKeyValue(key,value) {
  192. const tempData = [];
  193. for (let i = 0; i < this.pipeData.length; i++) {
  194. if (this.pipeData[i][key] == value) {
  195. tempData.push(this.pipeData[i].id)
  196. }
  197. };
  198. return tempData
  199. };
  200. /**
  201. * 根据isPipe获取数据(获取管网和设备)
  202. */
  203. getPipeIdByIsPipe(data) {
  204. const tempData = [];
  205. for (let i = 0; i < this.pipeData.length; i++) {
  206. if (this.pipeData[i].isPipe == data) {
  207. tempData.push(this.pipeData[i].id)
  208. }
  209. };
  210. return tempData
  211. };
  212. /**
  213. * 根据IsEquipment获取数据(获取设备)
  214. */
  215. getPipeIdByIsEquipment(data) {
  216. if(!data){
  217. data=true
  218. }
  219. const tempData = [];
  220. for (let i = 0; i < this.pipeData.length; i++) {
  221. if (this.pipeData[i].isEquipment == data) {
  222. tempData.push(this.pipeData[i].id)
  223. }
  224. };
  225. return tempData
  226. };
  227. /**
  228. * 根据isLine获取数据(获取管线)
  229. */
  230. getPipeIdByisLine(data) {
  231. if(!data){
  232. data=true
  233. }
  234. const tempData = [];
  235. for (let i = 0; i < this.pipeData.length; i++) {
  236. if (this.pipeData[i].isLine == data) {
  237. tempData.push(this.pipeData[i].id)
  238. }
  239. };
  240. return tempData
  241. };
  242. }
  243. const pipeInfo = new PipeInfo();
  244. export default pipeInfo;