| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:device:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item title="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar"> |
| | | <li><el-button type="primary" @click="synchronousData">忥</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column label="åºå·" width="55" fixed><template slot-scope="scope" >{{scope.$index+1}}</template></el-table-column> |
| | | <el-table-column prop="name" label="åç§°"></el-table-column> |
| | | <el-table-column prop="hkId" label="广æç¹å¯ä¸æ è¯" min-width="200"></el-table-column> |
| | | <el-table-column prop="channelInfo" label="广æç¹ç±»å"></el-table-column> |
| | | <el-table-column prop="channelNo" label="ééå·"></el-table-column> |
| | | <el-table-column prop="regionName" label="åºååç§°"></el-table-column> |
| | | <el-table-column prop="hkDate" label="忥æ¶é´"></el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <!-- <OperaDeviceWindow ref="operaDeviceWindow" @success="handlePageChange"/>--> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaDeviceWindow from '@/components/business/OperaDeviceWindow' |
| | | import { syncDevices, updateEntranceById } from '@/api/business/device' |
| | | export default { |
| | | name: 'Device', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaDeviceWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | doorName: '', |
| | | regionPathName: '', |
| | | isEntrance: '', |
| | | online: '', |
| | | type: 3 |
| | | }, |
| | | options: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ä¿¡æ¯è¡¨', |
| | | api: '/business/device', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeManufature(e, row) { |
| | | updateEntranceById({ |
| | | id: row.id, |
| | | isEntrance: e |
| | | }) |
| | | }, |
| | | synchronousData () { |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | syncDevices({type: 3}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | } |
| | | } |
| | | </script> |