From 7233f8c157e323f97a074753a2c4bd463f960b5c Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 12 五月 2026 14:02:36 +0800
Subject: [PATCH] 新增智能电表、空调管理
---
admin/src/views/business/deviceDianbiao.vue | 39 +++++++++++++++++++++++++++++++--------
1 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/admin/src/views/business/deviceDianbiao.vue b/admin/src/views/business/deviceDianbiao.vue
index 85a37d0..e92031b 100644
--- a/admin/src/views/business/deviceDianbiao.vue
+++ b/admin/src/views/business/deviceDianbiao.vue
@@ -11,6 +11,13 @@
<el-form-item title="璁惧鍙�" prop="doorNo">
<el-input v-model="searchForm.doorNo" placeholder="璇疯緭鍏ヨ澶囧彿" @keypress.enter.native="search"></el-input>
</el-form-item>
+ <el-form-item label="杩愯鐘舵��" prop="status">
+ <el-select v-model="searchForm.status" @keypress.enter.native="search" clearable placeholder="閫夋嫨鐘舵��">
+ <el-option label="鍚堥椄" value="0"></el-option>
+ <el-option label="寮�闂�" value="1"></el-option>
+ <el-option label="寮�闂�" value="2"></el-option>
+ </el-select>
+ </el-form-item>
<section>
<el-button type="primary" @click="search">鎼滅储</el-button>
<el-button @click="reset">閲嶇疆</el-button>
@@ -19,7 +26,8 @@
<!-- 琛ㄦ牸鍜屽垎椤� -->
<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 type="primary" @click="synchronousData">鍚屾</el-button></li>
+<!-- <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
@@ -27,14 +35,11 @@
:data="tableData.list"
stripe >
<el-table-column type="selection" width="55"></el-table-column>
+ <el-table-column prop="no" label="琛ㄥ彿" min-width="100" align="center" ></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="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="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="鏄惁浣跨敤">
@@ -114,6 +119,7 @@
import Pagination from '@/components/common/Pagination'
import OperaDeviceDataListWindow from '@/components/business/OperaDianbiaoDataListWindow'
import OperaDeviceDianbiaoWindow from '@/components/business/OperaDeviceDianbiaoWindow'
+import { syncDevices } from '@/api/business/device'
export default {
name: 'DeviceDuanluqi',
extends: BaseTable,
@@ -197,12 +203,29 @@
},
send (row, type) {
this.visibleSend = true
- this.form = { id: row.id, name: row.name, cmdDate: null, status: type}
+ 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: '' }
+ },
+ synchronousData () {
+ this.$dialog.actionConfirm('鎿嶄綔纭鎻愰啋', '鎮ㄧ‘璁ゅ悓姝ュ叏閮ㄤ俊鎭悧锛�')
+ .then(() => {
+ this.isWorking.delete = true
+ syncDevices({ type: 6 })
+ .then(res => {
+ this.$tip.apiSuccess(res || '鍚屾鎴愬姛')
+ this.search()
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking.delete = false
+ })
+ }) .catch(() => {})
}
}
}
--
Gitblit v1.9.3