gemercheung преди 1 година
родител
ревизия
6e6d1b47d9
променени са 9 файла, в които са добавени 131 реда и са изтрити 94 реда
  1. 7 1
      .env
  2. 7 1
      .env.development
  3. 7 1
      .env.production
  4. 4 1
      src/app/map/App.vue
  5. 3 1
      src/app/map/company-select/organization.ts
  6. 7 0
      src/core/Scene.js
  7. 1 1
      src/core/box/object/PureTextLabel.js
  8. 1 1
      src/view/case/addCaseFile.vue
  9. 94 87
      vite.config.ts

+ 7 - 1
.env

@@ -1 +1,7 @@
-SEVER_URL="https://192.168.0.25"
+VITE_SEVER_URL="https://192.168.0.25"
+VITE_DEVCODE_URL="https://192.168.0.25/code"
+VITE_SWKK_URL="https://test.4dkankan.com"
+VITE_SERVICE_URL="https://test.4dkankan.com"
+VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
+VITE_LASER_URL="https://uat-laser.4dkankan.com"
+VITE_FDKK_URL="https://laser.4dkankan.com"

+ 7 - 1
.env.development

@@ -1 +1,7 @@
-SEVER_URL="https://192.168.0.25"
+VITE_SEVER_URL="https://192.168.0.25"
+VITE_DEVCODE_URL="https://192.168.0.25/code"
+VITE_SWKK_URL="https://test.4dkankan.com"
+VITE_SERVICE_URL="https://test.4dkankan.com"
+VITE_SWSS_URL="https://uat-laser.4dkankan.com/uat"
+VITE_LASER_URL="https://uat-laser.4dkankan.com"
+VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"

+ 7 - 1
.env.production

@@ -1 +1,7 @@
-SEVER_URL="https://192.168.0.25"
+VITE_SEVER_URL="https://192.168.0.25"
+VITE_DEVCODE_URL="https://192.168.0.25/code"
+VITE_SWKK_URL="https://4dkankan.com"
+VITE_SERVICE_URL="https://4dkankan.com"
+VITE_SWSS_URL="https://laser.4dkankan.com/"
+VITE_LASER_URL="https://laser.4dkankan.com"
+VITE_FDKK_URL="https://uat-laser.4dkankan.com/uat"

+ 4 - 1
src/app/map/App.vue

@@ -111,10 +111,13 @@ const request = axios.create({
 const mapEl = ref<HTMLDivElement>();
 let AMap, map;
 
+const queryURL = `${import.meta.env.VITE_SEVER_URL}/fusion-xj/web/fireProject/queryProject`
+
+// debugger;
 const getDataQuest = () => {
   return new Promise(async (reslove, reject) => {
     const res = await request.post(
-      "https://xj-mix3d.4dkankan.com/fusion-xj/web/fireProject/queryProject",
+      queryURL,
       {
         pageNum: 1,
         pageSize: 10000,

+ 3 - 1
src/app/map/company-select/organization.ts

@@ -8,8 +8,10 @@ import {
 import { useUrlSearchParams } from "@vueuse/core";
 const params = useUrlSearchParams("history");
 console.log("params", params.deptId);
+
+
 const request = axios.create({
-  baseURL: 'https://xj-mix3d.4dkankan.com/',
+  baseURL: `${import.meta.env.VITE_SEVER_URL}/`,
   timeout: 1000,
   headers: {
     share: 1,

+ 7 - 0
src/core/Scene.js

@@ -236,6 +236,13 @@ export default class Scene extends Mitt {
     }
   }
 
+  test1() {
+    const object = this.boxManager.model;
+    for (var i = 0; i <= object; i++) {
+      console.log(object[i]);
+    }
+  }
+
   onBindEvent = () => {
     //window.addEventListener('resize', this.onResize)
   };

+ 1 - 1
src/core/box/object/PureTextLabel.js

@@ -19,7 +19,7 @@ export default class PureTextLabel extends THREE.Mesh {
     let fs = 12 * res * radio;
     var context = canvas.getContext("2d");
 
-    const lines = getWrapText(context, text, 158);
+    const lines = getWrapText(context, text, 140);
     console.log("lines", lines);
     containerHeight = containerHeight * lines.length;
     canvas.height = height * lines.length;

+ 1 - 1
src/view/case/addCaseFile.vue

@@ -13,7 +13,7 @@
         :disabled="!!file"
         :before-upload="upload"
         :file-list="fileList"
-        :http-request="() => {}"
+        :http-request="async() => {}"
         :on-preview="previewFile"
         :accept="accept"
         :before-remove="removeFile"

+ 94 - 87
vite.config.ts

@@ -1,4 +1,4 @@
-import { defineConfig } from "vite";
+import { defineConfig, loadEnv } from "vite";
 import vue from "@vitejs/plugin-vue";
 import { resolve } from "path";
 import ElementPlus from "unplugin-element-plus/vite";
@@ -9,96 +9,103 @@ if (process.argv.length > 3) {
   app = process.argv[process.argv.length - 1].trim();
 }
 
-const dev = true;
+// const dev = true;
 // const devUrl = "https://xj-mix3d.4dkankan.com"
-const devUrl = "https://192.168.0.25"
+// const devUrl = "https://192.168.0.25"
 
-
-export default defineConfig({
-  define: {
-    VITE_APP_APP: JSON.stringify(app),
-  },
-  base: "./",
-  build: {
-    rollupOptions: {
-      input: {
-        index: resolve(__dirname, "index.html"),
-        map: resolve(__dirname, "map.html"),
-        mirror: resolve(__dirname, "mirror.html"),
-        // 在这里继续添加更多页面
-      },
+export default ({ mode }: any) =>
+  defineConfig({
+    define: {
+      VITE_APP_APP: JSON.stringify(app),
     },
-    outDir: `dist/${app}`,
-  },
-  resolve: {
-    alias: [
-      {
-        find: "@",
-        replacement: resolve(__dirname, "./src"),
+    base: "./",
+    build: {
+      rollupOptions: {
+        input: {
+          index: resolve(__dirname, "index.html"),
+          map: resolve(__dirname, "map.html"),
+          mirror: resolve(__dirname, "mirror.html"),
+          // 在这里继续添加更多页面
+        },
       },
+      outDir: `dist/${app}`,
+    },
+    resolve: {
+      alias: [
+        {
+          find: "@",
+          replacement: resolve(__dirname, "./src"),
+        },
+      ],
+    },
+    plugins: [
+      vue(),
+      ElementPlus({
+        useSource: true,
+      }),
     ],
-  },
-  plugins: [
-    vue(),
-    ElementPlus({
-      useSource: true,
-    }),
-  ],
-  server: {
-    port: 5173,
-    host: "0.0.0.0",
-    proxy: {
-      "/api": {
-        secure: false,
-        target: dev ? devUrl : "mix3d.4dkankan.com",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(new RegExp(`^/api`), ""),
-      },
-      "/fusion-xj": {
-        secure: false,
-        target: dev ? devUrl : "mix3d.4dkankan.com",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(new RegExp(`^/api`), "/fusion-xj"),
-      },
-      "/dev-code": {
-        // target: "https://localhost:7173/",
-        target: dev
-          ? "https://xj-mix3d.4dkankan.com/code"
-          : "https://mix3d.4dkankan.com/code",
-        changeOrigin: true,
-        secure: false,
-        rewrite: (path) => path.replace(new RegExp(`^/dev-code`), ""),
-      },
-      "/swkk": {
-        target: dev ? "https://test.4dkankan.com" : "https://www.4dkankan.com",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(new RegExp(`^/swkk`), ""),
-      },
-      "/service": {
-        target: dev ? "https://test.4dkankan.com" : "https://www.4dkankan.com",
-        changeOrigin: true,
-      },
-      "/swss": {
-        target: dev
-          ? "https://uat-laser.4dkankan.com/uat"
-          : "https://laser.4dkankan.com",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(new RegExp(`^/swss`), ""),
-      },
-      "/laser": {
-        target: dev
-          ? "https://uat-laser.4dkankan.com"
-          : "https://laser.4dkankan.com",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(new RegExp(`^/laser`), "/laser"),
-      },
-      "/fdkk": {
-        target: dev
-          ? "https://uat-laser.4dkankan.com/uat"
-          : "https://laser.4dkankan.com",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(new RegExp(`^/fdkk`), "/fdkk"),
+    server: {
+      port: 5173,
+      host: "0.0.0.0",
+      proxy: {
+        "/api": {
+          secure: false,
+          // target: dev ? devUrl : "mix3d.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_SEVER_URL,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(new RegExp(`^/api`), ""),
+        },
+        "/fusion-xj": {
+          secure: false,
+          // target: dev ? devUrl : "mix3d.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_SEVER_URL,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(new RegExp(`^/api`), "/fusion-xj"),
+        },
+        "/dev-code": {
+          target: loadEnv(mode, process.cwd()).VITE_DEVCODE_URL,
+          // target: dev
+          //   ? "https://xj-mix3d.4dkankan.com/code"
+          //   : "https://mix3d.4dkankan.com/code",
+          changeOrigin: true,
+          secure: false,
+          rewrite: (path) => path.replace(new RegExp(`^/dev-code`), ""),
+        },
+        "/swkk": {
+          // target: dev ? "https://test.4dkankan.com" : "https://www.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_SWKK_URL,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(new RegExp(`^/swkk`), ""),
+        },
+        "/service": {
+          // target: dev ? "https://test.4dkankan.com" : "https://www.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_SERVICE_URL,
+          changeOrigin: true,
+        },
+        "/swss": {
+          // target: dev
+          //   ? "https://uat-laser.4dkankan.com/uat"
+          //   : "https://laser.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_SWSS_URL,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(new RegExp(`^/swss`), ""),
+        },
+        "/laser": {
+          // target: dev
+          //   ? "https://uat-laser.4dkankan.com"
+          //   : "https://laser.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_LASER_URL,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(new RegExp(`^/laser`), "/laser"),
+        },
+        "/fdkk": {
+          // target: dev
+          //   ? "https://uat-laser.4dkankan.com/uat"
+          //   : "https://laser.4dkankan.com",
+          target: loadEnv(mode, process.cwd()).VITE_FDKK_URL,
+          changeOrigin: true,
+          rewrite: (path) => path.replace(new RegExp(`^/fdkk`), "/fdkk"),
+        },
       },
     },
-  },
-});
+  });