ModalContent.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <div style="padding: 0px; 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. <AlaemList
  12. :flag="type"
  13. :selectTimes="selectTimes"
  14. :list="bjxxList"
  15. v-if="bjxxList && bjxxList.length > 0"
  16. @callback="callback"
  17. :pId="pId"
  18. />
  19. </border-panel>
  20. <border-panel
  21. height="593px"
  22. width="540px"
  23. style="margin-bottom: 6px"
  24. :headerType="3"
  25. title="出动力量"
  26. >
  27. <MobilizeStrength
  28. style="width: 518px"
  29. :list="cdxxList"
  30. :hcws1="hcws1"
  31. :zlxx="zlxx"
  32. :hcws="hcws"
  33. />
  34. </border-panel>
  35. </div>
  36. <div style="width: 1000px">
  37. <Map :data="mapData" v-if="mapData" />
  38. </div>
  39. <div>
  40. <border-panel
  41. height="469px"
  42. width="540px"
  43. style="margin-bottom: 6px"
  44. :headerType="3"
  45. title="事故单位信息"
  46. >
  47. <UnitInformation
  48. :ajxxList="ajxxList"
  49. :jzxxList="jzxxList"
  50. :wlwsb="wlwsb"
  51. :jzImg="jzImg"
  52. />
  53. </border-panel>
  54. <border-panel
  55. height="480px"
  56. width="540px"
  57. style="margin-bottom: 6px"
  58. :headerType="3"
  59. title="风险隐患信息"
  60. >
  61. <UnitInfo :fxxxList="fxxxList" :lshzList="lshzList" />
  62. </border-panel>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import MobilizeStrength from "@/views/PoliceSituation/components/MobilizeStrength.vue";
  68. import AlaemList from "./AlaemList.vue";
  69. import UnitInformation from "@/views/PoliceSituation/components/UnitInformation.vue";
  70. import UnitInfo from "@/views/PoliceSituation/components/UnitInfo.vue";
  71. import Map from "@/components/Map.vue";
  72. import moment from "moment";
  73. import {
  74. geTzl,
  75. getCdllxx,
  76. getHcws,
  77. getAjxx,
  78. getJzxx,
  79. getWlwsb,
  80. getFxyhxx,
  81. getZhd,
  82. } from "@/api/jqdt.js";
  83. import { getJumpList } from "@/api/index.js";
  84. export default {
  85. name: "ModalContent",
  86. props: {
  87. selectTimes: {
  88. type: Array,
  89. default: () => [],
  90. },
  91. type: String,
  92. },
  93. watch: {
  94. type: {
  95. handler(val) {
  96. this.flag = val;
  97. this.getList();
  98. },
  99. immediate: true,
  100. deep: true,
  101. },
  102. },
  103. components: {
  104. Map,
  105. AlaemList,
  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. };
  136. },
  137. methods: {
  138. changeMiddleType() {
  139. if (this.middleType === "720") {
  140. this.getMapData();
  141. this.middleType = "map";
  142. } else {
  143. this.middleType = "720";
  144. }
  145. },
  146. getMapData() {
  147. // console.log(this.params.id);
  148. this.mapData = null;
  149. getZhd({
  150. id: this.params.id,
  151. }).then((res) => {
  152. console.log(res);
  153. if (res.data && res.data.data) {
  154. this.mapData = {
  155. jd: res.data.data.dqjd1,
  156. wd: res.data.data.dqwd1,
  157. zl: res.data.data.总览信息1,
  158. jzmc: res.data.data.ddmc,
  159. showzhd: true,
  160. };
  161. }
  162. });
  163. },
  164. getQueryString(name) {
  165. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  166. var r = window.location.search.substr(1).match(reg);
  167. if (r != null) {
  168. return unescape(r[2]);
  169. }
  170. return null;
  171. },
  172. callback(id) {
  173. if (id) {
  174. this.params.id = id;
  175. this.getMapData();
  176. this.getOtherData();
  177. } else {
  178. this.ajid = "";
  179. this.cdxxList = []; //出动信息列表
  180. this.zlxx = ""; //出动信息总览
  181. this.hcws = []; //火场文书
  182. this.hcws1 = [];
  183. this.ajxxList = [];
  184. this.jzxxList = {};
  185. this.fxxxList = {};
  186. this.lshzList = [];
  187. this.wlwsb = [];
  188. this.mapData = null;
  189. }
  190. },
  191. openBasicModal() {
  192. this.showModal("basicInfoModal");
  193. },
  194. getOtherData() {
  195. // 出警力量
  196. const cdxxId = {
  197. ajid: this.params.id,
  198. };
  199. getCdllxx(cdxxId).then((res) => {
  200. this.cdxxList = res.data.rows;
  201. });
  202. // 出动力量-总览
  203. geTzl(this.params).then((res) => {
  204. this.zlxx = res.data.rows ? res.data.rows[0].zl : "";
  205. });
  206. // 火场文书
  207. const hcwsId = {
  208. jqTywysbm: this.params.id,
  209. };
  210. getHcws(hcwsId).then((res) => {
  211. this.hcws1 = res.data.rows[0];
  212. let i = res.data.rows;
  213. let i2 = i.filter((item, index) => {
  214. return index;
  215. });
  216. this.hcws = i2.map((i) => {
  217. return {
  218. ...i,
  219. gxsj: moment(i.gxsj).format("yyyy-MM-DD"),
  220. };
  221. });
  222. this.hcws1.gxsj = moment(this.hcws1.gxsj).format("yyyy-MM-DD");
  223. });
  224. // 事故单位信息-案件信息列表
  225. getAjxx(this.params).then((res) => {
  226. this.ajxxList = res.data.rows[0];
  227. });
  228. // 事故单位建筑信息
  229. const jzxxid = {
  230. ajid: this.params.id,
  231. };
  232. getJzxx(jzxxid).then((res) => {
  233. this.jzxxList = res.data.rows[0];
  234. this.jzImg = 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. type: this.flag,
  258. };
  259. getJumpList(params1).then((res) => {
  260. let list = res.data.rows;
  261. if (this.pId) {
  262. list = list.filter((p) => p.id !== this.pId);
  263. list.unshift(res.data.rows.find((p) => p.id === this.pId));
  264. }
  265. this.bjxxList = list;
  266. });
  267. },
  268. },
  269. created() {
  270. const id = this.getQueryString("id");
  271. this.pId = id;
  272. this.getList();
  273. },
  274. };
  275. </script>
  276. <style scoped lang="less">
  277. .m-btn {
  278. width: 78px;
  279. height: 72px;
  280. position: absolute;
  281. right: 20px;
  282. top: 30px;
  283. z-index: 99;
  284. cursor: pointer;
  285. }
  286. .m-btn.d {
  287. background: url("../../assets/images/dd-change-720.png") center center
  288. no-repeat;
  289. background-size: 78px 72px;
  290. }
  291. .m-btn.map {
  292. background: url("../../assets/images/dd-change-map.png") center center
  293. no-repeat;
  294. background-size: 78px 72px;
  295. }
  296. </style>