|
@@ -0,0 +1,107 @@
|
|
1
|
+<template>
|
|
2
|
+ <div v-loading="loading" class="exportOffline-wrap">
|
|
3
|
+ <el-table :height="height" :data="tableList" tooltip-effect="dark" style="width: 100%;">
|
|
4
|
+ <el-table-column label="名称" prop="index_name" min-width="300" align="left" />
|
|
5
|
+ <el-table-column width="20" />
|
|
6
|
+ <el-table-column label="导出链接" min-width="300" align="left">
|
|
7
|
+ <template slot-scope="{ row }">
|
|
8
|
+ <div v-if="row.status == 1" class="c-FFB055">待处理</div>
|
|
9
|
+ <div v-else-if="row.status == 2" class="c-448AFF">导出链接生成中,请稍候</div>
|
|
10
|
+ <div v-else-if="row.status == 3 && row.file_url" class="c-00B38A pointer" @click="handleDownload(row.file_url)">{{ row.file_url }}</div>
|
|
11
|
+ <div v-else> - </div>
|
|
12
|
+ </template>
|
|
13
|
+ </el-table-column>
|
|
14
|
+ <el-table-column label="创建时间" prop="created_at" width="160" align="center" />
|
|
15
|
+ <el-table-column label="操作人" prop="operator_name" width="200" align="center" />
|
|
16
|
+ <el-table-column label="操作" width="100" align="center">
|
|
17
|
+ <template slot-scope="{ row }">
|
|
18
|
+ <el-button
|
|
19
|
+ size="mini"
|
|
20
|
+ :type="(row.status != 3 || !row.file_url) ? 'info' : 'primary'"
|
|
21
|
+ :disabled="row.status != 3 || !row.file_url"
|
|
22
|
+ @click="handleDownload(row.file_url)"
|
|
23
|
+ >下载</el-button>
|
|
24
|
+ </template>
|
|
25
|
+ </el-table-column>
|
|
26
|
+ </el-table>
|
|
27
|
+ <div class="pagination" v-show="pagination.total > 0">
|
|
28
|
+ <el-pagination background :current-page="pagination.page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count="Number(pagination.pages)" />
|
|
29
|
+ </div>
|
|
30
|
+ </div>
|
|
31
|
+</template>
|
|
32
|
+<script>
|
|
33
|
+export default {
|
|
34
|
+ name: 'exportOffline',
|
|
35
|
+ data () {
|
|
36
|
+ return {
|
|
37
|
+ height: '',
|
|
38
|
+ loading: false,
|
|
39
|
+ pagination: {
|
|
40
|
+ page: 1,
|
|
41
|
+ page_size: 20,
|
|
42
|
+ pages: 0,
|
|
43
|
+ total: 0,
|
|
44
|
+ },
|
|
45
|
+ // filter: {
|
|
46
|
+ // keyword: '',
|
|
47
|
+ // },
|
|
48
|
+ tableList: [],
|
|
49
|
+ }
|
|
50
|
+ },
|
|
51
|
+ created () {
|
|
52
|
+ this.height = document.documentElement.clientHeight - 150
|
|
53
|
+ this.handleGetList()
|
|
54
|
+ },
|
|
55
|
+ methods: {
|
|
56
|
+ // 获取列表数据
|
|
57
|
+ async handleGetList() {
|
|
58
|
+ try {
|
|
59
|
+ this.loading = true
|
|
60
|
+ const url = `${this.URL.BASEURL}${this.URL.dataBoard_orderExportList}`
|
|
61
|
+ const params = {
|
|
62
|
+ page: this.pagination.page,
|
|
63
|
+ page_size: this.pagination.page_size,
|
|
64
|
+ }
|
|
65
|
+ const { data: res = {} } = await this.$axios.get(url, { params })
|
|
66
|
+ if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
|
|
67
|
+ this.tableList = res.rst.data;
|
|
68
|
+ this.pagination.total = res.rst.pageInfo.total;
|
|
69
|
+ this.pagination.pages = res.rst.pageInfo.pages;
|
|
70
|
+ } else if (res.errno != 4002) {
|
|
71
|
+ this.$message.warning(res.err)
|
|
72
|
+ this.tableList = [];
|
|
73
|
+ this.pagination.total = 0;
|
|
74
|
+ this.pagination.pages = 0;
|
|
75
|
+ }
|
|
76
|
+ } catch (error) {
|
|
77
|
+ console.log(error)
|
|
78
|
+ this.tableList = [];
|
|
79
|
+ this.pagination.total = 0;
|
|
80
|
+ this.pagination.pages = 0;
|
|
81
|
+ } finally {
|
|
82
|
+ this.loading = false
|
|
83
|
+ }
|
|
84
|
+ },
|
|
85
|
+ // 监听当前页数变化
|
|
86
|
+ handleCurrentChange(currentPage) {
|
|
87
|
+ this.pagination.page = currentPage
|
|
88
|
+ this.handleGetList()
|
|
89
|
+ },
|
|
90
|
+ // 执行下载
|
|
91
|
+ handleDownload(url) {
|
|
92
|
+ const a = document.createElement("a");
|
|
93
|
+ a.style.display = "none";
|
|
94
|
+ a.href = url;
|
|
95
|
+ document.body.appendChild(a);
|
|
96
|
+ a.click();
|
|
97
|
+ document.body.removeChild(a);
|
|
98
|
+ }
|
|
99
|
+ }
|
|
100
|
+}
|
|
101
|
+</script>
|
|
102
|
+<style lang="scss" scoped>
|
|
103
|
+.screenBox {
|
|
104
|
+ background: #fff;
|
|
105
|
+ padding: 5px 20px;
|
|
106
|
+}
|
|
107
|
+</style>
|