Shannon_mu 3 yıl önce
ebeveyn
işleme
dfba89ae39

BIN
operationSupport/src/assets/img/icon_dizhi@2x.png


BIN
operationSupport/src/assets/img/icon_dizhiGrad@2x.png


BIN
operationSupport/src/assets/img/icon_point_mine@2x.png


BIN
operationSupport/src/assets/img/point_weiwancheng@2x.png


+ 41 - 24
operationSupport/src/views/patrolManagement/popups/mapValue.vue

@@ -30,34 +30,30 @@
 <script>
 import functionJs from './pathSimplifierIns';
 export default {
-    props: ['point', 'isStart', 'height'],
+    props: ['point', 'isStart', 'height', 'line'],
     mixins: [functionJs],
     data() {
         return {
             marker: '',
             markerArr: [],
-            polyline: null
+            polyline: null,
+            lineArr2: []
         };
     },
     watch: {
         point: {
             handler() {
                 if (!!this.map) {
-                    this.lineArr = [];
                     // 判断当前是否有绘制点位清除
                     if (this.markerArr.length > 0) {
                         this.map.remove(this.markerArr);
                         this.markerArr = [];
                     }
-                    // 判断当前是否有巡航路线清除
-                    if (!!this.pathSimplifierIns) {
-                        this.pathSimplifierIns.setData([]);
-                        this.pathSimplifierIns = null;
-                    }
                     // 判断当前是否有轨迹清除
                     if (!!this.polyline) {
                         this.map.remove(this.polyline);
                         this.polyline = null;
+                        this.lineArr2 = [];
                     }
                     // 先初始化点位信息
                     this.point.map((item, index) => {
@@ -68,6 +64,31 @@ export default {
             },
             deep: true,
             immediate: true
+        },
+        line: {
+            handler() {
+                if (!!this.map) {
+                    this.lineArr = [];
+                    // 判断当前是否有巡航路线清除
+                    if (!!this.pathSimplifierIns) {
+                        this.pathSimplifierIns.setData([]);
+                        this.pathSimplifierIns = null;
+                    }
+                    this.line.map((item) => {
+                        this.lineArr.push([item.longitude, item.latitude]);
+                    });
+                    // 是否巡航开启
+                    if (this.isStart) {
+                        this.$nextTick(() => {
+                            this.initPlayBox();
+                            this.beforeInit = true;
+                            this.initLineArr(true);
+                        });
+                    }
+                }
+            },
+            deep: true,
+            immediate: true
         }
     },
     methods: {
@@ -80,40 +101,36 @@ export default {
         //绘制点位信息
         addIcon(e, index) {
             let lineArr = [e.longitude, e.latitude];
+            let self = this;
             this.marker = new AMap.Marker({
-                icon: this.icon,
+                icon: new AMap.Icon({
+                    image: !!e.id ? self.pointIcon : self.pointGradIcon,
+                    size: new AMap.Size(20, 25),
+                    imageSize: new AMap.Size(20, 28)
+                }),
                 position: lineArr
             });
             this.marker.setLabel({
-                offset: new AMap.Pixel(-22, 40),
+                offset: new AMap.Pixel(-22, 30),
                 content: `巡更点:${index + 1}`
             });
             this.markerArr.push(this.marker);
-            this.lineArr.push(lineArr);
+            this.lineArr2.push(lineArr);
         },
         // 添加点位 添加路线到地图
         setMap() {
             this.map.add(this.markerArr);
             this.map.setFitView();
-            // 大于一个点创建 巡航路线
-            if (this.point.length > 1) {
-                // 是否巡航开启
-                if (this.isStart) {
-                    this.$nextTick(() => {
-                        this.initPlayBox();
-                        this.beforeInit = true;
-                        this.initLineArr(true);
-                    });
-                } else {
-                    this.addPolyline();
-                }
+            // 大于一个点创建 轨迹回放
+            if (this.point.length > 1 && !this.isStart) {
+                this.addPolyline();
             }
         },
         //轨迹路线
         addPolyline() {
             this.polyline = new AMap.Polyline({
                 map: this.map,
-                path: this.lineArr,
+                path: this.lineArr2,
                 showDir: true,
                 strokeColor: '#28F', //线颜色
                 // strokeOpacity: 1,     //线透明度

+ 9 - 6
operationSupport/src/views/patrolManagement/popups/pathSimplifierIns.js

@@ -10,8 +10,8 @@ export default {
             isPlay: true,
             sliderVal: 0, // 进度条
             times: 1, // 倍速
-            maxSpeed: 40, // 最高倍速
-            navgtrSpeed: 1000, // 速度
+            maxSpeed: 10, // 最高倍速
+            navgtrSpeed: 5000, // 速度
             isMinSpeed: true,
             isMaxSpeed: false,
             navgtr: null,
@@ -69,7 +69,9 @@ export default {
             isCursorAtPathEnd: false,
             palyStayus: 0, //0->未开始  1->行驶中  2->暂停
             value: 0, // 进度条初始化
-
+            pointIcon: require('@/assets/img/icon_dizhi@2x.png'),
+            pointGradIcon: require('@/assets/img/icon_dizhiGrad@2x.png'),
+            moveIcon: require('@/assets/img/icon_point_mine@2x.png'),
             // signMarker: null,
             currentPoint: null,
 
@@ -95,6 +97,7 @@ export default {
                 }
 
                 // 初始化坐标点
+                debugger;
                 if (_this.lineArr.length > 0) {
                     that.actualList = _this.lineArr;
 
@@ -133,13 +136,13 @@ export default {
                     }
 
                     //对第一条线路(即索引 0)创建一个巡航器
-                    let image = PathSimplifier.Render.Canvas.getImageContent('https://webapi.amap.com/images/car.png', onload, onerror);
+                    let image = PathSimplifier.Render.Canvas.getImageContent(that.moveIcon, onload, onerror);
                     that.navgtr = that.pathSimplifierIns.createPathNavigator(0, {
                         loop: false, //循环播放
                         speed: that.navgtrSpeed, //巡航速度,单位千米/小时
                         pathNavigatorStyle: {
-                            width: 20,
-                            height: 30,
+                            width: 25,
+                            height: 60,
                             //使用图片
                             content: image, // 自定义巡航样式
                             strokeStyle: null,

+ 70 - 19
operationSupport/src/views/patrolManagement/popups/patrolDetails.vue

@@ -10,54 +10,61 @@
         </div>
         <div class="contentText">
             <div class="leftMap">
-                <map-value :point="targetData" ref="mapVal" :isStart="true" :height="400"></map-value>
+                <map-value :point="thisItem" :line="targetData" ref="mapVal" :isStart="true" :height="400"></map-value>
                 <div class="formLabel">
                     <div class="formLabelList">
                         <div class="label">所属社区</div>
-                        <div class="text">{{thisObj.communityName}}</div>
+                        <div class="text">{{ thisObj.communityName }}</div>
                     </div>
                     <div class="formLabelList">
                         <div class="label">巡更路线</div>
-                        <div class="text">{{thisObj.routeName}}</div>
+                        <div class="text">{{ thisObj.routeName }}</div>
                     </div>
                     <div class="formLabelList">
                         <div class="label">巡更人员</div>
-                        <div class="text">{{thisObj.partolName}}</div>
+                        <div class="text">{{ thisObj.partolName }}</div>
                     </div>
                     <div class="formLabelList">
                         <div class="label">巡更日期</div>
-                        <div class="text">{{thisObj.patrolDate}}</div>
+                        <div class="text">{{ thisObj.patrolDate }}</div>
                     </div>
                     <div class="formLabelList">
                         <div class="label">巡更时间</div>
-                        <div class="text">{{thisObj.patrolTime}}</div>
+                        <div class="text">{{ thisObj.patrolTime }}</div>
                     </div>
                 </div>
             </div>
             <div class="rightList">
-                <template v-for="(item,index) in thisItem">
+                <template v-for="(item, index) in thisItem">
                     <div class="steps" :key="index">
                         <div class="steps-left">
-                            <img src="@assets/img/point_yiwancheng@2x.png" alt />
-                            <div class="steps-left-line" v-if="index !== thisItem.length-1"></div>
+                            <img v-if="!!item.id" src="@assets/img/point_yiwancheng@2x.png" alt />
+                            <img v-else src="@assets/img/point_weiwancheng@2x.png" alt />
+                            <div class="steps-left-line" v-if="index !== thisItem.length - 1"></div>
                         </div>
                         <div class="steps-right">
                             <div class="steps-right-title">
-                                <span v-if="index===0">{{item.pointStatus==1?'待执行':'开始任务'}}</span>
-                                <span v-else>巡更点{{index}}</span>
-                                <span
-                                    class="status"
-                                    v-if="index!==0"
-                                >{{item.pointStatus==1?'未完成 ':'已完成'}}</span>
+                                <span v-if="index == 0">{{ !!item.id ? '开始任务 ' : '待执行' }}</span>
+                                <span v-else>{{ item.pointName }}</span>
+                                <span class="status" v-if="index !== 0" :class="!!item.id ? '' : 'grad'">{{
+                                    !!item.id ? '已完成' : '未完成'
+                                }}</span>
                             </div>
-                            <div class="steps-right-content">{{item.checkTime}}</div>
+                            <div class="steps-right-content">{{ item.checkTime }}</div>
                             <div class="steps-right-content">
                                 <span>巡更结果:</span>
-                                <span>{{item.result||'-'}}</span>
+                                <span>{{ item.result || '-' }}</span>
                             </div>
                             <div class="steps-right-content">
                                 <span>图片/视频:</span>
-                                <span>{{item.picturePath||'-'}}</span>
+                                <template v-if="!!item.picturePath">
+                                    <div class="imgVdio" v-for="items in item.picturePath.split(',')" :key="items">
+                                        <video v-if="typeVideo(items)" :src="items" @click="lookVideos(items)"></video>
+                                        <el-image class="imgs" v-else :src="items" :preview-src-list="[items]">
+                                            <div slot="error" class="image-slot">--</div>
+                                        </el-image>
+                                    </div>
+                                </template>
                             </div>
                         </div>
                     </div>
@@ -115,6 +122,30 @@ export default {
                     this.targetData = data;
                 }
             });
+        },
+        typeVideo(str) {
+            let type = str.slice(str.lastIndexOf('.') + 1, str.length);
+            let videoType = ['mp4'];
+            return videoType.includes(type);
+        },
+        lookVideos(src) {
+            new Promise((resolve) => {
+                this.$store.dispatch('addPopup', {
+                    url: '/lookVideo.vue',
+                    width: '600px',
+                    height: '500px',
+                    props: {
+                        src: src,
+                        callback: resolve
+                    },
+                    showConfirmButton: true,
+                    showCancelButton: true,
+                    hideStar: true,
+                    title: '查看视频'
+                });
+            }).then(() => {
+                this.mixins_search();
+            });
         }
     },
     created() {
@@ -171,6 +202,14 @@ export default {
                 img {
                     width: 20px;
                     vertical-align: -webkit-baseline-middle;
+                    &.grad {
+                        -webkit-filter: grayscale(100%);
+                        -moz-filter: grayscale(100%);
+                        -ms-filter: grayscale(100%);
+                        -o-filter: grayscale(100%);
+                        filter: grayscale(100%);
+                        filter: gray;
+                    }
                 }
                 .steps-left {
                     margin-right: 10px;
@@ -182,7 +221,7 @@ export default {
                     }
                 }
                 .steps-right {
-                    width: 100%;
+                    width: calc(100% - 15px);
                     line-height: 30px;
                     margin-bottom: 10px;
                     .steps-right-title {
@@ -192,6 +231,9 @@ export default {
                         .status {
                             color: $mainBgColor;
                             font-weight: 400;
+                            &.grad {
+                                color: gray;
+                            }
                         }
                     }
                     .steps-right-content {
@@ -207,4 +249,13 @@ export default {
         }
     }
 }
+.imgVdio {
+    display: inline-block;
+    margin-right: 10px;
+    .imgs,
+    video {
+        width: 64px;
+        cursor: pointer;
+    }
+}
 </style>

+ 105 - 23
operationSupport/src/views/patrolManagement/popups/scheduling.vue

@@ -22,34 +22,55 @@
                 <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" @click="add(data, item)">
+                        <div :key="index" v-if="data.day == item.partrolDate" class="222">
                             <template v-for="itx in item.rosterUserDtos">
                                 <div :key="itx" class="listTime">
                                     <span>{{ itx.partrolTime }}</span>
                                     <span>{{ itx.partolName }}</span>
                                 </div>
                             </template>
+                            <template
+                                v-if="
+                                    date.getTime() <= $moment($parent.thisObj.endDate).valueOf() &&
+                                    date.getTime() >= $moment(new Date()).valueOf()
+                                "
+                            >
+                                <!-- 每周那几天 -->
+                                <span v-if="thisObj.periodType == 1">
+                                    <template v-if="periodValueType(thisObj.periodValue).includes(date.getDay() + '')">
+                                        <div class="pointSet" @click="addItem(date, data, item)">点击设置</div>
+                                    </template>
+                                </span>
+                                <!-- 每隔N天 -->
+                                <span v-else>
+                                    <template v-if="timeAddDay($parent.thisObj, thisObj.periodValue, data)">
+                                        <div class="pointSet" @click="addItem(date, data, item)">点击设置</div>
+                                    </template>
+                                </span>
+                            </template>
                         </div>
                     </template>
-                    <!-- <div
-                        class="pointSet"
+                    <!-- 时间范围内且没有排班 -->
+                    <template
                         v-if="
                             date.getTime() <= $moment($parent.thisObj.endDate).valueOf() &&
-                            date.getTime() >= new Date(new Date().toLocaleDateString()).getTime() &&
+                            date.getTime() >= $moment(new Date()).valueOf() &&
                             !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>
+                        <!-- 每周那几天 -->
+                        <span v-if="thisObj.periodType == 1">
+                            <template v-if="periodValueType(thisObj.periodValue).includes(date.getDay() + '')">
+                                <div class="pointSet" @click="add(data)">点击设置</div>
+                            </template>
+                        </span>
+                        <!-- 每隔N天 -->
+                        <span v-else>
+                            <template v-if="timeAddDay($parent.thisObj, thisObj.periodValue, data)">
+                                <div class="pointSet" @click="add(data)">点击设置</div>
+                            </template>
+                        </span>
+                    </template>
                 </div>
             </template>
         </el-calendar>
@@ -63,6 +84,7 @@ export default {
             findUser: [],
             thisObj: {},
             calendarData: [],
+            indexThis: 0,
             trueArr: [] //已有设置时间集合
         };
     },
@@ -85,17 +107,14 @@ export default {
         }
     },
     methods: {
-        add(dateDe, onj) {
+        add(dateDe) {
             let title = '排班',
                 isSingle = true;
-            if (dateDe == undefined && onj == undefined) {
+            if (dateDe == undefined) {
                 title = '批量排班';
                 isSingle = false;
             }
-            if (dateDe !== undefined && onj !== undefined) {
-                new Date(dateDe).getTime() >= new Date(new Date().toLocaleDateString()).getTime();
-                return;
-            }
+
             new Promise((resolve) => {
                 this.$store.dispatch('addPopup', {
                     url: '/patrolManagement/popups/schedulingAdd.vue',
@@ -105,7 +124,6 @@ export default {
                         callback: resolve,
                         findUser: this.findUser,
                         dateDe,
-                        onj,
                         thisObj: this.thisObj,
                         isSingle: isSingle
                     },
@@ -122,6 +140,37 @@ 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()}`
+                    });
+                });
+            }
+        },
         goback() {
             this.$emit('initPage');
         },
@@ -138,7 +187,8 @@ export default {
                         data[inx].map((item) => {
                             rosterUserDtos.push({
                                 partrolTime: item.patrolTime,
-                                partolName: item.partolName
+                                partolName: item.partolName,
+                                patrolUserId: item.patrolUserId
                             });
                         });
                         trueArr.push(this.$moment(inx).format('YYYY-MM-DD'));
@@ -149,8 +199,38 @@ export default {
                     }
                     this.calendarData = calendarData;
                     this.trueArr = trueArr;
+                    this.indexThis = 0;
                 }
             });
+        },
+        periodValueType(value) {
+            if (!!value) {
+                return value.split(',').sort();
+            }
+            return [];
+        },
+        timeAddDay(val, sunDay, d) {
+            let sum = sunDay || 0;
+            let bb = false;
+            if (!!val && !!sunDay) {
+                if (this.indexThis <= 30) {
+                    this.indexThis++;
+                }
+                let { startDate } = val;
+                let thisD = this.$moment(d.day + ' 00:00:00').valueOf();
+                if (this.thisTimeTypeShow(this.$moment(startDate).valueOf(), sum).includes(thisD)) {
+                    bb = true;
+                }
+            }
+            return bb;
+        },
+        thisTimeTypeShow(kai, sum) {
+            let oneDay = 86400000,
+                indU = [];
+            for (let x = 0; x <= 30; x++) {
+                indU.push(kai + x * sum * oneDay);
+            }
+            return indU;
         }
     },
     created() {
@@ -159,6 +239,8 @@ export default {
     mounted() {
         this.findUser = this.$parent.findUser;
         this.thisObj = this.$parent.thisObj;
+        this.thisObj.periodType == 1;
+        console.log(this.thisObj);
         this.$el.querySelector('div.el-calendar__header').remove();
     }
 };

+ 8 - 3
operationSupport/src/views/patrolManagement/popups/schedulingAdd.vue

@@ -120,9 +120,14 @@ export default {
             this.thisDay = this.params.dateDe;
         }
         if (!!this.params.onj) {
-            console.log(this.params.onj);
-        }
-        if (!!this.params.thisObj) {
+            this.params.onj.rosterUserDtos.map((item) => {
+                this.timePeriod.push({
+                    partolName: item.partolName,
+                    partolUserId: item.patrolUserId,
+                    partrolTime: item.partrolTime
+                });
+            });
+        } else if (!!this.params.thisObj) {
             let arrs = this.params.thisObj.timePeriod.split(',');
             arrs.map((item) => {
                 this.timePeriod.push({