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

数据导出接口

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