|
@@ -7,13 +7,13 @@
|
|
|
<div class="add-inspection-task-content">
|
|
<div class="add-inspection-task-content">
|
|
|
<el-form ref="addTaskFormRef" :model="addTaskFrom" label-width="0.8rem" size="mini">
|
|
<el-form ref="addTaskFormRef" :model="addTaskFrom" label-width="0.8rem" size="mini">
|
|
|
<el-form-item label="任务名称">
|
|
<el-form-item label="任务名称">
|
|
|
- <el-input v-model="addTaskFrom.taskName" placeholder="请输入"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="addTaskFrom.securityPatrolName" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="任务内容">
|
|
<el-form-item label="任务内容">
|
|
|
- <el-input type="textarea" rows="4" v-model="addTaskFrom.taskContent" placeholder="请输入"></el-input>
|
|
|
|
|
|
|
+ <el-input type="textarea" rows="4" v-model="addTaskFrom.securityPatrolContext" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="巡查点">
|
|
<el-form-item label="巡查点">
|
|
|
- <div v-for="(item, index) in addTaskFrom.inspectionPoints" :key="index" class="ins-point">
|
|
|
|
|
|
|
+ <div v-for="(item, index) in addTaskFrom.inspectionPoint" :key="index" class="ins-point">
|
|
|
<el-select v-model="item.value" placeholder="请选择巡查点" :popper-append-to-body="false" popper-class="u-popper-select" @change="onPointSelect">
|
|
<el-select v-model="item.value" placeholder="请选择巡查点" :popper-append-to-body="false" popper-class="u-popper-select" @change="onPointSelect">
|
|
|
<el-option :label="opt.devName" :value="opt.deviceCode" v-for="opt in inspectionOptions" :key="opt.deviceCode"></el-option>
|
|
<el-option :label="opt.devName" :value="opt.deviceCode" v-for="opt in inspectionOptions" :key="opt.deviceCode"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
@@ -26,15 +26,14 @@
|
|
|
<span style="color: #fff"> min</span>
|
|
<span style="color: #fff"> min</span>
|
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
|
<el-form-item label="责任人">
|
|
<el-form-item label="责任人">
|
|
|
- <el-select v-model="addTaskFrom.person" placeholder="请选择责任人" style="width: 100%" :popper-append-to-body="false" popper-class="u-popper-select">
|
|
|
|
|
- <el-option label="区域一" value="shanghai"></el-option>
|
|
|
|
|
- <el-option label="区域二" value="beijing"></el-option>
|
|
|
|
|
|
|
+ <el-select v-model="addTaskFrom.responsiblePerson" placeholder="请选择责任人" style="width: 100%" :popper-append-to-body="false" popper-class="u-popper-select">
|
|
|
|
|
+ <el-option :label="p.name" :value="p.name" v-for="(p,i) in personList" :key="i"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<div style="display: flex; justify-content: flex-end; margin-top: 0.22rem">
|
|
<div style="display: flex; justify-content: flex-end; margin-top: 0.22rem">
|
|
|
- <el-button size="mini" plain @click="visible = false">取消</el-button>
|
|
|
|
|
- <el-button size="mini" type="primary">保存</el-button>
|
|
|
|
|
|
|
+ <el-button size="mini" plain @click="visible = false" class="cancelBtn">取消</el-button>
|
|
|
|
|
+ <el-button size="mini" type="primary" @click="toSave">保存</el-button>
|
|
|
<el-button size="mini" type="primary" @click="startInspection">开始巡查</el-button>
|
|
<el-button size="mini" type="primary" @click="startInspection">开始巡查</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -47,7 +46,7 @@
|
|
|
import 'mars3d/mars3d.css'
|
|
import 'mars3d/mars3d.css'
|
|
|
import * as mars3d from 'mars3d'
|
|
import * as mars3d from 'mars3d'
|
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
|
-import { getVideoRealtimeUrl } from '@/api/largeScreenApi'
|
|
|
|
|
|
|
+import { toAddSecurityPatrol } from '@/api/securityPatrolApi'
|
|
|
// 为了方便使用,绑定到原型链,在其他vue文件,直接this.mars3d 来使用
|
|
// 为了方便使用,绑定到原型链,在其他vue文件,直接this.mars3d 来使用
|
|
|
Vue.prototype.mars3d = mars3d
|
|
Vue.prototype.mars3d = mars3d
|
|
|
Vue.prototype.Cesium = mars3d.Cesium
|
|
Vue.prototype.Cesium = mars3d.Cesium
|
|
@@ -58,12 +57,22 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
visible: false,
|
|
visible: false,
|
|
|
addTaskFrom: {
|
|
addTaskFrom: {
|
|
|
- taskName: '',
|
|
|
|
|
- taskContent: '',
|
|
|
|
|
- inspectionPoints: [{ value: '' }],
|
|
|
|
|
- // taskDuration: '',
|
|
|
|
|
- person: ''
|
|
|
|
|
|
|
+ securityPatrolName: '',
|
|
|
|
|
+ securityPatrolContext: '',
|
|
|
|
|
+ inspectionPoint: [{ value: '' }],
|
|
|
|
|
+ responsiblePerson: ''
|
|
|
},
|
|
},
|
|
|
|
|
+ personList:[
|
|
|
|
|
+ {
|
|
|
|
|
+ name:'杨英'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name:'马刚'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name:'谢智宇'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
inspectionOptions: [
|
|
inspectionOptions: [
|
|
|
{
|
|
{
|
|
|
latitude: '28.189249',
|
|
latitude: '28.189249',
|
|
@@ -87,7 +96,13 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
- this.$globalEventBus.$on('clcikAddTask', (data) => {
|
|
|
|
|
|
|
+ this.$globalEventBus.$on('clcikAddTask', () => {
|
|
|
|
|
+ this.addTaskFrom={
|
|
|
|
|
+ securityPatrolName: '',
|
|
|
|
|
+ securityPatrolContext: '',
|
|
|
|
|
+ inspectionPoint: [{ value: '' }],
|
|
|
|
|
+ responsiblePerson: ''
|
|
|
|
|
+ }
|
|
|
this.visible = true
|
|
this.visible = true
|
|
|
this.addInitialPoints()
|
|
this.addInitialPoints()
|
|
|
})
|
|
})
|
|
@@ -97,23 +112,34 @@ export default {
|
|
|
this.stopPatrol()
|
|
this.stopPatrol()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ toSave(){
|
|
|
|
|
+ toAddSecurityPatrol(this.addTaskFrom).then((res)=>{
|
|
|
|
|
+ if(res.data){
|
|
|
|
|
+ this.$message.success('添加成功')
|
|
|
|
|
+ // this.$globalEventBus.$emit('refreshInspectList')
|
|
|
|
|
+ this.visible = false
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$message.error('添加失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
onPointSelect(a) {
|
|
onPointSelect(a) {
|
|
|
const obj = this.inspectionOptions.filter((item) => item.deviceCode == a)
|
|
const obj = this.inspectionOptions.filter((item) => item.deviceCode == a)
|
|
|
- this.addTaskFrom.inspectionPoints.map((point) => {
|
|
|
|
|
|
|
+ this.addTaskFrom.inspectionPoint.map((point) => {
|
|
|
if (point.value == a) {
|
|
if (point.value == a) {
|
|
|
Object.assign(point, obj[0])
|
|
Object.assign(point, obj[0])
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
startInspection() {
|
|
startInspection() {
|
|
|
- if (this.addTaskFrom.inspectionPoints === 0) {
|
|
|
|
|
|
|
+ if (this.addTaskFrom.inspectionPoint === 0) {
|
|
|
this.$message.warning('请先添加至少一个巡查点')
|
|
this.$message.warning('请先添加至少一个巡查点')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- this.addTaskFrom.inspectionPoints.forEach((item, index) => {
|
|
|
|
|
|
|
+ this.addTaskFrom.inspectionPoint.forEach((item, index) => {
|
|
|
this.fetchUrl(item).then((res) => {
|
|
this.fetchUrl(item).then((res) => {
|
|
|
const url = res.data.streamUrl
|
|
const url = res.data.streamUrl
|
|
|
- this.$set(this.addTaskFrom.inspectionPoints[index], 'url', url)
|
|
|
|
|
|
|
+ this.$set(this.addTaskFrom.inspectionPoint[index], 'url', url)
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
this.isPatrolling = true
|
|
this.isPatrolling = true
|
|
@@ -146,14 +172,14 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 切换到下一个巡查点
|
|
// 切换到下一个巡查点
|
|
|
goToNextPatrolPoint() {
|
|
goToNextPatrolPoint() {
|
|
|
- if (this.currentPatrolIndex >= this.addTaskFrom.inspectionPoints.length) {
|
|
|
|
|
|
|
+ if (this.currentPatrolIndex >= this.addTaskFrom.inspectionPoint.length) {
|
|
|
this.stopPatrol()
|
|
this.stopPatrol()
|
|
|
this.$globalEventBus.$emit('clickVideoPlay', { visible: false })
|
|
this.$globalEventBus.$emit('clickVideoPlay', { visible: false })
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.$globalEventBus.$emit('clickVideoPlay', { visible: false })
|
|
this.$globalEventBus.$emit('clickVideoPlay', { visible: false })
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
- const point = this.addTaskFrom.inspectionPoints[this.currentPatrolIndex]
|
|
|
|
|
|
|
+ const point = this.addTaskFrom.inspectionPoint[this.currentPatrolIndex]
|
|
|
this.flyToPoint(point)
|
|
this.flyToPoint(point)
|
|
|
// 播放视频
|
|
// 播放视频
|
|
|
this.playVideo(point)
|
|
this.playVideo(point)
|
|
@@ -212,17 +238,17 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
isLastItem(index) {
|
|
isLastItem(index) {
|
|
|
- return index === this.addTaskFrom.inspectionPoints.length - 1
|
|
|
|
|
|
|
+ return index === this.addTaskFrom.inspectionPoint.length - 1
|
|
|
},
|
|
},
|
|
|
isFirstItem() {
|
|
isFirstItem() {
|
|
|
- return this.addTaskFrom.inspectionPoints.length > 1
|
|
|
|
|
|
|
+ return this.addTaskFrom.inspectionPoint.length > 1
|
|
|
},
|
|
},
|
|
|
addOption() {
|
|
addOption() {
|
|
|
- this.addTaskFrom.inspectionPoints.push({ value: '' })
|
|
|
|
|
|
|
+ this.addTaskFrom.inspectionPoint.push({ value: '' })
|
|
|
},
|
|
},
|
|
|
removeOption(index) {
|
|
removeOption(index) {
|
|
|
- if (this.addTaskFrom.inspectionPoints.length > 1) {
|
|
|
|
|
- this.addTaskFrom.inspectionPoints.splice(index, 1)
|
|
|
|
|
|
|
+ if (this.addTaskFrom.inspectionPoint.length > 1) {
|
|
|
|
|
+ this.addTaskFrom.inspectionPoint.splice(index, 1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -252,8 +278,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.add-inspection-task-content {
|
|
.add-inspection-task-content {
|
|
|
- padding: px-to-rem(10);
|
|
|
|
|
- min-height: px-to-rem(465);
|
|
|
|
|
|
|
+ padding: px-to-rem(20);
|
|
|
|
|
+ min-height: px-to-rem(407);
|
|
|
background: rgb(35, 61, 108, 0.8);
|
|
background: rgb(35, 61, 108, 0.8);
|
|
|
:deep(.el-form) {
|
|
:deep(.el-form) {
|
|
|
.el-button {
|
|
.el-button {
|
|
@@ -281,6 +307,16 @@ export default {
|
|
|
.ins-point:last-child {
|
|
.ins-point:last-child {
|
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+ :deep(.el-button){
|
|
|
|
|
+ line-height:initial;
|
|
|
|
|
+ background:rgba(79,159,255,0.8);
|
|
|
|
|
+ padding:px-to-rem(3) px-to-rem(7);
|
|
|
|
|
+ }
|
|
|
|
|
+ .cancelBtn{
|
|
|
|
|
+ border: 1px solid #4F9FFF;
|
|
|
|
|
+ color:#FFF;
|
|
|
|
|
+ background-color:transparent;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|