Commit fb24907a by 杨明

fixed

1 parent 1e938621
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-24 16:20:21
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-25 09:32:28
* @LastEditTime: 2022-11-29 10:23:34
* @FilePath: \live\src\api\modules\console.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -27,6 +27,16 @@ const detailexport = params => {
sign: true
})
}
//流量数据-详情列表导出
const consoleExport = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.export`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//流量数据-详情列表查询(分页)
const detailpage = params => {
params.method = `scrm.api.shopmall.livebroadcast.console.detailpage`
......@@ -62,5 +72,6 @@ export default {
consolePage,
consoleInfo,
detailpage,
detailexport
detailexport,
consoleExport
}
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-28 10:12:36
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-28 10:25:09
* @FilePath: \live\src\components\big-view\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 11:06:49
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-29 10:19:37
* @FilePath: \live\src\setup\qiankun.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import Vue from 'vue'
import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
......@@ -19,7 +27,7 @@ export async function bootstrap({ history, common, messenger, globalState }) {
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: 'scrm-base-f90349f8-701a-47a4-858c-85792bb91e09-rop' } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-23 11:06:49
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-25 13:48:47
* @LastEditTime: 2022-11-28 11:18:50
* @FilePath: \live\src\utils\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -38,3 +38,21 @@ export function downloadUrl(url) {
link.click()
document.body.removeChild(link)
}
export function GetDateDiff(time1, time2 = new Date()) {
let startTime = new Date(time1) //开始时间
let endTime = time2 //结束时间
let date = endTime.getTime() - startTime.getTime() //时间差秒
//计算出相差天数
let days = Math.floor(date / (24 * 3600 * 1000))
//计算出小时数
let leave1 = date % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
let hours = Math.floor(leave1 / (3600 * 1000))
//计算相差分钟数
let leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数
let minutes = Math.floor(leave2 / (60 * 1000)) //计算相差秒数
let leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数
let seconds = Math.round(leave3 / 1000)
return days + '天' + hours + '时' + minutes + '分' + seconds + '秒'
}
......@@ -3,8 +3,12 @@
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<div class="live-table-header">
<h2>短视频列表</h2>
<el-button :size="size" type="primary" class="el-icon-plus" @click="detailexport">导出</el-button>
<h2>
已累计
<label>{{ roomNum }}</label>
人观看
</h2>
<el-button :size="size" type="primary" plain @click="detailexport">导出</el-button>
</div>
<GLTable ref="classifyRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="status" slot-scope="scope">
......@@ -20,14 +24,18 @@ import url from '@/assets/empty.png'
import { downloadUrl } from '@/utils'
export default {
name: 'LiveIndex',
props: {
visitSource: String,
roomNum: Number
},
data() {
return {
size: 'small',
url: url,
searchForm: {
term: '',
status: ''
nickname: '',
phone: '',
visitSource: ''
},
tableSearchForm: {},
// 搜索
......@@ -52,7 +60,7 @@ export default {
}
],
// 表格
getListApi: this.$apis.live.getListApi,
getListApi: this.$apis.console.detailpage,
tableParams: {
listName: 'list',
tableColumns: [
......@@ -74,18 +82,16 @@ export default {
},
{
label: '是否观看',
prop: 'status',
addHtml: 'status'
prop: 'status'
},
{
label: '观看时长',
prop: 'visitDuration',
addHtml: 'status'
prop: 'visitDuration'
},
{
label: '最后浏览',
prop: 'lastVisitTime',
addHtml: 'status'
width: 200
}
]
},
......@@ -97,12 +103,18 @@ export default {
methods: {
detailexport() {
this.$apis.console.detailexport({}).then(res => {
downloadUrl(res)
const getParams = Object.assign(this.getParams(), {
pageSize: 1000000,
currentPage: 1
})
this.$apis.console.detailexport(getParams).then(res => {
res && downloadUrl(res)
})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.id = this.$route.query.id
params.visitSource = this.visitSource
return params
},
beforeSearchFn() {
......@@ -121,10 +133,7 @@ export default {
},
handleReset() {
this.searchForm = {
classifyName: '',
createDate: []
}
this.searchForm = {}
this.handleSearch()
}
}
......@@ -141,7 +150,13 @@ export default {
.live-table-header {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
align-items: center;
margin-bottom: 10px;
color: #333333;
font-size: 16px;
label {
color: #5850ff;
}
}
}
</style>
......@@ -3,12 +3,14 @@
<div class="container">
<div class="look-container">
<div class="look-left">
<div class="look-left-b"></div>
<div class="look-left-b">
<img :src="room.liveVideoCover" />
</div>
<div class="look-left-content">
<div class="look-title">{{ room.name }}</div>
<div class="look-desc">开播时间:{{ room.startTimeStr }}</div>
<div class="look-desc">开播时间:{{ getBetween }}</div>
<div class="look-desc">房间号:{{ room.id }}</div>
<div class="look-status">直播已结束{{ room.name }}</div>
<div class="look-status">直播已结束{{ endTime }}</div>
</div>
</div>
<div class="look-right">
......@@ -35,22 +37,22 @@
</div>
<div class="data-desc">
<span>峰值在线人数</span>
<span>{{ base.visitPeakOnlineValue }}</span>
<span>{{ baseInfo.visitPeakOnlineValue }}</span>
</div>
<div class="data-desc">
<span>观看人数</span>
<span>{{ base.visitNumberOfPeople }}</span>
<span>{{ baseInfo.visitNumberOfPeople }}</span>
</div>
<div class="data-desc data-desc-jump">
<span>观看次数</span>
<span>
{{ base.visitNumberOfTimes }}
{{ baseInfo.visitNumberOfTimes }}
<a @click="handleLook">查看</a>
</span>
</div>
<div class="data-desc">
<span>平均观看时长</span>
<span>{{ base.visitAverageTime }}</span>
<span>{{ baseInfo.visitAverageTime }}</span>
</div>
</div>
<div class="data-container-right">
......@@ -60,11 +62,11 @@
</div>
<div class="data-desc">
<span>评论人数</span>
<span>{{ base.interactNumberOfPeople }}</span>
<span>{{ baseInfo.interactNumberOfPeople }}</span>
</div>
<div class="data-desc">
<span>评论次数</span>
<span>{{ base.interactNumberOfTimes }}</span>
<span>{{ baseInfo.interactNumberOfTimes }}</span>
</div>
</div>
</div>
......@@ -75,17 +77,17 @@
<div class="container-tabel">
<div class="live-table-header">
<h2>数据列表</h2>
<el-button :size="size" type="primary" class="el-icon-plus" @click="detailexport">导出</el-button>
<el-button :size="size" type="primary" plain @click="detailexport">导出</el-button>
</div>
<GLTable ref="classifyRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<GLTable ref="classifyRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="1"></GLTableButton>
</div>
</GLTable>
</div>
</div>
<GLDialog width="1158px" bigTitle="提示" :hasFooter="false" :visible.sync="dialogVisible" mode="big">
<record ref="recordForm"></record>
<GLDialog width="1158px" :bigTitle="room.name" :hasFooter="false" :visible.sync="dialogVisible" mode="big">
<record ref="recordForm" v-if="dialogVisible" :visitSource="visitSource" :roomNum="roomNum"></record>
</GLDialog>
</div>
</template>
......@@ -93,6 +95,7 @@
<script>
import url from '@/assets/empty.png'
import record from './components/record.vue'
import { downloadUrl, GetDateDiff } from '@/utils'
export default {
name: 'LiveIndex',
components: {
......@@ -100,20 +103,21 @@ export default {
},
data() {
return {
roomNum: 0,
roomId: '',
endTime: '',
dialogVisible: false,
visitSource: '',
dialogObj: {
show: false
},
size: 'small',
url: url,
base: {},
baseInfo: {},
room: {},
searchForm: {
term: '',
status: ''
},
tableSearchForm: { id: '' },
// 表格
getListApi: this.$apis.live.getListApi,
getListApi: this.$apis.console.consolePage,
tableParams: {
listName: 'list',
tableOption: true,
......@@ -139,29 +143,62 @@ export default {
attrs: {
type: 'text'
},
condition: row => {
return row.status == 0
},
listeners: {
click: row => {
this.$apis.live.LiveRoomDetailApi({ id: row.id }).then(res => {
console.log(JSON.parse(JSON.stringify(res)))
this.liveDetail = res
this.pageClick()
})
this.handleLook(row)
}
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
mounted() {},
created() {
this.roomId = this.$route.query.id
this.consoleBasic(this.roomId)
this.consoleInfo(this.roomId)
},
beforeDestroy() {
clearInterval(this.timer)
},
computed: {
getBetween() {
const startTimeStr = this.room.startTimeStr
const endTimeStr = this.room.endTimeStr
if (!startTimeStr) return
const [y1, d1] = startTimeStr.split(' ')
const [y2, d2] = endTimeStr.split(' ')
if (y1 == y2) {
return y1 + ' ' + d1.substring(0, 5) + '-' + d2.substring(0, 5)
} else {
return y1 + ' ' + d1.substring(0, 5) + '-' + y2 + ' ' + d2.substring(0, 5)
}
}
},
methods: {
//时间差
getTime() {
this.endTime = GetDateDiff(this.room.endTimeStr)
},
handleLook(row) {
this.visitSource = row.visitSource
this.roomNum = row.totalVisitCnt ? row.totalVisitCnt : this.baseInfo.visitNumberOfTimes
this.dialogVisible = true
},
consoleBasic(id) {
this.$apis.console.consoleBasic({ id }).then(res => {
this.baseInfo = res || {}
})
},
consoleInfo(id) {
this.$apis.console.consoleInfo({ id }).then(res => {
this.room = res || {}
this.timer = setInterval(this.getTime, 1000)
})
},
detailexport() {
this.$apis.console.detailexport({}).then(res => {
this.$apis.console.consoleExport({ id: this.roomId, currentPage: 1, pageSize: 100000 }).then(res => {
downloadUrl(res)
})
},
......@@ -174,25 +211,13 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
this.tableSearchForm.id = this.roomId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun()
},
handleSearch() {
this.$refs.classifyRef.refreshTable()
},
handleReset() {
this.searchForm = {
classifyName: '',
createDate: []
}
this.handleSearch()
}
}
}
......@@ -230,8 +255,10 @@ export default {
.look-left {
display: flex;
.look-left-b {
width: 260px;
height: 170px;
img {
width: 260px;
height: 170px;
}
}
.look-left-content {
margin-left: 20px;
......
......@@ -12,13 +12,22 @@
</div>
<GLTable ref="classifyRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="status" slot-scope="scope">
<span :class="['table-circle', scope.scope.status == 1 ? 'back-blue' : 'back-grey']"></span>
<span :class="['table-circle', scope.scope.status == 1 ? 'back-green' : 'back-grey']"></span>
<span>{{ scope.scope.statusStr || '--' }}</span>
</div>
<div slot="coverUrl" slot-scope="scope">
<div class="image-popover" @click="handleLook(scope.scope)">
<img :src="scope.scope.coverUrl" />
</div>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisibleDel = false" type="error" content="是否确认删除短视频?" :visible.sync="dialogVisibleDel" mode="small"></GLDialog>
</div>
</div>
......@@ -26,13 +35,17 @@
<script>
import url from '@/assets/empty.png'
import bigView from '@/components/big-view'
export default {
name: 'LiveIndex',
components: {
bigView
},
data() {
return {
dialogVisibleDel: false,
dialogVisibleImg: false,
dialogType: '',
selectItem: '',
size: 'small',
url: url,
......@@ -47,6 +60,7 @@ export default {
label: '',
name: 'term',
type: 'input',
placeholder: '请输入关键字',
maxlength: 20
},
{
......@@ -72,7 +86,7 @@ export default {
tableColumns: [
{
label: '编号',
prop: 'roomNumber'
prop: 'fileId'
},
{
label: '视频名称',
......@@ -104,6 +118,14 @@ export default {
name: '预览',
attrs: {
type: 'text'
},
condition: row => {
return row.status == 1
},
listeners: {
click: row => {
this.handleView(row)
}
}
},
{
......@@ -112,6 +134,9 @@ export default {
attrs: {
type: 'text'
},
condition: row => {
return row.status == 2 || row.status == 0
},
listeners: {
click: row => {
this.$router.push(`/shortVideo/uploadVideo?id=${row.id}`)
......@@ -125,7 +150,7 @@ export default {
type: 'text'
},
condition: row => {
return row.status == 0
return row.status == 0 || row.status == 1
},
listeners: {
click: row => {
......@@ -148,7 +173,16 @@ export default {
pageClick() {
this.$router.push(`/shortVideo/uploadVideo`)
},
handleView(row) {
this.dialogType = 'video'
this.dialogVisibleImg = true
this.dialogSrc = row.mediaUrl
},
handleLook(row) {
this.dialogType = 'img'
this.dialogVisibleImg = true
this.dialogSrc = row.coverUrl
},
handleSure() {
const { id } = this.selectItem
this.$apis.shortVideo
......@@ -208,4 +242,14 @@ export default {
color: #333333;
}
}
.table-circle {
margin-right: 5px;
}
.image-popover {
cursor: pointer;
img {
width: 36px;
height: 36px;
}
}
</style>
......@@ -53,9 +53,8 @@
取消
</el-button>
</div>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog>
</div>
</template>
......@@ -64,9 +63,13 @@
import upload from '@/api/uploadApi'
import uploadMixin from '@/mixins/upload'
// const upload = new GlsxUpload({ baseURL: 'http://scrm.dev.glsx.com.cn' })
import bigView from '@/components/big-view'
export default {
name: 'uploadVideo',
mixins: [uploadMixin],
components: {
bigView
},
data() {
return {
size: 'small',
......@@ -105,7 +108,6 @@ export default {
upload
.uploaded(file)
.then(res => {
self.loading = false
self.$refs['uploadForm'].clearValidate('mediaUrl')
const videoUrl = res.video.url
self.$set(self.uploadForm, 'mediaUrl', videoUrl)
......@@ -114,6 +116,7 @@ export default {
self.$set(self.uploadForm, 'coverUrl', res)
})
})
self.loading = false
})
.finally(end => {
console.log(end)
......@@ -144,15 +147,21 @@ export default {
handleUp() {
this.$refs['uploadForm'].validate(valid => {
if (valid) {
this.$apis.shortVideo.tencentcloudmediaUpdate().then(res => {
this.$set(this.uploadForm, 'coverUrl', res)
this.$apis.shortVideo.tencentcloudmediaUpdate(this.uploadForm).then(res => {
if (res) {
this.$router.push('/shortVideo/index')
this.$message({
type: 'success',
message: '操作成功!'
})
}
})
}
})
},
mediaDetail() {
const { id } = this.uploadForm
this.$apis.shortVideo.tencentcloudmediaDetail(id).then(res => {
this.$apis.shortVideo.tencentcloudmediaDetail({ id }).then(res => {
this.uploadForm = res
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!