|
|
@@ -15,7 +15,18 @@
|
|
|
<el-form-item label="巡查点" prop="inspectionPoint">
|
|
|
<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-option :label="opt.devName" :value="opt.deviceCode" :disabled="opt.disabled" v-for="(opt,i) in inspectionOptions" :key="i"></el-option>
|
|
|
+ <el-option :label="opt.devName" :value="opt.deviceCode" :disabled="opt.disabled" v-for="(opt, i) in inspectionOptions" :key="i"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="item.preset"
|
|
|
+ placeholder="请选择预置点位"
|
|
|
+ multiple
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ collapse-tags
|
|
|
+ value-key="presetId"
|
|
|
+ popper-class="u-popper-select"
|
|
|
+ >
|
|
|
+ <el-option :label="p.presetName" :value="p" v-for="p in presetList" :key="p.presetId"></el-option>
|
|
|
</el-select>
|
|
|
<img src="@/assets/image/safety-inspection/del.png" alt="" @click="removeOption(index)" v-if="isFirstItem()" />
|
|
|
<img src="@/assets/image/safety-inspection/add.png" alt="" v-if="isLastItem(index)" @click="addOption" />
|
|
|
@@ -40,6 +51,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { toAddSecurityPatrol, endPatrol, startPatrol } from '@/api/securityPatrolApi'
|
|
|
+import { queryPresetList,getVideoRealtimeUrl,doControlPreset } from '@/api/largeScreenApi'
|
|
|
import moment from 'moment'
|
|
|
export default {
|
|
|
name: 'addInspectionTask',
|
|
|
@@ -49,11 +61,12 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- saveLoading:false,
|
|
|
+ saveLoading: false,
|
|
|
+ presetList: [],
|
|
|
addTaskFrom: {
|
|
|
securityPatrolName: '',
|
|
|
securityPatrolContext: '',
|
|
|
- inspectionPoint: [{ value: '' }],
|
|
|
+ inspectionPoint: [{ value: '' ,preset: []}],
|
|
|
responsiblePerson: ''
|
|
|
},
|
|
|
rules: {
|
|
|
@@ -161,6 +174,14 @@ export default {
|
|
|
Object.assign(point, obj[0])
|
|
|
}
|
|
|
})
|
|
|
+ const currentItem = this.addTaskFrom.inspectionPoint.find(item => item.value === a);
|
|
|
+ if (currentItem) {
|
|
|
+ currentItem.preset = []; // 清空预置位选择
|
|
|
+ }
|
|
|
+ this.presetList = []
|
|
|
+ queryPresetList({ deviceCode: obj[0].deviceCode, channelCode: obj[0].channelCode }).then((res) => {
|
|
|
+ this.presetList = res.data
|
|
|
+ })
|
|
|
},
|
|
|
startInspection() {
|
|
|
this.$refs.addTaskFormRef.validate((valid) => {
|
|
|
@@ -187,22 +208,15 @@ export default {
|
|
|
},
|
|
|
fetchUrl(item) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- window
|
|
|
- .requestSDK(
|
|
|
- '/ttvideo/video/player/getVideoRealtimeUrl',
|
|
|
- {
|
|
|
+ getVideoRealtimeUrl({
|
|
|
deviceCode: item.deviceCode,
|
|
|
channelCode: item.channelCode,
|
|
|
netType: 2,
|
|
|
- protocolType: 9,
|
|
|
+ protocolType:9,
|
|
|
streamType: 1
|
|
|
- },
|
|
|
- {},
|
|
|
- 'post'
|
|
|
- )
|
|
|
- .then(async (res) => {
|
|
|
- resolve(res)
|
|
|
- })
|
|
|
+ }).then(async(res)=>{
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
// 切换到下一个巡查点
|
|
|
@@ -212,7 +226,6 @@ export default {
|
|
|
this.stopPatrol()
|
|
|
this.$globalEventBus.$emit('clickVideoInspectPlay', { visible: false, type: 'add' })
|
|
|
endPatrol({ id: this.xcId, endTime: endTime, startTime: this.currentTime }).then((res) => {
|
|
|
- console.log("巡查结束:"+res)
|
|
|
this.$emit('refreshData')
|
|
|
})
|
|
|
return
|
|
|
@@ -226,12 +239,17 @@ export default {
|
|
|
playVideo(point) {
|
|
|
this.fetchUrl(point).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- point.url = res.data.streamUrl
|
|
|
- this.addTaskFrom.countPatrolPoints = this.addTaskFrom.inspectionPoint.length
|
|
|
- this.$globalEventBus.$emit('clickVideoInspectPlay', {taskInfo:this.addTaskFrom, point: point, visible: true, type: 'add' })
|
|
|
- } else if (res.code == 4001) {
|
|
|
- this.$message.warning(JSON.parse(res.msg).resultMsg)
|
|
|
- }
|
|
|
+ point.url = res.data.streamUrl
|
|
|
+ this.addTaskFrom.countPatrolPoints = this.addTaskFrom.inspectionPoint.length
|
|
|
+ doControlPreset({ deviceCode: point.deviceCode, channelCode: point.channelCode, presetId: point.preset[0].presetId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$globalEventBus.$emit('clickVideoInspectPlay', { taskInfo: this.addTaskFrom, point: point, visible: true, type: 'add' })
|
|
|
+ } else if (res.code == 4001) {
|
|
|
+ this.$message.warning(JSON.parse(res.msg).resultMsg)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
stopPatrol() {
|
|
|
@@ -252,7 +270,7 @@ export default {
|
|
|
return this.addTaskFrom.inspectionPoint.length > 1
|
|
|
},
|
|
|
addOption() {
|
|
|
- this.addTaskFrom.inspectionPoint.push({ value: '' })
|
|
|
+ this.addTaskFrom.inspectionPoint.push({ value: '' ,preset: []})
|
|
|
},
|
|
|
removeOption(index) {
|
|
|
if (this.addTaskFrom.inspectionPoint.length > 1) {
|
|
|
@@ -316,6 +334,23 @@ export default {
|
|
|
align-items: center;
|
|
|
gap: px-to-rem(5);
|
|
|
margin-bottom: px-to-rem(20);
|
|
|
+ :deep(.el-tag.el-tag--info) {
|
|
|
+ background: #4f9fff;
|
|
|
+ color: #fff;
|
|
|
+ border-color: #4f9fff;
|
|
|
+ border-radius: px-to-rem(2);
|
|
|
+ }
|
|
|
+ :deep(.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover) {
|
|
|
+ background-color: #4f9fff;
|
|
|
+ }
|
|
|
+ :deep(.el-select-dropdown.is-multiple .el-select-dropdown__item.selected) {
|
|
|
+ background-color: #4f9fff;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ :deep(.el-tag.el-tag--info .el-tag__close) {
|
|
|
+ background-color: #fff;
|
|
|
+ color: #4f9fff;
|
|
|
+ }
|
|
|
}
|
|
|
.ins-point:last-child {
|
|
|
margin-bottom: 0;
|