| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:jkcabinet:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="设å¤ç¼å·" prop="code"> |
| | | <el-input v-model="searchForm.code" placeholder="请è¾å
¥è®¾å¤ç¼å·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <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="runStatus"> |
| | | <el-select v-model="searchForm.runStatus" placeholder="è¯·éæ©" @change="search"> |
| | | <el-option label="å
¨é¨" value=""></el-option> |
| | | <el-option label="å¨çº¿" :value="0"></el-option> |
| | | <el-option label="离线" :value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="status"> |
| | | <el-select v-model="searchForm.status" placeholder="è¯·éæ©" @change="search"> |
| | | <el-option label="å
¨é¨" value=""></el-option> |
| | | <el-option label="å¯ç¨" :value="0"></el-option> |
| | | <el-option label="ç¦ç¨" :value="1"></el-option> |
| | | </el-select> |
| | | </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" v-permissions="['business:jkcabinet:create', 'business:jkcabinet:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaJkCabinetWindow.open('æ°å»ºè®¾å¤')" icon="el-icon-plus" v-permissions="['business:jkcabinet:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="warning" @click="$refs.alcoholTest.open('æ°å»ºé
ç²¾æ£æµé
ç½®', form)">é
ç²¾æ£æµé
ç½®</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="code" label="设å¤ç¼å·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="设å¤åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="devId" label="设å¤ID" min-width="100px"></el-table-column> |
| | | <el-table-column prop="linkAddr" label="é讯å°å" min-width="100px"></el-table-column> |
| | | <el-table-column prop="port" label="端å£å·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="location" label="æå¨ä½ç½®" min-width="100px"></el-table-column> |
| | | <el-table-column label="ææ ¼æ°é" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button @click="$refs.cabinetDetails.open(row.name + '-ææ ¼ä¿¡æ¯', row.id)">{{row.gridNum}}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="è¿è¡ç¶æ" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-link type="success" :underline="false" v-if="row.runStatus === 0">å¨çº¿</el-link> |
| | | <el-link type="danger" :underline="false" v-if="row.runStatus === 1">离线</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-model="row.status" |
| | | @change="changeStatus($event, row.id)" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="0" |
| | | :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:jkcabinet:update', 'business:jkcabinet:delete'])" |
| | | label="æä½" |
| | | min-width="200" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.cabinetDetails.open(row.name + '-ææ ¼ä¿¡æ¯', row.id)">ç»å®é¥å</el-button> |
| | | <el-button type="text" @click="$refs.operaJkCabinetWindow.open('ç¼è¾é¥åæåºæ¬ä¿¡æ¯è¡¨', row)" v-permissions="['business:jkcabinet:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" v-permissions="['business:jkcabinet:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaJkCabinetWindow ref="operaJkCabinetWindow" @success="handlePageChange"/> |
| | | <!-- æå详æ
--> |
| | | <CabinetDetails ref="cabinetDetails" /> |
| | | <!-- æ°å¢é
ç²¾æ£æµ --> |
| | | <AlcoholTest ref="alcoholTest" @success="GetCabinetConfig" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaJkCabinetWindow from '@/components/business/OperaJkCabinetWindow' |
| | | import CabinetDetails from '@/components/business/cabinetDetails' |
| | | import AlcoholTest from '@/components/business/alcoholTest' |
| | | import { updateStatusById, getCabinetConfig } from '@/api/business/jkCabinet' |
| | | export default { |
| | | name: 'JkCabinet', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails, AlcoholTest}, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | code: '', |
| | | name: '', |
| | | status: '', |
| | | runStatus: '' |
| | | }, |
| | | form: null |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'é¥åæåºæ¬ä¿¡æ¯è¡¨', |
| | | api: '/business/jkCabinet', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | this.GetCabinetConfig() |
| | | }, |
| | | methods: { |
| | | changeStatus(status, id) { |
| | | updateStatusById({ id, status }) |
| | | .then(res => { |
| | | this.search() |
| | | }) |
| | | }, |
| | | GetCabinetConfig() { |
| | | getCabinetConfig() |
| | | .then(res => { |
| | | this.form = res |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |