| | |
| | | <el-date-picker v-model="mytime" type="daterange" range-separator="-" start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | <!-- <el-input placeholder="选择时间范围" v-model="timeArea"></el-input> --> |
| | | </div> |
| | | <div class="find"> |
| | | <el-button type="primary" icon="el-icon-search" @click="setTableData">查询</el-button> |
| | | <el-button icon="el-icon-delete-solid">重置</el-button> |
| | | <el-button icon="el-icon-delete-solid" @click="resetTableData">重置</el-button> |
| | | </div> |
| | | </div> |
| | | </header> |
| | |
| | | </template> |
| | | <script> |
| | | import helper from '@/utils/mydate' |
| | | import {parseTime} from '@/utils/index' |
| | | import { createNamespacedHelpers } from "vuex"; |
| | | const { mapActions } = createNamespacedHelpers("logs"); |
| | | export default { |
| | |
| | | ], |
| | | mysort: 0, |
| | | tempList: [], |
| | | timeArea: '', |
| | | operationType: '全部', |
| | | operationTypeList: [], |
| | | mytime: '', |
| | | mytime: ['',''], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | methods: { |
| | | ...mapActions(["getLogsList", 'getLogsOperationType', 'exportLogs']), |
| | | // 重置 |
| | | resetTableData(){ |
| | | const {setTableData} = this |
| | | this.operationType = '全部' |
| | | this.mytime = ['',''] |
| | | this.context = '' |
| | | setTableData(); |
| | | }, |
| | | // 导出日志 |
| | | async handleExport() { |
| | | const { currentPage, pageSize, context, operationType } = this; |
| | |
| | | }, |
| | | // 获取日志数据 |
| | | async getLogList() { |
| | | const { currentPage, pageSize, context, operationType, mysort } = this; |
| | | const { currentPage, pageSize, context, operationType, mysort,mytime } = this; |
| | | console.log(mytime) |
| | | let arr = await this.getLogsList({ |
| | | content: context, |
| | | current: currentPage, |
| | | endTime: '', |
| | | endTime: mytime[1] !==''?parseTime(mytime[1]):'', |
| | | id: '', |
| | | operationType: operationType === '全部' ? '' : operationType, |
| | | portEquipment: '', |
| | | size: pageSize, |
| | | startTime: '', |
| | | startTime: mytime[0] !==''?parseTime(mytime[0]):'', |
| | | sort: mysort |
| | | }) |
| | | console.log(arr) |