| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:platformbroadcastlog:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <div slot="search-form" ref="QueryFormRef"> |
| | | <el-form ref="searchForm" :model="searchForm" label-width="100px" inline> |
| | | <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> |
| | | <el-form-item label="" prop="personType"> |
| | | <el-select v-model="searchForm.deviceType" placeholder="è¯·éæ©è®¾å¤ç±»å"> |
| | | <el-option label="广æ" value="0"></el-option> |
| | | <el-option label="LED" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="eventType"> |
| | | <el-select v-model="searchForm.hkStatus" placeholder="è¯·éæ©ä¸åç¶æ"> |
| | | <el-option label="å¾
ä¸å" value="0"></el-option> |
| | | <el-option label="ä¸åä¸" value="1"></el-option> |
| | | <el-option label="ä¸åæå" value="2"></el-option> |
| | | <el-option label="ä¸å失败" value="3"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <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> |
| | | <el-radio-button label="1">è¿7天</el-radio-button> |
| | | <el-radio-button label="2">è¿30天</el-radio-button> |
| | | </el-radio-group> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:platformbroadcastlog:exportExcel']"> |
| | | <!-- |
| | | <li><el-button type="primary" :loading="isWorking.export" v-permissions="['business:platformbroadcastlog:exportExcel']" @click="exportExcel">导åº</el-button></li> |
| | | --> |
| | | </ul> |
| | | <el-table :max-height="tableHeight" v-loading="isWorking.search" :data="tableData.list" stripe> |
| | | <el-table-column prop="deviceType" label="设å¤ç±»å" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.deviceType == 0">广æ</span> |
| | | <span v-if="row.deviceType == 1">LED</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="hkStatus" label="ä¸åç¶æ" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.hkStatus == 0" style="color: #0c6ce3">å¾
ä¸å</span> |
| | | <span v-if="row.hkStatus == 1" style="color: #0c6ce3">ä¸åä¸</span> |
| | | <span v-if="row.hkStatus == 2" style="color: green">ä¸åæå</span> |
| | | <span v-if="row.hkStatus == 3" style="color: red">ä¸å失败</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="æ é¢" min-width="100px"></el-table-column> |
| | | <el-table-column prop="info" label="å
容" min-width="100px"></el-table-column> |
| | | <el-table-column prop="ids" label="设å¤ç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createDate" label="å建æ¶é´" min-width="100px"></el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> |
| | | </pagination> |
| | | </template> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { timeForMat } from '@/utils/util' |
| | | export default { |
| | | name: 'DeviceEvent', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination }, |
| | | data() { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | name: '', |
| | | info: '', |
| | | deviceType: '', |
| | | hkStatus: '', |
| | | startDate: '', |
| | | endDate: '', |
| | | radio: 0 |
| | | }, |
| | | time: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.config({ |
| | | module: 'LEDå¹¿æææ¾è®°å½', |
| | | api: '/business/platformBroadcastLog', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.changeRadio('0') |
| | | }, |
| | | mounted() { |
| | | this.$nextTick(() => { |
| | | this.tableHeight = document.body.scrollHeight - this.$refs.QueryFormRef.offsetHeight - 260 |
| | | }) |
| | | }, |
| | | 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) |
| | | } else if (e === '1') { |
| | | this.searchForm.startDate = timeForMat(6)[0] |
| | | this.searchForm.endDate = timeForMat(6)[1] |
| | | // this.time = timeForMat(6) |
| | | } else if (e === '2') { |
| | | this.searchForm.startDate = timeForMat(29)[0] |
| | | this.searchForm.endDate = timeForMat(29)[1] |
| | | // this.time = timeForMat(29) |
| | | } |
| | | 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() |
| | | } |
| | | } |
| | | } |
| | | </script> |