Jiang, Wim 3 rokov pred
rodič
commit
24db29bd90

+ 9 - 0
src/layout/BaseLayout/index.scss

@@ -18,10 +18,19 @@
     position: fixed;
     top: 0;
     z-index: 1;
+    .back-to-home {
+      position: absolute;
+      width: px2rem(600px);
+      cursor: pointer;
+      height: 100%;
+      left: 50%;
+      transform: translateX(-50%);
+    }
   }
   main {
     display: flex;
     flex-direction: column;
     min-height: calc(100vh);
+    position: relative;
   }
 }

+ 11 - 2
src/layout/BaseLayout/index.tsx

@@ -2,17 +2,26 @@ import { defineComponent } from 'vue';
 import { RouterView, useRoute, useRouter } from 'vue-router';
 import MarkerMap from '@/components/MarkerMap';
 import './index.scss';
+import { useIncidentStore } from '@/store';
 
 export default defineComponent({
   setup() {
     const route = useRoute();
+    const router = useRouter();
+
+    const store = useIncidentStore();
 
     return () => (
       <section class="base-layout-container">
-        <header class="base-layout-title-contatiner"></header>
+        <header class="base-layout-title-contatiner">
+          <div class="back-to-home" onClick={() => router.push('/home')}></div>
+        </header>
         <main>
           <RouterView />
-          <MarkerMap readonly={route.path.includes('incidentDetail')} />
+          <MarkerMap
+            readonly={route.path.includes('incidentDetail')}
+            marker={store.incidentDetail}
+          />
         </main>
       </section>
     );

+ 63 - 0
src/store/mock.ts

@@ -0,0 +1,63 @@
+/**
+ * - 预案类型: zhdd_plan_type;
+ * - 事件类型: zhdd_incident_type;
+ * - 事件状态: zhdd_incident_status; - 可用于 事件页面右侧菜单
+ * - 事件等级: zhdd_incident_level;
+ * - 事件来源: zhdd_incident_source;
+ * - 上报单位: zhdd_org_upload; - 可用于预案页面右侧菜单,
+ * - 应急资源:zhdd_resource - 可用于资源页面右侧菜单
+ * - 首页标记点: zhdd_screen_type
+ */
+
+export const zhdd_plan_type = [
+  { dictLabel: 'I 级预案', dictValue: '1' },
+  { dictLabel: 'II 级预案', dictValue: '2' },
+  { dictLabel: 'III 级预案', dictValue: '3' },
+  { dictLabel: 'IV 级预案', dictValue: '4' },
+];
+
+export const zhdd_incident_status = [
+  { dictLabel: '预警', dictValue: '1' },
+  { dictLabel: '待派发', dictValue: '2' },
+  { dictLabel: '待处置', dictValue: '3' },
+  { dictLabel: '已归档', dictValue: '4' },
+  { dictLabel: '已忽略', dictValue: '5' },
+];
+
+export const zhdd_incident_source = [
+  { dictLabel: '宿迁交通APP', dictValue: '1' },
+  { dictLabel: '市运输服务中心', dictValue: '2' },
+  { dictLabel: '市港航事业发展中心', dictValue: '3' },
+  { dictLabel: '市公共事业发展中心', dictValue: '4' },
+  { dictLabel: '应急安全处', dictValue: '5' },
+];
+
+export const zhdd_org_upload = [
+  { dictLabel: '归属部门', dictValue: '1' },
+  { dictLabel: '应急安全处', dictValue: '2' },
+  { dictLabel: '市运输服务中心', dictValue: '3' },
+  { dictLabel: '市港航事业发展中心', dictValue: '4' },
+  { dictLabel: '市铁路事业发展中心', dictValue: '5' },
+  { dictLabel: '市公路事业发展中心', dictValue: '6' },
+];
+
+export const zhdd_resource = [
+  { dictLabel: '应急仓库', dictValue: '1' },
+  { dictLabel: '应急队伍', dictValue: '2' },
+  { dictLabel: '应急车辆', dictValue: '3' },
+  { dictLabel: '应急专家', dictValue: '4' },
+  { dictLabel: '应急单兵', dictValue: '5' },
+];
+
+export const zhdd_incident_type = [
+  { dictLabel: '自然灾害', dictValue: '1' },
+  { dictLabel: '事故灾难', dictValue: '2' },
+  { dictLabel: '公共卫生事件', dictValue: '3' },
+  { dictLabel: '社会安全事件', dictValue: '4' },
+];
+export const zhdd_incident_level = [
+  { dictLabel: 'I', dictValue: '1' },
+  { dictLabel: 'II', dictValue: '2' },
+  { dictLabel: 'III', dictValue: '3' },
+  { dictLabel: 'IV', dictValue: '4' },
+];

+ 25 - 2
src/store/useCommonStore.ts

@@ -8,6 +8,7 @@ import {
 import { getSession } from "@/utils";
 import isEmpty from "lodash/isEmpty";
 import { defineStore } from "pinia";
+import { zhdd_plan_type, zhdd_incident_status, zhdd_incident_source, zhdd_org_upload, zhdd_resource, zhdd_incident_type, zhdd_incident_level } from "./mock";
 
 export type GlobalDictStore = {
   [key in DictType]?: GlobalDict[];
@@ -56,8 +57,30 @@ export default defineStore<"common", CommonStateType, {}, CommonActionsType>(
         try {
           this.toggleLoading();
           const { data } = await getGlobalDict(params);
-          this.globalDict[params] = data;
-
+          // this.globalDict[params] = data;
+          switch (params) {
+            case 'zhdd_plan_type':
+              this.globalDict[params] = zhdd_plan_type;
+              break;
+            case 'zhdd_incident_status':
+              this.globalDict[params] = zhdd_incident_status;
+              break;
+            case 'zhdd_incident_source':
+              this.globalDict[params] = zhdd_incident_source;
+              break;
+            case 'zhdd_org_upload':
+              this.globalDict[params] = zhdd_org_upload;
+              break;
+            case 'zhdd_resource':
+              this.globalDict[params] = zhdd_resource;
+              break;
+            case 'zhdd_incident_type':
+              this.globalDict[params] = zhdd_incident_type;
+              break;
+            case 'zhdd_incident_level':
+              this.globalDict[params] = zhdd_incident_level;
+              break;
+          }
           sessionStorage.setItem(
             params,
             JSON.stringify(this.globalDict[params])

+ 1 - 0
src/store/useMarkerStore.ts

@@ -9,6 +9,7 @@ import {
 import { defineStore } from 'pinia';
 
 export interface MarkerType {
+  id?: string | number;
   location?: string;
   marker?: any;
   popup?: any;