feat: 新增国标收流通道列表查看
This commit is contained in:
@@ -118,6 +118,19 @@ export function queryChannels(deviceId, params) {
|
||||
})
|
||||
}
|
||||
|
||||
export function queryHasStreamChannels(params) {
|
||||
const {page, count, query} = params
|
||||
return request({
|
||||
method: 'get',
|
||||
url: `/api/device/query/streams`,
|
||||
params: {
|
||||
page: page,
|
||||
count: count,
|
||||
query: query
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function deviceRecord(params) {
|
||||
const { deviceId, channelId, recordCmdStr } = params
|
||||
return request({
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
import {
|
||||
add, changeChannelAudio,
|
||||
add,
|
||||
changeChannelAudio,
|
||||
deleteDevice,
|
||||
deviceRecord,
|
||||
queryBasicParam,
|
||||
queryChannelOne,
|
||||
queryChannels, queryChannelTree, queryDeviceOne,
|
||||
queryChannels,
|
||||
queryChannelTree,
|
||||
queryDeviceOne,
|
||||
queryDevices,
|
||||
queryDeviceSyncStatus, queryDeviceTree,
|
||||
queryDeviceSyncStatus,
|
||||
queryDeviceTree,
|
||||
queryHasStreamChannels,
|
||||
resetGuard,
|
||||
setGuard,
|
||||
subscribeCatalog,
|
||||
subscribeMobilePosition,
|
||||
sync, update, updateChannelStreamIdentification,
|
||||
sync,
|
||||
update,
|
||||
updateChannelStreamIdentification,
|
||||
updateDeviceTransport
|
||||
} from '@/api/device'
|
||||
|
||||
@@ -126,6 +133,16 @@ const actions = {
|
||||
})
|
||||
})
|
||||
},
|
||||
queryHasStreamChannels({commit}, params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
queryHasStreamChannels(params).then(response => {
|
||||
const {data} = response
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
deviceRecord({ commit }, params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
deviceRecord(params).then(response => {
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
<template>
|
||||
<div id="ConsoleNodeLoad" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
|
||||
<ve-histogram ref="consoleNodeLoad" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" :legend-visible="true" />
|
||||
<ve-histogram ref="consoleNodeLoad" :data="chartData" :extend="extend" :events="events" :settings="chartSettings"
|
||||
width="100%" height="100%" :legend-visible="true"/>
|
||||
|
||||
<HasStreamChannel ref="hasStreamChannel"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import veHistogram from 'v-charts/lib/histogram'
|
||||
import HasStreamChannel from "@/views/dialog/hasStreamChannel";
|
||||
|
||||
export default {
|
||||
name: 'ConsoleNodeLoad',
|
||||
components: {
|
||||
veHistogram
|
||||
veHistogram,
|
||||
HasStreamChannel
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -43,6 +47,9 @@ export default {
|
||||
show: true,
|
||||
position: 'top'
|
||||
}
|
||||
},
|
||||
events: {
|
||||
click: this.onClick
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -56,10 +63,14 @@ export default {
|
||||
destroyed() {
|
||||
},
|
||||
methods: {
|
||||
setData: function(data) {
|
||||
setData: function (data) {
|
||||
this.chartData.rows = data
|
||||
},
|
||||
onClick(v) {
|
||||
if (v.seriesName === "国标收流") {
|
||||
this.$refs.hasStreamChannel.openDialog();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
v-el-drag-dialog
|
||||
title="视频播放"
|
||||
top="0"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="showVideoDialog"
|
||||
@close="close()"
|
||||
|
||||
149
web/src/views/dialog/hasStreamChannel.vue
Normal file
149
web/src/views/dialog/hasStreamChannel.vue
Normal file
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
v-if="showDialog"
|
||||
v-el-drag-dialog
|
||||
:visible.sync="showDialog"
|
||||
title="国标收流列表"
|
||||
width="70%"
|
||||
top="5rem"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form :inline="true" size="mini" @submit.native.prevent>
|
||||
<el-form-item label="搜索">
|
||||
<el-input
|
||||
v-model="query"
|
||||
placeholder="关键字"
|
||||
prefix-icon="el-icon-search"
|
||||
clearable
|
||||
@input="getChannelList"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="channelList" :height="500" stripe>
|
||||
<el-table-column prop="parentDeviceId" label="设备编号" min-width="180"/>
|
||||
<el-table-column prop="parentName" label="设备名称" min-width="180"/>
|
||||
<el-table-column prop="deviceId" label="通道编号" min-width="180"/>
|
||||
<el-table-column prop="name" label="通道名称" min-width="180"/>
|
||||
<el-table-column prop="ptzType" label="云台类型" min-width="100">
|
||||
<template v-slot:default="scope">
|
||||
<div>{{ scope.row.ptzTypeText }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="120" fixed="right">
|
||||
<template v-slot:default="scope">
|
||||
<el-button
|
||||
size="medium"
|
||||
icon="el-icon-video-play"
|
||||
type="text"
|
||||
:loading="scope.row.playing"
|
||||
@click="sendDevicePush(scope.row)"
|
||||
>播放
|
||||
</el-button>
|
||||
<el-button
|
||||
size="medium"
|
||||
icon="el-icon-switch-button"
|
||||
type="text"
|
||||
style="color: #f56c6c"
|
||||
@click="stopDevicePush(scope.row)"
|
||||
>停止
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
style="margin-top: 10px; text-align: right"
|
||||
:current-page="currentPage"
|
||||
:page-size="count"
|
||||
:page-sizes="[15, 25, 35, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="currentChange"
|
||||
/>
|
||||
</el-dialog>
|
||||
|
||||
<devicePlayer ref="devicePlayer"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import devicePlayer from "@/views/dialog/devicePlayer";
|
||||
import elDragDialog from "@/directive/el-drag-dialog";
|
||||
|
||||
export default {
|
||||
name: "HasStreamChannel",
|
||||
directives: {elDragDialog},
|
||||
components: {devicePlayer},
|
||||
data() {
|
||||
return {
|
||||
showDialog: false,
|
||||
loading: false,
|
||||
playing: false,
|
||||
channelList: [],
|
||||
query: null,
|
||||
currentPage: 1,
|
||||
count: 15,
|
||||
total: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getChannelList()
|
||||
},
|
||||
methods: {
|
||||
openDialog: function () {
|
||||
this.showDialog = true;
|
||||
},
|
||||
getChannelList: function () {
|
||||
this.loading = true;
|
||||
this.$store.dispatch("device/queryHasStreamChannels", {
|
||||
page: this.currentPage,
|
||||
count: this.count,
|
||||
query: this.query
|
||||
}).then((data) => {
|
||||
this.total = data.total
|
||||
this.channelList = data.list
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
currentChange: function (val) {
|
||||
this.currentPage = val
|
||||
this.getChannelList()
|
||||
},
|
||||
handleSizeChange: function (val) {
|
||||
this.count = val
|
||||
this.getChannelList()
|
||||
},
|
||||
sendDevicePush: function (row) {
|
||||
const deviceId = row.parentDeviceId
|
||||
const channelId = row.deviceId
|
||||
row.playing = true
|
||||
this.$store.dispatch("play/play", [deviceId, channelId])
|
||||
.then((data) => {
|
||||
this.$refs.devicePlayer.openDialog("media", deviceId, channelId, {
|
||||
streamInfo: data,
|
||||
hasAudio: row.hasAudio
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
row.playing = false
|
||||
})
|
||||
},
|
||||
stopDevicePush: function (row) {
|
||||
this.$store.dispatch("play/stop", [row.parentDeviceId, row.deviceId]).then(_ => {
|
||||
this.getChannelList();
|
||||
}).catch((error) => {
|
||||
if (error.response.status === 402) {
|
||||
this.getChannelList();
|
||||
} else {
|
||||
this.$message.error({showClose: true, message: error})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user