suerprisePlus
2024-06-27 6ae4841b48665145aa469d574fbadb988a9c498c
src/assets/js/map/modelLayer.js
@@ -23,16 +23,15 @@
    this.modelBase = config.modelBase;
    this.getSettingPublicKey();
    const token = getToken();
    console.log("token", token);
    if (token) {
      this.getModelLayerList();
    } else {
      getPublickey().then((response) => {
        const password = this.modelBase.password;
        const userId = this.modelBase.userId;
        const publickey = response.data;
        this.publickey = response.data;
        const encrypt = new JSEncrypt();
        encrypt.setPublicKey(publickey);
        encrypt.setPublicKey(this.publickey);
        let encrypted = encrypt.encrypt(password.substring(0, 50)) + "";
        let submit = {
          userid: userId,
@@ -92,6 +91,53 @@
      }
    });
  },
  getQueryGroupBy(layer, filed, ction) {
    const layerId = this.layers.filter((item) => {
      if (item.name == layer) {
        return item;
      }
    });
    if (layerId.length <= 0) {
      return;
    }
    const url =
      config.modelBase.url +
      config.modelBase.geo +
      "/entitydbdata/query/entity";
    const obj = [
      {
        type: "count",
        field: filed,
        outfield: "count_" + filed
      }
    ];
    axios
      .post(
        url,
        {
          layerid: layerId[0].id,
          dbid: this.dbid,
          token: getToken(),
          statistics: JSON.stringify(obj),
          containCount: true,
          groupby: filed
        },
        {
          headers: {
            Authorization: getToken(),
            "Content-Type": "application/x-www-form-urlencoded"
          }
        }
      )
      .then((response) => {
        ction(response);
      })
      .catch((error) => {
        error;
      });
  },
  setLayerQuery() {
    const token = getToken();
    this.geom = mapConfig.setPointToCrical(120.27, 14.79, null);
@@ -178,7 +224,6 @@
        }
      )
      .then((response) => {
        console.log("List", response);
        that.setLayerFilter(response.data.data.items);
      });
  },
@@ -193,7 +238,6 @@
    const a = [];
    // rs.filter((item) => {
    //   if (item.targettype == "军事目标") {
    //     console.log(item);
    //     // a.push(["${id} === '" + item.sid + "'",  "color('#FF0000', 0.5)"]);
    //   }
    // });
@@ -204,7 +248,6 @@
      'color("purple", 0.5)'
    ]);
    a.push(["true", "color('#E8F1F2', 0.5)"]);
    console.log(tileset);
    tileset.style = new Cesium.Cesium3DTileStyle({
      // color: "vec4(1.0,1.0,1.0, 1.0)", // 红色
      color: {
@@ -219,11 +262,9 @@
    });
    //   window.Cesium.when(tileset.readyPromise, function(tileset) {
    //     var tilesetId = tileset.id;
    //     console.log('Tileset ID: ' + tilesetId);
    // });
    //   tileset.readyPromise.then( (item)=> {
    //     tileset.tileVisible.addEventListener( (tile)=> {
    //       console.log(tile);
    //     })
    //   })
  }