wangfumin пре 2 месеци
родитељ
комит
a657639e75

+ 21 - 23
src/view/newFireCase/newFireDetails/components/basicInfo.vue

@@ -114,7 +114,8 @@
     </template>
   </div>
   <!-- 地图弹窗仅 fire 使用 -->
-  <creatMap v-if="props.fromRoute !== 'criminal'" v-model="showMapDialog" :caseId="caseId" @confirm="handleMapConfirm" />
+  <!-- 地图弹窗改为统一使用,无论路由来源 -->
+  <creatMap v-model="showMapDialog" :caseId="caseId" @confirm="handleMapConfirm" />
 </template>
 
 <script setup lang="ts">
@@ -128,14 +129,14 @@ import { genCascaderValue, getCode } from "@/helper/cascader";
 import { QuiskExpose } from "@/helper/mount";
 import { user } from "@/store/user";
 import { Search } from "@element-plus/icons-vue";
-import { selectMapImage } from "@/view/case/quisk";
+// 旧的选择地图逻辑已统一为 creatMap 弹窗,移除 selectMapImage
 import { Example, setExample as setCriminalExample, addExample as addCriminalExample } from "@/app/criminal/store/example";
 import { getCaseInfo } from "@/store/case";
 import creatMap from "./creatMap.vue";
 
 const props = defineProps<{ fire?: Fire, caseId?: number, editOrShow?: string, fromRoute?: string }>();
 const caseId = toRef(props, 'caseId');
-console.log(props.fromRoute, 'props.fromRoute')
+
 let bindFire = ref<Fire>( props.fire ? { ...props.fire } : ({ deptId: user.value.info.deptId} as Fire));
 const accidentDate = ref(
   bindFire.value.accidentDate ? new Date(bindFire.value.accidentDate) : new Date()
@@ -204,7 +205,11 @@ const autoSave = async () => {
     // 保存成功后派发标题更新事件,供父组件同步 currentRecord
     try {
       const title = props.fromRoute === 'criminal' ? (bindFire.value as any).caseTitle : (bindFire.value as any).projectName;
-      window.dispatchEvent(new CustomEvent('fireDetails:updateTitle', { detail: { title } }));
+      const mapUrl = (bindFire.value as any).mapUrl;
+      const latAndLong = (bindFire.value as any).latAndLong;
+      window.dispatchEvent(
+        new CustomEvent('fireDetails:updateTitle', { detail: { title, mapUrl, latAndLong } })
+      );
     } catch (e) {}
     // 自动保存成功后不刷新页面,也不打扰用户
   } catch (e) {
@@ -247,10 +252,14 @@ const autoSaveCriminal = async () => {
       await addCriminalExample(bindFire.value as any);
     }
     lastSavedSnapshotCriminal = snapshot;
-    // 保存成功后派发标题更新事件,供父组件同步 currentRecord
+    // 保存成功后派发标题更新事件,附带地图信息,供父组件同步 currentRecord
     try {
       const title = (bindFire.value as any).caseTitle;
-      window.dispatchEvent(new CustomEvent('fireDetails:updateTitle', { detail: { title } }));
+      const mapUrl = (bindFire.value as any).mapUrl;
+      const latAndLong = (bindFire.value as any).latAndLong;
+      window.dispatchEvent(
+        new CustomEvent('fireDetails:updateTitle', { detail: { title, mapUrl, latAndLong } })
+      );
     } catch (e) {}
   } catch (e) {
     console.error('criminal auto-save error', e);
@@ -302,9 +311,9 @@ defineExpose<QuiskExpose>({
         ElMessage.error("详细地址不能为空");
         throw "详细地址不能为空!";
       }
-      await (bindFire.value.caseId
-        ? setCriminalExample(bindFire.value)
-        : addCriminalExample(bindFire.value as any));
+      await (bindFire.value.caseId ? setCriminalExample(bindFire.value as any) : addCriminalExample(bindFire.value as any));
+        // 保存成功后刷新页面数据
+        window.location.reload()
     } else {
       if (!bindFire.value.latAndLong || !bindFire.value.latAndLong.trim()) {
         ElMessage.error("详细地址不能为空");
@@ -344,7 +353,6 @@ defineExpose<QuiskExpose>({
       } else {
         await addFire(bindFire.value as any);
       }
-      
       // 保存成功后,刷新fireDetails页面的数据
       window.location.reload()
     }
@@ -353,22 +361,12 @@ defineExpose<QuiskExpose>({
 
 // 打开地图/选择地址
 const searchAMapAddress = async () => {
-  if (props.fromRoute === 'criminal') {
-    const data = await selectMapImage({});
-    if (!data?.search) return;
-
-    bindFire.value.mapUrl = data.search.text;
-    bindFire.value.latlng = bindFire.value.latAndLong = `${data.search.lat},${data.search.lng}`;
-    if (!data.search.text) {
-      bindFire.value.mapUrl = bindFire.value.latAndLong;
-    }
-  } else {
-    showMapDialog.value = true
-  }
+  // 统一使用 creatMap 弹窗进行位置选择
+  showMapDialog.value = true;
 };
 // 处理地图确认选择
 const handleMapConfirm = (LocationInfo: any) => {
-  // console.log(LocationInfo, 666)
+  console.log(LocationInfo, 666)
   const {cityname, adname, address, name, location} = LocationInfo;
   bindFire.value.mapUrl = cityname + adname + address + name;
   bindFire.value.latlng = bindFire.value.latAndLong = `${location.lat},${location.lng}`;

+ 1 - 0
src/view/newFireCase/newFireDetails/components/headerTop.vue

@@ -119,6 +119,7 @@ const emit = defineEmits<{
   }
   .change-btn{
     margin-right: 26px;
+    cursor: pointer;
     .icon-rename{
       font-size: 24px;
     }

+ 9 - 0
src/view/newFireCase/newFireDetails/components/mix3d.vue

@@ -16,6 +16,9 @@
             <span style="margin-left: 6px;">导入</span>
           </div>
         </div>
+        <div class="no-data" v-if="scenes.length === 0">
+          暂无数据
+        </div>
         <el-menu class="scene-list" mode="vertical" :default-active="activeId" @select="onSelect">
           <el-menu-item
             v-for="item in scenes"
@@ -358,6 +361,12 @@ onMounted(async () => {
     height: 100%;
     overflow: auto;
     border-right: 1px solid #f0f0f0;
+    .no-data{
+      line-height: 100px;
+      color: #909399;
+      text-align: center;
+      margin-top: 16px;
+    }
     .import-row{
       .import-btn{
         display: flex;

+ 2 - 2
src/view/newFireCase/newFireDetails/components/otherFiles.vue

@@ -41,7 +41,7 @@
             <span class="file-name" :title="file.filesTitle">{{ file.filesTitle || '未命名' }}</span>
           </div>
           <div class="file-actions" v-if="editOrShow === 'edit'">
-            <el-tooltip content="更改名字" placement="top">
+            <el-tooltip content="重命名" placement="top">
               <el-button link @click.stop="handleRename(file)">
                 <i class="iconfont icon-rename" />
               </el-button>
@@ -51,7 +51,7 @@
                 <i class="iconfont icon-download" />
               </el-button>
             </el-tooltip>
-            <el-tooltip content="除" placement="top">
+            <el-tooltip content="除" placement="top">
               <el-button link @click.stop="handleDelete(file)">
                 <i class="iconfont icon-CloseCircle" />
               </el-button>

+ 9 - 0
src/view/newFireCase/newFireDetails/components/scene.vue

@@ -16,6 +16,9 @@
             <span style="margin-left: 6px;">导入</span>
           </div>
         </div>
+        <div class="no-data" v-if="scenes.length === 0">
+          暂无数据
+        </div>
         <el-menu class="scene-list" mode="vertical" :default-active="activeId" @select="onSelect">
           <el-menu-item
             v-for="item in scenes"
@@ -457,6 +460,12 @@ onMounted(async () => {
     height: 100%;
     border-right: 1px solid #f0f0f0;
     overflow: auto;
+    .no-data{
+      line-height: 100px;
+      color: #909399;
+      text-align: center;
+      margin-top: 16px;
+    }
     .import-row{
       .import-btn{
         display: flex;

+ 2 - 2
src/view/newFireCase/newFireDetails/components/screenShot.vue

@@ -30,7 +30,7 @@
             <span class="file-tip" v-if="isProcessing(file)">(后台正在处理...)</span>
           </div>
           <div class="file-actions" v-if="editOrShow === 'edit' && !isProcessing(file)">
-            <el-tooltip content="更改" placement="top">
+            <el-tooltip content="重命名" placement="top">
               <el-button link @click.stop="handleRename(file)">
                 <i class="iconfont icon-rename" />
               </el-button>
@@ -45,7 +45,7 @@
                 <i class="iconfont icon-download" />
               </el-button>
             </el-tooltip>
-            <el-tooltip content="除" placement="top">
+            <el-tooltip content="除" placement="top">
               <el-button link @click.stop="handleDelete(file)">
                 <i class="iconfont icon-CloseCircle" />
               </el-button>

+ 33 - 21
src/view/newFireCase/newFireDetails/components/siteInspection.vue

@@ -52,15 +52,21 @@
                 >
                   <span class="name">{{ img.name }}</span>
                   <div class="header-actions" v-if="editOrShow === 'edit'">
-                    <span class="action-icon" @click="renameSelected">
-                      <i class="iconfont icon-rename_s" />
-                    </span>
-                    <span class="action-icon" @click="editSelected('tabulation')">
-                      <i class="iconfont icon-Edit" />
-                    </span>
-                    <span class="action-icon" @click="deleteSelected">
-                      <i class="iconfont icon-CloseCircle" />
-                    </span>
+                    <el-tooltip content="重命名">
+                      <span class="action-icon" @click="renameSelected"> 
+                        <i class="iconfont icon-rename_s" />
+                      </span>
+                    </el-tooltip>
+                    <el-tooltip content="编辑">
+                      <span class="action-icon" @click="editSelected('tabulation')">
+                        <i class="iconfont icon-Edit" />
+                      </span>
+                    </el-tooltip>
+                    <el-tooltip content="移除">
+                      <span class="action-icon" @click="deleteSelected">
+                        <i class="iconfont icon-CloseCircle" />
+                      </span>
+                    </el-tooltip>
                   </div>
                 </div>
                 <div v-if="!orientationImages.length" class="empty-tip">暂无方位图</div>
@@ -93,15 +99,21 @@
                   >
                     <span class="name">{{ img.name }}</span>
                     <div class="header-actions" v-if="editOrShow === 'edit'">
-                      <span class="action-icon" @click="renameSelected">
-                        <i class="iconfont icon-rename_s" />
-                      </span>
-                      <span class="action-icon" @click="editSelected('overview')">
-                        <i class="iconfont icon-Edit" />
-                      </span>
-                      <span class="action-icon" @click="deleteSelected">
-                        <i class="iconfont icon-CloseCircle" />
-                      </span>
+                      <el-tooltip content="重命名">
+                        <span class="action-icon" @click="renameSelected">
+                          <i class="iconfont icon-rename_s" />
+                        </span>
+                      </el-tooltip>
+                      <el-tooltip content="编辑">
+                        <span class="action-icon" @click="editSelected('overview')">
+                          <i class="iconfont icon-Edit" />
+                        </span>
+                      </el-tooltip>
+                      <el-tooltip content="移除">
+                        <span class="action-icon" @click="deleteSelected">
+                          <i class="iconfont icon-CloseCircle" />
+                        </span>
+                      </el-tooltip>
                     </div>
                   </div>
                   <div v-if="!planeImages.length" class="empty-tip">暂无平面图</div>
@@ -142,7 +154,7 @@
                           <i class="iconfont icon-Edit" />
                         </span>
                       </el-tooltip>
-                      <el-tooltip content="除" placement="top">
+                      <el-tooltip content="除" placement="top">
                         <span class="action-icon" @click="deleteItem">
                           <i class="iconfont icon-CloseCircle" />
                         </span>
@@ -185,7 +197,7 @@
                         <i class="iconfont icon-Edit" />
                       </span>
                     </el-tooltip>
-                    <el-tooltip content="除" placement="top">
+                    <el-tooltip content="除" placement="top">
                       <span class="action-icon" @click="deleteItem">
                         <i class="iconfont icon-CloseCircle" />
                       </span>
@@ -227,7 +239,7 @@
                         <i class="iconfont icon-Edit" />
                       </span>
                     </el-tooltip>
-                    <el-tooltip content="除" placement="top">
+                    <el-tooltip content="除" placement="top">
                       <span class="action-icon" @click="deleteItem">
                         <i class="iconfont icon-CloseCircle" />
                       </span>

+ 8 - 1
src/view/newFireCase/newFireDetails/index.vue

@@ -160,14 +160,21 @@ onMounted(() => {
   
   // 监听标题更新事件:由 basicInfo 自动保存成功派发
   const titleUpdateHandler = (evt: any) => {
-    const title = evt?.detail?.title || '';
+    const detail = evt?.detail || {};
+    const title = detail?.title || '';
+    const mapUrl = detail?.mapUrl;
+    const latAndLong = detail?.latAndLong;
     if (!title) return;
     const cr: any = currentRecord.value || {};
     if (fromRoute.value === 'fire') {
       if (!cr.tmProject) cr.tmProject = {};
       cr.tmProject.projectName = title;
+      if (mapUrl !== undefined) cr.tmProject.mapUrl = mapUrl;
+      if (latAndLong !== undefined) cr.tmProject.latAndLong = latAndLong;
     } else if (fromRoute.value === 'criminal') {
       cr.caseTitle = title;
+      if (mapUrl !== undefined) cr.mapUrl = mapUrl;
+      if (latAndLong !== undefined) cr.latAndLong = latAndLong;
     }
     currentRecord.value = { ...cr };
   };

+ 17 - 9
src/view/newFireCase/newdispatch/editCrimical.vue

@@ -15,6 +15,8 @@
       <el-switch v-model="bindExample.mapShow" :disabled="!bindExample.latAndLong" />
     </el-form-item>
   </el-form>
+  <!-- 地图弹窗(使用与 basicInfo.vue 相同的 creatMap 组件) -->
+  <creatMap v-model="showMapDialog" :caseId="bindExample.caseId" @confirm="handleMapConfirm" />
 </template>
 
 <script setup lang="ts">
@@ -23,10 +25,11 @@ import { Example, setExample, addExample } from "@/app/criminal/store/example";
 import { ElMessage } from "element-plus";
 import { QuiskExpose } from "@/helper/mount";
 import { Search } from "@element-plus/icons-vue";
-import { selectMapImage } from "@/view/case/quisk";
+import creatMap from "../newFireDetails/components/creatMap.vue";
 
 const props = defineProps<{ example?: Example }>();
 const bindExample = ref<Example>(props.example ? { ...props.example } : ({} as Example));
+const showMapDialog = ref(false);
 
 defineExpose<QuiskExpose>({
   async submit() {
@@ -44,15 +47,20 @@ defineExpose<QuiskExpose>({
 });
 
 
+// 打开地图弹窗(与 basicInfo.vue 保持一致)
+const searchAMapAddress = () => {
+  showMapDialog.value = true;
+};
 
-const searchAMapAddress = async () => {
-  const data = await selectMapImage({});
-  if (!data?.search) return;
-
-  bindExample.value.mapUrl = data.search.text;
-  bindExample.value.latlng = bindExample.value.latAndLong = `${data.search.lat},${data.search.lng}`;
-  if (!data.search.text) {
-    bindExample.value.mapUrl = bindExample.value.latAndLong;
+// 处理地图选择确认,更新地址与经纬度
+const handleMapConfirm = (locationInfo: any) => {
+  const { cityname, adname, address, name, location } = locationInfo || {};
+  // 更新展示地址
+  bindExample.value.mapUrl = `${cityname || ''}${adname || ''}${address || ''}${name || ''}`;
+  // 更新经纬度
+  if (location && typeof location.lat === 'number' && typeof location.lng === 'number') {
+    bindExample.value.latlng = bindExample.value.latAndLong = `${location.lat},${location.lng}`;
   }
+  showMapDialog.value = false;
 };
 </script>