From 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 13 一月 2026 10:00:37 +0800
Subject: [PATCH] 优化

---
 admin/src/views/business/deviceBroadcastChannel.vue |  166 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 166 insertions(+), 0 deletions(-)

diff --git a/admin/src/views/business/deviceBroadcastChannel.vue b/admin/src/views/business/deviceBroadcastChannel.vue
new file mode 100644
index 0000000..63bc99c
--- /dev/null
+++ b/admin/src/views/business/deviceBroadcastChannel.vue
@@ -0,0 +1,166 @@
+<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>
+            <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">
+                <li><el-button type="primary" @click="synchronousData">鍚屾</el-button></li>
+            </ul>
+            <el-table
+                :height="tableHeightNew"
+                v-loading="isWorking.search"
+                :data="tableData.list"
+                stripe
+            >
+              <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
+                  label="鎿嶄綔"
+                  align="center"
+                  min-width="120"
+                  fixed="right"
+              >
+                <template slot-scope="{row}">
+                  <el-button type="text" @click="send(row)" icon="el-icon-edit" >鍙戦�佹挱鎶�</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" >
+          <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>
+    </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import { syncDevices, updateEntranceById } from '@/api/business/device'
+export default {
+  name: 'Device',
+  extends: BaseTable,
+  components: { TableLayout, Pagination },
+  data () {
+    return {
+      // 鎼滅储
+      searchForm: {
+        doorName: '',
+        regionPathName: '',
+        isEntrance: '',
+        online: '',
+        type: 3
+      },
+      isWorkSending: false,
+      form: {
+        sendInfo: '',
+        id: '',
+        hkId: '',
+        name: ''
+      },
+      visibleSend: false,
+      options: []
+    }
+  },
+  created () {
+    this.config({
+      module: '璁惧淇℃伅琛�',
+      api: '/business/device',
+      'field.id': 'id',
+      'field.main': 'id'
+    })
+    this.search()
+  },
+  methods: {
+    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: '' }
+    },
+    changeManufature (e, row) {
+      updateEntranceById({
+        id: row.id,
+        isEntrance: e
+      })
+    },
+    synchronousData () {
+      this.$dialog.actionConfirm('鎿嶄綔纭鎻愰啋', '鎮ㄧ‘璁ゅ悓姝ュ叏閮ㄤ俊鎭悧锛�')
+        .then(() => {
+          this.isWorking.delete = true
+          syncDevices({ type: 3 })
+            .then(res => {
+              this.$tip.apiSuccess(res || '鍚屾鎴愬姛')
+              this.search()
+            })
+            .catch(e => {
+              //  this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking.delete = false
+            })
+        })
+        .catch(() => {})
+    }
+  }
+}
+</script>

--
Gitblit v1.9.3