map-data1.js 132 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302
  1. import axios from "axios";
  2. import data from "@c/mixins/anbao";
  3. export default {
  4. data() {
  5. return {
  6. stores: this.$useStore(),
  7. map: null,
  8. oldPopup: null,
  9. oldPopupId: null,
  10. };
  11. },
  12. mounted() {
  13. window.vue = this;
  14. window.jMap = null;
  15. window.jmapQuery = null;
  16. },
  17. methods: {
  18. streetTownMap(name) {
  19. return name
  20. },
  21. /**
  22. *地图初始化
  23. *
  24. */
  25. async initMap(type) {
  26. window.vue = this;
  27. window.jMap = null;
  28. window.jmapQuery = null;
  29. window.jMap = new JMap();
  30. var map_params = {
  31. camera: {
  32. x: 121.4175597,
  33. y: 31.119248,
  34. radius: 18000.0,
  35. offset: { heading: -4, pitch: -70, range: 0 },
  36. },
  37. map_complete_callback: () => {
  38. window.jmapQuery = new JMapQuery(window.jMap);
  39. // ToDo...
  40. },
  41. map_left_click_callback: (obj, type, movement, event) => {
  42. this.stores.$state.tankuangXY = { x: movement.position.x, y: movement.position.y };
  43. },
  44. map_right_click_callback: (obj) => {},
  45. };
  46. let res = await this.$axios.get(this.$api.dt);
  47. // 加载地图
  48. window.jMap.createMap("mapF", res.data, window.location.origin, map_params, {});
  49. // 地图背景样式
  50. window.jMap.switchBaseLayer("blue");
  51. /**
  52. * 获取街镇信息
  53. */
  54. var options = {
  55. click: addLayerCallBack,
  56. isZoom: false,
  57. style: {
  58. outline: true,
  59. outlineColor: "rgb(255,0,0,0.8)",
  60. // material: "rgb(154,255,154,0)",
  61. perPositionHeight: true,
  62. height: 200,
  63. width: "10px",
  64. size:"10px",
  65. label: {
  66. show: true,
  67. text: "name",
  68. font: "16px Helvetica",
  69. fillColor: "rgb(0,255,0,0.9)",
  70. pixelOffset: [0, -40],
  71. backgroundColor: "rgb(0,0,0,0)",
  72. showBackground: false,
  73. },
  74. },
  75. // where:"name = '莘庄镇'"
  76. };
  77. window.jMap.addLayer("mh_dyn_district", [1], options);
  78. // 街镇标题绘制
  79. // var qp = new JMapQueryParam({
  80. // queryMapService: "mh_dyn_district",
  81. // queryMapLayers: [1],
  82. // outFields: ["code", "name", "center_x", "center_y"],
  83. // // queryWhere: "name like '%莘庄镇%' ",
  84. // callBack: (res) => {
  85. // res.features.forEach(async(val) => {
  86. // await window.jMap.FlagInfo.show({
  87. // id: val.attributes.code,
  88. // position: { x: Number(val.attributes.center_x), y: Number(val.attributes.center_y), z: 0 },
  89. // element: `<div class='ysc-dynamic-layer ys-css3-box' onclick="vue.clickFlag(${val.attributes.code})">
  90. // <div class='biaozhu' style="font-size:18px !important">${val.attributes.name} ${val.attributes.code}</div>
  91. // </div>`,
  92. // }, { isZoom: false });
  93. // });
  94. // },
  95. // });
  96. // new JMapQuery(window.jMap).execQuery(qp)
  97. },
  98. /**
  99. * 疏导区网格
  100. */
  101. anbaoSDUWG(){
  102. console.log(1111)
  103. let arr = [
  104. [
  105. {x:121.36194587932806,y:31.16013705465239,z:0},
  106. {x:121.34727553811794,y:31.15828077299882,z:0},
  107. {x:121.32700411033827,y:31.148247489434965,z:0},
  108. {x:121.31514606604391,y:31.139440444833916,z:0},
  109. {x:121.30048786370499,y:31.134903156770502,z:0},
  110. {x:121.29284839062778,y:31.12773298212305,z:0},
  111. {x:121.28484794201171,y:31.12306873887283,z:0},
  112. {x:121.2434981967536,y:31.119911283997425,z:0},
  113. {x:121.22295978253271,y:31.11453182095247,z:0},
  114. {x:121.22093534994545,y:31.128184924119704,z:0},
  115. {x:121.22476714240756,y:31.137743873822444,z:0},
  116. {x:121.22284789103668,y:31.151848705517672,z:0},
  117. {x:121.2192245740552,y:31.185051824029983,z:0},
  118. {x:121.21634530262463,y:31.19305254070648,z:0},
  119. {x:121.21666410880577,y:31.199965150511076,z:0},
  120. {x:121.20802887999594,y:31.252419358825662,z:0},
  121. {x:121.2510308379889,y:31.25199056924825,z:0},
  122. {x:121.26975280768023,y:31.256161713215423,z:0},
  123. {x:121.29758483246128,y:31.25239812402721,z:0},
  124. {x:121.34774474510056,y:31.253635862387053,z:0},
  125. {x:121.34278143296902,y:31.239737181776324,z:0},
  126. {x:121.34412376809345,y:31.224709084528335,z:0},
  127. {x:121.35105449522602,y:31.20248989001769,z:0},
  128. {x:121.35374042236845,y:31.182090361752536,z:0},
  129. {x:121.36194587932806,y:31.16013705465239,z:0},
  130. ],
  131. [
  132. {x:121.30025,y:31.184825,z:0},
  133. {x:121.298659,y:31.186719,z:0},
  134. {x:121.297278,y:31.188721,z:0},
  135. {x:121.294521,y:31.19274,z:0},
  136. {x:121.302864,y:31.196146,z:0},
  137. {x:121.304392,y:31.193755,z:0},
  138. {x:121.306291,y:31.191095,z:0},
  139. {x:121.308116,y:31.188478,z:0},
  140. {x:121.309198,y:31.186907,z:0},
  141. {x:121.309383,y:31.186432,z:0},
  142. {x:121.309391,y:31.185858,z:0},
  143. {x:121.309372,y:31.185243,z:0},
  144. {x:121.309175,y:31.185049,z:0},
  145. {x:121.308407,y:31.184564,z:0},
  146. {x:121.307629,y:31.18408,z:0},
  147. {x:121.306116,y:31.18316,z:0},
  148. {x:121.303064,y:31.181291,z:0},
  149. {x:121.30025,y:31.184825,z:0},
  150. ]
  151. ]
  152. for(let i=0;i<arr.length;i++){
  153. console.log(i)
  154. let target = {
  155. id: i,
  156. attributes: {
  157. name: i,
  158. },
  159. position: arr[i],
  160. label: {
  161. text: i,
  162. font: "16px Helvetica",
  163. color: i ==0 ? "red" : "orange",
  164. pixelOffset: [0, -50],
  165. backgroundColor: "red"
  166. }
  167. }
  168. let options = {
  169. isZoom: false,
  170. style: {
  171. color: i == 0 ? "red" : i == 1 ? "orange" : "",
  172. transparency: 1,
  173. outline: true,
  174. outlineColor: 'transparent',
  175. perPositionHeight: true
  176. },
  177. // click: regionLocateCallBack111
  178. };
  179. setTimeout(() => {
  180. window.jMap.Locate.trackLocate(target, options);
  181. }, 2000)
  182. }
  183. },
  184. /**
  185. * 安保区域
  186. * @param {*} status 是否有图层
  187. * @param {*} id 1大网格 2小网格
  188. * @param {*} query 搜索内容
  189. */
  190. anbao(status, id, query) {
  191. var that = this
  192. var color = [
  193. "#2c6395",
  194. "#1b6cb6",
  195. "#40a4ff",
  196. "#8ac7ff",
  197. "#b1cce5",
  198. "#a03523",
  199. "#d7le00",
  200. "#ffa192",
  201. "#dba197",
  202. "#009081",
  203. "#00ae9c",
  204. "#50fed",
  205. "#4d6700",
  206. "#729900",
  207. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  208. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  209. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  210. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  211. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  212. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  213. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  214. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  215. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  216. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  217. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  218. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  219. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  220. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  221. // "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100", "#009b8a", "#b72727", "#71a382", "#1c6093", "#a4294f", "#3f8a3f", "#68afc1",
  222. // "#5081c5", "#c3a102", "#d17100", , "#a4294f", "#3f8a3f", "#68afc1", "#5081c5", "#c3a102", "#d17100",
  223. ];
  224. var JmapQuery = new JMapQuery(window.jMap); // JMap为初始化地图时,实例化的JMap对象
  225. if (status) {
  226. window.jMap.Locate.clearLocate(); //清楚分布
  227. // window.jMap.removeLayer(); // 空值清除所有已添加图层
  228. }
  229. //中网格
  230. if (id == 1) {
  231. setTimeout(() => {
  232. // 例: 8.1 2 查询图层列表
  233. var qp2 = new JMapQueryParam({
  234. queryMapService: "mh_dyn_cywg",
  235. queryMapLayers: [0],
  236. // queryGeometry: result[0], // 默认进行属性查询,放开该段注释将在选定的几何空间内进行空间查询
  237. // queryWhere: "name like '%莘庄镇%' ", // 可自定义查询条件,也可不传该参数
  238. outFields: ["*"], // 返回字段信息
  239. callBack: testQueryCallBack2
  240. });
  241. JmapQuery.execQuery(qp2);
  242. // 图层查询完毕的回调函数
  243. function testQueryCallBack2(obj) {
  244. var bigNewArr = [];
  245. var name = [];
  246. //画线--------------
  247. var bigArr = obj.features.filter(function(el) {
  248. // return el.attributes.name.indexOf('新虹街道') > -1
  249. return el.attributes.name.indexOf('新虹街道') > -1 ||
  250. el.attributes.name.indexOf('华漕') > -1 ||
  251. el.attributes.name.indexOf('七宝中片') > -1 ||
  252. el.attributes.name.indexOf('航华网格') > -1 ||
  253. el.attributes.name.indexOf('七宝北片网格') > -1 ||
  254. el.attributes.name.indexOf('紫藤、红松') > -1 ||
  255. el.attributes.name.indexOf('虹梅区域') > -1
  256. })
  257. let arr = []
  258. for(let i=0;i<bigArr.length;i++){
  259. arr.push([])
  260. for(let ii =0;ii<bigArr[i].geometry.rings[0].length;ii++){
  261. arr[i].push(
  262. {
  263. x:bigArr[i].geometry.rings[0][ii][0],
  264. y:bigArr[i].geometry.rings[0][ii][1],
  265. z:0,
  266. }
  267. )
  268. }
  269. }
  270. console.log(11111,arr)
  271. for(let i=0;i<arr.length;i++){
  272. let target = {
  273. id: i + 1,
  274. attributes: {
  275. name: i,
  276. },
  277. position: arr[i],
  278. label: {
  279. text: i,
  280. font: "16px Helvetica",
  281. color: "red",
  282. pixelOffset: [0, -50],
  283. backgroundColor: "red"
  284. }
  285. }
  286. var options = {
  287. isZoom: false,
  288. style: {
  289. color: 'rgb(79, 226, 97)',
  290. transparency: 1,
  291. outline: true,
  292. outlineColor: 'transparent',
  293. perPositionHeight: true
  294. },
  295. click: regionLocateCallBack111
  296. };
  297. setTimeout(() => {
  298. window.jMap.Locate.trackLocate(target, options);
  299. }, 1000)
  300. }
  301. function regionLocateCallBack111(obj) {
  302. // console.log(obj); // obj为返回值
  303. }
  304. //画线----------------------------------
  305. //区域----------------------------------
  306. var bigArr = obj.features.filter(function(el) {
  307. return el.attributes.name.indexOf('新虹街道') > -1 ||
  308. el.attributes.name.indexOf('华漕') > -1 ||
  309. el.attributes.name.indexOf('七宝中片') > -1 ||
  310. el.attributes.name.indexOf('航华网格') > -1 ||
  311. el.attributes.name.indexOf('七宝北片网格') > -1 ||
  312. el.attributes.name.indexOf('紫藤、红松') > -1 ||
  313. el.attributes.name.indexOf('虹梅区域') > -1
  314. })
  315. bigArr.forEach(function(item, index) {
  316. var aaa = item.geometry.rings[0];
  317. var newArr = aaa.map(function(value, index) {
  318. var obj = {
  319. x: value[0],
  320. y: value[1],
  321. z: 0.1
  322. }
  323. return obj
  324. })
  325. bigNewArr.push(newArr);
  326. name.push(item.attributes.name)
  327. })
  328. bigNewArr.forEach(function(item, index) {
  329. var idx = index + 1;
  330. setTimeout(() => {
  331. // 2区域分布
  332. var target = {
  333. id: idx,
  334. attributes: {
  335. position: item[0],
  336. name: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index]
  337. },
  338. position: item,
  339. label: {
  340. text: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index],
  341. font: "14px Helvetica",
  342. color: "#fff",
  343. pixelOffset: [0, -40]
  344. }
  345. };
  346. var options = {
  347. isZoom: false,
  348. camera: {
  349. x: 121.4175597,
  350. y: 31.119248,
  351. radius: 18000.0,
  352. offset: { heading: -4, pitch: -70, range: 0 },
  353. },
  354. click: regionLocateCallBack,
  355. style: {
  356. // color: name[index] == "华漕镇处置网格二(纪王西片区)" ? "#2c6395" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "#1b6cb6" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "#40a4ff" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "#8ac7ff" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "#b1cce5" : name[index] == "新虹街道处置网格二(爱博)" ? "#a03523" : name[index] == "新虹街道处置网格三(华美)" ? "#d71e00" : name[index] == "新虹街道处置网格一(枢纽)" ? "#ffa192" : name[index] == "新虹街道处置网格四(航华)" ? "#dba197" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "#009081" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "#00ae9c" : name[index] == "七宝镇处置网格五(航华网格)" ? "#50ffed" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "#b2ec0a" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "#b2ec4a" : "#729900",
  357. color:"transparent",
  358. transparency: 0,
  359. outline: true,
  360. outlineColor: 'blue',
  361. // "#4d6700",
  362. // "#729900",
  363. }
  364. };
  365. setTimeout(() => {
  366. jMap.Locate.regionLocate(target, options);
  367. }, 500)
  368. // 分布点点击事件的回调函数
  369. function regionLocateCallBack(obj) {
  370. console.log(obj)
  371. that.stores.gridDataChange(obj._attributes);
  372. }
  373. }, idx * 1)
  374. })
  375. }
  376. }, 1000)
  377. }
  378. //小网格(居委会)
  379. if (id == 2 && query) {
  380. // console.log(query)
  381. let queryName = ""
  382. for (let i = 0; i < query.length; i++) {
  383. // console.log(query[i].mapGridName)
  384. queryName = queryName ? `${queryName},'${query[i].mapGridName}'` : `'${query[i].mapGridName}'`
  385. }
  386. setTimeout(() => {
  387. var name2 = [];
  388. var qp3 = new JMapQueryParam({
  389. queryMapService: "mh_dyn_district",
  390. queryMapLayers: [2],
  391. // queryGeometry: result[0], // 默认进行属性查询,放开该段注释将在选定的几何空间内进行空间查询
  392. // queryWhere: "name like '%纪东村村委会%' ", // 可自定义查询条件,也可不传该参数
  393. // queryWhere: "grid_type in ('居委网格','村委网格') and subdistrict like '%华漕镇%' ", // 可自定义查询条件,也可不传该参数
  394. // queryWhere: `name in ('沪星村村委会','九星村村委会','新龙村经济合作社','中春路第二居委会',
  395. // ) and subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
  396. queryWhere: `name in (${queryName}) and subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
  397. // queryWhere: `subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
  398. // queryWhere: `grid_type in ('居委网格','村委网格','拓展网格') and subdistrict in ('华漕镇','新虹街道','虹桥镇','七宝镇')`, // 可自定义查询条件,也可不传该参数
  399. outFields: ["*"], // 返回字段信息
  400. callBack: testQueryCallBack3
  401. });
  402. JmapQuery.execQuery(qp3);
  403. function testQueryCallBack3(obj) {
  404. let a = []
  405. for (let i = 0; i < obj.features.length; i++) {
  406. a[i] = {
  407. name: obj.features[i].attributes.name,
  408. subdistrict: obj.features[i].attributes.subdistrict,
  409. }
  410. }
  411. var big2Arr = []
  412. obj.features.forEach(function(item, index) {
  413. var b2 = item.geometry.rings;
  414. b2.forEach(function(item2, index2) {
  415. var newArr2 = b2[index2].map(function(value, index3) {
  416. var obj = {
  417. x: value[0],
  418. y: value[1],
  419. z: 0.1
  420. }
  421. return obj
  422. })
  423. big2Arr.push(newArr2);
  424. name2.push(item.attributes.name)
  425. })
  426. })
  427. //画线---------------------------------
  428. let huaxian = []
  429. for(let i=0;i<big2Arr.length;i++){
  430. huaxian.push([])
  431. for(let ii =0;ii<big2Arr[i].length;ii++){
  432. huaxian[i].push(
  433. big2Arr[i][ii]
  434. )
  435. }
  436. }
  437. for(let i=0;i<huaxian.length;i++){
  438. let target = {
  439. id: i + 1,
  440. attributes: {
  441. name: i,
  442. },
  443. position: huaxian[i],
  444. label: {
  445. text: i,
  446. font: "16px Helvetica",
  447. color: "rgba(255,255,255,0.1)",
  448. pixelOffset: [0, -50],
  449. backgroundColor: "red"
  450. }
  451. }
  452. var options = {
  453. isZoom: false,
  454. style: {
  455. color: 'rgb(1, 224, 255)',
  456. transparency: 1,
  457. outline: true,
  458. outlineColor: 'transparent',
  459. perPositionHeight: true
  460. },
  461. click: regionLocateCallBack111
  462. };
  463. setTimeout(() => {
  464. window.jMap.Locate.trackLocate(target, options);
  465. }, 1000)
  466. }
  467. function regionLocateCallBack111(obj) {
  468. // console.log(obj); // obj为返回值
  469. }
  470. //画线---------------------------------
  471. //画区域-----------------------------
  472. big2Arr.forEach(function(item, index) {
  473. var idx = index + 1;
  474. setTimeout(() => {
  475. // 2区域分布
  476. var target = {
  477. id: idx,
  478. attributes: {
  479. position: item[0],
  480. name: name2[index]
  481. },
  482. position: item,
  483. label: {
  484. text: name2[index],
  485. font: "12px Helvetica",
  486. color: "transparent",
  487. pixelOffset: [0, -40]
  488. }
  489. };
  490. var options = {
  491. isZoom: false,
  492. click: regionLocateCallBack2,
  493. style: {
  494. color: "#68afc1",
  495. transparency: 0.6,
  496. outline: true,
  497. outlineColor: 'blue',
  498. }
  499. };
  500. setTimeout(() => {
  501. jMap.Locate.regionLocate(target, options);
  502. }, 500)
  503. // 分布点点击事件的回调函数
  504. function regionLocateCallBack2(obj) {
  505. that.stores.gridDataChange(obj._attributes);
  506. }
  507. }, idx * 1)
  508. })
  509. //画区域-----------------------------
  510. }
  511. }, 2000);
  512. }
  513. //大网格
  514. if (id == 3) {
  515. setTimeout(() => {
  516. // 例: 8.1 2 查询图层列表
  517. var qp2 = new JMapQueryParam({
  518. queryMapService: "mh_dyn_cywg",
  519. queryMapLayers: [0],
  520. // queryGeometry: result[0], // 默认进行属性查询,放开该段注释将在选定的几何空间内进行空间查询
  521. // queryWhere: "name like '%莘庄镇%' ", // 可自定义查询条件,也可不传该参数
  522. outFields: ["*"], // 返回字段信息
  523. callBack: testQueryCallBack2
  524. });
  525. JmapQuery.execQuery(qp2);
  526. // 图层查询完毕的回调函数
  527. function testQueryCallBack2(obj) {
  528. var bigNewArr = [];
  529. var name = [];
  530. var bigArr = obj.features.filter(function(el) {
  531. // return el.attributes.name.indexOf('新虹街道') > -1
  532. return el.attributes.name.indexOf('新虹街道') > -1 ||
  533. el.attributes.name.indexOf('华漕') > -1 ||
  534. el.attributes.name.indexOf('七宝中片') > -1 ||
  535. el.attributes.name.indexOf('航华网格') > -1 ||
  536. el.attributes.name.indexOf('七宝北片网格') > -1 ||
  537. el.attributes.name.indexOf('紫藤、红松') > -1 ||
  538. el.attributes.name.indexOf('虹梅区域') > -1
  539. })
  540. //画区域
  541. bigArr.forEach(function(item, index) {
  542. var aaa = item.geometry.rings[0];
  543. var newArr = aaa.map(function(value, index) {
  544. var obj = {
  545. x: value[0],
  546. y: value[1],
  547. z: 0.1
  548. }
  549. return obj
  550. })
  551. bigNewArr.push(newArr);
  552. name.push(item.attributes.name)
  553. })
  554. bigNewArr.forEach(function(item, index) {
  555. var idx = index + 1;
  556. setTimeout(() => {
  557. // 2区域分布
  558. var target = {
  559. id: idx,
  560. attributes: {
  561. position: item[0],
  562. name: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index]
  563. },
  564. position: item,
  565. label: {
  566. // text: name[index] == "华漕镇处置网格二(纪王西片区)" ? "闵S1-1(纪王西网格)" : name[index] == "华漕镇处置网格一(纪王东片区)" ? "闵S1-2(纪王东网格)" : name[index] == "华漕镇处置网格四(诸翟北片区)" ? "闵S1-3(诸翟北网格)" : name[index] == "华漕镇处置网格五(诸翟南片区)" ? "闵S1-4(诸翟南网格)" : name[index] == "华漕镇处置网格三(老华漕片区)" ? "闵S1-5(老华漕网格)" : name[index] == "新虹街道处置网格二(爱博)" ? "闵S2-1(爱博网格)" : name[index] == "新虹街道处置网格三(华美)" ? "闵S2-2(华美网格)" : name[index] == "新虹街道处置网格一(枢纽)" ? "闵S2-3(枢纽网格)" : name[index] == "新虹街道处置网格四(航华)" ? "闵S2-4(航华网格)" : name[index] == "七宝镇处置网格一(七宝北片网格)" ? "闵S3-1(七宝北片网格)" : name[index] == "七宝镇处置网格二(七宝中片网格)" ? "闵S3-2(七宝吴宝路网格)" : name[index] == "七宝镇处置网格五(航华网格)" ? "闵S3-3(七宝航华网格)" : name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "闵S4-1(紫藤红松网格)" : name[index] == "虹桥镇处置网格二(虹梅区域)" ? "闵S4-2(虹梅网格)" : name[index],
  567. font: "14px Helvetica",
  568. color: "#fff",
  569. pixelOffset: [0, -40]
  570. }
  571. };
  572. var options = {
  573. isZoom: false,
  574. camera: {
  575. x: 121.4175597,
  576. y: 31.119248,
  577. radius: 9000.0,
  578. offset: { heading: -4, pitch: -70, range: 0 },
  579. },
  580. click: regionLocateCallBack,
  581. style: {
  582. color: "#5b9bd5",
  583. transparency: 0.6,
  584. // name[index] == "华漕镇处置网格二(纪王西片区)" ? "#5b9bd5" :
  585. // name[index] == "华漕镇处置网格一(纪王东片区)" ? "#5b9bd5" :
  586. // name[index] == "华漕镇处置网格四(诸翟北片区)" ? "#5b9bd5" :
  587. // name[index] == "华漕镇处置网格五(诸翟南片区)" ? "#5b9bd5" :
  588. // name[index] == "华漕镇处置网格三(老华漕片区)" ? "#5b9bd5" :
  589. // name[index] == "新虹街道处置网格二(爱博)" ? "#17cfbc" :
  590. // name[index] == "新虹街道处置网格三(华美)" ? "#17cfbc" :
  591. // name[index] == "新虹街道处置网格一(枢纽)" ? "#17cfbc" :
  592. // name[index] == "新虹街道处置网格四(航华)" ? "#17cfbc" :
  593. // name[index] == "七宝镇处置网格一(七宝北片网格)" ? "#fca091" :
  594. // name[index] == "七宝镇处置网格二(七宝中片网格)" ? "#fca091" :
  595. // name[index] == "七宝镇处置网格五(航华网格)" ? "#fca091" :
  596. // name[index] == "虹桥镇处置网格四(紫藤、红松区域)" ? "rgb(37, 95, 37)" :
  597. // name[index] == "虹桥镇处置网格二(虹梅区域)" ? "rgb(37, 95, 37)" : "rgb(37, 95, 37)",
  598. outline: true,
  599. outlineColor: 'blue',
  600. // "#4d6700",
  601. // "#729900",
  602. }
  603. };
  604. setTimeout(() => {
  605. jMap.Locate.regionLocate(target, options);
  606. }, 500)
  607. // 分布点点击事件的回调函数
  608. function regionLocateCallBack(obj) {
  609. // that.stores.gridDataChange(obj._attributes);
  610. }
  611. }, idx * 1)
  612. })
  613. }
  614. }, 1000)
  615. }
  616. },
  617. /**
  618. * 安保气泡窗
  619. * @param {*} data
  620. */
  621. anbaoPopup(data) {
  622. var children = []
  623. if (data.type == 15) {
  624. children = [
  625. ["街道:", data.content.streetTown, 12],
  626. ["安监所人员:", data.content[0].type1, 12],
  627. ["城运中心人员:", data.content[0].type2, 12],
  628. ["消防助理员:", data.content[0].type3, 12],
  629. ]
  630. }
  631. if (data.type == 16) {
  632. children = [
  633. ["街道:", data.content[0].streetTown, 12],
  634. ["小网格人员:", data.content[0].type1, 12],
  635. ["小网格长:", data.content[0].type2, 12],
  636. ]
  637. }
  638. let arrayList = [{
  639. title: [data.name, true],
  640. children: []
  641. }]
  642. arrayList[0].children = children
  643. data.gisX = data.position.x
  644. data.gisY = data.position.y
  645. this.popup(data, arrayList, true, null, 1)
  646. },
  647. /**
  648. *添加动态图层
  649. *
  650. */
  651. addLayer() {
  652. var wheres = [];
  653. wheres[1] = "subdistrict='七宝镇'"; // 1:图层序号 subdistrict='七宝镇' 筛选条件
  654. var options = {
  655. click: windowGxLayer,
  656. wheres: wheres
  657. };
  658. setTimeout(() => {
  659. jMap.addImageryLayer("mh_dyn_cywg", [1], options);
  660. }, 3000);
  661. },
  662. // 点击事件回调函数
  663. addLayerCallBack(obj) {
  664. },
  665. /**
  666. *安保区域划分
  667. *
  668. */
  669. anbaoMap() {
  670. let target = {
  671. id: '100001',
  672. attributes: {
  673. name: '大型安保范围',
  674. },
  675. position: data[0],
  676. label: {
  677. text: "大型安保范围",
  678. font: "16px Helvetica",
  679. color: "rgba(255,255,255,0.1)",
  680. pixelOffset: [0, -50],
  681. backgroundColor: "red"
  682. }
  683. }
  684. var options = {
  685. isZoom: true,
  686. style: {
  687. color: 'rgb(255,255,0,0.9)',
  688. transparency: 1,
  689. outline: true,
  690. outlineColor: 'transparent',
  691. perPositionHeight: true
  692. },
  693. // click: regionLocateCallBack
  694. };
  695. setTimeout(() => {
  696. window.jMap.Locate.trackLocate(target, options);
  697. }, 1000)
  698. },
  699. // 安保分布点点击事件的回调函数
  700. regionLocateCallBack(obj) {},
  701. /**
  702. * @聚合撒点
  703. * @param {数据list} data
  704. * @param {页面类型} pageType
  705. * @param {类型} type
  706. */
  707. initMarkers(data, pageType, type) {
  708. var _this = this;
  709. var tag = 1; //1.自定义图标 2.完全自定义 3.默认
  710. var style = ""; //地图最大化小图标
  711. var points = []; //地图撒点处理数据存储
  712. var options = {
  713. style: { pixelRange: 10 },
  714. isZoom: true,
  715. click: clusterMapCallBack,
  716. };
  717. jMap.ClusterMap.show(data, options);
  718. },
  719. clickFlag(val) {},
  720. randomColor() {
  721. var color = "#";
  722. //for循环中,如果后面仅有一条语句,{}可省略不写
  723. //随机生成6位0-15之间的数字,再用toString(16)将数字转成16进制
  724. for (var i = 0; i < 6; i++) color += parseInt(Math.random() * 16).toString(16);
  725. return color;
  726. },
  727. removeMarkers(lnglats) {
  728. this.map.remove(lnglats);
  729. },
  730. /**
  731. *街镇切换
  732. */
  733. streetTownSwitch(data) {
  734. let sf = 2800.0;
  735. if (data.id == 12) {
  736. //区缩放比例调整
  737. sf = 18000.0;
  738. }
  739. var options = {
  740. area: data.id,
  741. base_layer_name: "dark",
  742. model_data_name: "dark",
  743. isShowDistrictLabel: true,
  744. camera: {
  745. x: data.x,
  746. y: data.y,
  747. radius: sf,
  748. offset: { heading: 4, pitch: -89, range: 0 },
  749. },
  750. };
  751. jMap.switchStreet(options);
  752. },
  753. /**
  754. * 点分布(撒点)
  755. * @param {坐标信息} lnglats
  756. * @param {页面类型} type
  757. */
  758. addMarker(lnglats, pageType, type) {
  759. window.jMap.Locate.clearLocate();
  760. let that = this
  761. let icon = "";
  762. let arr = []
  763. let arr1 = []
  764. let arr2 = []
  765. let arr3 = []
  766. let arr4 = []
  767. let arr5 = []
  768. var target = lnglats.map((val, ind) => {
  769. var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
  770. var x = wgs84[0]
  771. var y = wgs84[1]
  772. if (pageType == "enforcement-dynamic" ||
  773. pageType == "self-management" ||
  774. pageType == "comprehensive-disposal" ||
  775. pageType == "rescue-station" ||
  776. pageType == "security-plan" ||
  777. pageType == "fire-signs" ||
  778. pageType == "fire-data-analysis" ||
  779. pageType == "water-sources") {
  780. let marker = {
  781. id: ind + 1,
  782. attrbutes: val,
  783. position: {
  784. x: x,
  785. y: y,
  786. // x: Number(val.gisX) || Number(val.longitude),
  787. // y: Number(val.gisY) || Number(val.latitude),
  788. z: 0
  789. },
  790. image: {
  791. url: type == "双随机执法单位" ? this.stores.sadianIcon.ssjzf : type == "安全检查单位" ? this.stores.sadianIcon.aqjcdw : type == "举报投诉" ? this.stores.sadianIcon.jbts : type == "执法记录仪" && val.type == "执法记录仪" ? this.stores.sadianIcon.zfjly :
  792. type == "执法记录仪" && val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx :
  793. type == "重点单位" ? this.stores.sadianIcon.zddw : type == "龙湖天街(试点)" ? this.stores.sadianIcon.lhtj : type == "一般单位" ? this.stores.sadianIcon.ybdw : type == "九小场所" ? this.stores.sadianIcon.jxcs : type == "其他单位" ? this.stores.sadianIcon.qtdw :
  794. type == "厂房" ? this.stores.sadianIcon.cf : type == "仓库" ? this.stores.sadianIcon.ck :
  795. type == "车辆" && val.type != "国家会展中心" ? this.stores.sadianIcon.xfc : type == "历史警情" && val.type != "国家会展中心" ? this.stores.sadianIcon.lsjq :
  796. type == "历史火灾" && val.type != "国家会展中心" ? this.stores.sadianIcon.lshz : val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx :
  797. type == "亡人火灾" ? this.stores.sadianIcon.wrhz : type == "伤人火灾" ? this.stores.sadianIcon.srhz :
  798. type == "消火栓可用" ? this.stores.sadianIcon.xhs : type == "消火栓不可用" ? this.stores.sadianIcon.xhsH :
  799. type == "天然水源" ? this.stores.sadianIcon.trsy : type == "科普教育基地" ? this.stores.sadianIcon.kpjyjd :
  800. type == "消防站" ? this.stores.sadianIcon.xfz : type == "高层建筑覆盖" && val.stationType == 1 ? this.stores.sadianIcon.xfdjl :
  801. type == "高层建筑覆盖" && val.stationType == 2 ? this.stores.sadianIcon.xfdj2 : type == "高层建筑覆盖" && val.stationType == 3 ? this.stores.sadianIcon.xfdj3 :
  802. type == "高层建筑覆盖" && val.stationType == 4 ? this.stores.sadianIcon.zzd : type == "高层建筑覆盖" && val.stationType == 5 ? this.stores.sadianIcon.jzwxxfz :
  803. type == "高层建筑覆盖" && val.stationType == 111 ? this.stores.sadianIcon.dian : type == "高层建筑" ? this.stores.sadianIcon.gcggjz :
  804. type == "专职队" ? this.stores.sadianIcon.zzd : type == "微型消防站" ? this.stores.sadianIcon.jzwxxfz : type == "大型综合体" && val.facilityType == "lhtj" ? this.stores.sadianIcon.lhtj :
  805. type == "大型综合体" && (val.facilityType == 2 || val.facilityType == 3) ? this.stores.sadianIcon.dxzht : type == "重大火灾隐患" ? this.stores.sadianIcon.lsjq :
  806. type == "企业消防" && val.facilityType == 13 ? this.stores.sadianIcon.zddw : type == "企业消防" && val.facilityType == 14 ? this.stores.sadianIcon.ybdw :
  807. type == "社区消防" && val.facilityType == 15 ? this.stores.sadianIcon.zddw : type == "社区消防" && val.facilityType == 16 ? this.stores.sadianIcon.ybdw :
  808. type == "一级微型消防站" ? this.stores.sadianIcon.yjxfz : type == "街镇专职消防队" ? this.stores.sadianIcon.jzzzxfd : type == "中小学" ? this.stores.sadianIcon.zs : type == "幼儿园" ? this.stores.sadianIcon.yey : type == "其他学校" ? this.stores.sadianIcon.qtxx :
  809. type == "三合一" ? this.stores.sadianIcon.shy : type == "实时警情" ? this.stores.sadianIcon.ssjq :
  810. type == "本年度重点事项推进情况" && val.status == 1 ? this.stores.sadianIcon.ywc : type == "本年度重点事项推进情况" && val.status == 2 ? this.stores.sadianIcon.jxz : type == "本年度重点事项推进情况" && val.status == 3 ? this.stores.sadianIcon.zbz :
  811. type == "高风险" ? this.stores.sadianIcon.gfx : type == "较高风险" ? this.stores.sadianIcon.jgfx : type == "一般风险" ? this.stores.sadianIcon.ybfx : type == "低风险" ? this.stores.sadianIcon.dfx :
  812. type == "单位巡检" ? this.stores.sadianIcon.dwxj : type == "物联网设备" ? this.stores.sadianIcon.dwxj : type == "监控视频" ? this.stores.sadianIcon.ssjq : type == "监督检查" ? this.stores.sadianIcon.jdjc :
  813. type == "养老机构" ? this.stores.sadianIcon.xfdjl :
  814. type == "医疗机构" ? this.stores.sadianIcon.zzd :
  815. type == "流动消防站(一级)" ? this.stores.sadianIcon.ldxfzyj :
  816. type == "流动消防站(二级)" ? this.stores.sadianIcon.ldxfzej :
  817. type == "重点微型消防站" ? this.stores.sadianIcon.zdwxxfz :
  818. this.stores.sadianIcon.trsy,
  819. // this.jqzhczIcon3 : val.type == "4" ?
  820. // this.jqzhczIcon4 : val.type == "5" ?
  821. // this.jqzhczIcon5 : val.type == "消火栓" && val.status == "1" ?
  822. // this.jqzhczIcon5 : val.type == "消火栓" && val.status == "2" ?
  823. // this.jqzhczIcon51 : val.type == "天然水源" ?
  824. // this.jqzhczIcon7 : this.xfzfdtIcon4,
  825. width: val.type == "国家会展中心" ? 83 : type == "高层建筑覆盖" && val.stationType == 111 ? 7 : type == 111 ? 74 : 19.5,
  826. height: val.type == "国家会展中心" ? 59 : type == "高层建筑覆盖" && val.stationType == 111 ? 7 : type == 111 ? 66 : 25,
  827. },
  828. };
  829. if (type == "高层建筑覆盖" && val.stationType == 1) {
  830. arr1.push(val)
  831. }
  832. if (type == "高层建筑覆盖" && val.stationType == 2) {
  833. arr2.push(val)
  834. }
  835. if (type == "高层建筑覆盖" && val.stationType == 3) {
  836. arr3.push(val)
  837. }
  838. if (type == "高层建筑覆盖" && val.stationType == 4) {
  839. arr4.push(val)
  840. }
  841. if (type == "高层建筑覆盖" && val.stationType == 5) {
  842. arr5.push(val)
  843. }
  844. return marker;
  845. } else {
  846. let marker = {
  847. id: ind + 1,
  848. attrbutes: val,
  849. position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
  850. image: { url: icon, width: 300, height: 300 },
  851. };
  852. return marker;
  853. }
  854. });
  855. if (type == "高层建筑覆盖") {
  856. if (arr1.length > 0) {
  857. this.bufferL1(arr1)
  858. }
  859. if (arr2.length > 0) {
  860. this.bufferL2(arr2)
  861. }
  862. if (arr3.length > 0) {
  863. this.bufferL3(arr3)
  864. }
  865. if (arr4.length > 0) {
  866. this.bufferL4(arr4)
  867. }
  868. if (arr5.length > 0) {
  869. this.bufferL5(arr5)
  870. }
  871. // this.bufferL(arr)
  872. }
  873. //消防水源
  874. if (pageType == "water-sources") {
  875. var array = {
  876. clusterId: 100001,
  877. clusterData: []
  878. }
  879. var target1 = lnglats.map((val, ind) => {
  880. var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
  881. var x = wgs84[0]
  882. var y = wgs84[1]
  883. val.type2 = type
  884. var array1 = {
  885. attributes: val,
  886. position: {
  887. x: x,
  888. y: y,
  889. z: 0,
  890. },
  891. image: {
  892. url: type == "消火栓可用" ? this.stores.sadianIcon.xhs : type == "消火栓不可用" ? this.stores.sadianIcon.xhsH : type == "天然水源" ? this.stores.sadianIcon.trsy : this.stores.sadianIcon.trsy,
  893. width: 19.5,
  894. height: 25,
  895. }
  896. }
  897. array.clusterData.push(array1)
  898. })
  899. var options = {
  900. style: { pixelRange: 60 },
  901. isZoom: true,
  902. click: this.clusterMapCallBack
  903. };
  904. window.jMap.ClusterMap.show(array, options)
  905. } else {
  906. //撒点类型
  907. window.jMap.Locate.pointLocate(target, {
  908. //撒点
  909. isZoom: false,
  910. //animate: { "show": true },
  911. scaleByDistance: {
  912. minScaling: 1,
  913. maxScaling: 1,
  914. minDistance: 50, //最小距离
  915. maxDistance: 120000 //最大距离
  916. },
  917. click: (val) => {
  918. //消防执法
  919. if (pageType == "enforcement-dynamic") {
  920. if (type == "安全检查单位" || type == "双随机执法单位") {
  921. this.$axios
  922. .get(
  923. this.$api.siaeall.one +
  924. "?" +
  925. this.$qs.stringify({
  926. companyId: val.attrbutes.number,
  927. companyName: val.attrbutes.name,
  928. })
  929. )
  930. .then((res) => {
  931. res.data[0].company = val._attrbutes.name;
  932. res.data[0].streetTown = val._attrbutes.streetTown;
  933. let arrayList = [{
  934. title: [res.data[0].company, res.data[0].company ? true : false],
  935. children: [
  936. ["单位地址:", res.data[0].companyAddress, 24],
  937. ["负责人:", res.data[0].linkPerson, 10],
  938. ["联系电话:", res.data[0].linkPhone, 14],
  939. ["历史火灾次数:", res.data[0].fireCount, 12],
  940. ],
  941. },
  942. {
  943. title: ["行政许可情况", res.data[0].processDate && res.data[0].carefullyCheckDate && res.data[0].securityCheckDates],
  944. children: [
  945. ["审核时间:", res.data[0].processDate, 12],
  946. ["验收时间:", res.data[0].carefullyCheckDate, 12],
  947. ["安检时间:", res.data[0].securityCheckDates, 12],
  948. ],
  949. },
  950. {
  951. title: ["历史检查情况", res.data[0].inspectCompany && res.data[0].fireHazard && res.data[0].rectificateFireHazard && res.data[0].punishmentDecision && res.data[0].orderThreeStops && res.data[0].correctionNotice && res.data[0].temporarySeizure && res.data[0].penaltyAmount],
  952. children: [
  953. ["检查:", res.data[0].inspectCompany + "(家)", 8],
  954. ["隐患:", res.data[0].fireHazard + "(起)", 8],
  955. ["整改:", res.data[0].rectificateFireHazard + "(起)", 8],
  956. ["行罚:", res.data[0].punishmentDecision + "(份)", 8],
  957. ["三停:", res.data[0].orderThreeStops + "(家)", 8],
  958. ["责改:", res.data[0].correctionNotice + "(份)", 8],
  959. ["临封:", res.data[0].temporarySeizure + "(份)", 8],
  960. ["罚金:", res.data[0].penaltyAmount + "(万元)", 8],
  961. ],
  962. },
  963. {
  964. title: ["相关火灾情况", res.data[0].fireTime && res.data[0].disposalDuration && res.data[0].burnedArea && res.data[0].fireGrade && res.data[0].mobilizeVehicles && res.data[0].squadron && res.data[0].status && res.data[0].initialFuelType1],
  965. children: [
  966. ["报警时间:", res.data[0].fireTime, 12],
  967. ["处置时长:", res.data[0].disposalDuration, 12],
  968. ["过火面积:", res.data[0].burnedArea, 12],
  969. ["火灾等级:", res.data[0].fireGrade, 12],
  970. ["调动车辆:", res.data[0].mobilizeVehicles + "(辆)", 12],
  971. ["所属中队:", res.data[0].squadron, 12],
  972. ["状况:", res.data[0].status, 12],
  973. ["起火物:", res.data[0].initialFuelType1, 12],
  974. ],
  975. },
  976. ];
  977. this.popup(val._attrbutes, arrayList, true)
  978. });
  979. } else if (type == "举报投诉") {
  980. let arrayList = [{
  981. title: [val._attrbutes.name, true],
  982. children: [
  983. ],
  984. }]
  985. this.popup(val._attrbutes, arrayList, true)
  986. } else if (type == "执法记录仪") {
  987. let arrayList = [{
  988. title: [val._attrbutes.groupName, true],
  989. children: [
  990. ["执法人:", val._attrbutes.name, 12],
  991. ],
  992. type: type,
  993. url: val._attrbutes.url,
  994. },
  995. ]
  996. this.popup(val._attrbutes, arrayList, true)
  997. } else if (type == "重大火灾隐患") {
  998. let msgParse = JSON.parse(val.attrbutes.extendData)
  999. let arrayList = [{
  1000. title: [val.attrbutes.facilityName, true],
  1001. children: [
  1002. ["地址:", val.attrbutes.address, 24],
  1003. ["分类等级:", val.attrbutes.address, 24],
  1004. ["基础信息:", msgParse.test1, 24],
  1005. ["消防安全隐患情况:", msgParse.test2, 24],
  1006. ],
  1007. }, ];
  1008. this.popup(val._attrbutes, arrayList, true)
  1009. } else if (type == "三合一") {
  1010. let msgParse = JSON.parse(val.attrbutes.extendData)
  1011. let arrayList = [{
  1012. title: [val.attrbutes.facilityName, true],
  1013. children: [
  1014. ["单位地址:", val.attrbutes.address.replace("\t", ""), 24],
  1015. ["单位类别:", "三合一九小场所", 24],
  1016. ["单位法人:", val.attrbutes.facilityName.replace("\t", ""), 24],
  1017. ["检查人员姓名:", msgParse.test1, 24],
  1018. ["检查时间:", msgParse.test3, 24],
  1019. ["单位使用性质:", msgParse.test4, 24],
  1020. ["单位所属街道:", msgParse.test8, 24],
  1021. ["消消防安全责任人:", msgParse.test10, 24],
  1022. ["消防安全管理人(联系人):", msgParse.test11, 24],
  1023. ["联系电话(手机):", msgParse.test12, 24],
  1024. ["单位(场所)面积(m²):", msgParse.test17, 24],
  1025. ["地上:", msgParse.test18, 24],
  1026. ["地下:", msgParse.test19, 24],
  1027. ["建筑性质:", msgParse.test21, 24],
  1028. ["建筑结构:", msgParse.test22, 24],
  1029. ],
  1030. }, ];
  1031. this.popup(val._attrbutes, arrayList, true)
  1032. } else if (type == "本年度重点事项推进情况") {
  1033. let msgParse = JSON.parse(val.attrbutes.extendData)
  1034. let arrayList = [{
  1035. title: [val.attrbutes.facilityName, true],
  1036. children: [
  1037. ["街道名称:", val.attrbutes.streetTown, 24],
  1038. ["地址:", val.attrbutes.address, 24],
  1039. ["状态:", val.attrbutes.status == 1 ? "已完成" : val.attrbutes.status == 2 ? "施工中" : val.attrbutes.status == 3 ? "招标中" : "", 24],
  1040. ],
  1041. }, ];
  1042. this.popup(val._attrbutes, arrayList, true)
  1043. }
  1044. }
  1045. //企业自主
  1046. if (pageType == "self-management") {
  1047. if (val.attrbutes.type == "重点单位") {
  1048. this.elementInfo(val.attrbutes, "重点单位")
  1049. } else if (val.attrbutes.type == "大型综合体") {
  1050. let msgParse = JSON.parse(val.attrbutes.extendData)
  1051. let arrayList = [{
  1052. title: [val.attrbutes.facilityName, true],
  1053. children: [
  1054. ["地址:", val.attrbutes.address, 24],
  1055. ["类型:", val.attrbutes.facilityType == 2 ? "5W平大型商业综合体" : val.attrbutes.facilityType == 3 ? "3-5万平大型商业综合体" : "", 24],
  1056. ["平面布局:", msgParse.planeLayout, 24],
  1057. ["用火用电用气管理:", msgParse.fireGasManage, 24],
  1058. ["油烟管道管理:", msgParse.oilFumeManage, 24],
  1059. ["消防设施:", msgParse.fireFacility, 24],
  1060. ["其他安全管理:", msgParse.otherSecurityManage, 24],
  1061. ["合计汇总:", msgParse.totalSummary, 24],
  1062. ],
  1063. }, ];
  1064. this.popup(val._attrbutes, arrayList, true)
  1065. } else if (val.attrbutes.type == "中小学" || val.attrbutes.type == "幼儿园" || val.attrbutes.type == "其他学校") {
  1066. let msgParse = JSON.parse(val.attrbutes.extendData)
  1067. let phone = val.attrbutes.contactPhone
  1068. let arrayList = [{
  1069. title: [val.attrbutes.facilityName, true],
  1070. children: [
  1071. ["机构简称:", msgParse.test1, 24],
  1072. // ["学校办别:", val.attrbutes.facilityType, 24],
  1073. ["学校类型:", val.attrbutes.type, 24],
  1074. ["所在街镇:", val.attrbutes.streetTown, 24],
  1075. ["地址:", msgParse.address, 24],
  1076. ["法人代表:", val.attrbutes.contact, 24],
  1077. ["手机:", phone.length > 8 ? phone.substring(0, 3) + '****' + phone.substring(phone.length - 3, phone.length) : phone.substring(0, 2) + '***' + phone.substring(phone.length - 3, phone.length), 24],
  1078. ],
  1079. }, ];
  1080. this.popup(val._attrbutes, arrayList, true)
  1081. } else if (val.attrbutes.facilityType == "22") {
  1082. let msgParse = JSON.parse(val.attrbutes.extendData)
  1083. let arrayList = [{
  1084. title: [val.attrbutes.facilityName, true],
  1085. children: [
  1086. ["单位地址:", msgParse.address, 24],
  1087. ["单位负责人:", val.attrbutes.contact, 24],
  1088. ["负责人电话:", val.attrbutes.contactPhone, 24],
  1089. ["巡检部位:", msgParse.test1, 24],
  1090. ["巡检人员:", msgParse.test2, 24],
  1091. ["巡检情况:", msgParse.test3, 24],
  1092. ],
  1093. }, ];
  1094. this.popup(val._attrbutes, arrayList, true)
  1095. } else if (type == "物联网设备") {
  1096. let arrayList = [{
  1097. title: [val.attrbutes.buildName, true],
  1098. children: [
  1099. ["建筑地址:", val.address, 24],
  1100. ["建筑面积:", val.attrbutes.buildArea, 24],
  1101. ["建筑高度:", val.attrbutes.buildHigh, 24],
  1102. ["地上(层):", val.attrbutes.aboveFloor, 24],
  1103. ["地下(层):", val.attrbutes.underFloor, 24],
  1104. ],
  1105. }, ];
  1106. this.popup(val._attrbutes, arrayList, true)
  1107. } else {
  1108. let arrayList = [{
  1109. title: ["单位详情", val.attrbutes.companyName ? true : false],
  1110. children: [
  1111. ["单位名称:", val.attrbutes.companyName, 24],
  1112. ["单位类型:", val.attrbutes.companyTypeName, 24],
  1113. ["联系电话:", val.attrbutes.linkPhone, 24],
  1114. ["地址:", val.attrbutes.address, 24],
  1115. ],
  1116. }, ];
  1117. this.popup(val._attrbutes, arrayList, true)
  1118. }
  1119. }
  1120. //大型安保 、火灾数据分析
  1121. if (pageType == "security-plan") {
  1122. if (type == "监控视频") {
  1123. let arrayList = [{
  1124. title: ["监控视频", true],
  1125. children: [
  1126. ["监控名称:", val.attrbutes.name, 24],
  1127. ["监控地址:", val.attrbutes.installPlace, 24],
  1128. ],
  1129. url: val.attrbutes.viewUrl,
  1130. id: val.attrbutes.id
  1131. }, ];
  1132. that.stores.jkspChange(arrayList);
  1133. }
  1134. if (type == "监督检查") {
  1135. let arrayList = [{
  1136. title: ["监督检查", true],
  1137. children: [
  1138. ["检查员名称:", val.attrbutes.checkName, 24],
  1139. ["检查人员所属单位:", val.attrbutes.subordinateCompany, 24],
  1140. ["检查时间:", val.attrbutes.checkTime, 24],
  1141. ["单位类型:", val.attrbutes.companyType, 24],
  1142. ["单位使用性质:", val.attrbutes.companyUseNature, 24],
  1143. ["单位法人:", val.attrbutes.companyName, 24],
  1144. ["单位(场所)实际名称:", val.attrbutes.companyActualName, 24],
  1145. ["网格号:", val.attrbutes.gridNum, 24],
  1146. ["所辖派出所:", val.attrbutes.subordinatePoliceStation, 24],
  1147. ["街镇:", val.attrbutes.street, 24],
  1148. ["单位地址:", val.attrbutes.companyAddress, 24],
  1149. ["消防安全责任人姓名:", val.attrbutes.fireDutyName, 24],
  1150. ["消防安全管理人姓名:", val.attrbutes.fireManageName, 24],
  1151. ["联系电话:", val.attrbutes.phone, 24],
  1152. // ["隐患图片:", val.attrbutes.hiddImage ? JSON.parse(val.attrbutes.hiddImage) : NULL, 24],
  1153. ],
  1154. }, ];
  1155. this.popup(val._attrbutes, arrayList, true)
  1156. }
  1157. //疏导区单位情况----------------------
  1158. if (type == "养老机构") {
  1159. let msgParse = JSON.parse(val.attrbutes.extendData)
  1160. let arrayList = [{
  1161. title: [type, true],
  1162. children: [
  1163. ["单位名称:", val.attrbutes.facilityName, 24],
  1164. ["地址:", val.attrbutes.address, 24],
  1165. ["所属街镇:", val.attrbutes.streetTown, 24],
  1166. ["隐患问题:", msgParse.test1, 24],
  1167. ],
  1168. }, ];
  1169. this.popup(val._attrbutes, arrayList, true)
  1170. }
  1171. if (type == "医疗机构") {
  1172. let msgParse = JSON.parse(val.attrbutes.extendData)
  1173. let arrayList = [{
  1174. title: [type, true],
  1175. children: [
  1176. ["单位名称:", val.attrbutes.facilityName, 24],
  1177. ["地址:", val.attrbutes.address, 24],
  1178. ["所属街镇:", val.attrbutes.streetTown, 24],
  1179. ["描述:", msgParse.test1, 24],
  1180. ["隐患问题:", msgParse.test2, 24],
  1181. ],
  1182. }, ];
  1183. this.popup(val._attrbutes, arrayList, true)
  1184. }
  1185. if (type == "流动消防站(一级)") {
  1186. let msgParse = JSON.parse(val.attrbutes.extendData)
  1187. let arrayList = [{
  1188. title: [val.attrbutes.facilityName, true],
  1189. children: [
  1190. ["街镇:", val.attrbutes.streetTown, 24],
  1191. ["驻防位置:", val.attrbutes.address, 24],
  1192. ["保卫区域:", val.attrbutes.facilityName, 24],
  1193. ["负责人:", val.attrbutes.contact, 24],
  1194. ["联系电话:", val.attrbutes.contactPhone, 24],
  1195. ["支队:", msgParse.test1, 24],
  1196. ["辖区中队:", msgParse.test2, 24],
  1197. ["驻防车辆:", msgParse.test3, 24],
  1198. ["车型/跟车人数:", `${msgParse.test4}/ ${msgParse.test5}`, 24],
  1199. ["设立原因:", msgParse.test6, 24],
  1200. ["驻防时间:", msgParse.test7, 24],
  1201. ["视频设备编号:", msgParse.test8, 24],
  1202. ["跟车人员姓名及岗位1:",`${msgParse.test10} ${msgParse.test9}`, 24],
  1203. ["跟车人员姓名及岗位2:",`${msgParse.test12} ${msgParse.test11}`, 24],
  1204. ["跟车人员姓名及岗位3:",`${msgParse.test14} ${msgParse.test14}`, 24],
  1205. ["跟车人员姓名及岗位4:",`${msgParse.test16} ${msgParse.test15}`, 24],
  1206. ["跟车人员姓名及岗位5:",`${msgParse.test18} ${msgParse.test17}`, 24],
  1207. ["跟车人员姓名及岗位6:",`${msgParse.test20} ${msgParse.test19}`, 24],
  1208. ["跟车人员姓名及岗位7:",`${msgParse.test22} ${msgParse.test21}`, 24],
  1209. ["户号:", msgParse.test23, 24],
  1210. ["车型:", msgParse.test24, 24],
  1211. ["车辆号牌:", msgParse.test25, 24],
  1212. ["所属单位:", msgParse.test26, 24],
  1213. ["电台呼号:", msgParse.test27, 24],
  1214. ["车辆类型:", `${msgParse.test28} ${msgParse.test29} ${msgParse.test30} ${msgParse.test31} ${msgParse.test32}`, 24],
  1215. ["总质量:", msgParse.test33, 24],
  1216. ["乘员数:", msgParse.test34, 24],
  1217. ["云梯高度(米)、油箱容量(升):",`${msgParse.test35} 、${msgParse.test36}`, 24],
  1218. ["发动机功率(千瓦):", msgParse.test37, 24],
  1219. ["水泵流量(升/分钟):", msgParse.test38, 24],
  1220. ["泡沫流量(升/分钟):", msgParse.test39, 24],
  1221. ["水箱容量(吨):", msgParse.test40, 24],
  1222. ["名称修改为(载水量):", msgParse.test41, 24],
  1223. ["泡沫容量(吨):", msgParse.test42, 24],
  1224. ],
  1225. }, ];
  1226. this.popup(val._attrbutes, arrayList, true)
  1227. }
  1228. if (type == "流动消防站(二级)") {
  1229. let msgParse = JSON.parse(val.attrbutes.extendData)
  1230. let arrayList = [{
  1231. title: [val.attrbutes.facilityName, true],
  1232. children: [
  1233. ["街镇:", val.attrbutes.streetTown, 24],
  1234. ["驻防位置:", val.attrbutes.address, 24],
  1235. ["保卫区域:", val.attrbutes.facilityName, 24],
  1236. ["负责人:", val.attrbutes.contact, 24],
  1237. ["联系电话:", val.attrbutes.contactPhone, 24],
  1238. ["人数:", msgParse.test1, 24],
  1239. ["设立原因:", msgParse.test2, 24],
  1240. ["驻防时间:", msgParse.test3, 24],
  1241. ["定位设备编号:", msgParse.test4, 24],
  1242. ["对讲设备编号:", msgParse.test5, 24],
  1243. ["跟车人员姓名及岗位:",`${msgParse.test7} ${msgParse.test6}`, 24],
  1244. ["跟车人员姓名及岗位:",`${msgParse.test9} ${msgParse.test8}`, 24],
  1245. ],
  1246. }, ];
  1247. this.popup(val._attrbutes, arrayList, true)
  1248. }
  1249. if (type == "重点微型消防站") {
  1250. let msgParse = JSON.parse(val.attrbutes.extendData)
  1251. let arrayList = [{
  1252. title: [val.attrbutes.facilityName, true],
  1253. children: [
  1254. ["街镇:", val.attrbutes.streetTown, 24],
  1255. ["地址:", val.attrbutes.address, 24],
  1256. ["名称:", val.attrbutes.facilityName, 24],,
  1257. ["负责人:", val.attrbutes.contact, 24],
  1258. ["联系电话:", val.attrbutes.contactPhone, 24],
  1259. ["支队:", msgParse.test1, 24],
  1260. ["性质:", msgParse.test2, 24],
  1261. ["固定电话:", msgParse.test3, 24],
  1262. ["微站可视化终端名称:", msgParse.test4, 24],
  1263. ["是否配备电动车:", msgParse.test5, 24],
  1264. ["备注:", msgParse.test6, 24],
  1265. ],
  1266. }, ];
  1267. this.popup(val._attrbutes, arrayList, true)
  1268. }
  1269. if (type == "宾馆酒店" || type == "酒店/宾馆") {
  1270. let msgParse = JSON.parse(val.attrbutes.extendData)
  1271. let arrayList = [{
  1272. title: [type, true],
  1273. children: [
  1274. ["宾馆酒店名称:", val.attrbutes.facilityName, 24],
  1275. ["街镇:", val.attrbutes.streetTown, 24],
  1276. ["地址:", val.attrbutes.address, 24],
  1277. ["房间数:",msgParse.test1, 24],
  1278. ],
  1279. }, ];
  1280. this.popup(val._attrbutes, arrayList, true)
  1281. }
  1282. if (type == "大型商业综合体") {
  1283. let msgParse = JSON.parse(val.attrbutes.extendData)
  1284. let arrayList = [{
  1285. title: [type, true],
  1286. children: [
  1287. ["单位名称:", val.attrbutes.facilityName, 24],
  1288. ["街镇:", val.attrbutes.streetTown, 24],
  1289. ["地址:", val.attrbutes.address, 24],
  1290. ["管理人:",msgParse.test1, 24],
  1291. ["电话:",msgParse.test2, 24],
  1292. ],
  1293. }, ];
  1294. this.popup(val._attrbutes, arrayList, true)
  1295. }
  1296. if (type == "厂房仓库" || type == "厂房/仓库") {
  1297. let msgParse = JSON.parse(val.attrbutes.extendData)
  1298. let arrayList = [{
  1299. title: [type, true],
  1300. children: [
  1301. ["单位名称:", val.attrbutes.facilityName, 24],
  1302. ["街镇:", val.attrbutes.streetTown, 24],
  1303. ["地址:", val.attrbutes.address, 24],
  1304. // ["所属单位:",msgParse.test1, 24],
  1305. // ["公司名称:",msgParse.test2, 24],
  1306. ["公司负责人及联系方式:",`${msgParse.test3} ${msgParse.test4}`, 24],
  1307. ],
  1308. }, ];
  1309. this.popup(val._attrbutes, arrayList, true)
  1310. }
  1311. if (type == "批发市场") {
  1312. // let msgParse = JSON.parse(val.attrbutes.extendData)
  1313. let arrayList = [{
  1314. title: [type, true],
  1315. children: [
  1316. ["单位名称:", val.attrbutes.facilityName, 24],
  1317. ["街镇:", val.attrbutes.streetTown, 24],
  1318. ["地址:", val.attrbutes.address, 24],
  1319. ["联系人:", val.attrbutes.contact, 24],
  1320. ["联系电话:", val.attrbutes.contactPhone, 24],
  1321. ],
  1322. }, ];
  1323. this.popup(val._attrbutes, arrayList, true)
  1324. }
  1325. if (type == "规模租赁公寓") {
  1326. let msgParse = JSON.parse(val.attrbutes.extendData)
  1327. let arrayList = [{
  1328. title: [type, true],
  1329. children: [
  1330. ["单位名称:", val.attrbutes.facilityName, 24],
  1331. ["街镇:", val.attrbutes.streetTown, 24],
  1332. ["地址:", val.attrbutes.address, 24],
  1333. ["联系人:", val.attrbutes.contact, 24],
  1334. ["联系电话:", val.attrbutes.contactPhone, 24],
  1335. ["建筑面积 ( 平方米 ):",msgParse.test1, 24],
  1336. ["房间数量(间):",msgParse.test2, 24],
  1337. ],
  1338. }, ];
  1339. this.popup(val._attrbutes, arrayList, true)
  1340. }
  1341. if (type == "三合一场所") {
  1342. let msgParse = JSON.parse(val.attrbutes.extendData)
  1343. let arrayList = [{
  1344. title: [type, true],
  1345. children: [
  1346. ["单位名称:", val.attrbutes.facilityName, 24],
  1347. ["街镇:", val.attrbutes.streetTown, 24],
  1348. ["地址:", val.attrbutes.address, 24],
  1349. ["联系人:", val.attrbutes.contact, 24],
  1350. ["联系电话:", val.attrbutes.contactPhone, 24],
  1351. ["住宿人员数量:",msgParse.test1, 24],
  1352. ["是否整改:",msgParse.test2, 24],
  1353. ],
  1354. }, ];
  1355. this.popup(val._attrbutes, arrayList, true)
  1356. }
  1357. //疏导区单位情况----------------------
  1358. //疏导区基本情况----------------------
  1359. if (type == "学校") {
  1360. let msgParse = JSON.parse(val.attrbutes.extendData)
  1361. let arrayList = [{
  1362. title: [type, true],
  1363. children: [
  1364. ["单位名称:", val.attrbutes.facilityName, 24],
  1365. ["街镇:", val.attrbutes.streetTown, 24],
  1366. ["地址:", val.attrbutes.address, 24],
  1367. ["联系人:", val.attrbutes.contact, 24],
  1368. ["联系电话:", val.attrbutes.contactPhone, 24],
  1369. ["场所名称:",msgParse.test1, 24],
  1370. ["法定代表人:",msgParse.test2, 24],
  1371. ["主标签:",msgParse.test3, 24],
  1372. ["次标签:",msgParse.test4, 24],
  1373. ],
  1374. }, ];
  1375. this.popup(val._attrbutes, arrayList, true)
  1376. }
  1377. if (type == "居民小区") {
  1378. // let msgParse = JSON.parse(val.attrbutes.extendData)
  1379. let arrayList = [{
  1380. title: [type, true],
  1381. children: [
  1382. ["单位名称:", val.attrbutes.facilityName, 24],
  1383. ["街镇:", val.attrbutes.streetTown, 24],
  1384. ["地址:", val.attrbutes.address, 24],
  1385. ["联系人:", val.attrbutes.contact, 24],
  1386. ["联系电话:", val.attrbutes.contactPhone, 24],
  1387. ],
  1388. }, ];
  1389. this.popup(val._attrbutes, arrayList, true)
  1390. }
  1391. }
  1392. //火灾数据分析
  1393. if (pageType == "fire-data-analysis") {
  1394. if (type == "历史火灾") {
  1395. let arrayList = [{
  1396. title: ["案件详情", true],
  1397. children: [
  1398. ["案件编号:", val.attrbutes.ajbh, 24],
  1399. ["案件描述:", val.attrbutes.bcxx, 24],
  1400. ["报警时间:", val.attrbutes.tzsj, 24],
  1401. ["案件类型:", val.attrbutes.ajlx, 24],
  1402. ["警情类别:", type, 24],
  1403. ["警情等级:", val.attrbutes.ajdj, 24],
  1404. ["调动车辆:", val.attrbutes.cdcl, 24],
  1405. ["处置对象:", val.attrbutes.czdx, 24],
  1406. ["主责中队:", val.attrbutes.zhongdui, 24],
  1407. ["案件状态:", val.attrbutes.ajzt, 24],
  1408. ["到场时间:", val.attrbutes.cssj, 24],
  1409. ["控制时间:", val.attrbutes.kzsj, 24],
  1410. ["熄灭时间:", val.attrbutes.xmsj, 24],
  1411. ["返队时间:", val.attrbutes.fdsj, 24],
  1412. ["所属街道:", val.attrbutes.streettown, 24],
  1413. ],
  1414. }, ];
  1415. this.popup(val._attrbutes, arrayList, true)
  1416. }
  1417. if (type == "伤人火灾" || type == "亡人火灾") {
  1418. let arrayList = [{
  1419. title: ["案件详情", true],
  1420. children: [
  1421. ["火灾序号:", val.attrbutes.fireNumber, 24],
  1422. ["所属街道:", val.attrbutes.street, 24],
  1423. ["起火地点:", val.attrbutes.fireAddress, 24],
  1424. ["起火时间:", val.attrbutes.fireTime, 24],
  1425. ["直接财产损失:", val.attrbutes.directPropertyLoss + "万", 24],
  1426. ["过火面积:", val.attrbutes.burnedArea + "㎡", , 24],
  1427. ["受灾户数:", val.attrbutes.affectedHouse + "户", 24],
  1428. ["受灾人数:", val.attrbutes.victimNumber + "人", 24],
  1429. ["死亡人数:", val.attrbutes.deathToll + "人", 24],
  1430. ["受伤人数:", val.attrbutes.injuredNumber + "人", 24],
  1431. ["起火经过:", val.attrbutes.fireProcess, 24],
  1432. ],
  1433. }, ];
  1434. this.popup(val._attrbutes, arrayList, true)
  1435. }
  1436. }
  1437. //消防救援站点
  1438. if (pageType == "rescue-station") {
  1439. if (type == "科普教育基地") {
  1440. let arrayList = [{
  1441. title: [val.attrbutes.type, true],
  1442. children: [
  1443. ["成立时间/联系人:", val.attrbutes.policeTime, 24],
  1444. ["站点地址:", val.attrbutes.alertLevel, 24],
  1445. ["预约电话:", val.attrbutes.address, 24],
  1446. ],
  1447. }, ];
  1448. this.popup(val._attrbutes, arrayList, true)
  1449. }
  1450. if (type == "消防站" || type == "专职队" || type == "高层建筑覆盖" || type == "高层建筑" || type == "微型消防站" || type == "一级微型消防站" || type == "街镇专职消防队") {
  1451. if (val.attrbutes.stationType == 1 || val.attrbutes.stationType == 2 || val.attrbutes.stationType == 3 || val.attrbutes.stationType == 4) {
  1452. let arrayList = [{
  1453. title: [val.attrbutes.stationName, true],
  1454. children: [
  1455. ["消防站地址:", val.attrbutes.stationAddress, 24],
  1456. ["消防站类型:", val.attrbutes.stationType == 1 ? "一级消防站" : val.attrbutes.stationType == 2 ? "二级消防站" : val.attrbutes.stationType == 3 ? "三级消防站" : val.attrbutes.stationType == 4 ? "专职队" : "", 24],
  1457. ],
  1458. }, ];
  1459. this.popup(val._attrbutes, arrayList, true)
  1460. }
  1461. if (val.attrbutes.stationType == 5) {
  1462. let arrayList = [{
  1463. title: [val.attrbutes.streetTown + "微型消防站(" + val.attrbutes.stationCode + '号)', true],
  1464. children: [
  1465. ["地址:", val.attrbutes.stationAddress, 24],
  1466. ["编号:", val.attrbutes.stationCode, 24],
  1467. ["距消防站直线距离:", val.attrbutes.stationAddress, 24],
  1468. ["距消防站行驶距离:", val.attrbutes.driveDistance, 24],
  1469. ["交通拥堵行驶时间:", val.attrbutes.jamDrive, 24],
  1470. ["交通畅通行驶时间:", val.attrbutes.unimpededDrive, 24],
  1471. // ["点位情况:", val.attrbutes.pointSituation, 24],
  1472. ["建筑情况:", val.attrbutes.buildSituation, 24],
  1473. ["车辆停放:", val.attrbutes.vehiclePark, 24],
  1474. ["是否有产证:", val.attrbutes.birthCert, 24],
  1475. ["产证情况:", val.attrbutes.birthCertSituation, 24],
  1476. ],
  1477. }, ];
  1478. this.popup(val._attrbutes, arrayList, true)
  1479. }
  1480. if (val.attrbutes.stationType == 111 || val.attrbutes.stationType == 112) {
  1481. let arrayList = [{
  1482. title: [val.attrbutes.buildName, true],
  1483. children: [
  1484. ["建筑地址:", val.attrbutes.address, 24],
  1485. ["主要产权人:", val.attrbutes.principalPropertyOwner, 24],
  1486. ["统一社会信用代码:", val.attrbutes.creditCode, 24],
  1487. ["物业服务企业名称:", val.attrbutes.propertyServiceName, 24],
  1488. ["建成年份:", val.attrbutes.completeYear, 24],
  1489. ["建筑高度:", val.attrbutes.buildHigh, 24],
  1490. ["地上建筑层数:", val.attrbutes.aboveFloor, 24],
  1491. ["地下建筑层数:", val.attrbutes.underFloor, 24],
  1492. ["建筑类型:", val.attrbutes.buildType, 24],
  1493. ["功能用途:", val.attrbutes.functionalPurpose, 24],
  1494. ],
  1495. }, ];
  1496. this.popup(val._attrbutes, arrayList, true)
  1497. }
  1498. if (val.attrbutes.stationType == 17 || val.attrbutes.stationType == 18) {
  1499. let bianhao = JSON.parse(val.attrbutes.extendData).test1
  1500. let arrayList = [{
  1501. title: [val.attrbutes.facilityName, true],
  1502. children: [
  1503. ["编号:", bianhao, 24],
  1504. ["消防站地址:", val.attrbutes.address, 24],
  1505. ["消防站类型:", val.attrbutes.stationType == 17 ? "一级微型消防站" : val.attrbutes.stationType == 18 ? "街镇专职消防队" : "", 24],
  1506. ],
  1507. }, ];
  1508. this.popup(val._attrbutes, arrayList, true)
  1509. }
  1510. }
  1511. if (type == "企业消防" || type == "社区消防") {
  1512. let arrayList = [{
  1513. title: [val.attrbutes.facilityName, true],
  1514. children: [
  1515. ["站点地址:", val.attrbutes.address, 24],
  1516. ["站点类型:", val.attrbutes.facilityType == 13 ? "重点单位微站" :
  1517. val.attrbutes.facilityType == 14 ? "一般单位微站" : val.attrbutes.facilityType == 15 ? "居委会微站" : val.attrbutes.facilityType == 16 ? "村委会微站" : "", 24
  1518. ],
  1519. ["街镇:", val.attrbutes.streetTown, 24],
  1520. ],
  1521. }, ];
  1522. this.popup(val._attrbutes, arrayList, true)
  1523. }
  1524. }
  1525. //警情综合处置
  1526. if (pageType == "comprehensive-disposal") {
  1527. if (type == "实时警情") {
  1528. let arrayList = [{
  1529. title: ["案件详情", true],
  1530. children: [
  1531. ["案件编号:", val.attrbutes.ajbh, 24],
  1532. ["案件描述:", val.attrbutes.bcxx, 24],
  1533. ["报警时间:", val.attrbutes.tzsj, 24],
  1534. ["案件类型:", val.attrbutes.ajlx, 24],
  1535. ["警情类别:", val.attrbutes.type, 24],
  1536. ["警情等级:", val.attrbutes.ajdj, 24],
  1537. ["案发地址:", val.attrbutes.afdz, 24],
  1538. ["调动车辆:", val.attrbutes.cdcl, 24],
  1539. ["处置对象:", val.attrbutes.czdx, 24],
  1540. ["主责中队:", val.attrbutes.zhongdui, 24],
  1541. ["案件状态:", val.attrbutes.cssj, 24],
  1542. ["到场时间:", val.attrbutes.dcsj, 24],
  1543. ["出水时间:", val.attrbutes.cssj, 24],
  1544. ["控制时间:", val.attrbutes.kzsj, 24],
  1545. ["熄灭时间:", val.attrbutes.xmsj, 24],
  1546. ["所属街道:", val.attrbutes.streettown, 24],
  1547. ],
  1548. }, ];
  1549. this.popup(val._attrbutes, arrayList, true)
  1550. }
  1551. }
  1552. //城市消防体征
  1553. if (pageType == "fire-signs") {
  1554. if (type == "仓库") {
  1555. let arrayList = [{
  1556. title: [val.attrbutes.companyName, true],
  1557. children: [
  1558. ["单位地址:", val.attrbutes.address, 24],
  1559. ["单位类别:", val.attrbutes.companyType, 24],
  1560. ["单位使用性质:", val.attrbutes.companyNature, 24],
  1561. ["单位(法人)名称:", val.attrbutes.delegateName, 24],
  1562. ["统一社会信用代码:", val.attrbutes.socialCode, 24],
  1563. ["所辖派出所:", val.attrbutes.policeStation, 24],
  1564. ["消防安全责任人:", val.attrbutes.fireDutyName, 24],
  1565. ["消防安全管理人:", val.attrbutes.fireManageName, 24],
  1566. ["联系电话(手机):", val.attrbutes.linkPhone, 24],
  1567. ["是否自主消防安全管理:", val.attrbutes.fireSafetyManage, 24],
  1568. ["单位(场所)面积(㎡):", val.attrbutes.companyArea, 24],
  1569. ["行业类别:", val.attrbutes.industryType, 24],
  1570. ["是否为洁净厂房:", val.attrbutes.cleanRoom, 24],
  1571. ["生产经营组织形式:", val.attrbutes.organizationForm, 24],
  1572. ["网格号:", val.attrbutes.gridNo, 24],
  1573. ["年份:", val.attrbutes.particularYear, 24],
  1574. ["提交时间:", val.attrbutes.submitTime, 24],
  1575. ["经度:", val.attrbutes.longitude, 24],
  1576. ["纬度:", val.attrbutes.latitude, 24],
  1577. ],
  1578. }, ];
  1579. this.popup(val._attrbutes, arrayList, true)
  1580. }
  1581. }
  1582. },
  1583. });
  1584. }
  1585. },
  1586. /**
  1587. * 点分布(撒点四叶草 安保专用)
  1588. * @param {坐标信息} lnglats
  1589. * @param {页面类型} type
  1590. */
  1591. addMarkerSYC(lnglats, pageType, type) {
  1592. let that = this
  1593. let icon = "";
  1594. var target = lnglats.map((val, ind) => {
  1595. var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
  1596. var x = wgs84[0]
  1597. var y = wgs84[1]
  1598. if (
  1599. pageType == "security-plan") {
  1600. let marker = {
  1601. id: ind + 1,
  1602. attrbutes: val,
  1603. position: {
  1604. x: x,
  1605. y: y,
  1606. z: 0
  1607. },
  1608. image: {
  1609. url: type == "国家会展中心" ? this.stores.sadianIcon.hzzx : this.stores.sadianIcon.zdwxxfz,
  1610. width: val.type == "国家会展中心" ? 83 : 19.5,
  1611. height: val.type == "国家会展中心" ? 59 : 25,
  1612. },
  1613. };
  1614. return marker;
  1615. } else {
  1616. let marker = {
  1617. id: ind + 1,
  1618. attrbutes: val,
  1619. position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
  1620. image: { url: icon, width: 300, height: 300 },
  1621. };
  1622. return marker;
  1623. }
  1624. });
  1625. //撒点类型
  1626. window.jMap.Locate.pointLocate(target, {
  1627. //撒点
  1628. isZoom: false,
  1629. //animate: { "show": true },
  1630. scaleByDistance: {
  1631. minScaling: 1,
  1632. maxScaling: 1,
  1633. minDistance: 50, //最小距离
  1634. maxDistance: 120000 //最大距离
  1635. },
  1636. click: (val) => {
  1637. },
  1638. });
  1639. },
  1640. /**
  1641. * 点分布(网格名称 安保专用)
  1642. * @param {坐标信息} lnglats
  1643. * @param {页面类型} type
  1644. */
  1645. addMarkerWG(lnglats, pageType, type) {
  1646. let that = this
  1647. let icon = "";
  1648. var target = lnglats.map((val, ind) => {
  1649. var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
  1650. var x = wgs84[0]
  1651. var y = wgs84[1]
  1652. if (
  1653. pageType == "security-plan") {
  1654. let marker = {
  1655. id: ind + 1,
  1656. attrbutes: val,
  1657. position: {
  1658. x: x,
  1659. y: y,
  1660. z: 0
  1661. },
  1662. image: {
  1663. url: val.type == "wgmc_hc" ? this.stores.sadianIcon.wgmc_hc :
  1664. val.type == "wgmc_xh" ? this.stores.sadianIcon.wgmc_xh :
  1665. val.type == "wgmc_qb" ? this.stores.sadianIcon.wgmc_qb :
  1666. val.type == "wgmc_hq" ? this.stores.sadianIcon.wgmc_hq :
  1667. val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx :this.stores.sadianIcon.zdwxxfz,
  1668. width: val.type == "wgmc_hc" ? 98 :
  1669. val.type == "wgmc_xh" ? 98 :
  1670. val.type == "wgmc_qb" ? 98 :
  1671. val.type == "wgmc_hq" ? 98 :
  1672. val.type == "国家会展中心" ? 83 : 19.5,
  1673. height: val.type == "wgmc_hc" ? 33 :
  1674. val.type == "wgmc_xh" ? 33 :
  1675. val.type == "wgmc_qb" ? 33 :
  1676. val.type == "wgmc_hq" ? 33 :
  1677. val.type == "国家会展中心" ? 59 : 25,
  1678. },
  1679. };
  1680. return marker;
  1681. } else {
  1682. let marker = {
  1683. id: ind + 1,
  1684. attrbutes: val,
  1685. position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
  1686. image: { url: icon, width: 300, height: 300 },
  1687. };
  1688. return marker;
  1689. }
  1690. });
  1691. //撒点类型
  1692. window.jMap.Locate.pointLocate(target, {
  1693. //撒点
  1694. isZoom: false,
  1695. //animate: { "show": true },
  1696. scaleByDistance: {
  1697. minScaling: 1,
  1698. maxScaling: 1,
  1699. minDistance: 50, //最小距离
  1700. maxDistance: 120000 //最大距离
  1701. },
  1702. click: (val) => {
  1703. },
  1704. });
  1705. },
  1706. //聚合点击事件
  1707. clusterMapCallBack(clusterPointArr, clickPoint) {
  1708. let val = clusterPointArr.attributes
  1709. if (val.type2 == "消火栓可用" || val.type2 == "消火栓不可用") {
  1710. let arrayList = [{
  1711. title: ["消火栓", true],
  1712. children: [
  1713. ["水源位置:", val.address, 24],
  1714. ["电话:", val.phone, 12],
  1715. ["责任人:", val.dutyPerson, 12],
  1716. ["支队名称:", val.detachmentName, 24],
  1717. ["管辖机构:", val.jurisdictionalAgency, 12],
  1718. ["水源类型:", val.type, 12],
  1719. ["取水形式:", val.getWaterType, 12],
  1720. ["水源性质:", val.waterAdministrative, 12],
  1721. ["供水单位:", val.waterUnit, 24],
  1722. ["水压(Mpa):", val.waterGage, 24],
  1723. ["状态:", val.status == 1 ? "可用" : "不可用", 12],
  1724. ],
  1725. }, ];
  1726. this.popup(val, arrayList, true)
  1727. } else if (type == "天然水源") {
  1728. let arrayList = [{
  1729. title: [val.facilityName, true],
  1730. children: [
  1731. ["水源位置:", val.address, 24],
  1732. ],
  1733. }, ];
  1734. this.popup(val, arrayList, true)
  1735. }
  1736. },
  1737. /**
  1738. * 热力图
  1739. * @param {} data
  1740. */
  1741. heatMap(data) {
  1742. let target = []
  1743. if (data.length > 0) {
  1744. for (let i = 0; i < data.length; i++) {
  1745. var wgs84 = CoordUtil.gcj02towgs84(Number(data[i].gisX) || Number(data[i].longitude), Number(data[i].gisY) || Number(data[i].latitude))
  1746. var x = wgs84[0]
  1747. var y = wgs84[1]
  1748. target[i] = []
  1749. target[i].x = x
  1750. target[i].y = y
  1751. }
  1752. let options = {
  1753. style: {
  1754. minOpacity: 0.6,
  1755. maxOpacity: 0.9,
  1756. radius: 50,
  1757. gradient: {
  1758. '.10': 'green',
  1759. '.45': 'yellow',
  1760. '.65': 'orange',
  1761. '.80': 'red'
  1762. }
  1763. },
  1764. isZoom: false
  1765. }
  1766. jMap.HeatMap.show(target, options)
  1767. } else {
  1768. jMap.HeatMap.hide()
  1769. }
  1770. },
  1771. // 无经纬度创建标点和点击事件
  1772. addMarkerAddress(lnglats) {
  1773. let target = lnglats.map((val, ind) => {
  1774. if (!val.addressId) {
  1775. let addressInfo = window.jMap.queryMphInfo(val.address)[val.address][0];
  1776. return {
  1777. ...val,
  1778. addressId: addressInfo.address_id, // 地址id
  1779. province: addressInfo.province, // 市
  1780. district: addressInfo.district, // 区
  1781. sub_district: addressInfo.sub_district, // 街镇
  1782. streetname: addressInfo.streetname, // 路
  1783. address: addressInfo.address, // 户
  1784. committee: addressInfo.committee, // 居委会
  1785. };
  1786. }
  1787. });
  1788. target = target.reduce((item, next) => {
  1789. !item.some((val) => val.addressId === next.addressId) && item.push(next);
  1790. return item;
  1791. }, []);
  1792. for (let item = 0; item < Math.floor(target.length / 100); item++) {
  1793. setTimeout(() => {
  1794. window.jMap.locateMph(
  1795. target
  1796. .slice(item * 100, (item + 1) * 100)
  1797. .map((val) => val.addressId)
  1798. .join(), {
  1799. isZoom: false,
  1800. scaleByDistance: { minScaling: 0, maxScaling: 1, minDistance: 1000, maxDistance: 30000 },
  1801. click: (value) => {
  1802. this.elementInfo(value, "fire");
  1803. },
  1804. }
  1805. );
  1806. }, 0);
  1807. }
  1808. },
  1809. elementInfo(value, type) {
  1810. let element = "";
  1811. if (type == "重点单位") {
  1812. element = `<div class="ysc-dynamic-layer ys-css3-box" onclick="vue.removePopup">
  1813. <div class="tableTooltip mapTab">
  1814. <div class="tableTitle">
  1815. <div>1212121</div>
  1816. </div>
  1817. </div>
  1818. </div>`;
  1819. }
  1820. this.addMarkerInfo(element, value, type);
  1821. },
  1822. bufferL(val) {
  1823. let target = {
  1824. geometry: [{
  1825. position: [],
  1826. type: 'point'
  1827. }],
  1828. distance: 7000
  1829. }
  1830. for (let i = 0; i < val.length; i++) {
  1831. // var wgs84 = CoordUtil.gcj02towgs84(Number(val.longitude + '0000000' ), Number(val.latitude + '0000000' ))
  1832. // var x = wgs84[0]
  1833. // var y = wgs84[1]
  1834. target.geometry[i] = {
  1835. position: [{ x: Number(val[i].longitude) + '0000000', y: Number(val[i].latitude) + '0000000' }],
  1836. type: 'point'
  1837. }
  1838. // if(val[i].stationType ==7 ){
  1839. // target
  1840. // }
  1841. }
  1842. var options = { callBack: this.bufferCallback };
  1843. jMap.Buffer.generate(target, options);
  1844. },
  1845. bufferL1(val) {
  1846. let target = {
  1847. geometry: [{
  1848. position: [],
  1849. type: 'point'
  1850. }],
  1851. distance: ((Math.sqrt(7 / 3.14) * 1000) / 2).toFixed(0)
  1852. }
  1853. for (let i = 0; i < val.length; i++) {
  1854. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  1855. var x = wgs84[0].toFixed(13)
  1856. var y = wgs84[1].toFixed(13)
  1857. target.geometry[i] = {
  1858. position: [{ x: x, y: y }],
  1859. type: 'point'
  1860. }
  1861. }
  1862. var options = { callBack: bufferCallback };
  1863. jMap.Buffer.generate(target, options);
  1864. },
  1865. bufferL2(val) {
  1866. let target = {
  1867. geometry: [{
  1868. position: [],
  1869. type: 'point'
  1870. }],
  1871. distance: ((Math.sqrt(4 / 3.14) * 1000) / 2).toFixed(0)
  1872. }
  1873. for (let i = 0; i < val.length; i++) {
  1874. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  1875. var x = wgs84[0].toFixed(13)
  1876. var y = wgs84[1].toFixed(13)
  1877. target.geometry[i] = {
  1878. position: [{ x: x, y: y }],
  1879. type: 'point'
  1880. }
  1881. }
  1882. var options = { callBack: bufferCallback };
  1883. jMap.Buffer.generate(target, options);
  1884. },
  1885. bufferL3(val) {
  1886. let target = {
  1887. geometry: [{
  1888. position: [],
  1889. type: 'point'
  1890. }],
  1891. distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
  1892. }
  1893. for (let i = 0; i < val.length; i++) {
  1894. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  1895. var x = wgs84[0].toFixed(13)
  1896. var y = wgs84[1].toFixed(13)
  1897. target.geometry[i] = {
  1898. position: [{ x: x, y: y }],
  1899. type: 'point'
  1900. }
  1901. }
  1902. var options = { callBack: bufferCallback };
  1903. jMap.Buffer.generate(target, options);
  1904. },
  1905. bufferL4(val) {
  1906. let target = {
  1907. geometry: [{
  1908. position: [],
  1909. type: 'point'
  1910. }],
  1911. distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
  1912. }
  1913. for (let i = 0; i < val.length; i++) {
  1914. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  1915. var x = wgs84[0].toFixed(13)
  1916. var y = wgs84[1].toFixed(13)
  1917. target.geometry[i] = {
  1918. position: [{ x: x, y: y }],
  1919. type: 'point'
  1920. }
  1921. }
  1922. var options = { callBack: bufferCallback };
  1923. jMap.Buffer.generate(target, options);
  1924. },
  1925. bufferL5(val) {
  1926. let target = {
  1927. geometry: [{
  1928. position: [],
  1929. type: 'point'
  1930. }],
  1931. distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
  1932. }
  1933. for (let i = 0; i < val.length; i++) {
  1934. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  1935. var x = wgs84[0].toFixed(13)
  1936. var y = wgs84[1].toFixed(13)
  1937. target.geometry[i] = {
  1938. position: [{ x: x, y: y }],
  1939. type: 'point'
  1940. }
  1941. }
  1942. var options = { callBack: bufferCallback };
  1943. jMap.Buffer.generate(target, options);
  1944. },
  1945. bufferCallback(result) {
  1946. for (var i in result) {
  1947. var target = {
  1948. id: i,
  1949. position: CoordUtil.arrayToJson(result[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  1950. };
  1951. var options = {
  1952. style: {
  1953. color: 'red',
  1954. transparency: 0.6,
  1955. }
  1956. }
  1957. // if (result[i].stationType == 1) {
  1958. // options.style.color = '#f80000',
  1959. // options.style.transparency = 0.6
  1960. // }
  1961. // if (result[i].stationType == 2) {
  1962. // options.style.color = '#f88c00',
  1963. // options.style.transparency = 0.6
  1964. // }
  1965. // if (result[i].stationType == 3) {
  1966. // options.style.color = '#0092f8',
  1967. // options.style.transparency = 0.6
  1968. // }
  1969. jMap.Locate.regionLocate(target, options)
  1970. }
  1971. },
  1972. bufferCallback1(result) {
  1973. for (var i in result) {
  1974. var target = {
  1975. id: i,
  1976. position: CoordUtil.arrayToJson(result[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  1977. };
  1978. jMap.Locate.regionLocate(target, {
  1979. style: {
  1980. color: '#f80000',
  1981. transparency: 0.6,
  1982. }
  1983. })
  1984. }
  1985. },
  1986. bufferCallback2(result2) {
  1987. for (var i in result2) {
  1988. var target = {
  1989. id: i,
  1990. position: CoordUtil.arrayToJson(result2[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  1991. };
  1992. jMap.Locate.regionLocate(target, {
  1993. isZoom: true,
  1994. style: {
  1995. color: '#f88c00',
  1996. transparency: 0.6,
  1997. }
  1998. })
  1999. }
  2000. },
  2001. bufferCallback3(result3) {
  2002. for (var i in result3) {
  2003. var target = {
  2004. id: i,
  2005. position: CoordUtil.arrayToJson(result3[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  2006. };
  2007. jMap.Locate.regionLocate(target, {
  2008. style: {
  2009. color: '#0092f8',
  2010. transparency: 0.6,
  2011. }
  2012. })
  2013. }
  2014. },
  2015. addMarkerInfo(element, value, type, isBtn = false) {
  2016. var wgs84 = CoordUtil.gcj02towgs84(Number(value.gisX) || Number(value.longitude), Number(value.gisY) || Number(value.latitude))
  2017. var x = wgs84[0]
  2018. var y = wgs84[1]
  2019. let _this = this
  2020. // window.jMap.Popup && window.jMap.Popup.hide([this.oldPopup && this.oldPopup.id]);
  2021. if (this.oldPopup && value.id === this.oldPopup.id) {
  2022. window.jMap.Popup.hide();
  2023. return (this.oldPopup = null);
  2024. }
  2025. if (type == "selfManagement" || type == "water") {
  2026. window.jMap.Popup.show({
  2027. id: value.id,
  2028. //position: value.wgs84position, //使用自定义窗体
  2029. position: { x: x, y: y }, //使用自定义窗体
  2030. element: element,
  2031. }, { isZoom: false, offset: [0, -40] });
  2032. }
  2033. if (type == "重点单位") {
  2034. _this.stores.zddwIdSD(value.companyId);
  2035. // localStorage.setItem("zddw",)
  2036. // window.jMap.Popup.show({
  2037. // // position: { x: value.gisX, y: value.gisY }, //使用自定义窗体
  2038. // position: { x: x, y: y }, //使用自定义窗体
  2039. // element: element,
  2040. // }, { isZoom: 100, offset: [0, -40] });
  2041. }
  2042. // if (!isBtn) {
  2043. // window.jMap.goTo({
  2044. // x: Number(value.wgs84position.x),
  2045. // y: Number(value.wgs84position.y),
  2046. // radius: 1000,
  2047. // }, {
  2048. // duration: 3,
  2049. // offset: {
  2050. // heading: -4,
  2051. // pitch: -70,
  2052. // range: 0,
  2053. // },
  2054. // });
  2055. // window.jMap.Buffer.generate({
  2056. // geometry: [{ position: [{ x: Number(value.wgs84position.x), y: Number(value.wgs84position.y) }], type: "point" }],
  2057. // distance: 1000,
  2058. // }, {
  2059. // callBack: (el) => {
  2060. // for (const i in el) {
  2061. // var target = {
  2062. // id: i,
  2063. // position: CoordUtil.arrayToJson(el[i].rings[0]),
  2064. // };
  2065. // }
  2066. // window.jMap.Locate.regionLocate(target, {
  2067. // style: {
  2068. // color: "rgba(235, 98, 98, .1)",
  2069. // transparency: 0.3,
  2070. // },
  2071. // });
  2072. // },
  2073. // });
  2074. // }
  2075. this.oldPopup = value;
  2076. },
  2077. removePopup(e) {
  2078. },
  2079. /**
  2080. * 气泡窗
  2081. * @param {*} data
  2082. * @param {*} arrayList 展示数据
  2083. * @param {*} type
  2084. * @param {*} other
  2085. * @param {*} zb 坐标类型
  2086. */
  2087. popup(data, arrayList, type, other, zb) {
  2088. if (type) {
  2089. if (!other) {
  2090. var html = document.createElement('div');
  2091. html.className = 'ysc-dynamic-layer ys-css3-box';
  2092. var line = document.createElement('div');
  2093. line.className = 'line';
  2094. var main = document.createElement('div');
  2095. main.className = 'main';
  2096. if (zb) {
  2097. main.setAttribute('style', 'position: fixed;top:120px;left:39%;max-height:500px;overflow-y: scroll;background:none;width:400px;bottom:auto; padding:10px 10px 5px 0 !important; border-radius: 0.05rem;border:1px solid rgba(115, 251, 253, 1);box - shadow: inset 0 0 1px 0.0125rem rgba(115, 251, 253, 1); background:rgba(0, 0, 0, 0.6)');
  2098. } else {
  2099. main.setAttribute('style', 'position: absolute;top:50%;max-height:500px;overflow-y: scroll;background:none;width:400px;bottom:auto; padding:10px 10px 5px 0 !important; border-radius: 0.05rem;border:1px solid rgba(115, 251, 253, 1);box - shadow: inset 0 0 1px 0.0125rem rgba(115, 251, 253, 1); background:rgba(0, 0, 0, 0.6)');
  2100. }
  2101. var click = document.createElement('div');
  2102. click.setAttribute('style', 'float: right;width: 13px;height: 13px;position: absolute;top:8px;right:16px;cursor: pointer');
  2103. var img = document.createElement('img');
  2104. img.className = 'click';
  2105. img.setAttribute("src", this.stores.sadianIcon.close);
  2106. img.setAttribute("style", 'width: 20px;height: 20px;')
  2107. click.appendChild(img)
  2108. var contain = document.createElement('div');
  2109. contain.setAttribute('style', 'margin-left: 3%;right:50px;top:30px;padding: 0px 0 ');
  2110. if (arrayList[0].title[1]) {
  2111. var p = document.createElement('div');
  2112. p.setAttribute('style', 'font-size:18px;color:#73fbfd;line-height:25px');
  2113. p.innerHTML = arrayList[0].title[0]
  2114. contain.appendChild(p)
  2115. }
  2116. for (let i = 0; i < arrayList[0].children.length; i++) {
  2117. if (arrayList[0].children[i][1]) {
  2118. let textWrap = document.createElement('div');
  2119. textWrap.setAttribute('style', 'font-size:14px;color:#fff;line-height:25px;');
  2120. let p1 = document.createElement('span');
  2121. p1.setAttribute('style', 'color:#73fbfd;');
  2122. p1.innerHTML = arrayList[0].children[i][0]
  2123. // if()
  2124. let p2 = document.createElement('span');
  2125. p2.setAttribute('style', 'color:#fff;word-break:break-all !important');
  2126. p2.innerHTML = arrayList[0].children[i][1]
  2127. textWrap.appendChild(p1)
  2128. textWrap.appendChild(p2)
  2129. contain.appendChild(textWrap)
  2130. }
  2131. }
  2132. setTimeout(() => {
  2133. main.appendChild(click)
  2134. main.appendChild(contain)
  2135. if (zb) {
  2136. } else {
  2137. html.appendChild(line)
  2138. }
  2139. html.appendChild(main)
  2140. let text = html.innerHTML.replace(/"click"/g, '"click" onclick="vue.popup(false, false, false)"')
  2141. if (zb) {
  2142. var wgs84 = [Number(data.gisX), Number(data.gisY)]
  2143. } else {
  2144. var wgs84 = CoordUtil.gcj02towgs84(Number(data.gisX) || Number(data.longitude), Number(data.gisY) || Number(data.latitude))
  2145. }
  2146. var x = wgs84[0]
  2147. var y = wgs84[1]
  2148. var target = {
  2149. id: '100001',
  2150. position: { x: x, y: y, z: 0 },
  2151. element: `<div class="ysc-dynamic-layer ys-css3-box" style="">${text}</div>`
  2152. };
  2153. var options = {
  2154. // isZoom: true,
  2155. offset: [-6, -275]
  2156. };
  2157. jMap.Popup.show(target, options);
  2158. }, 10)
  2159. } else {
  2160. }
  2161. } else {
  2162. jMap.Popup.hide();
  2163. }
  2164. },
  2165. }
  2166. }