管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-24 c42e12bcc0877678cf09438b7a6bfb9ccd7342fa
转孔柱状图添加图例,官网一张图修改
已修改6个文件
933 ■■■■ 文件已修改
src/components/MapView/mapMenuPop.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapSpacePop.vue 405 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Screen/ProjectTree.vue 429 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/mapsdk.vue 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/queryinfo.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuPop.vue
@@ -735,6 +735,22 @@
      this.$refs.dialogPayChannel.doLayout()
      // this.showAllImage(data.result)
    },
    //格式化时间
    format(shijianchuo) {
      //shijianchuo是整数,否则要parseInt转换
      var time = new Date(shijianchuo);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return y + "-" + this.add0(m) + "-" + this.add0(d);
    },
    //格式化时间
    add0(m) {
      return m < 10 ? "0" + m : m;
    },
    async showAllImage(res) {
      for (var i in res) {
        let properties = res[i]
src/components/MapView/mapSpacePop.vue
@@ -3,6 +3,43 @@
    <div style="padding: 5px">
      <el-form
        :inline="true"
        :model="ruleForm"
        class="demo-form-inline"
      >
        <el-form-item>
          <el-input
            size="small"
            style="width:47vh"
            v-model="ruleForm.fileName"
            disabled
            placeholder="请输入..."
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button
            @click="conditionVisible = true"
            size="small"
            type="success"
          >新增</el-button>
          <el-button
            size="small"
            @click="resetForm"
          >重置</el-button>
        </el-form-item>
        <el-form-item v-if="spaceLayer == 'sexplorationpoint'">
          <el-button
            size="small"
            @click="spaceHistogram( )"
            plain
          >柱状图</el-button>
          <!-- <el-button
            plain
            size="small"
          >剖切图</el-button> -->
        </el-form-item>
      </el-form>
      <!-- <el-form
        :inline="true"
        :model="formInline"
        class="demo-form-inline"
      >
@@ -66,9 +103,9 @@
          <!-- <el-button
            plain
            size="small"
          >剖切图</el-button> -->
        </el-form-item>
      </el-form>
          >剖切图</el-button>
      </el-form-item>
      </el-form> -->
      <div class="centTable">
        <el-table
          :data="tableData"
@@ -135,6 +172,81 @@
        </el-pagination>
      </div>
    </div>
    <el-dialog
      :visible.sync="conditionVisible"
      title="高级查询"
      width="44%"
      :close-on-click-modal="false"
      :modal="false"
    >
      <el-form
        :inline=" true"
        :model="formSql"
        class="demo-form-inline"
        label-position="top"
      >
        <el-form-item>
          <el-select
            @change="fieldChange($event)"
            v-model="formSql.field"
            :popper-append-to-body="false"
          >
            <el-option
              v-for="item in filedsOption"
              :key="item.field"
              :label="item.alias"
              :value="item.field"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-select
            :popper-append-to-body="false"
            v-model="formSql.condition"
          >
            <el-option
              v-for="item in condOption"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item v-show="!fromSqlflag">
          <el-input v-model="formSql.value"></el-input>
        </el-form-item>
        <el-form-item v-show="fromSqlflag">
          <el-date-picker
            v-model="formSql.date"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
          >
          </el-date-picker>
        </el-form-item>
      </el-form>
      <span
        slot="footer"
        class="dialog-footer"
      >
        <el-button
          size="small"
          @click="startFiledAndcondition"
        >取 消</el-button>
        <el-button
          class="primaries"
          size="small"
          @click="appendQueryFilter"
        >确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -148,6 +260,7 @@
  encr,
} from "../../api/api.js"
import * as turf from "@turf/turf"
import { conditions } from "../../views/Archive/Archive.js";
export default {
  computed: {
    storeTime() {
@@ -156,6 +269,13 @@
  },
  data() {
    return {
      conditionVisible: false,
      filedsOption: [],
      condOption: [],
      ruleForm: {
        fileName: "",
      },
      fromSqlflag: false,
      count: 0,
      listdata: {
        pageIndex: 1,
@@ -223,12 +343,21 @@
      imagePoint: null,
      domainsLayer: null,
      querytype: null,
      formSql: {
        field: "",
        condition: "",
        value: "",
        type: "",
        date: "",
      },
    }
  },
  watch: {
    async storeTime(index) {
      this.spaceLayer = index
      this.getDomainsLayer()
      this.resetForm();
      // this.getDomainsLayer()
      // this.getTableselectFields();
      // this.restSpacePopLayer();
    },
@@ -237,12 +366,43 @@
    this.spaceLayer = this.$store.state.mapSpaceQueryLayer
    // this.showSpacePopLayer();
    //   this.getTableselectFields();
    this.getDomainsLayer()
    this.resetForm();
    // this.getDomainsLayer()
  },
  methods: {
    fieldChange(value) {
      var obj = {};
      obj = this.filedsOption.find(function (item) {
        return item.field === value;
      });
      this.conditionChange(obj);
    },
    conditionChange(res) {
      this.formSql.field = res.field;
      this.formSql.type = res.type;
      if (res.type == "date" || res.type == "datetime") {
        this.fromSqlflag = true;
      } else {
        this.fromSqlflag = false;
      }
      var std = [];
      this.condOption = [];
      if (res.type == "text" || res.type == "blob") {
        std = conditions[0];
      } else if (res.type == "date" || res.type == "datetime") {
        std = conditions[2];
      } else {
        std = conditions[1];
      }
      for (var i in std) {
        this.condOption.push({
          label: std[i],
          value: std[i],
        });
      }
      this.formSql.condition = this.condOption[0].value;
    },
    closeSpaceBox() {
      if (this.imagePoint != null) {
        sgworld.Creator.DeleteObject(this.imagePoint)
@@ -328,7 +488,7 @@
      if (data.code != 200) {
        this.$message.error("列表调用失败")
      }
      this.filedsOption = [];
      this.optionx = []
      var valadata = data.result
      for (var i in valadata) {
@@ -340,10 +500,63 @@
            valadata[i].domainNa = this.getMatchDomainNa(valadata[i].domainNa)
          }
          this.optionx.push(valadata[i])
          this.filedsOption.push(valadata[i])
          this.attributeData.push(valadata[i])
        }
      }
      this.startFiledAndcondition();
      this.showSpacePopLayer()
    },
    appendQueryFilter() {
      if (this.formSql.type == "date" || this.formSql.type == "datetime") {
        if (this.formSql.date == null) {
          this.$message.error("请输入要查询的信息!");
          return;
        }
      } else {
        if (this.formSql.value == "") {
          this.$message.error("请输入要查询的信息!");
          return;
        }
      }
      if (this.ruleForm.fileName != "") {
        this.ruleForm.fileName += " and ";
      }
      var val;
      if (this.formSql.type == "long" || this.formSql.type == "integer") {
        val = parseInt(this.formSql.value);
      } else if (this.formSql.type == "double") {
        if (this.formSql.value.indexOf(".") != -1) {
          val = this.formSql.value;
        } else {
          val = parseFloat(this.formSql.value).toFixed(1);
        }
      } else if (
        this.formSql.type == "date" ||
        this.formSql.type == "datetime"
      ) {
        var time = new Date(this.formSql.date);
        var m = time.getMonth() + 1;
        var d = time.getDate();
        var y = time.getFullYear();
        val = "'" + y + "-" + this.add0(m) + "-" + this.add0(d) + "'";
      } else {
        val = "'" + this.formSql.value + "'";
      }
      this.ruleForm.fileName +=
        this.formSql.field + " " + this.formSql.condition + " " + val;
      this.startFiledAndcondition();
      this.getSpaceTableLayer();
    },
    startFiledAndcondition() {
      this.conditionVisible = false;
      this.conditionChange(this.filedsOption[0]);
      this.formSql.value = "";
      this.formSql.date = new Date();
    },
    getMatchDomainNa(res) {
      var std = null
@@ -365,35 +578,27 @@
      this.setListDataStart()
      this.getTableselectFields()
    },
    resetForm() {
      this.ruleForm.fileName = "";
      this.listdata.pageIndex = 1;
      this.listdata.pageSize = 10;
      //获取table信息
      this.getDomainsLayer()
    },
    //初始化查询表格信息
    async getSpaceTableLayer() {
      this.listdata.name = this.spaceLayer
      if (this.formInline.input == undefined || this.formInline.input == null) {
        this.listdata.filter = null
      } else {
        var val
        var value = this.formInline.input
        if (this.querytype == "long" || this.querytype == "integer") {
          val = parseInt(value)
        } else if (this.querytype == "double") {
          if (this.formSql.value.indexOf(".") != -1) {
            val = value
          } else {
            val = parseFloat(value).toFixed(1)
          }
        } else if (this.querytype == "date" || this.querytype == "datetime") {
          var time = new Date(value)
          var m = time.getMonth() + 1
          var d = time.getDate()
          var y = time.getFullYear()
          val = "'" + y + "-" + this.add0(m) + "-" + this.add0(d) + "'"
        } else {
          val = "'" + value + "'"
        }
        this.listdata.filter =
          this.formInline.name + " " + this.formInline.region + " " + val
      this.listdata.name = this.spaceLayer
      if (this.ruleForm.fileName != "") {
        this.listdata.filter = this.ruleForm.fileName;
      } else {
        this.listdata.filter = null;
      }
      const data = await dataQuerySelectByPage(this.listdata)
      if (data.code != 200) {
@@ -480,6 +685,8 @@
      if (data.code != 200) {
        return this.$message.error("列表调用失败")
      }
      this.count = data.count;
      if (data.result.length == 0) {
        return this.$message({
          message: '未查询到转孔点数据',
@@ -520,7 +727,7 @@
          })
          this.listdata.count = data.count;
          this.tableData = val;
          this.showHistogramLayer(data.count)
@@ -613,15 +820,7 @@
            }
          }
        }
        // var outlineList = [
        //   'rgba(141,135,114,1)',
        //   'rgba(248,235,179,1)',
        //   'rgba(185,183,151,1)',
        //   'rgba(224,222,94,1)',
        //   'rgba(250,190,153,1)',
        //   'rgba(197,222,130,1)',
        //   'rgba(208,228,177,1)',
        // ]
        var outlineList = [
          { 'name': '粉质黏土', 'color': 'rgba(139,106,77,1)' },
          { 'name': '淤泥质粉土', 'color': 'rgba(141,85,69,1)' },
@@ -666,14 +865,14 @@
          this.$store.state.histogramLayer.push(layer)
        }
      }
      this.$store.state.histLenged = true;
    },
    spaceHistogram() {
      this.restSpacePopLayer();
      this.resetForm();
      if (this.$store.state.histogramLayer.length != 0) {
        for (var i in this.$store.state.histogramLayer) {
          Viewer.entities.remove(this.$store.state.histogramLayer[i])
@@ -691,122 +890,6 @@
        that.setCartesianToEightFour(entity)
      });
      // var param = {
      //   gid: row.gid,
      //   name: this.spaceLayer,
      // }
      // const data1 = await dataQuerySelectWktById(param)
      // if (data1.code != 200) {
      //   this.$message.error("列表调用失败")
      // }
      // var val1 = decr(data1.result)
      // var wkt = this.$wkt.parse(val1)
      // var coord = wkt.coordinates
      // var obj = {
      //   pageIndex: 1,
      //   pageSize: 10,
      //   name: 'sexplorationpointstratum',
      //   filter: "exppointid = '" + row.exppointid + "'"
      // }
      // var data = await dataQuerySelectByPage(obj)
      // if (data.code != 200) {
      // }
      // if (data.result.length != 0) {
      //   var val = data.result;
      //   //冒泡排序
      //   for (var i = 0; i < val.length; i++) {
      //     for (var u = i + 1; u < val.length; u++) {
      //       if (val[i].botdepth > val[u].botdepth) {
      //         var num = val[i];
      //         val[i] = val[u];
      //         val[u] = num;
      //       }
      //     }
      //   }
      //   var outlineList = [
      //     'rgba(141,135,114,1)',
      //     'rgba(248,235,179,1)',
      //     'rgba(185,183,151,1)',
      //     'rgba(224,222,94,1)',
      //     'rgba(250,190,153,1)',
      //     'rgba(197,222,130,1)',
      //     'rgba(208,228,177,1)',
      //   ]
      //   var num = row.elev;
      //   var height = 0;
      //   for (var i = 0; i < val.length; i++) {
      //     var fill, line;
      //     if (i > outlineList.length) {
      //       var len = outlineList.length - 1;
      //       fill = outlineList[len];
      //       line = outlineList[len];
      //     } else {
      //       fill = outlineList[i];
      //       line = outlineList[i];
      //     }
      //     var height = num - val[i].botdepth
      //     var layer = Viewer.entities.add({
      //       position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]),
      //       tag: 'Histogram',
      //       properties: val[i],
      //       ellipse: {
      //         semiMinorAxis: 1.0, //短轴
      //         semiMajorAxis: 1.0, //长轴
      //         height: height, //拉伸高度    elev  gwaterdep
      //         extrudedHeight: num, //离地高度
      //         rotation: Cesium.Math.toRadians(0), //旋转
      //         fill: true, //是否显示圆的填充
      //         material: Cesium.Color.fromCssColorString(line), //圆的颜色,
      //         outline: false, //是否显示圆轮廓
      //       },
      //     });
      //     num -= val[i].botdepth;
      //     this.$store.state.histogramLayer.push(layer)
      //     sgworld.Navigate.flyToObj(layer)
      //   }
      //   window.histogramHandler = new Cesium.ScreenSpaceEventHandler(
      //     sgworld.Viewer.scene.canvas
      //   )
      //   var that = this;
      //   window.histogramHandler.setInputAction((event) => {
      //     // var ellipsoid = sgworld.Viewer.scene.globe.ellipsoid;
      //     // var cartesian = sgworld.Viewer.scene.camera.pickEllipsoid(event.endPosition, ellipsoid);
      //     var pick = sgworld.Viewer.scene.pick(event.endPosition);
      //     var selectedEntity = null;
      //     if (Cesium.defined(pick)) {
      //       if (pick && pick.id && pick.id.tag && pick.id.tag == "Histogram") {
      //         that.$store.state.propertiesInfo = {
      //           title: pick.id.properties._exppointid._value,
      //           name: pick.id.properties._geoname._value,
      //           type: pick.id.properties.geotype._value,
      //           botdepth: pick.id.properties._botdepth._value,
      //           describe: pick.id.properties._describe._value,
      //         }
      //         that.$store.state.propertiesFlag = "2"
      //       } else {
      //         that.$store.state.propertiesFlag = null
      //       }
      //     } else {
      //       that.$store.state.propertiesFlag = null
      //     }
      //   }, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
      // } else {
      //   var msg = row.exppointid + " 没勘探点地层表数据,无法生成柱状图"
      //   this.$message.error(msg);
      // }
    },
    async spaceLocation(index, row) {
      var param = {
src/components/Screen/ProjectTree.vue
@@ -10,6 +10,7 @@
      suffix-icon="el-icon-search"
      v-model="filterText"
      size="mini"
      :filter-node-method="filterNode"
    >
    </el-input>
    <div class="tree-container">
@@ -23,6 +24,7 @@
        class="el-tree"
        @check="handleCheckChange"
        :filter-node-method="filterNode"
        @node-click="handleLeftclick"
      >
        <div
          style="display: flex"
@@ -77,7 +79,7 @@
<script>
import { right_menu, right_list, image_layer } from "@/assets/js/index.js"
import { perms_selectLayers } from "@/api/api.js"
import { perms_selectLayers, comprehensive_selectPubById } from "@/api/api.js"
export default {
  data() {
@@ -85,7 +87,7 @@
      treeData: [],
      defaultProps: {
        children: "children",
        label: "label",
        label: "cnName",
      },
      typeIndex: null,
      leftMenuOpen: false,
@@ -100,6 +102,7 @@
      isMenuLayer: true,
      openEcharts: false,
      filterText: "",
      mptLayer: [],
    }
  },
@@ -119,6 +122,12 @@
    },
  },
  methods: {
    // 查询
    filterNode(value, data) {
      if (!value) return true;
      return data.cnName.indexOf(value) !== -1;
    },
    setShowCheckedLayer() {
      var value = this.$refs.tree.getCheckedNodes();
      var std = [];
@@ -136,79 +145,365 @@
      if (data.code != 200) {
        return this.$message.error("图层列表查询失败")
      }
      var std = []
      var layer_list = []
      var layer_groups = []
      var layerData = [];
      for (var i in data.result) {
        if (data.result[i].type == 1) {
          layer_groups.push({
            id: data.result[i].id,
            label: data.result[i].cnName,
            type: data.result[i].type,
            isEdit: false,
            children: [],
          })
        } else if (data.result[i].type == 2) {
          if (data.result[i].url != null) {
            var layer_entity = {
              id: data.result[i].id,
              pid: data.result[i].pid,
              label: data.result[i].cnName,
              resource: data.result[i].url,
              type: data.result[i].type,
              isEdit: false,
            }
            layer_list.push(layer_entity)
            if (data.result[i].isShow == 1) {
              std.push(data.result[i].id)
              layerData.push(data.result[i])
              // this.setAddImageLayer(layer_entity)
            }
          }
        }
      }
      for (var i in layer_list) {
        for (var j in layer_groups) {
          if (layer_list[i].pid === layer_groups[j].id) {
            layer_groups[j].children.push(layer_list[i])
          }
        }
      }
      this.treeData = layer_groups
      var std = data.result;
      var that = this;
      var checkKey = [];
      this.$refs.tree.setCheckedKeys(std)
      this.setShowImageLayer(layerData)
      var val = std.filter((str) => {
        if (str.type == 1) {
          return str;
        }
        if (str.url != null && str.type == 2) {
          if (str.isShow == 1) {
            checkKey.push(str.id);
          }
          return str;
        }
      });
      var value = std.filter((str) => {
        if (str.url != null && str.type == 2 && str.isShow == 1) {
          return str;
        }
      })
      this.$refs.tree.setCheckedKeys(checkKey)
      var res = this.setTreeData(val);
      this.treeData = res
      this.setShowImageLayer(value)
    },
    setTreeData(source) {
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值
        // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2;
        // 由此循环多次后,就能形成相应的树形数据结构
        return father.pid == 0; // 返回一级菜单
      });
    },
    handleCheckChange(data, checked, indeterminate) {
      // if (data.children != null) return
      // var std = []
      // for (var i = 0; i < Viewer.imageryLayers._layers.length; i++) {
      //   var val_id = Viewer.imageryLayers._layers[i].imageryProvider.name
      //   if (val_id == data.label) {
      //     std.push(data.label)
      //     const img_layer = Viewer.imageryLayers._layers[i]
      //     img_layer.show = checked
      // var wmsLayer = [];
      // var tilesetLayer = [];
      // var tmsLayer = [];
      // var mptLayer = [];
      // for (var i in data) {
      //   if (data[i].type == 2) {
      //     switch (data[i].serveType) {
      //       case "WMS":
      //         wmsLayer.push(data[i])
      //         break;
      //       case "Tileset":
      //         tilesetLayer.push(data[i])
      //         break;
      //       case "TMS":
      //         tmsLayer.push(data[i])
      //         break;
      //       case "Mpt":
      //         mptLayer.push(data[i])
      //         break;
      //     }
      //   }
      // }
      // if (std.length == 0 && checked == true) {
      //   this.setAddImageLayer(data)
      // }
      this.setClearWmsLayer()
      var value = this.$refs.tree.getCheckedNodes();
      var url = [];
      for (var i in value) {
        if (value[i].resource && value[i].type == 2) {
          url.push(value[i].resource)
      if (data.type == 1) {
        this.childOption = [];
        this.getchilds(data);
        var listWMS = [];
        var listWFS = [];
        var listTileset = [];
        var listTMS = [];
        var listMpt = [];
        for (var i in this.childOption) {
          switch (this.childOption[i].serveType) {
            case 'WMS':
              listWMS.push(this.childOption[i])
              break;
            case 'Tileset':
              listTileset.push(this.childOption[i])
              break;
            case 'Mpt':
              listMpt.push(this.childOption[i])
              break;
            case 'TMS':
              listTMS.push(this.childOption[i])
              break;
          }
        }
        this.setShowWMSLayer(listWMS);
        this.setShowTilesetLayer(listTileset);
        this.setShowMptLayer(listMpt);
        this.setShowTMSLayer(listTMS);
      } else if (data.type == 2) {
        if (data.serveType == "WMS") {
          this.setShowWMSLayer([data]);
        } else if (data.serveType == "Tileset") {
          this.setShowTilesetLayer([data]);
        } else if (data.serveType == "Mpt") {
          this.setShowMptLayer([data]);
        } else if (data.serveType == "TMS") {
          this.setShowTMSLayer([data]);
        }
      }
    },
    handleLeftclick(data, node) {
      if (node.checked == true) {
        if (data.serveType == 'Tileset') {
          for (var i in Viewer.scene.primitives._primitives) {
            if (
              Viewer.scene.primitives._primitives[i].id == data.cnName
            ) {
              Viewer.flyTo(Viewer.scene.primitives._primitives[i]);
            }
          }
        }
      }
    },
    getchilds(source) {
      if (source.children) {
        var child = source.children
        for (var i in child) {
          if (child[i].children) {
            this.getchilds(child[i])
          } else {
            this.childOption.push(child[i])
          }
        }
      } else {
        this.childOption.push(source)
      }
    },
    setAddTMSLayers(res) {
      var url = res.url;
      if (res.url.indexOf("{host}") != -1) {
        url = res.url.replace("{host}", iisHost);
      }
      if (res.pubid && res.pubid > 0) {
        this.setQueryPubid(res);
      } else {
        var layer = Viewer.imageryLayers.addImageryProvider(
          new Cesium.UrlTemplateImageryProvider({
            url: url,
            maximumLevel: 18,
          })
        );
        layer.name = res.cnName;
        setTimeout(() => {
          this.getWMSLayer();
        }, 100);
      }
    },
    async setQueryPubid(res) {
      const data = await comprehensive_selectPubById({ id: res.pubid })
      if (data.code != 200) {
      } else {
        var url = data.result.url;
        if (res.url.indexOf("{host}") != -1) {
          url = res.url.replace("{host}", iisHost);
        }
        var layer = Viewer.imageryLayers.addImageryProvider(
          new Cesium.UrlTemplateImageryProvider({
            url: url,
            maximumLevel: 18,
          })
        );
        layer.name = res.cnName;
        if (data.result.geom) {
          var wkt = this.$wkt.parse(data.result.geom);
          Viewer.camera.flyTo({
            destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000),
          });
        }
        setTimeout(() => {
          this.getWMSLayer();
        }, 100);
      }
    },
    setShowTMSLayer(result) {
      var value = this.$refs.tree.getCheckedNodes();
      var std = [];
      for (var i in value) {
        std.push(value[i].id)
      }
      for (var i in result) {
        var tile = result[i]
        if (std.indexOf(tile.id) != -1) {
          this.setAddTMSLayers(tile)
        } else {
          for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) {
            var val_id = window.Viewer.imageryLayers._layers[i].name;
            if (val_id == tile.cnName) {
              window.Viewer.imageryLayers.remove(
                window.Viewer.imageryLayers._layers[i]
              );
            }
          }
        }
      }
    },
    setShowMptLayer(result) {
      var value = this.$refs.tree.getCheckedNodes();
      var std = [];
      for (var i in value) {
        std.push(value[i].id)
      }
      for (var i in result) {
        var tile = result[i]
        if (std.indexOf(tile.id) != -1) {
          this.setAddMPTLayers(tile)
        } else {
          for (var i in this.mptLayer) {
            if (this.mptLayer[i].treeobj.name == tile.cnName) {
              this.mptLayer[i].deleteObject();
              this.mptLayer.splice(i, 1)
            }
          }
        }
      }
    },
    setAddMPTLayers(res) {
      if (res.url.indexOf("{host}") != -1) {
        res.url = res.url.replace("{host}", iisHost);
      }
      var url = res.url.split(';')
      var layer = sgworld.Creator.createImageryProvider(res.cnName, "wms", {
        url: url[0],
        layers: url[1]
      }, "0", undefined, true, "");
      this.mptLayer.push(layer)
      setTimeout(() => {
        this.getWMSLayer();
      }, 100);
    },
    getWMSLayer() {
      var value = this.$refs.tree.getCheckedNodes();
      var std = [];
      for (var i in value) {
        if (value[i].type == 2 && value[i].serveType == "WMS") {
          std.push(value[i])
        }
      }
      this.setShowWMSLayer(std);
    },
    setShowTilesetLayer(result) {
      var value = this.$refs.tree.getCheckedNodes();
      var std = [];
      for (var i in value) {
        std.push(value[i].id)
      }
      for (var i in result) {
        var tile = result[i]
        if (std.indexOf(tile.id) != -1) {
          this.setAddTilesetLayers(tile)
        } else {
          for (var j in Viewer.scene.primitives._primitives) {
            if (Viewer.scene.primitives._primitives[j].id == tile.cnName) {
              Viewer.scene.primitives.remove(Viewer.scene.primitives._primitives[j])
            }
          }
        }
      }
    },
    setAddTilesetLayers(res) {
      var url;
      if (res.url.indexOf("{host}") != -1) {
        url = res.url.replace("{host}", iisHost);
      } else {
        url = modelUrl + "/" + res.url
      }
      var tileset = Viewer.scene.primitives.add(
        new Cesium.Cesium3DTileset({
          name: res.cnName,
          url: url, //192.168.20.106,to4
          maximumScreenSpaceError: 64, // 最大屏幕空间错误:16
          maximumMemoryUsage: 768, // 最大内存:512
          dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
          skipLevelOfDetail: true, // 在遍历时候跳过详情:false
        })
      );
      tileset.readyPromise.then((tileset) => {
        tileset.id = res.cnName;
        tileset.layerId = res.id;
        this.getTilesetArgs(tileset, res);
      });
    },
    async getTilesetArgs(tileset, res) {
      if (res.pubid > 0) {
        const data = await comprehensive_selectPubById({ id: res.pubid })
        if (data.code != 200) {
        } else {
          this.reload(tileset, data.result.json)
        }
      } else {
        this.tileSet(tileset, parseFloat(res.elev))
      }
    },
    reload(tileset, res) {
      var vm = JSON.parse(res)
      var pos = Cesium.Cartesian3.fromDegrees(vm.lon, vm.lat, vm.height);
      var converter = Cesium.Transforms.eastNorthUpToFixedFrame;
      var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(vm.yaw), 0, 0);
      var matrix = Cesium.Transforms.headingPitchRollToFixedFrame(pos, hpr, Cesium.Ellipsoid.WGS84, converter);
      tileset._root.transform = matrix;
      Viewer.flyTo(tileset);
    },
    tileSet(tileset, height) {
      //3dtile模型的边界球体
      var boundingSphere = tileset.boundingSphere;
      //迪卡尔空间直角坐标=>地理坐标(弧度制)
      var cartographic_original = Cesium.Cartographic.fromCartesian(boundingSphere.center);
      //地理坐标(弧度制)=>迪卡尔空间直角坐标
      var Cartesian3_original = Cesium.Cartesian3.fromRadians(cartographic_original.longitude, cartographic_original.latitude, cartographic_original.height);
      var Cartesian3_offset = Cesium.Cartesian3.fromRadians(cartographic_original.longitude, cartographic_original.latitude, height);
      //获得地面和offset的转换
      var translation = Cesium.Cartesian3.subtract(Cartesian3_offset, Cartesian3_original, new Cesium.Cartesian3());
      //修改模型矩阵
      tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
      Viewer.flyTo(tileset);
    },
    setShowWMSLayer(res) {
      var url = [];
      this.setClearWmsLayer();
      for (var i in res) {
        if (res[i].url) {
          url.push(res[i].url)
        }
      }
      url = url.reverse();
      this.setAddImageLayer(url)
    },
    setShowImageLayer(res) {
      this.setClearWmsLayer()
      var url = [];
      for (var i in res) {
        url.push(res[i].enName)
@@ -260,10 +555,10 @@
        Viewer.imageryLayers._layers[3].show = true
      }
    },
    filterNode(value, data) {
      if (!value) return true
      return data.label.indexOf(value) !== -1
    },
    // filterNode(value, data) {
    //   if (!value) return true
    //   return data.label.indexOf(value) !== -1
    // },
  },
}
</script>
src/components/mapsdk.vue
@@ -337,14 +337,7 @@
        v-show="showLengendDialog"
      >
        <el-card class="box-card">
          <!-- <div
            class="lengend_color"
            style="height:205px"
          >
          </div> -->
          <div class="lengendBox">
            <div>
              <img
                class="lengendImg"
@@ -358,8 +351,65 @@
              <div>52.5°</div>
              <div>70°</div>
            </div>
          </div>
        </el-card>
      </div>
      <div
        class="HistLeng"
        v-show="$store.state.histLenged"
      >
        <el-card class="box-card">
          <table>
            <tr>
              <td>粉质黏土</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(139,106,77,1)">
                </div>
              </td>
            </tr>
            <tr>
              <td>淤泥质粉土</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(141,85,69,1)">
                </div>
              </td>
            </tr>
            <tr>
              <td>圆砾</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(102,166,184,1)">
                </div>
              </td>
            </tr>
            <tr>
              <td>卵石</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(54,83,173,1)">
                </div>
              </td>
            </tr>
            <tr>
              <td>泥岩</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(47,30,13,1)">
                </div>
              </td>
            </tr>
            <tr>
              <td>细砂</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(93,88,15,1)">
                </div>
              </td>
            </tr>
            <tr>
              <td>中砂</td>
              <td>
                <div style="width:100px;height:20px;background:rgba(164,140,21,1)">
                </div>
              </td>
            </tr>
          </table>
        </el-card>
      </div>
      <!--属性信息弹窗-->
@@ -1691,7 +1741,12 @@
      position: absolute;
      z-index: 40;
    }
    .HistLeng {
      z-index: 40;
      position: absolute;
      right: 115px;
      bottom: 10px;
    }
    .lengend {
      width: 300px;
      z-index: 40;
src/store/index.js
@@ -70,7 +70,8 @@
    catModelInfo: null,
    showPopBoxFlag: false,
    pickoption: null,
    previewLayer: null
    previewLayer: null,
    histLenged: false,
  },
  mutations: {
    //获取权限合集
src/views/Tools/queryinfo.vue
@@ -11,7 +11,10 @@
      top="calc(100% - 470px) "
    >
      <div>
        <div style="width:940px;height:400px;" v-drag>
        <div
          style="width:940px;height:400px;"
          v-drag
        >
          <map-menu-pop v-if="$store.state.mapPopBoxFlag == '1'" />
          <map-space-pop v-if="$store.state.mapPopBoxFlag == '2'" />
          <pipe-line-analy v-if="$store.state.mapPopBoxFlag == '3'" />
@@ -120,6 +123,8 @@
        )
        window.histogramHandler = null
      }
      this.$store.state.histLenged = false;
    },
    // 打开弹窗
    open(title, value, style = {}) {