|
@@ -1,24 +1,10 @@
|
|
|
<template>
|
|
|
<div class="main">
|
|
|
- <div class="blockName">
|
|
|
- {{ !isAdd ? '编辑' : '新增' }}巡更路线(
|
|
|
- <span class="show-required-icon-star"></span>为必填项)
|
|
|
- </div>
|
|
|
- <el-form
|
|
|
- :model="ruleForm"
|
|
|
- :rules="rules"
|
|
|
- ref="ruleForm"
|
|
|
- label-width="120px"
|
|
|
- class="formContent"
|
|
|
- >
|
|
|
+ <div class="blockName">{{ !isAdd ? '编辑' : '新增' }}巡更路线( <span class="show-required-icon-star"></span>为必填项)</div>
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="formContent">
|
|
|
<div class="formContent-item">
|
|
|
<el-form-item label="所属社区" prop="communityId">
|
|
|
- <el-select
|
|
|
- class="width100"
|
|
|
- v-model="ruleForm.communityId"
|
|
|
- placeholder="所属社区"
|
|
|
- clearable
|
|
|
- >
|
|
|
+ <el-select class="width100" v-model="ruleForm.communityId" placeholder="所属社区" clearable>
|
|
|
<el-option
|
|
|
v-for="(item, index) in $parent.communityArr"
|
|
|
:key="index"
|
|
@@ -35,7 +21,7 @@
|
|
|
v-model="ruleForm.routePointRelationDtos"
|
|
|
ref="transferTude"
|
|
|
filterable
|
|
|
- style="margin-bottom: 20px;"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
:props="{
|
|
|
key: 'id',
|
|
|
label: 'pointName',
|
|
@@ -44,8 +30,17 @@
|
|
|
}"
|
|
|
:titles="['待选列表', '已选列表']"
|
|
|
@change="handleChange"
|
|
|
+ target-order="push"
|
|
|
:data="patrolArr"
|
|
|
- ></el-transfer>
|
|
|
+ >
|
|
|
+ <div slot-scope="{ option }" class="transferTudeClass">
|
|
|
+ <span>{{ option.pointName }}</span>
|
|
|
+ <div>
|
|
|
+ <span class="zoniot_font zoniot-icon-shang" @click="optionUp(0, option)"></span>
|
|
|
+ <span class="zoniot_font zoniot-icon-xia" @click="optionUp(1, option)"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-transfer>
|
|
|
<map-value :point="targetData"></map-value>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -64,17 +59,17 @@
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="巡更时间" prop="timePeriod">
|
|
|
- <div class="timeList" v-for="(item,index) in timePeriod" :key="index">
|
|
|
+ <div class="timeList" v-for="(item, index) in timePeriod" :key="index">
|
|
|
<el-time-select
|
|
|
class="width50"
|
|
|
placeholder="开始时间"
|
|
|
v-model="item.startTime"
|
|
|
:picker-options="{
|
|
|
- start: '00:00',
|
|
|
- step: '00:15',
|
|
|
- end: '23:30'
|
|
|
+ start: '00:00',
|
|
|
+ step: '00:15',
|
|
|
+ end: '23:30'
|
|
|
}"
|
|
|
- @change="timeChange(item,'startTime')"
|
|
|
+ @change="timeChange(item, 'startTime')"
|
|
|
></el-time-select>
|
|
|
<span>至</span>
|
|
|
<el-time-select
|
|
@@ -82,21 +77,17 @@
|
|
|
v-model="item.endTime"
|
|
|
class="width50"
|
|
|
:picker-options="{
|
|
|
- start: '00:00',
|
|
|
- step: '00:15',
|
|
|
- end: '23:30',
|
|
|
- minTime: item.startTime
|
|
|
+ start: '00:00',
|
|
|
+ step: '00:15',
|
|
|
+ end: '23:30',
|
|
|
+ minTime: item.startTime
|
|
|
}"
|
|
|
- @change="timeChange(item,'endTime')"
|
|
|
+ @change="timeChange(item, 'endTime')"
|
|
|
></el-time-select>
|
|
|
- <div class="sunm" @click="addTime(index,1)">
|
|
|
+ <div class="sunm" @click="addTime(index, 1)">
|
|
|
<i class="zoniot_font zoniot-icon-tianjia1"></i>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="sunm"
|
|
|
- @click="addTime(index,-1)"
|
|
|
- v-if="timePeriod.length>1 && index!=0"
|
|
|
- >
|
|
|
+ <div class="sunm" @click="addTime(index, -1)" v-if="timePeriod.length > 1 && index != 0">
|
|
|
<i class="zoniot_font zoniot-icon-shanjian"></i>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -118,12 +109,8 @@
|
|
|
</el-checkbox-group>
|
|
|
<div v-else class="periodValueInput">
|
|
|
每隔
|
|
|
- <el-input-number
|
|
|
- v-model="ruleForm.periodValue"
|
|
|
- controls-position="right"
|
|
|
- :min="0"
|
|
|
- :max="30"
|
|
|
- ></el-input-number>天进行(输入0-30的数字,0代表每天都要进行任务)
|
|
|
+ <el-input-number v-model="ruleForm.periodValue" controls-position="right" :min="0" :max="30"></el-input-number
|
|
|
+ >天进行(输入0-30的数字,0代表每天都要进行任务)
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="定位距离(m)">
|
|
@@ -133,12 +120,7 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="拍照/视频要求">
|
|
|
- <el-select
|
|
|
- class="width100"
|
|
|
- v-model="ruleForm.cameraSettings"
|
|
|
- placeholder="请选择拍照/视频要求"
|
|
|
- clearable
|
|
|
- >
|
|
|
+ <el-select class="width100" v-model="ruleForm.cameraSettings" placeholder="请选择拍照/视频要求" clearable>
|
|
|
<el-option label="是" :value="1"></el-option>
|
|
|
<el-option label="否" :value="0"></el-option>
|
|
|
</el-select>
|
|
@@ -212,11 +194,11 @@ export default {
|
|
|
methods: {
|
|
|
//保存
|
|
|
addEdit() {
|
|
|
- this.$refs.ruleForm.validate(valid => {
|
|
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
let url = '/sc-community/patrolRoute/add';
|
|
|
this.ruleForm;
|
|
|
- let dotArr = arr => {
|
|
|
+ let dotArr = (arr) => {
|
|
|
let dotObj = [];
|
|
|
arr.map((item, index) => {
|
|
|
dotObj.push({
|
|
@@ -266,6 +248,8 @@ export default {
|
|
|
this.$emit('initPage');
|
|
|
},
|
|
|
getPoint(id) {
|
|
|
+ this.ruleForm.routePointRelationDtos = [];
|
|
|
+ this.targetData = [];
|
|
|
this.$http.get('/sc-community/patrol/point/getPointList', { id, id }).then(({ data, status, msg }) => {
|
|
|
this.patrolArr = data;
|
|
|
});
|
|
@@ -290,6 +274,29 @@ export default {
|
|
|
});
|
|
|
this.ruleForm.timePeriod = TimeArr.join();
|
|
|
}
|
|
|
+ },
|
|
|
+ optionUp(nub, item) {
|
|
|
+ let thisArr = this.ruleForm.routePointRelationDtos;
|
|
|
+ let okArr = this.$refs.transferTude.targetData;
|
|
|
+ let newArr = [];
|
|
|
+ let inx = null;
|
|
|
+ thisArr.map((list, index) => {
|
|
|
+ if (list == item.id) {
|
|
|
+ inx = index;
|
|
|
+ }
|
|
|
+ return inx;
|
|
|
+ });
|
|
|
+ if (inx !== null && thisArr.length > 1) {
|
|
|
+ //向下
|
|
|
+ if (nub == 1 && inx < thisArr.length - 1) {
|
|
|
+ thisArr.splice(inx + 1, 1, ...thisArr.splice(inx, 1, thisArr[inx + 1]));
|
|
|
+ okArr.splice(inx + 1, 1, ...okArr.splice(inx, 1, okArr[inx + 1]));
|
|
|
+ } else if (nub != 1 && inx > 0) {
|
|
|
+ thisArr.splice(inx, 1, ...thisArr.splice(inx - 1, 1, thisArr[inx]));
|
|
|
+ okArr.splice(inx, 1, ...okArr.splice(inx - 1, 1, okArr[inx]));
|
|
|
+ }
|
|
|
+ this.targetData = okArr;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {}
|
|
@@ -344,4 +351,26 @@ export default {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
}
|
|
|
+/deep/ .el-transfer-panel__item.el-checkbox {
|
|
|
+ margin-right: 0;
|
|
|
+}
|
|
|
+.transferTudeClass {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ > div {
|
|
|
+ width: 60px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ }
|
|
|
+ .zoniot_font {
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/ .el-transfer-panel:first-child {
|
|
|
+ .transferTudeClass {
|
|
|
+ > div {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|