shuishen
2022-03-05 ebc12b5f54c664bfd06e884dc2040223392558f8
地图部分修改
5 files modified
1787 ■■■■ changed files
src/components/map/components/campusBuildingSearch copy.vue 235 ●●●● patch | view | raw | blame | history
src/components/map/components/campusBuildingSearch.vue 228 ●●●● patch | view | raw | blame | history
src/components/map/components/dimension.vue 576 ●●●● patch | view | raw | blame | history
src/components/map/components/mapPopup.vue 365 ●●●● patch | view | raw | blame | history
src/components/map/index.vue 383 ●●●● patch | view | raw | blame | history
src/components/map/components/campusBuildingSearch copy.vue
@@ -7,19 +7,10 @@
        v-model="searchInput"
        @input="searchValueChange"
        @focus="shortcutFlag = true"
      >
      </el-input>
            ></el-input>
      <el-button-group>
        <el-button
          @click="navigationShow"
          class="deblurring"
          icon="el-icon-my-path"
        ></el-button>
        <el-button
          class="deblurring"
          type="primary"
          icon="el-icon-my-search"
        ></el-button>
                <el-button @click="navigationShow" class="deblurring" icon="el-icon-my-path"></el-button>
                <el-button class="deblurring" type="primary" icon="el-icon-my-search"></el-button>
      </el-button-group>
      <div v-show="searchValShow" class="search-value-box">
        <ul>
@@ -27,9 +18,7 @@
            v-for="(item, index) in searchValList"
            :key="index"
            @click="loadPopup(item)"
          >
            {{ item.name }}
          </li>
                    >{{ item.name }}</li>
        </ul>
      </div>
      <div class="map-campus-shortcut" v-show="shortcutFlag">
@@ -37,7 +26,7 @@
          <ul>
            <li v-for="(item, index) in shortcutList" :key="index">
              <el-button @click="openModelPopup(item)">
                <img :src="item.bgimg" alt="" />
                                <img :src="item.bgimg" alt />
                <span>{{ item.title }}</span>
              </el-button>
            </li>
@@ -49,13 +38,13 @@
</template>
<script>
import { mapGetters } from "vuex";
import { mapGetters } from 'vuex'
import { getList } from "@/api/pc/orgnav/index";
import { getSearchList } from "@/api/pc/public/search";
import { getList } from '@/api/pc/orgnav/index'
import { getSearchList } from '@/api/pc/public/search'
export default {
  name: "campusBuildingSearch",
    name: 'campusBuildingSearch',
  data() {
    return {
      DC: null,
@@ -82,12 +71,12 @@
        //     code: 2
        // },
        {
          bgimg: "/img/search/venue.png",
          title: "校区场馆",
          type: "arc",
          path: "/pcLayout/default/arc/venue",
          code: 3,
        },
                    bgimg: '/img/search/venue.png',
                    title: '校区场馆',
                    type: 'arc',
                    path: '/pcLayout/default/arc/venue',
                    code: 3
                }
        // {
        //     bgimg: '/img/search/dorm.png',
        //     title: '校区宿舍',
@@ -104,77 +93,77 @@
        // }
      ],
      shortcutFlag: false,
      searchInput: "",
            searchInput: '',
      searchValShow: false,
      searchValList: [],
    };
            searchValList: []
        }
  },
  computed: {
    ...mapGetters([
      "viewer",
            'viewer',
      // 校区内导航的显示关闭
      "campusNavFlag",
      "orgNavBarFlag",
      "arcNavBarFlag",
    ]),
            'campusNavFlag',
            'orgNavBarFlag',
            'arcNavBarFlag'
        ])
  },
  created() {
    this.DC = global.DC;
        this.DC = global.DC
  },
  methods: {
    searchValueChange() {
      if (this.searchInput == "") {
        this.searchValList = [];
        this.searchValShow = false;
        return;
            if (this.searchInput == '') {
                this.searchValList = []
                this.searchValShow = false
                return
      }
      getSearchList({ mechanismName: this.searchInput }).then((res) => {
        if (res.data.data.length > 0) {
          this.searchValList = res.data.data;
          this.searchValShow = true;
                    this.searchValList = res.data.data
                    this.searchValShow = true
        }
      });
            })
    },
    navigationShow() {
      if (this.campusNavFlag == false) {
        this.$store.commit("SET_CAMPUSNAVFLAG", true);
                this.$store.commit('SET_CAMPUSNAVFLAG', true)
      }
    },
    openModelPopup(param) {
      var list = [];
      if (this.$route.path.indexOf("/service") != -1) {
        this.$store.dispatch("delVisitedViews", this.$route);
        this.$router.push("/pcLayout/default");
            var list = []
            if (this.$route.path.indexOf('/service') != -1) {
                this.$store.dispatch('delVisitedViews', this.$route)
                this.$router.push('/pcLayout/default')
      }
      if (param.type == "orgnav") {
        var path = this.$route.path;
        if (path.indexOf("/arc") != -1) {
          this.$store.dispatch("delVisitedViews", this.$route);
          this.$router.push("/pcLayout/default");
          this.$store.commit("SET_ARCNAVBARTITLE", "");
          this.$store.commit("SET_ARCNAVBARCODE", "");
          this.$store.commit("SET_ARCNAVBARFLAG", false);
            if (param.type == 'orgnav') {
                var path = this.$route.path
                if (path.indexOf('/arc') != -1) {
                    this.$store.dispatch('delVisitedViews', this.$route)
                    this.$router.push('/pcLayout/default')
                    this.$store.commit('SET_ARCNAVBARTITLE', '')
                    this.$store.commit('SET_ARCNAVBARCODE', '')
                    this.$store.commit('SET_ARCNAVBARFLAG', false)
        }
        if (this.arcNavBarFlag == true) {
          this.$store.commit("SET_ARCNAVBARTITLE", "");
          this.$store.commit("SET_ARCNAVBARCODE", "");
          this.$store.commit("SET_ARCNAVBARFLAG", false);
                    this.$store.commit('SET_ARCNAVBARTITLE', '')
                    this.$store.commit('SET_ARCNAVBARCODE', '')
                    this.$store.commit('SET_ARCNAVBARFLAG', false)
        }
        this.$store.commit("SET_ORGNAVBARTITLE", param.title);
        this.$store.commit("SET_ORGNAVBARLIST", []);
                this.$store.commit('SET_ORGNAVBARTITLE', param.title)
                this.$store.commit('SET_ORGNAVBARLIST', [])
        this.$store.commit("SET_ORGNAVBARFLAG", true);
                this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: param.code }).then((res) => {
          res.data.data.records.forEach((item) => {
            list.push({
              navTitle: item.mechanismname,
              icon: "/img/navicon/tag.png",
                            icon: '/img/navicon/tag.png',
              longitude: item.jd,
              latitude: item.wd,
              alt: item.gd,
@@ -186,93 +175,93 @@
              address: item.address,
              telephone: item.telephone,
              introduce: item.introduce,
              videourl: item.videourl,
            });
          });
                            videourl: item.videourl
                        })
                    })
          this.$store.commit("SET_ORGNAVBARLIST", list);
        });
      } else if (param.type == "arc") {
        if (this.$route.path.indexOf("/orgnav") != -1) {
          this.$store.dispatch("delVisitedViews", this.$route);
          this.$router.push("/pcLayout/default");
          this.$store.commit("SET_ORGNAVBARTITLE", "");
          this.$store.commit("SET_ORGNAVBARLIST", []);
          this.$store.commit("SET_ORGNAVBARFLAG", false);
                    this.$store.commit('SET_ORGNAVBARLIST', list)
                })
            } else if (param.type == 'arc') {
                if (this.$route.path.indexOf('/orgnav') != -1) {
                    this.$store.dispatch('delVisitedViews', this.$route)
                    this.$router.push('/pcLayout/default')
                    this.$store.commit('SET_ORGNAVBARTITLE', '')
                    this.$store.commit('SET_ORGNAVBARLIST', [])
                    this.$store.commit('SET_ORGNAVBARFLAG', false)
        }
        if (this.orgNavBarFlag == true) {
          this.$store.commit("SET_ORGNAVBARTITLE", "");
          this.$store.commit("SET_ORGNAVBARLIST", []);
          this.$store.commit("SET_ORGNAVBARFLAG", false);
                    this.$store.commit('SET_ORGNAVBARTITLE', '')
                    this.$store.commit('SET_ORGNAVBARLIST', [])
                    this.$store.commit('SET_ORGNAVBARFLAG', false)
        }
        this.$store.commit("SET_ARCNAVBARTITLE", param.title);
        this.$store.commit("SET_ARCNAVBARCODE", param.code);
        this.$store.commit("SET_ARCNAVBARFLAG", true);
                this.$store.commit('SET_ARCNAVBARTITLE', param.title)
                this.$store.commit('SET_ARCNAVBARCODE', param.code)
                this.$store.commit('SET_ARCNAVBARFLAG', true)
      }
    },
    shortcutShow(event) {
      var sp = document.getElementById("CampusSearchPanel");
            var sp = document.getElementById('CampusSearchPanel')
      if (sp) {
        if (!sp.contains(event.target)) {
          // 这句是说如果我们点击到了id为myPanel以外的区域
          this.shortcutFlag = false;
                    this.shortcutFlag = false
        }
      }
    },
    loadPopup(param) {
      var that = this;
            var that = this
      that.searchInput = "";
      that.searchValList = [];
      that.searchValShow = false;
            that.searchInput = ''
            that.searchValList = []
            that.searchValShow = false
      this.$store.commit("CLEAR_ALL", null);
            this.$store.commit('CLEAR_ALL', null)
      var result = param.list;
            var result = param.list
      var imgArr = result.tpurl.split(",");
            var imgArr = result.tpurl.split(',')
      this.$store.commit("SET_POPUPBGURL", imgArr[0]);
      this.$store.commit("SET_POPUPQRURL", result.codeurl);
      this.$store.commit("SET_POINTPOSITION", [
            this.$store.commit('SET_POPUPBGURL', imgArr[0])
            this.$store.commit('SET_POPUPQRURL', result.codeurl)
            this.$store.commit('SET_POINTPOSITION', [
        Number(result.jd),
        Number(result.wd),
        Number(result.gd),
        Number(result.heading),
        Number(result.pitch),
        Number(result.roll),
      ]);
      this.$store.commit("SET_STATENAME", result.mechanismname);
      this.$store.commit("SET_SITENAME", result.address);
      this.$store.commit("SET_TELEPHONE", result.telephone);
      this.$store.commit("SET_INTRODUCETEXT", result.introduce);
      if (result.panoramaurl != "") {
        this.$store.commit("SET_PANORAMAURL", result.panoramaurl);
                Number(result.roll)
            ])
            this.$store.commit('SET_STATENAME', result.mechanismname)
            this.$store.commit('SET_SITENAME', result.address)
            this.$store.commit('SET_TELEPHONE', result.telephone)
            this.$store.commit('SET_INTRODUCETEXT', result.introduce)
            if (result.panoramaurl != '') {
                this.$store.commit('SET_PANORAMAURL', result.panoramaurl)
      }
      if (result.videourl && result.videourl != "") {
        this.$store.commit("SET_MONITORURL", result.videourl);
            if (result.videourl && result.videourl != '') {
                this.$store.commit('SET_MONITORURL', result.videourl)
      }
      this.$store.commit("SET_POPUPIMGATLAS", imgArr);
      if (param.jx != undefined && param.jx != "") {
        var tabOne = param.jx.split(",");
        this.$store.commit("SET_TEACHLIST", tabOne);
            this.$store.commit('SET_POPUPIMGATLAS', imgArr)
            if (param.jx != undefined && param.jx != '') {
                var tabOne = param.jx.split(',')
                this.$store.commit('SET_TEACHLIST', tabOne)
      } else {
        this.$store.commit("SET_TEACHLIST", []);
                this.$store.commit('SET_TEACHLIST', [])
      }
      if (param.sh != undefined && param.sh != "") {
        var tabTwo = param.sh.split(",");
        this.$store.commit("SET_LIVELIST", tabTwo);
            if (param.sh != undefined && param.sh != '') {
                var tabTwo = param.sh.split(',')
                this.$store.commit('SET_LIVELIST', tabTwo)
      } else {
        this.$store.commit("SET_LIVELIST", []);
                this.$store.commit('SET_LIVELIST', [])
      }
      this.newPopup(result);
            this.newPopup(result)
      this.viewer.flyToPosition(
        new this.DC.Position(
          Number(result.jd),
@@ -284,25 +273,25 @@
        ),
        () => {},
        3
      );
            )
    },
    newPopup(item) {
      const position = this.DC.Transform.transformWGS84ToCartesian(
        new this.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd))
      );
            )
      // eslint-disable-next-line no-unused-vars
      var popup = new this.DC.DivForms(this.viewer, {
        domId: "divFormsDomBox",
        position: [position],
      });
                domId: 'divFormsDomBox',
                position: [position]
            })
      this.$store.commit("SET_PANORAMAPOPUP", false);
      this.$store.commit("SET_MONITORPOPUP", false);
      this.$store.commit("SET_DETAILSPOPUP", true);
    },
  },
};
            this.$store.commit('SET_PANORAMAPOPUP', false)
            this.$store.commit('SET_MONITORPOPUP', false)
            this.$store.commit('SET_DETAILSPOPUP', true)
        }
    }
}
</script>
<style lang="scss" scope>
src/components/map/components/campusBuildingSearch.vue
@@ -9,11 +9,7 @@
        @focus="shortcutFlag = true"
      ></el-input>
      <el-button-group>
        <el-button
          @click="navigationShow"
          class="deblurring"
          icon="el-icon-my-path"
        ></el-button>
                <el-button @click="navigationShow" class="deblurring" icon="el-icon-my-path"></el-button>
        <el-button
          @click="fuzzyQuery"
          class="deblurring"
@@ -27,9 +23,7 @@
            v-for="(item, index) in searchValList"
            :key="index"
            @click="loadPopup(item)"
          >
            {{ item.mechanismname }}
          </li>
                    >{{ item.mechanismname }}</li>
        </ul>
      </div>
      <div class="map-campus-shortcut" v-show="shortcutFlag">
@@ -49,23 +43,23 @@
</template>
<script>
import { mapGetters } from "vuex";
import { mapGetters } from 'vuex'
import { getList } from "@/api/pc/orgnav/index";
import { getSearchList } from "@/api/pc/public/search";
import { getList } from '@/api/pc/orgnav/index'
import { getSearchList } from '@/api/pc/public/search'
export default {
  name: "campusBuildingSearch",
    name: 'campusBuildingSearch',
  data() {
    return {
      DC: null,
      shortcutList: [
        {
          bgimg: "/img/search/org.png",
          title: "其他机构",
          type: "orgnav",
          path: "/pcLayout/default/orgnav/rest",
          code: 5,
                    bgimg: '/img/search/org.png',
                    title: '其他机构',
                    type: 'orgnav',
                    path: '/pcLayout/default/orgnav/rest',
                    code: 5
        },
        // {
        //     bgimg: '/img/search/ofc.png',
@@ -82,19 +76,19 @@
        //     code: 2
        // },
        {
          bgimg: "/img/search/venue.png",
          title: "校区场馆",
          type: "arc",
          path: "/pcLayout/default/arc/venue",
          code: 3,
                    bgimg: '/img/search/venue.png',
                    title: '校区场馆',
                    type: 'arc',
                    path: '/pcLayout/default/arc/venue',
                    code: 3
        },
        {
          bgimg: "/img/search/floor.png",
          title: "主要场馆",
          type: "arc",
          path: "/pcLayout/default/arc/rest",
          code: 7,
        },
                    bgimg: '/img/search/floor.png',
                    title: '主要场馆',
                    type: 'arc',
                    path: '/pcLayout/default/arc/rest',
                    code: 7
                }
        // {
        //   bgimg: "/img/search/dorm.png",
        //   title: "校区宿舍",
@@ -112,80 +106,80 @@
        // }
      ],
      shortcutFlag: false,
      searchInput: "",
            searchInput: '',
      searchValShow: false,
      searchValList: [],
    };
            searchValList: []
        }
  },
  computed: {
    ...mapGetters([
      "viewer",
            'viewer',
      // 校区内导航的显示关闭
      "campusNavFlag",
      "orgNavBarFlag",
      "arcNavBarFlag",
    ]),
            'campusNavFlag',
            'orgNavBarFlag',
            'arcNavBarFlag'
        ])
  },
  created() {
    this.DC = global.DC;
        this.DC = global.DC
  },
  methods: {
    searchValueChange() {
      if (this.searchInput == "") {
        this.searchValList = [];
        this.searchValShow = false;
        return;
            if (this.searchInput == '') {
                this.searchValList = []
                this.searchValShow = false
                return
      }
      getSearchList({ mechanismName: this.searchInput }).then((res) => {
        if (res.data.data.length > 0) {
          this.searchValList = res.data.data;
          this.searchValShow = true;
                    this.searchValList = res.data.data
                    this.searchValShow = true
        }
      });
            })
    },
    navigationShow() {
      if (this.campusNavFlag == false) {
        this.$store.commit("SET_CAMPUSNAVFLAG", true);
                this.$store.commit('SET_CAMPUSNAVFLAG', true)
      }
    },
    fuzzyQuery() {
      if (this.searchInput == "") {
        this.searchValList = [];
        this.searchValShow = false;
            if (this.searchInput == '') {
                this.searchValList = []
                this.searchValShow = false
        this.$message({
          message: "请输入关键字",
          type: "warning",
          duration: 1000,
        });
        return;
                    message: '请输入关键字',
                    type: 'warning',
                    duration: 1000
                })
                return
      }
      getSearchList({ mechanismName: this.searchInput }).then((res) => {
        if (res.data.data.length > 0) {
          this.$store.commit("SET_SEARCHPOPUPFLAG", true);
          this.$store.commit("SET_SEARCHPOPUPLIST", res.data.data);
          this.searchInput = "";
          this.searchValList = [];
          this.searchValShow = false;
                    this.$store.commit('SET_SEARCHPOPUPFLAG', true)
                    this.$store.commit('SET_SEARCHPOPUPLIST', res.data.data)
                    this.searchInput = ''
                    this.searchValList = []
                    this.searchValShow = false
        }
      });
            })
    },
    openModelPopup(param) {
      var list = [];
            var list = []
      if (param.type == "orgnav") {
        this.$store.commit("SET_ORGNAVBARTITLE", param.title);
        this.$store.commit("SET_ORGNAVBARLIST", []);
        this.$store.commit("SET_ORGNAVBARFLAG", true);
            if (param.type == 'orgnav') {
                this.$store.commit('SET_ORGNAVBARTITLE', param.title)
                this.$store.commit('SET_ORGNAVBARLIST', [])
                this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: param.code }).then((res) => {
          res.data.data.records.forEach((item) => {
            list.push({
              navTitle: item.mechanismname,
              icon: "/img/navicon/tag.png",
                            icon: '/img/navicon/tag.png',
              longitude: item.jd,
              latitude: item.wd,
              alt: item.gd,
@@ -197,79 +191,79 @@
              address: item.address,
              telephone: item.telephone,
              introduce: item.introduce,
              videourl: item.videourl,
            });
          });
                            videourl: item.videourl
                        })
                    })
          this.$store.commit("SET_ORGNAVBARLIST", list);
        });
      } else if (param.type == "arc") {
        this.$store.commit("SET_ARCNAVBARTITLE", param.title);
        this.$store.commit("SET_ARCNAVBARCODE", param.code);
        this.$store.commit("SET_ARCNAVBARFLAG", true);
                    this.$store.commit('SET_ORGNAVBARLIST', list)
                })
            } else if (param.type == 'arc') {
                this.$store.commit('SET_ARCNAVBARTITLE', param.title)
                this.$store.commit('SET_ARCNAVBARCODE', param.code)
                this.$store.commit('SET_ARCNAVBARFLAG', true)
      }
      this.$router.push(param.path);
            this.$router.push(param.path)
    },
    shortcutShow(event) {
      var sp = document.getElementById("CampusSearchPanel");
            var sp = document.getElementById('CampusSearchPanel')
      if (sp) {
        if (!sp.contains(event.target)) {
          // 这句是说如果我们点击到了id为myPanel以外的区域
          this.shortcutFlag = false;
                    this.shortcutFlag = false
        }
      }
    },
    loadPopup(param) {
      var that = this;
            var that = this
      that.searchInput = "";
      that.searchValList = [];
      that.searchValShow = false;
            that.searchInput = ''
            that.searchValList = []
            that.searchValShow = false
      this.$store.commit("CLEAR_ALL", null);
            this.$store.commit('CLEAR_ALL', null)
      var imgArr = param.tpurl.split(",");
            var imgArr = param.tpurl.split(',')
      this.$store.commit("SET_POPUPBGURL", imgArr[0]);
      this.$store.commit("SET_POPUPQRURL", param.codeurl);
      this.$store.commit("SET_POINTPOSITION", [
            this.$store.commit('SET_POPUPBGURL', imgArr[0])
            this.$store.commit('SET_POPUPQRURL', param.codeurl)
            this.$store.commit('SET_POINTPOSITION', [
        Number(param.jd),
        Number(param.wd),
        Number(param.gd),
        Number(param.heading),
        Number(param.pitch),
        Number(param.roll),
      ]);
      this.$store.commit("SET_STATENAME", param.mechanismname);
      this.$store.commit("SET_SITENAME", param.address);
      this.$store.commit("SET_TELEPHONE", param.telephone);
      this.$store.commit("SET_INTRODUCETEXT", param.introduce);
      if (param.panoramaurl != "") {
        this.$store.commit("SET_PANORAMAURL", param.panoramaurl);
                Number(param.roll)
            ])
            this.$store.commit('SET_STATENAME', param.mechanismname)
            this.$store.commit('SET_SITENAME', param.address)
            this.$store.commit('SET_TELEPHONE', param.telephone)
            this.$store.commit('SET_INTRODUCETEXT', param.introduce)
            if (param.panoramaurl != '') {
                this.$store.commit('SET_PANORAMAURL', param.panoramaurl)
      }
      if (param.videourl && param.videourl != "") {
        this.$store.commit("SET_MONITORURL", param.videourl);
            if (param.videourl && param.videourl != '') {
                this.$store.commit('SET_MONITORURL', param.videourl)
      }
      this.$store.commit("SET_POPUPIMGATLAS", imgArr);
      if (param.jx != undefined && param.jx != "") {
        var tabOne = param.jx.split(",");
        this.$store.commit("SET_TEACHLIST", tabOne);
            this.$store.commit('SET_POPUPIMGATLAS', imgArr)
            if (param.jx != undefined && param.jx != '') {
                var tabOne = param.jx.split(',')
                this.$store.commit('SET_TEACHLIST', tabOne)
      } else {
        this.$store.commit("SET_TEACHLIST", []);
                this.$store.commit('SET_TEACHLIST', [])
      }
      if (param.sh != undefined && param.sh != "") {
        var tabTwo = param.sh.split(",");
        this.$store.commit("SET_LIVELIST", tabTwo);
            if (param.sh != undefined && param.sh != '') {
                var tabTwo = param.sh.split(',')
                this.$store.commit('SET_LIVELIST', tabTwo)
      } else {
        this.$store.commit("SET_LIVELIST", []);
                this.$store.commit('SET_LIVELIST', [])
      }
      this.newPopup(param);
            this.newPopup(param)
      this.viewer.flyToPosition(
        new this.DC.Position(
          Number(param.jd),
@@ -281,25 +275,25 @@
        ),
        () => {},
        0.5
      );
            )
    },
    newPopup(item) {
      const position = this.DC.Transform.transformWGS84ToCartesian(
        new this.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd))
      );
            )
      // eslint-disable-next-line no-unused-vars
      var popup = new this.DC.DivForms(this.viewer, {
        domId: "divFormsDomBox",
        position: [position],
      });
                domId: 'divFormsDomBox',
                position: [position]
            })
      this.$store.commit("SET_PANORAMAPOPUP", false);
      this.$store.commit("SET_MONITORPOPUP", false);
      this.$store.commit("SET_DETAILSPOPUP", true);
    },
  },
};
            this.$store.commit('SET_PANORAMAPOPUP', false)
            this.$store.commit('SET_MONITORPOPUP', false)
            this.$store.commit('SET_DETAILSPOPUP', true)
        }
    }
}
</script>
<style lang="scss" scope>
src/components/map/components/dimension.vue
@@ -1,10 +1,6 @@
<template>
  <div class="dimension-cut">
    <el-radio-group
      v-model="dimensionValue"
      size="medium"
      @change="dimensionChange"
    >
        <el-radio-group v-model="dimensionValue" size="medium" @change="dimensionChange">
      <el-radio-button label="三 维"></el-radio-button>
      <el-radio-button label="真三维"></el-radio-button>
    </el-radio-group>
@@ -12,16 +8,16 @@
</template>
<script>
import axios from "axios";
import { mapGetters } from "vuex";
import { getDetail } from "@/api/pc/public/arc";
import axios from 'axios'
import { mapGetters } from 'vuex'
import { getDetail } from '@/api/pc/public/arc'
export default {
  name: "dimension",
    name: 'dimension',
  data() {
    return {
      DC: null,
      dimensionValue: "三 维",
            dimensionValue: '三 维',
      // 建筑2.5D地图
      newLayer: null,
      baseLayer: null,
@@ -64,159 +60,159 @@
        [114.03863853, 27.62868839, 100],
        [114.03905656, 27.62843592, 100],
        [114.03954722, 27.62819644, 100],
        [114.04006133, 27.628038, 100],
                [114.04006133, 27.628038, 100]
      ],
      mapCenter: [115.871863, 28.743861, 400.0],
    };
            mapCenter: [115.871863, 28.743861, 400.0]
        }
  },
  props: ["areaLayer"],
    props: ['areaLayer'],
  computed: {
    ...mapGetters([
      "viewer",
            'viewer',
      // 校区内导航的显示关闭
      "campusNavFlag",
      "orgNavBarFlag",
      "arcNavBarFlag",
      "closeMapClick", // 关闭地图点击,防止新增标签误触
    ]),
            'campusNavFlag',
            'orgNavBarFlag',
            'arcNavBarFlag',
            'closeMapClick' // 关闭地图点击,防止新增标签误触
        ])
  },
  created() {
    this.DC = global.DC;
        this.DC = global.DC
  },
  watch: {
    viewer: {
      immediate: true,
      handler(newCode, oldCode) {
        if (this.titlesetLayerFlag == false && newCode != null) {
          var that = this;
                    var that = this
          that.tilesetLayer = new that.DC.TilesetLayer("tilesetLayer");
          that.viewer.addLayer(that.tilesetLayer);
          that.tileset = new that.DC.Tileset("/mx/tileset.json", {
                    that.tilesetLayer = new that.DC.TilesetLayer('tilesetLayer')
                    that.viewer.addLayer(that.tilesetLayer)
                    that.tileset = new that.DC.Tileset('/mx/tileset.json', {
            luminanceAtZenith: 0.3,
            shadows: that.DC.Namespace.Cesium.ShadowMode.DISABLED,
          });
          that.tilesetLayer.addOverlay(that.tileset);
          that.tilesetLayer.show = false;
                        shadows: that.DC.Namespace.Cesium.ShadowMode.DISABLED
                    })
                    that.tilesetLayer.addOverlay(that.tileset)
                    that.tilesetLayer.show = false
          that.silhouetteBlue =
            that.DC.Namespace.Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
                        that.DC.Namespace.Cesium.PostProcessStageLibrary.createEdgeDetectionStage()
          that.silhouetteBlue.uniforms.color =
            that.DC.Namespace.Cesium.Color.fromBytes(9, 162, 40);
          that.silhouetteBlue.uniforms.length = 0.01;
          that.silhouetteBlue.selected = [];
                        that.DC.Namespace.Cesium.Color.fromBytes(9, 162, 40)
                    that.silhouetteBlue.uniforms.length = 0.01
                    that.silhouetteBlue.selected = []
          that.viewer.scene.postProcessStages.add(
            that.DC.Namespace.Cesium.PostProcessStageLibrary.createSilhouetteStage(
              [that.silhouetteBlue]
            )
          );
                    )
          that.vecLayer = that.viewer.imageryLayers.addImageryProvider(
            new that.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
              url: " http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36",
              type: "wmts",
              layer: "vec",
              style: "default",
              format: "tiles",
              tileMatrixSetID: "w",
                            url: ' http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                            type: 'wmts',
                            layer: 'vec',
                            style: 'default',
                            format: 'tiles',
                            tileMatrixSetID: 'w',
              show: true,
              maximumLevel: 18,
                            maximumLevel: 18
            })
          );
                    )
          that.cvaLayer = that.viewer.imageryLayers.addImageryProvider(
            new that.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
              url: " http://t1.tianditu.gov.cn/cva_w/wmts?tk=9ae78c51a0a28f06444d541148496e36",
              type: "wmts",
              layer: "cva",
              style: "default",
              format: "tiles",
              tileMatrixSetID: "w",
                            url: ' http://t1.tianditu.gov.cn/cva_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                            type: 'wmts',
                            layer: 'cva',
                            style: 'default',
                            format: 'tiles',
                            tileMatrixSetID: 'w',
              show: true,
              maximumLevel: 18,
                            maximumLevel: 18
            })
          );
                    )
          var highlighted = {
            feature: undefined,
            originalColor: new that.DC.Namespace.Cesium.Color(),
          };
                        originalColor: new that.DC.Namespace.Cesium.Color()
                    }
          var selected = {
            feature: undefined,
            originalColor: new that.DC.Namespace.Cesium.Color(),
          };
                        originalColor: new that.DC.Namespace.Cesium.Color()
                    }
          const videoLayer = new that.DC.CameraVideoLayer("video-layer").addTo(
                    const videoLayer = new that.DC.CameraVideoLayer('video-layer').addTo(
            that.viewer
          );
                    )
          const cameraVideo = new that.DC.CameraVideo(
            new that.DC.Position(114.03935976, 27.62939045, 100.25, 4.2, -90),
            document.getElementById("video")
          );
                        document.getElementById('video')
                    )
          cameraVideo.setStyle({
            fov: 30,
            far: 120,
            near: 1,
            aspectRatio: 1.3,
            alpha: 0.7,
          });
          videoLayer.addOverlay(cameraVideo);
                        alpha: 0.7
                    })
                    videoLayer.addOverlay(cameraVideo)
          that.tileset.on(that.DC.MouseEventType.CLICK, (e) => {
            if (that.closeMapClick) {
              return;
                            return
            }
            that.viewer.scene.globe.depthTestAgainstTerrain = false;
                        that.viewer.scene.globe.depthTestAgainstTerrain = false
            if (e.overlay && e.overlay.attr.arcName != null) {
              this.$store.commit("CLEAR_ALL", null);
                            this.$store.commit('CLEAR_ALL', null)
              getDetail({
                mechanismname: e.overlay.attr.arcName,
                                mechanismname: e.overlay.attr.arcName
              }).then((res) => {
                if (res && JSON.stringify(res.data.data) != "{}") {
                  var result = res.data.data;
                                if (res && JSON.stringify(res.data.data) != '{}') {
                                    var result = res.data.data
                  var imgArr = result.tpurl.split(",");
                  this.$store.commit("SET_POPUPBGURL", imgArr[0]);
                  this.$store.commit("SET_POPUPQRURL", result.codeurl);
                  this.$store.commit("SET_POINTPOSITION", [
                                    var imgArr = result.tpurl.split(',')
                                    this.$store.commit('SET_POPUPBGURL', imgArr[0])
                                    this.$store.commit('SET_POPUPQRURL', result.codeurl)
                                    this.$store.commit('SET_POINTPOSITION', [
                    Number(e.wgs84Position.lng),
                    Number(e.wgs84Position.lat),
                    Number(e.wgs84Position.alt),
                    Number(0),
                    Number(0),
                    Number(0),
                  ]);
                  this.$store.commit("SET_STATENAME", result.mechanismname);
                  this.$store.commit("SET_SITENAME", result.address);
                  this.$store.commit("SET_TELEPHONE", result.telephone);
                  this.$store.commit("SET_INTRODUCETEXT", result.introduce);
                  this.$store.commit("SET_PANORAMAURL", result.panoramaurl);
                  this.$store.commit("SET_POPUPIMGATLAS", imgArr);
                  if (result.videourl && result.videourl != "") {
                    this.$store.commit("SET_MONITORURL", result.videourl);
                                        Number(0)
                                    ])
                                    this.$store.commit('SET_STATENAME', result.mechanismname)
                                    this.$store.commit('SET_SITENAME', result.address)
                                    this.$store.commit('SET_TELEPHONE', result.telephone)
                                    this.$store.commit('SET_INTRODUCETEXT', result.introduce)
                                    this.$store.commit('SET_PANORAMAURL', result.panoramaurl)
                                    this.$store.commit('SET_POPUPIMGATLAS', imgArr)
                                    if (result.videourl && result.videourl != '') {
                                        this.$store.commit('SET_MONITORURL', result.videourl)
                  }
                  if (result.jx != undefined && result.jx != "") {
                    var tabOne = res.data.data[0].jx.split(",");
                    this.$store.commit("SET_TEACHLIST", tabOne);
                                    if (result.jx != undefined && result.jx != '') {
                                        var tabOne = res.data.data[0].jx.split(',')
                                        this.$store.commit('SET_TEACHLIST', tabOne)
                  } else {
                    this.$store.commit("SET_TEACHLIST", []);
                                        this.$store.commit('SET_TEACHLIST', [])
                  }
                  if (result.sh != undefined && result.sh != "") {
                    var tabTwo = res.data.data[0].sh.split(",");
                    this.$store.commit("SET_LIVELIST", tabTwo);
                                    if (result.sh != undefined && result.sh != '') {
                                        var tabTwo = res.data.data[0].sh.split(',')
                                        this.$store.commit('SET_LIVELIST', tabTwo)
                  } else {
                    this.$store.commit("SET_LIVELIST", []);
                                        this.$store.commit('SET_LIVELIST', [])
                  }
                  // 定制化窗体
                  // eslint-disable-next-line no-unused-vars
                  var popup = new that.DC.DivForms(that.viewer, {
                    domId: "divFormsDomBox",
                                        domId: 'divFormsDomBox',
                    position: [
                      that.DC.Transform.transformWGS84ToCartesian(
                        new that.DC.Position(
@@ -224,15 +220,15 @@
                          Number(e.wgs84Position.lat),
                          Number(e.wgs84Position.alt)
                        )
                      ),
                    ],
                  });
                                            )
                                        ]
                                    })
                  this.$store.commit("SET_PANORAMAPOPUP", false);
                  this.$store.commit("SET_MONITORPOPUP", false);
                  this.$store.commit("SET_DETAILSPOPUP", true);
                                    this.$store.commit('SET_PANORAMAPOPUP', false)
                                    this.$store.commit('SET_MONITORPOPUP', false)
                                    this.$store.commit('SET_DETAILSPOPUP', true)
                }
              });
                            })
              this.viewer.flyToPosition(
                new this.DC.Position(
@@ -243,9 +239,9 @@
                  Number(-34.54),
                  Number(0)
                )
              );
                            )
            }
          });
                    })
          // that.tileset.on(that.DC.MouseEventType.MOUSE_MOVE, e => {
          //     that.silhouetteBlue.selected = []
@@ -302,36 +298,36 @@
          var provider =
            new that.DC.Namespace.Cesium.UrlTemplateImageryProvider({
              url: "/wp/{z}/{x}/{y}.png",
              fileExtension: "png",
                            url: '/wp/{z}/{x}/{y}.png',
                            fileExtension: 'png'
              // minimumLevel: 19
            });
                        })
          var baseProvider =
            new that.DC.Namespace.Cesium.UrlTemplateImageryProvider({
              url: "/base/{z}/{x}/{y}.png",
              fileExtension: "png",
            });
                            url: '/base/{z}/{x}/{y}.png',
                            fileExtension: 'png'
                        })
          // that.baseLayer = that.viewer.imageryLayers.addImageryProvider(baseProvider)
          that.newLayer =
            that.viewer.imageryLayers.addImageryProvider(provider);
                        that.viewer.imageryLayers.addImageryProvider(provider)
          that.wallLayer = new that.DC.VectorLayer("wallLayer");
                    that.wallLayer = new that.DC.VectorLayer('wallLayer')
          // that.viewer.addLayer(that.wallLayer)
          that.wallArr.forEach((item) => {
            item = item.join(",");
          });
          that.wallArr = that.wallArr.join(";");
          const wall = new that.DC.Wall(that.wallArr);
                        item = item.join(',')
                    })
                    that.wallArr = that.wallArr.join(';')
                    const wall = new that.DC.Wall(that.wallArr)
          wall.setStyle({
            material: new that.DC.WallTrailMaterialProperty({
              color: that.DC.Namespace.Cesium.Color.fromBytes(0, 142, 255, 150),
              // color: that.DC.Color.CYAN,
              speed: 10,
            }),
          });
                            speed: 10
                        })
                    })
          // that.wallLayer.addOverlay(wall)
          // that.viewer.camera.setView({
@@ -369,7 +365,7 @@
          //         }
          //     })
          // }, 400)
          that.titlesetLayerFlag = true;
                    that.titlesetLayerFlag = true
          that.viewer.camera.setView({
            // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
@@ -384,40 +380,40 @@
              heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
              // 视角
              pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
              roll: 0.0,
            },
          });
                            roll: 0.0
                        }
                    })
          // 最小
          that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220;
                    that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220
          // 最大
          that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400;
                    that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400
          // 设置相机缩小时的速率
          that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000;
                    that.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000
          // 设置相机放大时的速率
          that.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000;
                    that.viewer.scene.screenSpaceCameraController._maximumZoomRate = 5906376272000
          // 视角平移
          that.viewer.scene.screenSpaceCameraController.enableRotate = true;
                    that.viewer.scene.screenSpaceCameraController.enableRotate = true
          // 视角缩放
          that.viewer.scene.screenSpaceCameraController.enableZoom = true;
                    that.viewer.scene.screenSpaceCameraController.enableZoom = true
          // 视角旋转
          that.viewer.scene.screenSpaceCameraController.enableTilt = false;
                    that.viewer.scene.screenSpaceCameraController.enableTilt = false
          axios
            .get(
              "http://arcgis.jxpskj.com:6080/arcgis/rest/services/lxxqwxq/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson"
                            'http://arcgis.jxpskj.com:6080/arcgis/rest/services/lxxqwxq/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson'
            )
            .then((resultData) => {
              resultData.data.features.forEach((item) => {
                item.geometry.rings[0].forEach((it) => {
                  it = it.join(",");
                });
                                    it = it.join(',')
                                })
                item.geometry.rings[0] = item.geometry.rings[0].join(";");
                                item.geometry.rings[0] = item.geometry.rings[0].join(';')
                const polygon = new that.DC.Polygon(item.geometry.rings[0]);
                polygon.attr = item.attributes;
                                const polygon = new that.DC.Polygon(item.geometry.rings[0])
                                polygon.attr = item.attributes
                polygon.setStyle({
                  material: that.DC.Namespace.Cesium.Color.fromBytes(
@@ -425,41 +421,41 @@
                    255,
                    255,
                    1
                  ),
                });
                                    )
                                })
                that.areaLayer.addOverlay(polygon);
              });
                                that.areaLayer.addOverlay(polygon)
                            })
              that.areaLayer.show = true;
            });
                            that.areaLayer.show = true
                        })
          var select = {
            overlay: undefined,
            color: undefined,
          };
                        color: undefined
                    }
          that.viewer.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => {
            if (that.closeMapClick) {
              return;
                            return
            }
            if (e.overlay != undefined && e.layer.id == "areaLayer") {
                        if (e.overlay != undefined && e.layer.id == 'areaLayer') {
              if (select.overlay != undefined) {
                if (e.overlay != select.overlay) {
                  select.overlay.setStyle({
                    material: select.color,
                    outline: false,
                  });
                                        outline: false
                                    })
                  select.overlay = undefined;
                  select.color = undefined;
                                    select.overlay = undefined
                                    select.color = undefined
                }
              }
              if (select.overlay == undefined) {
                select.overlay = e.overlay;
                                select.overlay = e.overlay
                select.color = e.overlay._style.material;
                                select.color = e.overlay._style.material
                select.overlay.setStyle({
                  outline: true,
                  outlineColor: that.DC.Namespace.Cesium.Color.fromBytes(
@@ -475,76 +471,76 @@
                    245,
                    113,
                    158
                  ),
                });
                                    )
                                })
              }
            } else {
              if (select.overlay != undefined) {
                select.overlay.setStyle({
                  material: select.color,
                  outline: false,
                });
                                    outline: false
                                })
                select.overlay = undefined;
                select.color = undefined;
                                select.overlay = undefined
                                select.color = undefined
              }
            }
          });
                    })
          that.viewer.on(that.DC.MouseEventType.CLICK, (e) => {
            if (that.closeMapClick) {
              return;
                            return
            }
            if (e.overlay != undefined && e.layer.id == "areaLayer") {
                        if (e.overlay != undefined && e.layer.id == 'areaLayer') {
              var rid =
                e.overlay.attr["楼栋号"] == "8栋"
                  ? "9栋"
                  : e.overlay.attr["楼栋号"] == "9栋"
                  ? "8栋"
                  : e.overlay.attr["楼栋号"];
              this.$store.commit("CLEAR_ALL", null);
              getDetail({ mechanismname: "香琴湾" + rid }).then((res) => {
                that.viewer.scene.globe.depthTestAgainstTerrain = false;
                var result = res.data.data;
                                e.overlay.attr['楼栋号'] == '8栋'
                                    ? '9栋'
                                    : e.overlay.attr['楼栋号'] == '9栋'
                                        ? '8栋'
                                        : e.overlay.attr['楼栋号']
                            this.$store.commit('CLEAR_ALL', null)
                            getDetail({ mechanismname: '香琴湾' + rid }).then((res) => {
                                that.viewer.scene.globe.depthTestAgainstTerrain = false
                                var result = res.data.data
                var imgArr = result.tpurl.split(",");
                this.$store.commit("SET_POPUPBGURL", imgArr[0]);
                this.$store.commit("SET_POPUPQRURL", result.codeurl);
                this.$store.commit("SET_POINTPOSITION", [
                                var imgArr = result.tpurl.split(',')
                                this.$store.commit('SET_POPUPBGURL', imgArr[0])
                                this.$store.commit('SET_POPUPQRURL', result.codeurl)
                                this.$store.commit('SET_POINTPOSITION', [
                  Number(e.wgs84Position.lng),
                  Number(e.wgs84Position.lat),
                  Number(e.wgs84Position.alt),
                  Number(0),
                  Number(0),
                  Number(0),
                ]);
                this.$store.commit("SET_STATENAME", result.mechanismname);
                this.$store.commit("SET_SITENAME", result.address);
                this.$store.commit("SET_TELEPHONE", result.telephone);
                this.$store.commit("SET_INTRODUCETEXT", result.introduce);
                this.$store.commit("SET_PANORAMAURL", result.panoramaurl);
                this.$store.commit("SET_POPUPIMGATLAS", imgArr);
                if (result.videourl && result.videourl != "") {
                  this.$store.commit("SET_MONITORURL", result.videourl);
                                    Number(0)
                                ])
                                this.$store.commit('SET_STATENAME', result.mechanismname)
                                this.$store.commit('SET_SITENAME', result.address)
                                this.$store.commit('SET_TELEPHONE', result.telephone)
                                this.$store.commit('SET_INTRODUCETEXT', result.introduce)
                                this.$store.commit('SET_PANORAMAURL', result.panoramaurl)
                                this.$store.commit('SET_POPUPIMGATLAS', imgArr)
                                if (result.videourl && result.videourl != '') {
                                    this.$store.commit('SET_MONITORURL', result.videourl)
                }
                if (result.jx != undefined && result.jx != "") {
                  var tabOne = res.data.data[0].jx.split(",");
                  this.$store.commit("SET_TEACHLIST", tabOne);
                                if (result.jx != undefined && result.jx != '') {
                                    var tabOne = res.data.data[0].jx.split(',')
                                    this.$store.commit('SET_TEACHLIST', tabOne)
                } else {
                  this.$store.commit("SET_TEACHLIST", []);
                                    this.$store.commit('SET_TEACHLIST', [])
                }
                if (result.sh != undefined && result.sh != "") {
                  var tabTwo = res.data.data[0].sh.split(",");
                  this.$store.commit("SET_LIVELIST", tabTwo);
                                if (result.sh != undefined && result.sh != '') {
                                    var tabTwo = res.data.data[0].sh.split(',')
                                    this.$store.commit('SET_LIVELIST', tabTwo)
                } else {
                  this.$store.commit("SET_LIVELIST", []);
                                    this.$store.commit('SET_LIVELIST', [])
                }
                // 定制化窗体
                // eslint-disable-next-line no-unused-vars
                var popup = new that.DC.DivForms(that.viewer, {
                  domId: "divFormsDomBox",
                                    domId: 'divFormsDomBox',
                  position: [
                    that.DC.Transform.transformWGS84ToCartesian(
                      new that.DC.Position(
@@ -552,14 +548,14 @@
                        Number(e.wgs84Position.lat),
                        Number(e.wgs84Position.alt)
                      )
                    ),
                  ],
                });
                                        )
                                    ]
                                })
                this.$store.commit("SET_PANORAMAPOPUP", false);
                this.$store.commit("SET_MONITORPOPUP", false);
                this.$store.commit("SET_DETAILSPOPUP", true);
              });
                                this.$store.commit('SET_PANORAMAPOPUP', false)
                                this.$store.commit('SET_MONITORPOPUP', false)
                                this.$store.commit('SET_DETAILSPOPUP', true)
                            })
              this.viewer.flyToPosition(
                new this.DC.Position(
@@ -572,13 +568,13 @@
                ),
                () => {},
                0
              );
                            )
            }
          });
                    })
          document.querySelector(".dc-zoom-controller").children[1].onclick =
                    document.querySelector('.dc-zoom-controller').children[1].onclick =
            function () {
              if (that.dimensionValue == "真三维") {
                            if (that.dimensionValue == '真三维') {
                that.viewer.camera.setView({
                  // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                  // fromDegrees()方法,将经纬度和高程转换为世界坐标
@@ -592,9 +588,9 @@
                    heading: that.DC.Namespace.Cesium.Math.toRadians(-9),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-34.54),
                    roll: 0.0,
                  },
                });
                                        roll: 0.0
                                    }
                                })
              } else {
                that.viewer.camera.setView({
                  // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
@@ -609,21 +605,21 @@
                    heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                    roll: 0.0,
                  },
                });
                                        roll: 0.0
              }
            };
                                })
                            }
                        }
          document.querySelector(".dc-zoom-controller").children[2].onclick =
                    document.querySelector('.dc-zoom-controller').children[2].onclick =
            function () {
              if (
                that.dimensionValue != undefined &&
                that.dimensionValue != "真三维"
                                that.dimensionValue != '真三维'
              ) {
                const height = Math.ceil(
                  that.viewer.camera.positionCartographic.height
                );
                                )
                if (height <= 250) {
                  that.viewer.camera.setView({
@@ -638,9 +634,9 @@
                      heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                      // 视角
                      pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                      roll: 0.0,
                    },
                  });
                                            roll: 0.0
                                        }
                                    })
                }
                if (height > 250 && height <= 310) {
@@ -656,9 +652,9 @@
                      heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                      // 视角
                      pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                      roll: 0.0,
                    },
                  });
                                            roll: 0.0
                                        }
                                    })
                }
                if (height > 310 && height < 370) {
@@ -674,22 +670,22 @@
                      heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                      // 视角
                      pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                      roll: 0.0,
                    },
                  });
                                            roll: 0.0
                                        }
                                    })
                }
              }
            };
                        }
          document.querySelector(".dc-zoom-controller").children[0].onclick =
                    document.querySelector('.dc-zoom-controller').children[0].onclick =
            function () {
              if (
                that.dimensionValue != undefined &&
                that.dimensionValue != "真三维"
                                that.dimensionValue != '真三维'
              ) {
                const height = Math.ceil(
                  that.viewer.camera.positionCartographic.height
                );
                                )
                if (height > 370) {
                  that.viewer.camera.setView({
@@ -704,11 +700,11 @@
                      heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                      // 视角
                      pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                      roll: 0.0,
                    },
                  });
                                            roll: 0.0
                                        }
                                    })
                  return;
                                    return
                }
                if (height > 310) {
@@ -724,11 +720,11 @@
                      heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                      // 视角
                      pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                      roll: 0.0,
                    },
                  });
                                            roll: 0.0
                                        }
                                    })
                  return;
                                    return
                }
                if (height > 250) {
@@ -744,21 +740,21 @@
                      heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                      // 视角
                      pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                      roll: 0.0,
                    },
                  });
                                            roll: 0.0
                                        }
                                    })
                }
              }
            };
                        }
          that.viewer.on(that.DC.SceneEventType.CAMERA_CHANGED, () => {
            if (
              that.dimensionValue != undefined &&
              that.dimensionValue != "真三维"
                            that.dimensionValue != '真三维'
            ) {
              const height = Math.ceil(
                that.viewer.camera.positionCartographic.height
              );
                            )
              that.viewer.camera.setView({
                orientation: {
@@ -766,9 +762,9 @@
                  heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                  // 视角
                  pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                  roll: 0.0,
                },
              });
                                    roll: 0.0
                                }
                            })
              if (height <= 250) {
                that.viewer.camera.setView({
@@ -782,9 +778,9 @@
                    heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                    roll: 0.0,
                  },
                });
                                        roll: 0.0
                                    }
                                })
              }
              if (height > 250 && height <= 310) {
@@ -799,9 +795,9 @@
                    heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                    roll: 0.0,
                  },
                });
                                        roll: 0.0
                                    }
                                })
              }
              if (height > 310 && height <= 370) {
@@ -816,9 +812,9 @@
                    heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                    roll: 0.0,
                  },
                });
                                        roll: 0.0
                                    }
                                })
              }
              if (height > 370) {
@@ -833,15 +829,15 @@
                    heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                    roll: 0.0,
                  },
                });
                                        roll: 0.0
                                    }
                                })
              }
            }
          });
                    })
        }
      },
    },
            }
        }
  },
  methods: {
    // openPopups(lng, lat, alt) {
@@ -855,15 +851,15 @@
    //   });
    // },
    dimensionChange() {
      var that = this;
      that.$store.commit("SET_TWOORTHREE", that.dimensionValue);
      if (that.dimensionValue == "真三维") {
            var that = this
            that.$store.commit('SET_TWOORTHREE', that.dimensionValue)
            if (that.dimensionValue == '真三维') {
        // that.wallLayer.show = false
        that.areaLayer.show = false;
        that.viewer.imageryLayers.remove(that.newLayer);
        that.newLayer = null;
                that.areaLayer.show = false
                that.viewer.imageryLayers.remove(that.newLayer)
                that.newLayer = null
        // that.viewer.imageryLayers.remove(that.baseLayer)
        that.baseLayer = null;
                that.baseLayer = null
        // that.vecLayer = that.viewer.imageryLayers.addImageryProvider(new that.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
        //     url: ' http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
        //     type: 'wmts',
@@ -885,15 +881,15 @@
        //     show: true,
        //     maximumLevel: 18
        // }))
        that.silhouetteBlue.selected = [];
        that.tilesetLayer.show = true;
                that.silhouetteBlue.selected = []
                that.tilesetLayer.show = true
        // 最小
        that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 1.0;
                that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 1.0
        // 最大
        that.viewer.scene.screenSpaceCameraController.maximumZoomDistance =
          Number.POSITIVE_INFINITY;
                    Number.POSITIVE_INFINITY
        // 视角旋转
        that.viewer.scene.screenSpaceCameraController.enableTilt = true;
                that.viewer.scene.screenSpaceCameraController.enableTilt = true
        // 115.877863,28.741661
        that.viewer.camera.setView({
          // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
@@ -908,34 +904,34 @@
            heading: that.DC.Namespace.Cesium.Math.toRadians(-9),
            // 视角
            pitch: that.DC.Namespace.Cesium.Math.toRadians(-34.54),
            roll: 0.0,
          },
        });
                        roll: 0.0
                    }
                })
      } else {
        that.tilesetLayer.show = false;
                that.tilesetLayer.show = false
        // that.viewer.imageryLayers.remove(that.vecLayer)
        // that.vecLayer = null
        // that.viewer.imageryLayers.remove(that.cvaLayer)
        // that.cvaLayer = null
        that.areaLayer.show = true;
                that.areaLayer.show = true
        // var provider = new that.DC.Namespace.Cesium.ArcGisMapServerImageryProvider({
        //     url: 'http://arcgis.jxpskj.com:6080/arcgis/rest/services/PingXiang25DMapQP/MapServer'
        // })
        var provider = new that.DC.Namespace.Cesium.UrlTemplateImageryProvider({
          url: "/wp/{z}/{x}/{y}.png",
          fileExtension: "png",
        });
                    url: '/wp/{z}/{x}/{y}.png',
                    fileExtension: 'png'
                })
        var baseProvider =
          new that.DC.Namespace.Cesium.UrlTemplateImageryProvider({
            url: "/base/{z}/{x}/{y}.png",
            fileExtension: "png",
          });
                        url: '/base/{z}/{x}/{y}.png',
                        fileExtension: 'png'
                    })
        // that.baseLayer = that.viewer.imageryLayers.addImageryProvider(baseProvider)
        that.newLayer = that.viewer.imageryLayers.addImageryProvider(provider);
                that.newLayer = that.viewer.imageryLayers.addImageryProvider(provider)
        // that.wallLayer.show = true
@@ -952,19 +948,19 @@
            heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
            // 视角
            pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
            roll: 0.0,
          },
        });
        // 最小
        that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220;
        // 最大
        that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400;
        // 视角旋转
        that.viewer.scene.screenSpaceCameraController.enableTilt = false;
                        roll: 0.0
      }
    },
  },
};
                })
                // 最小
                that.viewer.scene.screenSpaceCameraController.minimumZoomDistance = 220
                // 最大
                that.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 400
                // 视角旋转
                that.viewer.scene.screenSpaceCameraController.enableTilt = false
            }
        }
    }
}
</script>
<style lang="scss" scoped>
src/components/map/components/mapPopup.vue
@@ -78,7 +78,9 @@
                          v-show="panoramaUrl != null && panoramaUrl != ''"
                          @click="panoramaClick"
                        >
                          <i class="popup-icon live-action-nav deblurring"></i>
                                                    <i
                                                        class="popup-icon live-action-nav deblurring"
                                                    ></i>
                          实景
                        </li>
                        <!-- v-show="panoramaUrl != null && panoramaUrl != ''" -->
@@ -97,16 +99,12 @@
                          v-show="teachList.length > 0"
                          :class="{ on: tabBtnFlag == '教学科研行政' }"
                          @click="tabBtnClick('教学科研行政')"
                        >
                          教学科研行政
                        </li>
                                                >教学科研行政</li>
                        <li
                          v-show="liveList.length > 0"
                          :class="{ on: tabBtnFlag == '生活服务' }"
                          @click="tabBtnClick('生活服务')"
                        >
                          生活服务
                        </li>
                                                >生活服务</li>
                      </ul>
                      <div class="btm-content">
                        <div :class="{ on: tabBtnFlag == '教学科研行政' }">
@@ -241,15 +239,10 @@
                  </div>
                  <div class="add-tag-content">
                    <div>
                      <el-input
                        v-model="addTagName"
                        placeholder="请输入标签名称"
                      ></el-input>
                                            <el-input v-model="addTagName" placeholder="请输入标签名称"></el-input>
                    </div>
                    <div>
                      <el-button type="primary" @click="createTag"
                        >生成标记</el-button
                      >
                                            <el-button type="primary" @click="createTag">生成标记</el-button>
                    </div>
                  </div>
                </div>
@@ -287,9 +280,9 @@
                    <!-- data:image/png;base64, -->
                    <img
                      :src="nowlabelLayerData.qrcode"
                      alt=""
                                            alt
                      class="labelLayeridewm"
                      style="width:250px,height:250px"
                                            style="width: 250px; height: 250px"
                    />
                  </div>
                </div>
@@ -333,9 +326,7 @@
            line-height: 36px;
            text-align: center;
          "
        >
          (右键另存为图片)
        </div>
                >(右键另存为图片)</div>
      </div>
    </el-dialog>
@@ -350,254 +341,254 @@
</template>
<script>
import { mapGetters } from "vuex";
import { getMechanismDetail } from "@/api/pc/public/arc";
import { setlabel } from "@/api/pc/label";
import { mapGetters } from 'vuex'
import { getMechanismDetail } from '@/api/pc/public/arc'
import { setlabel } from '@/api/pc/label'
export default {
  name: "mapPopup",
    name: 'mapPopup',
  data() {
    return {
      DC: null,
      tabBtnFlag: "教学科研行政",
            tabBtnFlag: '教学科研行政',
      QRCodeFlag: false,
      audioSource: "",
            audioSource: '',
      audioFlag: false,
      audioCourse: false,
      audioSynth: null,
      audioMsg: null,
      fullscreen: false,
      fullScreenUrl: "/img/icon/bigScreen.png",
      addTagName: "",
      addTagLayer: null,
    };
            fullScreenUrl: '/img/icon/bigScreen.png',
            addTagName: '',
            addTagLayer: null
        }
  },
  computed: {
    ...mapGetters([
      "viewer",
      "popupBgUrl",
      "pupupQRUrl",
            'viewer',
            'popupBgUrl',
            'pupupQRUrl',
      // 终点
      "terminus",
            'terminus',
      // 起点
      "startingPoint",
            'startingPoint',
      // 点信息
      "pointPosition",
            'pointPosition',
      // 点名称
      "stateName",
            'stateName',
      // 地址
      "siteName",
            'siteName',
      // 电话
      "telephone",
            'telephone',
      // 介绍
      "introduceText",
            'introduceText',
      // 详情弹框显示关闭
      "detailsPopup",
            'detailsPopup',
      // 全景地址
      "panoramaUrl",
            'panoramaUrl',
      // 全景弹框显示关闭
      "panoramaPopup",
            'panoramaPopup',
      // 监控地址
      "monitorUrl",
            'monitorUrl',
      // 监控弹框显示关闭
      "monitorPopup",
            'monitorPopup',
      "popupImgAtlas",
            'popupImgAtlas',
      // 教学
      "teachList",
            'teachList',
      // 科研
      "liveList",
            'liveList',
      // 校区内导航的显示关闭
      "campusNavFlag",
      "addTagPopup",
      "addTagPosition",
            'campusNavFlag',
            'addTagPopup',
            'addTagPosition',
      //自定义标签弹窗
      "labelLayerDataShow",
      "nowlabelLayerData",
    ]),
            'labelLayerDataShow',
            'nowlabelLayerData'
        ])
  },
  created() {
    this.DC = global.DC;
        this.DC = global.DC
    this.audioSynth = window.speechSynthesis;
    this.audioMsg = new window.SpeechSynthesisUtterance();
        this.audioSynth = window.speechSynthesis
        this.audioMsg = new window.SpeechSynthesisUtterance()
    this.audioMsg.onend = function () {
      this.audioSynth.cancel();
      this.audioFlag = false;
      this.audioCourse = false;
    };
            this.audioSynth.cancel()
            this.audioFlag = false
            this.audioCourse = false
        }
  },
  mounted() {},
  watch: {
    addTagPopup() {
      if (!this.addTagPopup) {
        // console.log("取消", "see");
        this.$store.commit("set_closeMapClick", false);
                this.$store.commit('set_closeMapClick', false)
      }
    },
    introduceText: {
      immediate: true,
      handler(newQuestion, oldQuestion) {
        this.audioSource = newQuestion;
                this.audioSource = newQuestion
        if (this.audioFlag == true) {
          this.audioSynth.cancel();
          this.audioFlag = false;
          this.audioCourse = false;
                    this.audioSynth.cancel()
                    this.audioFlag = false
                    this.audioCourse = false
        }
      },
            }
    },
    teachList: {
      immediate: true,
      handler(newCode, oldCode) {
        if (newCode.length > 0) {
          this.tabBtnFlag = "教学科研行政";
                    this.tabBtnFlag = '教学科研行政'
        }
      },
            }
    },
    liveList: {
      immediate: true,
      handler(newCode, oldCode) {
        if (newCode.length > 0 && this.teachList.length == 0) {
          this.tabBtnFlag = "生活服务";
                    this.tabBtnFlag = '生活服务'
        }
      },
            }
    },
    detailsPopup: {
      immediate: true,
      handler(newCode, oldCode) {
        if (newCode == false) {
          this.audioSynth.cancel();
          this.audioFlag = false;
          this.audioCourse = false;
                    this.audioSynth.cancel()
                    this.audioFlag = false
                    this.audioCourse = false
        } else {
          if (this.audioFlag == true) {
            this.audioSynth.cancel();
            this.audioFlag = false;
            this.audioCourse = false;
                        this.audioSynth.cancel()
                        this.audioFlag = false
                        this.audioCourse = false
          }
        }
      },
    },
            }
        }
  },
  methods: {
    screen() {
      if (this.fullscreen) {
        this.fullScreenUrl = "/img/icon/bigScreen.png";
        this.fullscreen = !this.fullscreen;
                this.fullScreenUrl = '/img/icon/bigScreen.png'
                this.fullscreen = !this.fullscreen
        document.getElementById("pcElHeader").style.zIndex = 9999;
                document.getElementById('pcElHeader').style.zIndex = 9999
      } else {
        this.fullScreenUrl = "/img/icon/smallScreen.png";
        this.fullscreen = !this.fullscreen;
                this.fullScreenUrl = '/img/icon/smallScreen.png'
                this.fullscreen = !this.fullscreen
        document.getElementById("pcElHeader").style.zIndex = 9;
                document.getElementById('pcElHeader').style.zIndex = 9
      }
    },
    tabBtnClick(param) {
      this.tabBtnFlag = param;
            this.tabBtnFlag = param
    },
    comeHereClick() {
      this.$store.commit("SET_COMENAME", this.stateName);
      this.$store.commit("SET_TERMINUS", this.pointPosition);
            this.$store.commit('SET_COMENAME', this.stateName)
            this.$store.commit('SET_TERMINUS', this.pointPosition)
      if (this.campusNavFlag == false) {
        this.$store.commit("SET_CAMPUSNAVFLAG", true);
                this.$store.commit('SET_CAMPUSNAVFLAG', true)
      }
    },
    getToHereClick() {
      this.$store.commit("SET_GETTONAME", this.stateName);
      this.$store.commit("SET_STARTINGPOINT", this.pointPosition);
            this.$store.commit('SET_GETTONAME', this.stateName)
            this.$store.commit('SET_STARTINGPOINT', this.pointPosition)
      if (this.campusNavFlag == false) {
        this.$store.commit("SET_CAMPUSNAVFLAG", true);
                this.$store.commit('SET_CAMPUSNAVFLAG', true)
      }
    },
    qrCodeClick() {
      this.QRCodeFlag = true;
            this.QRCodeFlag = true
    },
    imgsClick() {
      this.$refs.popupImgs.clickHandler();
            this.$refs.popupImgs.clickHandler()
    },
    panoramaClick() {
      if (this.audioFlag == true) {
        this.audioSynth.cancel();
        this.audioFlag = false;
        this.audioCourse = false;
                this.audioSynth.cancel()
                this.audioFlag = false
                this.audioCourse = false
      }
      // eslint-disable-next-line new-cap
      var positions = this.DC.Transform.transformWGS84ToCartesian(
        // eslint-disable-next-line new-cap
        new this.DC.Position.fromArray(this.pointPosition)
      );
      this.viewer.scene.globe.depthTestAgainstTerrain = false;
            )
            this.viewer.scene.globe.depthTestAgainstTerrain = false
      // eslint-disable-next-line no-unused-vars
      var panorama = new this.DC.PanoramaBox(this.viewer, {
        domId: "PanoramaBox",
        position: [positions],
      });
                domId: 'PanoramaBox',
                position: [positions]
            })
      this.$store.commit("SET_DETAILSPOPUP", false);
      this.$store.commit("SET_MONITORPOPUP", false);
      this.$store.commit("SET_PANORAMAPOPUP", true);
            this.$store.commit('SET_DETAILSPOPUP', false)
            this.$store.commit('SET_MONITORPOPUP', false)
            this.$store.commit('SET_PANORAMAPOPUP', true)
    },
    monitorClick() {
      if (this.audioFlag == true) {
        this.audioSynth.cancel();
        this.audioFlag = false;
        this.audioCourse = false;
                this.audioSynth.cancel()
                this.audioFlag = false
                this.audioCourse = false
      }
      // eslint-disable-next-line new-cap
      var positions = this.DC.Transform.transformWGS84ToCartesian(
        // eslint-disable-next-line new-cap
        new this.DC.Position.fromArray(this.pointPosition)
      );
      this.viewer.scene.globe.depthTestAgainstTerrain = false;
            )
            this.viewer.scene.globe.depthTestAgainstTerrain = false
      // eslint-disable-next-line no-unused-vars
      var monitor = new this.DC.PanoramaBox(this.viewer, {
        domId: "MonitorBox",
        position: [positions],
      });
      this.$store.commit("SET_PANORAMAPOPUP", false);
      this.$store.commit("SET_DETAILSPOPUP", false);
      this.$store.commit("SET_MONITORPOPUP", true);
                domId: 'MonitorBox',
                position: [positions]
            })
            this.$store.commit('SET_PANORAMAPOPUP', false)
            this.$store.commit('SET_DETAILSPOPUP', false)
            this.$store.commit('SET_MONITORPOPUP', true)
    },
    closeMapPopupBox() {
      if (this.audioFlag == true) {
        this.audioSynth.cancel();
        this.audioFlag = false;
        this.audioCourse = false;
                this.audioSynth.cancel()
                this.audioFlag = false
                this.audioCourse = false
      }
      this.$store.commit("SET_DETAILSPOPUP", false);
            this.$store.commit('SET_DETAILSPOPUP', false)
    },
    // 新增标记相关事件
    closeAddTagBox() {
      this.$store.commit("SET_ADDTAGPOPUP", false);
            this.$store.commit('SET_ADDTAGPOPUP', false)
    },
    closelabelLayerid() {
      this.$store.commit("openLabelLayer", {
        show: false,
      });
            this.$store.commit('openLabelLayer', {
                show: false
            })
    },
    createTag() {
      var that = this;
            var that = this
      //   console.log(this.RemoveTheBlank(this.addTagName));
      if (this.RemoveTheBlank(this.addTagName) == "") {
        this.$message("请输入标签名称");
        return;
            if (this.RemoveTheBlank(this.addTagName) == '') {
                this.$message('请输入标签名称')
                return
      }
      this.$store.commit("SET_ADDTAGPOPUP", false);
            this.$store.commit('SET_ADDTAGPOPUP', false)
      //   if (this.addTagLayer == null) {
      //     this.addTagLayer = new this.DC.HtmlLayer("addTagLayer");
@@ -606,33 +597,33 @@
      //2022.3.2对接接口
      // 新增标签
      let data = {
            const data = {
        name: this.RemoveTheBlank(this.addTagName),
        jd: this.addTagPosition.lng,
        wd: this.addTagPosition.lat,
      };
                wd: this.addTagPosition.lat
            }
      //   console.log(data);
      setlabel(data).then((res) => {
        console.log(res);
                console.log(res)
        if (res.data.code == 200) {
          doit();
                    doit()
          that.$message({
            message: "新增标签成功",
            type: "success",
          });
                        message: '新增标签成功',
                        type: 'success'
                    })
        } else {
          that.$message({
            message: "新增标签失败",
            type: "warning",
          });
                        message: '新增标签失败',
                        type: 'warning'
                    })
        }
        that.addTagName = "";
      });
      let doit = () => {
        that.$store.dispatch("addLabelLayerIcon", {
                that.addTagName = ''
            })
            const doit = () => {
                that.$store.dispatch('addLabelLayerIcon', {
          // list: [data],
          add: true,
        });
                    add: true
                })
        // const divIcon = new this.DC.DivIcon(
        //   new that.DC.Position(
        //     Number(that.addTagPosition.lng),
@@ -651,64 +642,64 @@
        //             `
        // );
        // this.addTagLayer.addOverlay(divIcon);
      };
            }
    },
    closePanoramaPopupBox() {
      this.$store.commit("SET_PANORAMAURL", "");
      this.$store.commit("SET_PANORAMAPOPUP", false);
            this.$store.commit('SET_PANORAMAURL', '')
            this.$store.commit('SET_PANORAMAPOPUP', false)
    },
    closeMonitorPopupBox() {
      this.$store.commit("SET_MONITORURL", "");
      this.$store.commit("SET_MONITORPOPUP", false);
            this.$store.commit('SET_MONITORURL', '')
            this.$store.commit('SET_MONITORPOPUP', false)
    },
    audioPlay() {
      if (this.audioFlag == false) {
        this.audioMsg.text = this.audioSource;
        this.audioSynth.speak(this.audioMsg);
        this.audioFlag = true;
        this.audioCourse = true;
                this.audioMsg.text = this.audioSource
                this.audioSynth.speak(this.audioMsg)
                this.audioFlag = true
                this.audioCourse = true
      } else {
        if (this.audioCourse == true) {
          this.audioSynth.pause();
          this.audioCourse = false;
                    this.audioSynth.pause()
                    this.audioCourse = false
        } else {
          this.audioSynth.resume();
          this.audioCourse = true;
                    this.audioSynth.resume()
                    this.audioCourse = true
        }
      }
    },
    mechanismDetailPopup(num, param) {
      getMechanismDetail({ num: num, mechanismName: param }).then((res) => {
        var result = res.data.data;
        this.$store.commit("CLEAR_ALL", null);
                var result = res.data.data
                this.$store.commit('CLEAR_ALL', null)
        var imgArr = result.tpurl.split(",");
                var imgArr = result.tpurl.split(',')
        this.$store.commit("SET_POPUPBGURL", imgArr[0]);
        this.$store.commit("SET_POPUPQRURL", result.codeurl);
        this.$store.commit("SET_POINTPOSITION", [
                this.$store.commit('SET_POPUPBGURL', imgArr[0])
                this.$store.commit('SET_POPUPQRURL', result.codeurl)
                this.$store.commit('SET_POINTPOSITION', [
          Number(result.jd),
          Number(result.wd),
          Number(result.gd),
          Number(result.heading),
          Number(result.pitch),
          Number(result.roll),
        ]);
        this.$store.commit("SET_STATENAME", result.mechanismname);
        this.$store.commit("SET_SITENAME", result.address);
        this.$store.commit("SET_TELEPHONE", result.telephone);
        this.$store.commit("SET_INTRODUCETEXT", result.introduce);
        this.$store.commit("SET_POPUPIMGATLAS", imgArr);
                    Number(result.roll)
                ])
                this.$store.commit('SET_STATENAME', result.mechanismname)
                this.$store.commit('SET_SITENAME', result.address)
                this.$store.commit('SET_TELEPHONE', result.telephone)
                this.$store.commit('SET_INTRODUCETEXT', result.introduce)
                this.$store.commit('SET_POPUPIMGATLAS', imgArr)
        if (result.videourl && result.videourl != "") {
          this.$store.commit("SET_MONITORURL", result.videourl);
                if (result.videourl && result.videourl != '') {
                    this.$store.commit('SET_MONITORURL', result.videourl)
        }
        this.newPopup(result);
                this.newPopup(result)
        this.viewer.flyToPosition(
          new this.DC.Position(
            Number(result.jd),
@@ -720,33 +711,33 @@
          ),
          function () {},
          3
        );
      });
                )
            })
    },
    newPopup(item) {
      const position = this.DC.Transform.transformWGS84ToCartesian(
        new this.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd))
      );
            )
      // eslint-disable-next-line no-unused-vars
      var popup = new this.DC.DivForms(this.viewer, {
        domId: "divFormsDomBox",
        position: [position],
      });
                domId: 'divFormsDomBox',
                position: [position]
            })
      this.$store.commit("SET_PANORAMAPOPUP", false);
      this.$store.commit("SET_MONITORPOPUP", false);
      this.$store.commit("SET_DETAILSPOPUP", true);
            this.$store.commit('SET_PANORAMAPOPUP', false)
            this.$store.commit('SET_MONITORPOPUP', false)
            this.$store.commit('SET_DETAILSPOPUP', true)
    },
    /**
     * 删除左右两端的空格
     */
    RemoveTheBlank(str) {
      return str.replace(/(^\s*)|(\s*$)/g, "");
    },
  },
};
            return str.replace(/(^\s*)|(\s*$)/g, '')
        }
    }
}
</script>
<style>
src/components/map/index.vue
@@ -1,10 +1,6 @@
/* eslint-disable camelcase */
<template>
  <div
    id="viewer-container"
    style="height: 100%; width: 100%"
    @click="mapClick($event)"
  >
    <div id="viewer-container" style="height: 100%; width: 100%" @click="mapClick($event)">
    <video
      id="video"
      style="position: fixed; visibility: hidden"
@@ -14,10 +10,7 @@
      crossorigin
      controls
    >
      <source
        src="http://dc.dvgis.cn/examples/data/demo.mp4"
        type="video/mp4"
      />
            <source src="http://dc.dvgis.cn/examples/data/demo.mp4" type="video/mp4" />
    </video>
    <div
@@ -34,9 +27,7 @@
        background: #2196f3ed;
        z-index: 11;
      "
    >
      智慧校区
    </div>
        >智慧校区</div>
    <dimension :areaLayer="areaLayer" />
@@ -51,192 +42,352 @@
    <search-details v-if="searchPopupFlag"></search-details>
    <org-nav-bar v-if="orgNavBarFlag"></org-nav-bar>
    <arc-nav-bar v-if="arcNavBarFlag"></arc-nav-bar>
        <div id="eagleEyeMap" class="eagle-eye-map"></div>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
import mapPopup from "./components/mapPopup.vue";
import campusBuildingSearch from "./components/campusBuildingSearch.vue";
import dimension from "./components/dimension.vue";
import { mapGetters } from 'vuex'
import mapPopup from './components/mapPopup.vue'
import campusBuildingSearch from './components/campusBuildingSearch.vue'
import dimension from './components/dimension.vue'
export default {
  name: "mapBox",
    name: 'mapBox',
  components: {
    mapPopup,
    campusBuildingSearch,
    dimension,
        dimension
  },
  data() {
    return {
      DC: null,
      areaLayer: null,
    };
            areaLayer: null
        }
  },
  watch: {
    searchPopupFlag: {
      immediate: true,
      handler(newVal, oldVal) {
        if (newVal == true) {
          if (this.$route.path.indexOf("/pcLayout/default/service") != -1) {
            this.$store.dispatch("delVisitedViews", this.$route);
            this.$router.push("/pcLayout/default");
                    if (this.$route.path.indexOf('/pcLayout/default/service') != -1) {
                        this.$store.dispatch('delVisitedViews', this.$route)
                        this.$router.push('/pcLayout/default')
          }
          if (this.$route.path.indexOf("/orgnav") != -1) {
            this.$store.dispatch("delVisitedViews", this.$route);
            this.$router.push("/pcLayout/default");
            this.$store.commit("SET_ORGNAVBARTITLE", "");
            this.$store.commit("SET_ORGNAVBARLIST", []);
            this.$store.commit("SET_ORGNAVBARFLAG", false);
                    if (this.$route.path.indexOf('/orgnav') != -1) {
                        this.$store.dispatch('delVisitedViews', this.$route)
                        this.$router.push('/pcLayout/default')
                        this.$store.commit('SET_ORGNAVBARTITLE', '')
                        this.$store.commit('SET_ORGNAVBARLIST', [])
                        this.$store.commit('SET_ORGNAVBARFLAG', false)
          }
          if (this.orgNavBarFlag == true) {
            this.$store.commit("SET_ORGNAVBARTITLE", "");
            this.$store.commit("SET_ORGNAVBARLIST", []);
            this.$store.commit("SET_ORGNAVBARFLAG", false);
                        this.$store.commit('SET_ORGNAVBARTITLE', '')
                        this.$store.commit('SET_ORGNAVBARLIST', [])
                        this.$store.commit('SET_ORGNAVBARFLAG', false)
          }
          if (this.$route.path.indexOf("/arc") != -1) {
            this.$store.dispatch("delVisitedViews", this.$route);
            this.$router.push("/pcLayout/default");
            this.$store.commit("SET_ARCNAVBARTITLE", "");
            this.$store.commit("SET_ARCNAVBARCODE", "");
            this.$store.commit("SET_ARCNAVBARFLAG", false);
                    if (this.$route.path.indexOf('/arc') != -1) {
                        this.$store.dispatch('delVisitedViews', this.$route)
                        this.$router.push('/pcLayout/default')
                        this.$store.commit('SET_ARCNAVBARTITLE', '')
                        this.$store.commit('SET_ARCNAVBARCODE', '')
                        this.$store.commit('SET_ARCNAVBARFLAG', false)
          }
          if (this.arcNavBarFlag == true) {
            this.$store.commit("SET_ARCNAVBARTITLE", "");
            this.$store.commit("SET_ARCNAVBARCODE", "");
            this.$store.commit("SET_ARCNAVBARFLAG", false);
                        this.$store.commit('SET_ARCNAVBARTITLE', '')
                        this.$store.commit('SET_ARCNAVBARCODE', '')
                        this.$store.commit('SET_ARCNAVBARFLAG', false)
          }
        }
      },
            }
    },
    orgNavBarFlag: {
      immediate: true,
      handler(newVal, oldVal) {
        if (newVal == true) {
          this.$store.commit("SET_SEARCHPOPUPFLAG", false);
                    this.$store.commit('SET_SEARCHPOPUPFLAG', false)
        }
      },
            }
    },
    arcNavBarFlag: {
      immediate: true,
      handler(newVal, oldVal) {
        if (newVal == true) {
          this.$store.commit("SET_SEARCHPOPUPFLAG", false);
                    this.$store.commit('SET_SEARCHPOPUPFLAG', false)
        }
      },
    },
            }
        }
  },
  computed: {
    ...mapGetters([
      "viewer",
      "popupBgUrl",
      "pupupQRUrl",
            'viewer',
            'popupBgUrl',
            'pupupQRUrl',
      // 终点
      "terminus",
            'terminus',
      // 起点
      "startingPoint",
            'startingPoint',
      // 点信息
      "pointPosition",
            'pointPosition',
      // 点名称
      "stateName",
            'stateName',
      // 地址
      "siteName",
            'siteName',
      // 介绍
      "introduceText",
            'introduceText',
      // 全景地址
      "panoramaUrl",
            'panoramaUrl',
      // 详情弹框显示关闭
      "detailsPopup",
            'detailsPopup',
      // 全景弹框显示关闭
      "panoramaPopup",
            'panoramaPopup',
      // 校区内导航的显示关闭
      "campusNavFlag",
      "orgNavBarFlag",
      "arcNavBarFlag",
      "searchPopupFlag",
    ]),
            'campusNavFlag',
            'orgNavBarFlag',
            'arcNavBarFlag',
            'searchPopupFlag'
        ])
  },
  mounted() {
    var that = this;
        var that = this
    let viewer;
        let viewer, eagleViewer
    that.DC = global.DC;
        that.DC = global.DC
    function distanceSurface() {
      viewer.measure.distanceSurface();
            viewer.measure.distanceSurface()
    }
    function calcArea() {
      viewer.measure.area();
            viewer.measure.area()
    }
    function areaSurface() {
      viewer.measure.areaSurface();
            viewer.measure.areaSurface()
    }
    function calcAngle() {
      viewer.measure.angle();
            viewer.measure.angle()
    }
    function calcModelAngle() {
      viewer.measure.angle({
        clampToModel: true,
      });
                clampToModel: true
            })
    }
    function calcHeight() {
      viewer.measure.height();
            viewer.measure.height()
    }
    function calcModelHeight() {
      viewer.measure.height({
        clampToModel: true,
      });
                clampToModel: true
            })
    }
    function calcHeading() {
      viewer.measure.heading();
            viewer.measure.heading()
    }
    function areaHeight() {
      viewer.measure.areaHeight();
            viewer.measure.areaHeight()
    }
    function calcTriangleHeight() {
      viewer.measure.triangleHeight();
            viewer.measure.triangleHeight()
    }
    function calcModelTriangleHeight() {
      viewer.measure.triangleHeight({
        clampToModel: true,
      });
                clampToModel: true
            })
    }
    function deactivate() {
      viewer.measure.deactivate();
            viewer.measure.deactivate()
    }
    function initViewer() {
      viewer = new that.DC.Viewer("viewer-container", {
            viewer = new that.DC.Viewer('viewer-container', {
        contextOptions: {
          webgl: {
            stencil: true,
            preserveDrawingBuffer: true,
                        preserveDrawingBuffer: true
                    }
                }
            })
            eagleViewer = new that.DC.Viewer('eagleEyeMap', {
                animation: false,
                baseLayerPicker: false,
                imageryProvider: false,
                fullscreenButton: false,
                geocoder: false,
                homeButton: false,
                infoBox: false,
                sceneModePicker: false,
                selectionIndicator: false,
                timeline: false,
                navigationHelpButton: false,
                navigationInstructionsInitiallyVisible: false,
                creditContainer: undefined
                // sceneMode: that.DC.Namespace.Cesium.SceneMode.SCENE2D
            })
            eagleViewer.camera.setView({
                // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                // fromDegrees()方法,将经纬度和高程转换为世界坐标
                destination: that.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    115.871863, 28.743861, 1400.0
                ),
                orientation: {
                    // 指向
                    heading: that.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: that.DC.Namespace.Cesium.Math.toRadians(-90),
                    roll: 0.0
                }
            })
            var sceneR = eagleViewer.scene
            var handlerR = new that.DC.Namespace.Cesium.ScreenSpaceEventHandler(sceneR.canvas)
            var isLeftTrigger = false
            var isRightTrigger = false
            viewer.on(that.DC.MouseEventType.MOUSE_MOVE, () => {
                isLeftTrigger = true
                isRightTrigger = false
            })
            handlerR.setInputAction(function (movement) {
                isLeftTrigger = false
                isRightTrigger = true
            }, that.DC.Namespace.Cesium.ScreenSpaceEventType.MOUSE_MOVE)
            var syncviewer = function () {
                if (isLeftTrigger) {
                    const position = that.DC.Transform.transformCartesianToWGS84(viewer.camera.position)
                    eagleViewer.camera.flyTo({
                        destination: that.DC.Transform.transformWGS84ToCartesian(new that.DC.Position(position.lng, position.lat, position.alt + 1000)),
                        orientation: {
                            heading: viewer.camera.heading,
                            pitch: viewer.camera.pitch,
                            roll: viewer.camera.roll
          },
                        duration: 0.0
                    })
                }
            }
            viewer.camera.changed.addEventListener(syncviewer)
            viewer.scene.preRender.addEventListener(syncviewer)
            var synceagleViewer = function () {
                if (isRightTrigger) {
                    console.log(eagleViewer.camera.heading)
                    viewer.camera.flyTo({
                        destination: eagleViewer.camera.position,
                        orientation: {
                            heading: eagleViewer.camera.heading,
                            pitch: eagleViewer.camera.pitch,
                            roll: eagleViewer.camera.roll
        },
      });
      that.createdLayers(viewer);
                        duration: 0.0
      that.$store.commit("SET_VIEWER", viewer);
                    })
                }
            }
      that.$refs.leftNav.initialize(viewer);
            eagleViewer.camera.changed.addEventListener(synceagleViewer)
            eagleViewer.scene.preRender.addEventListener(synceagleViewer)
            // viewer.camera.percentageChanged = 0.01
            // eagleViewer.camera.percentageChanged = 0.01
            // viewer.camera.changed.addEventListener((e) => {
            //     eagleViewer.camera.flyTo({
            //         destination: viewer.camera.position,
            //         orientation: {
            //             heading: viewer.camera.heading + 5000,
            //             pitch: viewer.camera.pitch,
            //             roll: viewer.camera.roll
            //         },
            //         duration: 0.0
            //     })
            // })
            // eagleViewer.camera.changed.addEventListener((e) => {
            //     viewer.camera.flyTo({
            //         destination: eagleViewer.camera.position,
            //         orientation: {
            //             heading: eagleViewer.camera.heading - 5000,
            //             pitch: eagleViewer.camera.pitch,
            //             roll: eagleViewer.camera.roll
            //         },
            //         duration: 0.0
            //     })
            // })
            eagleViewer.imageryLayers.addImageryProvider(
                new that.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                    url: ' http://t1.tianditu.gov.cn/vec_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                    type: 'wmts',
                    layer: 'vec',
                    style: 'default',
                    format: 'tiles',
                    tileMatrixSetID: 'w',
                    show: true,
                    maximumLevel: 18
                })
            )
            eagleViewer.imageryLayers.addImageryProvider(
                new that.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({
                    url: ' http://t1.tianditu.gov.cn/cva_w/wmts?tk=9ae78c51a0a28f06444d541148496e36',
                    type: 'wmts',
                    layer: 'cva',
                    style: 'default',
                    format: 'tiles',
                    tileMatrixSetID: 'w',
                    show: true,
                    maximumLevel: 18
                })
            )
            that.createdLayers(viewer)
            that.$store.commit('SET_VIEWER', viewer)
            that.$refs.leftNav.initialize(viewer)
      // const key = '0f7c1d161d7352116a21aacf0e9f44c1'
      // const vec = that.DC.ImageryLayerFactory.createTdtImageryLayer({
@@ -358,41 +509,55 @@
      //     name: '地形'
      // })
      viewer.use(new that.DC.Measure());
            viewer.use(new that.DC.Measure())
      // viewer.flyToPosition(
      //     new that.DC.Position(117.08489820, 31.65413916, 1500, 0, -90, 45)
      // )
      viewer.compass.enable = true;
      viewer.zoomController.enable = true;
      viewer.locationBar.enable = true;
      viewer.hawkeyeMap.enable = true;
      viewer.hawkeyeMap.addBaseLayer(
        that.DC.ImageryLayerFactory.createAmapImageryLayer({
          crs: "WGS84",
        })
      );
            viewer.compass.enable = true
            viewer.zoomController.enable = true
            viewer.locationBar.enable = true
            // DC的鹰眼地图
            // viewer.hawkeyeMap.enable = true
            // viewer.hawkeyeMap.addBaseLayer(
            //     that.DC.ImageryLayerFactory.createAmapImageryLayer({
            //         crs: 'WGS84'
            //     })
            // )
      // viewer.distanceLegend.enable = true
    }
    that.DC.ready(initViewer);
        that.DC.ready(initViewer)
  },
  methods: {
    mapClick(e) {
      this.$refs.campusNavRoute.shortcutShow(e);
      this.$refs.campusBuildingSearch.shortcutShow(e);
            this.$refs.campusNavRoute.shortcutShow(e)
            this.$refs.campusBuildingSearch.shortcutShow(e)
    },
    createdLayers(viewer) {
      const layerGroup = new this.DC.LayerGroup("modelBox");
      viewer.addLayerGroup(layerGroup);
            const layerGroup = new this.DC.LayerGroup('modelBox')
            viewer.addLayerGroup(layerGroup)
      this.areaLayer = new this.DC.VectorLayer("areaLayer");
      layerGroup.addLayer(this.areaLayer);
    },
  },
};
            this.areaLayer = new this.DC.VectorLayer('areaLayer')
            layerGroup.addLayer(this.areaLayer)
        }
    }
}
</script>
<style lang="scss" scope></style>
<style lang="scss" scope>
.eagle-eye-map {
    position: fixed;
    right: 10px;
    bottom: 10px;
    border: 5px solid orange;
    border-radius: 50%;
    width: 200px;
    height: 200px;
    z-index: 99;
    overflow: hidden;
}
</style>