From dd6a43fdbadaaf6d646b3eb2ca0a63f58ed77ea4 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 29 十月 2025 15:56:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao

---
 admin/src/components/business/cabinetDetails.vue |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/admin/src/components/business/cabinetDetails.vue b/admin/src/components/business/cabinetDetails.vue
index d2c5248..f1bb5d4 100644
--- a/admin/src/components/business/cabinetDetails.vue
+++ b/admin/src/components/business/cabinetDetails.vue
@@ -6,8 +6,8 @@
         :withFooter="false"
     >
         <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
-            <el-form-item label="閽ュ寵" prop="keyCode">
-                <el-input v-model="searchForm.keyCode" placeholder="璇疯緭鍏ラ挜鍖欑紪鐮佹垨鍚嶇О" @keypress.enter.native="getList"></el-input>
+            <el-form-item label="閽ュ寵缂栫爜" prop="keyCode">
+                <el-input v-model="searchForm.keyCode" placeholder="璇疯緭鍏ラ挜鍖欑紪鐮�" @keypress.enter.native="getList"></el-input>
             </el-form-item>
             <el-form-item label="鐘舵��" prop="status">
                 <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨" @change="getList">
@@ -37,7 +37,9 @@
             v-loading="loading"
             :data="list"
             stripe
+            @selection-change="handleSelectionChange"
         >
+            <el-table-column type="selection" width="55"></el-table-column>
             <el-table-column prop="code" label="鏌滄牸缂栫爜" min-width="100px"></el-table-column>
             <el-table-column prop="cabinetName" label="鎵�灞為挜鍖欐煖" min-width="100px"></el-table-column>
             <el-table-column prop="keyId" label="缁戝畾閽ュ寵" min-width="100px">
@@ -104,6 +106,7 @@
       return {
         id: null,
         info: null,
+        ids: [],
         searchForm: {
           keyCode: '',
           status: '',
@@ -118,9 +121,17 @@
       open (title, id) {
         this.title = title
         this.id = id
+        this.searchForm = {
+          keyCode: '',
+          status: '',
+          bindStatus: ''
+        }
         this.getList()
         this.getKeysAll()
         this.visible = true
+      },
+      handleSelectionChange(e) {
+        this.ids = e.map(item => item.id)
       },
       getKeysAll() {
         list({  })
@@ -135,8 +146,20 @@
         if (type === 1) {
           obj.keyId = row.keyId
         } else if (type === 2) {
+          if (!row.boardCode) return
+          if (!/^[1-9]\d*$/.test(row.boardCode)) {
+            this.$message.warning('鍙兘杈撳叆姝f暣鏁�')
+            row.boardCode = ''
+            return
+          }
           obj.boardCode = row.boardCode
         } else if (type === 3) {
+          if (!row.channelCode) return
+          if (!/^[1-9]\d*$/.test(row.channelCode)) {
+            this.$message.warning('鍙兘杈撳叆姝f暣鏁�')
+            row.channelCode = ''
+            return
+          }
           obj.channelCode = row.channelCode
         }
         updateById(obj)
@@ -153,7 +176,7 @@
           cancelButtonText: '鍙栨秷',
           type: 'warning'
         }).then(() => {
-          unBindKeys(this.list.map(item => item.id))
+          unBindKeys(this.ids)
             .then(res => {
               this.getList()
             })
@@ -172,9 +195,9 @@
         this.getList()
       },
       reset() {
-        this.searchForm.keyId = ''
+        this.searchForm.keyCode = ''
         this.searchForm.status = ''
-        this.searchForm.workingStatus = ''
+        this.searchForm.bindStatus = ''
         this.getList()
       },
       getList() {
@@ -186,6 +209,7 @@
             cabinetId: this.id,
             keyId: this.searchForm.keyId,
             status: this.searchForm.status,
+            bindStatus: this.searchForm.bindStatus,
             workingStatus: this.searchForm.workingStatus
           }
         }).then(res => {

--
Gitblit v1.9.3