校园-江西科技师范大学-前端
shuishen
2023-12-04 75caf8524a5934b16176764f8d56d77d11cd4d2c
校区切换处理---接口传参
9 files modified
161 ■■■■■ changed files
src/components/arcNavBar/index.vue 57 ●●●● patch | view | raw | blame | history
src/components/leftNav/index.vue 19 ●●●●● patch | view | raw | blame | history
src/components/map/index.vue 4 ●●●● patch | view | raw | blame | history
src/components/serviceNavBar/index.vue 38 ●●●●● patch | view | raw | blame | history
src/pcviews/orgnav/directly.vue 15 ●●●●● patch | view | raw | blame | history
src/pcviews/orgnav/masses.vue 9 ●●●●● patch | view | raw | blame | history
src/pcviews/orgnav/ofc.vue 9 ●●●●● patch | view | raw | blame | history
src/pcviews/orgnav/rest.vue 5 ●●●● patch | view | raw | blame | history
src/pcviews/orgnav/teaching.vue 5 ●●●● patch | view | raw | blame | history
src/components/arcNavBar/index.vue
@@ -8,12 +8,12 @@
            <img class="close deblurring" :src="publicPath + 'img/navicon/close.png'" alt @click="closeModel" />
        </template>
        <template slot="public-box-content">
            <div class="tab" v-show="false">
            <!-- <div class="tab">
                <ul>
                    <li :class="{ on: item.flag }" v-for="(item, index) in titleList" :key="index"
                        @click="topNavClick(item, index)">{{ item.title }}</li>
                </ul>
            </div>
            </div> -->
            <ul>
                <li v-for="(item, index) in itemNavList" :key="index" @click="mapPopup(item)">
                    <img :src="item.icon" alt />
@@ -39,6 +39,7 @@
import { Icon, Style, Fill, Text, Stroke } from 'ol/style.js'
let currentOrgLayer = null
let time
export default {
    name: 'ArcNavBar',
@@ -50,7 +51,11 @@
            titleList: []
        }
    },
    inject: ["layoutElement"],
    props: {},
    computed: {
        ...mapGetters([
            'popupBgUrl',
@@ -70,8 +75,10 @@
            'twoOrThree'
        ])
    },
    created () {
    },
    mounted () {
        this.$nextTick(() => {
            currentOrgLayer = new VectorLayer({
@@ -82,27 +89,36 @@
            this.map2D.addLayer(currentOrgLayer)
        })
    },
    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 = []
                // 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.titleList[0].flag = true
                    this.getChilsNavs(this.titleList[0].key)
                })
                // })
                time = setInterval(() => {
                    if (this.layoutElement.campusValue) {
                        this.getChilsNavs(this.layoutElement.campusValue)
                        clearInterval(time)
                    }
                }, 100)
            }
        }
        },
    },
    methods: {
        coordinate (item) {
@@ -129,7 +145,16 @@
            this.itemNavList = []
            currentOrgLayer.getSource().clear()
            if (currentOrgLayer) {
                currentOrgLayer.getSource().clear()
            } else {
                currentOrgLayer = new VectorLayer({
                    // 图标图层
                    zIndex: 9,
                    source: new VectorSource(),
                })
                this.map2D.addLayer(currentOrgLayer)
            }
            getChildNavList({ campus: campus, type: this.arcNavBarCode }).then(
                (res) => {
src/components/leftNav/index.vue
@@ -152,7 +152,6 @@
        })
    },
    inject: ["layoutElement"],
    watch: {
        calenderShow: {
            handler (newData, oldData) {
@@ -206,12 +205,6 @@
                }
            },
            immediate: true
        },
        'layoutElement.campusValue': {
            handler (newData) {
                console.log(newData, 99911)
            }
        }
    },
    methods: {
@@ -273,10 +266,10 @@
            }
        },
        initialize () {
        initialize (campus) {
            var that = this
            getTagList().then((res) => {
            getTagList({ campus }).then((res) => {
                res.data.data.forEach((item, index) => {
                    let obj = {}
                    if (item.x && item.x != '') {
@@ -325,7 +318,7 @@
                })
            })
            getWayList().then((res) => {
            getWayList({ campus }).then((res) => {
                res.data.data.forEach((item) => {
                    let obj = {}
                    if (item.x && item.x != '') {
@@ -403,7 +396,7 @@
            //     })
            // })
            getSceneList().then((res) => {
            getSceneList({ campus }).then((res) => {
                res.data.data.records.forEach((item) => {
                    let obj = {}
                    if (item.x && item.x != '') {
@@ -466,7 +459,7 @@
                })
            })
            getLifeList({ lifetype: 11 }).then((res) => {
            getLifeList({ lifetype: 11, campus }).then((res) => {
                res.data.data.forEach((item) => {
                    let obj = {}
                    if (item.x && item.x != '') {
@@ -507,7 +500,7 @@
                })
            })
            getLifeList({ lifetype: 12 }).then((res) => {
            getLifeList({ lifetype: 12, campus }).then((res) => {
                res.data.data.forEach((item) => {
                    let obj = {}
                    if (item.x && item.x != '') {
src/components/map/index.vue
@@ -157,6 +157,10 @@
        'layoutElement.campusValue': {
            handler (newData) {
                this.campusCut(newData)
                this.$nextTick(() => {
                    this.$refs.leftNav.initialize(newData)
                })
            }
        }
    },
src/components/serviceNavBar/index.vue
@@ -8,12 +8,12 @@
            <img class="close deblurring" :src="publicPath + 'img/navicon/close.png'" alt @click="closeModel" />
        </template>
        <template slot="public-box-content">
            <div class="tab" v-show="false">
            <!-- <div class="tab" v-show="false">
                <ul>
                    <li :class="{ on: item.flag }" v-for="(item, index) in titleList" :key="index"
                        @click="topNavClick(item, index)">{{ item.title }}</li>
                </ul>
            </div>
            </div> -->
            <ul>
                <li v-for="(item, index) in itemNavList" :key="index" @click="mapPopup(item.details)">
                    <img :src="item.icon" alt />
@@ -46,6 +46,9 @@
            itemNavList: []
        }
    },
    inject: ["layoutElement"],
    props: {
        title: {
            type: String
@@ -75,22 +78,21 @@
        ])
    },
    created () {
        this.titleList = []
        // this.titleList = []
        // 三江社区//"土木楼"//"科学园"//"黄河路"//"红旗社区"
        getList().then((res) => {
            res.data.data.forEach((item) => {
                // console.log(item, "see");
                this.titleList.push({
                    title: item.dictValue,
                    flag: false,
                    key: item.dictKey
                })
            })
        // getList().then((res) => {
        //     res.data.data.forEach((item) => {
        //         // console.log(item, "see");
        //         this.titleList.push({
        //             title: item.dictValue,
        //             flag: false,
        //             key: item.dictKey
        //         })
        //     })
            this.titleList[0].flag = true
        //     this.titleList[0].flag = true
            this.getChilsNavs(this.titleList[0].key)
        })
        // })
    },
    watch: {
        twoOrThree: {
@@ -100,7 +102,11 @@
            immediate: true
        }
    },
    mounted () { },
    mounted () {
        this.getChilsNavs(this.layoutElement.campusValue)
    },
    methods: {
        coordinate (item) {
            const arr = item.split(',')
src/pcviews/orgnav/directly.vue
@@ -1,3 +1,13 @@
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-11-22 10:26:22
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-12-04 15:32:25
 * @FilePath: \sd-jg-school-web-ksd\src\pcviews\orgnav\directly.vue
 * @Description:
 *
 * Copyright (c) 2023 by shuishen, All Rights Reserved.
-->
<template>
    <div></div>
</template>
@@ -13,6 +23,9 @@
            list: []
        }
    },
    inject: ["layoutElement"],
    computed: {
        ...mapGetters([
            // 校园内导航的显示关闭
@@ -31,7 +44,7 @@
        this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: 3 }).then((res) => {
        getList({ type: 3, campus: this.layoutElement.campusValue }).then((res) => {
            res.data.data.records.forEach((item) => {
                this.list.push({
                    navTitle: item.mechanismname,
src/pcviews/orgnav/masses.vue
@@ -2,8 +2,8 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-29 09:04:54
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-09-09 15:39:12
 * @FilePath: \smart-campus\src\pcviews\orgnav\masses.vue
 * @LastEditTime: 2023-12-04 15:33:04
 * @FilePath: \sd-jg-school-web-ksd\src\pcviews\orgnav\masses.vue
 * @Description:
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
@@ -23,6 +23,9 @@
            list: []
        }
    },
    inject: ["layoutElement"],
    computed: {
        ...mapGetters([
            // 校园内导航的显示关闭
@@ -43,7 +46,7 @@
        this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: 1 }).then((res) => {
        getList({ type: 1, campus: this.layoutElement.campusValue }).then((res) => {
            res.data.data.records.forEach((item) => {
                this.list.push({
                    navTitle: item.mechanismname,
src/pcviews/orgnav/ofc.vue
@@ -2,8 +2,8 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-29 09:04:54
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-08-30 14:21:58
 * @FilePath: \smart-campus\src\pcviews\orgnav\ofc.vue
 * @LastEditTime: 2023-12-04 15:33:30
 * @FilePath: \sd-jg-school-web-ksd\src\pcviews\orgnav\ofc.vue
 * @Description:
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
@@ -23,6 +23,9 @@
            list: []
        }
    },
    inject: ["layoutElement"],
    computed: {
        ...mapGetters([
            // 校园内导航的显示关闭
@@ -41,7 +44,7 @@
        this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: 2 }).then((res) => {
        getList({ type: 2, campus: this.layoutElement.campusValue }).then((res) => {
            res.data.data.records.forEach((item) => {
                this.list.push({
                    navTitle: item.mechanismname,
src/pcviews/orgnav/rest.vue
@@ -13,6 +13,9 @@
            list: []
        }
    },
    inject: ["layoutElement"],
    computed: {
        ...mapGetters([
            // 校园内导航的显示关闭
@@ -31,7 +34,7 @@
        this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: 5 }).then((res) => {
        getList({ type: 5, campus: this.layoutElement.campusValue }).then((res) => {
            res.data.data.records.forEach((item) => {
                this.list.push({
                    navTitle: item.mechanismname,
src/pcviews/orgnav/teaching.vue
@@ -13,6 +13,9 @@
            list: []
        }
    },
    inject: ["layoutElement"],
    computed: {
        ...mapGetters([
            // 校园内导航的显示关闭
@@ -31,7 +34,7 @@
        this.$store.commit('SET_ORGNAVBARFLAG', true)
        getList({ type: 4 }).then((res) => {
        getList({ type: 4, campus: this.layoutElement.campusValue }).then((res) => {
            res.data.data.records.forEach((item) => {
                this.list.push({
                    navTitle: item.mechanismname,