Browse Source

修复地图问题

Shannon_mu 3 years ago
parent
commit
f1ab781d35

+ 9 - 4
operationSupport/src/assets/css/main.scss

@@ -478,15 +478,20 @@ a {
 .el-submenu__title {
     height: 50px;
     line-height: 50px !important;
-    padding: 0 10px !important;
+    padding: 0 vw(10);
     margin: 0 10px;
     background: #2c354a;
     border-radius: 32px 0px 0px 32px !important;
     color: $mainTextColor;
 }
-.el-menu--collapse .el-menu-item{
-    .el-tooltip{
-        padding-left: 10px !important;
+.el-menu--collapse {
+    .el-submenu__title{
+        padding: 0 10px !important;
+    }
+    .el-menu-item {
+        .el-tooltip {
+            padding-left: 10px !important;
+        }
     }
 }
 // 折叠菜单栏时出现箭头图标

+ 6 - 2
operationSupport/src/assets/css/public-style.scss

@@ -6,6 +6,12 @@ $greenColor: #44d7b6;
 $redColor: #ff7171;
 $ashColor: #dcdcdc;
 
+@function vw($size) {
+  @return ($size/19.2)vw;
+}
+@function vh($size) {
+  @return ($size/10.8)vh;
+}
 .greenText {
   color: $greenColor !important;
 }
@@ -20,8 +26,6 @@ $ashColor: #dcdcdc;
   height: 100%;
 }
 
-
-
 .formContent-item_title {
   font-size: 14px;
   position: relative;

+ 8 - 2
operationSupport/src/views/ownerManagement/stepPage/newAdd.vue

@@ -151,8 +151,14 @@
                         </zz-form>
 
                         <div class="block-title car" v-for="(items, indexs) in item.parkingList" :key="indexs">
-                            <div class="floor list-title">
-                                {{ `${items.garageName}${items.areaName || items.partitionName || ''}-${items.parkingNumber}` }}
+                            <div class="floor list-title" v-if="!!items.areaName">
+                                {{ `${items.garageName}${items.areaName}-${items.parkingNumber}` }}
+                            </div>
+                            <div class="floor list-title" v-else-if="!!items.partitionName">
+                                {{ `${items.garageName}${items.partitionName}-${items.parkingNumber}` }}
+                            </div>
+                            <div class="floor list-title" v-else>
+                                {{ `${items.garageName}-${items.parkingNumber}` }}
                             </div>
                             <span class="remove list-title" @click="removeCard(indexs, item)">移除</span>
                             <img class="bg-img" src="@/assets/img/ownerManagement/bg_card@2x.png" alt="" />

+ 11 - 4
operationSupport/src/views/ownerManagement/stepPage/poptreeSelect.vue

@@ -9,6 +9,7 @@
             ref="tenantstree"
             @check-change="checkChange"
         >
+            <div style="width: 100%" slot-scope="{ node, data }" @click="thisCheck($event, node, data)">{{ data.name }}</div>
         </el-tree>
     </el-scrollbar>
 </template>
@@ -26,7 +27,9 @@ export default {
         };
     },
     computed: {},
-    mounted() {},
+    mounted() {
+        console.log(this.$refs.tenantstree.$children);
+    },
     methods: {
         submit() {
             let arrs = this.$refs.tenantstree.getCheckedNodes();
@@ -61,9 +64,8 @@ export default {
             this.params.callback && this.params.callback(combination);
             this.$emit('close');
         },
-        checkChange(data,checked){
-            if(checked){
-
+        checkChange(data, checked) {
+            if (checked) {
             }
         },
         filterTreeData(trData) {
@@ -78,6 +80,11 @@ export default {
         },
         isNotEmpty(arr) {
             return arr && Array.isArray(arr) && arr.length > 0;
+        },
+        thisCheck(ev, node, data) {
+            if (!data.disabled) {
+                node.checked = !node.checked;
+            }
         }
     },
     created() {

+ 15 - 2
operationSupport/src/views/patrolManagement/popups/addPoint.vue

@@ -1,7 +1,14 @@
 <template>
     <div>
         <zz-form :cols="formCols" :data="formData" :rules="formRules" labelWidth="100" ref="form">
-            <el-select v-model="formData.communityId" placeholder="请选择所属社区" clearable slot="communityId" @change="communityChange">
+            <el-select
+                v-model="formData.communityId"
+                ref="community"
+                placeholder="请选择所属社区"
+                clearable
+                slot="communityId"
+                @change="communityChange"
+            >
                 <el-option v-for="(item, index) in communityArr" :key="index" :label="item.communityName" :value="item.id"></el-option>
             </el-select>
             <el-select v-model="formData.buildingId" placeholder="请选择楼栋" clearable slot="buildingId" @change="buildingChange">
@@ -95,6 +102,7 @@ export default {
             communityArr: [],
             buildingArr: [],
             unitArr: [],
+            communityLoc:[],
             backfill: false,
             mapPopUpStatus: false //地图弹出框
         };
@@ -111,7 +119,8 @@ export default {
                     props: {
                         callback: resolve,
                         location: this.initDot,
-                        data: this.formData
+                        data: this.formData,
+                        communityLoc:this.communityLoc
                     },
                     title: title
                 });
@@ -184,6 +193,10 @@ export default {
             });
         },
         communityChange(e) {
+            let thisLoc = this.communityArr.find((item) => {
+                return item.id == e;
+            });
+            this.communityLoc = [thisLoc.longitude,thisLoc.latitude];
             this.formData.buildingId = '';
             this.formData.unit = '';
             this.nestedLoop(this.communityTre, 'building', 'buildingArr', e);

+ 2 - 2
operationSupport/src/views/patrolManagement/popups/mapValue.vue

@@ -2,7 +2,7 @@
     <div>
         <div id="mapValue" :style="`height:${height || 300}px`"></div>
         <!--控制条-->
-        <div class="map-control" v-if="isStart && !!point.length">
+        <div class="map-control" v-if="isStart && !!line.length">
             <div class="clickIco">
                 <i class="zoniot_font zoniot-icon-kaishi" v-if="palyStayus == 0" @click="navgControl('start')"></i>
                 <i class="zoniot_font zoniot-icon-tingzhi" v-else-if="palyStayus == 2" @click="navgControl('pause')"></i>
@@ -78,7 +78,7 @@ export default {
                         this.lineArr.push([item.longitude, item.latitude]);
                     });
                     // 是否巡航开启
-                    if (this.isStart) {
+                    if (this.isStart && this.lineArr.length != 0) {
                         this.$nextTick(() => {
                             this.initPlayBox();
                             this.beforeInit = true;

+ 0 - 1
operationSupport/src/views/patrolManagement/popups/pathSimplifierIns.js

@@ -97,7 +97,6 @@ export default {
                 }
 
                 // 初始化坐标点
-                debugger;
                 if (_this.lineArr.length > 0) {
                     that.actualList = _this.lineArr;
 

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

@@ -33,8 +33,9 @@ export default {
     methods: {
         init() {
             let _this = this;
+
             this.map = new AMap.Map('container', {
-                city: this.params.data.communityName || '',
+                center: this.params.communityLoc.length == 2 ? this.params.communityLoc : '',
                 resizeEnable: true, //是否监控地图容器尺寸变化
                 zoom: 16 //初始化地图层级
             });

+ 45 - 36
operationSupport/src/views/patrolManagement/popups/scheduling.vue

@@ -22,7 +22,7 @@
                 <div class="showDateDay">{{ date | dateNewType }}</div>
                 <div class="schedulingUser">
                     <template v-for="(item, index) in calendarData">
-                        <div :key="index" v-if="data.day == item.partrolDate" class="222">
+                        <div :key="index" v-if="data.day == item.partrolDate">
                             <template v-for="itx in item.rosterUserDtos">
                                 <div :key="itx" class="listTime">
                                     <span>{{ itx.partrolTime }}</span>
@@ -30,10 +30,7 @@
                                 </div>
                             </template>
                             <template
-                                v-if="
-                                    date.getTime() <= $moment($parent.thisObj.endDate).valueOf() &&
-                                    date.getTime() >= $moment(new Date()).valueOf()
-                                "
+                                v-if="date.getTime() <= $moment($parent.thisObj.endDate).valueOf() && thisTimeFF(data, item.rosterUserDtos)"
                             >
                                 <!-- 每周那几天 -->
                                 <span v-if="thisObj.periodType == 1">
@@ -141,35 +138,31 @@ export default {
             });
         },
         addItem(da, dateDe, onj) {
-            if (da.getTime() <= this.$moment(new Date()).valueOf()) {
-                return;
-            } else {
-                new Promise((resolve) => {
-                    this.$store.dispatch('addPopup', {
-                        url: '/patrolManagement/popups/schedulingAdd.vue',
-                        width: '450px',
-                        height: '300px',
-                        props: {
-                            callback: resolve,
-                            findUser: this.findUser,
-                            dateDe,
-                            onj,
-                            thisObj: this.thisObj,
-                            isSingle: true
-                        },
-                        title: '排班'
-                    });
-                }).then(() => {
-                    let newTime = this.$moment(this.monthValue).format('YYYY-MM-DD');
-                    let timeArr = newTime.split('-');
-                    let time = new Date(timeArr[0], Number(timeArr[1]), 0);
-                    this.getShiftInformation({
-                        patrolRouteId: this.thisObj.id,
-                        startTime: `${timeArr[0]}-${timeArr[1]}-01`,
-                        endTime: `${timeArr[0]}-${timeArr[1]}-${time.getDate()}`
-                    });
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/patrolManagement/popups/schedulingAdd.vue',
+                    width: '450px',
+                    height: '300px',
+                    props: {
+                        callback: resolve,
+                        findUser: this.findUser,
+                        dateDe,
+                        onj,
+                        thisObj: this.thisObj,
+                        isSingle: true
+                    },
+                    title: '排班'
                 });
-            }
+            }).then(() => {
+                let newTime = this.$moment(this.monthValue).format('YYYY-MM-DD');
+                let timeArr = newTime.split('-');
+                let time = new Date(timeArr[0], Number(timeArr[1]), 0);
+                this.getShiftInformation({
+                    patrolRouteId: this.thisObj.id,
+                    startTime: `${timeArr[0]}-${timeArr[1]}-01`,
+                    endTime: `${timeArr[0]}-${timeArr[1]}-${time.getDate()}`
+                });
+            });
         },
         goback() {
             this.$emit('initPage');
@@ -218,19 +211,35 @@ export default {
                 }
                 let { startDate } = val;
                 let thisD = this.$moment(d.day + ' 00:00:00').valueOf();
-                if (this.thisTimeTypeShow(this.$moment(startDate).valueOf(), sum).includes(thisD)) {
+                if (this.thisTimeTypeShow(this.$moment(startDate).valueOf(), Number(sum)).includes(thisD)) {
                     bb = true;
                 }
             }
             return bb;
         },
         thisTimeTypeShow(kai, sum) {
+            // 零点计算 sum天得+1
             let oneDay = 86400000,
                 indU = [];
-            for (let x = 0; x <= 30; x++) {
-                indU.push(kai + x * sum * oneDay);
+            for (let x = 0; x <= 16; x++) {
+                indU.push(kai + x * (sum + 1) * oneDay);
             }
             return indU;
+        },
+        thisTimeFF(s, arr) {
+            let thisDate = this.$moment(new Date());
+            let sur = false;
+            arr.map((item, index) => {
+                let timePot = item.partrolTime.split('-');
+                timePot.map((its) => {
+                    if (this.$moment(`${s.day} ${its}:00`).valueOf() > thisDate.valueOf()) {
+                        sur = true;
+                        return sur;
+                    }
+                });
+                return sur;
+            });
+            return sur;
         }
     },
     created() {

+ 1 - 0
operationSupport/src/views/patrolManagement/popups/schedulingAdd.vue

@@ -47,6 +47,7 @@ export default {
             },
             pickerOptions: {
                 disabledDate(time) {
+                    // console.log(_this.$moment(_this.params.thisObj.startDate).format('YYYY-MM-DD'));
                     let startDate = _this.$moment(_this.params.thisObj.startDate).valueOf();
                     let endDate = _this.$moment(_this.params.thisObj.endDate).valueOf();
                     return time.getTime() > endDate || time.getTime() < startDate;

+ 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: {