|
|
@@ -20,6 +20,7 @@ import {
|
|
|
} from "naive-ui";
|
|
|
import { drawBoundingBox } from "@/utils";
|
|
|
import { useAlarmStore, toRefsAlarmStore } from "@/stores/modules/alarm";
|
|
|
+import { useUrlSearchParams } from "@vueuse/core";
|
|
|
import GridData from "./components/gridData.vue";
|
|
|
import TableData from "./components/tableData.vue";
|
|
|
import dayjs from "dayjs";
|
|
|
@@ -170,7 +171,6 @@ async function getDataList(form = {}) {
|
|
|
alertData.value = resF as RowData[];
|
|
|
pagination.itemCount = res.total;
|
|
|
isRequestLoading.value = false;
|
|
|
- console.log(alertData);
|
|
|
}
|
|
|
|
|
|
const statusOptions = [
|
|
|
@@ -238,8 +238,25 @@ watchThrottled(
|
|
|
{ throttle: 0, deep: true },
|
|
|
);
|
|
|
|
|
|
+const gridDataRef = useTemplateRef<typeof GridData>("gridDataRef");
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
- getDataList();
|
|
|
+ const params = useUrlSearchParams("hash");
|
|
|
+ const { e_id } = params;
|
|
|
+ if (e_id) {
|
|
|
+ searchForm.keyword = e_id as string;
|
|
|
+ getDataList().then(() => {
|
|
|
+ // 打开抽屉
|
|
|
+ setTimeout(() => {
|
|
|
+ const item = alertData.value.find((i) => i.EventID === e_id);
|
|
|
+ if (item && gridDataRef.value) {
|
|
|
+ gridDataRef.value.drawerOpen(item);
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ getDataList();
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
provide("getDataList", getDataList);
|
|
|
@@ -402,6 +419,7 @@ provide("getDataList", getDataList);
|
|
|
<!-- 网格视图 -->
|
|
|
<GridData
|
|
|
v-if="viewMode === 'grid'"
|
|
|
+ ref="gridDataRef"
|
|
|
:alertData="alertData"
|
|
|
:loading="isRequestLoading"
|
|
|
/>
|