|
@@ -1,5 +1,5 @@
|
|
|
-import { onMounted, onUnmounted, defineComponent, ref, watchEffect } from 'vue';
|
|
|
-import { useRoute } from 'vue-router';
|
|
|
+import { onMounted, onUnmounted, defineComponent, ref, watchEffect,watch } from 'vue';
|
|
|
+import { useRoute,useRouter } from 'vue-router';
|
|
|
import {
|
|
|
useCommonStore,
|
|
|
useDaHuaStore,
|
|
@@ -17,12 +17,18 @@ import LiveVideoCard from './LiveVideoCard';
|
|
|
import AccidentCard from './AccidentCard';
|
|
|
import EmergencyCard from './EmergencyCard';
|
|
|
import './index.scss';
|
|
|
-import { watch } from 'fs';
|
|
|
+// import { watch } from 'fs';
|
|
|
import { isEmpty } from 'lodash';
|
|
|
import isString from 'lodash/isString';
|
|
|
import { NeedsReadUser, NeedsReadUserName } from '@/api/common';
|
|
|
import { BaseReg } from '@/constants/constants';
|
|
|
|
|
|
+// @ts-ignore
|
|
|
+import Iconback from '@/assets/icons/detail/back@2x.png';
|
|
|
+import MessageCard from '../HomePage/MessageCard';
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: 'IncidentDetail',
|
|
|
provide: {},
|
|
@@ -33,6 +39,7 @@ export default defineComponent({
|
|
|
const markerStore = useMarkerStore();
|
|
|
const daHuaStore = useDaHuaStore();
|
|
|
const route = useRoute();
|
|
|
+ const router = useRouter();
|
|
|
|
|
|
const liveVideoRef = ref<HTMLElement>();
|
|
|
|
|
@@ -79,6 +86,20 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ watch(
|
|
|
+ () => store.incidentDetail,
|
|
|
+ (next) => {
|
|
|
+ if(next.baseInfo==undefined||next.baseInfo==null) router.push('/home');
|
|
|
+ console.log(next)
|
|
|
+ },
|
|
|
+ );
|
|
|
+
|
|
|
+ const docloseeventlist = () => {
|
|
|
+ mainStore.setEventListshow(false);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
commonStore.getGlobalDict('zhdd_incident_type');
|
|
|
commonStore.getGlobalDict('zhdd_incident_source');
|
|
@@ -88,6 +109,10 @@ export default defineComponent({
|
|
|
if (el.target && liveVideoRef.value?.contains(el.target as Node)) {
|
|
|
}
|
|
|
});
|
|
|
+ // if (!store.incidentDetail) {
|
|
|
+ // router.push("/home");
|
|
|
+
|
|
|
+ // }
|
|
|
});
|
|
|
onUnmounted(() => {
|
|
|
store.incidentDetail = {};
|
|
@@ -99,7 +124,7 @@ export default defineComponent({
|
|
|
return () => (
|
|
|
<>
|
|
|
<div class="incident-detail-page-container">
|
|
|
- {!markerStore.livevideovisible && (
|
|
|
+ {
|
|
|
<div class="detail-left">
|
|
|
<IncidentInfoCard />
|
|
|
<LiveMonitoringCard />
|
|
@@ -108,9 +133,9 @@ export default defineComponent({
|
|
|
<CommandChainCard />
|
|
|
<AccidentCard />
|
|
|
</div>
|
|
|
- )}
|
|
|
+ }
|
|
|
|
|
|
- {!daHuaStore.dahuaUserVisible && (
|
|
|
+ {
|
|
|
<div class="detail-right">
|
|
|
<EmergencyCard />
|
|
|
<IncidentPlanCard />
|
|
@@ -118,7 +143,7 @@ export default defineComponent({
|
|
|
|
|
|
{/* <LiveMonitoringCard /> */}
|
|
|
</div>
|
|
|
- )}
|
|
|
+ }
|
|
|
</div>
|
|
|
{/*大华 相关的通讯录可以放这里*/}
|
|
|
{/*{daHuaStore.dahuaUserVisible && (*/}
|
|
@@ -144,6 +169,49 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
+ <div class="event-list-c" v-show={mainStore.isshoweventlist}>
|
|
|
+ <div class="elc-back" onClick={docloseeventlist}>
|
|
|
+ <img src={Iconback} /> 返回
|
|
|
+ </div>
|
|
|
+ <div class="elc-content">
|
|
|
+
|
|
|
+ {store.incidents.data?.map((item, idx) => (
|
|
|
+ <a
|
|
|
+ onClick={async (e) => {
|
|
|
+ e.preventDefault();
|
|
|
+ // @ts-ignore
|
|
|
+ markerStore.currentIncident = item;
|
|
|
+ item.id && (await store.getIncidentItem(item.id));
|
|
|
+ router.push(`/incidentDetail?id=${item.id}`);
|
|
|
+ }}>
|
|
|
+ <div class="message-item">
|
|
|
+ <div class="title">
|
|
|
+ <span class="index">{idx + 1}、</span>
|
|
|
+ <span>
|
|
|
+ {item.createTime +
|
|
|
+ ',在' +
|
|
|
+ item.addr +
|
|
|
+ '处发生了' +
|
|
|
+ (commonStore.globalDict['zhdd_incident_type']?.find(
|
|
|
+ (i) => i.dictValue.toString() === `${item.type}`,
|
|
|
+ )?.dictLabel ?? '预警') +
|
|
|
+ '事件'}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="desc">
|
|
|
+ 来源:
|
|
|
+ {
|
|
|
+ commonStore.globalDict['zhdd_incident_source']?.find(
|
|
|
+ (i) => i.dictValue.toString() === `${item.source}`,
|
|
|
+ )?.dictLabel
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ ))}
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</>
|
|
|
);
|
|
|
},
|