+
liuyg
2021-12-17 4d39edd970d8517f416b4cec2d9babad8e5d95b5
+
9 files modified
2 files added
441 ■■■■ changed files
src/components/mobileCortrolButtom/index.vue 16 ●●●●● patch | view | raw | blame | history
src/components/mobileGoTo/index.vue 63 ●●●●● patch | view | raw | blame | history
src/components/mobileLeftNav/index.vue 1 ●●●● patch | view | raw | blame | history
src/components/mobilePanorama/index.vue 45 ●●●●● patch | view | raw | blame | history
src/components/mobilePopupOur/index.vue 183 ●●●● patch | view | raw | blame | history
src/components/mobilePopupOurOnce/index.vue 7 ●●●● patch | view | raw | blame | history
src/components/mobileWindow/index.vue 24 ●●●●● patch | view | raw | blame | history
src/components/mobilemap/index.vue 37 ●●●●● patch | view | raw | blame | history
src/store/getters.js 5 ●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 58 ●●●● patch | view | raw | blame | history
src/styles/mobile/popup.scss 2 ●●● patch | view | raw | blame | history
src/components/mobileCortrolButtom/index.vue
@@ -53,7 +53,7 @@
    };
  },
  computed: {
    ...mapGetters(["mviewer"]),
    ...mapGetters(["mviewer", "openmobileGoTo"]),
  },
  created() {
    this.DC = global.DC;
@@ -78,12 +78,14 @@
      this.$store.commit("MSET_BIGPOPUPAFTER", true);
    },
    goOn() {
      console.log(returnCitySN["cip"]);
      let data = {
        ip: returnCitySN["cip"],
        key: "7WKBZ-QDY62-WEEUG-C7KUN-ADAF5-L5BKZ",
      };
      console.log("定位", data.ip);
      let that = this;
      this.$store.commit("MSET_OPENMOBILEGOTO", !that.openmobileGoTo);
      // console.log(returnCitySN["cip"]);
      // let data = {
      //   ip: returnCitySN["cip"],
      //   key: "7WKBZ-QDY62-WEEUG-C7KUN-ADAF5-L5BKZ",
      // };
      // console.log("定位", data.ip);
      // getIp(data).then((res) => {
      //   // getUsers(data).then((res) => {
      //   console.log(res);
src/components/mobileGoTo/index.vue
New file
@@ -0,0 +1,63 @@
<template>
  <div v-show="openmobileGoTo" class="mobileGoTo">
    <el-input v-model="lnt"></el-input>
    <el-input v-model="lat"></el-input>
    <!-- <el-input v-model="alt"></el-input> -->
    <el-button type="primary" @click="submitForm('')">跳转</el-button>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "mobileGoTo",
  computed: {
    ...mapGetters([
      "openmobileGoTo",
      "mviewer",
      "DC",
      "query",
      "MobileWindowChangeData",
    ]),
  },
  data() {
    return {
      lnt: "121.53772514948211",
      lat: "31.23938286341316",
      alt: "90.648862227",
    };
  },
  watch: {
    MobileWindowChangeData() {
      this.lnt = this.query.lntLat[0];
      this.lat = this.query.lntLat[1];
    },
  },
  methods: {
    submitForm() {
      if (this.lnt && this.lat) {
        let that = this;
        // 定制化窗体
        let position = {};
        let lntLat = [that.lnt, that.lat];
        let d = {
          position,
          lntLat,
          query: { position, lntLat },
          useJWD: true, //仅使用经纬度
        };
        that.$store.dispatch("setMobileWindows", d);
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.mobileGoTo {
  position: fixed;
  bottom: 60px;
  width: 73%;
  z-index: 500;
}
</style>
src/components/mobileLeftNav/index.vue
@@ -393,6 +393,7 @@
        position,
        lntLat,
        query: { ...(query || {}), position, lntLat },
        useJWD: true, //仅使用经纬度
      };
      that.$store.dispatch("setMobileWindows", d);
    },
src/components/mobilePanorama/index.vue
New file
@@ -0,0 +1,45 @@
<template>
  <div v-show="openmobilePanorama" class="mobilePanorama">
    <div class="mobilePanorama-close" @click="closeMobilePanorama">
      <i class="el-icon-error icon"></i>
    </div>
  </div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  name: "mobilePanorama",
  computed: {
    ...mapGetters(["openmobilePanorama"]),
  },
  data() {
    return {};
  },
  methods: {
    closeMobilePanorama() {
      this.$store.commit("MSET_OPENMOBILEPANORAMA", false);
    },
  },
};
</script>
<style lang="scss" scoped>
.mobilePanorama {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: #fff;
  .mobilePanorama-close {
    position: absolute;
    right: 5px;
    top: 5px;
    .icon {
      font-size: 35px;
    }
  }
}
</style>
src/components/mobilePopupOur/index.vue
@@ -89,265 +89,145 @@
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
            {
              name: "电力部门",
              icon: "",
              Cartesian3: {
                x: -2852016.545079094,
                y: 4654237.53861168,
                z: 3288210.9971253853,
              },
              position: [121.49907024133591, 31.234911748958513],
              lntLat: [121.49907024133591, 31.234911748958513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门",
              icon: "",
              Cartesian3: {
                x: -2853624.057617497,
                y: 4654505.819491945,
                z: 3286416.3935731286,
              },
              position: [121.51198333955459, 31.216073280697593],
              lntLat: [121.51198333955459, 31.216073280697593],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆",
              icon: "",
              Cartesian3: {
                x: -2852304.498038979,
                y: 4655537.369322868,
                z: 3286133.4029617086,
              },
              position: [121.4945198122125, 31.213002416673532],
              lntLat: [121.4945198122125, 31.213002416673532],
              buts: ["定位"],
            },
          ],
@@ -359,33 +239,18 @@
            {
              name: "电力部门1",
              icon: "",
              Cartesian3: {
                x: -2852016.545091094,
                y: 4654237.53861168,
                z: 3288210.9971238153,
              },
              position: [121.49190702133591, 31.234911741858513],
              buts: ["实景", "图集", "定位"],
            },
            {
              name: "保安部门1",
              icon: "",
              Cartesian3: {
                x: -2852016.541509094,
                y: 4654237.53816168,
                z: 3288210.9971125853,
              },
              position: [121.49907021413591, 31.234911741895513],
              buts: ["图集", "定位"],
            },
            {
              name: "图书馆1",
              icon: "",
              Cartesian3: {
                x: -2852016.545019094,
                y: 4654237.53861168,
                z: 3288210.9971123853,
              },
              position: [121.49901024133591, 31.234911749581513],
              buts: ["定位"],
            },
src/components/mobilePopupOurOnce/index.vue
@@ -67,12 +67,15 @@
        setTimeout(() => {
          // 定制化窗体
          let d = {
            position: that.onceData.Cartesian3,
            lntLat: that.onceData.position,
            position: {},
            lntLat: that.onceData.lntLat,
            query: this.onceData,
            useJWD: true, //仅使用经纬度
          };
          that.popupsDom = that.$store.dispatch("setMobileWindows", d);
        }, 500);
      } else if (val == "实景") {
        this.$store.commit("MSET_OPENMOBILEPANORAMA", true);
      }
    },
  },
src/components/mobileWindow/index.vue
@@ -14,7 +14,7 @@
        :preview-src-list="srcList"
      >
      </el-image>
      <div>{{ query }}</div>
      <div>{{ query.query }}</div>
      <!-- 哈工大A10公寫总建筑面积30740平方米,于2001年采用货款方式高标准建造并投入使用。整个楼体共分十层,地上九层为公寫主体。公寓外观呈工字型,公寓内房司以A、B、C三个区域別分,与哈工大雄厚的工科底蕴遥相呼应,是哈尔滨工业大学学生公寫的标志性建筑 -->
    </div>
    <div class="mobile-popup-control">
@@ -22,7 +22,9 @@
        >图集</el-link
      >
      <el-divider direction="vertical"></el-divider>
      <el-link icon="el-icon-map-location">实景</el-link>
      <el-link icon="el-icon-map-location" @click="openMobilePanorama"
        >实景</el-link
      >
      <el-divider direction="vertical"></el-divider>
      <el-link icon="el-icon-aim" @click="goOn">去这</el-link>
    </div>
@@ -34,16 +36,18 @@
export default {
  name: "mobileWindow",
  computed: {
    ...mapGetters(["MobileWindowsHide", "query"]),
    ...mapGetters(["MobileWindowsHide", "query", "MobileWindowChangeData"]),
  },
  watch: {
    MobileWindowsHide() {
    MobileWindowChangeData() {
      //   this.fullscreenLoading = true;
      if (!this.MobileWindowsHide) {
        setTimeout(() => {
          // this.fullscreenLoading = false;
          console.log("地图点击弹窗数据请求参数", this.query);
        }, 500);
        // setTimeout(() => {
        // this.fullscreenLoading = false;
        console.log("地图点击弹窗数据请求参数", this.query);
        // console.log("地图点击弹窗数据请求参数", this.query.lntLat[0]);
        // console.log("地图点击弹窗数据请求参数", this.query.lntLat[1]);
        // }, 500);
      }
    },
  },
@@ -64,6 +68,10 @@
      imgsDom.click();
    },
    goOn() {},
    openMobilePanorama() {
      console.log(11);
      this.$store.commit("MSET_OPENMOBILEPANORAMA", true);
    },
  },
};
</script>
src/components/mobilemap/index.vue
@@ -15,6 +15,10 @@
    <mobilePopupOurAfter v-if="mBigPopupAfter"></mobilePopupOurAfter>
    <!-- 大弹窗 -->
    <mobilePopupOur :style="[bigPopup]" v-if="mBigPopup"></mobilePopupOur>
    <!-- 测试-跳转位置 -->
    <mobileGoTo></mobileGoTo>
    <!-- 实景窗口 -->
    <mobilePanorama></mobilePanorama>
  </div>
</template>
<script>
@@ -143,22 +147,8 @@
        iconUrl: "examples/images/icon/img.png",
        name: "影像",
      });
      // let nowPosition = "";
      // 地图移动事件
      viewer.on(DC.MouseEventType.MOUSE_MOVE, (e) => {
        if (!that.iconHide) {
          that.$store.commit("MSET_ICONHIDE", true);
        }
        that.$store.dispatch("closeMobileWindowsDom"); //关闭弹窗
        // if (!that.MobileWindowsHide && that.popupsDom) {
        //   that.popupsDom.closeOur();
        //   that.$store.commit("MSET_MOBILEWINDOWSHIDE", true);
        // }
        // nowPosition = [e.wgs84Position.lng, e.wgs84Position.lat];
        // console.log(nowPosition);
      });
      // // eslint-disable-next-line camelcase
      // eslint-disable-next-line camelcase
      // const baselayer_shaded = DC.ImageryLayerFactory.createArcGisImageryLayer({
      //   url: "http://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer",
      // });
@@ -184,6 +174,20 @@
      //   iconUrl: "examples/images/icon/ter.png",
      //   name: "地形",
      // });
      // 地图移动事件
      viewer.on(DC.MouseEventType.MOUSE_MOVE, (e) => {
        if (!that.iconHide) {
          that.$store.commit("MSET_ICONHIDE", true);
        }
        that.$store.dispatch("closeMobileWindowsDom"); //关闭弹窗
        // if (!that.MobileWindowsHide && that.popupsDom) {
        //   that.popupsDom.closeOur();
        //   that.$store.commit("MSET_MOBILEWINDOWSHIDE", true);
        // }
        // nowPosition = [e.wgs84Position.lng, e.wgs84Position.lat];
        // console.log(nowPosition);
      });
      const layer = new DC.TilesetLayer("layer");
      viewer.addLayer(layer);
@@ -217,7 +221,7 @@
        viewer.scene.globe.depthTestAgainstTerrain = false;
        // console.log(document.getElementById("mobile-map_content_content"));
        // console.log(e.position);
        console.log(e);
        // 定制化窗体
        that.openPopupS(e.position, [e.wgs84Position.lng, e.wgs84Position.lat]);
@@ -247,6 +251,7 @@
        position,
        lntLat,
        query: { ...(query || {}), position, lntLat },
        useJWD: true, //仅使用经纬度
      };
      that.$store.dispatch("setMobileWindows", d);
    },
src/store/getters.js
@@ -6,8 +6,11 @@
    iconHide: state => state.mobile.iconHide,
    DC: state => state.mobile.DC,
    MobileWindowsHide: state => state.mobile.MobileWindowsHide,
    MobileWindowChangeData: state => state.mobile.MobileWindowChangeData,
    popupsDom: state => state.mobile.popupsDom,
    query: state => state.mobile.query
    query: state => state.mobile.query,
    openmobileGoTo: state => state.mobile.openmobileGoTo,
    openmobilePanorama: state => state.mobile.openmobilePanorama
}
const getters = {
    ...mobile,
src/store/modules/mobile.js
@@ -1,24 +1,30 @@
import $store from '../index'
const mobile = {
    state: {
        mviewer: null,
        mBigPopup: false,
        mBigPopupAfter: false,
        ips: '',
        iconHide: false,
        DC: '',
        MobileWindowsHide: true,
        popupsDom: '',
        query: {}
        mviewer: null,//地图实体类
        mBigPopup: false,//全屏弹窗
        mBigPopupAfter: false,////全屏弹窗之前的弹窗
        ips: '',//获取的ip
        iconHide: false,//右侧伸缩状态
        DC: '',//DC全局保存
        MobileWindowsHide: true,//改变点击窗口的显示状态
        MobileWindowChangeData: false,//改变点击窗口的数据
        popupsDom: '',//mobileDivForms的实体类
        query: {},//传输数据
        openmobileGoTo: false,//测试
        openmobilePanorama: false,//实景显影
    },
    mutations: {
        MSET_VIEWER(state, viewer) {
            state.mviewer = viewer
        },
        MSET_BIGPOPUP(state, viewer) {
            state.mBigPopup = viewer
            state.mBigPopup = viewer;
            $store.dispatch("closeMobileWindowsDom"); //关闭弹窗
        },
        MSET_BIGPOPUPAFTER(state, viewer) {
            state.mBigPopupAfter = viewer
            state.mBigPopupAfter = viewer;
            $store.dispatch("closeMobileWindowsDom"); //关闭弹窗
        },
        MSET_ICONHIDE(state, viewer) {
            state.iconHide = viewer
@@ -27,6 +33,7 @@
            state.DC = viewer
        },
        MSET_MOBILEWINDOWSHIDE(state, viewer) {
            state.MobileWindowChangeData = !state.MobileWindowChangeData;
            state.MobileWindowsHide = viewer
        },
        MSET_POPUPDOM(state, viewer) {
@@ -34,12 +41,27 @@
        },
        MSET_QUERY(state, viewer) {
            state.query = viewer
        },
        MSET_OPENMOBILEGOTO(state, viewer) {
            state.openmobileGoTo = viewer
        },
        MSET_OPENMOBILEPANORAMA(state, viewer) {
            state.openmobilePanorama = viewer
        }
    },
    actions: {
        setMobileWindows({ state, commit }, data) {
        setMobileWindows({ state, commit, }, data) {
            if (data.useJWD) {
                var ellipsoid = state.mviewer.scene.globe.ellipsoid;
                var cartographic = state.DC.Namespace.Cesium.Cartographic.fromDegrees(
                    data.lntLat[0],
                    data.lntLat[1] - 0.00006,
                    "90.648862227"
                );
                data.position = ellipsoid.cartographicToCartesian(cartographic);
            }
            // 传递响应数据
            commit("MSET_QUERY", data.query)
            commit("MSET_QUERY", data);
            // 定制化窗体
            let popupsDom = new state.DC.mobileDivForms(state.mviewer, {
                domId: "mobilePopup",
@@ -59,6 +81,16 @@
                state.popupsDom.closeOur();
                commit("MSET_MOBILEWINDOWSHIDE", true);
            }
        },
        CHANGETOC3({ state, commit }, data) {// //转换经纬度坐标 成世界坐标cartesian3
            var ellipsoid = state.mviewer.scene.globe.ellipsoid;
            var cartographic = state.DC.Namespace.Cesium.Cartographic.fromDegrees(
                data.lnt,
                data.lat - 0.0004,
                data.alt || "90.648862227"
            );
            var position = ellipsoid.cartographicToCartesian(cartographic);
            return position;
        }
    }
}
src/styles/mobile/popup.scss
@@ -2,7 +2,7 @@
    //弹窗
    width: 100%;
    position: fixed;
    z-index: 99;
    z-index: 999;
    left: -1000px;
    box-sizing: border-box;
    #mobilePopup {