Sfoglia il codice sorgente

[Mod 0000]矿端首页增加公司名称

wangkeyi 3 settimane fa
parent
commit
2776f8a05c

BIN
src/assets/images/sealedGoaf/title-bg.png


+ 39 - 2
src/views/dashboard/SealedGoaf/index.vue

@@ -1,6 +1,16 @@
 <!-- eslint-disable vue/multi-word-component-names -->
 <template>
   <div class="company-home">
+
+    <template v-if="appStore.getSimpleMapParams.isLeaf" >
+      <div class="company-title">
+        <span class="title-text">
+          <!-- {{ departName }}  -->
+          <!-- 先注释掉,写死name -->
+          XX集团神木XX矿业有限公司
+        </span>
+      </div>
+    </template>
     <!-- 渲染所有模块 -->
     <ModulePrimary
       v-for="cfg in cfgs"
@@ -31,12 +41,13 @@
   import ModulePrimary from '/@/components/Configurable/ModulePrimary.vue';
   import { useGlobSetting } from '/@/hooks/setting';
   import { useAppStore } from '/@/store/modules/app';
-  // import { useMineDepartmentStore } from '/@/store/modules/mine';
+  import { useMineDepartmentStore } from '/@/store/modules/mine';
 
   const { title = '老空区永久密闭监测与分析系统' } = useGlobSetting();
   const { data, updateData } = useInitPage(title);
   const appStore = useAppStore();
-  // const mineStore = useMineDepartmentStore();
+  const mineStore = useMineDepartmentStore();
+  let departName = '';
 
   const cfgs = computed(() => configs.value);
   const { configs } = useInitConfigs();
@@ -183,6 +194,12 @@
       if (params.isLeaf) {
         fetchLeafData();
         configs.value = testConfigSealedMine; // 解构触发响应式更新
+
+        const depart = mineStore.findDepartById(params.deptId, mineStore.getDepartTree);
+       if (depart) {
+          departName = depart.departName;
+          console.log('自动填充矿区名称:', depart.departName);
+        }
       } else {
         fetchHomeData();
         configs.value = testConfigSealedGoaf; // 解构触发响应式更新
@@ -216,6 +233,26 @@
     // 允许点击穿透以支持下面的地图进行交互
     pointer-events: none;
   }
+  .company-title {
+    position: absolute;
+    background-image: url(/src/assets/images/sealedGoaf/title-bg.png);
+    background-repeat: no-repeat;
+    background-size: 100% 100%;
+    width: 230px;
+    height: 52px;
+    left: 230px;
+    padding: 14px 20px;
+
+    .title-text {
+      /* 子元素负责文本溢出处理 */
+      display: block;
+      width: 100%;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      text-align: center; /* 根据需求调整对齐方式 */
+    }
+  }
 
   :deep(.ant-select-selection-item) {
     display: flex;

+ 1 - 1
src/views/system/cadFile/app.ts

@@ -67,7 +67,7 @@ export const initMap2d = async (container: HTMLElement, config: { fileUrl?: stri
   map = new vjmap.Map({
     container, // DIV容器ID
     style: svc.rasterStyle(), // 样式,这里是栅格样式
-    center: { lng: -0.9509370605581751, lat: -0.37209374623643043 }, // 设置地图中心点
+    center: { lng: -0.9509370605581751, lat: -0.3509374623643043 }, // 设置地图中心点
     // center: prj.toLngLat(mapExtent.center()), // 设置地图中心点
     zoom: 11, // 设置地图缩放级别
     // zoom: 1, // 设置地图缩放级别