|
@@ -29,7 +29,7 @@
|
|
|
<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="closeModal" class="cancelBtn">取消</el-button>
|
|
<el-button size="mini" plain @click="closeModal" class="cancelBtn">取消</el-button>
|
|
|
- <el-button size="mini" type="primary" @click="toSave">保存</el-button>
|
|
|
|
|
|
|
+ <el-button size="mini" type="primary" @click="toSave" v-loading="saveLoading">保存</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>
|
|
@@ -49,6 +49,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ saveLoading:false,
|
|
|
addTaskFrom: {
|
|
addTaskFrom: {
|
|
|
securityPatrolName: '',
|
|
securityPatrolName: '',
|
|
|
securityPatrolContext: '',
|
|
securityPatrolContext: '',
|
|
@@ -94,6 +95,7 @@ export default {
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.$globalEventBus.$on('closeVideoPlayAdd', () => {
|
|
this.$globalEventBus.$on('closeVideoPlayAdd', () => {
|
|
|
this.stopPatrol()
|
|
this.stopPatrol()
|
|
|
|
|
+ this.$emit('getSecurityPatrolList')
|
|
|
})
|
|
})
|
|
|
this.$globalEventBus.$on('toPlayNextVideoAdd', () => {
|
|
this.$globalEventBus.$on('toPlayNextVideoAdd', () => {
|
|
|
this.goToNextPatrolPoint()
|
|
this.goToNextPatrolPoint()
|
|
@@ -139,7 +141,9 @@ export default {
|
|
|
toSave() {
|
|
toSave() {
|
|
|
this.$refs.addTaskFormRef.validate((valid) => {
|
|
this.$refs.addTaskFormRef.validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ this.saveLoading = true
|
|
|
toAddSecurityPatrol(this.addTaskFrom).then((res) => {
|
|
toAddSecurityPatrol(this.addTaskFrom).then((res) => {
|
|
|
|
|
+ this.saveLoading = false
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
this.$message.success('添加成功')
|
|
this.$message.success('添加成功')
|
|
|
this.closeModal()
|
|
this.closeModal()
|
|
@@ -170,20 +174,6 @@ export default {
|
|
|
this.$message.warning('请先添加至少一个巡查点')
|
|
this.$message.warning('请先添加至少一个巡查点')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- this.addTaskFrom.inspectionPoint.forEach((item, index) => {
|
|
|
|
|
- this.fetchUrl(item).then((res) => {
|
|
|
|
|
- let url = ''
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- url = res.data.streamUrl
|
|
|
|
|
- } else if (res.code == 400) {
|
|
|
|
|
- this.$message.error(res.msg)
|
|
|
|
|
- } else if (res.code == 4001) {
|
|
|
|
|
- this.$message.warning('设备离线')
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- this.$set(this.addTaskFrom.inspectionPoint[index], 'url', url)
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
this.isPatrolling = true
|
|
this.isPatrolling = true
|
|
|
this.currentPatrolIndex = 0
|
|
this.currentPatrolIndex = 0
|
|
|
this.goToNextPatrolPoint()
|
|
this.goToNextPatrolPoint()
|
|
@@ -232,8 +222,14 @@ export default {
|
|
|
this.currentPatrolIndex++
|
|
this.currentPatrolIndex++
|
|
|
},
|
|
},
|
|
|
playVideo(point) {
|
|
playVideo(point) {
|
|
|
- console.info(point)
|
|
|
|
|
- this.$globalEventBus.$emit('clickVideoPlay', { point: point, visible: true, type: 'add' })
|
|
|
|
|
|
|
+ this.fetchUrl(point).then((res) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ point.url = res.data.streamUrl
|
|
|
|
|
+ this.$globalEventBus.$emit('clickVideoPlay', { point: point, visible: true, type: 'add' })
|
|
|
|
|
+ } else if (res.code == 4001) {
|
|
|
|
|
+ this.$message.warning('设备离线')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
stopPatrol() {
|
|
stopPatrol() {
|
|
|
this.isPatrolling = false
|
|
this.isPatrolling = false
|