|
@@ -1,9 +1,10 @@
|
|
<template>
|
|
<template>
|
|
- <el-button type="primary" class="export"> 导出 </el-button>
|
|
|
|
|
|
+ <el-button type="primary" class="export" @click="exportfun"> 导出 </el-button>
|
|
|
|
+ <div style="line-height: 3.5em;" v-text="item.showTime"></div>
|
|
<el-table :data="list" @sort-change="sortFun">
|
|
<el-table :data="list" @sort-change="sortFun">
|
|
<el-table-column type="expand">
|
|
<el-table-column type="expand">
|
|
<template #default="props">
|
|
<template #default="props">
|
|
- <self-video v-if="props.row.video_url" :item="props.row" />
|
|
|
|
|
|
+ <self-video v-if="props.row.video_url && props.row.flow_url" :item="props.row" />
|
|
<self-line v-else :item="props.row" />
|
|
<self-line v-else :item="props.row" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -69,8 +70,6 @@ const resultP = ref({
|
|
const list = ref([]);
|
|
const list = ref([]);
|
|
|
|
|
|
function getEpgResult() {
|
|
function getEpgResult() {
|
|
- if (resultP.value.page * resultP.value.pageSize >= resultP.value.total)
|
|
|
|
- return;
|
|
|
|
epgResult(resultP.value).then(r => {
|
|
epgResult(resultP.value).then(r => {
|
|
resultP.value.total = r.total || 0;
|
|
resultP.value.total = r.total || 0;
|
|
list.value = (r.data || []).map(v => {
|
|
list.value = (r.data || []).map(v => {
|
|
@@ -85,6 +84,7 @@ getEpgResult();
|
|
function sortFun(column) {
|
|
function sortFun(column) {
|
|
resultP.value.order = column.order ? config.order[column.order] : 'DESC';
|
|
resultP.value.order = column.order ? config.order[column.order] : 'DESC';
|
|
resultP.value.sort = column.prop ? column.prop.toUpperCase() : 'STADATE';
|
|
resultP.value.sort = column.prop ? column.prop.toUpperCase() : 'STADATE';
|
|
|
|
+ resultP.value.page = 1;
|
|
getEpgResult();
|
|
getEpgResult();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -92,6 +92,37 @@ function changePage(num) {
|
|
resultP.value.page = num;
|
|
resultP.value.page = num;
|
|
getEpgResult();
|
|
getEpgResult();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+function exportfun() {
|
|
|
|
+ let xhttp;
|
|
|
|
+ if (window.XMLHttpRequest) xhttp = new XMLHttpRequest();
|
|
|
|
+ else xhttp = new window.ActiveXObject('Microsoft.XMLHTTP');
|
|
|
|
+ xhttp.responseType = 'blob';
|
|
|
|
+ xhttp.open(
|
|
|
|
+ 'GET',
|
|
|
|
+ config.base.url2 + '/epg-export?programId=' + props.item.id,
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ xhttp.send();
|
|
|
|
+ xhttp.onreadystatechange = function () {
|
|
|
|
+ if (this.readyState != 4 || this.status != 200) return;
|
|
|
|
+ // 组装a标签
|
|
|
|
+ let elink = document.createElement('a');
|
|
|
|
+ // 设置下载文件名
|
|
|
|
+ let D = new Date(),
|
|
|
|
+ M = D.getMonth() + 1,
|
|
|
|
+ E = D.getDate();
|
|
|
|
+ M > 9 ? '' : (M = ['0', M].join(''));
|
|
|
|
+ E > 9 ? '' : (E = ['0', E].join(''));
|
|
|
|
+ elink.download =
|
|
|
|
+ props.item.programName + ' ' + [D.getFullYear(), M, E].join('-') + '.csv';
|
|
|
|
+ elink.style.display = 'none';
|
|
|
|
+ elink.href = URL.createObjectURL(this.response);
|
|
|
|
+ document.body.appendChild(elink);
|
|
|
|
+ elink.click();
|
|
|
|
+ document.body.removeChild(elink);
|
|
|
|
+ };
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style></style>
|
|
<style></style>
|