|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <a-card size="small" :bordered="false" class="noticeManagementList-wrap">
|
|
|
+ <a-card size="small" :bordered="false" class="dowloadFIle-wrap">
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<!-- 搜索条件 -->
|
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
@@ -7,22 +7,28 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="创建时间">
|
|
|
- <rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
+ <a-range-picker
|
|
|
+ id="dowloadFIle-beginDate"
|
|
|
+ showTime
|
|
|
+ :disabled-date="disabledDate"
|
|
|
+ v-model="time"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ @change="dateChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="文件名称">
|
|
|
- <a-input id="noticeManagementList-fileName" v-model.trim="queryParam.fileName" allowClear placeholder="请输入文件名称"/>
|
|
|
+ <a-input id="dowloadFIle-fileName" v-model.trim="queryParam.fileName" allowClear placeholder="请输入文件名称"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="状态">
|
|
|
- <v-select code="EXPORT_TASK_STATE" id="noticeManagementList-taskState" v-model="queryParam.taskState" allowClear placeholder="请选择状态"></v-select>
|
|
|
+ <v-select code="EXPORT_TASK_STATE" id="dowloadFIle-taskState" v-model="queryParam.taskState" allowClear placeholder="请选择状态"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="noticeManagementList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="noticeManagementList-reset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="searchForm" :disabled="disabled" id="dowloadFIle-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="dowloadFIle-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -54,21 +60,27 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import moment from 'moment'
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
+import getDate from '@/libs/getDate.js'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import { taskList, dowloadFile } from '@/api/dowloadFile'
|
|
|
-import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
export default {
|
|
|
name: 'DowloadFile',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, VSelect, rangeDate },
|
|
|
+ components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
tableHeight: 0,
|
|
|
+ // 默认时间
|
|
|
+ time: [
|
|
|
+ moment(getDate.getRecentTime().starttime, 'YYYY-MM-DD HH:mm:ss'),
|
|
|
+ moment(getDate.getRecentTime().endtime, 'YYYY-MM-DD HH:mm:ss')
|
|
|
+ ],
|
|
|
queryParam: { // 查询条件
|
|
|
- beginDate: '',
|
|
|
- endDate: '',
|
|
|
+ beginDate: getDate.getRecentTime().starttime,
|
|
|
+ endDate: getDate.getRecentTime().endtime,
|
|
|
fileName: '',
|
|
|
taskState: undefined
|
|
|
},
|
|
@@ -108,25 +120,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ disabledDate (current) {
|
|
|
+ return current && (current < moment(getDate.getRecentTime().starttime).subtract('days', 1) || current > moment().endOf('day'))
|
|
|
+ },
|
|
|
dowloadExcel (url) {
|
|
|
dowloadFile(url, '')
|
|
|
- // const elt = document.createElement('a')
|
|
|
- // elt.setAttribute('href', url)
|
|
|
- // elt.setAttribute('download', '')
|
|
|
- // elt.style.display = 'none'
|
|
|
- // document.body.appendChild(elt)
|
|
|
- // elt.click()
|
|
|
- // document.body.removeChild(elt)
|
|
|
},
|
|
|
// 时间 change
|
|
|
- dateChange (date) {
|
|
|
- this.queryParam.beginDate = date[0] ? date[0] : ''
|
|
|
- this.queryParam.endDate = date[1] ? date[1] : ''
|
|
|
+ dateChange (date, dateString) {
|
|
|
+ this.queryParam.beginDate = dateString[0] ? moment(dateString[0]).format('YYYY-MM-DD HH:mm:ss') : ''
|
|
|
+ this.queryParam.endDate = dateString[1] ? moment(dateString[1]).format('YYYY-MM-DD HH:mm:ss') : ''
|
|
|
+ },
|
|
|
+ searchForm () {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.beginDate = null
|
|
|
- this.queryParam.endDate = null
|
|
|
+ this.time = [getDate.getRecentTime().starttime, getDate.getRecentTime().endtime]
|
|
|
+ this.queryParam.beginDate = getDate.getRecentTime().starttime
|
|
|
+ this.queryParam.endDate = getDate.getRecentTime().endtime
|
|
|
this.queryParam.fileName = ''
|
|
|
this.queryParam.type = undefined
|
|
|
this.queryParam.taskState = undefined
|