index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <div style="padding: 0px 35px; display: flex; justify-content: space-between">
  3. <div>
  4. <border-panel
  5. height="350px"
  6. width="540px"
  7. style="margin-bottom: 6px"
  8. :headerType="3"
  9. title="报警信息"
  10. >
  11. <Alaem
  12. :list="bjxxList"
  13. v-if="bjxxList && bjxxList.length > 0"
  14. @callback="callback"
  15. :pId="pId"
  16. />
  17. </border-panel>
  18. <border-panel
  19. height="600px"
  20. width="540px"
  21. style="margin-bottom: 6px"
  22. :headerType="3"
  23. title="出动力量"
  24. >
  25. <MobilizeStrength
  26. :list="cdxxList"
  27. :zlxx="zlxx"
  28. :hcws="hcws"
  29. :hcws1="hcws1"
  30. />
  31. </border-panel>
  32. </div>
  33. <div style="width: 1000px; padding-bottom: 6px; position: relative">
  34. <!-- <Map :data="mapData" v-if="mapData" /> -->
  35. <iframe
  36. ref="box"
  37. src="https://www.720yun.com/t/65aknlde0pm?scene_id=110320524"
  38. style="height: 100%; width: 100%"
  39. v-if="middleType === '720'"
  40. ></iframe>
  41. <div style="height: 100%; width: 100%; position: relative" v-else>
  42. <Map :data="mapData" v-if="mapData && Mapflag == false" />
  43. <img
  44. v-if="Mapflag == true"
  45. class="map-null"
  46. src="../../assets/images/map-null1.png"
  47. alt=""
  48. />
  49. </div>
  50. <!-- <div
  51. class="m-btn d"
  52. :class="middleType === '720' ? 'map' : 'd'"
  53. @click="changeMiddleType"
  54. ></div> -->
  55. </div>
  56. <div>
  57. <border-panel
  58. height="469px"
  59. width="540px"
  60. style="margin-bottom: 6px"
  61. :headerType="3"
  62. title="事故单位信息"
  63. >
  64. <UnitInformation
  65. :ajxxList="ajxxList"
  66. :jzxxList="jzxxList"
  67. :wlwsb="wlwsb"
  68. :jzImg="jzImg"
  69. />
  70. </border-panel>
  71. <border-panel
  72. height="480px"
  73. width="540px"
  74. style="margin-bottom: 6px"
  75. :headerType="3"
  76. title="风险隐患信息"
  77. >
  78. <UnitInfo :fxxxList="fxxxList" :lshzList="lshzList" />
  79. </border-panel>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import MobilizeStrength from "./components/MobilizeStrength.vue";
  85. import Alaem from "./components/Alarm.vue";
  86. import UnitInformation from "./components/UnitInformation.vue";
  87. import UnitInfo from "./components/UnitInfo.vue";
  88. import Map from "@/components/Map.vue";
  89. import moment from "moment";
  90. import {
  91. getBjxx,
  92. geTzl,
  93. getCdllxx,
  94. getHcws,
  95. getAjxx,
  96. getJzxx,
  97. getWlwsb,
  98. getFxyhxx,
  99. getZhd,
  100. } from "@/api/jqdt.js";
  101. export default {
  102. name: "Fire",
  103. components: {
  104. Map,
  105. Alaem,
  106. MobilizeStrength,
  107. UnitInformation,
  108. UnitInfo,
  109. },
  110. data() {
  111. return {
  112. jzImg: "",
  113. gxsj1: null,
  114. pId: null,
  115. params: {
  116. pageSize: 100,
  117. pageNum: 1,
  118. qy: null,
  119. id: null,
  120. },
  121. ajid: "",
  122. bjxxList: [], //报警信息
  123. cdxxList: [], //出动信息列表
  124. zlxx: [], //出动信息总览
  125. hcws: [], //火场文书
  126. hcws1: [],
  127. ajxxList: [],
  128. jzxxList: {},
  129. fxxxList: {},
  130. lshzList: [],
  131. wlwsb: [],
  132. mapData: null,
  133. middleType: "map",
  134. flag: "",
  135. Mapflag: false,
  136. };
  137. },
  138. methods: {
  139. changeMiddleType() {
  140. if (this.middleType === "720") {
  141. this.getMapData();
  142. this.middleType = "map";
  143. } else {
  144. this.middleType = "720";
  145. }
  146. },
  147. getMapData() {
  148. // console.log(this.params.id);
  149. var latreg =
  150. /^(\-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,15})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,15}|180)$/;
  151. var longrg =
  152. /^(\-|\+)?([0-8]?\d{1}\.\d{0,15}|90\.0{0,15}|[0-8]?\d{1}|90)$/;
  153. this.mapData = null;
  154. getZhd({
  155. id: this.params.id,
  156. }).then((res) => {
  157. if (res.data && res.data.data) {
  158. this.mapData = {
  159. jd: res.data.data.dqjd1,
  160. wd: res.data.data.dqwd1,
  161. zl: res.data.data.总览信息1,
  162. jzmc: res.data.data.ddmc,
  163. showzhd: true,
  164. };
  165. }
  166. if (
  167. !longrg.test(Number(res.data.data.dqwd1)) &&
  168. !latreg.test(Number(res.data.data.dqjd1))
  169. ) {
  170. this.Mapflag = true;
  171. } else {
  172. this.Mapflag = false;
  173. }
  174. });
  175. },
  176. getQueryString(name) {
  177. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  178. var r = window.location.search.substr(1).match(reg);
  179. if (r != null) {
  180. return unescape(r[2]);
  181. }
  182. return null;
  183. },
  184. callback(id) {
  185. this.params.id = id;
  186. this.getMapData();
  187. this.getOtherData();
  188. },
  189. openBasicModal() {
  190. this.showModal("basicInfoModal");
  191. },
  192. getOtherData() {
  193. // 出警力量
  194. const cdxxId = {
  195. ajid: this.params.id,
  196. };
  197. getCdllxx(cdxxId).then((res) => {
  198. this.cdxxList = res.data.rows;
  199. });
  200. // 出动力量-总览
  201. geTzl(this.params).then((res) => {
  202. this.zlxx = res.data.rows ? res.data.rows[0].zl : "";
  203. });
  204. // 火场文书
  205. const hcwsId = {
  206. jqTywysbm: this.params.id,
  207. };
  208. getHcws(hcwsId).then((res) => {
  209. this.hcws1 = res.data.rows[0];
  210. let i = res.data.rows;
  211. let i2 = i.filter((item, index) => {
  212. return index;
  213. });
  214. this.hcws = i2.map((i) => {
  215. return {
  216. ...i,
  217. gxsj: moment(i.gxsj).format("yyyy-MM-DD"),
  218. };
  219. });
  220. this.hcws1.gxsj = moment(this.hcws1.gxsj).format("yyyy-MM-DD");
  221. });
  222. // 事故单位信息-案件信息列表
  223. getAjxx(this.params).then((res) => {
  224. this.ajxxList = res.data.rows[0];
  225. });
  226. // 事故单位建筑信息
  227. const jzxxid = {
  228. ajid: this.params.id,
  229. };
  230. getJzxx(jzxxid).then((res) => {
  231. console.log(res);
  232. this.jzxxList = res.data.rows[0];
  233. this.jzImg = this.jzxxList.jzzp1;
  234. console.log(this.jzxxList.jzzp1, "建筑信息");
  235. });
  236. // 风险隐患信息
  237. const fxyhId = {
  238. ajid: this.params.id,
  239. };
  240. getFxyhxx(fxyhId).then((res) => {
  241. this.fxxxList =
  242. res.data.rows && res.data.rows.length > 0 ? res.data.rows[0] : null;
  243. this.lshzList = res.data.rows;
  244. });
  245. // 物联网设备信息
  246. const wlwId = {
  247. ajid: this.params.id,
  248. };
  249. getWlwsb(wlwId).then((res) => {
  250. this.wlwsb = res.data.rows;
  251. });
  252. },
  253. getList() {
  254. const params1 = {
  255. pageSize: 10000,
  256. pageNum: 1,
  257. };
  258. getBjxx(params1).then((res) => {
  259. let list = res.data.rows;
  260. if (this.pId) {
  261. list = list.filter((p) => p.id !== this.pId);
  262. list.unshift(res.data.rows.find((p) => p.id === this.pId));
  263. }
  264. this.bjxxList = list;
  265. });
  266. },
  267. },
  268. created() {
  269. const id = this.getQueryString("id");
  270. this.pId = id;
  271. this.getList();
  272. },
  273. };
  274. </script>
  275. <style scoped lang="less">
  276. .m-btn {
  277. width: 78px;
  278. height: 72px;
  279. position: absolute;
  280. right: 20px;
  281. top: 30px;
  282. z-index: 99;
  283. cursor: pointer;
  284. }
  285. .m-btn.d {
  286. background: url("../../assets/images/dd-change-720.png") center center
  287. no-repeat;
  288. background-size: 78px 72px;
  289. }
  290. .m-btn.map {
  291. background: url("../../assets/images/dd-change-map.png") center center
  292. no-repeat;
  293. background-size: 78px 72px;
  294. }
  295. .map-null {
  296. display: inline-block;
  297. margin-top: 380px;
  298. margin-left: 280px;
  299. }
  300. </style>