maxiaoxiao 11 місяців тому
батько
коміт
506ceb3684

+ 1 - 1
src/views/ConstructionApplication3D/billboard/addBiillboardModel.vue

@@ -577,7 +577,7 @@ export default {
         templateCentre: {},
         templateBottom: {},
       },
-      options: window.billboardReviewList,
+      options: window.billboardReviewList.filter((c) => c.id != "wew1"),
       /**
        * 编辑句柄
        */

+ 353 - 349
src/views/ConstructionApplication3D/billboard/billboardDesign.vue

@@ -229,16 +229,18 @@ export default {
      * @param Mitem 模型实体
      */
     locationSingleModel(Mitem) {
-      let entitie = viewer.entities.getById("pointBillboard_" + Mitem.id);
-      if (entitie) {
-        viewer.flyTo(entitie);
-      } else {
-        //渲染单个广告牌
-        // if (billboardModel.id == Mitem.id) {
-        this.DrawBillboard(Mitem);
+      if (Mitem.isAddModel) {
         let entitie = viewer.entities.getById("pointBillboard_" + Mitem.id);
-        viewer.flyTo(entitie);
-        // }
+        if (entitie) {
+          viewer.flyTo(entitie);
+        } else {
+          //渲染单个广告牌
+          // if (billboardModel.id == Mitem.id) {
+          this.DrawBillboard(Mitem);
+          let entitie = viewer.entities.getById("pointBillboard_" + Mitem.id);
+          viewer.flyTo(entitie);
+          // }
+        }
       }
     },
     /**
@@ -400,376 +402,378 @@ export default {
      * 绘制广告牌
      */
     DrawBillboard(billboardModel) {
-      if (billboardModel.template) {
-        if (typeof billboardModel.template === "string") {
-          billboardModel.template = JSON.parse(billboardModel.template);
+      if (billboardModel.isAddModel) {
+        if (billboardModel.template) {
+          if (typeof billboardModel.template === "string") {
+            billboardModel.template = JSON.parse(billboardModel.template);
+          }
+        } else {
+          billboardModel.template = {};
         }
-      } else {
-        billboardModel.template = {};
-      }
 
-      if (billboardModel.templateBottom) {
-        if (typeof billboardModel.templateBottom === "string") {
-          billboardModel.templateBottom = JSON.parse(
-            billboardModel.templateBottom
-          );
+        if (billboardModel.templateBottom) {
+          if (typeof billboardModel.templateBottom === "string") {
+            billboardModel.templateBottom = JSON.parse(
+              billboardModel.templateBottom
+            );
+          }
+        } else {
+          billboardModel.templateBottom = {};
         }
-      } else {
-        billboardModel.templateBottom = {};
-      }
-      if (billboardModel.templateCentre) {
-        if (typeof billboardModel.templateCentre === "string") {
-          billboardModel.templateCentre = JSON.parse(
-            billboardModel.templateCentre
-          );
+        if (billboardModel.templateCentre) {
+          if (typeof billboardModel.templateCentre === "string") {
+            billboardModel.templateCentre = JSON.parse(
+              billboardModel.templateCentre
+            );
+          }
+        } else {
+          billboardModel.templateCentre = {};
         }
-      } else {
-        billboardModel.templateCentre = {};
-      }
-      if (billboardModel.templateTop) {
-        if (typeof billboardModel.templateTop === "string") {
-          billboardModel.templateTop = JSON.parse(billboardModel.templateTop);
+        if (billboardModel.templateTop) {
+          if (typeof billboardModel.templateTop === "string") {
+            billboardModel.templateTop = JSON.parse(billboardModel.templateTop);
+          }
+        } else {
+          billboardModel.templateTop = {};
         }
-      } else {
-        billboardModel.templateTop = {};
-      }
 
-      debugger;
-      var newposition = Cesium.Cartesian3.fromDegrees(
-        billboardModel.x,
-        billboardModel.y,
-        billboardModel.z
-      );
+        debugger;
+        var newposition = Cesium.Cartesian3.fromDegrees(
+          billboardModel.x,
+          billboardModel.y,
+          billboardModel.z
+        );
 
-      if (billboardModel.template) {
-        var imageurl = "../../../../static/ModelData/billboard/1.jpg";
-        var modelurl = "../../../../static/ModelData/billboard/box.gltf";
-        switch (billboardModel.template.ModelType) {
-          //矩形广告
-          case "rectangleBillboard":
-            var orientation = Cesium.Transforms.headingPitchRollQuaternion(
-              newposition,
-              new Cesium.HeadingPitchRoll(
-                Cesium.Math.toRadians(billboardModel.rotateZ),
-                Cesium.Math.toRadians(billboardModel.rotateY),
-                Cesium.Math.toRadians(billboardModel.rotateX)
-              )
-            );
-            //计算当前实体的xyz
-            var p = Cesium.Cartesian3.fromDegrees(
-              Number(billboardModel.templateTop.x),
-              Number(billboardModel.templateTop.y),
-              Number(billboardModel.templateTop.z)
-            );
-            var topentity = viewer.entities.add({
-              id: "top_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: p,
-              /**
-               * 长方体
-               */
-              box: {
-                dimensions: new Cesium.Cartesian3(
-                  Number(billboardModel.templateTop.xL),
-                  Number(billboardModel.templateTop.zL),
-                  Number(billboardModel.templateTop.yL)
-                ),
+        if (billboardModel.template) {
+          var imageurl = "../../../../static/ModelData/billboard/1.jpg";
+          var modelurl = "../../../../static/ModelData/billboard/box.gltf";
+          switch (billboardModel.template.ModelType) {
+            //矩形广告
+            case "rectangleBillboard":
+              var orientation = Cesium.Transforms.headingPitchRollQuaternion(
+                newposition,
+                new Cesium.HeadingPitchRoll(
+                  Cesium.Math.toRadians(billboardModel.rotateZ),
+                  Cesium.Math.toRadians(billboardModel.rotateY),
+                  Cesium.Math.toRadians(billboardModel.rotateX)
+                )
+              );
+              //计算当前实体的xyz
+              var p = Cesium.Cartesian3.fromDegrees(
+                Number(billboardModel.templateTop.x),
+                Number(billboardModel.templateTop.y),
+                Number(billboardModel.templateTop.z)
+              );
+              var topentity = viewer.entities.add({
+                id: "top_billboard_" + billboardModel.id,
+                name: "gltf",
                 show: true,
-                material: Cesium.Color.LIGHTGREEN,
-              },
-              orientation: orientation,
-            });
-            entityList.push(topentity);
+                position: p,
+                /**
+                 * 长方体
+                 */
+                box: {
+                  dimensions: new Cesium.Cartesian3(
+                    Number(billboardModel.templateTop.xL),
+                    Number(billboardModel.templateTop.zL),
+                    Number(billboardModel.templateTop.yL)
+                  ),
+                  show: true,
+                  material: Cesium.Color.LIGHTGREEN,
+                },
+                orientation: orientation,
+              });
+              entityList.push(topentity);
 
-            break;
-          // 立杆型广告
-          case "postsBillboard":
-            var orientation = Cesium.Transforms.headingPitchRollQuaternion(
-              newposition,
-              new Cesium.HeadingPitchRoll(
-                Cesium.Math.toRadians(billboardModel.rotateZ),
-                Cesium.Math.toRadians(billboardModel.rotateY),
-                Cesium.Math.toRadians(billboardModel.rotateX)
-              )
-            );
-            var c_p = Cesium.Cartesian3.fromDegrees(
-              billboardModel.templateCentre.x,
-              billboardModel.templateCentre.y,
-              billboardModel.templateCentre.z
-            );
-            var Centreentity = viewer.entities.add({
-              id: "Centre_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: c_p,
-              /**
-               * 圆柱
-               */
-              cylinder: {
-                length: billboardModel.templateCentre.yL, //圆柱体长度
-                topRadius: billboardModel.templateCentre.rL, //圆柱顶部半径
-                bottomRadius: billboardModel.templateCentre.rL, //圆柱体底部半径
-                material: Cesium.Color.LIGHTGREEN,
-                shadows: Cesium.ShadowMode.DISABLED, //指定圆柱体是否从每个光源投射或接收阴影
-              },
-              orientation: Cesium.Transforms.headingPitchRollQuaternion(
+              break;
+            // 立杆型广告
+            case "postsBillboard":
+              var orientation = Cesium.Transforms.headingPitchRollQuaternion(
                 newposition,
                 new Cesium.HeadingPitchRoll(
                   Cesium.Math.toRadians(billboardModel.rotateZ),
-                  Cesium.Math.toRadians(0),
-                  Cesium.Math.toRadians(0)
+                  Cesium.Math.toRadians(billboardModel.rotateY),
+                  Cesium.Math.toRadians(billboardModel.rotateX)
                 )
-              ),
-            });
-            entityList.push(Centreentity);
+              );
+              var c_p = Cesium.Cartesian3.fromDegrees(
+                billboardModel.templateCentre.x,
+                billboardModel.templateCentre.y,
+                billboardModel.templateCentre.z
+              );
+              var Centreentity = viewer.entities.add({
+                id: "Centre_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: c_p,
+                /**
+                 * 圆柱
+                 */
+                cylinder: {
+                  length: billboardModel.templateCentre.yL, //圆柱体长度
+                  topRadius: billboardModel.templateCentre.rL, //圆柱顶部半径
+                  bottomRadius: billboardModel.templateCentre.rL, //圆柱体底部半径
+                  material: Cesium.Color.LIGHTGREEN,
+                  shadows: Cesium.ShadowMode.DISABLED, //指定圆柱体是否从每个光源投射或接收阴影
+                },
+                orientation: Cesium.Transforms.headingPitchRollQuaternion(
+                  newposition,
+                  new Cesium.HeadingPitchRoll(
+                    Cesium.Math.toRadians(billboardModel.rotateZ),
+                    Cesium.Math.toRadians(0),
+                    Cesium.Math.toRadians(0)
+                  )
+                ),
+              });
+              entityList.push(Centreentity);
 
-            //计算当前实体的xyz
+              //计算当前实体的xyz
 
-            var t_p = Cesium.Cartesian3.fromDegrees(
-              Number(billboardModel.templateTop.x),
-              Number(billboardModel.templateTop.y),
-              Number(billboardModel.templateTop.z)
-            );
-            var topentity = viewer.entities.add({
-              id: "top_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: t_p,
-              /**
-               * 矩形
-               */
-              box: {
-                dimensions: new Cesium.Cartesian3(
-                  Number(billboardModel.templateTop.xL),
-                  Number(billboardModel.templateTop.zL),
-                  Number(billboardModel.templateTop.yL)
+              var t_p = Cesium.Cartesian3.fromDegrees(
+                Number(billboardModel.templateTop.x),
+                Number(billboardModel.templateTop.y),
+                Number(billboardModel.templateTop.z)
+              );
+              var topentity = viewer.entities.add({
+                id: "top_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: t_p,
+                /**
+                 * 矩形
+                 */
+                box: {
+                  dimensions: new Cesium.Cartesian3(
+                    Number(billboardModel.templateTop.xL),
+                    Number(billboardModel.templateTop.zL),
+                    Number(billboardModel.templateTop.yL)
+                  ),
+                  material: Cesium.Color.LIGHTGREEN,
+                  // outline: false,
+                  // outlineColor: Cesium.Color.SPRINGGREEN,
+                  // outlineWidth: 1,
+                },
+                orientation: orientation,
+              });
+              entityList.push(topentity);
+
+              break;
+            //底座型立杆广告
+            case "ColumnWithaseBillboard":
+              var orientation = Cesium.Transforms.headingPitchRollQuaternion(
+                newposition,
+                new Cesium.HeadingPitchRoll(
+                  Cesium.Math.toRadians(billboardModel.rotateZ),
+                  Cesium.Math.toRadians(billboardModel.rotateY),
+                  Cesium.Math.toRadians(billboardModel.rotateX)
+                )
+              );
+              var b_p = Cesium.Cartesian3.fromDegrees(
+                billboardModel.templateBottom.x,
+                billboardModel.templateBottom.y,
+                billboardModel.templateBottom.z
+              );
+              var bottomentity = viewer.entities.add({
+                id: "bottom_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: b_p,
+                /**
+                 * 矩形
+                 */
+                box: {
+                  dimensions: new Cesium.Cartesian3(
+                    billboardModel.templateBottom.xL,
+                    billboardModel.templateBottom.zL,
+                    billboardModel.templateBottom.yL
+                  ),
+                  material: Cesium.Color.LIGHTGREEN,
+                  // outline: false,
+                  // outlineColor: Cesium.Color.SPRINGGREEN,
+                  // outlineWidth: 1,
+                },
+                orientation: Cesium.Transforms.headingPitchRollQuaternion(
+                  newposition,
+                  new Cesium.HeadingPitchRoll(
+                    Cesium.Math.toRadians(billboardModel.rotateZ),
+                    Cesium.Math.toRadians(0),
+                    Cesium.Math.toRadians(0)
+                  )
                 ),
-                material: Cesium.Color.LIGHTGREEN,
-                // outline: false,
-                // outlineColor: Cesium.Color.SPRINGGREEN,
-                // outlineWidth: 1,
-              },
-              orientation: orientation,
-            });
-            entityList.push(topentity);
+              });
+              entityList.push(bottomentity);
 
-            break;
-          //底座型立杆广告
-          case "ColumnWithaseBillboard":
-            var orientation = Cesium.Transforms.headingPitchRollQuaternion(
-              newposition,
-              new Cesium.HeadingPitchRoll(
-                Cesium.Math.toRadians(billboardModel.rotateZ),
-                Cesium.Math.toRadians(billboardModel.rotateY),
-                Cesium.Math.toRadians(billboardModel.rotateX)
-              )
-            );
-            var b_p = Cesium.Cartesian3.fromDegrees(
-              billboardModel.templateBottom.x,
-              billboardModel.templateBottom.y,
-              billboardModel.templateBottom.z
-            );
-            var bottomentity = viewer.entities.add({
-              id: "bottom_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: b_p,
-              /**
-               * 矩形
-               */
-              box: {
-                dimensions: new Cesium.Cartesian3(
-                  billboardModel.templateBottom.xL,
-                  billboardModel.templateBottom.zL,
-                  billboardModel.templateBottom.yL
+              var c_p = Cesium.Cartesian3.fromDegrees(
+                billboardModel.templateCentre.x,
+                billboardModel.templateCentre.y,
+                billboardModel.templateCentre.z
+              );
+              var Centreentity = viewer.entities.add({
+                id: "Centre_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: c_p,
+                /**
+                 * 圆柱
+                 */
+                cylinder: {
+                  length: billboardModel.templateCentre.yL, //圆柱体长度
+                  topRadius: billboardModel.templateCentre.rL, //圆柱顶部半径
+                  bottomRadius: billboardModel.templateCentre.rL, //圆柱体底部半径
+                  material: Cesium.Color.LIGHTGREEN,
+                  shadows: Cesium.ShadowMode.DISABLED, //指定圆柱体是否从每个光源投射或接收阴影
+                },
+                orientation: Cesium.Transforms.headingPitchRollQuaternion(
+                  newposition,
+                  new Cesium.HeadingPitchRoll(
+                    Cesium.Math.toRadians(billboardModel.rotateZ),
+                    Cesium.Math.toRadians(0),
+                    Cesium.Math.toRadians(0)
+                  )
                 ),
-                material: Cesium.Color.LIGHTGREEN,
-                // outline: false,
-                // outlineColor: Cesium.Color.SPRINGGREEN,
-                // outlineWidth: 1,
-              },
-              orientation: Cesium.Transforms.headingPitchRollQuaternion(
+              });
+              entityList.push(Centreentity);
+
+              var t_p = Cesium.Cartesian3.fromDegrees(
+                Number(billboardModel.templateTop.x),
+                Number(billboardModel.templateTop.y),
+                Number(billboardModel.templateTop.z)
+              );
+
+              var topentity = viewer.entities.add({
+                id: "top_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: t_p,
+                /**
+                 * 矩形
+                 */
+                box: {
+                  dimensions: new Cesium.Cartesian3(
+                    Number(billboardModel.templateTop.xL),
+                    Number(billboardModel.templateTop.zL),
+                    Number(billboardModel.templateTop.yL)
+                  ),
+                  material: Cesium.Color.LIGHTGREEN,
+                  // outline: false,
+                  // outlineColor: Cesium.Color.SPRINGGREEN,
+                  // outlineWidth: 1,
+                },
+                orientation: orientation,
+              });
+              entityList.push(topentity);
+
+              break;
+            //实物型广告(模型型)
+            case "ModelBillboard":
+              var orientation = Cesium.Transforms.headingPitchRollQuaternion(
                 newposition,
                 new Cesium.HeadingPitchRoll(
                   Cesium.Math.toRadians(billboardModel.rotateZ),
-                  Cesium.Math.toRadians(0),
-                  Cesium.Math.toRadians(0)
+                  Cesium.Math.toRadians(billboardModel.rotateY),
+                  Cesium.Math.toRadians(billboardModel.rotateX)
                 )
-              ),
-            });
-            entityList.push(bottomentity);
-
-            var c_p = Cesium.Cartesian3.fromDegrees(
-              billboardModel.templateCentre.x,
-              billboardModel.templateCentre.y,
-              billboardModel.templateCentre.z
-            );
-            var Centreentity = viewer.entities.add({
-              id: "Centre_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: c_p,
-              /**
-               * 圆柱
-               */
-              cylinder: {
-                length: billboardModel.templateCentre.yL, //圆柱体长度
-                topRadius: billboardModel.templateCentre.rL, //圆柱顶部半径
-                bottomRadius: billboardModel.templateCentre.rL, //圆柱体底部半径
-                material: Cesium.Color.LIGHTGREEN,
-                shadows: Cesium.ShadowMode.DISABLED, //指定圆柱体是否从每个光源投射或接收阴影
-              },
-              orientation: Cesium.Transforms.headingPitchRollQuaternion(
+              );
+              var p = Cesium.Cartesian3.fromDegrees(
+                Number(billboardModel.templateTop.x),
+                Number(billboardModel.templateTop.y),
+                Number(billboardModel.templateTop.z)
+              );
+              var url = billboardModel.template.templateTopUrl || modelurl;
+              var entity = viewer.entities.add({
+                id: "top_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: p,
+                /**
+                 * 模型
+                 */
+                model: {
+                  uri: url,
+                  scale: billboardModel.templateTop.scaleL,
+                },
+                orientation: orientation,
+              });
+              entityList.push(entity);
+              break;
+            //图片型广告
+            case "imgBillboard":
+              var orientation = Cesium.Transforms.headingPitchRollQuaternion(
                 newposition,
                 new Cesium.HeadingPitchRoll(
                   Cesium.Math.toRadians(billboardModel.rotateZ),
-                  Cesium.Math.toRadians(0),
-                  Cesium.Math.toRadians(0)
+                  Cesium.Math.toRadians(billboardModel.rotateY),
+                  Cesium.Math.toRadians(billboardModel.rotateX)
                 )
-              ),
-            });
-            entityList.push(Centreentity);
-
-            var t_p = Cesium.Cartesian3.fromDegrees(
-              Number(billboardModel.templateTop.x),
-              Number(billboardModel.templateTop.y),
-              Number(billboardModel.templateTop.z)
-            );
-
-            var topentity = viewer.entities.add({
-              id: "top_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: t_p,
-              /**
-               * 矩形
-               */
-              box: {
-                dimensions: new Cesium.Cartesian3(
-                  Number(billboardModel.templateTop.xL),
-                  Number(billboardModel.templateTop.zL),
-                  Number(billboardModel.templateTop.yL)
-                ),
-                material: Cesium.Color.LIGHTGREEN,
-                // outline: false,
-                // outlineColor: Cesium.Color.SPRINGGREEN,
-                // outlineWidth: 1,
-              },
-              orientation: orientation,
-            });
-            entityList.push(topentity);
+              );
+              var p = Cesium.Cartesian3.fromDegrees(
+                Number(billboardModel.templateTop.x),
+                Number(billboardModel.templateTop.y),
+                Number(billboardModel.templateTop.z)
+              );
+              var url = billboardModel.template.templateTopUrl || imageurl;
+              var entity = viewer.entities.add({
+                id: "top_billboard_" + billboardModel.id,
+                name: "gltf",
+                show: true,
+                position: p,
+                /**
+                 * 广告牌
+                 */
+                billboard: {
+                  image: url,
+                  width: Number(billboardModel.templateTop.xL),
+                  height: Number(billboardModel.templateTop.yL),
+                  rotation: Number(billboardModel.rotateX),
+                  sizeInMeters: true,
+                },
+                orientation: orientation,
+              });
+              entityList.push(entity);
+              break;
+          }
 
-            break;
-          //实物型广告(模型型)
-          case "ModelBillboard":
-            var orientation = Cesium.Transforms.headingPitchRollQuaternion(
-              newposition,
-              new Cesium.HeadingPitchRoll(
-                Cesium.Math.toRadians(billboardModel.rotateZ),
-                Cesium.Math.toRadians(billboardModel.rotateY),
-                Cesium.Math.toRadians(billboardModel.rotateX)
-              )
-            );
-            var p = Cesium.Cartesian3.fromDegrees(
-              Number(billboardModel.templateTop.x),
-              Number(billboardModel.templateTop.y),
-              Number(billboardModel.templateTop.z)
-            );
-            var url = billboardModel.template.templateTopUrl || modelurl;
-            var entity = viewer.entities.add({
-              id: "top_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: p,
-              /**
-               * 模型
-               */
-              model: {
-                uri: url,
-                scale: billboardModel.templateTop.scaleL,
-              },
-              orientation: orientation,
-            });
-            entityList.push(entity);
-            break;
-          //图片型广告
-          case "imgBillboard":
-            var orientation = Cesium.Transforms.headingPitchRollQuaternion(
-              newposition,
-              new Cesium.HeadingPitchRoll(
-                Cesium.Math.toRadians(billboardModel.rotateZ),
-                Cesium.Math.toRadians(billboardModel.rotateY),
-                Cesium.Math.toRadians(billboardModel.rotateX)
-              )
-            );
-            var p = Cesium.Cartesian3.fromDegrees(
+          var h = 0;
+          if (billboardModel.templateTop.yL) {
+            h = Number(billboardModel.templateTop.yL) / 2;
+          }
+          viewer.entities.removeById("pointBillboard_" + billboardModel.id);
+          lodash.remove(
+            entityList,
+            (entity) => entity.id === "pointBillboard_" + billboardModel.id
+          );
+          const point = viewer.entities.add({
+            id: "pointBillboard_" + billboardModel.id,
+            //点
+            position: Cesium.Cartesian3.fromDegrees(
               Number(billboardModel.templateTop.x),
               Number(billboardModel.templateTop.y),
-              Number(billboardModel.templateTop.z)
-            );
-            var url = billboardModel.template.templateTopUrl || imageurl;
-            var entity = viewer.entities.add({
-              id: "top_billboard_" + billboardModel.id,
-              name: "gltf",
-              show: true,
-              position: p,
-              /**
-               * 广告牌
-               */
-              billboard: {
-                image: url,
-                width: Number(billboardModel.templateTop.xL),
-                height: Number(billboardModel.templateTop.yL),
-                rotation: Number(billboardModel.rotateX),
-                sizeInMeters: true,
-              },
-              orientation: orientation,
-            });
-            entityList.push(entity);
-            break;
-        }
-
-        var h = 0;
-        if (billboardModel.templateTop.yL) {
-          h = Number(billboardModel.templateTop.yL) / 2;
-        }
-        viewer.entities.removeById("pointBillboard_" + billboardModel.id);
-        lodash.remove(
-          entityList,
-          (entity) => entity.id === "pointBillboard_" + billboardModel.id
-        );
-        const point = viewer.entities.add({
-          id: "pointBillboard_" + billboardModel.id,
-          //点
-          position: Cesium.Cartesian3.fromDegrees(
-            Number(billboardModel.templateTop.x),
-            Number(billboardModel.templateTop.y),
-            Number(billboardModel.templateTop.z) + h
-          ),
-          label: {
-            text: billboardModel.billboardName, //描述内容
-            font: "20px Sans-Serif", //字体大小 类型
-            fillColor: Cesium.Color.RED, //颜色
-            outlineColor: Cesium.Color.GOLD,
-            style: Cesium.LabelStyle.CENTER_LABEL,
-            // 垂直位置
-            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
-            // 中心位置
-            pixelOffset: new Cesium.Cartesian2(0, -10),
-            //设置背景颜色透明
-            backgroundColor: new Cesium.Color(0.0, 0.0, 0.0, 0.0),
-            //打开背景  打开背景 (不会被线段覆盖)
-            showBackground: true,
-            // heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
-            distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
-              0.0,
-              300.0
+              Number(billboardModel.templateTop.z) + h
             ),
-            heightReference: Cesium.HeightReference.NONE,
-          },
-        });
-        entityList.push(point);
+            label: {
+              text: billboardModel.billboardName, //描述内容
+              font: "20px Sans-Serif", //字体大小 类型
+              fillColor: Cesium.Color.RED, //颜色
+              outlineColor: Cesium.Color.GOLD,
+              style: Cesium.LabelStyle.CENTER_LABEL,
+              // 垂直位置
+              verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
+              // 中心位置
+              pixelOffset: new Cesium.Cartesian2(0, -10),
+              //设置背景颜色透明
+              backgroundColor: new Cesium.Color(0.0, 0.0, 0.0, 0.0),
+              //打开背景  打开背景 (不会被线段覆盖)
+              showBackground: true,
+              // heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
+              distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
+                0.0,
+                300.0
+              ),
+              heightReference: Cesium.HeightReference.NONE,
+            },
+          });
+          entityList.push(point);
+        }
       }
 
       // if (billboardModel.isAddModel) {

+ 26 - 4
src/views/ConstructionApplication3D/projectManagement/projectManagement.vue

@@ -251,7 +251,7 @@
                               <el-button
                                 type="primary"
                                 size="mini"
-                                @click.stop="normAnalysis(itemModel)"
+                                @click.stop="normAnalysis(item, itemModel)"
                                 >指标分析
                               </el-button>
                             </el-col>
@@ -2473,9 +2473,31 @@ export default {
      * 指标分析
      * @param Minfo
      */
-    normAnalysis(Minfo) {
+    normAnalysis(info, Minfo) {
       let that = this;
+      if (!info.plotnumber) {
+        that.$message({
+          message: "请现在项目信息中补全项目地块编码",
+          type: "warning",
+        });
+        return;
+      }
       this.getGuiHuaDiKuai(function () {
+        for (let index = 0; index < that.LandPlanningList.length; index++) {
+          const LandPlanning = that.LandPlanningList[index];
+          let DKBM = LandPlanning.data.find((c) => c.label == "DKBM")
+            ? LandPlanning.data.find((c) => c.label == "DKBM").value
+            : "";
+          let plotnumbers = info.plotnumber.split(",");
+          let isInclude = plotnumbers.some((element) => element.includes(DKBM));
+          if (!isInclude || !DKBM) {
+            that.$message({
+              message: "请选择项目内的地块进行查询",
+              type: "warning",
+            });
+            return;
+          }
+        }
         that.HighLimit(Minfo);
         that.getnorm(Minfo);
       });
@@ -3106,7 +3128,6 @@ export default {
           //指标分析数据
           this.removeLandPlanningList();
           //限高分析数据
-          this.removeLandPlanningList();
           this.removeHighLimit();
         },
       });
@@ -3272,8 +3293,9 @@ export default {
           Cesium.ScreenSpaceEventType.LEFT_CLICK
         );
       }
-      this.removeModel();
       this.removeAll();
+      this.removeModel();
+
       undergroundMode(false);
     },
   },