From ee53cfaffb30751dbade9008d482269d62147917 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期六, 25 四月 2026 07:54:06 +0800
Subject: [PATCH] #日志采集功能优化V3.0.0.9

---
 src/main/webapp/components/DevpCard.js |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/main/webapp/components/DevpCard.js b/src/main/webapp/components/DevpCard.js
index e5c8bbb..d0b78f5 100644
--- a/src/main/webapp/components/DevpCard.js
+++ b/src/main/webapp/components/DevpCard.js
@@ -5,9 +5,9 @@
     <div class="mc-root">
       <div class="mc-toolbar">
         <div class="mc-title">杈撻�佺洃鎺�</div>
-        <div v-if="!readOnly" class="mc-search">
+        <div v-if="showSearch" class="mc-search">
           <input class="mc-input" v-model="searchStationId" placeholder="璇疯緭鍏ョ珯鍙�" />
-          <button type="button" class="mc-btn mc-btn-ghost" @click="getDevpStateInfo">鏌ヨ</button>
+          <button type="button" class="mc-btn mc-btn-ghost" @click="handleSearch">鏌ヨ</button>
         </div>
       </div>
 
@@ -109,7 +109,8 @@
     param: { type: Object, default: function () { return {}; } },
     items: { type: Array, default: null },
     autoRefresh: { type: Boolean, default: true },
-    readOnly: { type: Boolean, default: false }
+    readOnly: { type: Boolean, default: false },
+    showSearchInReadOnly: { type: Boolean, default: false }
   },
   data: function () {
     return {
@@ -131,6 +132,9 @@
     };
   },
   computed: {
+    showSearch: function () {
+      return !this.readOnly || this.showSearchInReadOnly;
+    },
     sourceList: function () {
       return Array.isArray(this.items) ? this.items : this.stationList;
     },
@@ -154,6 +158,9 @@
   watch: {
     items: function () {
       this.afterDataRefresh();
+    },
+    searchStationId: function () {
+      this.applySearchFilter();
     },
     param: {
       deep: true,
@@ -203,10 +210,14 @@
     toggleItem: function (item) {
       var next = String(item.stationId);
       this.activeNames = this.activeNames === next ? "" : next;
+      this.$emit('item-select', this.activeNames ? (item || null) : null);
     },
     focusStation: function (stationId) {
-      this.searchStationId = String(stationId);
-      var index = this.filteredStationList.findIndex(function (item) {
+      if (!this.readOnly) {
+        this.searchStationId = String(stationId);
+      }
+      var targetList = this.readOnly ? this.sourceList : this.filteredStationList;
+      var index = targetList.findIndex(function (item) {
         return String(item.stationId) === String(stationId);
       });
       this.currentPage = index >= 0 ? Math.floor(index / this.pageSize) + 1 : 1;
@@ -231,6 +242,17 @@
       }
       this.currentPage = page;
     },
+    applySearchFilter: function () {
+      this.currentPage = 1;
+      this.afterDataRefresh();
+    },
+    handleSearch: function () {
+      if (this.readOnly) {
+        this.applySearchFilter();
+        return;
+      }
+      this.getDevpStateInfo();
+    },
     getDevpStateInfo: function () {
       if (this.$root && this.$root.sendWs) {
         this.$root.sendWs(JSON.stringify({

--
Gitblit v1.9.1