管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2023-02-16 a92fa5ec4d415ccc42f8c3b7eae7d07cc8418889
1
已添加1个文件
已修改6个文件
224538 ■■■■ 文件已修改
public/SmartEarthSDK/SmartEarth.min - 副本.js 112246 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/SmartEarthSDK/SmartEarth.min.js 111951 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuPop.vue 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuTop.vue 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue 129 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/domainManage.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/SmartEarthSDK/SmartEarth.min - ¸±±¾.js
¶Ô±ÈÐÂÎļþ
ÎļþÌ«´ó
public/SmartEarthSDK/SmartEarth.min.js
ÎļþÌ«´ó
src/components/MapView/mapMenuPop.vue
@@ -467,7 +467,20 @@
      this.listdata.name = null;
      this.option = [];
    },
    clearQuerInfo() {
      if (this.$store.state.queryInfo.length != 0) {
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
        this.$store.state.queryInfo = [];
        if (this.$store.state.primitLayer != null) {
          sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
          this.$store.state.primitLayer = null;
        }
      }
    },
    setTableAll() {
      this.clearQuerInfo();
      this.signGetPublicKey();
      this.startTableMssage();
      this.listdata.wkt = this.$store.state.mapMenuShpFile;
@@ -628,13 +641,7 @@
      this.showAllImage(data.result);
    },
    async showAllImage(res) {
      if (window.Viewer.scene.primitives.length != null) {
        window.Viewer.scene.primitives.removeAll();
      }
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
      for (var i in res) {
        var param = {
          gid: res[i].gid,
@@ -647,7 +654,7 @@
        var val1 = decr(data.result);
        if (val1) {
          var wkt = this.$wkt.parse(val1);
          this.getprimitiLayer(wkt);
          // this.getprimitiLayer(wkt);
          this.primitivesAddLayer(wkt);
        }
      }
@@ -662,6 +669,7 @@
      }
    },
    primitivesAddLayer(res) {
      debugger
      switch (res.type) {
        case "Point":
          var val = Cesium.Cartesian3.fromDegrees(
@@ -669,34 +677,41 @@
            res.coordinates[1],
            200
          );
          this.$store.state.primitLayer.add({
          var point = Viewer.entities.add({
            position: val,
            image: SmartEarthRootUrl + "Workers/image/mark.png",
            billboard: {
              // å›¾åƒåœ°å€ï¼ŒURI或Canvas的属性
              image: SmartEarthRootUrl + "Workers/image/mark.png",
              // å¤§å°æ˜¯å¦ä»¥ç±³ä¸ºå•位
              sizeInMeters: false,
              // ç›¸å¯¹äºŽåæ ‡çš„垂直位置
              verticalOrigin: Cesium.VerticalOrigin.CENTER,
              // ç›¸å¯¹äºŽåæ ‡çš„æ°´å¹³ä½ç½®
              horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
              // åº”用于图像的统一比例。比例大于会1.0放大标签,而比例小于会1.0缩小标签。
              scale: 1.0,
              // æ˜¯å¦æ˜¾ç¤º
              show: true
            }
          });
          this.$store.state.queryInfo.push(point)
          break;
        case "LineString":
        case "MultiLineString":
          var line = res.coordinates[0];
          var std = [];
          for (var i in line) {
            std.push(line[i][0], line[i][1]);
          }
          var instance = new Cesium.GeometryInstance({
            geometry: new Cesium.GroundPolylineGeometry({
          var polyline = Viewer.entities.add({
            polyline: {
              positions: Cesium.Cartesian3.fromDegreesArray(std),
              width: 4.0,
            }),
            attributes: {
              color: Cesium.ColorGeometryInstanceAttribute.fromColor(
                new Cesium.Color(1.0, 0.0, 0.0, 0.3)
              ),
            },
          });
          window.Viewer.scene.primitives.add(
            new Cesium.GroundPolylinePrimitive({
              geometryInstances: instance,
              appearance: new Cesium.PolylineColorAppearance(),
            })
          );
              width: 5,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              clampToGround: true,
            }
          })
          this.$store.state.queryInfo.push(polyline)
          break;
        case "MultiPolygon":
          var val = res.coordinates[0][0];
@@ -704,24 +719,16 @@
          for (var i in val) {
            std.push(val[i][0], val[i][1]);
          }
          var primitive = new Cesium.GroundPrimitive({
            //贴地的primitive
            geometryInstances: new Cesium.GeometryInstance({
              geometry: new Cesium.PolygonGeometry({
                //支持CircleGeometry,CorridorGeometry,EllipseGeometry,RectangleGeometry
                polygonHierarchy: new Cesium.PolygonHierarchy(
                  Cesium.Cartesian3.fromDegreesArray(std)
                ),
              }),
              attributes: {
                color: Cesium.ColorGeometryInstanceAttribute.fromColor(
                  new Cesium.Color(1.0, 0.0, 0.0, 0.3)
                ),
              },
            }),
            appearance: Cesium.EllipsoidSurfaceAppearance(),
          });
          window.Viewer.scene.primitives.add(primitive);
          var entity = Viewer.entities.add({
            polygon: {
              hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
              //height : 100000,
              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
              outline: true,
              outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
            }
          })
          this.$store.state.queryInfo.push(entity)
          break;
      }
    },
src/components/MapView/mapMenuTop.vue
@@ -172,48 +172,19 @@
  },
  mounted() {
    // sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
    this.menuTopFrom.queryType = 'rectangle';
    this.getAllTable();
  },
  methods: {
    flyRemove() {
    },
    flyQuery() {
    // Viewer.flyTo( sgworld.Creator.SimpleGraphic._viewer.entities._entities._array[0])
      // switch (this.menuTopFrom.queryType) {
      //   case 'point': //点
      //     Viewer.camera.flyTo({
      //       destination: Cesium.Cartesian3.fromDegrees(this.flyEntity.lng, this.flyEntity.lat, 3000),
      //     });
      //     break;
      //   case 'polyline': //线
      //     debugger
      //     break;
      //   case 'rectangle': //矩形
      //     debugger
      //     break;
      //   case 'circle': //圆
      //     debugger
      //     break;
      //   case 'polygon': //多边形
      //     debugger
      //     break;
      // }
    },
    changeValue(value) {
      // var obj = {};
      // obj = this.queryOption.find(function (item) {
      //   return item.value === value;
      // });
      // if (obj.value == 'inputFile') {
      //   this.getMenuTopFile();
      // }
      var obj = {};
      obj = this.queryOption.find(function (item) {
        return item.value === value;
      });
      if (obj.value == 'inputFile') {
        this.getMenuTopFile();
      }
    },
    async getAllTable() {
      const data = await inquiry_SelectTabs();
@@ -300,7 +271,16 @@
      //清空标绘
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      sgworld.Creator.SimpleGraphic.clear();
      if (this.$store.state.queryInfo.length != 0) {
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
        this.$store.state.queryInfo = [];
      }
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
      if (this.treeChange.length == 0) {
        this.$message.error('请选择要查询的数据');
        return;
@@ -368,7 +348,7 @@
        properties: { foo: 'bar' },
      };
      var circle = turf.circle(position, radius, options);
      debugger
      this.setJonToWKT(circle);
    },
    setTurfPolyOrLine(res, type) {
@@ -403,22 +383,22 @@
    showMapMenuPop() {
      this.$store.state.mapSpaceQueryLayer = this.treeChange;
      this.$store.state.mapPopBoxFlag = '1';
      // this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("空间查询", null, {
        close: () => {
          if (this.$store.state.primitLayer != null) {
            // sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
            this.$store.state.primitLayer = null;
          }
          // if (this.$store.state.primitLayer != null) {
          //   // sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
          //   this.$store.state.primitLayer = null;
          // }
          if (window.Viewer.scene.primitives.length != 0) {
            window.Viewer.scene.primitives.removeAll()
          }
          // if (window.Viewer.scene.primitives.length != 0) {
          //   window.Viewer.scene.primitives.removeAll()
          // }
        }
      });
      this.$bus.$emit('changeMapMenuTop', 'true');
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      // this.$bus.$emit('changeMapMenuTop', 'true');
      // sgworld.Creator.SimpleGraphic.clear();
      //清空inputFile
      // var file = document.getElementById('getMenuTopFile');
@@ -431,24 +411,21 @@
      this.menuTopFrom.queryLayer = null;
      this.menuTopFrom.queryType = 'rectangle';
      this.$refs.tree.setCheckedKeys([]);
 //清空标绘
      //清空标绘
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      sgworld.Creator.SimpleGraphic.clear();
      // //清除对象
      // if (window.Viewer.scene.primitives.length != null) {
      //   window.Viewer.scene.primitives.removeAll();
      // }
      // if (this.$store.state.primitLayer != null) {
      //   sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
      //   this.$store.state.primitLayer = null;
      // }
      if (this.$store.state.queryInfo.length != 0) {
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
        this.$store.state.queryInfo = [];
      }
      //关闭窗口
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo");
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
    },
    setCartesianToEightFour(res) {
      var std = {};
src/store/index.js
@@ -57,6 +57,7 @@
    isNaviget: false,
    treeData: null,
    checkedKeys: [],
    queryInfo:[],
  },
  mutations: {
    //获取权限合集
src/views/Synthesis/LeftMenu.vue
@@ -47,6 +47,7 @@
  FullScreen,
  ScaleLine,
  Rotate,
} from "ol/control.js"
import * as turf from '@turf/turf';
import { geometry } from '@turf/turf';
@@ -354,18 +355,18 @@
            css: 'twoMenu_imge86',
          },
          // {
          //   id: 'h9',
          //   label: 'synthesis.import1',
          //   name: '导入SHP',
          //   css: 'twoMenu_imge85',
          // },
          // {
          //   id: 'h10',
          //   label: 'synthesis.export1',
          //   name: '导出SHP',
          //   css: 'twoMenu_imge86',
          // },
          {
            id: 'h9',
            label: 'synthesis.import1',
            name: '导入SHP',
            css: 'twoMenu_imge85',
          },
          {
            id: 'h10',
            label: 'synthesis.export1',
            name: '导出SHP',
            css: 'twoMenu_imge86',
          },
          {
@@ -403,20 +404,14 @@
      scaleLine: null,
      Excavation: false,
      entityaLayers: [],
      isMenuFlag: null,
    };
  },
  methods: {
    //二級菜单点击切换
    setChangeTwoMenu(res) {
      //清除绘制图形对象
      // sgworld.Creator.SimpleGraphic.clear();
      if (window.Viewer.scene.primitives.length != null) {
        window.Viewer.scene.primitives.removeAll();
      }
      if (this.$store.state.primitLayer != null) {
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
      //关闭打开的信息窗体
@@ -433,11 +428,29 @@
        window.model = null;
      }
      if (this.isMenuFlag != val) {
        sgworld.Creator.SimpleGraphic.clear();
        this.isMenuFlag = val;
        if (this.entityaLayers.length != 0) {
          for (var i in this.entityaLayers) {
            sgworld.Viewer.entities.remove(this.entityaLayers[i]);
          }
          this.entityaLayers = [];
        }
        for (var i in this.$store.state.queryInfo) {
          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
        this.$store.state.queryInfo = [];
        if (this.$store.state.primitLayer != null) {
          sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
          this.$store.state.primitLayer = null;
        }
      }
      switch (val) {
        case 'a': //图层管理
          this.setCoverage(res.id);
          break;
        case 'b':
@@ -592,7 +605,7 @@
          var north = Cesium.Math.toDegrees(entities[i].rectangle.coordinates.getValue().north);
          var west = Cesium.Math.toDegrees(entities[i].rectangle.coordinates.getValue().west);
          var south = Cesium.Math.toDegrees(entities[i].rectangle.coordinates.getValue().south);
          var line = turf.lineString([[east, north], [west, south]])
          var line = turf.polygon([[[east, north], [west, north], [west, south], [east, south], [east, north]]])
          wkt = this.$wkt.convert(line.geometry)
          var fill = entities[i].rectangle._material._color._value;
          fillColor = fill.red + ',' + fill.green + ',' + fill.blue;
@@ -720,45 +733,91 @@
          console.error(e);
        }
      });
      document.getElementById("shpFile").value = ""
    },
    showShpEntity(res) {
      for (var i in res) {
        var wkt = this.$wkt.parse(res[i].wkt);
        var fillColor = res[i].fillColor.split(",");
       var color = new Cesium.Color(fillColor[0], fillColor[1], fillColor[2], res[i].opacity)
        var color = new Cesium.Color(parseFloat(fillColor[0]), parseFloat(fillColor[1]), parseFloat(fillColor[2]), res[i].opacity);
        var name = res[i].name
        switch (res[i].type) {
          case 'rectangle':
            debugger
            break;
          case 'point':
            debugger
            break;
          case 'polygon':
            var std = [];
            var geo = wkt.coordinates[0];
            for (var i in geo) {
              std.push(geo[i][0])
              std.push(geo[i][1])
            }
            const entity = Viewer.entities.add({
              name: 'Wyoming',
            var entity = Viewer.entities.add({
              name: name,
              polygon: {
                hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
                //height : 100000,
                material:color,
                material: color,
                outline: true,
                outlineColor: color,
              }
            })
            this.entityaLayers.push(entity)
            break;
          case 'point':
            let point = Viewer.entities.add({
              name: name,
              position: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0], wkt.coordinates[1]), //经纬度转世界坐标
              point: {
                show: true,
                color: color,
                pixelSize: 10,
                outlineColor: color,
                outlineWidth: 3,
                heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                disableDepthTestDistance: Number.POSITIVE_INFINITY,
              },
            });
            this.entityaLayers.push(point)
            break;
          case 'polyline':
            debugger
            var std = [];
            var geo = wkt.coordinates;
            for (var i in geo) {
              std.push(geo[i][0])
              std.push(geo[i][1])
            }
            let line = Viewer.entities.add({
              name: name,
              polyline: {
                //经纬度数组转世界坐标,带高度的话是fromDegreesArrayHeights
                positions: Cesium.Cartesian3.fromDegreesArray(std),
                width: 10,
                material: color,
                clampToGround: true,
              }
            })
            this.entityaLayers.push(line)
            break;
          case 'label':
            debugger
            const label = Viewer.entities.add({
              position: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0], wkt.coordinates[1]),
              label: {
                text: name,
                fillColor: color,
                font: '28px',
                horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                verticalOrigin: Cesium.VerticalOrigin.TOP,
                heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                disableDepthTestDistance: Number.POSITIVE_INFINITY,
              },
            })
            this.entityaLayers.push(label)
            break;
        }
      }
@@ -1455,7 +1514,7 @@
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    border: 1px solid rgba(0, 0, 0, 0);
    padding: 10px;
    min-width: 100px;
    margin-left: 10px;
src/views/datamanage/domainManage.vue
@@ -7,7 +7,10 @@
    <el-divider />
    <div class="mainBox">
      <div class="leftTree subpage_Div">
        <el-input v-model="filterInput" style="width:200px"></el-input>
        <el-input
          v-model="filterInput"
          style="width:200px"
        ></el-input>
        <div style="width:450px">
          <el-tree
            :data="domainData"
@@ -418,6 +421,10 @@
          val: '业务数据',
          children: [],
        },
         {
          val: '元数据',
          children: [],
        },
      ],
      defaultProps: {
        children: 'children',
@@ -486,6 +493,7 @@
      getDomainTabs().then((res) => {
        let bdres = res.result.filter((item) => item.ns == 'bd');
        let bsres = res.result.filter((item) => item.ns == 'bs');
        let mdres = res.result.filter((item) => item.ns == 'md');
        for (var i in bdres) {
          // bdres[i].val = bdres[i].tabDesc + '(' + bdres[i].tab + ')';
          bdres[i].val = bdres[i].tabDesc;
@@ -494,8 +502,13 @@
          // bsres[i].val = bsres[i].tabDesc + '(' + bsres[i].tab + ')';
          bsres[i].val = bsres[i].tabDesc;
        }
          for (var i in mdres) {
          // bsres[i].val = bsres[i].tabDesc + '(' + bsres[i].tab + ')';
          mdres[i].val = mdres[i].tabDesc;
        }
        this.domainData[0].children = bdres;
        this.domainData[1].children = bsres;
         this.domainData[2].children = mdres;
      });
    },
    handleSelectionChange(val) {