guonan
2025-07-08 79f9b20e2661a560604e78a8e277eb5775747443
提交
已修改6个文件
80 ■■■■■ 文件已修改
src/api/hpApi.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/requestTR.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/monifangzhen/schemeCard.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tools/LayerTree.vue 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/map.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/hpApi.js
@@ -238,7 +238,7 @@
export async function getSafePoint(data) {
  const response = await axios.get("/hp/safeHavenLocation/getDataSelect", {
    params: {
      divisionId: data
      divisionId: 110116110218
    }
  });
  return response.data;
src/api/requestTR.js
@@ -1,25 +1,13 @@
import axios from "axios";
// 判断当前是否是开发环境
let API_URL;
if (process.env.NODE_ENV === 'development') {
  // 开发环境使用 '/api'
  API_URL = '/api';
} else {
  // 生产环境使用实际的配置地址
  API_URL = `${BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL}/api`;
}
// 创建 Axios 实例
const instance = axios.create({
  baseURL: API_URL,
  // timeout: 1000 * 60, // 请求超时时间(单位:毫秒)
  baseURL: "/api", // 使用你配置的 /auth 代理
  timeout: 1000 * 60, // 请求超时时间(单位:毫秒)
  headers: {
    "Content-Type": "application/x-www-form-urlencoded", // 默认请求头
    "Content-Type": "application/x-www-form-urlencoded", // 默认请求头application/json
  },
});
// 请求拦截器
// instance.interceptors.request.use(
//   (config) => {
src/components/monifangzhen/schemeCard.vue
@@ -221,7 +221,7 @@
        item.result == "创建仿真" ||
        item.result == "完成" ||
        item.result == "-1" ||
        item.result == "停止" ||
        item.result == "已停止" ||
        item.result == "运行中"
    );
    simAPIStore.shouldPoll = !shouldStop; // 修改 Pinia 状态
src/components/tools/LayerTree.vue
@@ -14,7 +14,12 @@
<script setup>
import { ref, onMounted, watch, nextTick, onUnmounted, watchEffect } from "vue";
import { createPoint, removeEntities, addTileset } from "@/utils/map";
import {
  createPoint,
  removeEntities,
  addTileset,
  clearAllPoints,
} from "@/utils/map";
import { deviceDictList, getDictName } from "@/constant/dict.js";
import { useRoute } from "vue-router";
import {
@@ -76,7 +81,7 @@
  try {
    TerrainLayer = await earthCtrl.factory.createTerrainLayer({
      sourceType: "ctb",
      url: "http://106.120.22.26:9103/gisserver/ctsserver/sunhugoudem84",
      url: "http://106.120.22.26:9103/gisserver/ctsserver/sunhugoudem",
      requestVertexNormals: true,
    });
    treeMap.set("地形数据", TerrainLayer);
@@ -238,9 +243,7 @@
  const list = treeMap.get(layerName);
  if (list && Array.isArray(list)) {
    list.forEach((entity) => {
      if (viewer.entities.contains(entity)) {
        viewer.entities.remove(entity);
      }
      clearAllPoints();
    });
  }
  treeMap.delete(layerName);
@@ -253,17 +256,14 @@
  if (simStore.DeviceShowSwitch) {
    const deviceList = simStore.devices
      .filter((item) => item.deviceName?.includes("孙胡沟"))
      .map((item) => {
        const entity = createPoint({
          ...item,
          type: getDictName(deviceDictList, item.dictDeviceType),
          name: item.deviceName.split("孙胡沟")[1],
          id: item.deviceId,
          className: "device",
          showLabel: true,
        });
        entity.show = true;
        return entity;
      .map(async (item) => {
        const entity = viewer.entities.getById(item.deviceId);
        item.type = getDictName(deviceDictList, item.dictDeviceType);
        item.name = item.deviceName.split("孙胡沟")[1];
        item.id = item.deviceId;
        item.className = "device";
        item.showLabel = true;
        await createPoint(item);
      });
    if (deviceList.length) {
@@ -279,18 +279,16 @@
  if (simStore.DangerShowSwitch) {
    const dangerPoints = simStore.DangerPoint.filter((item) =>
      item.position?.includes("孙胡沟")
    ).map((item) => {
      const entity = createPoint({
        id: item.hdId,
        name: item.hdName,
        latitude: item.lat,
        longitude: item.lon,
        showBillboard: true,
        type: item.disasterType,
        className: "district",
      });
      entity.show = true;
      return entity;
    ).map(async (item) => {
      const entity = viewer.entities.getById(item.hdId);
      item.id = item.hdId;
      item.name = item.hdName;
      item.latitude = item.lat;
      item.longitude = item.lon;
      item.showBillboard = true;
      item.type = item.disasterType;
      item.className = "district";
      await createPoint(item);
    });
    if (dangerPoints.length) {
@@ -325,6 +323,7 @@
 */
function addTetrahedron() {
  getSafePoint().then((res) => {
    console.log(res,'resresresres')
    const geoJsonData = convertToGeoJson(res.data); // 转换为 GeoJSON
    // 加载 GeoJSON 数据到地图
    loadAreaPolygon(geoJsonData, true).then((entities) => {
src/utils/map.js
@@ -196,6 +196,7 @@
    if (Cesium.defined(picked) && id) {
      const entity = picked?.id;
      console.log(entity.attrs, 'attrsattrsattrs')
      if (entity && entity.className) {
        showDeviceDetail.value = true;
        deviceDetail.value = entity.attrs;
vue.config.js
@@ -30,7 +30,7 @@
        secure: false
      },
      '/hp': {
        target: 'http://192.168.56.106:9522',
        target: 'http://192.168.56.106:9533',
        changeOrigin: true,
        pathRewrite: {
          '^/hp': ''