瀏覽代碼

打包调整 迭代一

Hwf 9 月之前
父節點
當前提交
5d5c2fabe5

+ 1 - 1
.env.production

@@ -14,7 +14,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
 VITE_APP_SNAILJOB_ADMIN = '/snail-job'
 
 # 生产环境
-VITE_APP_BASE_API = '/prod-api'
+VITE_APP_BASE_API = 'http://10.181.7.236:9988'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

+ 8 - 8
index.html

@@ -6,14 +6,14 @@
     <meta name="renderer" content="webkit" />
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
 <!--    <link rel="icon" href="/favicon.ico" />-->
-    <link rel="stylesheet" href="./lib/mapbox/css/mapbox-gl.css" />
-    <link rel="stylesheet" href="./lib/mapbox/css/mapbox-gl-draw.css" />
-    <script src="./lib/mapbox/js/mapbox-gl.js"></script>
-    <script src="./lib/mapbox/js/mapbox-gl-draw.js"></script>
-    <script src="./lib/GeoGlobeSDK/GeoGlobeJS.min.js"></script>
-    <script src="./lib/GeoGlobeSDK/GeoGlobeJS.visuals.min.js"></script>
-    <script src="./lib/GeoGlobeSDK/GeoGlobeJS.extends.min.js"></script>
-    <script src="./lib/GeoGlobeSDK/GeoLevel.js"></script>
+    <link rel="stylesheet" href="/lib/mapbox/css/mapbox-gl.css" />
+    <link rel="stylesheet" href="/lib/mapbox/css/mapbox-gl-draw.css" />
+    <script src="/lib/mapbox/js/mapbox-gl.js"></script>
+    <script src="/lib/mapbox/js/mapbox-gl-draw.js"></script>
+    <script src="/lib/GeoGlobeSDK/GeoGlobeJS.min.js"></script>
+    <script src="/lib/GeoGlobeSDK/GeoGlobeJS.visuals.min.js"></script>
+    <script src="/lib/GeoGlobeSDK/GeoGlobeJS.extends.min.js"></script>
+    <script src="/lib/GeoGlobeSDK/GeoLevel.js"></script>
     <script src="/h5player.min.js"></script>
     <script src="/Decoder.js"></script>
 

+ 5 - 5
src/components/Map/index2.vue → src/components/Map/YMap.vue

@@ -17,7 +17,7 @@
     </div>
   </div>
 </template>
-<script setup lang="ts">
+<script setup lang="ts" name="YMap">
 import WMTSManager from "@/utils/wmtsManager";
 import QuickZoom from "@/components/Map/quickZoom.vue";
 import { reactive } from "vue";
@@ -75,10 +75,10 @@ const initMapEvent = () => {
     layer_cva.metadata = { group: 'basemap' };
     map.addLayer(layer_vtc);
     map.addLayer(layer_cva);
-    // if (props.activeMap !== 'vectorgraph') {
-    //   removeLayers();
-    //   switchMap(props.activeMap);
-    // }
+    if (props.activeMap !== 'vectorgraph') {
+      removeLayers();
+      switchMap(props.activeMap);
+    }
   });
 };
 // 切换地图

+ 0 - 325
src/components/Map/gdIndex.vue

@@ -1,325 +0,0 @@
-<template>
-  <div class="map-container">
-    <div id="yztMap" class="map-container"></div>
-    <!-- 右下工具  -->
-    <div v-show="mapState.showScale" class="zoom-text">{{ mapState.zoom }}级</div>
-    <div class="right-tool">
-      <!-- 快捷缩放 -->
-      <QuickZoom :step="mapState.zoom" :min-step="mapState.minZoom" :max-step="mapState.maxZoom" @change-step="setMapZoom" />
-      <div class="flex" style="margin-top: 5px">
-        <div class="model-btn" @click="switchThreeDimensional">{{ mapState.isThreeDimensional ? '3D' : '2D' }}</div>
-        <div class="model-btn" style="margin-left: 5px" @click="changeScaleControl">尺</div>
-      </div>
-      <!-- 测距工具 -->
-      <div class="model-btn" @click="toggleRangingTool">
-        {{ isRanging ? '关闭测距' : '开启测距' }}
-      </div>
-    </div>
-  </div>
-</template>
-
-<script setup lang="ts">
-import { onMounted, onUnmounted, reactive, watch, defineProps, withDefaults, ref } from 'vue';
-import AMapLoader from '@amap/amap-jsapi-loader';
-import QuickZoom from './quickZoom.vue';
-
-interface Props {
-  activeMap: string;
-}
-
-const props = withDefaults(defineProps<Props>(), {});
-
-const mapState = reactive({
-  center: [110.93154257997, 21.669064031332],
-  zoom: 9,
-  minZoom: 6,
-  maxZoom: 16,
-  isThreeDimensional: false,
-  // 是否显示比例尺
-  showScale: true
-});
-
-let map, scale, nowLayer, ruler;
-const isRanging = ref(false);
-
-watch(
-  () => props.activeMap,
-  (value, oldValue) => {
-    if (!['logical', 'vectorgraph'].includes(props.activeMap)) {
-      switchMap(props.activeMap);
-    } else {
-      map.removeLayer(nowLayer);
-    }
-  }
-);
-
-// 初始化事件
-const initMap = () => {
-  AMapLoader.load({
-    key: '30d3d8448efd68cb0b284549fd41adcf', // 申请好的Web端开发者Key,首次调用 load 时必填
-    version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-    plugins: ['AMap.Scale', 'AMap.RangingTool']
-  }).then((AMap) => {
-    map = new AMap.Map('yztMap', {
-      // 是否为3D地图模式
-      viewMode: '3D',
-      pitch: mapState.isThreeDimensional ? 45 : 0,
-      // 初始化地图级别
-      zoom: mapState.zoom,
-      // 初始化地图中心点位置
-      center: [mapState.center[0], mapState.center[1]],
-      // 是否可拖拽
-      dragEnable: true,
-      // 是否允许通过鼠标滚轮来缩放
-      scrollWheel: true
-    });
-
-    if (!['logical', 'vectorgraph'].includes(props.activeMap)) {
-      switchMap(props.activeMap);
-    } else {
-      map.removeLayer();
-    }
-
-    scale = new AMap.Scale();
-    if (mapState.showScale) {
-      map.addControl(scale);
-    }
-
-    // 自定义测距工具样式
-    const startMarkerOptions = {
-      icon: new AMap.Icon({
-        size: new AMap.Size(19, 31), // 图标大小
-        imageSize: new AMap.Size(19, 31),
-        image: '//webapi.amap.com/theme/v1.3/markers/b/start.png'
-      }),
-      offset: new AMap.Pixel(-9, -31)
-    };
-    const endMarkerOptions = {
-      icon: new AMap.Icon({
-        size: new AMap.Size(19, 31), // 图标大小
-        imageSize: new AMap.Size(19, 31),
-        image: '//webapi.amap.com/theme/v1.3/markers/b/end.png'
-      }),
-      offset: new AMap.Pixel(-9, -31)
-    };
-    const midMarkerOptions = {
-      icon: new AMap.Icon({
-        size: new AMap.Size(19, 31), // 图标大小
-        imageSize: new AMap.Size(19, 31),
-        image: '//webapi.amap.com/theme/v1.3/markers/b/mid.png'
-      }),
-      offset: new AMap.Pixel(-9, -31)
-    };
-    const lineOptions = {
-      strokeStyle: 'solid',
-      strokeColor: '#FF33FF',
-      strokeOpacity: 1,
-      strokeWeight: 2
-    };
-    const rulerOptions = {
-      startMarkerOptions: startMarkerOptions,
-      midMarkerOptions: midMarkerOptions,
-      endMarkerOptions: endMarkerOptions,
-      lineOptions: lineOptions
-    };
-
-    // 初始化自定义样式测距工具
-    ruler = new AMap.RangingTool(map, rulerOptions);
-
-    map.on('zoomchange', zoomChangeHandler);
-  });
-};
-
-// 切换测距工具状态
-const toggleRangingTool = () => {
-  if (ruler) {
-    if (isRanging.value) {
-      ruler.turnOff(); // 关闭测距工具
-    } else {
-      ruler.turnOn(); // 启动测距工具
-    }
-    isRanging.value = !isRanging.value; // 切换状态
-  }
-};
-
-// 切换地图
-const switchMap = (type) => {
-  mapState.zoom = 11;
-  if (type === 'satellite') {
-    const satellite = new AMap.TileLayer.Satellite();
-    map.addLayer(satellite);
-    nowLayer = satellite;
-  } else if (type === 'satellite2') {
-    let queryParamsArr = [
-      {
-        serviceCode: 'YZT1715739306532'
-      },
-      {
-        serviceCode: 'YZT1695608158269',
-        REQUEST: 'GetCapabilities'
-      }
-    ];
-    console.log(queryParamsArr[0].serviceCode);
-    var wms = new AMap.TileLayer.WMTS({
-      // url: 'http://t0.tianditu.gov.cn/img_c/wmts',
-      url: 'http://10.181.7.236:9988/api/oneShare/proxyHandler/mm/' + queryParamsArr[0].serviceCode,
-      // blend: true,
-      tileSize: 256,
-      params: {
-        // Layer: "img",
-        // Version: "1.0.0",
-        // Format: "tiles",
-        // TileMatrixSet: "w",
-        // STYLE: "default",
-        // tk: 'd31190edaa4190af833234ab7b1a6f27'
-        SERVICE: 'WMTS',
-        // REQUEST: 'GetTile',
-        VERSION: '1.0.0',
-        LAYER: 'gds_2m_kj202401',
-        STYLE: 'default',
-        // TILEMATRIXSET: 'default028mm',
-        // TILEMATRIX: '9',
-        // TILEROW: '97',
-        // TILECOL: '413',
-        Format: 'image/jpgpng'
-      }
-    });
-    wms.setMap(map);
-  }
-};
-
-// 缩放级别变化
-const zoomChangeHandler = (event) => {
-  mapState.zoom = map.getZoom();
-};
-
-// 切换比例尺
-const changeScaleControl = () => {
-  mapState.showScale = !mapState.showScale;
-  if (mapState.showScale) {
-    map.addControl(scale);
-  } else {
-    map.removeControl(scale);
-  }
-};
-
-// 设置地图层级
-const setMapZoom = (value) => {
-  if (!map) return;
-  if (value === 1) {
-    map.setCenter([113.280637, 23.125178]);
-    map.setZoom(7);
-  } else if (value === 2) {
-    map.setCenter([110.93154257997, 21.6690640313328]);
-    map.setZoom(11);
-  } else if (value === 3) {
-    map.setCenter([110.93154257997, 21.669064031332]);
-    map.setZoom(12);
-  } else if (value === 4) {
-    map.setCenter([110.93154257997, 21.669064031332]);
-    map.setZoom(15);
-  } else if (value === 5) {
-    map.setCenter([110.93154257997, 21.669064031332]);
-    map.setZoom(16);
-  }
-};
-
-// 切换2D、3D
-const switchThreeDimensional = () => {
-  mapState.isThreeDimensional = !mapState.isThreeDimensional;
-  const pitch = mapState.isThreeDimensional ? 45 : 0;
-  map.setPitch(pitch);
-};
-
-// 加载事件
-onMounted(() => {
-  initMap();
-});
-
-// 卸载事件
-onUnmounted(() => {
-  if (map) {
-    map.off('zoomchange', zoomChangeHandler);
-  }
-});
-</script>
-
-<style scoped>
-.map-container {
-  width: 100%;
-  height: 100%;
-  position: relative;
-  .zoom-text {
-    position: absolute;
-    bottom: 8px;
-    right: 75px;
-    font-size: 14px;
-  }
-  .right-tool {
-    position: absolute;
-    bottom: 50px;
-    right: 5px;
-  }
-  .model-btn {
-    background-color: #022577;
-    font-size: 14px;
-    color: #889ee9;
-    cursor: pointer;
-    padding: 3px 3px;
-    border-radius: 5px;
-  }
-  :deep(.amap-scalecontrol) {
-    left: unset !important;
-    background-color: unset !important;
-    right: 74px;
-  }
-  :deep(.amap-scale-text) {
-    width: 230px !important;
-    text-align: left !important;
-    font-size: 14px;
-    padding-left: 20px;
-  }
-  :deep(.amap-scale-middle) {
-    width: 228px !important;
-  }
-  :deep(.amap-scale-edgeright) {
-    left: 228px !important;
-  }
-  :deep(.amap-logo),
-  :deep(.amap-copyright) {
-    display: none !important;
-  }
-  /* 自定义测距工具样式 */
-  :deep(.amap-ranger) {
-    background-color: #ffffff;
-    border: 1px solid #888888;
-    border-radius: 5px;
-    padding: 5px;
-  }
-
-  :deep(.amap-ranger .amap-toolbar) {
-    color: #333;
-    font-size: 12px;
-    padding: 5px;
-  }
-
-  :deep(.amap-ranger .amap-toolbar button) {
-    background-color: #022577;
-    color: #fff;
-    border: none;
-    border-radius: 4px;
-    padding: 5px;
-    margin-right: 5px;
-    cursor: pointer;
-  }
-
-  :deep(.amap-ranger .amap-toolbar button:hover) {
-    background-color: #1a3c75;
-  }
-
-  :deep(.amap-ranger .amap-toolbar .amap-toolbar-text) {
-    color: #444;
-    font-size: 14px;
-  }
-}
-</style>

+ 1 - 1
src/components/Map/index.vue

@@ -18,7 +18,7 @@
   </div>
 </template>
 
-<script setup lang="ts">
+<script setup lang="ts" name="Map">
 import { onMounted, onUnmounted, reactive, watch, defineProps, withDefaults, ref } from 'vue';
 import AMapLoader from '@amap/amap-jsapi-loader';
 import QuickZoom from './quickZoom.vue';

+ 2 - 2
src/router/index.ts

@@ -1,4 +1,4 @@
-import { createWebHistory, createRouter, RouteRecordRaw } from 'vue-router';
+import { createWebHashHistory, createRouter, RouteRecordRaw } from 'vue-router';
 /* Layout */
 import Layout from '@/layout/index.vue';
 
@@ -94,7 +94,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [];
  * 创建路由
  */
 const router = createRouter({
-  history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
+  history: createWebHashHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
   routes: constantRoutes,
   // 刷新时,滚动条位置还原
   scrollBehavior(to, from, savedPosition) {

+ 10 - 10
src/views/emergencyCommandMap/LeftSection.vue

@@ -9,13 +9,13 @@
         </div>
       </div>
       <div class="card-content">
-        <div style="line-height: 80px">事件名称:{{ eventInformation.name }}</div>
-        <div style="line-height: 80px">事件类型:{{ eventInformation.type }}</div>
-        <div style="line-height: 80px">事件等级:{{ eventInformation.grade }}</div>
-        <div style="line-height: 80px">事件地点:{{ eventInformation.address }}</div>
-        <div style="line-height: 80px">事件状态:{{ eventInformation.status }}</div>
-        <div style="line-height: 80px">上报时间:{{ eventInformation.time }}</div>
-        <div style="line-height: 80px">报送单位:{{ eventInformation.unit }}</div>
+        <div style="line-height: 70px">事件名称:{{ eventInformation.name }}</div>
+        <div style="line-height: 70px">事件类型:{{ eventInformation.type }}</div>
+        <div style="line-height: 70px">事件等级:{{ eventInformation.grade }}</div>
+        <div style="line-height: 70px">事件地点:{{ eventInformation.address }}</div>
+        <div style="line-height: 70px">事件状态:{{ eventInformation.status }}</div>
+        <div style="line-height: 70px">上报时间:{{ eventInformation.time }}</div>
+        <div style="line-height: 70px">报送单位:{{ eventInformation.unit }}</div>
       </div>
     </div>
     <div class="card" style="height: 435px">
@@ -23,12 +23,12 @@
         <div>综合值守</div>
       </div>
       <div class="card-content">
-        <div style="line-height: 80px">值班时间:{{ comprehensiveDutyState.time }}</div>
-        <div class="card-flex" style="line-height: 80px">
+        <div style="line-height: 70px">值班时间:{{ comprehensiveDutyState.time }}</div>
+        <div class="card-flex" style="line-height: 70px">
           <div>带班领导:{{ comprehensiveDutyState.classLeader }}</div>
           <div>副班人员:{{ comprehensiveDutyState.deputyShiftPerson }}</div>
         </div>
-        <div class="card-flex" style="line-height: 80px">
+        <div class="card-flex" style="line-height: 70px">
           <div>主班领导:{{ comprehensiveDutyState.mainShiftPerson }}</div>
           <div>备班领导:{{ comprehensiveDutyState.backupPerson }}</div>
         </div>

+ 1 - 1
src/views/globalMap/index.vue

@@ -14,7 +14,7 @@
 
 <script lang="ts" setup>
 import Map from '@/components/Map/index.vue';
-import YMap from '@/components/Map/index2.vue';
+import YMap from '@/components/Map/YMap.vue';
 import MapLogical from '@/components/Map/MapLogical.vue';
 import { logicalData } from './data/mapData';
 import SwitchMapTool from '@/views/globalMap/SwitchMapTool.vue';