map-data1.js 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242
  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() {
  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. console.log(movement.position)
  43. this.stores.$state.tankuangXY = { x: movement.position.x, y: movement.position.y };
  44. // this.$store.commit("tankuangXY", { x: movement.position.x, y: movement.position.y });
  45. },
  46. map_right_click_callback: (obj) => {},
  47. };
  48. let res = await this.$axios.get(this.$api.dt);
  49. // 加载地图
  50. window.jMap.createMap("mapF", res.data, window.location.origin, map_params, {});
  51. // 地图背景样式
  52. window.jMap.switchBaseLayer("blue");
  53. /**
  54. * 获取街镇信息
  55. */
  56. var options = {
  57. click: addLayerCallBack,
  58. isZoom: false,
  59. style: {
  60. outline: true,
  61. outlineColor: "rgb(255,0,0,0.8)",
  62. material: "rgb(154,255,154,0)",
  63. perPositionHeight: false,
  64. height: 5,
  65. width: 5,
  66. label: {
  67. show: true,
  68. text: "name",
  69. font: "16px Helvetica",
  70. fillColor: "rgb(0,255,0,0.9)",
  71. pixelOffset: [0, -40],
  72. backgroundColor: "rgb(0,0,0,0)",
  73. showBackground: false,
  74. },
  75. },
  76. // where:"name = '莘庄镇'"
  77. };
  78. window.jMap.addLayer("mh_dyn_district", [1], options);
  79. var _this = this;
  80. function addLayerCallBack(obj) {
  81. // _this.streetTownMap(obj._name)
  82. _this.stores.streetTownSet(obj._name)
  83. }
  84. // 街镇标题
  85. var qp = new JMapQueryParam({
  86. queryMapService: "mh_dyn_district",
  87. queryMapLayers: [1],
  88. outFields: ["code", "name", "center_x", "center_y"],
  89. queryWhere: "name like '%莘庄镇%' ",
  90. callBack: (res) => {
  91. res.features.forEach(async(val) => {
  92. await window.jMap.FlagInfo.show({
  93. id: val.attributes.code,
  94. position: { x: Number(val.attributes.center_x), y: Number(val.attributes.center_y), z: 0 },
  95. element: `<div class='ysc-dynamic-layer ys-css3-box' onclick="vue.clickFlag(${val.attributes.code})">
  96. <div class='biaozhu' style="font-size:18px !important">${val.attributes.name} ${val.attributes.code}</div>
  97. </div>`,
  98. }, { isZoom: false });
  99. });
  100. },
  101. });
  102. // new JMapQuery(window.jMap).execQuery(qp)
  103. //window.jMap.bindBuildingClick(callbackFunction)
  104. // 点击三维建筑模型触发的回调函数
  105. },
  106. /**
  107. *添加动态图层
  108. *
  109. */
  110. addLayer() {
  111. var wheres = [];
  112. wheres[1] = "subdistrict='七宝镇'"; // 1:图层序号 subdistrict='七宝镇' 筛选条件
  113. var options = {
  114. click: windowGxLayer,
  115. wheres: wheres
  116. };
  117. setTimeout(() => {
  118. jMap.addImageryLayer("mh_dyn_cywg", [1], options);
  119. }, 3000);
  120. },
  121. // 点击事件回调函数
  122. addLayerCallBack(obj) {
  123. },
  124. /**
  125. *安保区域划分
  126. *
  127. */
  128. anbaoMap() {
  129. let target = {
  130. id: '100001',
  131. attributes: {
  132. name: '大型安保范围',
  133. },
  134. position: data[0],
  135. label: {
  136. text: "大型安保范围",
  137. font: "16px Helvetica",
  138. color: "rgba(255,255,255,0.1)",
  139. pixelOffset: [0, -50],
  140. backgroundColor: "red"
  141. }
  142. }
  143. var options = {
  144. isZoom: true,
  145. style: {
  146. color: 'rgb(255,255,0,0.9)',
  147. transparency: 1,
  148. outline: true,
  149. outlineColor: 'transparent',
  150. perPositionHeight: true
  151. },
  152. // click: regionLocateCallBack
  153. };
  154. setTimeout(() => {
  155. window.jMap.Locate.trackLocate(target, options);
  156. }, 1000)
  157. },
  158. // 安保分布点点击事件的回调函数
  159. regionLocateCallBack(obj) {
  160. console.log(obj); // obj为返回值
  161. },
  162. /**
  163. * @聚合撒点
  164. * @param {数据list} data
  165. * @param {页面类型} pageType
  166. * @param {类型} type
  167. */
  168. initMarkers(data, pageType, type) {
  169. var _this = this;
  170. var tag = 1; //1.自定义图标 2.完全自定义 3.默认
  171. var style = ""; //地图最大化小图标
  172. var points = []; //地图撒点处理数据存储
  173. var options = {
  174. style: { pixelRange: 10 },
  175. isZoom: true,
  176. click: clusterMapCallBack,
  177. };
  178. jMap.ClusterMap.show(data, options);
  179. },
  180. clickFlag(val) {
  181. console.log(val);
  182. },
  183. randomColor() {
  184. var color = "#";
  185. //for循环中,如果后面仅有一条语句,{}可省略不写
  186. //随机生成6位0-15之间的数字,再用toString(16)将数字转成16进制
  187. for (var i = 0; i < 6; i++) color += parseInt(Math.random() * 16).toString(16);
  188. return color;
  189. },
  190. removeMarkers(lnglats) {
  191. this.map.remove(lnglats);
  192. },
  193. /**
  194. *街镇切换
  195. */
  196. streetTownSwitch(data) {
  197. // console.log(data);
  198. let sf = 2800.0;
  199. if (data.id == 12) {
  200. //区缩放比例调整
  201. sf = 18000.0;
  202. }
  203. var options = {
  204. area: data.id,
  205. base_layer_name: "dark",
  206. model_data_name: "dark",
  207. isShowDistrictLabel: true,
  208. camera: {
  209. x: data.x,
  210. y: data.y,
  211. radius: sf,
  212. offset: { heading: 4, pitch: -89, range: 0 },
  213. },
  214. };
  215. jMap.switchStreet(options);
  216. },
  217. /**
  218. * 点分布(撒点)
  219. * @param {坐标信息} lnglats
  220. * @param {页面类型} type
  221. */
  222. addMarker(lnglats, pageType, type) {
  223. window.jMap.Locate.clearLocate();
  224. let icon = "";
  225. let arr = []
  226. let arr1 = []
  227. let arr2 = []
  228. let arr3 = []
  229. let arr4 = []
  230. let arr5 = []
  231. var target = lnglats.map((val, ind) => {
  232. var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
  233. var x = wgs84[0]
  234. var y = wgs84[1]
  235. if (pageType == "enforcement-dynamic" ||
  236. pageType == "self-management" ||
  237. pageType == "comprehensive-disposal" ||
  238. pageType == "rescue-station" ||
  239. pageType == "security-plan" ||
  240. pageType == "fire-signs" ||
  241. pageType == "fire-data-analysis" ||
  242. pageType == "water-sources") {
  243. let marker = {
  244. id: ind + 1,
  245. attrbutes: val,
  246. position: {
  247. x: x,
  248. y: y,
  249. // x: Number(val.gisX) || Number(val.longitude),
  250. // y: Number(val.gisY) || Number(val.latitude),
  251. z: 0
  252. },
  253. image: {
  254. url: type == "双随机执法单位" ? this.stores.sadianIcon.ssjzf : type == "安全检查单位" ? this.stores.sadianIcon.aqjcdw : type == "举报投诉" ? this.stores.sadianIcon.jbts : type == "执法记录仪" ? this.stores.sadianIcon.zfjly :
  255. 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 :
  256. type == "厂房" ? this.stores.sadianIcon.cf : type == "仓库" ? this.stores.sadianIcon.ck :
  257. type == "车辆" && val.type != "国家会展中心" ? this.stores.sadianIcon.xfc : type == "历史警情" && val.type != "国家会展中心" ? this.stores.sadianIcon.lsjq :
  258. type == "历史火灾" && val.type != "国家会展中心" ? this.stores.sadianIcon.lshz : val.type == "国家会展中心" ? this.stores.sadianIcon.hzzx :
  259. type == "亡人火灾" ? this.stores.sadianIcon.wrhz : type == "伤人火灾" ? this.stores.sadianIcon.srhz :
  260. type == "消火栓可用" ? this.stores.sadianIcon.xhs : type == "消火栓不可用" ? this.stores.sadianIcon.xhsH :
  261. type == "天然水源" ? this.stores.sadianIcon.trsy : type == "科普教育基地" ? this.stores.sadianIcon.kpjyjd :
  262. type == "消防站" ? this.stores.sadianIcon.xfz : type == "高层建筑覆盖" && val.stationType == 1 ? this.stores.sadianIcon.xfdjl :
  263. type == "高层建筑覆盖" && val.stationType == 2 ? this.stores.sadianIcon.xfdj2 : type == "高层建筑覆盖" && val.stationType == 3 ? this.stores.sadianIcon.xfdj3 :
  264. type == "高层建筑覆盖" && val.stationType == 4 ? this.stores.sadianIcon.zzd : type == "高层建筑覆盖" && val.stationType == 5 ? this.stores.sadianIcon.jzwxxfz :
  265. type == "高层建筑覆盖" && val.stationType == 111 ? this.stores.sadianIcon.dian : type == "高层建筑" ? this.stores.sadianIcon.gcggjz :
  266. type == "专职队" ? this.stores.sadianIcon.zzd : type == "微型消防站" ? this.stores.sadianIcon.jzwxxfz : type == "大型综合体" && val.facilityType == "lhtj" ? this.stores.sadianIcon.lhtj :
  267. type == "大型综合体" && (val.facilityType == 2 || val.facilityType == 3) ? this.stores.sadianIcon.dxzht : type == "重大火灾隐患" ? this.stores.sadianIcon.lsjq :
  268. type == "企业消防" && val.facilityType == 13 ? this.stores.sadianIcon.zddw : type == "企业消防" && val.facilityType == 14 ? this.stores.sadianIcon.ybdw :
  269. type == "社区消防" && val.facilityType == 15 ? this.stores.sadianIcon.zddw : type == "社区消防" && val.facilityType == 16 ? this.stores.sadianIcon.ybdw :
  270. 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 :
  271. type == "三合一" ? this.stores.sadianIcon.shy : type == "实时警情" ? this.stores.sadianIcon.ssjq :
  272. type == "本年度重点事项推进情况" && val.status == 1 ? this.stores.sadianIcon.ywc : type == "本年度重点事项推进情况" && val.status == 2 ? this.stores.sadianIcon.jxz : type == "本年度重点事项推进情况" && val.status == 3 ? this.stores.sadianIcon.zbz :
  273. type == "高风险" ? this.stores.sadianIcon.gfx : type == "较高风险" ? this.stores.sadianIcon.jgfx : type == "一般风险" ? this.stores.sadianIcon.ybfx : type == "低风险" ? this.stores.sadianIcon.dfx :
  274. this.stores.sadianIcon.trsy,
  275. // this.jqzhczIcon3 : val.type == "4" ?
  276. // this.jqzhczIcon4 : val.type == "5" ?
  277. // this.jqzhczIcon5 : val.type == "消火栓" && val.status == "1" ?
  278. // this.jqzhczIcon5 : val.type == "消火栓" && val.status == "2" ?
  279. // this.jqzhczIcon51 : val.type == "天然水源" ?
  280. // this.jqzhczIcon7 : this.xfzfdtIcon4,
  281. width: val.type == "国家会展中心" ? 83 : type == "高层建筑覆盖" && val.stationType == 111 ? 7 : type == 111 ? 74 : 19.5,
  282. height: val.type == "国家会展中心" ? 59 : type == "高层建筑覆盖" && val.stationType == 111 ? 7 : type == 111 ? 66 : 25,
  283. },
  284. };
  285. if (type == "高层建筑覆盖" && val.stationType == 1) {
  286. arr1.push(val)
  287. }
  288. if (type == "高层建筑覆盖" && val.stationType == 2) {
  289. arr2.push(val)
  290. }
  291. if (type == "高层建筑覆盖" && val.stationType == 3) {
  292. arr3.push(val)
  293. }
  294. if (type == "高层建筑覆盖" && val.stationType == 4) {
  295. arr4.push(val)
  296. }
  297. if (type == "高层建筑覆盖" && val.stationType == 5) {
  298. arr5.push(val)
  299. }
  300. return marker;
  301. } else {
  302. let marker = {
  303. id: ind + 1,
  304. attrbutes: val,
  305. position: { x: val.gisBaiDuX, y: val.gisBaiDuY, z: 0 },
  306. image: { url: icon, width: 300, height: 300 },
  307. };
  308. return marker;
  309. }
  310. });
  311. if (type == "高层建筑覆盖") {
  312. if (arr1.length > 0) {
  313. this.bufferL1(arr1)
  314. }
  315. if (arr2.length > 0) {
  316. this.bufferL2(arr2)
  317. }
  318. if (arr3.length > 0) {
  319. this.bufferL3(arr3)
  320. }
  321. if (arr4.length > 0) {
  322. this.bufferL4(arr4)
  323. }
  324. if (arr5.length > 0) {
  325. this.bufferL5(arr5)
  326. }
  327. // this.bufferL(arr)
  328. }
  329. //消防水源
  330. if (pageType == "water-sources") {
  331. var array = {
  332. clusterId: 100001,
  333. clusterData: []
  334. }
  335. var target1 = lnglats.map((val, ind) => {
  336. var wgs84 = CoordUtil.gcj02towgs84(Number(val.gisX) || Number(val.longitude), Number(val.gisY) || Number(val.latitude))
  337. var x = wgs84[0]
  338. var y = wgs84[1]
  339. val.type2 = type
  340. var array1 = {
  341. attributes: val,
  342. position: {
  343. x: x,
  344. y: y,
  345. z: 0,
  346. },
  347. image: {
  348. url: type == "消火栓可用" ? this.stores.sadianIcon.xhs : type == "消火栓不可用" ? this.stores.sadianIcon.xhsH : type == "天然水源" ? this.stores.sadianIcon.trsy : this.stores.sadianIcon.trsy,
  349. width: 19.5,
  350. height: 25,
  351. }
  352. }
  353. array.clusterData.push(array1)
  354. })
  355. var options = {
  356. style: { pixelRange: 60 },
  357. isZoom: true,
  358. click: this.clusterMapCallBack
  359. };
  360. window.jMap.ClusterMap.show(array, options)
  361. } else {
  362. //撒点类型
  363. window.jMap.Locate.pointLocate(target, {
  364. //撒点
  365. isZoom: false,
  366. //animate: { "show": true },
  367. scaleByDistance: {
  368. minScaling: 1,
  369. maxScaling: 1,
  370. minDistance: 50, //最小距离
  371. maxDistance: 120000 //最大距离
  372. },
  373. click: (val) => {
  374. //消防执法
  375. if (pageType == "enforcement-dynamic") {
  376. if (type == "安全检查单位" || type == "双随机执法单位") {
  377. this.$axios
  378. .get(
  379. this.$api.siaeall.one +
  380. "?" +
  381. this.$qs.stringify({
  382. companyId: val.attrbutes.number,
  383. companyName: val.attrbutes.name,
  384. })
  385. )
  386. .then((res) => {
  387. res.data[0].company = val._attrbutes.name;
  388. res.data[0].streetTown = val._attrbutes.streetTown;
  389. let arrayList = [{
  390. title: [res.data[0].company, res.data[0].company ? true : false],
  391. children: [
  392. ["单位地址:", res.data[0].companyAddress, 24],
  393. ["负责人:", res.data[0].linkPerson, 10],
  394. ["联系电话:", res.data[0].linkPhone, 14],
  395. ["历史火灾次数:", res.data[0].fireCount, 12],
  396. ],
  397. },
  398. {
  399. title: ["行政许可情况", res.data[0].processDate && res.data[0].carefullyCheckDate && res.data[0].securityCheckDates],
  400. children: [
  401. ["审核时间:", res.data[0].processDate, 12],
  402. ["验收时间:", res.data[0].carefullyCheckDate, 12],
  403. ["安检时间:", res.data[0].securityCheckDates, 12],
  404. ],
  405. },
  406. {
  407. 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],
  408. children: [
  409. ["检查:", res.data[0].inspectCompany + "(家)", 8],
  410. ["隐患:", res.data[0].fireHazard + "(起)", 8],
  411. ["整改:", res.data[0].rectificateFireHazard + "(起)", 8],
  412. ["行罚:", res.data[0].punishmentDecision + "(份)", 8],
  413. ["三停:", res.data[0].orderThreeStops + "(家)", 8],
  414. ["责改:", res.data[0].correctionNotice + "(份)", 8],
  415. ["临封:", res.data[0].temporarySeizure + "(份)", 8],
  416. ["罚金:", res.data[0].penaltyAmount + "(万元)", 8],
  417. ],
  418. },
  419. {
  420. 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],
  421. children: [
  422. ["报警时间:", res.data[0].fireTime, 12],
  423. ["处置时长:", res.data[0].disposalDuration, 12],
  424. ["过火面积:", res.data[0].burnedArea, 12],
  425. ["火灾等级:", res.data[0].fireGrade, 12],
  426. ["调动车辆:", res.data[0].mobilizeVehicles + "(辆)", 12],
  427. ["所属中队:", res.data[0].squadron, 12],
  428. ["状况:", res.data[0].status, 12],
  429. ["起火物:", res.data[0].initialFuelType1, 12],
  430. ],
  431. },
  432. ];
  433. this.popup(val._attrbutes, arrayList, true)
  434. });
  435. } else if (type == "举报投诉") {
  436. let arrayList = [{
  437. title: [val._attrbutes.name, true],
  438. children: [
  439. ],
  440. }]
  441. this.popup(val._attrbutes, arrayList, true)
  442. } else if (type == "执法记录仪") {
  443. let arrayList = [{
  444. title: [val._attrbutes.groupName, true],
  445. children: [
  446. ["执法人:", val._attrbutes.name, 12],
  447. ],
  448. type: type,
  449. url: val._attrbutes.url,
  450. },
  451. ]
  452. this.popup(val._attrbutes, arrayList, true)
  453. } else if (type == "重大火灾隐患") {
  454. let msgParse = JSON.parse(val.attrbutes.extendData)
  455. let arrayList = [{
  456. title: [val.attrbutes.facilityName, true],
  457. children: [
  458. ["地址:", val.attrbutes.address, 24],
  459. ["分类等级:", val.attrbutes.address, 24],
  460. ["基础信息:", msgParse.test1, 24],
  461. ["消防安全隐患情况:", msgParse.test2, 24],
  462. ],
  463. }, ];
  464. this.popup(val._attrbutes, arrayList, true)
  465. } else if (type == "三合一") {
  466. let msgParse = JSON.parse(val.attrbutes.extendData)
  467. let arrayList = [{
  468. title: [val.attrbutes.facilityName, true],
  469. children: [
  470. ["单位地址:", val.attrbutes.address.replace("\t", ""), 24],
  471. ["单位类别:", "三合一九小场所", 24],
  472. ["单位法人:", val.attrbutes.facilityName.replace("\t", ""), 24],
  473. ["检查人员姓名:", msgParse.test1, 24],
  474. ["检查时间:", msgParse.test3, 24],
  475. ["单位使用性质:", msgParse.test4, 24],
  476. ["单位所属街道:", msgParse.test8, 24],
  477. ["消消防安全责任人:", msgParse.test10, 24],
  478. ["消防安全管理人(联系人):", msgParse.test11, 24],
  479. ["联系电话(手机):", msgParse.test12, 24],
  480. ["单位(场所)面积(m²):", msgParse.test17, 24],
  481. ["地上:", msgParse.test18, 24],
  482. ["地下:", msgParse.test19, 24],
  483. ["建筑性质:", msgParse.test21, 24],
  484. ["建筑结构:", msgParse.test22, 24],
  485. ],
  486. }, ];
  487. this.popup(val._attrbutes, arrayList, true)
  488. } else if (type == "本年度重点事项推进情况") {
  489. let msgParse = JSON.parse(val.attrbutes.extendData)
  490. let arrayList = [{
  491. title: [val.attrbutes.facilityName, true],
  492. children: [
  493. ["街道名称:", val.attrbutes.streetTown, 24],
  494. ["地址:", val.attrbutes.address, 24],
  495. ["状态:", val.attrbutes.status == 1 ? "已完成" : val.attrbutes.status == 2 ? "施工中" : val.attrbutes.status == 3 ? "招标中" : "", 24],
  496. ],
  497. }, ];
  498. this.popup(val._attrbutes, arrayList, true)
  499. }
  500. }
  501. //企业自主
  502. if (pageType == "self-management") {
  503. if (val.attrbutes.type == "重点单位") {
  504. this.elementInfo(val.attrbutes, "重点单位")
  505. } else if (val.attrbutes.type == "大型综合体") {
  506. let msgParse = JSON.parse(val.attrbutes.extendData)
  507. let arrayList = [{
  508. title: [val.attrbutes.facilityName, true],
  509. children: [
  510. ["地址:", val.attrbutes.address, 24],
  511. ["类型:", val.attrbutes.facilityType == 2 ? "5W平大型商业综合体" : val.attrbutes.facilityType == 3 ? "3-5万平大型商业综合体" : "", 24],
  512. ["平面布局:", msgParse.planeLayout, 24],
  513. ["用火用电用气管理:", msgParse.fireGasManage, 24],
  514. ["油烟管道管理:", msgParse.oilFumeManage, 24],
  515. ["消防设施:", msgParse.fireFacility, 24],
  516. ["其他安全管理:", msgParse.otherSecurityManage, 24],
  517. ["合计汇总:", msgParse.totalSummary, 24],
  518. ],
  519. }, ];
  520. this.popup(val._attrbutes, arrayList, true)
  521. } else if (val.attrbutes.type == "中小学" || val.attrbutes.type == "幼儿园" || val.attrbutes.type == "其他学校") {
  522. let msgParse = JSON.parse(val.attrbutes.extendData)
  523. let phone = val.attrbutes.contactPhone
  524. let arrayList = [{
  525. title: [val.attrbutes.facilityName, true],
  526. children: [
  527. ["机构简称:", msgParse.test1, 24],
  528. // ["学校办别:", val.attrbutes.facilityType, 24],
  529. ["学校类型:", val.attrbutes.type, 24],
  530. ["所在街镇:", val.attrbutes.streetTown, 24],
  531. ["地址:", msgParse.address, 24],
  532. ["法人代表:", val.attrbutes.contact, 24],
  533. ["手机:", 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],
  534. ],
  535. }, ];
  536. this.popup(val._attrbutes, arrayList, true)
  537. } else {
  538. let arrayList = [{
  539. title: ["单位详情", val.attrbutes.companyName ? true : false],
  540. children: [
  541. ["单位名称:", val.attrbutes.companyName, 24],
  542. ["单位类型:", val.attrbutes.companyTypeName, 24],
  543. ["联系电话:", val.attrbutes.linkPhone, 24],
  544. ["地址:", val.attrbutes.address, 24],
  545. ],
  546. }, ];
  547. this.popup(val._attrbutes, arrayList, true)
  548. }
  549. }
  550. //大型安保 、火灾数据分析
  551. if (pageType == "security-plan" || pageType == "fire-data-analysis") {
  552. let arrayList = [{
  553. title: ["案件详情", true],
  554. children: [
  555. ["案件编号:", val.attrbutes.ajbh, 24],
  556. ["案件描述:", val.attrbutes.bcxx, 24],
  557. ["报警时间:", val.attrbutes.tzsj, 24],
  558. ["案件类型:", val.attrbutes.ajlx, 24],
  559. ["警情类别:", type, 24],
  560. ["警情等级:", val.attrbutes.ajdj, 24],
  561. ["调动车辆:", val.attrbutes.cdcl, 24],
  562. ["处置对象:", val.attrbutes.czdx, 24],
  563. ["主责中队:", val.attrbutes.zhongdui, 24],
  564. ["案件状态:", val.attrbutes.ajzt, 24],
  565. ["到场时间:", val.attrbutes.cssj, 24],
  566. ["控制时间:", val.attrbutes.kzsj, 24],
  567. ["熄灭时间:", val.attrbutes.xmsj, 24],
  568. ["返队时间:", val.attrbutes.fdsj, 24],
  569. ["所属街道:", val.attrbutes.streettown, 24],
  570. ],
  571. }, ];
  572. if (val._attrbutes.type != "国家会展中心") {
  573. this.popup(val._attrbutes, arrayList, true)
  574. }
  575. }
  576. //消防救援站点
  577. if (pageType == "rescue-station") {
  578. if (type == "科普教育基地") {
  579. let arrayList = [{
  580. title: [val.attrbutes.type, true],
  581. children: [
  582. ["成立时间/联系人:", val.attrbutes.policeTime, 24],
  583. ["站点地址:", val.attrbutes.alertLevel, 24],
  584. ["预约电话:", val.attrbutes.address, 24],
  585. ],
  586. }, ];
  587. this.popup(val._attrbutes, arrayList, true)
  588. }
  589. if (type == "消防站" || type == "专职队" || type == "高层建筑覆盖" || type == "高层建筑" || type == "微型消防站" || type == "一级微型消防站" || type == "街镇专职消防队") {
  590. if (val.attrbutes.stationType == 1 || val.attrbutes.stationType == 2 || val.attrbutes.stationType == 3 || val.attrbutes.stationType == 4) {
  591. let arrayList = [{
  592. title: [val.attrbutes.stationName, true],
  593. children: [
  594. ["消防站地址:", val.attrbutes.stationAddress, 24],
  595. ["消防站类型:", val.attrbutes.stationType == 1 ? "一级消防站" : val.attrbutes.stationType == 2 ? "二级消防站" : val.attrbutes.stationType == 3 ? "三级消防站" : val.attrbutes.stationType == 4 ? "专职队" : "", 24],
  596. ],
  597. }, ];
  598. this.popup(val._attrbutes, arrayList, true)
  599. }
  600. if (val.attrbutes.stationType == 5) {
  601. let arrayList = [{
  602. title: [val.attrbutes.streetTown + "微型消防站(" + val.attrbutes.stationCode + '号)', true],
  603. children: [
  604. ["地址:", val.attrbutes.stationAddress, 24],
  605. ["编号:", val.attrbutes.stationCode, 24],
  606. ["距消防站直线距离:", val.attrbutes.stationAddress, 24],
  607. ["距消防站行驶距离:", val.attrbutes.driveDistance, 24],
  608. ["交通拥堵行驶时间:", val.attrbutes.jamDrive, 24],
  609. ["交通畅通行驶时间:", val.attrbutes.unimpededDrive, 24],
  610. // ["点位情况:", val.attrbutes.pointSituation, 24],
  611. ["建筑情况:", val.attrbutes.buildSituation, 24],
  612. ["车辆停放:", val.attrbutes.vehiclePark, 24],
  613. ["是否有产证:", val.attrbutes.birthCert, 24],
  614. ["产证情况:", val.attrbutes.birthCertSituation, 24],
  615. ],
  616. }, ];
  617. this.popup(val._attrbutes, arrayList, true)
  618. }
  619. if (val.attrbutes.stationType == 111 || val.attrbutes.stationType == 112) {
  620. let arrayList = [{
  621. title: [val.attrbutes.buildName, true],
  622. children: [
  623. ["建筑地址:", val.attrbutes.address, 24],
  624. ["主要产权人:", val.attrbutes.principalPropertyOwner, 24],
  625. ["统一社会信用代码:", val.attrbutes.creditCode, 24],
  626. ["物业服务企业名称:", val.attrbutes.propertyServiceName, 24],
  627. ["建成年份:", val.attrbutes.completeYear, 24],
  628. ["建筑高度:", val.attrbutes.buildHigh, 24],
  629. ["地上建筑层数:", val.attrbutes.aboveFloor, 24],
  630. ["地下建筑层数:", val.attrbutes.underFloor, 24],
  631. ["建筑类型:", val.attrbutes.buildType, 24],
  632. ["功能用途:", val.attrbutes.functionalPurpose, 24],
  633. ],
  634. }, ];
  635. this.popup(val._attrbutes, arrayList, true)
  636. }
  637. if (val.attrbutes.stationType == 17 || val.attrbutes.stationType == 18) {
  638. let bianhao = JSON.parse(val.attrbutes.extendData).test1
  639. let arrayList = [{
  640. title: [val.attrbutes.facilityName, true],
  641. children: [
  642. ["编号:", bianhao, 24],
  643. ["消防站地址:", val.attrbutes.address, 24],
  644. ["消防站类型:", val.attrbutes.stationType == 17 ? "一级微型消防站" : val.attrbutes.stationType == 18 ? "街镇专职消防队" : "", 24],
  645. ],
  646. }, ];
  647. this.popup(val._attrbutes, arrayList, true)
  648. }
  649. }
  650. if (type == "企业消防" || type == "社区消防") {
  651. let arrayList = [{
  652. title: [val.attrbutes.facilityName, true],
  653. children: [
  654. ["站点地址:", val.attrbutes.address, 24],
  655. ["站点类型:", val.attrbutes.facilityType == 13 ? "重点单位微站" :
  656. val.attrbutes.facilityType == 14 ? "一般单位微站" : val.attrbutes.facilityType == 15 ? "居委会微站" : val.attrbutes.facilityType == 16 ? "村委会微站" : "", 24
  657. ],
  658. ["街镇:", val.attrbutes.streetTown, 24],
  659. ],
  660. }, ];
  661. this.popup(val._attrbutes, arrayList, true)
  662. }
  663. }
  664. //警情综合处置
  665. if (pageType == "comprehensive-disposal") {
  666. if (type == "实时警情") {
  667. let arrayList = [{
  668. title: ["案件详情", true],
  669. children: [
  670. ["案件编号:", val.attrbutes.ajbh, 24],
  671. ["案件描述:", val.attrbutes.bcxx, 24],
  672. ["报警时间:", val.attrbutes.tzsj, 24],
  673. ["案件类型:", val.attrbutes.ajlx, 24],
  674. ["警情类别:", val.attrbutes.type, 24],
  675. ["警情等级:", val.attrbutes.ajdj, 24],
  676. ["案发地址:", val.attrbutes.afdz, 24],
  677. ["调动车辆:", val.attrbutes.cdcl, 24],
  678. ["处置对象:", val.attrbutes.czdx, 24],
  679. ["主责中队:", val.attrbutes.zhongdui, 24],
  680. ["案件状态:", val.attrbutes.cssj, 24],
  681. ["到场时间:", val.attrbutes.dcsj, 24],
  682. ["出水时间:", val.attrbutes.cssj, 24],
  683. ["控制时间:", val.attrbutes.kzsj, 24],
  684. ["熄灭时间:", val.attrbutes.xmsj, 24],
  685. ["所属街道:", val.attrbutes.streettown, 24],
  686. ],
  687. }, ];
  688. this.popup(val._attrbutes, arrayList, true)
  689. }
  690. }
  691. //城市消防体征
  692. if (pageType == "fire-signs") {
  693. if (type == "仓库") {
  694. let arrayList = [{
  695. title: [val.attrbutes.companyName, true],
  696. children: [
  697. ["单位地址:", val.attrbutes.address, 24],
  698. ["单位类别:", val.attrbutes.companyType, 24],
  699. ["单位使用性质:", val.attrbutes.companyNature, 24],
  700. ["单位(法人)名称:", val.attrbutes.delegateName, 24],
  701. ["统一社会信用代码:", val.attrbutes.socialCode, 24],
  702. ["所辖派出所:", val.attrbutes.policeStation, 24],
  703. ["消防安全责任人:", val.attrbutes.fireDutyName, 24],
  704. ["消防安全管理人:", val.attrbutes.fireManageName, 24],
  705. ["联系电话(手机):", val.attrbutes.linkPhone, 24],
  706. ["是否自主消防安全管理:", val.attrbutes.fireSafetyManage, 24],
  707. ["单位(场所)面积(㎡):", val.attrbutes.companyArea, 24],
  708. ["行业类别:", val.attrbutes.industryType, 24],
  709. ["是否为洁净厂房:", val.attrbutes.cleanRoom, 24],
  710. ["生产经营组织形式:", val.attrbutes.organizationForm, 24],
  711. ["网格号:", val.attrbutes.gridNo, 24],
  712. ["年份:", val.attrbutes.particularYear, 24],
  713. ["提交时间:", val.attrbutes.submitTime, 24],
  714. ["经度:", val.attrbutes.longitude, 24],
  715. ["纬度:", val.attrbutes.latitude, 24],
  716. ],
  717. }, ];
  718. this.popup(val._attrbutes, arrayList, true)
  719. }
  720. }
  721. },
  722. });
  723. }
  724. },
  725. //聚合点击事件
  726. clusterMapCallBack(clusterPointArr, clickPoint) {
  727. let val = clusterPointArr.attributes
  728. if (val.type2 == "消火栓可用" || val.type2 == "消火栓不可用") {
  729. let arrayList = [{
  730. title: ["消火栓", true],
  731. children: [
  732. ["水源位置:", val.address, 24],
  733. ["电话:", val.phone, 12],
  734. ["责任人:", val.dutyPerson, 12],
  735. ["支队名称:", val.detachmentName, 24],
  736. ["管辖机构:", val.jurisdictionalAgency, 12],
  737. ["水源类型:", val.type, 12],
  738. ["取水形式:", val.getWaterType, 12],
  739. ["水源性质:", val.waterAdministrative, 12],
  740. ["供水单位:", val.waterUnit, 24],
  741. ["水压(Mpa):", val.waterGage, 24],
  742. ["状态:", val.status == 1 ? "可用" : "不可用", 12],
  743. ],
  744. }, ];
  745. this.popup(val, arrayList, true)
  746. } else if (type == "天然水源") {
  747. let arrayList = [{
  748. title: [val.facilityName, true],
  749. children: [
  750. ["水源位置:", val.address, 24],
  751. ],
  752. }, ];
  753. this.popup(val, arrayList, true)
  754. }
  755. },
  756. heatMap(data) {
  757. let target = []
  758. if (data.length > 0) {
  759. for (let i = 0; i < data.length; i++) {
  760. var wgs84 = CoordUtil.gcj02towgs84(Number(data[i].gisX) || Number(data[i].longitude), Number(data[i].gisY) || Number(data[i].latitude))
  761. var x = wgs84[0]
  762. var y = wgs84[1]
  763. target[i] = []
  764. target[i].x = x
  765. target[i].y = y
  766. }
  767. }
  768. let options = {
  769. style: {
  770. minOpacity: 0.6,
  771. maxOpacity: 0.9,
  772. radius: 50,
  773. gradient: {
  774. '.10': 'green',
  775. '.45': 'yellow',
  776. '.65': 'orange',
  777. '.80': 'red'
  778. }
  779. },
  780. isZoom: false
  781. }
  782. jMap.HeatMap.show(target, options)
  783. },
  784. // 无经纬度创建标点和点击事件
  785. addMarkerAddress(lnglats) {
  786. let target = lnglats.map((val, ind) => {
  787. if (!val.addressId) {
  788. let addressInfo = window.jMap.queryMphInfo(val.address)[val.address][0];
  789. return {
  790. ...val,
  791. addressId: addressInfo.address_id, // 地址id
  792. province: addressInfo.province, // 市
  793. district: addressInfo.district, // 区
  794. sub_district: addressInfo.sub_district, // 街镇
  795. streetname: addressInfo.streetname, // 路
  796. address: addressInfo.address, // 户
  797. committee: addressInfo.committee, // 居委会
  798. };
  799. }
  800. });
  801. target = target.reduce((item, next) => {
  802. !item.some((val) => val.addressId === next.addressId) && item.push(next);
  803. return item;
  804. }, []);
  805. for (let item = 0; item < Math.floor(target.length / 100); item++) {
  806. setTimeout(() => {
  807. window.jMap.locateMph(
  808. target
  809. .slice(item * 100, (item + 1) * 100)
  810. .map((val) => val.addressId)
  811. .join(), {
  812. isZoom: false,
  813. scaleByDistance: { minScaling: 0, maxScaling: 1, minDistance: 1000, maxDistance: 30000 },
  814. click: (value) => {
  815. this.elementInfo(value, "fire");
  816. },
  817. }
  818. );
  819. }, 0);
  820. }
  821. },
  822. elementInfo(value, type) {
  823. let element = "";
  824. if (type == "重点单位") {
  825. element = `<div class="ysc-dynamic-layer ys-css3-box" onclick="vue.removePopup">
  826. <div class="tableTooltip mapTab">
  827. <div class="tableTitle">
  828. <div>1212121</div>
  829. </div>
  830. </div>
  831. </div>`;
  832. }
  833. this.addMarkerInfo(element, value, type);
  834. },
  835. bufferL(val) {
  836. let target = {
  837. geometry: [{
  838. position: [],
  839. type: 'point'
  840. }],
  841. distance: 7000
  842. }
  843. for (let i = 0; i < val.length; i++) {
  844. // var wgs84 = CoordUtil.gcj02towgs84(Number(val.longitude + '0000000' ), Number(val.latitude + '0000000' ))
  845. // var x = wgs84[0]
  846. // var y = wgs84[1]
  847. target.geometry[i] = {
  848. position: [{ x: Number(val[i].longitude) + '0000000', y: Number(val[i].latitude) + '0000000' }],
  849. type: 'point'
  850. }
  851. // if(val[i].stationType ==7 ){
  852. // target
  853. // }
  854. }
  855. var options = { callBack: this.bufferCallback };
  856. jMap.Buffer.generate(target, options);
  857. },
  858. bufferL1(val) {
  859. let target = {
  860. geometry: [{
  861. position: [],
  862. type: 'point'
  863. }],
  864. distance: ((Math.sqrt(7 / 3.14) * 1000) / 2).toFixed(0)
  865. }
  866. for (let i = 0; i < val.length; i++) {
  867. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  868. var x = wgs84[0].toFixed(13)
  869. var y = wgs84[1].toFixed(13)
  870. target.geometry[i] = {
  871. position: [{ x: x, y: y }],
  872. type: 'point'
  873. }
  874. }
  875. var options = { callBack: bufferCallback };
  876. jMap.Buffer.generate(target, options);
  877. },
  878. bufferL2(val) {
  879. let target = {
  880. geometry: [{
  881. position: [],
  882. type: 'point'
  883. }],
  884. distance: ((Math.sqrt(4 / 3.14) * 1000) / 2).toFixed(0)
  885. }
  886. for (let i = 0; i < val.length; i++) {
  887. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  888. var x = wgs84[0].toFixed(13)
  889. var y = wgs84[1].toFixed(13)
  890. target.geometry[i] = {
  891. position: [{ x: x, y: y }],
  892. type: 'point'
  893. }
  894. }
  895. var options = { callBack: bufferCallback };
  896. jMap.Buffer.generate(target, options);
  897. },
  898. bufferL3(val) {
  899. let target = {
  900. geometry: [{
  901. position: [],
  902. type: 'point'
  903. }],
  904. distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
  905. }
  906. for (let i = 0; i < val.length; i++) {
  907. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  908. var x = wgs84[0].toFixed(13)
  909. var y = wgs84[1].toFixed(13)
  910. target.geometry[i] = {
  911. position: [{ x: x, y: y }],
  912. type: 'point'
  913. }
  914. }
  915. var options = { callBack: bufferCallback };
  916. jMap.Buffer.generate(target, options);
  917. },
  918. bufferL4(val) {
  919. let target = {
  920. geometry: [{
  921. position: [],
  922. type: 'point'
  923. }],
  924. distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
  925. }
  926. for (let i = 0; i < val.length; i++) {
  927. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  928. var x = wgs84[0].toFixed(13)
  929. var y = wgs84[1].toFixed(13)
  930. target.geometry[i] = {
  931. position: [{ x: x, y: y }],
  932. type: 'point'
  933. }
  934. }
  935. var options = { callBack: bufferCallback };
  936. jMap.Buffer.generate(target, options);
  937. },
  938. bufferL5(val) {
  939. let target = {
  940. geometry: [{
  941. position: [],
  942. type: 'point'
  943. }],
  944. distance: ((Math.sqrt(2 / 3.14) * 1000) / 2).toFixed(0)
  945. }
  946. for (let i = 0; i < val.length; i++) {
  947. var wgs84 = CoordUtil.gcj02towgs84(Number(val[i].longitude), Number(val[i].latitude))
  948. var x = wgs84[0].toFixed(13)
  949. var y = wgs84[1].toFixed(13)
  950. target.geometry[i] = {
  951. position: [{ x: x, y: y }],
  952. type: 'point'
  953. }
  954. }
  955. var options = { callBack: bufferCallback };
  956. jMap.Buffer.generate(target, options);
  957. },
  958. bufferCallback(result) {
  959. for (var i in result) {
  960. var target = {
  961. id: i,
  962. position: CoordUtil.arrayToJson(result[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  963. };
  964. var options = {
  965. style: {
  966. color: 'red',
  967. transparency: 0.6,
  968. }
  969. }
  970. // if (result[i].stationType == 1) {
  971. // options.style.color = '#f80000',
  972. // options.style.transparency = 0.6
  973. // }
  974. // if (result[i].stationType == 2) {
  975. // options.style.color = '#f88c00',
  976. // options.style.transparency = 0.6
  977. // }
  978. // if (result[i].stationType == 3) {
  979. // options.style.color = '#0092f8',
  980. // options.style.transparency = 0.6
  981. // }
  982. jMap.Locate.regionLocate(target, options)
  983. }
  984. },
  985. bufferCallback1(result) {
  986. for (var i in result) {
  987. var target = {
  988. id: i,
  989. position: CoordUtil.arrayToJson(result[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  990. };
  991. jMap.Locate.regionLocate(target, {
  992. style: {
  993. color: '#f80000',
  994. transparency: 0.6,
  995. }
  996. })
  997. }
  998. },
  999. bufferCallback2(result2) {
  1000. for (var i in result2) {
  1001. var target = {
  1002. id: i,
  1003. position: CoordUtil.arrayToJson(result2[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  1004. };
  1005. jMap.Locate.regionLocate(target, {
  1006. isZoom: true,
  1007. style: {
  1008. color: '#f88c00',
  1009. transparency: 0.6,
  1010. }
  1011. })
  1012. }
  1013. },
  1014. bufferCallback3(result3) {
  1015. for (var i in result3) {
  1016. var target = {
  1017. id: i,
  1018. position: CoordUtil.arrayToJson(result3[i].rings[0]) // 二维坐标数组转JSON数组,详见三中
  1019. };
  1020. jMap.Locate.regionLocate(target, {
  1021. style: {
  1022. color: '#0092f8',
  1023. transparency: 0.6,
  1024. }
  1025. })
  1026. }
  1027. },
  1028. addMarkerInfo(element, value, type, isBtn = false) {
  1029. var wgs84 = CoordUtil.gcj02towgs84(Number(value.gisX) || Number(value.longitude), Number(value.gisY) || Number(value.latitude))
  1030. var x = wgs84[0]
  1031. var y = wgs84[1]
  1032. let _this = this
  1033. // window.jMap.Popup && window.jMap.Popup.hide([this.oldPopup && this.oldPopup.id]);
  1034. if (this.oldPopup && value.id === this.oldPopup.id) {
  1035. window.jMap.Popup.hide();
  1036. return (this.oldPopup = null);
  1037. }
  1038. if (type == "selfManagement" || type == "water") {
  1039. window.jMap.Popup.show({
  1040. id: value.id,
  1041. //position: value.wgs84position, //使用自定义窗体
  1042. position: { x: x, y: y }, //使用自定义窗体
  1043. element: element,
  1044. }, { isZoom: false, offset: [0, -40] });
  1045. }
  1046. if (type == "重点单位") {
  1047. _this.stores.zddwIdSD(value.companyId);
  1048. // localStorage.setItem("zddw",)
  1049. // window.jMap.Popup.show({
  1050. // // position: { x: value.gisX, y: value.gisY }, //使用自定义窗体
  1051. // position: { x: x, y: y }, //使用自定义窗体
  1052. // element: element,
  1053. // }, { isZoom: 100, offset: [0, -40] });
  1054. }
  1055. // if (!isBtn) {
  1056. // window.jMap.goTo({
  1057. // x: Number(value.wgs84position.x),
  1058. // y: Number(value.wgs84position.y),
  1059. // radius: 1000,
  1060. // }, {
  1061. // duration: 3,
  1062. // offset: {
  1063. // heading: -4,
  1064. // pitch: -70,
  1065. // range: 0,
  1066. // },
  1067. // });
  1068. // window.jMap.Buffer.generate({
  1069. // geometry: [{ position: [{ x: Number(value.wgs84position.x), y: Number(value.wgs84position.y) }], type: "point" }],
  1070. // distance: 1000,
  1071. // }, {
  1072. // callBack: (el) => {
  1073. // for (const i in el) {
  1074. // var target = {
  1075. // id: i,
  1076. // position: CoordUtil.arrayToJson(el[i].rings[0]),
  1077. // };
  1078. // }
  1079. // window.jMap.Locate.regionLocate(target, {
  1080. // style: {
  1081. // color: "rgba(235, 98, 98, .1)",
  1082. // transparency: 0.3,
  1083. // },
  1084. // });
  1085. // },
  1086. // });
  1087. // }
  1088. this.oldPopup = value;
  1089. },
  1090. removePopup(e) {
  1091. },
  1092. /**
  1093. *
  1094. *气泡窗
  1095. */
  1096. popup(data, arrayList, type, other) {
  1097. if (type) {
  1098. if (!other) {
  1099. var html = document.createElement('div');
  1100. html.className = 'ysc-dynamic-layer ys-css3-box';
  1101. var line = document.createElement('div');
  1102. line.className = 'line';
  1103. var main = document.createElement('div');
  1104. main.className = 'main';
  1105. 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)');
  1106. var click = document.createElement('div');
  1107. click.setAttribute('style', 'float: right;width: 13px;height: 13px;position: absolute;top:8px;right:16px;cursor: pointer');
  1108. var img = document.createElement('img');
  1109. img.className = 'click';
  1110. img.setAttribute("src", this.stores.sadianIcon.close);
  1111. img.setAttribute("style", 'width: 20px;height: 20px;')
  1112. click.appendChild(img)
  1113. var contain = document.createElement('div');
  1114. contain.setAttribute('style', 'margin-left: 3%;right:50px;top:30px;padding: 0px 0 ');
  1115. if (arrayList[0].title[1]) {
  1116. var p = document.createElement('div');
  1117. p.setAttribute('style', 'font-size:18px;color:#73fbfd;line-height:25px');
  1118. p.innerHTML = arrayList[0].title[0]
  1119. contain.appendChild(p)
  1120. }
  1121. for (let i = 0; i < arrayList[0].children.length; i++) {
  1122. if (arrayList[0].children[i][1]) {
  1123. let textWrap = document.createElement('div');
  1124. textWrap.setAttribute('style', 'font-size:14px;color:#fff;line-height:25px;');
  1125. let p1 = document.createElement('span');
  1126. p1.setAttribute('style', 'color:#73fbfd;');
  1127. p1.innerHTML = arrayList[0].children[i][0]
  1128. let p2 = document.createElement('span');
  1129. p2.setAttribute('style', 'color:#fff;word-break:break-all !important');
  1130. p2.innerHTML = arrayList[0].children[i][1]
  1131. textWrap.appendChild(p1)
  1132. textWrap.appendChild(p2)
  1133. contain.appendChild(textWrap)
  1134. }
  1135. }
  1136. setTimeout(() => {
  1137. main.appendChild(click)
  1138. main.appendChild(contain)
  1139. html.appendChild(line)
  1140. html.appendChild(main)
  1141. let text = html.innerHTML.replace(/"click"/g, '"click" onclick="vue.popup(false, false, false)"')
  1142. var wgs84 = CoordUtil.gcj02towgs84(Number(data.gisX) || Number(data.longitude), Number(data.gisY) || Number(data.latitude))
  1143. var x = wgs84[0]
  1144. var y = wgs84[1]
  1145. var target = {
  1146. id: '100001',
  1147. position: { x: x, y: y, z: 0 },
  1148. element: `<div class="ysc-dynamic-layer ys-css3-box" style="">${text}</div>`
  1149. };
  1150. var options = {
  1151. // isZoom: true,
  1152. offset: [-6, -275]
  1153. };
  1154. jMap.Popup.show(target, options);
  1155. }, 10)
  1156. } else {
  1157. }
  1158. } else {
  1159. jMap.Popup.hide();
  1160. }
  1161. },
  1162. }
  1163. }