|
160 | 160 | <span class="footer-panel-title"> |
161 | 161 | {{ footerPanel === 'search' ? '网页源代码搜索' : rawPanelTitle }} |
162 | 162 | </span> |
163 | | - <RippleButton class="footer-panel-close" title="关闭面板" @click="closeFooterPanel"> |
164 | | - <X :size="14" :stroke-width="2" /> |
165 | | - </RippleButton> |
| 163 | + <div class="footer-panel-actions"> |
| 164 | + <RippleButton v-if="footerPanel === 'raw'" class="footer-panel-copy" title="复制原始线索" @click="copyRawOutput"> |
| 165 | + <Copy :size="12" :stroke-width="2" /> |
| 166 | + </RippleButton> |
| 167 | + <RippleButton class="footer-panel-close" title="关闭面板" @click="closeFooterPanel"> |
| 168 | + <X :size="14" :stroke-width="2" /> |
| 169 | + </RippleButton> |
| 170 | + </div> |
166 | 171 | </header> |
167 | 172 | <div v-if="footerPanel === 'search'" class="footer-panel-body"> |
168 | 173 | <div class="search-row"> |
|
666 | 671 | } |
667 | 672 | } |
668 | 673 |
|
| 674 | + const copyRawOutput = async () => { |
| 675 | + const text = rawOutputText.value |
| 676 | + if (!text || text === RAW_PLACEHOLDER || text === RAW_LOADING_TEXT) { |
| 677 | + setStatus('暂无可复制的原始线索。') |
| 678 | + return |
| 679 | + } |
| 680 | + try { |
| 681 | + await navigator.clipboard.writeText(text) |
| 682 | + setStatus('已复制原始线索。') |
| 683 | + } catch (error: any) { |
| 684 | + setStatus(`复制失败:${String(error?.message || error)}`) |
| 685 | + } |
| 686 | + } |
| 687 | +
|
669 | 688 | const getRawResult = async () => { |
670 | 689 | if (state.rawLoaded) return state.rawResult |
671 | 690 | const tabId = state.currentTabId || (await getActiveTabId()) |
|
1588 | 1607 | text-transform: uppercase; |
1589 | 1608 | } |
1590 | 1609 |
|
1591 | | - .footer-panel-close { |
| 1610 | + .footer-panel-actions { |
| 1611 | + display: inline-flex; |
| 1612 | + flex-shrink: 0; |
| 1613 | + gap: 4px; |
| 1614 | + } |
| 1615 | +
|
| 1616 | + .footer-panel-close, |
| 1617 | + .footer-panel-copy { |
1592 | 1618 | align-items: center; |
1593 | 1619 | background: transparent; |
1594 | 1620 | border: 0; |
|
1605 | 1631 | width: 22px; |
1606 | 1632 | } |
1607 | 1633 |
|
1608 | | - .footer-panel-close:hover { |
| 1634 | + .footer-panel-close:hover, |
| 1635 | + .footer-panel-copy:hover { |
1609 | 1636 | background: var(--accent-soft); |
1610 | 1637 | color: var(--accent); |
1611 | 1638 | } |
|
0 commit comments