提交 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,15 +76,13 @@ ...@@ -67,15 +76,13 @@
</template> </template>
<script> <script>
import { import { exportList } from '@/api/downList';
exportList const STATUS_DESC_MAP = {
} from '@/api/downList';
const STATUS_DESC_MAP = {
1: '处理中', 1: '处理中',
2: '完成', 2: '完成',
3: '失败' 3: '失败',
}; };
export default { export default {
data() { data() {
return { return {
pageSize: 15, pageSize: 15,
...@@ -85,22 +92,25 @@ ...@@ -85,22 +92,25 @@
tableData: [], tableData: [],
}; };
}, },
created () { created() {
this.queryList(); this.queryList();
}, },
methods: { methods: {
queryList () { reload() {
this.queryList();
},
queryList() {
exportList({ exportList({
pageSize: this.pageSize, pageSize: this.pageSize,
pageNo: this.pageNo pageNo: this.pageNo,
}).then(res => { }).then((res) => {
if (res && res.code === '000000') { if (res && res.code === '000000') {
this.totalCount = res.data.allSize; this.totalCount = res.data.allSize;
this.tableData = res.data.list; this.tableData = res.data.list;
} }
}); });
}, },
getStatusDesc (status) { getStatusDesc(status) {
return STATUS_DESC_MAP[status]; return STATUS_DESC_MAP[status];
}, },
download(link) { download(link) {
...@@ -116,7 +126,7 @@ ...@@ -116,7 +126,7 @@
this.queryList(); 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 {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册