|
57 | 57 | <div v-html="renderedMarkdown"></div> |
58 | 58 | <div v-if="!inResponse" class="footer-btn"> |
59 | 59 | <a-tooltip placement="top" :title="$t('common.copy')"> |
60 | | - <span class="icon-style" @click="handleCopy()"> |
| 60 | + <span class="icon-style" @click="handleCopyResponses()"> |
61 | 61 | <CopyOutlined /></span |
62 | 62 | ></a-tooltip> |
63 | 63 | <a-tooltip |
|
111 | 111 | <a-button shape="round" @click="handleCancel"> |
112 | 112 | {{ $t("common.cancel") }} |
113 | 113 | </a-button> |
114 | | - <a-button type="primary" shape="round" @click="handleSend"> |
| 114 | + <a-button |
| 115 | + type="primary" |
| 116 | + shape="round" |
| 117 | + @click="handleSend" |
| 118 | + :disabled="!queryInput" |
| 119 | + > |
115 | 120 | {{ $t("common.send") }} |
116 | 121 | </a-button> |
117 | 122 | </div> |
|
142 | 147 | {{ message.content }} |
143 | 148 | <div class="footer-btn"> |
144 | 149 | <a-tooltip placement="top" :title="$t('common.copy')"> |
145 | | - <span class="icon-style" @click="handleCopy()"> |
| 150 | + <span class="icon-style" @click="handleCopyQuery()"> |
146 | 151 | <CopyOutlined /></span |
147 | 152 | ></a-tooltip> |
148 | 153 | <a-tooltip |
@@ -292,16 +297,21 @@ const handleRegenerate = () => { |
292 | 297 | if (!query) return; |
293 | 298 | emit("regenerate", query); |
294 | 299 | }; |
295 | | -const handleCopy = async () => { |
| 300 | +const handleCopyQuery = async () => { |
| 301 | + await copy(queryInput.value); |
| 302 | +}; |
| 303 | +const handleCopyResponses = async () => { |
296 | 304 | await copy(readResponse.value); |
297 | 305 | }; |
298 | 306 | const handleEdit = () => { |
| 307 | + queryInput.value = props.message.content; |
299 | 308 | editState.value = true; |
300 | 309 | }; |
301 | 310 | const handleCancel = () => { |
302 | 311 | editState.value = false; |
303 | 312 | }; |
304 | 313 | const handleSend = () => { |
| 314 | + if (!queryInput.value) return; |
305 | 315 | emit("resend", { index: props.messageIndex, query: queryInput.value }); |
306 | 316 | handleCancel(); |
307 | 317 | }; |
@@ -422,7 +432,7 @@ watch( |
422 | 432 | z-index: 20; |
423 | 433 | opacity: 0; |
424 | 434 | visibility: hidden; |
425 | | - transition: opacity 0.3s ease, visibility 0s linear 2s; /* 关键:延迟 visibility 变化 */ |
| 435 | + transition: opacity 0.3s ease, visibility 0s linear 2s; |
426 | 436 | gap: 8px; |
427 | 437 | .anticon { |
428 | 438 | cursor: pointer; |
|
0 commit comments