【类 型】:test
【原 因】:还原站点管理主页的代码 之前用此路由 此时视频流 的代码 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
8e5a6428e3
commit
178219ea08
@ -1,45 +1,141 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="app-container">
|
||||||
<video
|
<!-- 组合按钮 -->
|
||||||
ref="video"
|
<el-button-group>
|
||||||
autoplay
|
<el-button type="primary" icon="el-icon-plus" @click="$router.replace('/site/add')">添加</el-button>
|
||||||
controls
|
<el-button type="danger" icon="el-icon-delete" @click="deleteSite(countSelIdArr($refs.myTable.selection))">删除
|
||||||
playsinline
|
</el-button>
|
||||||
muted
|
<el-button type="warning" icon="el-icon-edit" @click="toEditPage()">编辑</el-button>
|
||||||
width="640"
|
</el-button-group>
|
||||||
height="360"
|
<!-- 用户select选项 -->
|
||||||
></video>
|
<el-button-group class="m-l-20">
|
||||||
|
<SelectionShopId v-model="form.shop_id" :allSel="true" />
|
||||||
|
</el-button-group>
|
||||||
|
<!-- 站点表格 -->
|
||||||
|
<el-table class="m-t-20 w-100" ref="myTable"
|
||||||
|
:data="siteListArr.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border tooltip-effect="dark">
|
||||||
|
<el-table-column align="center" type="selection" width="40">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="id" label="id" width="50">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="sitename" label="站点名称" width="120" min-width="100">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="菊花码缩率图" width="120" min-width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-image :src="scope.row.qr" :preview-src-list="[scope.row.qr]">
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="describe" label="站点描述" min-width="80" show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="已绑航线" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag class="iconfont"
|
||||||
|
:class="scope.row.bind_route === null || scope.row.bind_route === '' ? 'icon-ic_tingyong' : 'icon-feihangluxian'"
|
||||||
|
:type="scope.row.bind_route === null || scope.row.bind_route === '' ? 'danger' : ''">
|
||||||
|
<font class="m-l-5">{{ scope.row.bind_route === null || scope.row.bind_route === '' ? "未绑定" :
|
||||||
|
scope.row.bind_route }}</font>
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="controler" label="操作" width="140" min-width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button type="danger" icon="el-icon-delete" @click="deleteSite([scope.row.id])">删除</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination class="m-t-20" layout="prev, pager, next" :current-page.sync="currentPage" :page-size="pageSize"
|
||||||
|
:total="siteListArr.length">
|
||||||
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { countSelIdArr } from '@/utils'
|
||||||
|
import SelectionShopId from '@/components/SelectionShopId'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'Site',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
url: 'http://82.156.122.87:80/rtc/v1/whep/?app=live&stream=083AF27BB2D0',
|
pageSize: 8, // 每页显示记录条数
|
||||||
sdk: null
|
currentPage: 1, // 当前页
|
||||||
|
form: {
|
||||||
|
shop_id: ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
components: {
|
||||||
this.startPlay()
|
SelectionShopId
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
/**
|
||||||
|
* @description: 获取站点列表
|
||||||
|
*/
|
||||||
|
siteList () {
|
||||||
|
return this.$store.state.siteList
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description: 过滤掉 不对应客户的 站点列表
|
||||||
|
* @return: 站点列表
|
||||||
|
*/
|
||||||
|
siteListArr () {
|
||||||
|
if (this.form.shop_id !== '') {
|
||||||
|
return this.siteList.filter((item) => item.shop_id === this.form.shop_id)
|
||||||
|
} else {
|
||||||
|
return this.siteList
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async startPlay () {
|
countSelIdArr,
|
||||||
if (this.sdk) {
|
/**
|
||||||
this.sdk.close()
|
* @description: 跳转到编辑页面
|
||||||
this.sdk = null
|
*/
|
||||||
}
|
toEditPage () {
|
||||||
|
const selId = this.countSelIdArr(this.$refs.myTable.selection)
|
||||||
this.sdk = new window.SrsRtcWhipWhepAsync()
|
switch (selId.length) {
|
||||||
this.$refs.video.srcObject = this.sdk.stream
|
case 0:
|
||||||
|
this.$message.error('请选择一条需要编辑的记录')
|
||||||
try {
|
break
|
||||||
const session = await this.sdk.play(this.url)
|
case 1:
|
||||||
console.log('播放成功,session:', session)
|
this.$router.push('/site/edit/' + selId['0'])
|
||||||
} catch (e) {
|
break
|
||||||
console.error('播放失败', e)
|
default:
|
||||||
|
this.$message.error('只能选择一条记录')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* @description: 删除站点
|
||||||
|
*/
|
||||||
|
deleteSite (idArr) {
|
||||||
|
this.$store.dispatch('fetchDelSite', idArr)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
countSelIdArr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "@/styles/theme.scss";
|
||||||
|
|
||||||
|
.el-tag {
|
||||||
|
i {
|
||||||
|
vertical-align: middle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-placeholder {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user