瀏覽代碼

地图需求

Shannon_mu 3 年之前
父節點
當前提交
fd3ce3ab6c

+ 31 - 9
operationSupport/src/main.js

@@ -71,18 +71,27 @@ Vue.prototype.routerLoad = {
             }
         });
     },
-    findMen(arr, indexPath) {
-        let status = false;
+    findMen(arrList, arr, indexPath) {
         arr.map((v) => {
+            // if ('/' + v.linkPath !== indexPath) {
+            //     if (!!v.children) {
+            //         this.findMen(arrList, item.children, indexPath);
+            //     } else {
+            //         arrList.push(true)
+            //     }
+            // } else {
+
+            // }
+
             if (v.children) {
-                this.findMen(v.children);
+                this.findMen(arrList, v.children, indexPath);
             } else {
-                if ('/' + v.linkPath === indexPath) {
-                    status = true;
+                if ('/' + v.linkPath == indexPath) {
+                    arrList.push(true)
                 }
             }
         });
-        return status;
+
     },
     close() {
         let activeRout = localStorage.getItem('path');
@@ -99,6 +108,16 @@ Vue.prototype.routerLoad = {
         http.get('/sc-user-center/user/findUserMenu', { appId: '1002' }).then(({ status, data, msg }) => {
             if (0 === status) {
                 store.commit('setMenuList', data[0].children);
+                if (data[0].children[0].children == null) {
+                    router.push({
+                        path: '/' + data[0].children[0].linkPath
+                    });
+                } else {
+                    router.push({
+                        path: '/' + data[0].children[0].children[0].linkPath
+                    });
+
+                }
                 store.commit('setThisDetai', data[0]);
             }
         });
@@ -138,12 +157,15 @@ Vue.prototype.routerLoad = {
 router.beforeEach((to, from, next) => {
     if (to.path !== '/404') {
         // console.log()
-        let PermissionsRouter = Vue.prototype.routerLoad.findMen(store.getters.getMenuList, to.fullPath);
-        if (PermissionsRouter) {
+        let newa = [];
+        console.log()
+        Vue.prototype.routerLoad.findMen(newa, store.getters.getMenuList, to.fullPath);
+        if (newa.length) {
             next();
         } else {
-            next({ path: 404 });
+            next({ path: '404' });
         }
+        next();
         // 跳转时存储路由
         localStorage.setItem('path', to.fullPath);
     } else {

+ 1 - 1
operationSupport/src/router/index.js

@@ -325,7 +325,7 @@ const quietRoute = [
             },
             ...zRoute
         ],
-        redirect: '/workbench/index'
+        // redirect: '/workbench/index'
     },
     {
         path: '*',

+ 7 - 2
operationSupport/src/views/patrolManagement/popups/popMap.vue

@@ -34,8 +34,9 @@ export default {
         init() {
             let _this = this;
             this.map = new AMap.Map('container', {
+                city: this.params.data.communityName || '',
                 resizeEnable: true, //是否监控地图容器尺寸变化
-                zoom: 11 //初始化地图层级
+                zoom: 16 //初始化地图层级
             });
             this.map.on('complete', () => {
                 if (!!_this.params.location) {
@@ -46,7 +47,10 @@ export default {
 
             this.map.on('click', this.mapClick);
             this.placeSearch = new AMap.PlaceSearch({
-                map: _this.map
+                map: _this.map,
+                city: '广东', //020
+                citylimit: true, //定点范围
+                autoFitView: true
             });
             AMap.event.addListener(this.placeSearch, 'markerClick', (e) => {
                 this.thisMapPot = e.event.lnglat;
@@ -82,6 +86,7 @@ export default {
         togglePlaceSearch(val, resolve) {
             this.placeSearch.search(val, (status, result) => {
                 if (result.info == 'OK' && status == 'complete') {
+                    console.log(result.poiList);
                     this.poisArray = result.poiList.pois;
                 }
                 resolve && resolve(true);

+ 9 - 1
operationSupport/src/views/patrolManagement/popups/scheduling.vue

@@ -31,7 +31,7 @@
                             </template>
                         </div>
                     </template>
-                    <div
+                    <!-- <div
                         class="pointSet"
                         v-if="
                             date.getTime() <= $moment($parent.thisObj.endDate).valueOf() &&
@@ -39,6 +39,14 @@
                             !trueArr.includes(data.day)
                         "
                         @click="add(data)"
+                    > -->
+                    <div
+                        class="pointSet"
+                        v-if="
+                            date.getTime() <= $moment($parent.thisObj.endDate).valueOf() &&
+                            date.getTime() >= new Date(new Date().toLocaleDateString()).getTime()
+                        "
+                        @click="add(data)"
                     >
                         点击设置
                     </div>

+ 4 - 4
operationSupport/vue.config.js

@@ -34,8 +34,8 @@ module.exports = {
                 viewportWidth: 1920 //传参
             });
         // 配置每次打包浏览器缓存文件名的随机性
-        // const filename = path.posix.join('js', `${new Date().getTime()}_[name].js`);
-        // config.mode('production').devtool(false).output.filename(filename).chunkFilename(filename);
+        const filename = path.posix.join('js', `${new Date().getTime()}_[name].js`);
+        config.mode('production').devtool(false).output.filename(filename).chunkFilename(filename);
     },
     // 配置全局样式变量
     css: {
@@ -61,8 +61,8 @@ module.exports = {
         },
         extract: {
             // 打包后css文件名称添加时间戳
-            // filename: `css/[name].${new Date().getTime()}.css`,
-            // chunkFilename: `css/chunk.[id].${new Date().getTime()}.css`
+            filename: `css/[name].${new Date().getTime()}.css`,
+            chunkFilename: `css/chunk.[id].${new Date().getTime()}.css`
         }
     },
     configureWebpack: {