shuishen
2021-12-30 4593a5c6ef4549a519681fa44d94fa242d15bec4
src/components/arcNavBar/index.vue
@@ -10,7 +10,7 @@
                         src="/img/icon/xyjz.png"
                         alt="">
                    <span>
                        {{title}}
                        {{arcNavBarTitle}}
                    </span>
                </div>
                <img class="close"
@@ -53,16 +53,12 @@
        return {
            moveFlag: false,
            itemNavList: [],
            titleList: [],
            DC: null
        }
    },
    props: {
        title: {
            type: String
        },
        arcCode: {
            type: Number
        }
    },
    computed: {
        ...mapGetters([
@@ -78,23 +74,33 @@
            // 介绍
            'introduceText',
            // 全景地址
            'panoramaUrl'
            'panoramaUrl',
            'arcNavBarTitle',
            'arcNavBarCode'
        ])
    },
    created () {
        this.DC = global.DC
        this.titleList = []
        getList().then(res => {
            res.data.data.forEach(item => {
                this.titleList.push({ title: item.dictValue, flag: false, key: item.dictKey })
            })
            this.titleList[0].flag = true
            this.getChilsNavs(this.titleList[0].key)
        })
    },
    mounted () {
    },
    watch: {
        arcNavBarCode: {
            immediate: true,
            handler (newCode, oldCode) {
                this.titleList = []
                getList().then(res => {
                    res.data.data.forEach(item => {
                        this.titleList.push({ title: item.dictValue, flag: false, key: item.dictKey })
                    })
                    this.titleList[0].flag = true
                    this.getChilsNavs(this.titleList[0].key)
                })
            }
        }
    },
    methods: {
        move (e) {
@@ -143,9 +149,7 @@
                document.onmouseup = null
            }
        },
        closeModel () {
            this.$parent.closeModel()
        },
        topNavClick (item, index) {
            this.titleList.forEach(item => {
                item.flag = false
@@ -155,10 +159,11 @@
            this.getChilsNavs(item.key)
        },
        getChilsNavs (campus) {
            this.itemNavList = []
            getChildNavList({ campus: campus, type: this.arcCode }).then(res => {
            getChildNavList({ campus: campus, type: this.arcNavBarCode }).then(res => {
                res.data.data.forEach(item => {
                    this.itemNavList.push({
                        navTitle: item.mechanismname,
@@ -168,6 +173,7 @@
                })
            })
        },
        mapPopup (param) {
            getChildNavDetail({ id: param.id }).then(res => {
                var result = res.data.data[0].list
@@ -207,6 +213,7 @@
                )
            })
        },
        newPopup (item) {
            const position = this.DC.Transform.transformWGS84ToCartesian(new this.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd), Number(item.heading), Number(item.pitch), Number(item.roll)))
            // eslint-disable-next-line no-unused-vars
@@ -219,6 +226,18 @@
            this.$store.commit('SET_PANORAMAPOPUP', false)
            this.$store.commit('SET_DETAILSPOPUP', true)
        },
        closeModel () {
            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)
        }
    }
}