提交 06b4eb67 编写于 作者: zhentian.jia's avatar zhentian.jia

对接exel导出接口

上级 d20e0354
......@@ -23,8 +23,8 @@ export const envConfig = {
saasDomainUrl: 'https://dev-saas.yunqueyi.com/',
workApiUrl: 'https://dev-work.yunqueyi.com/web',
workApiSrc: 'https://dev-work.yunqueyi.com',
// reportUrl: 'http://10.177.15.150:10401/',
reportUrl: 'https://dev-sc-report.yunqueyi.com/',
reportUrl: 'http://10.177.15.150:10401/',
// reportUrl: 'https://dev-sc-report.yunqueyi.com/',
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/',
......
......@@ -206,10 +206,12 @@ const vueFilter = {
}
},
exportStatus: (value) => {
if(value == 1) {
return '数据生成中,请稍后---'
}else {
return '文件生成失败请重新操作导出'
if(value == 0) {
return '数据生成中,请稍后---';
}else if(value == 1) {
return '数据生成完成';
} else {
return '文件生成失败 请重新操作导出';
}
},
}
......
......@@ -4,9 +4,9 @@
<div class="component-content screenSet" id="screenSet">
<p>导出文件列表</p>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" label="名称" align="center" min-width="300"></el-table-column>
<el-table-column prop="time" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.time | liveDateFilter }}</template>
<el-table-column prop="fileName" label="名称" align="center" min-width="150"></el-table-column>
<el-table-column prop="createdTime" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.createdTime }}</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="center" min-width="150">
<template slot-scope="scope">{{ scope.row.status | exportStatus }}</template>
......@@ -55,19 +55,21 @@ export default {
return {
curmbFirst: "学情报告",
curmbSecond: "导出下载",
projectId: '',
tableData: [],
param: {
pageSize: 10,
pageNo: 1
},
totalRows: 0,
totalTime: 3
totalTime: 3,
// buttonText: "刷新",
// buttonStatus: false,
};
},
created() {
vm = this;
this.projectId = vm.getUrlSearch(window.location.href, "projectId");
this.search();
},
mounted: function() {
......@@ -77,43 +79,47 @@ export default {
setButton() {
for (let i = 0; i < vm.tableData.length; i++) {
vm.tableData[i].index = i;
if(vm.tableData[i].option == false) {
vm.tableData[i].buttonText = "刷新";
if(vm.tableData[i].status == 1) {
vm.tableData[i].buttonText = "下载";
vm.tableData[i].buttonStatus = false;
} else {
vm.tableData[i].buttonText = "下载";
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = false;
}
}
},
search() {
vm.tableData = [
{
id: 123,
name:
"浙江省心脑项目,浙江省杭州市区西湖区,第二人民医院杭州市中医院---",
time: 1562221264000,
status: 1,
option: false,
},
{
id: 233,
name:
"江西省心脑项目,浙江省杭州市区西湖区,第二人民医院杭州市中医院---",
time: 1562221874000,
status: 1,
option: false,
},
{
id: 666,
name:
"上海市心脑项目,浙江省杭州市区西湖区,第二人民医院杭州市中医院---",
time: 1562225864000,
status: 1,
option: false,
}
// {
// id: 123,
// fileName:
// "浙江省心脑项目,浙江省杭州市区西湖区,第二人民医院杭州市中医院---",
// createdTime: 1562221264000,
// status: 0,
// },
// {
// id: 233,
// fileName:
// "江西省心脑项目,浙江省杭州市区西湖区,第二人民医院杭州市中医院---",
// createdTime: 1562221874000,
// status: 0,
// },
// {
// id: 666,
// fileName:
// "上海市心脑项目,浙江省杭州市区西湖区,第二人民医院杭州市中医院---",
// createdTime: 1562225864000,
// status: 0,
// }
];
this.setButton();
// this.setButton();
let req = {
projectId : vm.projectId,
}
vm.reportGET("report/downLoad/getDownloadList", req).then(res => {
vm.tableData = res.data.data;
vm.setButton();
});
},
downLoad() {
console.log('下载Excel');
......@@ -129,32 +135,36 @@ export default {
// downloadElement.click() // 点击下载
// document.body.removeChild(downloadElement) // 下载完成移除元素
// window.URL.revokeObjectURL(href) // 释放掉blob对象
},
getDownLoadStatus() {
},
update(row) {
if(vm.tableData[row.index].option == true) {
if(vm.tableData[row.index].status == 1) {
vm.downLoad();
} else {
this.$nextTick(function() {
vm.getDownLoadStatus();
console.log(vm.tableData[row.index]);
let nowTime = vm.totalTime;
vm.tableData[row.index].name = vm.tableData[row.index].name+ ' ';
vm.tableData[row.index].fileName = vm.tableData[row.index].fileName+ ' ';
vm.tableData[row.index].buttonText = nowTime + "s后可以刷新";
vm.tableData[row.index].buttonStatus = true;
let clock = window.setInterval(() => {
nowTime--;
vm.tableData[row.index].name = vm.tableData[row.index].name+ ' ';
vm.tableData[row.index].fileName = vm.tableData[row.index].fileName+ ' ';
vm.tableData[row.index].buttonText = nowTime + "s后可以刷新";
if (nowTime < 0) {
window.clearInterval(clock);
vm.tableData[row.index].name = vm.tableData[row.index].name+ ' ';
vm.tableData[row.index].fileName = vm.tableData[row.index].fileName+ ' ';
// vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = false; //这里重新开启
vm.tableData[row.index].option = Boolean(Math.round(Math.random()));
if(vm.tableData[row.index].option == false) {
vm.tableData[row.index].buttonText = "刷新";
} else {
vm.tableData[row.index].status = Boolean(Math.round(Math.random()));
if(vm.tableData[row.index].status == 1) {
vm.tableData[row.index].buttonText = "下载";
} else {
vm.tableData[row.index].buttonText = "刷新";
}
}
}, 1000);
......
......@@ -437,7 +437,10 @@ export default {
this.dialogVisible = true;
},
toDownload() {
vm.$router.push({ path: "export-download" });
let routerData = {
projectId : vm.projectId,
};
vm.$router.push({ path: "export-download", query: routerData });
},
update() {},
release() {},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册