shuishen
2022-04-29 4f55f7d94198eca8eba9ae6b85af19a07cac2f79
src/components/mobileCortrolButtom/index.vue
@@ -15,8 +15,7 @@
            v-for="(item, index) in tabTable"
            :key="index"
            :command="item"
            >{{ item.title }}</el-dropdown-item
          >
                    >{{ item.title }}</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
@@ -29,7 +28,9 @@
    <div class="m-l-inbut" @click="zoomIns">
      <i class="el-icon-refresh"></i>
    </div>
    <div class="m-l-inbut" @click="goOns"><i class="el-icon-location"></i></div>
        <div class="m-l-inbut" @click="goOns">
            <i class="el-icon-location"></i>
        </div>
    <div class="m-l-inbut" @click="openOurSee">
      <i class="el-icon-map-location"></i>
    </div>
@@ -37,42 +38,43 @@
</template>
<script>
import { mapGetters } from "vuex";
import { getIp, getUsers } from "@/api/mobile/ip/index";
import { getListarc } from "@/api/mobile/public/arc";
import { getActivity } from "@/api/mobile/hd/hd";
import { mapGetters } from 'vuex'
import { getIp, getUsers } from '@/api/mobile/ip/index'
import { getListarc } from '@/api/mobile/public/arc'
import { getActivity } from '@/api/mobile/hd/hd'
export default {
  name: "mobileCortrolButtom",
    name: 'mobileCortrolButtom',
  data() {
    return {
      tabTable: [],
      ccData: [
        {
          lnt: 114.03835559,
          lat: 27.63057034,
                    lat: 27.63057034
        },
        {
          lnt: 114.03971446,
          lat: 27.62986481,
                    lat: 27.62986481
        },
        {
          lnt: 114.03841654,
          lat: 27.62919726,
                    lat: 27.62919726
        },
        {
          lnt: 114.039946,
          lat: 27.62847544,
                    lat: 27.62847544
                }
            ]
        }
        },
      ],
    };
  },
    props: ['mapCenter', 'frislayertHeight'],
  computed: {
    ...mapGetters([
      "openmobileGoTo",
      "dimensionData",
            'openmobileGoTo',
            'dimensionData',
      // "startPointFn",
      "dimension",
    ]),
            'dimension'
        ])
  },
  created() {
    // this.getStreet();
@@ -81,32 +83,32 @@
  methods: {
    openOurSee() {
      this.$store.commit(
        "MSET_OPENMOBILEPANORAMA",
        "http://vr.jxpskj.com/lxxqw/"
      );
                'MSET_OPENMOBILEPANORAMA',
                'http://vr.jxpskj.com/lxxqw/'
            )
    },
    goOns() {
      let that = this;
      this.$store.commit("GET_NOWPOSITION", (res) => {
        that.$store.dispatch("pcMoveView", {
            const that = this
            this.$store.commit('GET_NOWPOSITION', (res) => {
                that.$store.dispatch('pcMoveView', {
          jd: res[0],
          wd: res[1],
          viewer: global.viewer,
        });
                    viewer: global.viewer
                })
        let data = [
                const data = [
          {
            name: "我的位置",
                        name: '我的位置',
            jd: res[0],
            wd: res[1],
          },
        ];
        that.$store.dispatch("addLabelLayerIconMobelUse", {
                        wd: res[1]
                    }
                ]
                that.$store.dispatch('addLabelLayerIconMobelUse', {
          list: data,
          clear: true,
          mviewer: global.viewer,
        });
      });
                    mviewer: global.viewer
                })
            })
    },
    zoomIns(val) {
      // this.$store.dispatch("mapFlyTo", {
@@ -125,30 +127,45 @@
      //     }
      //     return;
      //   }
      window.startPointFn();
            var that = this
            global.viewer.flyToPosition(
                new global.DC.Position(
                    that.mapCenter[0],
                    that.mapCenter[1],
                    that.frislayertHeight,
                    that.dimensionData.heading,
                    that.dimensionData.pitch,
                    that.dimensionData.roll
                ),
                () => {
                },
                0
            )
    },
    openActivity() {
      const d = {
        main: [
          {
            name: "活动",
                        name: '活动',
            type: 1,
            method: getActivity,
          },
                        method: getActivity
                    }
        ],
        qurey: "活动",
      };
      this.$store.commit("MSET_POPUPOUROPENDATA", d);
      this.$store.commit("MSET_BIGPOPUP", { name: "活动" });
                qurey: '活动'
            }
            this.$store.commit('MSET_POPUPOUROPENDATA', d)
            this.$store.commit('MSET_BIGPOPUP', { name: '活动' })
      // this.$store.commit("set_showActivity", true);
    },
    mubiao() {
      // 测试fllyTo
    },
    handleCommand(command) {
      const that = this;
      const position = [+command.lnt + 0.00027, +command.lat + 0.00048, 450];
      console.log(command, "定位");
            const that = this
            const position = [+command.lnt + 0.00027, +command.lat + 0.00048, 450]
            console.log(command, '定位')
      // 定位
      // this.$store.commit("MSETCC_SETCC", {
      //   lntLat: position,
@@ -182,16 +199,16 @@
          ),
          // heading: data.heading,
          // pitch: data.pitch,
          roll: that.dimensionData.roll,
        },
      });
                    roll: that.dimensionData.roll
                }
            })
    },
    openBigPopupAfter() {
      this.$store.commit("MSET_BIGPOPUPAFTER", true);
            this.$store.commit('MSET_BIGPOPUPAFTER', true)
    },
    goOn() {
      const that = this;
      this.$store.commit("MSET_OPENMOBILEGOTO", !that.openmobileGoTo);
            const that = this
            this.$store.commit('MSET_OPENMOBILEGOTO', !that.openmobileGoTo)
      // console.log(returnCitySN["cip"]);
      // let data = {
      //   ip: returnCitySN["cip"],
@@ -204,10 +221,10 @@
      // });
    },
    getStreet() {
      const that = this;
            const that = this
      getListarc().then((res) => {
        const title = [];
        const data = res.data.data;
                const title = []
                const data = res.data.data
        for (let k = 0; k < data.length; k++) {
          title.push({
            title: data[k].dictValue,
@@ -215,8 +232,8 @@
            key: data[k].dictKey,
            child: [],
            lnt: that.ccData[k].lnt,
            lat: that.ccData[k].lat,
          });
                        lat: that.ccData[k].lat
                    })
        }
        // res.data.data.forEach((item) => {
        //   title.push({
@@ -226,12 +243,12 @@
        //     child: [],
        //   });
        // });
        this.tabTable = title;
        this.$store.commit("MSET_POPUPTABLENAME", title);
      });
    },
  },
};
                this.tabTable = title
                this.$store.commit('MSET_POPUPTABLENAME', title)
            })
        }
    }
}
</script>
<style scoped lang="scss">