| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <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 |
| | | :height="tableHeightNew" |
| | | 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="channelNo" label="å¼å
³åºå·" align="center" min-width="100"></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="editDate" label="æè¿æ´æ°æ¶é´" align="center" min-width="150"></el-table-column> |
| | | <el-table-column prop="channelParam" label="æ§å¶å¼å
³åæ°" align="center" min-width="100"> |
| | | <el-table-column prop="channelInfo" label="æ§å¶å¼å
³åºå·" align="center" min-width="100"></el-table-column> |
| | | <el-table-column prop="level" label="ç©ºé²æ¶é´(ç§)" align="center" min-width="100"></el-table-column> |
| | | <el-table-column label="空é²çµæµéå¼" align="center" min-width="120"> |
| | | <template slot-scope="{row}"> |
| | | <span >{{ row.doorNameObj.max || '-'}}A</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> |
| | | <el-table-column prop="doorNameObj" label="MQTTé
ç½®åæ°" align="center"> |
| | | <el-table-column prop="doorNameObj.mqttIp" label="IP" min-width="120" align="center"></el-table-column> |
| | | <el-table-column prop="doorNameObj.mqttPort" label="端å£" min-width="80" align="center"></el-table-column> |
| | | <el-table-column prop="doorNameObj.mqttUsername" label="è´¦å·" align="center"></el-table-column> |
| | | <el-table-column prop="doorNameObj.mqttPassword" label="å¯ç " align="center"> |
| | | <template slot-scope="{row}"> |
| | | <span :class=" 'blue'">{{row.showPwd?row.doorNameObj.mqttPassword:'******'}}</span> |
| | | <el-button style="margin-left: 10px" v-if="row.doorNameObj.mqttPassword!=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> |
| | | <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="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="channelNo"> |
| | | <el-input v-model="form.channelNo" type="text" placeholder="请è¾å
¥å¼å
³åºå· ï¼å¤ä¸ªç¨è±æéå·éå¼ï¼å¦ 1,2,3" v-trim/> |
| | | </el-form-item> |
| | | <p class="tip-warn" style="width: 100%;"><i class="el-icon-warning"></i>设å¤åå§å¼å
³åºå·ä¿¡æ¯ï¼{{form.channelNo1}}ï¼æ§å¶å¤ä¸ªå¼å
³ï¼è¯·ç¨è±æéå·éå¼ï¼å¦ 1,2;</p> |
| | | </el-form> |
| | | <template v-slot:footer > |
| | | <el-button @click="sendAction()" type="primary" v-if="form.status === 1" :loading="isWorkSending">确认å¼é¸</el-button> |
| | | <el-button @click="sendAction()" type="danger" v-if="form.status !== 1" :loading="isWorkSending">确认å
³é¸</el-button> |
| | | <el-button @click="sendClose()">è¿å</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaDeviceDuanluqiWindow 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/OperaDeviceDataListWindow' |
| | | import OperaDeviceDuanluqiWindow from '@/components/business/OperaDeviceDuanluqiWindow' |
| | | export default { |
| | | name: 'DeviceDuanluqi', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaDeviceDuanluqiWindow ,OperaDeviceDataListWindow}, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | doorNo: '', |
| | | no: '', |
| | | name: '', |
| | | type: 5 |
| | | }, |
| | | isWorkSending: false, |
| | | form: { |
| | | id: '', |
| | | name: '', |
| | | channelNo: '', |
| | | channelNo1: '', |
| | | status: null |
| | | }, |
| | | visibleSend: false, |
| | | options: [], |
| | | rules: { |
| | | channelNo: [{ required: true, message: '请è¾å
¥éè¦æä½çå¼å
³åºå·', trigger: 'blur' }], |
| | | } |
| | | } |
| | | }, |
| | | 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 () { |
| | | if (!this.form.channelNo) { |
| | | return |
| | | } |
| | | this.$dialog.actionConfirm('确认è¿è¡æè·¯å¨ã' + (this.form.status === 1 ? 'å¼é¸' : 'å
³é¸') + 'ãæä½åï¼', 'æä½ç¡®è®¤æé') |
| | | .then(() => { |
| | | this.isWorkSending = true |
| | | this.api.duanluqiCmd(this.form) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'è¯·æ±æå') |
| | | this.sendClose() |
| | | }) |
| | | .catch(e => { |
| | | }) |
| | | .finally(() => { |
| | | this.isWorkSending = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | send (row, type) { |
| | | this.visibleSend = true |
| | | this.form = { id: row.id, name: row.name, channelNo: row.channelNo, status: type ,channelNo1:row.channelNo} |
| | | }, |
| | | sendClose () { |
| | | this.visibleSend = false |
| | | this.isWorkSending = false |
| | | this.form = { id: '', name: '', channelNo: '', status: '',channelNo1:'' } |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |