From 4d9a62339d43e163c3615a52b72a3c3f01cc30ab Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 16 十月 2020 16:49:41 +0800 Subject: [PATCH] 去除lombok框架 添加流传输模式udp/tcp被动支持 --- web_src/src/components/channelList.vue | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 43 insertions(+), 4 deletions(-) diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index 7a1e0e2..b3980c3 100644 --- a/web_src/src/components/channelList.vue +++ b/web_src/src/components/channelList.vue @@ -31,10 +31,19 @@ <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" border style="width: 100%"> <el-table-column prop="channelId" label="閫氶亾缂栧彿" width="210"> </el-table-column> - <el-table-column prop="name" label="閫氶亾鍚嶇О" width="500"> + <el-table-column prop="name" label="閫氶亾鍚嶇О"> </el-table-column> <el-table-column prop="subCount" label="瀛愯妭鐐规暟"> </el-table-column> + <el-table-column label="寮�鍚煶棰�" align="center"> + <template slot-scope="scope"> + <el-switch + @change="updateChannel(scope.row)" + v-model="scope.row.hasAudio" + active-color="#409EFF"> + </el-switch> + </template> + </el-table-column> <el-table-column label="鐘舵��" width="180" align="center"> <template slot-scope="scope"> <div slot="reference" class="name-wrapper"> @@ -47,7 +56,8 @@ </el-table-column> <el-table-column label="鎿嶄綔" width="240" align="center" fixed="right"> <template slot-scope="scope"> - <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">棰勮瑙嗛</el-button> + <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">鎾斁</el-button> + <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="scope.row.play" @click="stopDevicePush(scope.row)">鍋滄</el-button> <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.parental == 1" @click="changeSubchannel(scope.row)">鏌ョ湅瀛愮洰褰�</el-button> <!-- <el-button size="mini" @click="sendDevicePush(scope.row)">褰曞儚鏌ヨ</el-button> --> </template> @@ -189,10 +199,11 @@ message: '璇锋眰鎴愬姛', type: 'success' }); - });; + }); }, //閫氱煡璁惧涓婁紶濯掍綋娴� sendDevicePush: function(itemData) { + console.log(itemData) let deviceId = this.deviceId; this.isLoging = true; let channelId = itemData.channelId; @@ -202,12 +213,30 @@ method: 'get', url: '/api/play/' + deviceId + '/' + channelId }).then(function(res) { + console.log(res.data) let ssrc = res.data.ssrc; that.isLoging = false - that.$refs.devicePlayer.play(res.data,deviceId,channelId); + if (!!ssrc) { + that.$refs.devicePlayer.play(res.data,deviceId,channelId,itemData.hasAudio); + that.initData(); + }else { + that.$message.error(res.data); + } }).catch(function(e) { }); }, + stopDevicePush: function(itemData) { + console.log(itemData) + var that = this; + this.$axios({ + method: 'post', + url: '/api/play/' + itemData.ssrc + '/stop' + }).then(function(res) { + console.log(JSON.stringify(res)); + that.initData(); + }); + }, + showDevice: function(){ this.$router.push(this.beforeUrl).then(()=>{ this.initParam(); @@ -256,6 +285,16 @@ this.currentPage = 1; this.total = 0; this.initData(); + }, + updateChannel: function(row) { + console.log(row) + this.$axios({ + method: 'post', + url: `/api/channel/update/${this.deviceId}`, + params: row + }).then(function(res) { + console.log(JSON.stringify(res)); + }); } } -- Gitblit v1.8.0