代码优化
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="head-container">
|
||||
<el-input v-model="query.value" clearable size="small" placeholder="请输入你要搜索的内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-input v-model="query.blurry" clearable size="small" placeholder="请输入你要搜索的内容" style="width: 200px;" class="filter-item" />
|
||||
<el-date-picker
|
||||
v-model="query.date"
|
||||
v-model="query.createTime"
|
||||
:default-time="['00:00:00','23:59:59']"
|
||||
type="daterange"
|
||||
range-separator=":"
|
||||
@@ -14,45 +14,24 @@
|
||||
/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="$parent.toQuery">搜索</el-button>
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="download"
|
||||
>导出</el-button>
|
||||
</div>
|
||||
<el-button
|
||||
:loading="$parent.downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="$parent.downloadMethod"
|
||||
>导出</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { downloadFile } from '@/utils/index'
|
||||
import { downloadLog } from '@/api/monitor/log'
|
||||
export default {
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
downloadLoading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
download() {
|
||||
this.$parent.beforeInit()
|
||||
this.downloadLoading = true
|
||||
downloadLog(this.$parent.params).then(result => {
|
||||
downloadFile(result, '系统日志列表', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user