| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
| | | <el-form-item title="æ è¯ç¬¦" prop="no"> |
| | | <el-input v-model="searchForm.no" placeholder="请è¾å
¥è®¾å¤å°åå" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item title="设å¤å·" prop="doorNo"> |
| | | <el-input v-model="searchForm.doorNo" 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" v-permissions="['business:device:create', 'business:device:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaDeviceWindow.open('æ°å»ºç©ºè°')" icon="el-icon-plus" v-permissions="['business:device:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:device:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="åç§°" fixed min-width="150" align="center"></el-table-column> |
| | | <el-table-column prop="no" label="空è°å°åå" min-width="100" align="center" ></el-table-column> |
| | | <el-table-column prop="doorNo" label="设å¤å·" min-width="120" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="manufature" label="åå" align="center" min-width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="regionPathName" align="center" min-width="100" label="æå¨ä½ç½®"></el-table-column> |
| | | <el-table-column prop="ip" label="IP" min-width="150" align="center" show-overflow-tooltip ></el-table-column> |
| | | <el-table-column prop="port" label="端å£" align="center" ></el-table-column> |
| | | <el-table-column prop="isUsed" label="æ¯å¦ä½¿ç¨"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeUsed($event, row)" v-model="row.isUsed" active-color="#13ce66" |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="doorNameObj.pwdLevel" label="å¯ç ç级" align="center" min-width="150"></el-table-column> |
| | | <el-table-column prop="doorNameObj.pwd" label="å¯ç " align="center"> |
| | | <template slot-scope="{row}"> |
| | | <span :class=" 'blue'">{{row.showPwd?row.doorNameObj.pwd:'******'}}</span> |
| | | <el-button style="margin-left: 10px" v-if="row.doorNameObj.pwd!=null" |
| | | @click.native.p.prevent="showPassward(row)" type="text"> |
| | | <i class="el-icon-view" :class="row.showPwd?'red':'blue'" :title="row.showPwd?'éè':'æ¾ç¤º'"></i> |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="doorNameObj.userCode" label="æä½è
代ç " align="center" min-width="150"></el-table-column> |
| | | <el-table-column prop="editDate" label="æè¿æ´æ°æ¶é´" align="center" min-width="150"></el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | min-width="280" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaDeviceWindow.open('ç¼è¾ç©ºè°', row)" icon="el-icon-edit" v-permissions="['business:device:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.operaDeviceDataWindow.open('æ¥çç©ºè°æ°æ®', row)" icon="el-icon-view" v-permissions="['business:device:update']">æ°æ®</el-button> |
| | | <el-button type="text" @click="send(row,1)" icon="el-icon-circle-check" v-permissions="['business:device:update']">æå¼</el-button> |
| | | <el-button type="text" class="red" @click="send(row,0)" icon="el-icon-circle-close" v-permissions="['business:device:update']">å
³é</el-button> |
| | | <el-button type="text" class="red" @click="readData(row)" icon="el-icon-circle-close" v-permissions="['business:device:update']">è¯»åæ°æ®</el-button> |
| | | <el-button type="text" class="red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:device:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" > |
| | | </pagination> |
| | | </template> |
| | | <el-dialog |
| | | :visible.sync="visibleSend" |
| | | style="z-index: 100000" |
| | | append-to-body |
| | | width="50%" |
| | | height="50%" |
| | | :title="'æ§å¶ç©ºè°-ã'+ form.name+'ã'" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="æ§è¡æä½ï¼" > |
| | | <b class="green" v-if="form.status ===1">æå¼</b> |
| | | <b class="red" v-else>å
³é</b> |
| | | </el-form-item> |
| | | <el-form-item label="æææ¶é´" prop="cmdDate"> |
| | | <el-date-picker type="datetime" v-model="form.cmdDate" value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="è¯·éæ©æææ¶é´" /> |
| | | </el-form-item> |
| | | <!-- <p class="tip-warn" style="width: 100%;"><i class="el-icon-warning"></i></p> --> |
| | | </el-form> |
| | | <template v-slot:footer > |
| | | <el-button @click="sendAction(0)" type="primary" v-if="form.status === 1" :loading="isWorkSending">确认æå¼</el-button> |
| | | <el-button @click="sendAction(1)" type="danger" v-if="form.status !== 1" :loading="isWorkSending">确认å
³é</el-button> |
| | | <el-button @click="sendClose()">è¿å</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaDeviceDianbiaoWindow ref="operaDeviceWindow" @success="handlePageChange"/> |
| | | <OperaDeviceDataListWindow ref="operaDeviceDataWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaDeviceDataListWindow from '@/components/business/OperaDianbiaoDataListWindow' |
| | | import OperaDeviceDianbiaoWindow from '@/components/business/OperaDeviceDianbiaoWindow' |
| | | export default { |
| | | name: 'DeviceDuanluqi', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaDeviceDianbiaoWindow, OperaDeviceDataListWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | doorNo: '', |
| | | no: '', |
| | | name: '', |
| | | type: 7 |
| | | }, |
| | | isWorkSending: false, |
| | | form: { |
| | | id: '', |
| | | status: null, |
| | | name: null, |
| | | cmdDate: null |
| | | }, |
| | | visibleSend: false, |
| | | options: [], |
| | | rules: { |
| | | cmdDate: [{ required: true, message: 'è¯·éæ©æä½æææ¶é´' }] |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ä¿¡æ¯è¡¨', |
| | | api: '/business/device', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeUsed (e, row) { |
| | | this.api.updateUsedById({ |
| | | id: row.id, |
| | | isUsed: e |
| | | }) |
| | | }, |
| | | showPassward (row) { |
| | | if (!row.showPwd) { |
| | | this.$set(row, 'showPwd', true) |
| | | } else { |
| | | this.$set(row, 'showPwd', false) |
| | | } |
| | | }, |
| | | sendAction (status) { |
| | | this.form.status = status |
| | | this.$dialog.actionConfirm('确认è¿è¡ç©ºè°ã' + (this.form.status === 1 ? 'æå¼' : 'å
³é') + 'ãæä½åï¼', 'æä½ç¡®è®¤æé') |
| | | .then(() => { |
| | | console.log(this.form) |
| | | this.isWorkSending = true |
| | | this.api.dianbaoCmd(this.form) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'è¯·æ±æå') |
| | | this.handlePageChange() |
| | | }) |
| | | .catch(e => { |
| | | }) |
| | | .finally(() => { |
| | | this.isWorkSending = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | readData (row) { |
| | | this.api.dianbiaoData({ id: row.id }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'è¯·æ±æå') |
| | | this.handlePageChange() |
| | | }) |
| | | .catch(e => { |
| | | }) |
| | | .finally(() => { |
| | | this.isWorkSending = false |
| | | }) |
| | | }, |
| | | send (row, type) { |
| | | this.visibleSend = true |
| | | this.form = { id: row.id, name: row.name, cmdDate: null, status: type} |
| | | }, |
| | | sendClose () { |
| | | this.visibleSend = false |
| | | this.isWorkSending = false |
| | | this.form = { id: '', name: '', status: '', cmdDate: '' } |
| | | } |
| | | } |
| | | } |
| | | </script> |