提交 a414bf99 编写于 作者: bo.dang's avatar bo.dang

下载Excel和签到人数

上级 6333fb9d
......@@ -44,6 +44,15 @@ export const saveCircleSetting = (params) => {
})
};
export const downloadSigninfo = (params) => {
return fetch({
headers,
url: getBaseUrl(`rtc/liveAdmin/download/signInfo/${params.rtcId}`),
method: 'get',
description: '下载签到信息表'
})
};
export const updateRangeStatus = (params) => {
return fetch({
headers,
......
......@@ -99,6 +99,7 @@
maxlength="20"
placeholder="开播后超过此时长无法签到"
style="width:70%;"
:disabled="styleEditFlag"
></el-input>
<span></span>
<el-tooltip class="item" effect="dark" content="若不设置此时长,则直播全程可签到" placement="top">
......@@ -116,7 +117,7 @@
<!--<el-checkbox v-model="formData.checked">App通知</el-checkbox>-->
<el-checkbox size="small" v-model="checked">App通知</el-checkbox>
<el-checkbox size="small" v-model="checked" :disabled="styleEditFlag">App通知</el-checkbox>
</el-form-item>
......
......@@ -115,9 +115,9 @@
>
<el-table :data="dialogStatisticsData" align="center">
<el-table-column property="peopleNum" label="观看人数" align="center"></el-table-column>
<el-table-column prop="liveDuration" label="签到人数" align="center">
<el-table-column property="signNum" v-if="isSign == 1" label="签到人数" align="center">
<template slot-scope="scope">
<el-link @click="downlodExcel(scope.row)">{{ scope.row.liveDuration }}</el-link>
<el-link @click="downlodExcel()">{{ scope.row.signNum }}</el-link>
</template>
</el-table-column>
<el-table-column property="liveDuration" label="直播时长(分钟)" align="center"></el-table-column>
......@@ -286,7 +286,7 @@ import DownloadJS from "@/utils/download/download4";
let vm = null;
import BreadCrumb from "@/components/breadcrumb.vue";
import { getPlayback, postPlayback, updateLiveStatus } from "../../utils/yqrange/yqrangeApi";
import { getPlayback, postPlayback, updateLiveStatus, downloadSigninfo } from "../../utils/yqrange/yqrangeApi";
import { doUpload, getFilePath, unsubscribe } from "../../utils/qiniu-util";
import QRCode from "qrcodejs2"
import ElLink from "element-ui/packages/link/src/main";
......@@ -298,6 +298,7 @@ export default {
},
data() {
return {
rtcId: null,
curmbFirst: "云鹊小圈",
curmbSecond: "直播管理",
dialogStatisticsVisible: false,
......@@ -345,8 +346,9 @@ export default {
],
dialogStatisticsData: [
{
peopleNum: 234,
liveDuration: "38分钟"
peopleNum: 0,
liveDuration: "",
signNum: 0
}
],
liveScope: 1,
......@@ -386,7 +388,8 @@ export default {
videoSize: 0,
link: '',//预览的链接
qrcodeBox: null,
dialogVisible: false
dialogVisible: false,
isSign: 0, // 是否签到
};
},
created() {
......@@ -929,14 +932,12 @@ export default {
})
.catch(() => {});
},
//数据统计
countLive(row) {
this.rtcId = row.rtcId;
this.isSign = row.isSign;
this.dialogStatisticsVisible = true;
console.log("getStatisticsData() : this.circleId = " + this.circleId);
vm.GET("rtc/liveAdmin/data/" + row.rtcId, "").then(res => {
......@@ -944,7 +945,8 @@ export default {
let listData = [];
let obj = {
peopleNum: res.data.viewedPersonTime,
liveDuration: res.data.liveDuration
liveDuration: res.data.liveDuration,
signNum: res.data.signNum
};
listData.push(obj);
this.dialogStatisticsData = listData;
......@@ -1129,8 +1131,56 @@ export default {
vm.dialogVisible = false;
},
downlodExcel(row){
alert("happy!");
downlodExcel(){
let params = {
// rtcId: this.rtcId
rtcId: 372
}
downloadSigninfo(params).then((res) => {
// vm.GET(`rtc/liveAdmin/download/signInfo/` + params.rtcId, { responseType: 'blob' }).then((res) => {
closeLoading(this);
// const aLink = document.createElement("a");
// let blob = new Blob([res], {type: "application/vnd.ms-excel;charset=utf-8"});
// // let downloadUrl = URL.createObjectURL(blob);
// // window.location.href = downloadUrl;
// aLink.href = URL.createObjectURL(blob);
// aLink.setAttribute('download', '123' + '.xlsx'); // 设置下载文件名称
// aLink.click();
// this.$refs.loadElement.appendChild(aLink);
this.downloadExcelFile(res.data, 2);
// setTimeout(() => {
// window.open(downloadUrl);
// }, 500);
// if(res.code == "000000") {
// this.$message.success("下载成功");
// // vm.getLiveList("", "");
// } else {
// this.$message.error("下载失败,请重试");
// }
}).catch((error) => {
this.$message.error("请重试");
})
},
/* 文件下载*/
downloadExcelFile(base64, flag) {
let a = document.createElement('a');
vm.uploadHref = 'data:application/xls;base64,' + base64;
a.setAttribute('href',vm.uploadHref);
a.setAttribute('download','签到人数统计' + new Date().getTime() + '.xlsx');
// if (flag && flag == 2) {
// a.setAttribute('download',vm.exportFileName);
// } else {
// a.setAttribute('download',vm.uploadFileName);
// }
a.click();
},
......
......@@ -61,7 +61,7 @@
<el-button @click="roleManage(scope.row)" type="text" size="small" v-if="scope.row.status != 0">成员管理</el-button>
<el-button @click="editRange(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="deleteRange(scope.row)" type="text" size="small" v-if="showAllFlag && scope.row.status != 0">解散圈子</el-button>
<el-button @click="setting(scope.row)" type="text" size="small" v-if="scope.row.status != 0">应用配置</el-button>
<el-button @click="setting(scope.row)" type="text" size="small" v-if="scope.row.status != 0 && showNewFlag">应用配置</el-button>
</div>
</template>
</el-table-column>
......@@ -257,7 +257,7 @@ export default {
},
//上线
publishRange(row) {
this.$confirm(`确定上线“${row.name}”吗?`, '', {
this.$confirm(`上线后圈子成员将收到入圈消息提醒(每天最多提醒一次),确定上线“${row.name}”吗?`, '', {
confirmButtonText: '上线',
cancelButtonText: '取消',
type: 'warning',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册