|  |  |  | 
|---|
|  |  |  | <el-form-item label="" prop="name"> | 
|---|
|  |  |  | <el-input v-model="searchForm.name" placeholder="请输入标题" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="" prop="content"> | 
|---|
|  |  |  | <el-input v-model="searchForm.content" placeholder="请输入内容" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | <el-form-item label="" prop="info"> | 
|---|
|  |  |  | <el-input v-model="searchForm.info" placeholder="请输入内容" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="" prop="personType"> | 
|---|
|  |  |  | <el-select v-model="searchForm.deviceType" placeholder="请选择设备类型"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-option label="下发失败" value="3"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="起止时间" prop="eventType"> | 
|---|
|  |  |  | <el-date-picker @change="seleTime" v-model="time" type="datetimerange" format="yyyy-MM-dd HH:mm:ss" | 
|---|
|  |  |  | value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> | 
|---|
|  |  |  | </el-date-picker> | 
|---|
|  |  |  | <el-form-item label="" prop="eventType"> | 
|---|
|  |  |  | <el-date-picker @change="changeDate" v-model="searchForm.startDate" type="datetime" | 
|---|
|  |  |  | format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" /> | 
|---|
|  |  |  | <el-date-picker @change="changeDate" v-model="searchForm.endDate" type="datetime" format="yyyy-MM-dd HH:mm:ss" | 
|---|
|  |  |  | value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" /> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-radio-group v-model="searchForm.radio" size="small" @input="changeRadio"> | 
|---|
|  |  |  | <el-radio-button label="0">当天</el-radio-button> | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | changeDate(e) { | 
|---|
|  |  |  | if ((this.searchForm.startDate && this.searchForm.endDate) && this.searchForm.startDate > this.searchForm.endDate) { | 
|---|
|  |  |  | this.searchForm.endDate = this.searchForm.startDate | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | return this.$message.error('开始时间不能大于结束时间') | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeRadio(e) { | 
|---|
|  |  |  | if (e === '0') { | 
|---|
|  |  |  | this.searchForm.startDate = timeForMat(0)[0] | 
|---|
|  |  |  | this.searchForm.endDate = timeForMat(0)[1] | 
|---|
|  |  |  | this.time = timeForMat(0) | 
|---|
|  |  |  | // this.time = timeForMat(0) | 
|---|
|  |  |  | } else if (e === '1') { | 
|---|
|  |  |  | this.searchForm.startDate = timeForMat(6)[0] | 
|---|
|  |  |  | this.searchForm.endTime = timeForMat(6)[1] | 
|---|
|  |  |  | this.time = timeForMat(6) | 
|---|
|  |  |  | this.searchForm.endDate = timeForMat(6)[1] | 
|---|
|  |  |  | // this.time = timeForMat(6) | 
|---|
|  |  |  | } else if (e === '2') { | 
|---|
|  |  |  | this.searchForm.startDate= timeForMat(29)[0] | 
|---|
|  |  |  | this.searchForm.endTime = timeForMat(29)[1] | 
|---|
|  |  |  | this.time = timeForMat(29) | 
|---|
|  |  |  | this.searchForm.startDate = timeForMat(29)[0] | 
|---|
|  |  |  | this.searchForm.endDate = timeForMat(29)[1] | 
|---|
|  |  |  | // this.time = timeForMat(29) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | seleTime(e) { | 
|---|
|  |  |  | this.searchForm.startTime = e[0] | 
|---|
|  |  |  | this.searchForm.endTime = e[1] | 
|---|
|  |  |  | this.searchForm.radio = null | 
|---|
|  |  |  | if ((this.searchForm.startDate && this.searchForm.endDate) && this.searchForm.startDate > this.searchForm.endDate) { | 
|---|
|  |  |  | this.searchForm.startDate = this.searchForm.endDate | 
|---|
|  |  |  | return this.$message.error('开始时间不能大于结束时间') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | reset() { | 
|---|
|  |  |  | this.$refs.searchForm.resetFields() | 
|---|
|  |  |  | this.time = [] | 
|---|
|  |  |  | this.searchForm = { | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | info: '', | 
|---|
|  |  |  | deviceType: '', | 
|---|
|  |  |  | hkStatus: '', | 
|---|
|  |  |  | startDate: '', | 
|---|
|  |  |  | endDate: '', | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.searchForm.radio = '' | 
|---|
|  |  |  | // this.changeRadio('0') | 
|---|
|  |  |  | this.search() | 
|---|