Browse Source

修改bug

tangning 2 months ago
parent
commit
06fcede360

+ 3 - 0
src/store/case.ts

@@ -123,6 +123,9 @@ export const getCaseInfo = async (caseId) => {
 export const getCaseInquestInfo = async (caseId: number) =>
 export const getCaseInquestInfo = async (caseId: number) =>
   (await axios.get(newCaseInfo, { params: { caseId } })).data;
   (await axios.get(newCaseInfo, { params: { caseId } })).data;
 
 
+export const getUploadProcess = async (uploadId: number) =>
+  (await axios.get(`/fusion/upload/uploadProcess/`+ uploadId)).data;
+
 export const casesaveOrUpDate = async (params) =>
 export const casesaveOrUpDate = async (params) =>
   (await axios.post<string>(casesaveOrUpdate, params)).data;
   (await axios.post<string>(casesaveOrUpdate, params)).data;
 
 

+ 7 - 0
src/view/case/draw/selectMapleaftImages.vue

@@ -134,6 +134,13 @@ if(!isGoogle.value){
     // center: [51.505, -0.09],
     // center: [51.505, -0.09],
     // zoom: 13
     // zoom: 13
   });
   });
+  if (caseInfoData.value?.latAndLong) {
+    clickMarker = L.marker([center[0], center[1]], {
+      position: [center[0], center[1]],
+      title: "点击位置",
+    });
+    clickMarker.addTo(map);
+  }
   L.control.layers(baseLayers, null).addTo(map);
   L.control.layers(baseLayers, null).addTo(map);
   map.on("click", function (e) {
   map.on("click", function (e) {
     // 获取点击位置的经纬度坐标
     // 获取点击位置的经纬度坐标

+ 5 - 1
src/view/layout/top/index.vue

@@ -10,6 +10,7 @@
       <el-input
       <el-input
         v-model="bindExample.caseAddress"
         v-model="bindExample.caseAddress"
         :placeholder="$t('sceneHome.nameSearch')"
         :placeholder="$t('sceneHome.nameSearch')"
+        v-if="!ga"
         clearable
         clearable
         maxlength="100"
         maxlength="100"
         disabled
         disabled
@@ -62,6 +63,7 @@ import { ui18n } from "@/i18n";
 import { Search } from "@element-plus/icons-vue";
 import { Search } from "@element-plus/icons-vue";
 import { selectMapImage } from "@/view/case/quisk";
 import { selectMapImage } from "@/view/case/quisk";
 import { setExample } from "@/app/criminal/store/example";
 import { setExample } from "@/app/criminal/store/example";
+import { getUrlData } from "@/store/user";
 
 
 const bindExample = ref({
 const bindExample = ref({
   caseTitle: "",
   caseTitle: "",
@@ -76,7 +78,7 @@ const bindExample = ref({
   latAndLongs: "",
   latAndLongs: "",
   criminalType: "",
   criminalType: "",
 });
 });
-
+const ga = ref(false)
 refreshRole();
 refreshRole();
 const caseId = computed(() => {
 const caseId = computed(() => {
   const caseId = router.currentRoute.value.params.caseId;
   const caseId = router.currentRoute.value.params.caseId;
@@ -85,6 +87,8 @@ const caseId = computed(() => {
   }
   }
 });
 });
 onMounted(async () => {
 onMounted(async () => {
+  ga.value = getUrlData()?.ga;
+  console.log("onMounted", getUrlData());
   const caseInfo = await getCaseInfo(caseId.value);
   const caseInfo = await getCaseInfo(caseId.value);
   if (caseInfo) {
   if (caseInfo) {
     bindExample.value = JSON.parse(JSON.stringify(caseInfo));
     bindExample.value = JSON.parse(JSON.stringify(caseInfo));

+ 38 - 19
src/view/mediaLibrary/TableComponent.vue

@@ -55,7 +55,7 @@
       </el-form-item>
       </el-form-item>
       <el-form-item style="float: right; margin-right: 0">
       <el-form-item style="float: right; margin-right: 0">
         <el-button
         <el-button
-        v-if="photography == 1"
+          v-if="photography == 1"
           @click="windowOpen({ type: 'photography', library: true })"
           @click="windowOpen({ type: 'photography', library: true })"
           >{{ $t("mediaLibrary.photography") }}</el-button
           >{{ $t("mediaLibrary.photography") }}</el-button
         >
         >
@@ -319,7 +319,7 @@
             type="primary"
             type="primary"
             @click="hanleDown"
             @click="hanleDown"
           >
           >
-            {{$t("sys.download")}}
+            {{ $t("sys.download") }}
           </el-button>
           </el-button>
         </div>
         </div>
       </template>
       </template>
@@ -337,6 +337,7 @@ import {
   getaddOrUpdate,
   getaddOrUpdate,
   setFileaddOrUpdate,
   setFileaddOrUpdate,
   uploadFile,
   uploadFile,
+  getUploadProcess,
   getUrlSrc,
   getUrlSrc,
 } from "@/store/case";
 } from "@/store/case";
 import dayjs from "dayjs";
 import dayjs from "dayjs";
@@ -496,30 +497,48 @@ const handleuploadAdd = async () => {
       text: loadingText.value,
       text: loadingText.value,
       background: "rgba(0, 0, 0, 0.7)",
       background: "rgba(0, 0, 0, 0.7)",
     });
     });
+    windowOpen({type: 'event', data: 'menu-disabled'})
     uploadFile({ file, dictId: addForm.value.dictId }, (completeProgress) => {
     uploadFile({ file, dictId: addForm.value.dictId }, (completeProgress) => {
       console.log("上传进度", completeProgress);
       console.log("上传进度", completeProgress);
       // props.progress = completeProgress; //上传过程
       // props.progress = completeProgress; //上传过程
       loadingText.value = completeProgress + "%";
       loadingText.value = completeProgress + "%";
-      loading.setText(ui18n.t("mediaLibrary.tips.uplooad") + loadingText.value)
-    }).then((res) => {
-      loading.close();
-      console.log("上传进度", res);
-      if (res.data?.status != -1) {
+      loading.setText(ui18n.t("mediaLibrary.tips.uplooad") + loadingText.value);
+    })
+      .then(async (res) => {
+        console.log("上传进度", res);
+        if (res.data?.status != -1) {
+          getFileStatus(res.data.id, loading);
+        } else {
+          ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadErr"));
+        }
+      })
+      .catch((err) => {
+        loading.close();
+        windowOpen({type: 'event', data: 'menu-enabled'})
+      });
+    console.log(formData);
+  }
+};
+const getFileStatus = (id, loading) => {
+  getUploadProcess(id).then((res) => {
+    console.log("getFileStatus", res);
+    if(res.percent == 100){
+        loading.close();
+        windowOpen({type: 'event', data: 'menu-enabled'})
         initData();
         initData();
         dialogData.value.show = false;
         dialogData.value.show = false;
         ElMessage({
         ElMessage({
           type: "success",
           type: "success",
           message: res.data?.status == 0 ? ui18n.t("record.backRun"):ui18n.t("mediaLibrary.tips.uplooadSuccess"),
           message: res.data?.status == 0 ? ui18n.t("record.backRun"):ui18n.t("mediaLibrary.tips.uplooadSuccess"),
         });
         });
-      } else {
-        ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadErr"));
-      }
-    }).catch((err) => {
-      loading.close();
-    });
-    console.log(formData);
-  }
+    }else{
+      setTimeout(()=>{
+        getFileStatus(id, loading)
+      },1000)
+    }
+  });
 };
 };
+
 // 定义方法
 // 定义方法
 const del = (row) => {
 const del = (row) => {
   console.log(file, "file");
   console.log(file, "file");
@@ -701,9 +720,9 @@ initData();
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-.upload-demo .el-upload-list__item.is-success:focus:not(:hover){
-            display: none !important;
-        }
+.upload-demo .el-upload-list__item.is-success:focus:not(:hover) {
+  display: none !important;
+}
 .mb-3 {
 .mb-3 {
   margin-bottom: 1rem;
   margin-bottom: 1rem;
 }
 }
@@ -761,7 +780,7 @@ initData();
         white-space: nowrap; //溢出不换行
         white-space: nowrap; //溢出不换行
       }
       }
       .del {
       .del {
-        color: #FA3D47;
+        color: #fa3d47;
         // width: 40px;
         // width: 40px;
 
 
         cursor: pointer;
         cursor: pointer;