bill 3 hafta önce
ebeveyn
işleme
254efb32ff

+ 2 - 0
src/api/setting.ts

@@ -15,6 +15,8 @@ type ServeSetting = {
 
 export type Setting = {
   id?: string;
+  title?: string
+  initGPS?: string
   pose?: {
     position: SceneLocalPos;
     target: SceneLocalPos;

+ 32 - 11
src/components/global-search/index.vue

@@ -1,5 +1,9 @@
 <template>
-  <div id="global-search" v-if="custom.showSearch">
+  <div
+    id="global-search"
+    v-if="custom.showSearch"
+    :class="{ nul: fuseModels.length === 0 }"
+  >
     <Select
       :filter-option="filter"
       v-model:value="value"
@@ -10,7 +14,7 @@
       show-search
       @search="handleSearch"
       :dropdownMatchSelectWidth="false"
-      popupClassName="global-search-menu"
+      :popupClassName="popupClassName || 'global-search-menu'"
       allowClear
       placeholder="搜索"
     >
@@ -26,7 +30,11 @@
             :key="item.key + option.id"
             :class="{ 'last-item': ndx + 1 === item.options.length }"
           >
-            <component :is="item.comp" :data="(option as any)" />
+            <component
+              :is="item.comp"
+              :data="(option as any)"
+              @update:data="(data: any) => emit('update:data', data)"
+            />
           </SelectOption>
         </SelectOptGroup>
       </template>
@@ -65,8 +73,11 @@ import { debounce } from "@/utils";
 import { searchAddress, Address } from "@/store/map";
 import { fuseModels } from "@/store";
 
+const props = defineProps<{ popupClassName?: string; enable?: string }>();
+const emit = defineEmits<{ (e: "update:data", val: any): void }>();
+
 const addressItems = ref<Address[]>([]);
-const options = computed(() => [
+const optionsAll = computed(() => [
   {
     key: "mode-",
     name: "模型",
@@ -102,13 +113,13 @@ const options = computed(() => [
     getLabel: (tag: Guide) => tag.title,
     comp: GuideComp,
   },
-  {
-    key: "view-",
-    name: "视图提取",
-    options: views.value,
-    getLabel: (tag: View) => tag.title,
-    comp: ViewComp,
-  },
+  // {
+  //   key: "view-",
+  //   name: "视图提取",
+  //   options: views.value,
+  //   getLabel: (tag: View) => tag.title,
+  //   comp: ViewComp,
+  // },
   // {
   //   key: "monitor-",
   //   name: "监控",
@@ -125,6 +136,12 @@ const options = computed(() => [
   },
 ]);
 
+const options = computed(() =>
+  !props.enable
+    ? optionsAll.value
+    : optionsAll.value.filter((item) => item.key === props.enable)
+);
+
 const filterOption = (input: string, key: string) => {
   if (key.indexOf("map-") === 0) return true;
   const option = options.value.find((option) => key.indexOf(option.key) === 0);
@@ -174,6 +191,10 @@ const handleSearch = (val: string) => {
   top: calc(var(--editor-head-height) + var(--header-top) + 20px);
   // background: #000;
   transition: all 0.3s ease;
+
+  &.nul {
+    left: 20px;
+  }
 }
 </style>
 

+ 2 - 1
src/components/global-search/map.vue

@@ -7,9 +7,10 @@ import { flyLatLng } from "@/hook/use-fly";
 import { Address } from "@/store/map";
 
 const props = defineProps<{ data: Address }>();
+const emit = defineEmits<{ (e: "update:data", val: Address): void }>();
 
 const fly = () => {
-  console.log("fly", props.data.latlng);
   flyLatLng(props.data.latlng);
+  emit("update:data", props.data);
 };
 </script>

+ 2 - 1
src/layout/edit/fuse-edit.vue

@@ -1,13 +1,14 @@
 <template>
   <template v-if="loaded" style="height: 100%">
     <Header></Header>
+    <GlobalSearch />
+    {{ fuseModels.length }}
     <template v-if="fuseModels.length">
       <router-view v-slot="{ Component }">
         <!-- <keep-alive> -->
         <component :is="Component" />
         <!-- </keep-alive> -->
       </router-view>
-      <GlobalSearch />
     </template>
 
     <SelectModel v-else>

+ 4 - 4
src/layout/edit/fuse-slide-menu.vue

@@ -30,10 +30,10 @@ const items: Items = [
     name: RoutesName.guide,
     ...metas[RoutesName.guide],
   },
-  {
-    name: RoutesName.view,
-    ...metas[RoutesName.view],
-  },
+  // {
+  //   name: RoutesName.view,
+  //   ...metas[RoutesName.view],
+  // },
   {
     name: RoutesName.setting,
     ...metas[RoutesName.setting],

+ 12 - 12
src/layout/show/slide-menu.vue

@@ -31,11 +31,11 @@ defineEmits<{ (e: "changeItem", item: MenuItem): void }>();
 
 const items = computed(() => {
   const items = [
-    {
-      name: RoutesName.fireInfo,
-      config: getRouteConfig(RoutesName.fireInfo),
-      ...metas[RoutesName.fireInfo],
-    },
+    // {
+    //   name: RoutesName.fireInfo,
+    //   config: getRouteConfig(RoutesName.fireInfo),
+    //   ...metas[RoutesName.fireInfo],
+    // },
     {
       name: RoutesName.summaryShow,
       config: getRouteConfig(RoutesName.summaryShow),
@@ -43,13 +43,13 @@ const items = computed(() => {
     },
   ];
 
-  if (views.value.length) {
-    items.push({
-      name: RoutesName.viewShow,
-      config: getRouteConfig(RoutesName.viewShow),
-      ...metas[RoutesName.viewShow],
-    });
-  }
+  // if (views.value.length) {
+  //   items.push({
+  //     name: RoutesName.viewShow,
+  //     config: getRouteConfig(RoutesName.viewShow),
+  //     ...metas[RoutesName.viewShow],
+  //   });
+  // }
 
   if (records.value.length) {
     items.push({

+ 12 - 12
src/router/config.ts

@@ -11,12 +11,12 @@ export const routes = [
         name: RoutesName.fuseEditSwitch,
         component: () => import('@/layout/edit/fuse-switch.vue'),
         children: [
-          {
-            path: paths[RoutesName.view],
-            name: RoutesName.view,
-            meta: metas[RoutesName.view],
-            component: () => import('@/views/view/index.vue')
-          },
+          // {
+          //   path: paths[RoutesName.view],
+          //   name: RoutesName.view,
+          //   meta: metas[RoutesName.view],
+          //   component: () => import('@/views/view/index.vue')
+          // },
           {
             path: paths[RoutesName.merge],
             name: RoutesName.merge,
@@ -104,12 +104,12 @@ export const routes = [
         name: RoutesName.fireInfo,
         component: () => import('@/views/folder/index.vue')
       },
-      {
-        path: paths[RoutesName.viewShow],
-        name: RoutesName.viewShow,
-        mate: { left: 'scene-list' },
-        component: () => import('@/views/view/show.vue')
-      },
+      // {
+      //   path: paths[RoutesName.viewShow],
+      //   name: RoutesName.viewShow,
+      //   mate: { left: 'scene-list' },
+      //   component: () => import('@/views/view/show.vue')
+      // },
       {
         path: paths[RoutesName.recordShow],
         name: RoutesName.recordShow,

+ 10 - 10
src/router/constant.ts

@@ -108,12 +108,12 @@ export const metas = {
     sysTitle: "多元融合",
   },
 
-  [RoutesName.view]: {
-    sysTitle: "视图提取",
-    icon: "view",
-    title: "视图提取",
-    left: 'scene-list'
-  },
+  // [RoutesName.view]: {
+  //   sysTitle: "视图提取",
+  //   icon: "view",
+  //   title: "视图提取",
+  //   left: 'scene-list'
+  // },
   [RoutesName.record]: { sysTitle: "屏幕录制" },
   [RoutesName.show]: { sysTitle: "" },
 
@@ -125,10 +125,10 @@ export const metas = {
     icon: "list-scene",
     title: "视图",
   },
-  [RoutesName.fireInfo]: {
-    icon: "message_c",
-    title: "案件信息",
-  },
+  // [RoutesName.fireInfo]: {
+  //   icon: "message_c",
+  //   title: "案件信息",
+  // },
   [RoutesName.recordShow]: {
     icon: "list-record",
     title: "录屏",

+ 1 - 1
src/router/index.ts

@@ -60,7 +60,7 @@ watch(currentLayout, () => {
   clearTimeout(timeout)
   timeout = setTimeout(() => {
     if (!currentLayout.value || router.currentRoute.value.name === RoutesName.show) {
-      router.replace({ name: RoutesName.fireInfo })
+      router.replace({ name: RoutesName.summaryShow })
     }
   }, 100)
 })

+ 36 - 0
src/views/setting/index.vue

@@ -1,5 +1,21 @@
 <template>
   <RightFillPano>
+    <ui-group title="名称" borderBottom>
+      <ui-group-option>
+        <Input v-model:value="setting!.title" style="width: 100%; height: 40px" />
+      </ui-group-option>
+    </ui-group>
+    <ui-group title="位置" borderBottom>
+      <ui-group-option>
+        <GlobalSearch
+          class="gps"
+          popupClassName="gps-popupClassName"
+          enable="map-"
+          @update:data="updateGPS"
+        />
+      </ui-group-option>
+    </ui-group>
+
     <ui-group title="初始画面" borderBottom>
       <ui-group-option>
         <div class="init-pic" :class="{ disabled: isEdit }">
@@ -18,6 +34,7 @@
 </template>
 
 <script lang="ts" setup>
+import GlobalSearch from "@/components/global-search/index.vue";
 import { RightFillPano } from "@/layout";
 import { enterEdit, enterOld, setting, isEdit, updataSetting } from "@/store";
 import { ref } from "vue";
@@ -25,6 +42,11 @@ import { togetherCallback, getFileUrl, loadPack } from "@/utils";
 import { showRightPanoStack, showRightCtrlPanoStack } from "@/env";
 import { analysisPose, sdk } from "@/sdk";
 import selectBack from "./select-back.vue";
+import { Input } from "ant-design-vue";
+
+const updateGPS = (val: any) => {
+  console.log(val);
+};
 
 const enterSetPic = () => {
   enterEdit(
@@ -103,3 +125,17 @@ const changeBack = ([back, mapId]: [string | null, number | null]) => {
   cursor: pointer;
 }
 </style>
+
+<style lang="scss">
+.gps#global-search {
+  position: static;
+
+  > .ant-select {
+    width: 100% !important;
+  }
+}
+
+.gps-popupClassName {
+  width: auto;
+}
+</style>