提交 6a3f18de 编写于 作者: zhentian.jia's avatar zhentian.jia

数据导出接口

上级 ad4cdea2
......@@ -207,11 +207,11 @@ const vueFilter = {
},
exportStatus: (value) => {
if(value == 0) {
return '数据生成中,请稍后---';
return '生成中';
}else if(value == 1) {
return '数据生成完成';
return '成功';
} else {
return '文件生成失败 请重新操作导出';
return '失败';
}
},
getAvgTime: (value) => {
......
......@@ -3,7 +3,11 @@
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="p-title">任务列表</div>
<el-table :data="tableData" style="width: 100%">
<el-tabs v-model="listType" type="card" @tab-click="handleClick">
<el-tab-pane label="查看报告" name="1"></el-tab-pane>
<el-tab-pane label="导出列表" name="2"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" class="table-export" style="width: 100%">
<el-table-column
prop="title"
label="名称"
......@@ -11,18 +15,21 @@
min-width="150"
show-overflow-tooltip
></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 prop="time" label="时间" align="center" min-width="120">
<template slot-scope="scope">{{ scope.row.time }}</template>
</el-table-column>
<el-table-column prop="status" label="状态" align="center" min-width="150">
<template slot-scope="scope">{{ scope.row.status | exportStatus }}</template>
<el-table-column prop="status" label="状态" align="left" min-width="30">
<template slot-scope="scope">
<span class="logo"></span>
<span class="text">{{ scope.row.status | exportStatus }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="70">
<template slot-scope="scope">
<el-button
type="primary"
:disabled="scope.row.buttonStatus"
size="small"
type="text"
@click="update(scope.row)"
>{{ scope.row.buttonText }}</el-button>
</template>
......@@ -72,12 +79,9 @@ export default {
totalRows: 0,
totalTime: 3,
queryData: {},
listType: "1"
// buttonText: "刷新",
// buttonStatus: false,
formData: {
pageNo: 1,
pageSize: 20,
},
};
},
created() {
......@@ -89,40 +93,54 @@ export default {
commonUtil.resizeHeight();
},
methods: {
handleClick(tab, event) {
vm.listType = tab.name;
},
setButton() {
for (let i = 0; i < vm.tableData.length; i++) {
vm.tableData[i].index = i;
if (vm.tableData[i].status == 1) {
vm.tableData[i].buttonText = "下载";
vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 0) {
} else if (vm.tableData[i].status == 0) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = false;
} else if(vm.tableData[i].status == 2) {
} else if (vm.tableData[i].status == 2) {
vm.tableData[i].buttonText = "刷新";
vm.tableData[i].buttonStatus = true;
}
}
},
search() {
// this.setButton();
let req = {
projectId: vm.projectId
};
if(req.projectId == null) {
req.projectId = '';
// let req = {
// projectId: vm.projectId
// };
// if(req.projectId == null) {
// req.projectId = '';
// }
// vm.reportGET("report/downLoad/getDownloadList", req).then(res => {
// if (res.code == "000000") {
// vm.tableData = res.data.data;
// vm.totalRows = res.data.totalRows;
// vm.setButton();
// }
// });
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
vm.reportGET("report/downLoad/getDownloadList", req).then(res => {
if (res.code == "000000") {
vm.tableData = res.data.data;
vm.totalRows = res.data.totalRows;
vm.setButton();
}
});
vm.reportGET("report/downLoad/getDownloadList", req).then(res => {
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: ""
};
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") {
vm.tableData = res.data.data;
vm.totalRows = res.data.totalRows;
vm.tableData = res.data.list;
vm.totalRows = res.data.totalSize;
vm.setButton();
}
});
......@@ -143,26 +161,37 @@ export default {
}, 500);
},
getDownLoadStatus(row) {
let req = {
// let req = {
// id: row.id
// };
let projectId = "";
if (vm.projectId != null) {
projectId = vm.projectId;
}
let reqList = {
projectId: projectId,
pageNo: vm.param.pageNo,
pageSize: vm.param.pageSize,
type: parseInt(vm.listType),
id: row.id
};
vm.reportGET("report/downLoad/getDownLoadStatus", req).then(res => {
vm.GET("stats/mission/missionlist", reqList).then(res => {
if (res.code == "000000") {
vm.tableData[row.index].status = res.data.data;
// console.log('res.data.data',res.data.data);
if (res.data.data == 1) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "下载";
vm.tableData[row.index].fileUrl = res.data.url;
} else if(res.data.data == 0) {
console.log("res", res, vm.tableData[row.index]);
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
} else if(res.data.data == 2) {
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
vm.tableData[row.index].buttonText = "刷新";
vm.tableData[row.index].buttonStatus = true;
}
// vm.tableData[row.index].status = res.data.data;
// // console.log('res.data.data',res.data.data);
// if (res.data.data == 1) {
// vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
// vm.tableData[row.index].buttonText = "下载";
// vm.tableData[row.index].fileUrl = res.data.url;
// } else if (res.data.data == 0) {
// console.log("res", res, vm.tableData[row.index]);
// vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
// vm.tableData[row.index].buttonText = "刷新";
// } else if (res.data.data == 2) {
// vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
// vm.tableData[row.index].buttonText = "刷新";
// vm.tableData[row.index].buttonStatus = true;
// }
} else {
vm.$message(res.message);
vm.tableData[row.index].title = vm.tableData[row.index].title + " ";
......@@ -221,11 +250,32 @@ export default {
margin-left: 30px;
margin-bottom: 30px;
height: 25px;
font-size:18px;
font-weight:600;
font-size: 18px;
font-weight: 600;
line-height: 25px;
color: #000000;
}
.table-export {
.logo {
margin-top: 8px;
margin-right: 6px;
float: left;
width: 6px;
height: 6px;
border-radius: 50%;
background: #1890ff;
}
.text {
float: left;
}
.el-button--text {
color: #449284;
}
.el-button.is-disabled {
background: #fff !important;
border: 0px solid #fff !important;
}
}
}
}
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册