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

feat 下载列表增加刷新

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