From 3609d361118d75dd221959977bfac33a37815953 Mon Sep 17 00:00:00 2001
From: lawrencehj <1934378145@qq.com>
Date: 星期一, 15 三月 2021 15:24:41 +0800
Subject: [PATCH] 完成响应上级远程启动信令执行
---
web_src/src/components/videoList.vue | 107 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 65 insertions(+), 42 deletions(-)
diff --git a/web_src/src/components/videoList.vue b/web_src/src/components/videoList.vue
index 1ae78be..8a3f1c0 100644
--- a/web_src/src/components/videoList.vue
+++ b/web_src/src/components/videoList.vue
@@ -8,10 +8,10 @@
<div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">
<span style="font-size: 1rem; font-weight: bold;">璁惧鍒楄〃</span>
<div style="position: absolute; right: 1rem; top: 0.3rem;">
- <el-button icon="el-icon-refresh-right" circle size="mini" @click="getDeviceList()"></el-button>
+ <el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading" @click="getDeviceList()"></el-button>
</div>
</div>
- <devicePlayer ref="devicePlayer"></devicePlayer>
+ <!-- <devicePlayer ref="devicePlayer"></devicePlayer> -->
<!--璁惧鍒楄〃-->
<el-table :data="deviceList" border style="width: 100%" :height="winHeight">
<el-table-column prop="name" label="鍚嶇О" width="180" align="center">
@@ -21,7 +21,7 @@
<el-table-column label="鍦板潃" width="180" align="center">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
- <el-tag size="medium">{{ scope.row.host.address }}</el-tag>
+ <el-tag size="medium">{{ scope.row.hostAddress }}</el-tag>
</div>
</template>
</el-table-column>
@@ -29,18 +29,18 @@
</el-table-column>
<el-table-column prop="model" label="鍥轰欢鐗堟湰" align="center">
</el-table-column>
- <el-table-column label="閫氳鏂瑰紡" align="center">
+ <el-table-column label="娴佷紶杈撴ā寮�" align="center" width="160">
<template slot-scope="scope">
- <el-select @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="璇烽�夋嫨">
+ <el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="璇烽�夋嫨">
<el-option key="UDP" label="UDP" value="UDP"></el-option>
- <el-option key="TCP-ACTIVE" label="TCP涓诲姩妯″紡" value="TCP-ACTIVE"></el-option>
- <el-option key="TCP-PASSIVE" label="TCP琚姩妯″紡" :disabled="true" value="TCP-PASSIVE"></el-option>
+ <el-option key="TCP-ACTIVE" label="TCP涓诲姩妯″紡" :disabled="true" value="TCP-ACTIVE"></el-option>
+ <el-option key="TCP-PASSIVE" label="TCP琚姩妯″紡" value="TCP-PASSIVE"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="channelCount" label="閫氶亾鏁�" align="center">
</el-table-column>
- <el-table-column label="鐘舵��" width="180" align="center">
+ <el-table-column label="鐘舵��" width="80" align="center">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<el-tag size="medium" v-if="scope.row.online == 1">鍦ㄧ嚎</el-tag>
@@ -49,11 +49,15 @@
</template>
</el-table-column>
- <el-table-column label="鎿嶄綔" width="240" align="center" fixed="right">
+ <el-table-column label="鎿嶄綔" width="360" align="center" fixed="right">
<template slot-scope="scope">
- <el-button size="mini" icon="el-icon-refresh" @click="refDevice(scope.row)">鍒锋柊閫氶亾</el-button>
- <el-button size="mini" icon="el-icon-s-open" type="primary" @click="showChannelList(scope.row)">鏌ョ湅閫氶亾</el-button>
- </template>
+ <el-button size="mini" :ref="scope.row.deviceId + 'refbtn' " icon="el-icon-refresh" @click="refDevice(scope.row)">鍒锋柊</el-button>
+ <el-button-group>
+ <el-button size="mini" icon="el-icon-video-camera-solid" v-bind:disabled="scope.row.online==0" type="primary" @click="showChannelList(scope.row)">閫氶亾</el-button>
+ <el-button size="mini" icon="el-icon-location" v-bind:disabled="scope.row.online==0" type="primary" @click="showDevicePosition(scope.row)">瀹氫綅</el-button>
+ <el-button size="mini" icon="el-icon-s-tools" v-bind:disabled="scope.row.online==0" type="primary">鎺у埗</el-button>
+ </el-button-group>
+ </template>
</el-table-column>
</el-table>
<el-pagination
@@ -73,12 +77,10 @@
</template>
<script>
- import devicePlayer from './gb28181/devicePlayer.vue'
- import uiHeader from './UiHeader.vue'
+ import uiHeader from './UiHeader.vue'
export default {
name: 'app',
components: {
- devicePlayer,
uiHeader
},
data() {
@@ -92,7 +94,8 @@
winHeight: window.innerHeight - 200,
currentPage:1,
count:15,
- total:0
+ total:0,
+ getDeviceListLoading: false
};
},
computed: {
@@ -132,20 +135,23 @@
},
getDeviceList: function() {
let that = this;
-
+ this.getDeviceListLoading = true;
this.$axios.get(`/api/devices`,{
params: {
- page: that.currentPage - 1,
+ page: that.currentPage,
count: that.count
}
} )
.then(function (res) {
console.log(res);
+ console.log(res.data.list);
that.total = res.data.total;
- that.deviceList = res.data.data;
+ that.deviceList = res.data.list;
+ that.getDeviceListLoading = false;
})
.catch(function (error) {
console.log(error);
+ that.getDeviceListLoading = false;
});
},
@@ -153,50 +159,67 @@
console.log(JSON.stringify(row))
this.$router.push(`/channelList/${row.deviceId}/0/15/1`);
},
-
+ showDevicePosition: function(row) {
+ console.log(JSON.stringify(row))
+ this.$router.push(`/devicePosition/${row.deviceId}/0/15/1`);
+ },
//gb28181骞冲彴瀵规帴
//鍒锋柊璁惧淇℃伅
refDevice: function(itemData) {
///api/devices/{deviceId}/sync
console.log("鍒锋柊瀵瑰簲璁惧:" + itemData.deviceId);
+ var that = this;
+ that.$refs[itemData.deviceId + 'refbtn' ].loading = true;
this.$axios({
method: 'post',
url: '/api/devices/' + itemData.deviceId + '/sync'
}).then(function(res) {
- // console.log("鍒锋柊璁惧缁撴灉锛�"+JSON.stringify(res));
+ console.log("鍒锋柊璁惧缁撴灉锛�"+JSON.stringify(res));
+ if (!res.data.deviceId) {
+ that.$message({
+ showClose: true,
+ message: res.data,
+ type: 'error'
+ });
+ }else{
+ that.$message({
+ showClose: true,
+ message: '璇锋眰鎴愬姛',
+ type: 'success'
+ });
+ }
+ that.initData()
+ that.$refs[itemData.deviceId + 'refbtn' ].loading = false;
}).catch(function(e) {
- that.$message({
- showClose: true,
- message: '璇锋眰鎴愬姛',
- type: 'success'
- });
+ console.error(e)
+ that.$refs[itemData.deviceId + 'refbtn' ].loading = false;
});;
},
//閫氱煡璁惧涓婁紶濯掍綋娴�
sendDevicePush: function(itemData) {
- let deviceId = this.currentDevice.deviceId;
- let channelId = itemData.channelId;
- console.log("閫氱煡璁惧鎺ㄦ祦1锛�" + deviceId + " : " + channelId);
- let that = this;
- this.$axios({
- method: 'get',
- url: '/api/play/' + deviceId + '/' + channelId
- }).then(function(res) {
- let ssrc = res.data.ssrc;
- that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
- }).catch(function(e) {
- });
+ // let deviceId = this.currentDevice.deviceId;
+ // let channelId = itemData.channelId;
+ // console.log("閫氱煡璁惧鎺ㄦ祦1锛�" + deviceId + " : " + channelId);
+ // let that = this;
+ // this.$axios({
+ // method: 'get',
+ // url: '/api/play/' + deviceId + '/' + channelId
+ // }).then(function(res) {
+ // let ssrc = res.data.ssrc;
+ // that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
+ // }).catch(function(e) {
+ // });
},
transportChange: function (row) {
- console.log(`淇敼浼犺緭鏂瑰紡涓� ${row.transport}锛�${row.deviceId} `);
+ console.log(row);
+ console.log(`淇敼浼犺緭鏂瑰紡涓� ${row.streamMode}锛�${row.deviceId} `);
let that = this;
this.$axios({
method: 'get',
- url: '/api/devices/' + row.deviceId + '/transport/' + row.transport
+ url: '/api/devices/' + row.deviceId + '/transport/' + row.streamMode
}).then(function(res) {
- let ssrc = res.data.ssrc;
- that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
+
}).catch(function(e) {
});
}
--
Gitblit v1.8.0