Browse Source

修改环境

shuhao 4 months ago
parent
commit
a6900e6e61
7 changed files with 18 additions and 8 deletions
  1. 1 0
      .env
  2. 1 0
      .env.dev
  3. 1 0
      .env.pro
  4. 1 0
      package.json
  5. 1 1
      src/api/config.js
  6. 11 6
      src/views/authentic/index.vue
  7. 2 1
      vue.config.js

+ 1 - 0
.env

@@ -1 +1,2 @@
 SERVER = "http://127.0.0.1:81/"
+PYSERVER = "http://127.0.0.1:5000/"

+ 1 - 0
.env.dev

@@ -1 +1,2 @@
 SERVER = "https://feiniaotech-dev.sysuimars.cn/"
+PYSERVER = "https://birds-api-1-2.sysuimars.cn/"

+ 1 - 0
.env.pro

@@ -1 +1,2 @@
 SERVER = "https://birdseye-api.feiniaotech.sysuimars.cn/"
+PYSERVER = "https://birds-api-1-2.sysuimars.cn/"

+ 1 - 0
package.json

@@ -5,6 +5,7 @@
   "scripts": {
     "serve": "vue-cli-service serve --mode dev",
     "serve2": "vue-cli-service serve --mode local",
+    "serve3": "vue-cli-service serve --mode pro",
     "build": "vue-cli-service build --mode pro",
     "build2": "vue-cli-service build --mode dev",
     "lint": "vue-cli-service lint"

+ 1 - 1
src/api/config.js

@@ -1,6 +1,6 @@
 let server = VE_ENV.SERVER
 let serverMock = "https://mock.apipark.cn/m1/4662471-4313509-default/"
-let pythonServe = "http://birds-api-1-2.sysuimars.cn/"
+let pythonServe = VE_ENV.PYSERVER
 // let djiCloudBase = "http://127.0.0.1/";
 let djiCloudBase = "https://djiapi.sysuimars.com/";
 

+ 11 - 6
src/views/authentic/index.vue

@@ -453,7 +453,7 @@ const onSuccess = (res) => {
         const geom = [{ featureWkt: res.data.geom, ...res.data }];
         authenticMap.setAreaGeometry(geom);
         authenticMap.fit([res.data.geom]);
-        updatePointList("upload");
+        updatePointList("upload",geom[0]);
         heightArr.value = res.data.height;
         const arr = pointList.value.map((item, index) => {
             return [...item, res.data.height[index]];
@@ -611,14 +611,19 @@ const getDetailsData = (id) => {
 };
 
 // 添加经纬度列表
-const updatePointList = (type) => {
-    const { geometryArr, area } = authenticMap.getAreaGeometry(type);
-    const lastItem = geometryArr[geometryArr.length - 1];
+const updatePointList = (type, geom) => {
+  const { geometryArr, area } = authenticMap.getAreaGeometry(type);
+  let lastItem = null
+    if(type === 'upload'){
+      lastItem = geom
+    }else{
+      lastItem = geometryArr[geometryArr.length - 1];
+    }
     formInline.geom = lastItem.featureWkt;
-    let result = parseMultiPolygon(lastItem.featureWkt);
+  debugger
+  let result = parseMultiPolygon(lastItem.featureWkt);
     result.pop();
     pointList.value = result;
-
     //判断是否是导入数据
     if (store.state.authentic.isEditStatus) {
         const arr = pointList.value.map((item, index) => {

+ 2 - 1
vue.config.js

@@ -58,7 +58,8 @@ module.exports = {
             {
                 VE_ENV: {
                     MODE: JSON.stringify(process.env.NODE_ENV),
-                    SERVER: JSON.stringify(process.env.SERVER)
+                    SERVER: JSON.stringify(process.env.SERVER),
+                    PYSERVER: JSON.stringify(process.env.PYSERVER)
                 },
             },
         ]);