管道基础大数据平台系统开发-【前端】-新系統界面
surprise
2024-02-05 fb98e10c76d7e6c2d01f3a9f8c1b727f905cbdca
src/views/Synthesis/LeftMenu.vue
@@ -17,6 +17,8 @@
    <queryinfo ref="queryinfo" />
    <terrainDig ref="terrainDig" />
    <modelAttach ref="modelAttach" />
    <undergroundModel ref="undergroundModel" />
    <setPellucidity ref="setPellucidity" />
    <input
      type="file"
      accept=".kml"
@@ -67,11 +69,14 @@
          v-if="dialog.isJpg"
          class="pdfClass"
        >
          <img
          <el-image
            style="width:100%; height:100%"
            :src="dialog.src"
            alt=""
          />
            :preview-src-list="[dialog.src]"
          >
          </el-image>
        </div>
      </el-dialog>
      <div style="height:63vh">
@@ -184,52 +189,158 @@
          </el-tab-pane>
        </el-tabs>
        <!-- <el-form :model="formInline">
          <el-form-item>
            <el-row :gutter="20">
              <el-col :span="20">
                <el-input
                  size="small"
                  disabled
                  v-model="formInline.file"
                ></el-input>
                <input
                  name="file1"
                  type="file"
                  id="insertFile"
                  multiple="multiple"
                  style="display: none"
                  @change="insertFile( )"
                />
              </el-col>
              <el-col :span="4">
                <el-link
                  @click="getInsertFile( )"
                  :underline="false"
                  icon="el-icon-folder"
                > </el-link>
              </el-col>
            </el-row>
          </el-form-item>
          <el-form-item>
            <el-button
              @click="setAttachInsert"
              size="mini"
              type="primary"
              plain
            >添加</el-button>
            <el-button
              type="danger"
              plain
              size="mini"
              @click="setAttachDel"
            >删除</el-button>
          </el-form-item>
        </el-form> -->
        <!--     @selection-change="handleAttatchChange" -->
      </div>
    </el-dialog>
    <el-dialog
      title="数据申请"
      :visible.sync="dialogInsertVisible"
      width="30%"
      top="35vh"
      :modal="false"
      :before-close="handleInsertClose"
    >
      <div style="width: 100%; max-height: 450px; overflow-y: auto">
        <el-form
          ref="form"
          :model="ruleForm"
          label-width="100px"
        >
          <el-form-item label="审核单位">
            <div>
              <ul>
                <li v-for="item in ruleForm.depid">
                  {{ item.name }}
                </li>
              </ul>
            </div>
          </el-form-item>
          <el-form-item label="表名">
            <div>
              <ul>
                <li v-for="item in ruleForm.tabs">
                  {{ item.tabDesc }}
                </li>
              </ul>
            </div>
          </el-form-item>
          <el-form-item label="条件">
            <el-input
              :title="ruleForm.wkt"
              v-model="ruleForm.wkt"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item label="描述">
            <el-input
              type="textarea"
              placeholder="请输入内容"
              v-model="ruleForm.descr"
              maxlength="50"
              show-word-limit
            >
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-button
              class="primary"
              size="small"
              @click="getInsertDownz()"
            >{{
              $t("common.confirm")
            }}</el-button>
            <el-button
              type="info"
              size="small"
              @click="closeInsertDown"
            >{{
              $t("common.cancel")
            }}</el-button>
          </el-form-item>
        </el-form>
      </div>
    </el-dialog>
    <el-dialog
      :title="$t('common.passworld')"
      :visible.sync="dialogVisible1"
      width="30%"
      top="35vh"
      :modal="false"
      :before-close="handleCloseDown1"
    >
      <el-form
        :model="codeForm"
        :rules="rules"
        ref="codeForm"
        label-width="100px"
        class="codeForm"
      >
        <el-form-item
          :label="$t('common.passworld')"
          prop="password"
        >
          <el-input
            type="password"
            v-model="codeForm.password"
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item
          :label="$t('common.SPassword')"
          prop="repassword"
        >
          <el-input
            type="password"
            v-model="codeForm.repassword"
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button
            class="primary"
            size="small"
            @click="downloadx('codeForm')"
          >{{ $t("common.confirm") }}</el-button>
          <el-button
            type="info"
            size="small"
            @click="closeDownx('codeForm')"
          >{{
            $t("common.cancel")
          }}</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog
      title="范围"
      :visible.sync="dialogExtentVisible"
      width="30%"
      :before-close="handleExtentClose"
      :modal="false"
      :lock-scroll="false"
      :close-on-click-modal="false"
    >
      <el-row :gutter="20">
        <el-col :span="16">
          <el-input v-model="setExtent"></el-input>
        </el-col>
        <el-col :span="6">
          <div>
            单位:(m)
          </div>
        </el-col>
      </el-row>
      <span
        slot="footer"
        class="dialog-footer"
      >
        <el-button @click="handleExtentClose">取 消</el-button>
        <el-button
          @click="handleExtentinsert"
          type="primary"
        >确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
@@ -241,6 +352,8 @@
import queryinfo from "../Tools/queryinfo.vue";
import terrainDig from "../Tools/terrainDig.vue";
import modelAttach from "../Tools/ModelAttach.vue";
import undergroundModel from "../Tools/undergroundModel.vue";
import setPellucidity from "../Tools/setPellucidity.vue";
import $ from "jquery";
import { getToken } from "@/utils/auth";
import ImageWMS from "ol/source/ImageWMS";
@@ -255,7 +368,11 @@
  comprehensive_deletes,
  comprehensive_selectModelByPageAndCount,
  comprehensive_insertModel,
  comprehensive_updateModel, selectByBuffer
  comprehensive_updateModel, selectByBuffer,
  dataQuery_selectTabByEntity,
  inquiry_selectDomains,
  inquiry_selectFields,
  dataQuery_selectByGid,
} from '../../api/api.js'
import {
  OverviewMap,
@@ -268,9 +385,40 @@
import { geometry } from "@turf/turf";
export default {
  components: { mapinfo, maplayer, queryinfo, terrainDig, modelAttach },
  components: { mapinfo, maplayer, queryinfo, terrainDig, modelAttach, undergroundModel, setPellucidity },
  data() {
    var repasswordValidator = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请再次输入密码'));
      } else if (value !== this.codeForm.password) {
        callback(new Error('两次输入密码不一致!'));
      } else {
        callback();
      }
    };
    var passwordValidator = (rule, value, callback) => {
      var passwordreg =
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/;
      if (!passwordreg.test(value)) {
        callback(
          new Error('密码必须由数字、字母、特殊字符组合,请输入13-20位')
        );
      } else {
        callback();
      }
    };
    return {
      rules: {
        password: [{ required: true, message: '请输入密码', trigger: 'blur' }, { validator: passwordValidator, trigger: 'blur' }],
        repassword: [
          { required: true, message: '请输入确认密码', trigger: 'blur' },
          { validator: repasswordValidator, trigger: 'blur' },
        ],
      },
      codeForm: {
        password: '',
        repassword: '',
      },
      showTwoMenuFlag: false,
      setListTwoMenu: [],
      setListTwoMenuAll: [
@@ -293,6 +441,12 @@
            name: "地下模式",
            css: "twoMenu_imge29",
          },
          // {
          //   id: "b10",
          //   label: "synthesis.undergroundMode",
          //   name: "瓦片下载",
          //   css: "twoMenu_imge29",
          // },
        ],
        [
          {
@@ -674,6 +828,18 @@
        }],
      modelClip: false,
      showPickUp: false,
      dialogInsertVisible: false,
      dialogVisible1: false,
      ruleForm: {
        depname: [],
        tabs: [],
        pwd: null,
        repwd: null,
        wkt: null,
        descr: null,
      },
      dialogExtentVisible: false,
      setExtent: 10,
    };
  },
  methods: {
@@ -718,7 +884,7 @@
        }
      }
      this.showTwoMenuFlag = res.id;
      if (val != 'h') {
      if (val != 'h' && res.id != "b9") {
        sgworld.Creator.SimpleGraphic.clear();
        Viewer.entities.removeAll();
      }
@@ -1554,7 +1720,7 @@
          var that = this;
          that.modelClip = !that.modelClip;
          if (that.modelClip) {
            that.$store.state.propertiesFlag = '3';
            // that.$store.state.propertiesFlag = '3';
            if (window.model) {
              that.modelClipping();
            }
@@ -1563,7 +1729,7 @@
                new Cesium.Cesium3DTileset({
                  name: res.cnName,
                  url: modelUrl + "/tileset/m/SN/tileset.json",
                  maximumScreenSpaceError: 64, // 最大屏幕空间错误:16
                  maximumScreenSpaceError: modelUrl.indexOf("/pnts/") > -1 ? 16 : 64, // 最大屏幕空间错误:16
                  maximumMemoryUsage: 768, // 最大内存:512
                  dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false
                  skipLevelOfDetail: true, // 在遍历时候跳过详情:false
@@ -1579,7 +1745,7 @@
            }
          }
          else {
            that.$store.state.propertiesFlag = '';
            // that.$store.state.propertiesFlag = '';
            Viewer.entities.removeAll();
          }
          // window.model = sgworld.Creator.create3DTilesets(
@@ -1624,10 +1790,34 @@
          this.closePipelinePop();
          if (this.isContrastFlag == false) {
            this.isContrastFlag = true;
            sgworld.Analysis.createCurtainContrast(2, 1);
            var localUrl = 'http://{host}/LFData/2d/tiles/img/{z}/{x}/{y}.png'
            localUrl = localUrl.replace("{host}", iisHost)
            window.contRastLayer = Viewer.imageryLayers.addImageryProvider(
              new Cesium.UrlTemplateImageryProvider({
                url: localUrl,
                maximumLevel: 22,
                enablePickFeatures: false
              })
            );
            Viewer.imageryLayers.lowerToBottom(window.contRastLayer);//将图层移到最底层
            Viewer.imageryLayers.raise(window.contRastLayer);//将图层上移一层
            if (window.BaseMapLayer) {
              Viewer.imageryLayers.raise(window.contRastLayer);//将图层上移一层
              sgworld.Analysis.createCurtainContrast(1, 2);
            } else {
              sgworld.Analysis.createCurtainContrast(0, 1);
            }
          } else {
            this.isContrastFlag = false;
            sgworld.Analysis.clearCurtainContrast();
            if (window.contRastLayer) {
              window.Viewer.imageryLayers.remove(
                window.contRastLayer
              );
              window.contRastLayer = null;
            }
          }
          break;
        case "d10": //地面整平
@@ -1757,138 +1947,144 @@
    //模型裁切
    modelClipping() {
      const scene = Viewer.scene;
      let targetY = 0.0;
      let targetY = 40.0;
      let planeEntities = [];
      let selectedPlane;
      // let clippingPlanes = new Cesium.ClippingPlaneCollection({
      //   planes: [ // ClippingPlane对象数组集合
      //     new Cesium.ClippingPlane( // 裁切面
      //       new Cesium.Cartesian3(0.0, 0.0, -1.0), // 法线方向
      //       0// 原点到平面的最短距离,设置0就好
      //     ),
      //   ],
      //   enabled: true,
      //   edgeWidth: 1.0, // 模型被裁切部分的截面线宽
      // });
      let clippingPlanes = new Cesium.ClippingPlaneCollection({
        planes: [ // ClippingPlane对象数组集合
          //前后切割
          new Cesium.ClippingPlane(new Cesium.Cartesian3(0, 1, 0), 0), //后
          new Cesium.ClippingPlane(new Cesium.Cartesian3(0, -1, 0), 0),  //前
          // 左右切割
          new Cesium.ClippingPlane(new Cesium.Cartesian3(1.0, 0.0, 0), 0), //左
          new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0), 0),  //右
          // 上下切割
          new Cesium.ClippingPlane(new Cesium.Cartesian3(0, 0.0, -1), 0),  //上→下
          // new Cesium.ClippingPlane(new Cesium.Cartesian3(0, 0.0, 1), 0),  //下→上、
          new Cesium.ClippingPlane( // 裁切面
            new Cesium.Cartesian3(0.0, 0.0, -1.0), // 法线方向
            0// 原点到平面的最短距离,设置0就好
          ),
        ],
        enabled: true,
        edgeWidth: 1.0, // 模型被裁切部分的截面线宽
        unionClippingRegions: true, //true 才能多个切割
      });
      // let clippingPlanes = new Cesium.ClippingPlaneCollection({
      //   planes: [ // ClippingPlane对象数组集合
      //     //前后切割
      //     new Cesium.ClippingPlane(new Cesium.Cartesian3(0, 1, 0), 0), //后
      //     new Cesium.ClippingPlane(new Cesium.Cartesian3(0, -1, 0), 0),  //前
      //     // 左右切割
      //     new Cesium.ClippingPlane(new Cesium.Cartesian3(1.0, 0.0, 0), 0), //左
      //     new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0), 0),  //右
      //     // 上下切割
      //     new Cesium.ClippingPlane(new Cesium.Cartesian3(0, 0.0, -1), 0),  //上→下
      //     // new Cesium.ClippingPlane(new Cesium.Cartesian3(0, 0.0, 1), 0),  //下→上、
      //   ],
      //   enabled: true,
      //   edgeWidth: 1.0, // 模型被裁切部分的截面线宽
      //   unionClippingRegions: true, //true 才能多个切割
      // });
      let boundingSphere = window.model.boundingSphere;
      // 创建一个坐标轴,便于测试
      var transform = Cesium.Transforms.eastNorthUpToFixedFrame(boundingSphere.center);
      var modelMatrixPrimitive = Viewer.scene.primitives.add(new Cesium.DebugModelMatrixPrimitive({
        // modelMatrix: transform,
        length: 140.0
      }));
      // var transform = Cesium.Transforms.eastNorthUpToFixedFrame(boundingSphere.center);
      // var modelMatrixPrimitive = Viewer.scene.primitives.add(new Cesium.DebugModelMatrixPrimitive({
      //   // modelMatrix: transform,
      //   length: 140.0
      // }));
      // // 创建添加裁剪平面
      // for (let i = 0; i < clippingPlanes.length; ++i) {
      //   const plane = clippingPlanes.get(i);
      //   const planeEntity = Viewer.entities.add({
      //     position: boundingSphere.center,
      //     plane: {
      //       dimensions: new Cesium.Cartesian2(
      //         boundingSphere.radius * 1.5,
      //         boundingSphere.radius * 1.5
      //       ),//切面的长和宽
      //       material: Cesium.Color.WHITE.withAlpha(0.1),
      //       plane: new Cesium.CallbackProperty(
      //         // 添加绑定事件,不断调用
      //         createPlaneUpdateFunction(plane),
      //         false
      //       ),
      //       outline: true,
      //       outlineColor: Cesium.Color.WHITE,
      //     },
      //   });
      //   planeEntities.push(planeEntity);
      // }
      // 创建添加裁剪平面
      let m_box;
      for (let i = 0; i < clippingPlanes.length; ++i) {
        let plane = clippingPlanes.get(i);
        let getPlaneType = getType4Plane(plane);
        let planeEntity = Viewer.entities.add({ //添加平面实体 直观裁切面
          id: 'ClipPlane' + i,
          position: boundingSphere.center,// 根据3dtiles同步调整裁切面高度
        const plane = clippingPlanes.get(i);
        const planeEntity = Viewer.entities.add({
          position: boundingSphere.center,
          plane: {
            dimensions: new Cesium.Cartesian2(80, 80),//切面的长和宽
            plane: new Cesium.CallbackProperty(createPlaneUpdateFunction_box(plane, getPlaneType, boundingSphere.center), false),
            material: Cesium.Color.WHITE.withAlpha(0.01),
            outline: false,
            dimensions: new Cesium.Cartesian2(
              boundingSphere.radius * 1.5,
              boundingSphere.radius * 1.5
            ),//切面的长和宽
            material: Cesium.Color.WHITE.withAlpha(0.1),
            plane: new Cesium.CallbackProperty(
              // 添加绑定事件,不断调用
              createPlaneUpdateFunction(plane),
              false
            ),
            outline: true,
            outlineColor: Cesium.Color.WHITE,
          }
          },
        });
        if (!m_box) {
          m_box = Viewer.entities.add({
            id: 'ClopBox',
            modelMatrixPrimitive: modelMatrixPrimitive,
            position: boundingSphere.center,
            box: {
              dimensions: new Cesium.Cartesian3(boundingSphere.radius * 1.2, boundingSphere.radius * 1.2, 40),
              material: Cesium.Color.WHITE.withAlpha(0.3),
            }
          })
        }
        planeEntities.push(planeEntity);
      }
      window.model.clippingPlanes = clippingPlanes;
      // 绑定上移动事件
      // const downHandler = new Cesium.ScreenSpaceEventHandler(
      //   Viewer.scene.canvas
      // );
      // downHandler.setInputAction(function (movement) {
      //   const pickedObject = scene.pick(movement.position);
      //   if (
      //     Cesium.defined(pickedObject) &&
      //     Cesium.defined(pickedObject.id.plane)
      //   ) {
      //     selectedPlane = pickedObject.id.plane;
      //     selectedPlane.material = Cesium.Color.WHITE.withAlpha(0.05);
      //     selectedPlane.outlineColor = Cesium.Color.WHITE;
      //     scene.screenSpaceCameraController.enableInputs = false;
      // 创建添加裁剪平面
      // let m_box;
      // for (let i = 0; i < clippingPlanes.length; ++i) {
      //   let plane = clippingPlanes.get(i);
      //   let getPlaneType = getType4Plane(plane);
      //   let planeEntity = Viewer.entities.add({ //添加平面实体 直观裁切面
      //     id: 'ClipPlane' + i,
      //     position: boundingSphere.center,// 根据3dtiles同步调整裁切面高度
      //     plane: {
      //       dimensions: new Cesium.Cartesian2(80, 80),//切面的长和宽
      //       plane: new Cesium.CallbackProperty(createPlaneUpdateFunction_box(plane, getPlaneType, boundingSphere.center), false),
      //       material: Cesium.Color.WHITE.withAlpha(0.2),
      //       outline: false,
      //       outlineColor: Cesium.Color.WHITE,
      //     }
      //   });
      //   if (!m_box) {
      //     m_box = Viewer.entities.add({
      //       id: 'ClopBox',
      //       modelMatrixPrimitive: modelMatrixPrimitive,
      //       position: boundingSphere.center,
      //       box: {
      //         dimensions: new Cesium.Cartesian3(boundingSphere.radius * 1.2, boundingSphere.radius * 1.2, 40),
      //         material: Cesium.Color.WHITE.withAlpha(0.3),
      //       }
      //     })
      //   }
      // }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
      // }
      window.model.clippingPlanes = clippingPlanes;
      if (window.modelHeight && window.modelHeight != 0) {
        // console.log("window.modelHeight---",window.modelHeight)
        window.model.clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(
          new Cesium.Cartesian3(0.0, 0.0, window.modelHeight)
        );
      }
      // 绑定上移动事件
      const downHandler = new Cesium.ScreenSpaceEventHandler(
        Viewer.scene.canvas
      );
      downHandler.setInputAction(function (movement) {
        const pickedObject = scene.pick(movement.position);
        if (
          Cesium.defined(pickedObject) &&
          Cesium.defined(pickedObject.id.plane)
        ) {
          selectedPlane = pickedObject.id.plane;
          selectedPlane.material = Cesium.Color.WHITE.withAlpha(0.05);
          selectedPlane.outlineColor = Cesium.Color.WHITE;
          scene.screenSpaceCameraController.enableInputs = false;
        }
      }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
      // 绑定下移动事件
      // const upHandler = new Cesium.ScreenSpaceEventHandler(
      //   Viewer.scene.canvas
      // );
      // upHandler.setInputAction(function () {
      //   if (Cesium.defined(selectedPlane)) {
      //     selectedPlane.material = Cesium.Color.WHITE.withAlpha(0.1);
      //     selectedPlane.outlineColor = Cesium.Color.WHITE;
      //     selectedPlane = undefined;
      //   }
      //   scene.screenSpaceCameraController.enableInputs = true;
      // }, Cesium.ScreenSpaceEventType.LEFT_UP);
      const upHandler = new Cesium.ScreenSpaceEventHandler(
        Viewer.scene.canvas
      );
      upHandler.setInputAction(function () {
        if (Cesium.defined(selectedPlane)) {
          selectedPlane.material = Cesium.Color.WHITE.withAlpha(0.1);
          selectedPlane.outlineColor = Cesium.Color.WHITE;
          selectedPlane = undefined;
        }
        scene.screenSpaceCameraController.enableInputs = true;
      }, Cesium.ScreenSpaceEventType.LEFT_UP);
      // Update plane on mouse move
      // const moveHandler = new Cesium.ScreenSpaceEventHandler(
      //   Viewer.scene.canvas
      // );
      // moveHandler.setInputAction(function (movement) {
      //   if (Cesium.defined(selectedPlane)) {
      //     const deltaY = movement.startPosition.y - movement.endPosition.y;
      //     targetY += deltaY;
      //     console.log("targetY----",targetY)
      //   }
      // }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
      const moveHandler = new Cesium.ScreenSpaceEventHandler(
        Viewer.scene.canvas
      );
      moveHandler.setInputAction(function (movement) {
        if (Cesium.defined(selectedPlane)) {
          const deltaY = movement.startPosition.y - movement.endPosition.y;
          targetY += deltaY;
          // console.log("targetY----",targetY)
        }
      }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
      function createPlaneUpdateFunction(plane) {
        return function () {
          plane.distance = targetY;
          // console.log("targetY----",targetY)
          return plane;
        };
      }
@@ -2040,11 +2236,16 @@
      }
    },
    addAnalysisFlood() {
      var url = window.location.href;
      var testurl = "";
      if (url.indexOf("web") != -1) {
        testurl = "/web";
      }
      var method = {
        pointSelect: true,
        spood: 20,
        GroupID: 0,
        url: "/SmartEarthSDK/Workers/image/33.gif",
        url: testurl + "/SmartEarthSDK/Workers/image/33.gif",
      };
      window.AnalysisFlood = sgworld.Command.execute(
        2,
@@ -2201,8 +2402,18 @@
          this.$store.state.isNaviget = this.isNaviget;
          break;
        case "b9": //地下模式
          this.UndergroundMode = !this.UndergroundMode;
          window.sgworld.Analysis.UndergroundMode(this.UndergroundMode, 0.3);
          // this.UndergroundMode = !this.UndergroundMode;
          // window.sgworld.Analysis.UndergroundMode(this.UndergroundMode, 0.3);
          if (window.UndergroundMode) {
            this.$refs &&
              this.$refs.undergroundModel &&
              this.$refs.undergroundModel.close();
          } else {
            this.$refs &&
              this.$refs.undergroundModel &&
              this.$refs.undergroundModel.open("地下模式", null,);
          }
          break;
      }
    },
@@ -2235,6 +2446,8 @@
      var that = this;
      var checkKey = [];
      let checkedLayers = [];
      this.$store.state.isProjectLayer = [];
      var val = std.filter((str) => {
        if (str.type == 1) {
          return str;
@@ -2248,24 +2461,30 @@
      });
      var value = std.filter((str) => {
        if (str.url != null && str.type == 2 && str.isShow == 1) {
          return str;
        }
      })
      var layer = std.filter((str) => {
        if (str.isProject == 1 && str.type == 2) {
          this.$store.state.isProjectLayer.push(str);
        }
      })
      this.setAddLayers(value);
      var res = this.setTreeData(val);
      this.$store.state.pigCode = null;
      //存储选中图层
      // sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers));
      for (var i in res) {
        res[i].children = res[i].children.filter((val) => {
          if (val.children != null) {
            return val;
          }
        });
      }
      // for (var i in res) {
      //   res[i].children = res[i].children.filter((val) => {
      //     if (val.children != null) {
      //       return val;
      //     }
      //   });
      // }
      this.$store.state.oldTree = val;
      this.$store.state.treeData = res;
      this.$store.state.checkedKeys = checkKey;
@@ -2275,6 +2494,12 @@
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        if (branchArr.length > 0) {
          branchArr.sort(function (a, b) {
            return a.orderNum - b.orderNum
          })
        }
        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;
        // 由此循环多次后,就能形成相应的树形数据结构
@@ -2282,6 +2507,7 @@
      });
    },
    setAddLayers(res) {
      this.setClearWmsLayer()
      var std = [[]];
      for (var i in res) {
        switch (res[i].serveType) {
@@ -2291,11 +2517,78 @@
        }
      }
      if (std[0].length != 0) {
        this.setAddWmsLayer(std[0])
        if (this.$store.state.pigCode) {
          this.setPrjidWmsLayer(std[0])
        } else {
          this.setAddWmsLayer(std[0])
        }
      }
    },
    setAddWmsLayer(res) {
    setPrjidWmsLayer(res) {
      var layer = [];
      var sql = [];
      var dirid = this.$store.state.pigCode
      var that = this;
      for (var i in res) {
        layer.push(res[i].url)
        if (res[i].isProject == 1) {
          var val = "dirid like '" + dirid + "%'"
          sql.push(val)
        } else {
          sql.push("1 = 1")
        }
      }
      layer = layer.reverse();
      sql = sql.reverse().join(";")
      var getFeatureInfoFormat = new Cesium.GetFeatureInfoFormat("html", null, function (html) {
        that.getFeatureInfo(html)
      });
      window.layerWMS = new Cesium.WebMapServiceImageryProvider({
        url: geoServerURl,
        layers: layer.toString(),
        getFeatureInfoParameters: { info_format: 'text/html' },
        enablePickFeatures: true,
        getFeatureInfoFormats: [getFeatureInfoFormat],
        parameters: {
          transparent: true,
          format: "image/png",
          srs: "EPSG:4490",
          styles: "",
          cql_filter: sql
        },
        tileWidth: 512,
        tileHeight: 512,
      });
      layerWMS.name = "Wms_Layer";
      window.Viewer.imageryLayers.addImageryProvider(window.layerWMS);
      var layer2 = new Image({
        name: "Wms_Layer",
        source: new ImageWMS({
          crossOrigin: "anonymous",
          url: geoServerURl,
          params: {
            FORMAT: "image/png",
            VERSION: "1.1.1",
            LAYERS: layer.toString(),
            cql_filter: sql
          },
        }),
      });
      if (res.opacity) {
        layer2.setOpacity(parseInt(res.opacity) / 100);
      }
      window.map.addLayer(layer2);
    },
    setClearWmsLayer() {
      for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) {
        var val_id = window.Viewer.imageryLayers._layers[i].imageryProvider.name;
        if (val_id == "Wms_Layer") {
@@ -2311,10 +2604,16 @@
          window.map.removeLayer(layers_ol[i]); //显示图层
        }
      }
    },
    setAddWmsLayer(res) {
      var url = [];
      for (var i in res) {
        url.push(res[i].url)
        if (res[i].url) {
          url.push(res[i].url)
        }
      }
      url = url.reverse();
      var that = this;
      var getFeatureInfoFormat = new Cesium.GetFeatureInfoFormat("html", null, function (html) {
@@ -2336,7 +2635,7 @@
        tileHeight: 512,
      });
      layerWMS.name = "Wms_Layer";
      window.Viewer.scene.imageryLayers.addImageryProvider(window.layerWMS);
      window.Viewer.imageryLayers.addImageryProvider(window.layerWMS);
      var layer2 = new Image({
        name: "Wms_Layer",
        source: new ImageWMS({
@@ -2361,25 +2660,155 @@
      start = html.lastIndexOf(tab) + tab.length + 1;
      end = html.indexOf("</td>", start);
      var gid = html.substr(start, end - start);
      if (gid && tab) {
        this.$store.state.pickoption = {
          gid: gid,
          name: tab.replaceAll("_", "")
        }
        if (tab == 'm_surface_deformation_data') {
          this.$store.state.surfaceDeForm.flag = true;
          this.$store.state.surfaceDeForm.gid = gid;
        } else {
          this.$store.state.surfaceDeForm.flag = false;
          this.$store.state.surfaceDeForm.gid = null;
        }
        const res = await dataQuery_selectTabByEntity({
          name: this.$store.state.pickoption.name
        })
        this.$refs &&
          this.$refs.queryinfo &&
          this.$refs.queryinfo.close("queryinfo");
        this.$store.state.mapPopBoxFlag = "4";
        if (res.code != 200) {
          return;
        }
        var value = res.result.split('.')
        this.$store.state.propertiesName = {
          ns: value[0],
          enName: value[1],
          tabDesc: '拾取信息'
        }
        var name = this.$store.state.pickoption.name;
        const data = await inquiry_selectFields({ name: name })
        if (data.code != 200) {
          this.$message.error("列表调用失败")
        }
        const data1 = await inquiry_selectDomains({ name: name })
        if (data1.code != 200) {
          this.$message.error("列表调用失败")
        }
        this.optionx = []
        this.attributeData = []
        var valadata = data.result
        var laydomain = data1.result
        this.optionx = data1.result
        for (var i in valadata) {
          if (valadata[i].showtype == 1) {
            if (
              valadata[i].domainNa != null &&
              valadata[i].domainNa != undefined
            ) {
              for (var j in laydomain) {
                if (laydomain[j].domName == valadata[i].domainNa) {
                  // valadata[i].domainNa = laydomain[j].codeDesc
                }
              }
            }
            // this.optionx.push(valadata[i])
            this.attributeData.push(valadata[i])
          }
        }
        this.$refs &&
          this.$refs.queryinfo &&
          this.$refs.queryinfo.open("拾取分析", null,);
        this.getTableData()
      }
    },
    //格式化时间
    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) +
        ' ' +
        h +
        ':' +
        mm +
        ':' +
        s
      );
    },
    //格式化时间
    add0(m) {
      return m < 10 ? '0' + m : m;
    },
    async getTableData() {
      this.tableData = []
      const data = await dataQuery_selectByGid(this.$store.state.pickoption)
      if (data.code != 200) {
        return
      }
      var valste = data.result
      valste.dirid = valste.dirName;
      valste.depid = valste.depName;
      valste.verid = valste.verName;
      valste.createuser = valste.createName;
      valste.updateuser = valste.updateName;
      if (valste.createtime) {
        valste.createtime = this.format(valste.createtime)
      }
      if (valste.updatetime) {
        valste.updatetime = this.format(valste.updatetime)
      }
      for (var j in this.optionx) {
        if (
          this.optionx[j].domainNa != null &&
          this.optionx[j].domainNa != undefined
        ) {
          valste[this.optionx[j].field] = this.optionx[j].domainNa
        }
      }
      var arr = {}
      for (var i = (this.attributeData.length - 1); i >= 0; i--) {
        var vla = this.attributeData[i]
        if (vla.domainNa) {
          var val = this.optionx.filter(res => {
            if (res.domName == vla.domainNa && res.domCode == valste[vla.field]) {
              return res;
            }
          })
          var vlue = null
          if (val.length > 0) {
            vlue = val[0].codeDesc
          } else {
            vlue = ''
          }
          arr[vla.alias] = vlue
        } else {
          arr[vla.alias] = valste[vla.field]
        }
      }
      arr['eventid'] = valste.eventid
      this.$store.state.propertiesInfo = arr;
      this.$store.state.propertiesFlag = '1'
    },
    showModelAttach() {
      if (this.$store.state.attachModel) {
@@ -2552,7 +2981,18 @@
    matchState(state = "", reg) {
      var row = state.row;
      var name = row.name;
      if (name.indexOf('.pdf') != -1 || name.indexOf('.jpg') != -1 || name.indexOf('.gif') != -1 || name.indexOf('.png') != -1 || name.indexOf('.jpeg') != -1) {
      if (name.indexOf('.pdf') != -1
        || name.indexOf('.jpg') != -1
        || name.indexOf('.gif') != -1
        || name.indexOf('.png') != -1
        || name.indexOf('.jpeg') != -1
        || name.indexOf('.PDF') != -1
        || name.indexOf('.JPG') != -1
        || name.indexOf('.GIF') != -1
        || name.indexOf('.PNG') != -1
        || name.indexOf('.JPEG') != -1
        || name.indexOf('.BMP') != -1
        || name.indexOf('.bmp') != -1) {
        return true;
      }
@@ -2568,12 +3008,23 @@
    setAttatchDetail(index, row) {
      this.refreshAttatchDetail()
      var name = row.name;
      if (name.indexOf('.pdf') != -1) {
      if (name.indexOf('.pdf') != -1 || name.indexOf('.PDF') != -1) {
        this.dialog.dialogVisible = true;
        this.dialog.isPdf = true;
        var url = BASE_URL + "/comprehensive/downloadForView?guid=" + row.guid + "&token=" + getToken();
        this.dialog.src = url
      } else if (name.indexOf('.jpg') != -1 || name.indexOf('.gif') != -1 || name.indexOf('.png') != -1 || name.indexOf('.jpeg') != -1) {
      } else if (
        name.indexOf('.jpg') != -1
        || name.indexOf('.gif') != -1
        || name.indexOf('.png') != -1
        || name.indexOf('.jpeg') != -1
        || name.indexOf('.JPG') != -1
        || name.indexOf('.GIF') != -1
        || name.indexOf('.PNG') != -1
        || name.indexOf('.JPEG') != -1
        || name.indexOf('.BMP') != -1
        || name.indexOf('.bmp') != -1
      ) {
        this.dialog.dialogVisible = true;
        this.dialog.isJpg = true;
        var url = BASE_URL + "/comprehensive/downloadForView?guid=" + row.guid + "&token=" + getToken();
@@ -2634,8 +3085,6 @@
      if (this.$store.state.showPopBoxFlag == true) {
        this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
        this.$refs &&
          this.$refs.queryinfo &&
          this.$refs.queryinfo.open("属性", null, {
@@ -2652,16 +3101,76 @@
            },
          });
      }
    },
    setPellucidity() {
      this.$refs && this.$refs.setPellucidity && this.$refs.setPellucidity.open();
    },
    setDialogInsertVisible(res) {
      this.ruleForm = res;
      this.dialogInsertVisible = true;
    },
    downloadx() {
      this.$bus.$emit("setInsertDown1", this.codeForm)
      this.closeDownx();
    },
    handleCloseDown1() {
      this.$confirm("确认关闭?")
        .then(_ => {
          this.closeDownx();
        })
        .catch(_ => { })
    },
    closeDownx() {
      this.dialogVisible1 = false;
      this.codeForm = {
        password: '',
        repassword: '',
      }
    },
    closeInsertDown() {
      this.ruleForm = {
        depname: [],
        tabs: [],
        pwd: null,
        repwd: null,
        wkt: null,
        descr: null,
      }
      this.dialogInsertVisible = false
    },
    handleInsertClose() {
      this.$confirm("确认关闭?")
        .then(_ => {
          this.closeInsertDown()
        })
        .catch(_ => { })
    },
    getInsertDownz() {
      this.dialogInsertVisible = false;
      // this.dialogVisible1 = true;
      //
      this.$bus.$emit("setInsertApply1", this.ruleForm)
    },
    handleExtentClose() {
      this.dialogExtentVisible = false
      this.setExtent = 10;
    },
    handleExtentinsert() {
      this.$bus.$emit("setExtentBUff", this.setExtent)
      this.handleExtentClose();
    }
  },
  mounted() {
    this.$bus.$off();
    this.measureData = new Map();
    this.colorAll = {
      point: Cesium.Color.fromCssColorString("#ff0000"),
      polyline: Cesium.Color.fromCssColorString("#ffff00").withAlpha(0.6),
      polygon: Cesium.Color.fromCssColorString("#ffff00").withAlpha(0.6),
    };
    this.$store.state.setAlphaList = []
    this.$bus.$on("setChangeTwoMenu", (res) => {
      if (res == 8) {
        this.setLayerScene();
@@ -2670,14 +3179,44 @@
      }
    });
    this.$bus.$on("showMenuLayer", ((res) => {
      this.setAddLayers(res);
    }));
    this.$bus.$on("showPellucidity", res => {
      this.setPellucidity();
    });
    this.$store.state.isProjectLayer = [];
    this.$store.state.pigCode = null;
    this.$store.state.showAllLayers = true;
    this.$store.state.layerMnage = false;
    this.$store.state.treeData = null;
    this.$store.state.checkedKeys = [];
    // this.setCoverage("a1");
    this.layersStart();
    // this.layersStart();
    this.$bus.$on('addImageLayer',  (res)=>{
      if(res){
        this.layersStart();
      }
    });
    this.$bus.$on("setDialogInsertVisible", (res) => {
      if (res == true) {
        this.dialogVisible1 = true;
      } else {
        this.setDialogInsertVisible(res);
      }
    })
    this.$bus.$on('showExtentLayer', res => {
      this.dialogExtentVisible = res;
    });
  },
  watch: {
    Obj(newVal, oldVal) {