index.vue
4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<template>
<div>
<el-form ref="archiveDataForm" class="form-header" :model="selectForm" label-width="auto" size="small"
@submit.native.prevent>
<el-row>
<el-col :span="6">
<el-form-item label="操作时间">
<el-date-picker class="formItem" v-model="selectForm.dateList" type="daterange"
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" clearable>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="ml20 mb20">
<el-button type="primary" size="small" icon="el-icon-search" :loading="loading" @click="selectLog(1)">查 询
</el-button>
</div>
<Tables ref="archiveDataTables" ductName="archiveDataTables" :order="true" :border='true' :data="data"
:headerData="tableHeader" tableAlign="center" :showOverflowTooltip="true" :height="tableHeight"
:page="selectForm.page" :limitSize="selectForm.size" :pageSizes="[20]" :totalCount="total"
:loading="loading" @currentChange="currentChange">
<template v-slot:queryParameter="scope">
<el-popover placement="top" width="350" trigger="hover">
<ul style="height:300px;overflow-y:scroll;"
v-if="scope.row.queryParameter != null && scope.row.queryParameter != ''">
<li v-for="(item, index) in JSON.stringify(JSON.parse(scope.row.queryParameter)).split(',')"
:key="index" style="border-bottom:1px solid #E4E7ED;margin-bottom:5px">{{ item }}</li>
</ul>
<el-button type="text" slot="reference">查 看</el-button>
</el-popover>
</template>
<template v-slot:downloadPath="scope">
<el-button v-if="scope.row.downloadPath != null && scope.row.status == 1" type="text" size="mini"
icon="el-icon-download" @click="download(scope.row)">下载
</el-button>
<span v-else>暂无下载</span>
</template>
</Tables>
</div>
</template>
<script>
import { findArchiveCargoLog, isExistZip } from "@/api/system/logConfig.js";
import { downLoadZip } from "@/utils/zipdownload";
export default {
data() {
return {
selectForm: {
dateList: [],
page: 1,
size: 20
},
data: [],
tableHeader: this.tableHeaders['archiveData'],
tableHeight: 300,
total: 0,
loading: false,
}
},
created() {
this.selectLog()
},
mounted() {
// this.tableHeight = window.innerHeight - this.$refs.archiveDataForm.$el.offsetHeight - 200
},
methods: {
selectLog(val) {
this.loading = true
if (val == 1) {
this.selectForm.page = 1
}
let obj = {}
if (this.selectForm.dateList && this.selectForm.dateList.length > 0) {
obj.createTimeStart = this.selectForm.dateList[0]
obj.createTimeEnd = this.selectForm.dateList[1]
}
obj.page = this.selectForm.page
obj.size = this.selectForm.size
findArchiveCargoLog(obj).then(res => {
this.loading = false
if (res.code === 200) {
this.data = res.data.list
this.total = res.data.total
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
this.loading = true
console.log(err)
})
},
download(val) {
isExistZip(val).then(res => {
if (res.code === 200) {
setTimeout(() => {
let url = '/archiveCargoLog/downloadZip'
let filename = val.packageName
downLoadZip(url, val, filename)
}, 500);
} else {
this.msgWarning(res.msg)
}
}).catch(err => {
console.log(err)
})
},
currentChange(val) {
this.selectForm.page = val.page
this.selectLog()
}
}
}
</script>
<style lang="scss" scoped>
</style>