From 27a2394115286ed3fce465943d6c8f95cf088769 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: 星期一, 19 十月 2020 20:30:59 +0800 Subject: [PATCH] 修正启动提示错误(UDP误为TCP) --- web_src/src/components/channelList.vue | 56 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 49 insertions(+), 7 deletions(-) diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index 7a1e0e2..8e6638a 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"> @@ -45,11 +54,15 @@ </el-table-column> <el-table-column prop="ptztypeText" label="浜戝彴绫诲瀷"> </el-table-column> - <el-table-column label="鎿嶄綔" width="240" align="center" fixed="right"> + <el-table-column label="鎿嶄綔" width="280" 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-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> --> + <el-button-group> + <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" icon="el-icon-video-camera" type="primary" >璁惧褰曡薄</el-button>--> + <!-- <el-button size="mini" @click="sendDevicePush(scope.row)">褰曞儚鏌ヨ</el-button> --> + </el-button-group> </template> </el-table-column> </el-table> @@ -189,10 +202,11 @@ message: '璇锋眰鎴愬姛', type: 'success' }); - });; + }); }, //閫氱煡璁惧涓婁紶濯掍綋娴� sendDevicePush: function(itemData) { + console.log(itemData) let deviceId = this.deviceId; this.isLoging = true; let channelId = itemData.channelId; @@ -202,12 +216,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 +288,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