index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. <template>
  2. <div style="padding: 0px 35px; display: flex; justify-content: space-between">
  3. <div>
  4. <border-panel
  5. height="302px"
  6. style="margin-bottom: 6px; cursor: pointer"
  7. title="基础信息"
  8. >
  9. <BasicInfo :qy="qy" @click-label="reloadMap" @showTc="showTc" @UnitType="UnitType" />
  10. </border-panel>
  11. <border-panel height="346px" style="margin-bottom: 6px" title="隐患排查">
  12. <HiddenDangerDetection @click-label="reloadMap" :qy="qy" />
  13. </border-panel>
  14. <border-panel
  15. height="293px"
  16. header-cursor="pointer"
  17. title="自主管理"
  18. @click-header="openAutoManageModal"
  19. >
  20. <AutonomousManagement
  21. @click-label="reloadMap"
  22. @click-item="onClickAutonomousManagementItemHandler"
  23. :qy="qy"
  24. />
  25. </border-panel>
  26. </div>
  27. <div class="display: flex;">
  28. <div class="map" style="position: relative">
  29. <MapChartsCategory
  30. :mapHeatData="heatMap"
  31. :formatter="showLabel"
  32. :qx="qy"
  33. :legend="legendData"
  34. @selectArea="(area) => (qy = area)"
  35. :right="20"
  36. showTip
  37. />
  38. <!-- <div style="position: relative; width: 100%; height: 632px;">
  39. <MapChart3D
  40. :mapHeatData="heatMap"
  41. :formatter="showLabel"
  42. :qx="qy"
  43. @selectArea="(area) => (qy = area)"
  44. />
  45. </div> -->
  46. <div style="position: absolute; top: 10px; width: 500px">
  47. <SearchBox :area="qy" @update:area="e => qy = e" />
  48. </div>
  49. <div class="tips" @click="getShoeInfo('smsMsgModal')">提示</div>
  50. <div class="title" v-if="selectMapType !== 'DEFAULT'">
  51. <div class="back-btn" @click="reloadMap('DEFAULT')">{{ '<' }}</div>
  52. <div class="select-title">{{selectMapTitle}}</div>
  53. </div>
  54. </div>
  55. <div>
  56. <border-panel
  57. height="321px"
  58. width="938px"
  59. title="火灾指数"
  60. :header-type="1"
  61. >
  62. <FireIndex @click-label="onClockFireIndex" :type="fireIndexType" :qx="qy" />
  63. <template #ext-header>
  64. <button-block
  65. :items="['月', '年']"
  66. @select-item="selectItemHandler"
  67. />
  68. </template>
  69. </border-panel>
  70. </div>
  71. </div>
  72. <div>
  73. <border-panel
  74. height="311px"
  75. style="margin-bottom: 6px; cursor: pointer"
  76. header-cursor="pointer"
  77. title="预警预测"
  78. @click-header="openBasicModal"
  79. >
  80. <RiskWarning
  81. :riskList="riskList"
  82. @showFxyj="showFxyj"
  83. :qy="qy"
  84. :monthData="monthData"
  85. :typeList="typeList"
  86. @click-label="reloadMap"
  87. />
  88. <template #ext-header>
  89. <img
  90. src="../../assets/images/dd_wh.png"
  91. alt=""
  92. @click="getShoeInfo('whFxModal')"
  93. />
  94. </template>
  95. </border-panel>
  96. <border-panel
  97. height="331px"
  98. style="margin-bottom: 6px; cursor: pointer"
  99. title="物联感知"
  100. >
  101. <WisdomFire @click-label="reloadMap" :frieList="frieList" :iotList="iotList" :qy="qy" />
  102. <ZhxfModalHeader slot="title" />
  103. </border-panel>
  104. <border-panel title="警情动态" height="298px" :header-type="1">
  105. <AlarmingSituationDynamics :qx="qy" :PoliceList="PoliceList" />
  106. </border-panel>
  107. </div>
  108. <basic-modal top="120px" ref="basicInfoModal" name="基础信息">
  109. <BasicInfoModalContent :qy="qy" :default="defaultModel" />
  110. </basic-modal>
  111. <basic-modal top="120px" ref="autoManageModal" name="自主管理">
  112. <zzglModul ref="zzglModul" :queryParams="queryParams" :qy="qy" />
  113. </basic-modal>
  114. <!-- 风险问号弹窗 -->
  115. <basic-modal
  116. top="30px"
  117. ref="whFxModal"
  118. name="高层建筑消防安全风险分级分色判定标准"
  119. width="90%"
  120. >
  121. <div
  122. style="display: flex; flex-direction: column; justify-content: center"
  123. >
  124. <img class="imgs" src="../../assets/images/zl-fxyj.png" />
  125. </div>
  126. </basic-modal>
  127. <!-- 短信提示弹窗 -->
  128. <basic-modal top="120px" ref="smsMsgModal" name="信息提示" width="800px">
  129. <MessageTipModalContent :qy="qy" @close="onCloseModal" />
  130. </basic-modal>
  131. </div>
  132. </template>
  133. <script>
  134. import BasicInfo from "./components/BasicInfo.vue";
  135. import AlarmingSituationDynamics from "./components/AlarmingSituationDynamics/index.vue";
  136. import AutonomousManagement from "./components/AutonomousManagement/index.vue";
  137. import HiddenDangerDetection from "./components/HiddenDangerDetection/index.vue";
  138. import MapChartsCategory from "./components/NewMapChartsCategory.vue";
  139. import RiskWarning from "./components/RiskWarning.vue";
  140. import WisdomFire from "./components/WisdomFire.vue";
  141. import FireIndex from "./components/FireIndex/index.vue";
  142. import BasicInfoModalContent from "./components/BasicInfoModalContent.vue";
  143. import SearchBox from "@/components/SearchBox.vue";
  144. import zzglModul from "./components/zzglModul.vue";
  145. import { getSxzbListToatl,getFhzdType } from "@/api/index.js";
  146. import { getSxzbListToatl } from "@/api/index.js";
  147. import {
  148. totaldata,
  149. getJqdt,
  150. getZxgjtj,
  151. getJrjzsbs
  152. } from "@/api/index.js";
  153. import MessageTipModalContent from "@/components/MessageTipModalContent.vue";
  154. import MapChart3D from '@/components/MapChart3D/index.vue'
  155. import { createInfoWindow, TEMPLATE_TYPE, loadMapData, TITLE_MAP } from '@/shared'
  156. export default {
  157. name: "HomePage",
  158. components: {
  159. BasicInfo,
  160. WisdomFire,
  161. AlarmingSituationDynamics,
  162. MapChartsCategory,
  163. RiskWarning,
  164. AutonomousManagement,
  165. HiddenDangerDetection,
  166. FireIndex,
  167. BasicInfoModalContent,
  168. SearchBox,
  169. zzglModul,
  170. MessageTipModalContent,
  171. MapChart3D
  172. },
  173. data() {
  174. return {
  175. // 定时器
  176. timer: null,
  177. riskList: [],
  178. // 传参
  179. qy: "重庆市",
  180. params: {
  181. pageSize: 100,
  182. pageNum: 1,
  183. },
  184. PoliceList: [],
  185. frieList: {},
  186. iotList: {},
  187. fireIndexType: 0,
  188. heatMap: [],
  189. defaultModel: {},
  190. monthData: [],
  191. queryParams: {
  192. glxs: "", //管理形式
  193. wbxs: "", //维保形式
  194. dxjj: "", //大修基金
  195. },
  196. selectMapType: TEMPLATE_TYPE.DEFAULT,
  197. legendData: [],
  198. TEMPLATE_TYPE,
  199. typeList:[]
  200. };
  201. },
  202. computed: {
  203. selectMapTitle() {
  204. return TITLE_MAP[this.selectMapType]
  205. }
  206. },
  207. watch: {
  208. qy() {
  209. this.getList();
  210. this.getFireList();
  211. this.getIotList();
  212. this.zdType()
  213. },
  214. },
  215. methods: {
  216. onClockFireIndex() {
  217. this.reloadMap(["HZQSY", "HZQSN"][this.fireIndexType])
  218. },
  219. reloadMap(type) {
  220. if (this.selectMapType === type) return;
  221. this.selectMapType = type;
  222. this.loadData()
  223. },
  224. onCloseModal() {
  225. this.closeModal("smsMsgModal");
  226. },
  227. onClickAutonomousManagementItemHandler(data) {
  228. const temp = {
  229. glxs: "",
  230. wbxs: "",
  231. dxjj: "",
  232. };
  233. switch (data.index) {
  234. case 0:
  235. temp.glxs = data.value;
  236. break;
  237. case 1:
  238. temp.wbxs = data.value;
  239. break;
  240. case 2:
  241. temp.dxjj = data.value;
  242. break;
  243. }
  244. this.queryParams = temp;
  245. this.showModal("autoManageModal");
  246. },
  247. showLabel(params) {
  248. return createInfoWindow(this.selectMapType, params);
  249. },
  250. showTc(val) {
  251. if (val) {
  252. this.defaultModel = {
  253. qy: this.qy,
  254. dl: val,
  255. };
  256. this.showModal("basicInfoModal");
  257. }
  258. },
  259. showFxyj(val) {
  260. this.defaultModel = {
  261. qy: this.qy,
  262. fxdjYs: val,
  263. };
  264. this.showModal("basicInfoModal");
  265. },
  266. openBasicModal() {
  267. this.showModal("basicInfoModal");
  268. },
  269. UnitType(name) {
  270. const params = {
  271. qy: this.qy,
  272. };
  273. if (name == "超高层建筑总数(栋)") {
  274. params.gd = "100米以上";
  275. }
  276. if (name == "2000年底前老旧住宅建筑总数(栋)") {
  277. params.jcnd = "2000年前";
  278. params.dl = "住宅建筑";
  279. }
  280. if (name == "2000年底前老旧商业混合体建筑总数(栋)") {
  281. params.jcnd = "2000年前";
  282. params.dl = "公共建筑";
  283. }
  284. this.defaultModel = params;
  285. this.showModal("basicInfoModal");
  286. },
  287. getShoeInfo(name) {
  288. this.showModal(name);
  289. },
  290. // 风险预警
  291. getList() {
  292. totaldata({ ...this.params, qy: this.qy === "重庆市" ? "" : this.qy })
  293. .then((res) => {
  294. if (res.data.code == 200) {
  295. this.riskList = res.data.rows;
  296. }
  297. })
  298. .catch((error) => {
  299. this.$message({
  300. message: res.data.msg,
  301. type: "error",
  302. });
  303. });
  304. },
  305. selectItemHandler(idx) {
  306. this.fireIndexType = idx;
  307. },
  308. getStaic() {
  309. getJqdt(this.params).then((res) => {
  310. this.PoliceList = res.data.rows;
  311. });
  312. },
  313. //智慧消防
  314. getFireList() {
  315. getZxgjtj({
  316. ...this.params,
  317. name: this.qy === "重庆市" ? "" : this.qy,
  318. }).then((res) => {
  319. this.frieList = res.data.rows[0];
  320. });
  321. },
  322. // 物联网栋数
  323. getIotList() {
  324. getJrjzsbs({
  325. ...this.params,
  326. name: this.qy === "重庆市" ? "" : this.qy,
  327. }).then((res) => {
  328. this.iotList = res.data.rows[0];
  329. });
  330. },
  331. //重点类型
  332. zdType(){
  333. getFhzdType( { ...this.params, qx: this.qy === "重庆市" ? "" : this.qy }).then(res=>{
  334. this.typeList=res.data
  335. })
  336. },
  337. openAutoManageModal() {
  338. this.showModal("autoManageModal");
  339. },
  340. loadData() {
  341. loadMapData(this.selectMapType).then(res => {
  342. this.legendData = res.legendData
  343. this.heatMap = res.heatMap
  344. })
  345. },
  346. // 火灾预测
  347. loadHzzbSxzbYoy() {
  348. getSxzbListToatl({
  349. qy: this.qy === "重庆市" ? "" : this.qy,
  350. }).then((res) => {
  351. this.monthData = res.data.data.sxzbMonth;
  352. // let temp = res.data.data;
  353. // console.log("009999", temp);
  354. // const month = temp.sxzbMonth.splice(temp.sxzbMonth.length - 12, 12);
  355. // (this.monthData = month.map((item, index) =>
  356. // month.length - 1 === index || month.length - 2 === index
  357. // ? {
  358. // name: item.y,
  359. // value: item.hzqs,
  360. // itemStyle: {
  361. // normal: {
  362. // type: "dotted",
  363. // width: 2,
  364. // color: "#fd87ab",
  365. // },
  366. // },
  367. // }
  368. // : { name: item.y, value: item.hzqs }
  369. // )),
  370. // console.log("--------zhiss", this.monthData);
  371. // let temp=res.data.data
  372. // console.log('-------ssssssss',temp.sxzbMonth.splice(temp.sxzbMonth.length - 12, 12));
  373. // const month = temp.sxzbMonth.splice(temp.sxzbMonth.length - 12, 12);
  374. // this.monthLabel = month.map((item) => item.y);
  375. // this.monthData = [
  376. // month.map((item, index) =>
  377. // month.length - 1 === index
  378. // ? {
  379. // name: item.qhyy,
  380. // value: item.hzqs,
  381. // itemStyle: {
  382. // color: "#cccccc89",
  383. // },
  384. // }
  385. // : { name: item.y, value: item.hzqs }
  386. // ),
  387. // month.map((item) => ({ name: item.y, value: item.wrs })),
  388. // month.map((item) => ({ name: item.y, value: item.srs })),
  389. // month.map((item) => ({
  390. // name: item.y,
  391. // value: parseInt(item.zzjjss / 10000),
  392. // })),
  393. // ];
  394. });
  395. },
  396. },
  397. created() {
  398. this.getList();
  399. this.getStaic();
  400. this.getFireList();
  401. this.getIotList();
  402. this.loadData();
  403. this.loadHzzbSxzbYoy();
  404. this.zdType()
  405. },
  406. mounted() {
  407. this.timer = setInterval(() => {
  408. // 获取通知
  409. getJqdt(this.params).then((res) => {
  410. // console.log("通知", res);
  411. this.PoliceList = res.data.rows;
  412. });
  413. }, 6000);
  414. },
  415. destroyed() {
  416. if (this.timer) {
  417. clearInterval(this.timer);
  418. }
  419. },
  420. };
  421. </script>
  422. <style scoped>
  423. .map {
  424. flex: 1;
  425. }
  426. .imgs {
  427. display: inline-block;
  428. /* width: 100%;
  429. height: 700px; */
  430. }
  431. .tips {
  432. color: #9bc3ff;
  433. background: url("../../assets/images/border.png") no-repeat;
  434. background-size: 100% 100%;
  435. background-color: transparent;
  436. position: absolute;
  437. bottom: 20px;
  438. left: 5px;
  439. box-sizing: border-box;
  440. padding: 10px 20px;
  441. cursor: pointer;
  442. }
  443. .title {
  444. position: absolute;
  445. top: 60px;
  446. left: 5px;
  447. box-sizing: border-box;
  448. padding: 10px 20px;
  449. cursor: pointer;
  450. display: flex;
  451. align-items: center;
  452. font-size: 20px;
  453. .back-btn {
  454. margin-right: 10px;
  455. }
  456. .select-title {
  457. }
  458. }
  459. </style>