Browse Source

perf: 警情动态弹框

TwoKe945 1 year ago
parent
commit
c8ff1f8866

+ 5 - 10
app/src/views/Home/components/AlarmingSituationDynamics/AlaemList.vue

@@ -153,6 +153,11 @@
 				getJumpList(params).then(res => {
 					console.log(res, '报警信息');
 					this.czztList = res.data.rows
+          if (this.czztList.length > 0) {
+            this.tab(this.czztList[0].id)
+          } else {
+            this.tab(null)
+          }
 				})
 			},
       resetData() {
@@ -166,15 +171,6 @@
 			},
 		},
 		created() {
-			// 如果pTd存在 就选中pID
-			if (this.pId) {
-				this.tab(this.pId)
-			}
-			// 默认选中第一条
-			else {
-				this.tab(this.list[0].id)
-			}
-
 			if (this.$route.query.type) {
 				this.type = Number(this.$route.query.type)
 			}
@@ -184,7 +180,6 @@
       } else if (this.selectTimes.length === 2) {
         this.times = [new Date(this.selectTimes[0]), new Date(this.selectTimes[1])]
       }
-
 			this.searchTab()
 		}
 	};

+ 28 - 6
app/src/views/Home/components/AlarmingSituationDynamics/ModalContent.vue

@@ -5,7 +5,9 @@
 				<AlaemList :selectTimes="selectTimes" :list="bjxxList" v-if="bjxxList && bjxxList.length > 0" @callback="callback" :pId="pId" />
 			</border-panel>
 			<border-panel height="593px" width="540px" style="margin-bottom: 6px" :headerType="3" title="出动力量">
-				<MobilizeStrength style="width: 518px;" :list="cdxxList" :zlxx="zlxx" :hcws="hcws" />
+				<MobilizeStrength style="width: 518px;" :list="cdxxList" 
+        :hcws1="hcws1"
+        :zlxx="zlxx" :hcws="hcws" />
 			</border-panel>
 		</div>
 		<div style="width: 1000px">
@@ -67,8 +69,9 @@
 				ajid: "",
 				bjxxList: [], //报警信息
 				cdxxList: [], //出动信息列表
-				zlxx: [], //出动信息总览
+				zlxx: "", //出动信息总览
 				hcws: [], //火场文书
+        hcws1: [],
 				ajxxList: [],
 				jzxxList: {},
 				fxxxList: {},
@@ -105,9 +108,23 @@
 				return null;
 			},
 			callback(id) {
-				this.params.id = id;
-				this.getMapData();
-				this.getOtherData();
+        if (id) {
+          this.params.id = id;
+          this.getMapData();
+          this.getOtherData();
+        } else {
+          this.ajid = ""
+          this.cdxxList = []//出动信息列表
+          this.zlxx =  "" //出动信息总览
+          this.hcws = [] //火场文书
+          this.hcws1 = []
+          this.ajxxList = []
+          this.jzxxList = {}
+          this.fxxxList = {}
+          this.lshzList = []
+          this.wlwsb = []
+          this.mapData = null
+        }
 			},
 			openBasicModal() {
 				this.showModal("basicInfoModal");
@@ -129,7 +146,12 @@
 					jqTywysbm: this.params.id,
 				};
 				getHcws(hcwsId).then((res) => {
-					this.hcws = res.data.rows[0];
+					this.hcws1 = res.data.rows[0]
+					let i = res.data.rows
+					let i2 = i.filter((item, index) => {
+						return index
+					})
+					this.hcws = i2;
 				});
 				// 事故单位信息-案件信息列表
 				getAjxx(this.params).then((res) => {

+ 1 - 1
app/src/views/PoliceSituation/components/MobilizeStrength.vue

@@ -303,4 +303,4 @@ white-space: nowrap;">{{ item.yjddsj || '-'}}</span>
 			}
 		}
 	}
-</style>
+</style>

+ 1 - 1
app/src/views/PoliceSituation/index.vue

@@ -180,4 +180,4 @@
 	};
 </script>
 
-<style scoped lang="less"></style>
+<style scoped lang="less"></style>