Browse Source

zzy + 元数据加载

zhiyuan-007 9 months ago
parent
commit
61bcf903a6

+ 42 - 24
src/data/all-headers.js

@@ -1,74 +1,92 @@
 export const sjxHeaders = [
     {
         prop:"ATTRIBUTE_NAME",
-        label:"属性名称"
+        label:"属性名称",
+        width:200
+    },
+    {
+        prop:"FIELD_DESCRIPTION",
+        label:"字段描述",
+        width:200
     },
     {
         prop:"FIELD_TYPE",
-        label:"字段类型"
+        label:"字段类型",
+        width:150
     },
     {
         prop:"FIELD_LENGTH",
-        label:"长度"
+        label:"长度",
+        width:100
     },
     {
         prop:"DECIMAL_PLACES",
-        label:"小数位"
+        label:"小数位",
+        width:100
     },
     {
         prop:"NULL_PROPERTY",
-        label:"空值性"
+        label:"空值性",
+        width:100
     },
     {
         prop:"UNIQUENESS",
-        label:"唯一性"
+        label:"唯一性",
+        width:100
     },
     {
         prop:"FIELD_THRESHOLD",
-        label:"字段阈值"
-    },
-    {
-        prop:"FIELD_DESCRIPTION",
-        label:"字段描述"
+        label:"字段阈值",
+        width:100
     },
     {
         prop:"IS_PRIMARY_KEY",
-        label:"是否为主键"
+        label:"是否为主键",
+        width:100
     },
     {
         prop:"UNIT_OF_MEASURE",
-        label:"计量单位"
+        label:"计量单位",
+        width:100
     },
     {
         prop:"IS_ENCRYPTION",
-        label:"是否加密"
+        label:"是否加密",
+        width:100
     },
     {
         prop:"IS_DESENSITIZATION",
-        label:"是否脱敏"
+        label:"是否脱敏",
+        width:100
     },
     {
         prop:"SPATIAL_PROPERTY",
-        label:"空间属性"
-    },
-    {
-        prop:"INSERT_TIME",
-        label:"插入时间"
+        label:"空间属性",
+        width:100
     },
     {
         prop:"IS_LONGITUDE",
-        label:"是否为经度"
+        label:"是否为经度",
+        width:100
     },
     {
         prop:"IS_DIMENSION",
-        label:"是否为维度"
+        label:"是否为维度",
+        width:100
     },
     {
         prop:"IS_ADDRESS",
-        label:"地址字段"
+        label:"地址字段",
+        width:100
     },
     {
         prop:"IS_DIC",
-        label:"是否字典"
+        label:"是否字典",
+        width:100
+    },
+    {
+        prop:"INSERT_TIME",
+        label:"插入时间",
+        width:180
     }
 ]

+ 9 - 0
src/unit/map/addLayer.js

@@ -55,6 +55,15 @@ export function SetBackground(){
     })
 }
 
+export function FeatureThreeDimension(params){
+    debugger
+    invokeParams('FeatureThreeDimension', {
+        "url": params.url,
+        "status": params.status
+    })
+}
+
+
 //点查询
 export function MapClickByType(status){
     invokeParams('MapClickAll', {

+ 16 - 2
src/views/c-cpns/LayerDetailDialog.vue

@@ -129,9 +129,23 @@ export default {
           ...res.data.msg[0].Rows[0]
         }
       })
-      queryDataItem(mapStore.layerDetailObj.S_CODE).then(res => {
+      queryDataItem(mapStore.layerDetailObj.CODE).then(res => {
         debugger
-        tableData.value = res.data.msg[0].Rows;
+        let data = res.data.msg[0].Rows;
+        data.forEach(item =>{
+          item.NULL_PROPERTY = item.NULL_PROPERTY=='0'?'否':'是';
+          item.IS_PRIMARY_KEY = item.IS_PRIMARY_KEY=='0'?'否':'是';
+          item.IS_ENCRYPTION = item.IS_ENCRYPTION=='0'?'否':'是';
+          item.IS_DESENSITIZATION = item.IS_DESENSITIZATION=='0'?'否':'是';
+          item.IS_LONGITUDE = item.IS_LONGITUDE=='0'?'否':'是';
+          item.IS_DIMENSION = item.IS_DIMENSION=='0'?'否':'是';
+          item.IS_ADDRESS = item.IS_ADDRESS=='0'?'否':'是';
+          item.IS_DIC = item.IS_DIC=='0'?'否':'是';
+          item.UNIQUENESS = item.UNIQUENESS=='0'?'否':'是';
+          item.SPATIAL_PROPERTY = item.SPATIAL_PROPERTY=='0'?'否':'是';
+        })
+
+        tableData.value = data;
       })
     })
     const activeName = ref('dir')

+ 1 - 0
src/views/c-cpns/MyTable.vue

@@ -2,6 +2,7 @@
   <el-table
       ref="table"
       :data="tableData"
+      height="400"
   >
     <slot name="header" :header="headers">
       <el-table-column

+ 32 - 3
src/views/c-cpns/ServiceTree.vue

@@ -12,6 +12,9 @@
       >
         <template #default="{ node, data }">
           <span  class="custom-tree-label">{{ node.label }}</span>
+          <span  v-if="node.isLeaf" class="custom-tree-gl-icon" @click="showLayerGL(data)">
+            <OfficeBuilding />
+          </span>
           <span  v-if="node.isLeaf" class="custom-tree-detail-icon" @click="showDetailDialog(data)">
             <Document />
           </span>
@@ -28,16 +31,18 @@
 import {onMounted, ref, watch} from "vue";
 import CommonTitle from "@/views/c-cpns/CommonTitle.vue";
 import {getServiceTree} from "@/service/http.js";
-import {AddSingleLayer} from "@/unit/map/addLayer.js";
+import {AddSingleLayer, FeatureThreeDimension} from "@/unit/map/addLayer.js";
 import {useMapStore} from "@/store/mapStore.js";
-import {Edit,Document} from "@element-plus/icons-vue";
+import {Edit,Document,OfficeBuilding} from "@element-plus/icons-vue";
 export default {
   name: "ServiceTree",
-  components: {CommonTitle,Edit,Document},
+  components: {CommonTitle,Edit,Document,OfficeBuilding},
   setup(){
     const mapStore = useMapStore()
     let treeData = ref([]);
     const treeRef = ref(null);
+    const showGL = ref(false);
+    const GLLayer = ref('');
     function getTreeData(){
       getServiceTree({
         TYPE:"",
@@ -55,6 +60,22 @@ export default {
       mapStore.layerDetailObj = data;
       mapStore.layerDetailShow = true;
     }
+    function showLayerGL(data){
+      if(showGL&&data.ADDRESS == GLLayer.value){
+        showGL.value = false;
+        GLLayer.value = '';
+        FeatureThreeDimension({
+          url:data.ADDRESS,
+          status:"hide"
+        })
+        return
+      }
+      GLLayer.value = data.ADDRESS;
+      FeatureThreeDimension({
+        url:data.ADDRESS,
+        status:"show"
+      });
+    }
     function changeChange(){
       let nowChecked = treeRef.value.getCheckedNodes(true);
       //找到原来有现在没有的删除
@@ -100,6 +121,7 @@ export default {
       changeChange,
       treeRef,
       applyData,
+      showLayerGL,
       showDetailDialog
     }
   }
@@ -116,6 +138,13 @@ export default {
   .custom-tree-label{
     font-size: 16px;
   }
+  .custom-tree-gl-icon{
+    position: absolute;
+    right: 70px;
+    width: 16px;
+    height: 16px;
+    font-size: 10px;
+  }
   .custom-tree-detail-icon{
     position: absolute;
     right: 40px;

+ 2 - 2
vite.config.js

@@ -15,8 +15,8 @@ export default defineConfig({
             // 代理所有 /api 的请求,该求情将被代理到 target 中
             '/api': {
                 // 代理请求之后的请求地址(你的真实接口地址)
-                target: 'https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod/',
-                //target: 'http://localhost:9250/',
+                //target: 'https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod/',
+                target: 'http://localhost:9250/',
                 secure: false,
                 ws: true,
                 // 跨域