|
18 | 18 | > |
19 | 19 | <template #top> |
20 | 20 | <div class="compact-actions"> |
21 | | - <a-input-search |
22 | | - v-model:value="searchInput" |
23 | | - placeholder="搜索实体" |
24 | | - style="width: 200px" |
25 | | - @search="onSearch" |
26 | | - allow-clear |
27 | | - /> |
28 | | - <a-button |
29 | | - type="text" |
30 | | - :icon="h(ReloadOutlined)" |
31 | | - :loading="graph.fetching" |
32 | | - @click="loadGraph" |
33 | | - title="刷新" |
34 | | - /> |
35 | | - <a-button |
36 | | - type="text" |
37 | | - :icon="h(SettingOutlined)" |
38 | | - @click="showSettings = true" |
39 | | - title="设置" |
40 | | - /> |
| 21 | + <div class="actions-left"> |
| 22 | + <a-input |
| 23 | + v-model:value="searchInput" |
| 24 | + placeholder="搜索实体" |
| 25 | + style="width: 240px" |
| 26 | + @keydown.enter="onSearch" |
| 27 | + allow-clear |
| 28 | + > |
| 29 | + <template #suffix> |
| 30 | + <component :is="graph.fetching ? LoadingOutlined : SearchOutlined" @click="onSearch" /> |
| 31 | + </template> |
| 32 | + </a-input> |
| 33 | + <a-button |
| 34 | + class="action-btn" |
| 35 | + :icon="h(ReloadOutlined)" |
| 36 | + :loading="graph.fetching" |
| 37 | + @click="loadGraph" |
| 38 | + title="刷新" |
| 39 | + /> |
| 40 | + </div> |
| 41 | + <div class="actions-right"> |
| 42 | + <a-button |
| 43 | + class="action-btn" |
| 44 | + :icon="h(SettingOutlined)" |
| 45 | + @click="showSettings = true" |
| 46 | + title="设置" |
| 47 | + /> |
| 48 | + </div> |
41 | 49 | </div> |
42 | 50 | </template> |
43 | 51 | </GraphCanvas> |
|
94 | 102 | <script setup> |
95 | 103 | import { ref, computed, watch, nextTick, onUnmounted, reactive, h } from 'vue'; |
96 | 104 | import { useDatabaseStore } from '@/stores/database'; |
97 | | -import { ReloadOutlined, SettingOutlined } from '@ant-design/icons-vue'; |
| 105 | +import { ReloadOutlined, SettingOutlined, SearchOutlined, LoadingOutlined } from '@ant-design/icons-vue'; |
98 | 106 | import GraphCanvas from '@/components/GraphCanvas.vue'; |
99 | 107 | import GraphDetailPanel from '@/components/GraphDetailPanel.vue'; |
100 | 108 | import { getKbTypeLabel } from '@/utils/kb_utils'; |
@@ -241,14 +249,59 @@ onUnmounted(() => { |
241 | 249 | position: absolute; |
242 | 250 | top: 10px; |
243 | 251 | left: 10px; |
| 252 | + right: 10px; |
244 | 253 | display: flex; |
| 254 | + justify-content: space-between; |
245 | 255 | align-items: center; |
246 | | - gap: 8px; |
247 | | - background: var(--color-trans-light); |
248 | | - backdrop-filter: blur(4px); |
249 | | - padding: 6px; |
250 | | - border-radius: 8px; |
251 | | - box-shadow: 0 0px 4px var(--shadow-3); |
| 256 | + pointer-events: none; /* Let clicks pass through empty areas */ |
| 257 | +
|
| 258 | + .actions-left, .actions-right { |
| 259 | + pointer-events: auto; /* Re-enable clicks for buttons/inputs */ |
| 260 | + display: flex; |
| 261 | + align-items: center; |
| 262 | + gap: 4px; |
| 263 | + background: var(--color-trans-light); |
| 264 | + backdrop-filter: blur(4px); |
| 265 | + padding: 2px; |
| 266 | + border-radius: 8px; |
| 267 | + box-shadow: 0 0px 4px var(--shadow-3); |
| 268 | + } |
| 269 | +
|
| 270 | + :deep(.ant-input-affix-wrapper) { |
| 271 | + padding: 4px 11px; |
| 272 | + border-radius: 6px; |
| 273 | + border-color: transparent; |
| 274 | + box-shadow: none; |
| 275 | + background: rgba(255, 255, 255, 0.6); |
| 276 | +
|
| 277 | + &:hover, &:focus, &-focused { |
| 278 | + background: #fff; |
| 279 | + border-color: var(--primary-color); |
| 280 | + } |
| 281 | +
|
| 282 | + input { |
| 283 | + background: transparent; |
| 284 | + } |
| 285 | + } |
| 286 | +
|
| 287 | + .action-btn { |
| 288 | + width: 32px; |
| 289 | + height: 32px; |
| 290 | + padding: 0; |
| 291 | + display: flex; |
| 292 | + align-items: center; |
| 293 | + justify-content: center; |
| 294 | + border: none; |
| 295 | + background: transparent; |
| 296 | + color: var(--gray-600); |
| 297 | + border-radius: 6px; |
| 298 | + box-shadow: none; |
| 299 | +
|
| 300 | + &:hover { |
| 301 | + background: rgba(0, 0, 0, 0.05); |
| 302 | + color: var(--primary-color); |
| 303 | + } |
| 304 | + } |
252 | 305 | } |
253 | 306 |
|
254 | 307 | .graph-disabled { |
|
0 commit comments