Browse Source

新增编辑

tengmingxue 7 months ago
parent
commit
faa30367f2

+ 106 - 53
public/config.js

@@ -24,8 +24,7 @@ window.threeMapConfig = {
         roll: 3.108624468950438e-14
     },
     mapConfig: {
-        demUrl: '',//iserverConfig.baseUrl + 'services/3D-local3DCache-DEM0304/rest/realspace/datas/DEM0304',
-        // demUrl: 'http://221.182.8.141:16090/iserver/services/3D-local3DCache-wdqdem/rest/realspace/datas/wdq_dem',
+        demUrl: iserverConfig.baseUrl + 'services/3D-local3DCache-DEM0304/rest/realspace/datas/DEM0304',
         isSct: true,
         defaultView: {
             destination: {
@@ -41,29 +40,29 @@ window.threeMapConfig = {
         },
         //类型type  GD高德,BDBD百度本地,BD百度,GOOGLE谷歌,TX腾讯,SUPER超图,SUPER_3D超图三维,WEBP超图webp
         layers2D: [
-            // {
-            //     id: 'yx',
-            //     title: '天地图影像地图',
-            //     epsg: 4326,
-            //     show: true,
-            //     minimumLevel: 0,
-            //     maximumLevel: 18,
-            //     type: 'TDT',
-            //     url: [
-            //         'http://t{s}.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=15f7b01aababbb39ab568f4ba12ea21c',
-            //     ],
-            //     subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
-            // },
             {
                 id: 'yx',
                 title: '天地图影像地图',
                 epsg: 4326,
-                show: false,
+                show: true,
                 minimumLevel: 0,
                 maximumLevel: 18,
-                type: 'SUPER',
-                url: iserverConfig.baseUrl + 'services/map-ugcv5-YRGPGLOBALDOM2/rest/maps/YRGP_GLOBAL_DOM'
+                type: 'TDT',
+                url: [
+                    'http://t{s}.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=15f7b01aababbb39ab568f4ba12ea21c',
+                ],
+                subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
             },
+            // {
+            //     id: 'yx',
+            //     title: '天地图影像地图',
+            //     epsg: 4326,
+            //     show: false,
+            //     minimumLevel: 0,
+            //     maximumLevel: 18,
+            //     type: 'SUPER',
+            //     url: iserverConfig.baseUrl + 'services/map-ugcv5-YRGPGLOBALDOM2/rest/maps/YRGP_GLOBAL_DOM'
+            // },
             {
                 id: 'sl',
                 title: '天地矢量地图',
@@ -110,14 +109,14 @@ window.threeMapConfig = {
             },
         ],
         layers3D: [
-            {
-                id: 'db_model',
-                url: iserverConfig.baseUrl + 'services/3D-local3DCache-YRGPXLDDAM/rest/realspace',
-                height: 0,
-                flyTo: false,
-                show: false,
-                type: 'S3M',
-            },
+            // {
+            //     id: 'db_model',
+            //     url: iserverConfig.baseUrl + 'services/3D-local3DCache-YRGPXLDDAM/rest/realspace',
+            //     height: 0,
+            //     flyTo: false,
+            //     show: false,
+            //     type: 'S3M',
+            // },
             {
                 id: 'xldqxsy',   //小浪底倾斜摄影
                 url: iserverConfig.baseUrl + 'services/3D-XLDQXSY/rest/realspace',
@@ -141,7 +140,16 @@ window.threeMapConfig = {
                 flyTo: true,
                 show: false,
                 type: 'S3M',
-            }
+            },
+            
+            {
+                id: 'DEM0304',  //地形DEM
+                url: iserverConfig.baseUrl + 'services/3D-BIM_XLD_L2_DZCFDQSJ_202205/rest/realspace',
+                height: 0,
+                flyTo: true,
+                show: false,
+                type: 'S3M',
+            },
         ],
         asyncLayer3D: [
 
@@ -150,35 +158,68 @@ window.threeMapConfig = {
     // 图层树
     layerControl: [
         {
-            title: "小浪底",
-            key: "xld",
+            title: "基础底图",
+            key: "basic_map",
             children: [],
             disabled: true,
             isLeaf: false
         },
+        // {
+        //     title: "小浪底",
+        //     key: "xld",
+        //     children: [],
+        //     disabled: true,
+        //     isLeaf: false,
+        //     uper:'basic_map',
+        // },
         {
-            title: "大坝模型",
-            key: "db_model",
-            isLeaf: true,
-            uper: 'xld',
-            fusionLayers: {
-                model: 'db_model'
-            }
-        },
-        {
-            title: "基础场景",
+            title: "倾斜摄影",
             key: "base_scene",
             children: [],
             disabled: true,
-            isLeaf: false
+            isLeaf: false,
+            uper:'basic_map',
         },
         {
             title: "库区航拍影像",
             key: "base_kq_hp",
             children: [],
             disabled: true,
-            isLeaf: false
+            isLeaf: false,
+            uper:'basic_map',
+        },
+
+        {
+            title: "BIM模型",
+            key: "bim_model",
+            children: [],
+            disabled: true,
+            isLeaf: false,
+            uper:'basic_map',
+        },
+
+        {
+            title: "地形DEM",
+            key: "DEM0304",
+            isLeaf: true,
+            uper: 'basic_map',
+            fusionLayers: {
+                model: 'DEM0304'
+            },
+            isEdit:false,
         },
+
+
+        // {
+        //     title: "大坝模型",
+        //     key: "db_model",
+        //     isLeaf: true,
+        //     uper: 'xld',
+        //     fusionLayers: {
+        //         model: 'db_model'
+        //     },
+        //     isEdit:false,
+        // },
         {
             title: "小浪底倾斜摄影",
             key: "xldqxsy",
@@ -186,10 +227,9 @@ window.threeMapConfig = {
             uper: 'base_scene',
             fusionLayers: {
                 model: 'xldqxsy'
-            }
+            },
+            isEdit:false,
         },
-    
-
 
         {
             title: "西霞院倾斜摄影",
@@ -198,29 +238,40 @@ window.threeMapConfig = {
             uper: 'base_scene',
             fusionLayers: {
                 model: 'xxyqxsy'
-            }
+            },
+            isEdit:false,
         },
         {
             title: "小浪底厂房BIM模型",
             key: "XLD_CF_BIM",
             isLeaf: true,
-            uper: 'base_scene',
+            uper: 'bim_model',
             fusionLayers: {
                 model: 'XLD_CF_BIM'
-            }
+            },
+            isEdit:false,
+        },
+        {
+            title: "西霞院厂房BIM模型(暂无)",
+            key: "XXY_CF_BIM",
+            isLeaf: true,
+            uper: 'bim_model',
+            fusionLayers: {
+                model: 'XLD_CF_BIM'
+            },
+            isEdit:false,
         },
 
         {
             title: "库区遥感影像", //卫星遥感影像
             key: "satellite",
             isLeaf: true,
-            uper: 'base_scene',
+            uper: 'basic_map',
             fusionLayers: {
                 layer2d: ['satellite']
-            }
+            },
+            isEdit:false,
         },
-
-        
         {
             title: "库区航拍影像202406", //卫星遥感影像
             key: "kq_hp_06",
@@ -228,7 +279,8 @@ window.threeMapConfig = {
             uper: 'base_kq_hp',
             fusionLayers: {
                 layer2d: ['kq_hp_06']
-            }
+            },
+            isEdit:false,
         },
         {
             title: "库区航拍影像202407", //卫星遥感影像
@@ -237,7 +289,8 @@ window.threeMapConfig = {
             uper: 'base_kq_hp',
             fusionLayers: {
                 layer2d: ['kq_hp_07']
-            }
+            },
+            isEdit:false,
         },
     ],
     // 视角配置

+ 12 - 7
src/assets/bussinessMapConfig/floodDispatch.ts

@@ -104,7 +104,8 @@ export const bussinessMapConfig = {
             uper: 'fd_ly',
             fusionLayers: {
                 model: 'fd_lyzxq'
-            }
+            },
+            isEdit:false,
         },
         {
             title: "一级骨干水库",
@@ -113,7 +114,8 @@ export const bussinessMapConfig = {
             uper: 'fd_ly',
             fusionLayers: {
                 model: 'fd_shuiku1'
-            }
+            },
+            isEdit:false,
         },
         {
             title: "一级骨干水库标注",
@@ -122,7 +124,8 @@ export const bussinessMapConfig = {
             uper: 'fd_ly',
             fusionLayers: {
                 model: 'fd_shuiku1Label'
-            }
+            },
+            isEdit:false,
         },
         {
             title: "二级骨干水库",
@@ -131,7 +134,8 @@ export const bussinessMapConfig = {
             uper: 'fd_ly',
             fusionLayers: {
                 model: 'fd_shuiku2'
-            }
+            },
+            isEdit:false,
         },
         {
             title: "二级骨干水库标注",
@@ -149,7 +153,8 @@ export const bussinessMapConfig = {
             uper: 'fd_ly',
             fusionLayers: {
                 model: 'fd_ylz'
-            }
+            },
+            isEdit:true,
         },
         {
             title: "雨量站标注",
@@ -158,9 +163,9 @@ export const bussinessMapConfig = {
             uper: 'fd_ly',
             fusionLayers: {
                 model: 'fd_ylzLabe2'
-            }
+            },
+            isEdit:true,
         },
-        
 
     ],
     // 视角配置

+ 2 - 1
src/assets/bussinessMapConfig/houseAreaMonitoring.ts

@@ -46,7 +46,8 @@ export const bussinessMapConfig = {
             uper: 'ham',
             fusionLayers: {
                 model: 'ham01'
-            }
+            },
+            isEdit:false,
         }
     ],
     // 视角配置

+ 3 - 2
src/assets/bussinessMapConfig/safeProduction.ts

@@ -2,7 +2,7 @@
  * @Author: tengmingxue 1473375109@qq.com
  * @Date: 2024-08-25 10:49:22
  * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2024-08-25 15:38:37
+ * @LastEditTime: 2024-08-26 16:19:08
  * @FilePath: \xld_twoThree_map\src\assets\bussinessMapConfig\equipmentAssets.ts
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -46,7 +46,8 @@ export const bussinessMapConfig = {
             uper: 'sap',
             fusionLayers: {
                 model: 'sap01'
-            }
+            },
+            isEdit:false,
         }
     ],
     // 视角配置

+ 2 - 1
src/assets/bussinessMapConfig/securityProtection.ts

@@ -46,7 +46,8 @@ export const bussinessMapConfig = {
             uper: 'sep',
             fusionLayers: {
                 model: 'sep01'
-            }
+            },
+            isEdit:false,
         }
     ],
     // 视角配置

BIN
src/assets/images/mapTools/edit-b.png


BIN
src/assets/images/mapTools/edit.png


+ 29 - 14
src/views/components/LayerControl/index.vue

@@ -7,11 +7,12 @@
       </div>
       <div class="controls-tree">
         <a-directory-tree
+          v-if="treeData.length"
           checkable
           :tree-data="treeData"
           :selectable="false"
           v-model:checkedKeys="checkedKeys"
-          :defaultExpandAll="true"
+          :defaultExpandAll="defaultExpandAll"
           @check="onCheck"
         >
           <template #title="item">
@@ -22,6 +23,7 @@
               v-if="item.isLeaf && item.isFlyTo"
               @click="handleModelPos($event, item)"
             ></span>
+            <span class="edit-btn" v-if="item?.isEdit" title="矢量数据维护" @click="editVector(item)"></span>
           </template>
         </a-directory-tree>
       </div>
@@ -52,15 +54,9 @@ export default defineComponent({
   setup(_, { emit }) {
     const panelStore = usePanelStore();
     const activeMenu = ref(panelStore.activeMenu);
-    const treeData = ref([
-      {
-        title: '图层管理',
-        key: 'all',
-        disabled: true,
-        children: [],
-      },
-    ]);
+    const treeData = ref([]);
     const checkedKeys = ref([]);
+    const defaultExpandAll = ref(false);
     watch(
       () => panelStore.activeMenu,
       (val) => {
@@ -96,7 +92,7 @@ export default defineComponent({
 
     /**
      * 递归生成树形结构数据
-    */
+     */
     function buildTreeRecursively(list, uper = null) {
       return list
         .filter((item) => (uper ? item.uper === uper : !item?.uper))
@@ -105,11 +101,13 @@ export default defineComponent({
           children: buildTreeRecursively(list, item.key),
         }));
     }
-    
+
     /**
      * 图层配置
-    */
+     */
     const setLayerConfig = () => {
+      treeData.value = [];
+      defaultExpandAll.value = false;
       let { layerView, layerControl } = threeMapConfig;
       let config = null;
       switch (activeMenu.value) {
@@ -144,8 +142,16 @@ export default defineComponent({
       });
       //treeData.value[0].children = toTree(JSON.parse(JSON.stringify(layers)));
       //生成树结构
-      treeData.value[0].children = buildTreeRecursively(layers);
+      treeData.value = buildTreeRecursively(layers);
+      defaultExpandAll.value = true;
     };
+    
+    /**
+     * 编辑数据集
+    */
+    const editVector = (vector)=> {
+      let { key , title } = vector
+    }
 
     onMounted(() => {
       setLayerConfig();
@@ -210,13 +216,14 @@ export default defineComponent({
     };
 
     return {
-      // right,
+      defaultExpandAll,
       activeMenu,
       treeData,
       checkedKeys,
       onCheck,
       buildTreeRecursively,
       handleModelPos,
+      editVector,
     };
   },
 });
@@ -310,6 +317,14 @@ export default defineComponent({
             background: url('/@/assets/images/pos.png') no-repeat;
             background-size: 100% 100%;
           }
+          .edit-btn {
+            position: absolute;
+            right: 0;
+            height: 16px;
+            width: 16px;
+            background: url('/@/assets/images/mapTools/edit-b.png') no-repeat;
+            background-size: 100% 100%;
+          }
         }
         span {
           color: #fff;