提交 9795bfca 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

feat 下载列表增加刷新

上级 e6c511d8
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div class="status_base"> <div class="status_base">
<div :class="'status-circle status-' + scope.row.status" /><div>{{ getStatusDesc(scope.row.status) }}</div> <div :class="'status-circle status-' + scope.row.status" />
<div>{{ getStatusDesc(scope.row.status) }}</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -41,6 +42,14 @@ ...@@ -41,6 +42,14 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div <div
v-if="scope.row.status === 1"
class="download-btn"
@click="reload"
>
刷新
</div>
<div
v-else-if="scope.row.status === 2"
class="download-btn" class="download-btn"
@click="download(scope.row.path)" @click="download(scope.row.path)"
> >
...@@ -67,56 +76,57 @@ ...@@ -67,56 +76,57 @@
</template> </template>
<script> <script>
import { import { exportList } from '@/api/downList';
exportList const STATUS_DESC_MAP = {
} from '@/api/downList'; 1: '处理中',
const STATUS_DESC_MAP = { 2: '完成',
1: '处理中', 3: '失败',
2: '完成', };
3: '失败' export default {
}; data() {
export default { return {
data() { pageSize: 15,
return { pageNo: 1,
pageSize: 15, totalCount: 0,
pageNo: 1, loading: false,
totalCount: 0, tableData: [],
loading: false, };
tableData: [], },
}; created() {
this.queryList();
},
methods: {
reload() {
this.queryList();
}, },
created () { queryList() {
exportList({
pageSize: this.pageSize,
pageNo: this.pageNo,
}).then((res) => {
if (res && res.code === '000000') {
this.totalCount = res.data.allSize;
this.tableData = res.data.list;
}
});
},
getStatusDesc(status) {
return STATUS_DESC_MAP[status];
},
download(link) {
window.location.href = link;
},
handleSizeChange(value) {
this.pageNo = 1;
this.pageSize = value;
this.queryList(); this.queryList();
}, },
methods: { handleCurrentChange(value) {
queryList () { this.pageNo = value;
exportList({ this.queryList();
pageSize: this.pageSize,
pageNo: this.pageNo
}).then(res => {
if (res && res.code === '000000') {
this.totalCount = res.data.allSize;
this.tableData = res.data.list;
}
});
},
getStatusDesc (status) {
return STATUS_DESC_MAP[status];
},
download(link) {
window.location.href = link;
},
handleSizeChange(value) {
this.pageNo = 1;
this.pageSize = value;
this.queryList();
},
handleCurrentChange(value) {
this.pageNo = value;
this.queryList();
},
}, },
}; },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -137,13 +147,13 @@ ...@@ -137,13 +147,13 @@
margin-right: 5px; margin-right: 5px;
} }
.status-1 { .status-1 {
background-color: rgb(219, 223, 12);; background-color: rgb(219, 223, 12);
} }
.status-2 { .status-2 {
background-color: rgb(87, 238, 82);; background-color: rgb(87, 238, 82);
} }
.status-3 { .status-3 {
background-color: rgb(238, 68, 16);; background-color: rgb(238, 68, 16);
} }
} }
.download-btn { .download-btn {
...@@ -154,4 +164,4 @@ ...@@ -154,4 +164,4 @@
color: rgb(98, 233, 86); color: rgb(98, 233, 86);
} }
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册