页面增加录像控制(开始/停止)

pull/1669/head
648540858 2024-10-28 11:03:51 +08:00
parent a9c3b58642
commit 4b6a4e690d
2 changed files with 64 additions and 3 deletions

View File

@ -347,7 +347,7 @@ export default {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success({ this.$message.success({
showClose: true, showClose: true,
message: "布防命令已发送" message: "布防成功"
}) })
}else { }else {
this.$message.error({ this.$message.error({
@ -370,7 +370,7 @@ export default {
if (res.data.code === 0) { if (res.data.code === 0) {
this.$message.success({ this.$message.success({
showClose: true, showClose: true,
message: "撤防命令已发送" message: "撤防成功"
}) })
}else { }else {
this.$message.error({ this.$message.error({

View File

@ -139,14 +139,19 @@
<el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1 || scope.row.deviceId.length <= 8" direction="vertical"></el-divider> <el-divider v-if="scope.row.subCount > 0 || scope.row.parental === 1 || scope.row.deviceId.length <= 8" direction="vertical"></el-divider>
<el-dropdown @command="(command)=>{moreClick(command, scope.row)}"> <el-dropdown @command="(command)=>{moreClick(command, scope.row)}">
<el-button size="medium" type="text" > <el-button size="medium" type="text" >
更多功能<i class="el-icon-arrow-down el-icon--right"></i> 更多<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="records" v-bind:disabled="device == null || device.online === 0"> <el-dropdown-item command="records" v-bind:disabled="device == null || device.online === 0">
设备录像</el-dropdown-item> 设备录像</el-dropdown-item>
<el-dropdown-item command="cloudRecords" v-bind:disabled="device == null || device.online === 0" > <el-dropdown-item command="cloudRecords" v-bind:disabled="device == null || device.online === 0" >
云端录像</el-dropdown-item> 云端录像</el-dropdown-item>
<el-dropdown-item command="record" v-bind:disabled="device == null || device.online === 0" >
设备录像控制-开始</el-dropdown-item>
<el-dropdown-item command="stopRecord" v-bind:disabled="device == null || device.online === 0" >
设备录像控制-停止</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
@ -338,6 +343,10 @@ export default {
this.queryRecords(itemData) this.queryRecords(itemData)
}else if (command === "cloudRecords") { }else if (command === "cloudRecords") {
this.queryCloudRecords(itemData) this.queryCloudRecords(itemData)
}else if (command === "record") {
this.startRecord(itemData)
}else if (command === "stopRecord") {
this.stopRecord(itemData)
} }
}, },
queryRecords: function (itemData) { queryRecords: function (itemData) {
@ -352,6 +361,58 @@ export default {
this.$router.push(`/cloudRecordDetail/rtp/${deviceId}_${channelId}`) this.$router.push(`/cloudRecordDetail/rtp/${deviceId}_${channelId}`)
}, },
startRecord: function (itemData) {
this.$axios({
method: 'get',
url: `/api/device/control/record/${this.deviceId}/Record`,
params: {
channelId: itemData.deviceId
}
}).then( (res)=> {
if (res.data.code === 0) {
this.$message.success({
showClose: true,
message: "开始录像成功"
})
}else {
this.$message.error({
showClose: true,
message: res.data.msg
})
}
}).catch( (error)=> {
this.$message.error({
showClose: true,
message: error.message
})
});
},
stopRecord: function (itemData) {
this.$axios({
method: 'get',
url: `/api/device/control/record/${this.deviceId}/StopRecord`,
params: {
channelId: itemData.deviceId
}
}).then( (res)=> {
if (res.data.code === 0) {
this.$message.success({
showClose: true,
message: "停止录像成功"
})
}else {
this.$message.error({
showClose: true,
message: res.data.msg
})
}
}).catch( (error)=> {
this.$message.error({
showClose: true,
message: error.message
})
});
},
stopDevicePush: function (itemData) { stopDevicePush: function (itemData) {
var that = this; var that = this;
this.$axios({ this.$axios({