From f67e78a754fb8d7364d35aaafb0295690a4cc810 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 03 十二月 2025 10:37:06 +0800
Subject: [PATCH] 最新版本541200007
---
admin/src/views/business/deviceBroadcast.vue | 123 ++++++++++++++++++++++++++++++++++------
1 files changed, 103 insertions(+), 20 deletions(-)
diff --git a/admin/src/views/business/deviceBroadcast.vue b/admin/src/views/business/deviceBroadcast.vue
index 4731caa..baf4669 100644
--- a/admin/src/views/business/deviceBroadcast.vue
+++ b/admin/src/views/business/deviceBroadcast.vue
@@ -12,22 +12,49 @@
</el-form>
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
- <ul class="toolbar">
- <li><el-button type="primary" @click="synchronousData">鍚屾</el-button></li>
- </ul>
+ <ul class="toolbar" v-permissions="['business:device:create', 'business:device:delete']">
+ <li><el-button type="primary" :loading="isWorking.delete" @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
:height="tableHeightNew"
v-loading="isWorking.search"
:data="tableData.list"
stripe
>
+ <el-table-column type="selection" width="55"></el-table-column>
<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-column prop="name" label="鍚嶇О"></el-table-column>
+ <el-table-column prop="hkId" label="鍞竴鏍囪瘑" ></el-table-column>
+ <el-table-column prop="regionPathName" label="鎵�鍦ㄤ綅缃�"></el-table-column>
+ <el-table-column prop="no" label="搴忓垪鍙�" ></el-table-column>
+ <el-table-column prop="ip" label="IP鍦板潃" ></el-table-column>
+ <el-table-column prop="port" label="绔彛" ></el-table-column>
+ <el-table-column prop="doorId" label="璐﹀彿"></el-table-column>
+ <el-table-column prop="doorName" label="瀵嗙爜" align="center">
+ <template slot-scope="{row}">
+ <span :class=" 'blue'">{{row.showPwd?row.doorName:'******'}}</span>
+ <el-button style="margin-left: 10px" v-if="row.doorName!=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="editDate" label="鏈�杩戞洿鏂版椂闂�"></el-table-column>
+ <el-table-column
+ v-if="containPermissions(['business:devicerole:update', 'business:devicerole:delete'])"
+ label="鎿嶄綔"
+ align="center"
+ min-width="120"
+ 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="send(row)" icon="el-icon-edit" 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"
@@ -36,8 +63,26 @@
>
</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" >
+ <el-form-item label="鎾姤鍐呭" prop="name" required>
+ <el-input v-model="form.sendInfo" type="textarea" placeholder="璇疯緭鍏ユ挱鎶ュ唴瀹�" v-trim/>
+ </el-form-item>
+ </el-form>
+ <template v-slot:footer >
+ <el-button @click="sendBobao()" type="primary" :loading="isWorkSending">纭</el-button>
+ <el-button @click="sendClose()">杩斿洖</el-button>
+ </template>
+ </el-dialog>
<!-- 鏂板缓/淇敼 -->
- <OperaDeviceWindow ref="operaDeviceWindow" @success="handlePageChange"/>
+ <OperaDeviceBroadcastWindow ref="operaDeviceWindow" @success="handlePageChange"/>
</TableLayout>
</template>
@@ -45,12 +90,12 @@
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'
+import OperaDeviceBroadcastWindow from '@/components/business/OperaDeviceBroadcastWindow'
+import { syncDevices } from '@/api/business/device'
export default {
name: 'Device',
extends: BaseTable,
- components: { TableLayout, Pagination, OperaDeviceWindow },
+ components: { TableLayout, Pagination, OperaDeviceBroadcastWindow },
data () {
return {
// 鎼滅储
@@ -61,6 +106,14 @@
online: '',
type: 4
},
+ isWorkSending: false,
+ form: {
+ sendInfo: '',
+ id: '',
+ hkId: '',
+ name: ''
+ },
+ visibleSend: false,
options: []
}
},
@@ -74,23 +127,53 @@
this.search()
},
methods: {
- changeManufature(e, row) {
- updateEntranceById({
- id: row.id,
- isEntrance: e
- })
+ showPassward (row) {
+ if (!row.showPwd) {
+ this.$set(row, 'showPwd', true)
+ } else {
+ this.$set(row, 'showPwd', false)
+ }
+ },
+ sendBobao () {
+ if (!this.form.sendInfo) {
+ return
+ }
+ this.$dialog.actionConfirm('纭杩涜骞挎挱鎾姤鍚楋紵', '鎿嶄綔纭鎻愰啋')
+ .then(() => {
+ this.isWorkSending = true
+ this.api.sendBobao(this.form)
+ .then(res => {
+ this.$tip.apiSuccess(res || '鎾姤璇锋眰鎴愬姛')
+ this.sendClose()
+ })
+ .catch(e => {
+ })
+ .finally(() => {
+ this.isWorkSending = false
+ })
+ })
+ .catch(() => {})
+ },
+ send (row) {
+ this.visibleSend = true
+ this.form = { sendInfo: '', id: row.id, hkId: row.hkId, name: row.name }
+ },
+ sendClose () {
+ this.visibleSend = false
+ this.isWorkSending = false
+ this.form = { sendInfo: '', id: '', hkId: '', name: '' }
},
synchronousData () {
this.$dialog.actionConfirm('鎿嶄綔纭鎻愰啋', '鎮ㄧ‘璁ゅ悓姝ュ叏閮ㄤ俊鎭悧锛�')
.then(() => {
this.isWorking.delete = true
- syncDevices({type: 3})
+ syncDevices({ type: 4 })
.then(res => {
this.$tip.apiSuccess(res || '鍚屾鎴愬姛')
this.search()
})
.catch(e => {
- // this.$tip.apiFailed(e)
+ // this.$tip.apiFailed(e)
})
.finally(() => {
this.isWorking.delete = false
--
Gitblit v1.9.3