Kaynağa Gözat

本地版修复

tangning 2 ay önce
ebeveyn
işleme
8e6f1b276c

+ 4 - 1
src/store/case.ts

@@ -310,8 +310,11 @@ export const getTipsList = (key) =>
     }
   });
 
-  export const getGaoDeGaoDeList = (key) =>{
+  export const getGaoDeGaoDeList = (key,type=1) =>{
     let url = `https://restapi.amap.com/v3/place/text?keywords=${key}&page=1&offset=5&output=JSON&key=3609daa52e8ae4493393292213e2fb98`
+    if(type != 1){
+      url = `https://restapi.amap.com/v3/geocode/regeo?location=${key}&&radius=1000&extensions=all&key=3609daa52e8ae4493393292213e2fb98`
+    }
     return axios.post('/fusion/notAuth/forwardReq',  { 
           "method":"get",
           url,

+ 8 - 4
src/view/case/draw/selectMapleaftImages.vue

@@ -76,7 +76,6 @@ var Gaode = L.tileLayer.chinaProvider("GaoDe.Normal.Map", {
   minZoom: 5,
 });
 var baseLayers = {
-  [ui18n.t("coord.edit.ggmap")]: '',
   [ui18n.t("coord.edit.gmap")]: Gaode,
 };
 
@@ -141,15 +140,20 @@ if(!isGoogle.value){
     });
     clickMarker.addTo(map);
   }
+  console.log("baseLayers", baseLayers);
   L.control.layers(baseLayers, null).addTo(map);
-  map.on("click", function (e) {
+  map.on("click", async function (e) {
     // 获取点击位置的经纬度坐标
+    console.log("click", e);
     var latitude = e.latlng.lat;
     var longitude = e.latlng.lng;
     console.log("click", e, [longitude, latitude]);
-
+    let ress = await getGaoDeGaoDeList(`${longitude},${latitude}`, 2)
+    let data = ress.data && JSON.parse(ress.data) || {};
+    console.log("click",data, ress);
+    let formatted_address = data.regeocode && data.regeocode.formatted_address || "";
     searchInfo.value = {
-      text: "",
+      text: formatted_address.length ? formatted_address : "",
       lat: latitude,
       lng: longitude,
       zoom: 0,

+ 11 - 11
src/view/mediaLibrary/TableComponent.vue

@@ -507,7 +507,15 @@ const handleuploadAdd = async () => {
       .then(async (res) => {
         console.log("上传进度", res);
         if (res.data?.status != -1) {
-          getFileStatus(res.data.id, loading);
+          loading.close();
+          windowOpen({type: 'event', data: 'menu-enabled'})
+          initData();
+          dialogData.value.show = false;
+          ElMessage({
+            type: "success",
+            message: res.data?.status == 0 ? ui18n.t("record.backRun"):ui18n.t("mediaLibrary.tips.uplooadSuccess"),
+          });
+          getFileStatus(res.data.id);
         } else {
           ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadErr"));
         }
@@ -519,21 +527,13 @@ const handleuploadAdd = async () => {
     console.log(formData);
   }
 };
-const getFileStatus = (id, loading) => {
+const getFileStatus = (id) => {
   getUploadProcess(id).then((res) => {
-    console.log("getFileStatus", res);
     if(res.percent == 100){
-        loading.close();
-        windowOpen({type: 'event', data: 'menu-enabled'})
         initData();
-        dialogData.value.show = false;
-        ElMessage({
-          type: "success",
-          message: res.data?.status == 0 ? ui18n.t("record.backRun"):ui18n.t("mediaLibrary.tips.uplooadSuccess"),
-        });
     }else{
       setTimeout(()=>{
-        getFileStatus(id, loading)
+        getFileStatus(id)
       },1000)
     }
   });